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.
372 lines
1.0 MiB
372 lines
1.0 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[51,5,6,7,9],{"+NIl":function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){"use strict";le.defineMode("stex",function(q,L){"use strict";function J(R,A){R.cmdState.push(A)}function B(R){return R.cmdState.length>0?R.cmdState[R.cmdState.length-1]:null}function M(R){var A=R.cmdState.pop();A&&A.closeBracket()}function G(R){for(var A=R.cmdState,S=A.length-1;S>=0;S--){var c=A[S];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function F(R,A,S){return function(){this.name=R,this.bracketNo=0,this.style=A,this.styles=S,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=F("importmodule","tag",["string","builtin"]),P.documentclass=F("documentclass","tag",["","atom"]),P.usepackage=F("usepackage","tag",["atom"]),P.begin=F("begin","tag",["atom"]),P.end=F("end","tag",["atom"]),P.label=F("label","tag",["atom"]),P.ref=F("ref","tag",["atom"]),P.eqref=F("eqref","tag",["atom"]),P.cite=F("cite","tag",["atom"]),P.bibitem=F("bibitem","tag",["atom"]),P.Bibitem=F("Bibitem","tag",["atom"]),P.RBibitem=F("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function k(R,A){R.f=A}function y(R,A){var S;if(R.match(/^\\[a-zA-Z@]+/)){var c=R.current().slice(1);return S=P.hasOwnProperty(c)?P[c]:P.DEFAULT,S=new S,J(A,S),k(A,O),S.style}if(R.match(/^\\[$&%#{}_]/))return"tag";if(R.match(/^\\[,;!\/\\]/))return"tag";if(R.match("\\["))return k(A,function(u,h){return C(u,h,"\\]")}),"keyword";if(R.match("\\("))return k(A,function(u,h){return C(u,h,"\\)")}),"keyword";if(R.match("$$"))return k(A,function(u,h){return C(u,h,"$$")}),"keyword";if(R.match("$"))return k(A,function(u,h){return C(u,h,"$")}),"keyword";var s=R.next();if(s=="%")return R.skipToEnd(),"comment";if(s=="}"||s=="]"){if(S=B(A),S)S.closeBracket(s),k(A,O);else return"error";return"bracket"}else return s=="{"||s=="["?(S=P.DEFAULT,S=new S,J(A,S),"bracket"):/\d/.test(s)?(R.eatWhile(/[\w.%]/),"atom"):(R.eatWhile(/[\w\-_]/),S=G(A),S.name=="begin"&&(S.argument=R.current()),S.styleIdentifier())}function C(R,A,S){if(R.eatSpace())return null;if(S&&R.match(S))return k(A,y),"keyword";if(R.match(/^\\[a-zA-Z@]+/))return"tag";if(R.match(/^[a-zA-Z]+/))return"variable-2";if(R.match(/^\\[$&%#{}_]/))return"tag";if(R.match(/^\\[,;!\/]/))return"tag";if(R.match(/^[\^_&]/))return"tag";if(R.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(R.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=R.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(R.skipToEnd(),"comment"):"error"}function O(R,A){var S=R.peek(),c;return S=="{"||S=="["?(c=B(A),c.openBracket(S),R.eat(S),k(A,y),"bracket"):/[ \t\r]/.test(S)?(R.eat(S),null):(k(A,y),M(A),y(R,A))}return{startState:function(){var R=L.inMathMode?function(A,S){return C(A,S)}:y;return{cmdState:[],f:R}},copyState:function(R){return{cmdState:R.cmdState.slice(),f:R.f}},token:function(R,A){return A.f(R,A)},blankLine:function(R){R.f=y,R.cmdState.length=0},lineComment:"%"}}),le.defineMIME("text/x-stex","stex"),le.defineMIME("text/x-latex","stex")})},"/GNS":function(Ke,Ie,Z){Ke.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){le.defineOption("placeholder","",function(F,P,k){var y=k&&k!=le.Init;if(P&&!y)F.on("blur",B),F.on("change",M),F.on("swapDoc",M),le.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){J(F)}),M(F);else if(!P&&y){F.off("blur",B),F.off("change",M),F.off("swapDoc",M),le.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),q(F);var C=F.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}P&&!F.hasFocus()&&B(F)});function q(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function L(F){q(F);var P=F.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=F.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var k=F.getOption("placeholder");typeof k=="string"&&(k=document.createTextNode(k)),P.appendChild(k),F.display.lineSpace.insertBefore(P,F.display.lineSpace.firstChild)}function J(F){setTimeout(function(){var P=!1,k=F.getInputField();k.nodeName=="TEXTAREA"?P=!k.value:F.lineCount()==1&&(P=!/[^\u200b]/.test(k.querySelector(".CodeMirror-line").textContent)),P?L(F):q(F)},20)}function B(F){G(F)&&L(F)}function M(F){var P=F.getWrapperElement(),k=G(F);P.className=P.className.replace(" CodeMirror-empty","")+(k?" CodeMirror-empty":""),k?L(F):q(F)}function G(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){"use strict";var q={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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};le.defineMode("xml",function(J,B){var M=J.indentUnit,G={},F=B.htmlMode?q:L;for(var P in F)G[P]=F[P];for(var P in B)G[P]=B[P];var k,y;function C(o,E){function b(U){return E.tokenize=U,U(o,E)}var x=o.next();if(x=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?b(A("atom","]]>")):null:o.match("--")?b(A("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),b(S(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),E.tokenize=A("meta","?>"),"meta"):(k=o.eat("/")?"closeTag":"openTag",E.tokenize=O,"tag bracket");if(x=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}C.isInText=!0;function O(o,E){var b=o.next();if(b==">"||b=="/"&&o.eat(">"))return E.tokenize=C,k=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return k="equals",null;if(b=="<"){E.tokenize=C,E.state=h,E.tagName=E.tagStart=null;var x=E.tokenize(o,E);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(b)?(E.tokenize=R(b),E.stringStartCol=o.column(),E.tokenize(o,E)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function R(o){var E=function(b,x){for(;!b.eol();)if(b.next()==o){x.tokenize=O;break}return"string"};return E.isInAttribute=!0,E}function A(o,E){return function(b,x){for(;!b.eol();){if(b.match(E)){x.tokenize=C;break}b.next()}return o}}function S(o){return function(E,b){for(var x;(x=E.next())!=null;){if(x=="<")return b.tokenize=S(o+1),b.tokenize(E,b);if(x==">")if(o==1){b.tokenize=C;break}else return b.tokenize=S(o-1),b.tokenize(E,b)}return"meta"}}function c(o,E,b){this.prev=o.context,this.tagName=E,this.indent=o.indented,this.startOfLine=b,(G.doNotIndent.hasOwnProperty(E)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function s(o){o.context&&(o.context=o.context.prev)}function u(o,E){for(var b;;){if(!o.context)return;if(b=o.context.tagName,!G.contextGrabbers.hasOwnProperty(b)||!G.contextGrabbers[b].hasOwnProperty(E))return;s(o)}}function h(o,E,b){return o=="openTag"?(b.tagStart=E.column(),T):o=="closeTag"?p:h}function T(o,E,b){return o=="word"?(b.tagName=E.current(),y="tag",v):G.allowMissingTagName&&o=="endTag"?(y="tag bracket",v(o,E,b)):(y="error",T)}function p(o,E,b){if(o=="word"){var x=E.current();return b.context&&b.context.tagName!=x&&G.implicitlyClosed.hasOwnProperty(b.context.tagName)&&s(b),b.context&&b.context.tagName==x||G.matchClosing===!1?(y="tag",f):(y="tag error",D)}else return G.allowMissingTagName&&o=="endTag"?(y="tag bracket",f(o,E,b)):(y="error",D)}function f(o,E,b){return o!="endTag"?(y="error",f):(s(b),h)}function D(o,E,b){return y="error",f(o,E,b)}function v(o,E,b){if(o=="word")return y="attribute",m;if(o=="endTag"||o=="selfcloseTag"){var x=b.tagName,N=b.tagStart;return b.tagName=b.tagStart=null,o=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(x)?u(b,x):(u(b,x),b.context=new c(b,x,N==b.indented)),h}return y="error",v}function m(o,E,b){return o=="equals"?a:(G.allowMissing||(y="error"),v(o,E,b))}function a(o,E,b){return o=="string"?d:o=="word"&&G.allowUnquoted?(y="string",v):(y="error",v(o,E,b))}function d(o,E,b){return o=="string"?d:v(o,E,b)}return{startState:function(o){var E={tokenize:C,state:h,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(E.baseIndent=o),E},token:function(o,E){if(!E.tagName&&o.sol()&&(E.indented=o.indentation()),o.eatSpace())return null;k=null;var b=E.tokenize(o,E);return(b||k)&&b!="comment"&&(y=null,E.state=E.state(k||b,o,E),y&&(b=y=="error"?b+" error":y)),b},indent:function(o,E,b){var x=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+M;if(x&&x.noIndent)return le.Pass;if(o.tokenize!=O&&o.tokenize!=C)return b?b.match(/^(\s*)/)[0].length:0;if(o.tagName)return G.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+M*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var N=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(N&&N[1])for(;x;)if(x.tagName==N[2]){x=x.prev;break}else if(G.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(N)for(;x;){var U=G.contextGrabbers[x.tagName];if(U&&U.hasOwnProperty(N[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+M:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(o){o.state==a&&(o.state=v)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var E=[],b=o.context;b;b=b.prev)b.tagName&&E.push(b.tagName);return E.reverse()}}}),le.defineMIME("text/xml","xml"),le.defineMIME("application/xml","xml"),le.mimeModes.hasOwnProperty("text/html")||le.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4qgm":function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70Y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),y=Z("DZo9"),C=Z("8z0m"),O=Z("WmNS"),R=Z.n(O),A=Z("q1tI"),S=Z.n(A),c=Z("m3rI"),s=Z("wzkS"),u=Z("y5JW"),h=Z("LtfV"),T=C.a.Dragger;function p(f){var D=[];return f&&f.length>0&&(D=f.map(function(v){return{uid:v.id,id:v.id,name:v.title+u.c+v.filesize,url:v.url,filesize:v.filesize,status:"done",response:{id:v.id}}})),D}Ie.b=function(f){var D=f.value,v=f.onChange,m=f.action,a=f.className,d=f.maxSize,o=d===void 0?150:d,E=f.title,b=E===void 0?"\u4E0A\u4F20\u9644\u4EF6":E,x=f.showRemoveModal,N=x===void 0?!1:x,U=f.accept,K=U===void 0?"":U,V=f.additionalText,_=f.isDragger,I=f.number,Y=I===void 0?1e3:I,ee=f.aloneClear,oe=ee===void 0?!1:ee,he=f.restrict,Le=he===void 0?!0:he,xe=Object(A.useState)(!1),Ae=Object(k.a)(xe,2),Te=Ae[0],Ce=Ae[1],pe=Object(A.useState)(D||[]),de=Object(k.a)(pe,2),re=de[0],ce=de[1];Object(A.useEffect)(function(){D&&(ce(Object(P.a)(D)),Y===(D==null?void 0:D.length)&&Ce(!0))},[D]);var ae=function(){setTimeout(function(){re.pop(),ce(Object(P.a)(re))},500)},we={multiple:!0,disabled:Te,accept:K,withCredentials:!0,fileList:re,beforeUpload:function(Me,Pe){var Ne=Me.size/1024/1024;return re.concat(Pe).length>Y?(re.pop(),ce(Object(P.a)(re)),F.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(Y,"\u4E2A\u6587\u4EF6")),oe?Promise.reject():(ae(),!1)):Ne<o?!0:(F.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(o,"MB).")),oe?Promise.reject():(ae(),!1))},action:m||"".concat(c.a.API_SERVER,"/api/attachments.json"),onChange:function(Me){var Pe=Object(P.a)(Me.fileList);Pe.length>=Y?Ce(!0):Ce(!1),ce(Object(P.a)(Pe)),Pe=Pe.map(function(Ne){var Fe;if(Ne!=null&&(Fe=Ne.response)!==null&&Fe!==void 0&&Fe.id){var Be;Ne.url="/api/attachments/".concat(Ne==null||((Be=Ne.response)===null||Be===void 0)?void 0:Be.id)}return Ne.name.indexOf(u.c)===-1&&(Ne.name="".concat(Ne.name).concat(u.c).concat(Object(u.a)(Ne.size))),Object(M.a)({},Ne)}),console.log("info:",Me),v(Pe)},onRemove:function(){var ye=Object(B.a)(R.a.mark(function Pe(Ne){var Fe;return R.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(Fe=function(){var nt=Object(B.a)(R.a.mark(function it(){var $e,tt;return R.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if($e=Ne.response?Ne.response.id:Ne.id,!$e){et.next=8;break}return et.next=4,Object(s.d)(Ne.response?Ne.response.id:Ne.uid);case 4:return tt=et.sent,et.abrupt("return",tt);case 8:return et.abrupt("return",!0);case 9:case"end":return et.stop()}},it)}));return function(){return nt.apply(this,arguments)}}(),!N){Ue.next=5;break}return Ue.abrupt("return",new Promise(function(nt,it){J.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:S.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var $e=Object(B.a)(R.a.mark(function ct(){var et;return R.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,Fe();case 2:et=Oe.sent,F.b.success("\u5220\u9664\u6210\u529F"),nt(!0);case 5:case"end":return Oe.stop()}},ct)}));function tt(){return $e.apply(this,arguments)}return tt}(),onCancel:function(){return nt(!1)}})}));case 5:return Ue.next=7,Fe();case 7:return Ue.abrupt("return",Ue.sent);case 8:case"end":return Ue.stop()}},Pe)}));function Me(Pe){return ye.apply(this,arguments)}return Me}()};function De(ye){ye.preventDefault(),ye.stopPropagation()}return S.a.createElement("div",{className:"multi-upload ".concat(a||"")},_&&S.a.createElement(T,we,S.a.createElement("p",{className:"ant-upload-drag-icon"},S.a.createElement(h.a,null)),S.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",S.a.createElement("br",null),S.a.createElement("span",{style:{display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",o,"MB) ")),V),!_&&S.a.createElement(C.a,we,S.a.createElement(q.a,{disabled:Te},b),S.a.createElement("span",{onClick:De,style:{marginLeft:10,color:"#FA6400",display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",o,"MB) ")))}},"55Ip":function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return u}),Z.d(Ie,"b",function(){return v});var le=Z("Ty5D"),q=Z("dI71"),L=Z("q1tI"),J=Z.n(L),B=Z("YS25"),M=Z("17x9"),G=Z.n(M),F=Z("wx14"),P=Z("zLVn"),k=Z("9R94"),y=function(a){Object(q.a)(d,a);function d(){for(var E,b=arguments.length,x=new Array(b),N=0;N<b;N++)x[N]=arguments[N];return E=a.call.apply(a,[this].concat(x))||this,E.history=Object(B.a)(E.props),E}var o=d.prototype;return o.render=function(){return J.a.createElement(le.c,{history:this.history,children:this.props.children})},d}(J.a.Component),C=function(a){Object(q.a)(d,a);function d(){for(var E,b=arguments.length,x=new Array(b),N=0;N<b;N++)x[N]=arguments[N];return E=a.call.apply(a,[this].concat(x))||this,E.history=Object(B.b)(E.props),E}var o=d.prototype;return o.render=function(){return J.a.createElement(le.c,{history:this.history,children:this.props.children})},d}(J.a.Component),O=function(d,o){return typeof d=="function"?d(o):d},R=function(d,o){return typeof d=="string"?Object(B.c)(d,null,null,o):d},A=function(d){return d},S=J.a.forwardRef;typeof S=="undefined"&&(S=A);function c(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}var s=S(function(a,d){var o=a.innerRef,E=a.navigate,b=a.onClick,x=Object(P.a)(a,["innerRef","navigate","onClick"]),N=x.target,U=Object(F.a)({},x,{onClick:function(V){try{b&&b(V)}catch(_){throw V.preventDefault(),_}!V.defaultPrevented&&V.button===0&&(!N||N==="_self")&&!c(V)&&(V.preventDefault(),E())}});return A!==S?U.ref=d||o:U.ref=o,J.a.createElement("a",U)}),u=S(function(a,d){var o=a.component,E=o===void 0?s:o,b=a.replace,x=a.to,N=a.innerRef,U=Object(P.a)(a,["component","replace","to","innerRef"]);return J.a.createElement(le.e.Consumer,null,function(K){K||Object(k.a)(!1);var V=K.history,_=R(O(x,K.location),K.location),I=_?V.createHref(_):"",Y=Object(F.a)({},U,{href:I,navigate:function(){var oe=O(x,K.location),he=b?V.replace:V.push;he(oe)}});return A!==S?Y.ref=d||N:Y.innerRef=N,J.a.createElement(E,Y)})});if(!1)var h,T;var p=function(d){return d},f=J.a.forwardRef;typeof f=="undefined"&&(f=p);function D(){for(var a=arguments.length,d=new Array(a),o=0;o<a;o++)d[o]=arguments[o];return d.filter(function(E){return E}).join(" ")}var v=f(function(a,d){var o=a["aria-current"],E=o===void 0?"page":o,b=a.activeClassName,x=b===void 0?"active":b,N=a.activeStyle,U=a.className,K=a.exact,V=a.isActive,_=a.location,I=a.sensitive,Y=a.strict,ee=a.style,oe=a.to,he=a.innerRef,Le=Object(P.a)(a,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return J.a.createElement(le.e.Consumer,null,function(xe){xe||Object(k.a)(!1);var Ae=_||xe.location,Te=R(O(oe,Ae),Ae),Ce=Te.pathname,pe=Ce&&Ce.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),de=pe?Object(le.f)(Ae.pathname,{path:pe,exact:K,sensitive:I,strict:Y}):null,re=!!(V?V(de,Ae):de),ce=re?D(U,x):U,ae=re?Object(F.a)({},ee,{},N):ee,we=Object(F.a)({"aria-current":re&&E||null,className:ce,style:ae,to:Te},Le);return p!==f?we.ref=d||he:we.innerRef=he,J.a.createElement(u,we)})});if(!1)var m},"5D2P":function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Ke,Ie,Z){"use strict";var le=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),q=new Uint8Array(16);function L(){if(!le)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return le(q)}var J=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function B(O){return typeof O=="string"&&J.test(O)}for(var M=B,G=[],F=0;F<256;++F)G.push((F+256).toString(16).substr(1));function P(O){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(G[O[R+0]]+G[O[R+1]]+G[O[R+2]]+G[O[R+3]]+"-"+G[O[R+4]]+G[O[R+5]]+"-"+G[O[R+6]]+G[O[R+7]]+"-"+G[O[R+8]]+G[O[R+9]]+"-"+G[O[R+10]]+G[O[R+11]]+G[O[R+12]]+G[O[R+13]]+G[O[R+14]]+G[O[R+15]]).toLowerCase();if(!M(A))throw TypeError("Stringified UUID is invalid");return A}var k=P;function y(O,R,A){O=O||{};var S=O.random||(O.rng||L)();if(S[6]=S[6]&15|64,S[8]=S[8]&63|128,R){A=A||0;for(var c=0;c<16;++c)R[A+c]=S[c];return R}return k(S)}var C=Ie.a=y},"7ZXX":function(Ke,Ie,Z){Ke.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return T});var le=Z("k1fw"),q=Z("0Owb"),L=Z("+L6B"),J=Z("2/Rp"),B=Z("y8nQ"),M=Z("Vl3Y"),G=Z("tJVT"),F=Z("OaEy"),P=Z("2fM7"),k=Z("q1tI"),y=Z.n(k),C=Z("VrN/"),O=Z.n(C),R=Z("p77/"),A=Z.n(R),S=Z("c5Ni"),c=Z.n(S),s=P.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};Ie.b=function(p){var f=p.callback,D=p.onCancel,v=Object(k.useState)("python"),m=Object(G.a)(v,2),a=m[0],d=m[1];function o(b){d(h[b][1])}function E(b){f(b)}return y.a.createElement(M.a,Object(q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(P.a,{onChange:o},Object.keys(h).map(function(b){return y.a.createElement(s,{key:b,value:b},h[b][0])}))),y.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(T,{mode:a})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(J.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function T(p){var f=p.value,D=p.onChange,v=p.mode,m=p.options,a=m===void 0?{}:m,d=Object(k.useRef)(),o=Object(k.useState)(),E=Object(G.a)(o,2),b=E[0],x=E[1];return Object(k.useEffect)(function(){if(b){function N(U){var K=U.getValue();D&&D(K)}return b.on("change",N),function(){b.off("change",N)}}},[b,D]),Object(k.useEffect)(function(){b&&b.setOption("mode",v)},[b,v]),Object(k.useEffect)(function(){b&&((f!==b.getValue()||f==="")&&setTimeout(function(){b.setValue(f||" ")},300))},[b,f]),Object(k.useEffect)(function(){if(d.current&&!b){var N=O.a.fromTextArea(d.current,Object(le.a)({mode:v,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},a));x(N)}},[d.current,b]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:d}))}},"7v3h":function(Ke,Ie,Z){Ke.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Ke,Ie,Z){Ke.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){"use strict";le.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 q=0;q<le.modeInfo.length;q++){var L=le.modeInfo[q];L.mimes&&(L.mime=L.mimes[0])}le.findModeByMIME=function(J){J=J.toLowerCase();for(var B=0;B<le.modeInfo.length;B++){var M=le.modeInfo[B];if(M.mime==J)return M;if(M.mimes){for(var G=0;G<M.mimes.length;G++)if(M.mimes[G]==J)return M}}if(/\+xml$/.test(J))return le.findModeByMIME("application/xml");if(/\+json$/.test(J))return le.findModeByMIME("application/json")},le.findModeByExtension=function(J){J=J.toLowerCase();for(var B=0;B<le.modeInfo.length;B++){var M=le.modeInfo[B];if(M.ext){for(var G=0;G<M.ext.length;G++)if(M.ext[G]==J)return M}}},le.findModeByFileName=function(J){for(var B=0;B<le.modeInfo.length;B++){var M=le.modeInfo[B];if(M.file&&M.file.test(J))return M}var G=J.lastIndexOf("."),F=G>-1&&J.substring(G+1,J.length);if(F)return le.findModeByExtension(F)},le.findModeByName=function(J){J=J.toLowerCase();for(var B=0;B<le.modeInfo.length;B++){var M=le.modeInfo[B];if(M.name.toLowerCase()==J)return M;if(M.alias){for(var G=0;G<M.alias.length;G++)if(M.alias[G].toLowerCase()==J)return M}}}})},"8hTe":function(Ke,Ie,Z){Ke.exports={button:"button___1wy9m"}},"9Bee":function(Ke,Ie,Z){"use strict";var le=Z("DYRE"),q=Z("zeV3"),L=Z("+L6B"),J=Z("2/Rp"),B=Z("k1fw"),M=Z("9og8"),G=Z("tJVT"),F=Z("WmNS"),P=Z.n(F),k=Z("q1tI"),y=Z.n(k),C=Z("vg9a"),O=Z("DlQD"),R=Z.n(O),A=Z("rUJ1");function S(z,l){var g=z.match(/^(\s+)(?:```)/);if(g===null)return l;var W=g[1];return l.split(`
|
|
`).map(function(Q){var H=Q.match(/^\s+/);if(H===null)return Q;var me=Object(G.a)(H,1),Qe=me[0];return Qe.length>=W.length?Q.slice(W.length):Q}).join(`
|
|
`)}var c=[],s=["<ul>"],u=new R.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function T(){c.length=0,s=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(z,l,g,W){if(l>=z.length||z[l].level<=g)return l;var Q=z[l];W.push("<li><a href='#"+Q.anchor+"'>"+Q.text+"</a>"),l++;var H=[];return l=f(z,l,Q.level,H),H.length>0&&(W.push("<ul>"),H.forEach(function(me){W.push(me)}),W.push("</ul>")),W.push("</li>"),l=f(z,l,g,W),l}function D(){return f(c,0,0,s),s.push("</ul>"),s.join("")}var v={heading:function(l){var g=h.exec(l);if(g)return{type:"heading",raw:g[0],depth:g[1].length,text:g[2]}},fences:function(l){var g=this.rules.block.fences.exec(l);if(g){var W=g[0],Q=S(W,g[3]||""),H=g[2]?g[2].trim():g[2];if(["latex","katex","math"].indexOf(H)>=0){var me=d(),Qe=Q;Q=me,o[me]={type:"block",expression:Qe}}return{type:"code",raw:W,lang:H,text:Q}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,a=0,d=function(){return"__special_katext_id_".concat(a++,"__")},o={};function E(){return o}function b(){a=0,o={}}function x(z){return z=z.replace(m,function(l,g){var W=d();return o[W]={type:"inline",expression:g},W}),z}var N=u.listitem;u.listitem=function(z){return N(x(z))};var U=u.paragraph;u.paragraph=function(z){return U(x(z))};var K=u.tablecell;u.tablecell=function(z,l){return K(x(z),l)},u.code=function(z,l,g){var W=(l||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat(z,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(l,'">').concat(g?z:Object(A.escape)(z,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(g?z:Object(A.escape)(z,!0))+"</code></pre>"},u.heading=function(z,l,g){var W=this.options.headerPrefix+g.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:W,level:l,text:z}),"<h"+l+' id="'+W+'">'+z+"</h"+l+">"},R.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),R.a.use({tokenizer:v,renderer:u});var V=R.a,_=Z("SJMd"),I=Z("ulZh"),Y=Z.n(I),ee=Z("m3rI"),oe=Z("Oy/b"),he=Z("p5ED"),Le=Z("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var xe=function(z,l){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,W){g.__proto__=W}||function(g,W){for(var Q in W)Object.prototype.hasOwnProperty.call(W,Q)&&(g[Q]=W[Q])})(z,l)};function Ae(z,l){function g(){this.constructor=z}xe(z,l),z.prototype=l===null?Object.create(l):(g.prototype=l.prototype,new g)}function Te(z,l,g,W){return new(g||(g=Promise))(function(Q,H){function me(ft){try{Xe(W.next(ft))}catch(Je){H(Je)}}function Qe(ft){try{Xe(W.throw(ft))}catch(Je){H(Je)}}function Xe(ft){var Je;ft.done?Q(ft.value):(Je=ft.value,Je instanceof g?Je:new g(function(St){St(Je)})).then(me,Qe)}Xe((W=W.apply(z,l||[])).next())})}function Ce(z,l){var g,W,Q,H,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return H={next:Qe(0),throw:Qe(1),return:Qe(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function Qe(Xe){return function(ft){return function(Je){if(g)throw new TypeError("Generator is already executing.");for(;me;)try{if(g=1,W&&(Q=2&Je[0]?W.return:Je[0]?W.throw||((Q=W.return)&&Q.call(W),0):W.next)&&!(Q=Q.call(W,Je[1])).done)return Q;switch(W=0,Q&&(Je=[2&Je[0],Q.value]),Je[0]){case 0:case 1:Q=Je;break;case 4:return me.label++,{value:Je[1],done:!1};case 5:me.label++,W=Je[1],Je=[0];continue;case 7:Je=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Je[0]!==6&&Je[0]!==2)){me=0;continue}if(Je[0]===3&&(!Q||Je[1]>Q[0]&&Je[1]<Q[3])){me.label=Je[1];break}if(Je[0]===6&&me.label<Q[1]){me.label=Q[1],Q=Je;break}if(Q&&me.label<Q[2]){me.label=Q[2],me.ops.push(Je);break}Q[2]&&me.ops.pop(),me.trys.pop();continue}Je=l.call(z,me)}catch(St){Je=[6,St],W=0}finally{g=Q=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([Xe,ft])}}}function pe(){for(var z=0,l=0,g=arguments.length;l<g;l++)z+=arguments[l].length;var W=Array(z),Q=0;for(l=0;l<g;l++)for(var H=arguments[l],me=0,Qe=H.length;me<Qe;me++,Q++)W[Q]=H[me];return W}var de=function(){function z(){}return z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},z.setAttributes=function(l,g){for(var W=0,Q=g;W<Q.length;W++){var H=Q[W],me=H[0],Qe=H[1];l.setAttribute(me,Qe)}},z.createRect=function(l,g,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",l.toString()),Q.setAttribute("height",g.toString()),W&&z.setAttributes(Q,W),Q},z.createLine=function(l,g,W,Q,H){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",l.toString()),me.setAttribute("y1",g.toString()),me.setAttribute("x2",W.toString()),me.setAttribute("y2",Q.toString()),H&&z.setAttributes(me,H),me},z.createPolygon=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",l),g&&z.setAttributes(W,g),W},z.createCircle=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(l/2).toString()),W.setAttribute("cy",(l/2).toString()),W.setAttribute("r",l.toString()),g&&z.setAttributes(W,g),W},z.createEllipse=function(l,g,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(l/2).toString()),Q.setAttribute("cy",(g/2).toString()),Q.setAttribute("rx",(l/2).toString()),Q.setAttribute("ry",(g/2).toString()),W&&z.setAttributes(Q,W),Q},z.createGroup=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&z.setAttributes(g,l),g},z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},z.createMarker=function(l,g,W,Q,H,me,Qe){var Xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return z.setAttributes(Xe,[["id",l],["orient",g],["markerWidth",W.toString()],["markerHeight",Q.toString()],["refX",H.toString()],["refY",me.toString()]]),Xe.appendChild(Qe),Xe},z.createText=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","text");return g.setAttribute("x","0"),g.setAttribute("y","0"),l&&z.setAttributes(g,l),g},z.createTSpan=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=l,g&&z.setAttributes(W,g),W},z.createImage=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&z.setAttributes(g,l),g},z.createPoint=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=l,W.y=g,W},z.createPath=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",l),g&&z.setAttributes(W,g),W},z}(),re=function(){function z(){}return z.addKey=function(l){z.key=l},Object.defineProperty(z,"isLicensed",{get:function(){return!!z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(z.key)},enumerable:!1,configurable:!0}),z}(),ce=function(){function z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return z.prototype.rasterize=function(l,g,W){var Q=this;return new Promise(function(H){var me=W!==void 0?W:document.createElement("canvas");l===null&&(Q.markersOnly=!0,Q.naturalSize=!1);var Qe=document.createElementNS("http://www.w3.org/2000/svg","svg");Qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Qe.setAttribute("width",g.width.baseVal.valueAsString),Qe.setAttribute("height",g.height.baseVal.valueAsString),Qe.setAttribute("viewBox","0 0 "+g.viewBox.baseVal.width.toString()+" "+g.viewBox.baseVal.height.toString()),Qe.innerHTML=g.innerHTML,Q.naturalSize===!0?(Qe.width.baseVal.value=l.naturalWidth,Qe.height.baseVal.value=l.naturalHeight):Q.width!==void 0&&Q.height!==void 0&&(Qe.width.baseVal.value=Q.width,Qe.height.baseVal.value=Q.height),me.width=Qe.width.baseVal.value,me.height=Qe.height.baseVal.value;var Xe=Qe.outerHTML,ft=me.getContext("2d");Q.markersOnly!==!0&&ft.drawImage(l,0,0,me.width,me.height);var Je=window.URL,St=new Image(me.width,me.height);St.setAttribute("crossOrigin","anonymous");var It=new Blob([Xe],{type:"image/svg+xml"}),$t=Je.createObjectURL(It);St.onload=function(){ft.drawImage(St,0,0),Je.revokeObjectURL($t);var jr=me.toDataURL(Q.imageType,Q.imageQuality);H(jr)},St.src=$t})},z}(),ae=function(){},we=function(){function z(l){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),z.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},z.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},z.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new De("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ye("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ye("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},z.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},z}(),De=function(z,l){this.selector=z,this.style=l},ye=function(z,l){this.localName=z,this.style=l},Me=function(){function z(l,g,W,Q,H){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=l,this.displayMode=g,this.markerItems=W,this.uiStyleSettings=Q,this.styles=H,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return z.prototype.show=function(l){var g=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(W,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(H){var me=document.createElement("div");me.className=""+g.toolbarButtonStyleClass.name,me.setAttribute("data-type-name",H.typeName),me.innerHTML=H.icon,me.addEventListener("click",function(){g.markerToolbarButtonClicked(me,H)}),g.buttons.push(me),g.markerButtons.push(me)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",Q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},z.prototype.addButtonClickListener=function(l){this.buttonClickListeners.push(l)},z.prototype.removeButtonClickListener=function(l){this.buttonClickListeners.indexOf(l)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(l),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var l=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var g=0;g<this.markerButtons.length;g++)g<l||g===l&&this.markerButtons.length-1===l?this.markerButtonBlock.appendChild(this.markerButtons[g]):(g===l&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[g]))}},z.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},z.prototype.resetButtonStyles=function(){var l=this;this.buttons.forEach(function(g){g.className=g.className.replace(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name,"").trim(),g.className=g.className.replace(l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?l.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:l.toolbarActiveButtonStyleColorsClass.name,"").trim(),g.className+=" "+(l.uiStyleSettings.toolbarButtonStyleColorsClassName?l.uiStyleSettings.toolbarButtonStyleColorsClassName:l.toolbarButtonStyleColorsClass.name)})},z.prototype.addActionButton=function(l,g,W){var Q=this,H=document.createElement("div");switch(H.className=""+this.toolbarButtonStyleClass.name,H.innerHTML=g,H.setAttribute("data-action",W),H.addEventListener("click",function(){Q.actionToolbarButtonClicked(H,W)}),W){case"select":H.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":H.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":H.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":H.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":H.style.fill=this.uiStyleSettings.closeButtonColor}l.appendChild(H),this.buttons.push(H)},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ye("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 ye("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ye("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ye("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 ye("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var l=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ye("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},z.prototype.markerToolbarButtonClicked=function(l,g){this.setActiveButton(l),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",g)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(l,g){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",g)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.prototype.setActiveButton=function(l){this.resetButtonStyles(),l.className=l.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),l.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},z.prototype.setActiveMarkerButton=function(l){var g=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===l});g&&this.setActiveButton(g)},z.prototype.setCurrentMarker=function(l){var g=this;this.currentMarker=l,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){g.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},z}(),Pe=function(){function z(l,g,W,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=l,this.displayMode=g,this.uiStyleSettings=W,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var l;this.toolboxStyleClass=this.styles.addClass(new ye("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 ye("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var g=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ye("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ye("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ye("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 ye("toolbox-panel-row_colors",`
|
|
background-color: `+((l=this.uiStyleSettings.toolboxBackgroundColor)!==null&&l!==void 0?l:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ye("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
|
|
padding: `+g+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},z.prototype.show=function(l){var g;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolboxStyleClass.name+" "+((g=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(l){var g,W,Q=this;this.panels=l,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((g=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(H){var me;H.uiStyleSettings=Q.uiStyleSettings;var Qe=document.createElement("div");Qe.className=Q.toolboxButtonStyleClass.name+" "+((me=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:Q.toolboxButtonStyleColorsClass.name),Qe.innerHTML=H.icon,Qe.title=H.title,Qe.addEventListener("click",function(){Q.panelButtonClick(H)}),Q.panelButtons.push(Qe),Q.buttonRow.appendChild(Qe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(l){var g=this,W=-1;if(l!==this.activePanel){W=this.panels.indexOf(l),this.panelRow.innerHTML="";var Q=l.getUi();Q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=l}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){g.displayMode==="inline"?g.panelRow.style.display="none":g.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(H,me){var Qe,Xe;H.className=g.toolboxButtonStyleClass.name+" "+(me===W?""+((Qe=g.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:g.toolboxActiveButtonStyleColorsClass.name):""+((Xe=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Xe!==void 0?Xe:g.toolboxButtonStyleColorsClass.name))})},z}(),Ne=function(z,l){this.title=z,this.icon=l},Fe=function(z){function l(g,W,Q,H){var me=z.call(this,g,H||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return me.colors=[],me.addTransparent=!1,me.colorBoxes=[],me.colors=W,me.currentColor=Q,me.setCurrentColor=me.setCurrentColor.bind(me),me.getColorBox=me.getColorBox.bind(me),me}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var H=g.getColorBox(Q);W.appendChild(H),g.colorBoxes.push(H)}),W},l.prototype.getColorBox=function(g){var W=this,Q=this.uiStyleSettings.toolbarHeight/4,H=this.uiStyleSettings.toolbarHeight-Q,me=document.createElement("div");me.style.display="inline-block",me.style.boxSizing="content-box",me.style.width=H-2+"px",me.style.height=H-2+"px",me.style.padding="1px",me.style.marginRight="2px",me.style.marginBottom="2px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderRadius=(H+2)/2+"px",me.style.borderColor=g===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){W.setCurrentColor(g,me)});var Qe=document.createElement("div");return Qe.style.display="inline-block",Qe.style.width=H-2+"px",Qe.style.height=H-2+"px",Qe.style.backgroundColor=g,Qe.style.borderRadius=H/2+"px",g==="transparent"&&(Qe.style.fill=this.uiStyleSettings.toolboxAccentColor,Qe.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),me.appendChild(Qe),me},l.prototype.setCurrentColor=function(g,W){var Q=this;this.currentColor=g,this.colorBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(g)},l}(Ne),Be=function(){function z(l,g,W){this._state="new",this._isSelected=!1,this._container=l,this._overlayContainer=g,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(l){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(l,g){},z.prototype.dblClick=function(l,g){},z.prototype.manipulate=function(l){},z.prototype.pointerUp=function(l){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(l){this.container.childNodes.length>0?this.container.insertBefore(l,this.container.childNodes[0]):this.container.appendChild(l)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(l){this._state=l.state,this.notes=l.notes},z.prototype.scale=function(l,g){},z.prototype.colorChanged=function(l){this.onColorChanged&&this.onColorChanged(l),this.stateChanged()},z.prototype.fillColorChanged=function(l){this.onFillColorChanged&&this.onFillColorChanged(l),this.stateChanged()},z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var l=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),l.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(l)&&this.onStateChanged(this)}},z.typeName="MarkerBase",z}(),Ue=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.prototype.findGripByVisual=function(l){return this.topLeft.ownsTarget(l)?this.topLeft:this.topCenter.ownsTarget(l)?this.topCenter:this.topRight.ownsTarget(l)?this.topRight:this.centerLeft.ownsTarget(l)?this.centerLeft:this.centerRight.ownsTarget(l)?this.centerRight:this.bottomLeft.ownsTarget(l)?this.bottomLeft:this.bottomCenter.ownsTarget(l)?this.bottomCenter:this.bottomRight.ownsTarget(l)?this.bottomRight:void 0},z}(),nt=function(){function z(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},z}(),it=function(){function z(){}return z.toITransformMatrix=function(l){return{a:l.a,b:l.b,c:l.c,d:l.d,e:l.e,f:l.f}},z.toSVGMatrix=function(l,g){return l.a=g.a,l.b=g.b,l.c=g.c,l.d=g.d,l.e=g.e,l.f=g.f,l},z}(),$e=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.left=0,H.top=0,H.width=0,H.height=0,H.defaultSize={x:50,y:20},H.offsetX=0,H.offsetY=0,H.rotationAngle=0,H.CB_DISTANCE=10,H._suppressMarkerCreateEvent=!1,H.container.transform.baseVal.appendItem(de.createTransform()),H.setupControlBox(),H}return Ae(l,z),Object.defineProperty(l.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"visual",{get:function(){return this._visual},set:function(g){this._visual=g;var W=de.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(g){return!!z.prototype.ownsTarget.call(this,g)||!!(this.controlGrips.findGripByVisual(g)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(g))},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="new"&&(this.left=g.x,this.top=g.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Q=this.unrotatePoint(g);if(this.manipulationStartX=Q.x,this.manipulationStartY=Q.y,this.offsetX=Q.x-this.left,this.offsetY=Q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var H=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=H.x-this.width/2,this.top=H.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var me=this.container.transform.baseVal.getItem(0);me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},l.prototype.pointerUp=function(g){var W=this.state;z.prototype.pointerUp.call(this,g),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(g),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},l.prototype.moveVisual=function(g){this.visual.style.transform="translate("+g.x+"px, "+g.y+"px)"},l.prototype.manipulate=function(g){var W=this.unrotatePoint(g);this.state==="creating"?this.resize(g):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(g)},l.prototype.resize=function(g){var W=this.manipulationStartLeft,Q=this.manipulationStartWidth,H=this.manipulationStartTop,me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+g.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Q=this.manipulationStartWidth+g.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:H=this.manipulationStartTop+g.y-this.manipulationStartY,me=this.manipulationStartHeight+this.manipulationStartTop-H;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:me=this.manipulationStartHeight+g.y-this.manipulationStartY}Q>=0?(this.left=W,this.width=Q):(this.left=W+Q,this.width=-Q),me>=0?(this.top=H,this.height=me):(this.top=H+me,this.height=-me),this.setSize()},l.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},l.prototype.rotate=function(g){if(Math.abs(g.x-this.centerX)>.1){var W=Math.sign(g.x-this.centerX);this.rotationAngle=180*Math.atan((g.y-this.centerY)/(g.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},l.prototype.applyRotation=function(){var g=this.container.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(g,0)},l.prototype.rotatePoint=function(g){if(this.rotationAngle===0)return g;var W=this.container.getCTM(),Q=de.createPoint(g.x,g.y);return{x:(Q=Q.matrixTransform(W)).x,y:Q.y}},l.prototype.unrotatePoint=function(g){if(this.rotationAngle===0)return g;var W=this.container.getCTM();W=W.inverse();var Q=de.createPoint(g.x,g.y);return{x:(Q=Q.matrixTransform(W)).x,y:Q.y}},l.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var g=de.createTransform();g.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(g),this.container.appendChild(this.controlBox),this.controlRect=de.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=de.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 Ue,this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){var g=this.controlBox.transform.baseVal.getItem(0);g.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(g,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()},l.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()},l.prototype.createGrip=function(){var g=new nt;return g.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(g.visual),g},l.prototype.positionGrips=function(){var g=this.controlGrips.topLeft.GRIP_SIZE,W=-g/2,Q=W,H=(this.width+this.CB_DISTANCE)/2-g/2,me=(this.height+this.CB_DISTANCE)/2-g/2,Qe=this.height+this.CB_DISTANCE-g/2,Xe=this.width+this.CB_DISTANCE-g/2;this.positionGrip(this.controlGrips.topLeft.visual,W,Q),this.positionGrip(this.controlGrips.topCenter.visual,H,Q),this.positionGrip(this.controlGrips.topRight.visual,Xe,Q),this.positionGrip(this.controlGrips.centerLeft.visual,W,me),this.positionGrip(this.controlGrips.centerRight.visual,Xe,me),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Qe),this.positionGrip(this.controlGrips.bottomCenter.visual,H,Qe),this.positionGrip(this.controlGrips.bottomRight.visual,Xe,Qe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,H,Q-3*this.CB_DISTANCE)},l.prototype.positionGrip=function(g,W,Q){var H=g.transform.baseVal.getItem(0);H.setTranslate(W,Q),g.transform.baseVal.replaceItem(H,0)},l.prototype.hideControlBox=function(){this.controlBox.style.display="none"},l.prototype.showControlBox=function(){this.controlBox.style.display=""},l.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g);var W=g;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W);var Q=this.rotatePoint({x:this.left,y:this.top}),H=this.unrotatePoint({x:Q.x*g,y:Q.y*W});this.left=H.x,this.top=H.y,this.width=this.width*g,this.height=this.height*W,this.adjustControlBox()},l}(Be),tt=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.createVisual=H.createVisual.bind(H),H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.visual)},l.prototype.createVisual=function(){this.visual=de.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)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},l.prototype.manipulate=function(g){z.prototype.manipulate.call(this,g)},l.prototype.resize=function(g){z.prototype.resize.call(this,g),this.setSize()},l.prototype.setSize=function(){z.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(g){z.prototype.pointerUp.call(this,g),this.setSize()},l.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},l.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},l.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this))},l.prototype.restoreState=function(g){var W=g;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),z.prototype.restoreState.call(this,g),this.setSize()},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.setSize()},l.title="Rectangle marker",l}($e),ct=function(z){function l(g,W,Q,H){var me=z.call(this,g,H||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return me.widths=[],me.widthBoxes=[],me.widths=W,me.currentWidth=Q,me.setCurrentWidth=me.setCurrentWidth.bind(me),me}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(Q){var H=document.createElement("div");H.style.display="flex",H.style.flexGrow="2",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=Q===g.currentWidth?g.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){g.setCurrentWidth(Q,H)}),W.appendChild(H);var me=document.createElement("div");me.innerText=Q.toString(),me.style.marginRight="5px",H.appendChild(me);var Qe=document.createElement("div");Qe.style.minHeight="20px",Qe.style.flexGrow="2",Qe.style.display="flex",Qe.style.alignItems="center";var Xe=document.createElement("hr");Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop=Q+"px solid "+g.uiStyleSettings.toolboxColor,Xe.style.flexGrow="2",Qe.appendChild(Xe),H.appendChild(Qe),g.widthBoxes.push(H)}),W},l.prototype.setCurrentWidth=function(g,W){var Q=this;this.currentWidth=g,this.widthBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},l}(Ne),et=function(z){function l(g,W,Q,H){var me=z.call(this,g,H||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return me.styles=[],me.styleBoxes=[],me.styles=W,me.currentStyle=Q,me.setCurrentStyle=me.setCurrentStyle.bind(me),me}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(Q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/g.styles.length-5+"%",H.style.borderColor=Q===g.currentStyle?g.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){g.setCurrentStyle(Q,H)}),W.appendChild(H);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.overflow="hidden";var Qe=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+g.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Q!==""?'stroke-dasharray="'+Q+'"':"")+` />
|
|
</svg>`;me.innerHTML=Qe,H.appendChild(me),g.styleBoxes.push(H)}),W},l.prototype.setCurrentStyle=function(g,W){var Q=this;this.currentStyle=g,this.styleBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},l}(Ne),ot=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Fe("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new ct("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new et("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(l,z),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=z.prototype.getState.call(this);return g.typeName=l.typeName,g},l.typeName="FrameMarker",l.title="Frame marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',l}(tt),Oe=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},ht=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.x1=0,H.y1=0,H.x2=0,H.y2=0,H.defaultLength=50,H.manipulationStartX=0,H.manipulationStartY=0,H.manipulationStartX1=0,H.manipulationStartY1=0,H.manipulationStartX2=0,H.manipulationStartY2=0,H.setupControlBox(),H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!!z.prototype.ownsTarget.call(this,g)||!(!this.grip1.ownsTarget(g)&&!this.grip2.ownsTarget(g))},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.state==="new"&&(this.x1=g.x,this.y1=g.y,this.x2=g.x,this.y2=g.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},l.prototype.pointerUp=function(g){var W=this.state;z.prototype.pointerUp.call(this,g),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(g),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},l.prototype.adjustVisual=function(){},l.prototype.manipulate=function(g){this.state==="creating"?this.resize(g):this.state==="move"?(this.x1=this.manipulationStartX1+g.x-this.manipulationStartX,this.y1=this.manipulationStartY1+g.y-this.manipulationStartY,this.x2=this.manipulationStartX2+g.x-this.manipulationStartX,this.y2=this.manipulationStartY2+g.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(g)},l.prototype.resize=function(g){switch(this.activeGrip){case this.grip1:this.x1=g.x,this.y1=g.y;break;case this.grip2:case void 0:this.x2=g.x,this.y2=g.y}this.adjustVisual(),this.adjustControlBox()},l.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){this.positionGrips()},l.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},l.prototype.createGrip=function(){var g=new nt;return g.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(g.visual),g},l.prototype.positionGrips=function(){var g=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-g/2,this.y1-g/2),this.positionGrip(this.grip2.visual,this.x2-g/2,this.y2-g/2)},l.prototype.positionGrip=function(g,W,Q){var H=g.transform.baseVal.getItem(0);H.setTranslate(W,Q),g.transform.baseVal.replaceItem(H,0)},l.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g);var W=g;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.x1=this.x1*g,this.y1=this.y1*W,this.x2=this.x2*g,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},l}(Be),st=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Fe("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new ct("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new et("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorLine&&g!==this.visibleLine)},l.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.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)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},l.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()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},l.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},l.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g);var W=g;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},l.typeName="LineMarker",l.title="Line marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',l}(ht),je=function(z){function l(g,W,Q,H){var me=z.call(this,g,H||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return me.fonts=[],me.fontBoxes=[],me.fonts=W,me.currentFont=Q,me.setCurrentFont=me.setCurrentFont.bind(me),me}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(Q){var H=document.createElement("div");H.style.display="inline-block",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/g.fonts.length-5+"%",H.style.borderColor=Q===g.currentFont?g.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){g.setCurrentFont(Q,H)}),W.appendChild(H);var me=document.createElement("div");me.style.display="flex",me.style.minHeight="20px",me.style.flexGrow="2",me.style.fontFamily=Q,me.style.overflow="hidden";var Qe=document.createElement("div");Qe.style.whiteSpace="nowrap",Qe.style.overflow="hidden",Qe.style.textOverflow="ellipsis",Qe.innerHTML="The quick brown fox jumps over the lazy dog",me.appendChild(Qe),H.appendChild(me),g.fontBoxes.push(H)}),W},l.prototype.setCurrentFont=function(g,W){var Q=this;this.currentFont=g,this.fontBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},l}(Ne),Ye=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.color="transparent",H.padding=5,H.DEFAULT_TEXT="your text here",H.text=H.DEFAULT_TEXT,H.isMoved=!1,H.color=Q.defaultColor,H.fontFamily=Q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setColor=H.setColor.bind(H),H.setFont=H.setFont.bind(H),H.renderText=H.renderText.bind(H),H.sizeText=H.sizeText.bind(H),H.textEditDivClicked=H.textEditDivClicked.bind(H),H.showTextEditor=H.showTextEditor.bind(H),H.setSize=H.setSize.bind(H),H.positionTextEditor=H.positionTextEditor.bind(H),H.colorPanel=new Fe("Color",Q.defaultColorSet,Q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.fontFamilyPanel=new je("Font",Q.defaultFontFamilies,Q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H}return Ae(l,z),l.prototype.ownsTarget=function(g){if(z.prototype.ownsTarget.call(this,g)||g===this.visual||g===this.textElement||g===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(Q){Q===g&&(W=!0)}),W},l.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.isMoved=!1,this.pointerDownPoint=g,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},l.prototype.renderText=function(){var g=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){g.textElement.appendChild(de.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},l.prototype.getTextScale=function(){var g=this.textElement.getBBox(),W=1;if(g.width>0&&g.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/g.width,H=(1*this.height-this.height*this.padding*2/100)/g.height;W=Math.min(Q,H)}return W},l.prototype.getTextPosition=function(g){var W=this.textElement.getBBox(),Q=0,H=0;return W.width>0&&W.height>0&&(Q=(this.width-W.width*g)/2,H=this.height/2-W.height*g/2),{x:Q,y:H}},l.prototype.sizeText=function(){var g=this.textElement.getBBox(),W=this.getTextScale(),Q=this.getTextPosition(W);Q.y-=g.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},l.prototype.manipulate=function(g){z.prototype.manipulate.call(this,g),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(g.x-this.pointerDownPoint.x)>5||Math.abs(g.y-this.pointerDownPoint.y)>5)},l.prototype.resize=function(g){z.prototype.resize.call(this,g),this.isMoved=!0,this.setSize(),this.sizeText()},l.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},l.prototype.pointerUp=function(g){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,g),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},l.prototype.showTextEditor=function(){var g=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(g.textEditor.style.fontSize);g.textEditor.clientWidth>=Number.parseInt(g.textEditor.style.maxWidth)&&W>.9;)W-=.1,g.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var Q=W.clipboardData.getData("text"),H=window.getSelection();if(!H.rangeCount)return!1;H.deleteFromDocument(),H.getRangeAt(0).insertNode(document.createTextNode(Q)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){g.textEditDivClicked(g.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},l.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var g=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),H={x:Q.width*g,y:Q.height*g};W.x-=H.x/2,W.y-=H.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*g,12)+"px",this.textElement.style.display="none"}},l.prototype.textEditDivClicked=function(g){this.text=g.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},l.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},l.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},l.prototype.dblClick=function(g,W){z.prototype.dblClick.call(this,g,W),this.showTextEditor()},l.prototype.setColor=function(g){this.textElement&&de.setAttributes(this.textElement,[["fill",g]]),this.color=g,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(g)},l.prototype.setFont=function(g){this.textElement&&de.setAttributes(this.textElement,[["font-family",g]]),this.fontFamily=g,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},l.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},l.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){var W=g;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),z.prototype.restoreState.call(this,g),this.setSize()},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.setSize(),this.sizeText(),this.positionTextEditor()},l.typeName="TextMarker",l.title="Text marker",l.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>',l}($e),Ee=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.color="transparent",H.lineWidth=3,H.drawing=!1,H.pixelRatio=1,H.color=Q.defaultColor,H.lineWidth=Q.defaultStrokeWidth,H.pixelRatio=Q.freehandPixelRatio,H.setColor=H.setColor.bind(H),H.addCanvas=H.addCanvas.bind(H),H.finishCreation=H.finishCreation.bind(H),H.setLineWidth=H.setLineWidth.bind(H),H.colorPanel=new Fe("Color",Q.defaultColorSet,Q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.lineWidthPanel=new ct("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.lineWidthPanel.onWidthChanged=H.setLineWidth,H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.drawingImage)},l.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var g=de.createTransform();this.visual.transform.baseVal.appendItem(g),this.addMarkerVisualToContainer(this.visual)},l.prototype.pointerDown=function(g,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(g.x,g.y),this.drawing=!0):z.prototype.pointerDown.call(this,g,W)},l.prototype.manipulate=function(g){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(g.x,g.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,g)},l.prototype.resize=function(g){z.prototype.resize.call(this,g),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(g){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,g)},l.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)},l.prototype.select=function(){this.state==="creating"&&this.finishCreation(),z.prototype.select.call(this)},l.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},l.prototype.finishCreation=function(){for(var g=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=W[0],H=W[1],me=W[2],Qe=W[3],Xe=!1,ft=0;ft<this.canvasElement.height;ft++)for(var Je=0;Je<this.canvasElement.width;Je++)g.data[ft*this.canvasElement.width*4+4*Je+3]>0&&(Xe=!0,ft<H&&(H=ft),Je<Q&&(Q=Je),ft>Qe&&(Qe=ft),Je>me&&(me=Je));if(Xe){this.left=Q/this.pixelRatio,this.top=H/this.pixelRatio,this.width=(me-Q)/this.pixelRatio,this.height=(Qe-H)/this.pixelRatio;var St=document.createElement("canvas");St.width=me-Q,St.height=Qe-H,St.getContext("2d").putImageData(this.canvasContext.getImageData(Q,H,me-Q,Qe-H),0,0),this.drawingImgUrl=St.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},l.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},l.prototype.setColor=function(g){this.color=g,this.colorChanged(g)},l.prototype.setLineWidth=function(g){this.lineWidth=g},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){this.createVisual(),z.prototype.restoreState.call(this,g),this.drawingImgUrl=g.drawingImgUrl,this.setDrawingImage()},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.setDrawingImage()},l.typeName="FreehandMarker",l.title="Freehand marker",l.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>',l}($e),ge=function(z){function l(g,W,Q){var H=z.call(this,g,Q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return H.typeBoxes=[],H.currentType=W,H.setCurrentType=H.setCurrentType.bind(H),H}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var Q=function(Qe){var Xe="both";switch(Qe){case 0:Xe="both";break;case 1:Xe="start";break;case 2:Xe="end";break;case 3:Xe="none"}var ft=document.createElement("div");if(ft.style.display="flex",ft.style.flexGrow="2",ft.style.alignItems="center",ft.style.justifyContent="space-between",ft.style.padding="5px",ft.style.borderWidth="2px",ft.style.borderStyle="solid",ft.style.borderColor=Xe===H.currentType?H.uiStyleSettings.toolboxAccentColor:"transparent",ft.addEventListener("click",function(){g.setCurrentType(Xe,ft)}),W.appendChild(ft),Xe==="both"||Xe==="start"){var Je=document.createElement("div");Je.style.display="flex",Je.style.alignItems="center",Je.style.minHeight="20px",Je.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="`+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Je.style.marginLeft="5px",ft.appendChild(Je)}var St=document.createElement("div");St.style.display="flex",St.style.alignItems="center",St.style.minHeight="20px",St.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",St.appendChild(It),ft.appendChild(St),Xe==="both"||Xe==="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="`+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,$t.style.marginRight="5px",ft.appendChild($t)}H.typeBoxes.push(ft)},H=this,me=0;me<4;me++)Q(me);return W},l.prototype.setCurrentType=function(g,W){var Q=this;this.currentType=g,this.typeBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},l}(Ne),be=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.arrowType="end",H.arrowBaseHeight=10,H.arrowBaseWidth=10,H.getArrowPoints=H.getArrowPoints.bind(H),H.setArrowType=H.setArrowType.bind(H),H.arrowTypePanel=new ge("Arrow type","end"),H.arrowTypePanel.onArrowTypeChanged=H.setArrowType,H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.arrow1&&g!==this.arrow2)},l.prototype.getArrowPoints=function(g,W){var Q=this.arrowBaseWidth+2*this.strokeWidth,H=this.arrowBaseHeight+2*this.strokeWidth;return g-Q/2+","+(W+H/2)+" "+g+","+(W-H/2)+" "+(g+Q/2)+","+(W+H/2)},l.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(g,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(g+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},l.prototype.setArrowType=function(g){this.arrowType=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g);var W=g;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},l.typeName="ArrowMarker",l.title="Arrow marker",l.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',l}(st),ne=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.fillColor=Q.defaultFillColor,H.strokeWidth=0,H.fillPanel=new Fe("Color",Q.defaultColorSet,Q.defaultFillColor),H.fillPanel.onColorChanged=H.setFillColor,H}return Ae(l,z),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=z.prototype.getState.call(this);return g.typeName=l.typeName,g},l.typeName="CoverMarker",l.title="Cover marker",l.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',l}(tt),ie=function(z){function l(g,W,Q,H){var me=z.call(this,g,H||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return me.opacities=[],me.opacityBoxes=[],me.opacities=W,me.currentOpacity=Q,me.setCurrentOpacity=me.setCurrentOpacity.bind(me),me}return Ae(l,z),l.prototype.getUi=function(){var g=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(Q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=Q===g.currentOpacity?g.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){g.setCurrentOpacity(Q,H)}),W.appendChild(H);var me=document.createElement("div");me.innerText=100*Q+"%",H.appendChild(me),g.opacityBoxes.push(H)}),W},l.prototype.setCurrentOpacity=function(g,W){var Q=this;this.currentOpacity=g,this.opacityBoxes.forEach(function(H){H.style.borderColor=H===W?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},l}(Ne),se=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.setOpacity=H.setOpacity.bind(H),H.fillColor=Q.defaultHighlightColor,H.strokeWidth=0,H.opacity=Q.defaultHighlightOpacity,H.fillPanel=new Fe("Color",Q.defaultColorSet,H.fillColor),H.fillPanel.onColorChanged=H.setFillColor,H.opacityPanel=new ie("Opacity",Q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Ae(l,z),l.prototype.setOpacity=function(g){this.opacity=g,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=z.prototype.getState.call(this);return g.typeName=l.typeName,g},l.typeName="HighlightMarker",l.title="Highlight marker",l.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>',l}(ne),ue='<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>',ke=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.bgColor="transparent",H.tipPosition={x:0,y:0},H.tipBase1Position={x:0,y:0},H.tipBase2Position={x:0,y:0},H.tipMoving=!1,H.color=Q.defaultStrokeColor,H.bgColor=Q.defaultFillColor,H.fontFamily=Q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setBgColor=H.setBgColor.bind(H),H.getTipPoints=H.getTipPoints.bind(H),H.positionTip=H.positionTip.bind(H),H.setTipPoints=H.setTipPoints.bind(H),H.colorPanel=new Fe("Text color",Q.defaultColorSet,H.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>'),H.colorPanel.onColorChanged=H.setColor,H.bgColorPanel=new Fe("Fill color",Q.defaultColorSet,H.bgColor,ue),H.bgColorPanel.onColorChanged=H.setBgColor,H.fontFamilyPanel=new je("Font",Q.defaultFontFamilies,Q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H.tipGrip=new nt,H.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),H.controlBox.appendChild(H.tipGrip.visual),H}return Ae(l,z),l.prototype.ownsTarget=function(g){return z.prototype.ownsTarget.call(this,g)||this.tipGrip.ownsTarget(g)||this.tip===g},l.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},l.prototype.pointerDown=function(g,W){this.state==="new"&&z.prototype.pointerDown.call(this,g,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,g,W)},l.prototype.pointerUp=function(g){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,g);else{var W=this.state==="creating";z.prototype.pointerUp.call(this,g),this.setTipPoints(W),this.positionTip()}},l.prototype.manipulate=function(g){if(this.tipMoving){var W=this.unrotatePoint(g);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,g)},l.prototype.setBgColor=function(g){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",g]]),de.setAttributes(this.tip,[["fill",g]])),this.bgColor=g,this.fillColorChanged(g)},l.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},l.prototype.setTipPoints=function(g){g===void 0&&(g=!1);var W=Math.min(this.height/2,15),Q=this.height/5;g&&(this.tipPosition={x:W+Q/2,y:this.height+20});var H=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?H<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+Q,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?H<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-Q,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+Q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?H<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-Q,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-Q},this.tipBase2Position={x:this.width,y:this.height-W}):H<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Q=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+Q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-Q})},l.prototype.resize=function(g){z.prototype.resize.call(this,g),this.positionTip()},l.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var g=this.tipGrip.visual.transform.baseVal.getItem(0);g.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(g,0)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.select=function(){this.positionTip(),z.prototype.select.call(this)},l.prototype.getState=function(){var g=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){var W=g;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,z.prototype.restoreState.call(this,g),this.createTip(),this.setTipPoints()},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.tipPosition={x:this.tipPosition.x*g,y:this.tipPosition.y*W},this.positionTip()},l.typeName="CalloutMarker",l.title="Callout marker",l.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>',l}(Ye),Se=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.fillColor=Q.defaultFillColor,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.setOpacity=H.setOpacity.bind(H),H.createVisual=H.createVisual.bind(H),H.strokePanel=new Fe("Line color",pe(Q.defaultColorSet,["transparent"]),Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.fillPanel=new Fe("Fill color",pe(Q.defaultColorSet,["transparent"]),H.fillColor,ue),H.fillPanel.onColorChanged=H.setFillColor,H.strokeWidthPanel=new ct("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new et("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H.opacityPanel=new ie("Opacity",Q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.visual)},l.prototype.createVisual=function(){this.visual=de.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)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},l.prototype.manipulate=function(g){z.prototype.manipulate.call(this,g)},l.prototype.resize=function(g){z.prototype.resize.call(this,g),this.setSize()},l.prototype.setSize=function(){z.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},l.prototype.pointerUp=function(g){z.prototype.pointerUp.call(this,g),this.setSize()},l.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},l.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(g),this.stateChanged()},l.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.setOpacity=function(g){this.opacity=g,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){var W=g;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),z.prototype.restoreState.call(this,g),this.setSize()},l.prototype.scale=function(g,W){z.prototype.scale.call(this,g,W),this.setSize()},l.typeName="EllipseMarker",l.title="Ellipse marker",l.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>',l}($e),Ve=function(z){function l(g,W,Q){return z.call(this,g,W,Q)||this}return Ae(l,z),Object.defineProperty(l.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.tip1&&g!==this.tip2)},l.prototype.createTips=function(){this.tip1=de.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(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.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(de.createTransform()),this.visual.appendChild(this.tip2)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.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()]]),de.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 g=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(g,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var Q=this.tip2.transform.baseVal.getItem(0);Q.setRotate(g+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Q,0)}},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=z.prototype.getState.call(this);return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g),this.createTips(),this.adjustVisual()},l.typeName="MeasurementMarker",l.title="Measurement marker",l.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>',l}(st),at=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.strokePanel.colors=Q.defaultColorSet,H.fillColor="transparent",H}return Ae(l,z),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=z.prototype.getState.call(this);return g.typeName=l.typeName,g},l.typeName="EllipseFrameMarker",l.title="Ellipse frame marker",l.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>',l}(Se),We=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(l){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(l)||(this.undoStack.push(l),JSON.stringify(this.lastRedoStep)!==JSON.stringify(l)&&this.redoStack.splice(0,this.redoStack.length))},z.prototype.replaceLastUndoStep=function(l){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=l)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var l=this.undoStack.pop();return l!==void 0&&this.redoStack.push(l),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),mt=function(z){function l(g,W,Q){var H=z.call(this,g,W,Q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.curveX=0,H.curveY=0,H.manipulationStartCurveX=0,H.manipulationStartCurveY=0,H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.positionGrips=H.positionGrips.bind(H),H.addControlGrips=H.addControlGrips.bind(H),H.adjustVisual=H.adjustVisual.bind(H),H.setupControlBox=H.setupControlBox.bind(H),H.resize=H.resize.bind(H),H.strokeColor=Q.defaultColor,H.strokeWidth=Q.defaultStrokeWidth,H.strokeDasharray=Q.defaultStrokeDasharray,H.strokePanel=new Fe("Line color",Q.defaultColorSet,Q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new ct("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new et("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Ae(l,z),l.prototype.ownsTarget=function(g){return!(!z.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorCurve&&g!==this.visibleCurve&&!this.curveGrip.ownsTarget(g))},l.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},l.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.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)},l.prototype.pointerDown=function(g,W){z.prototype.pointerDown.call(this,g,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=g.x,this.curveY=g.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},l.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.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)},l.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,z.prototype.addControlGrips.call(this)},l.prototype.positionGrips=function(){z.prototype.positionGrips.call(this);var g=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-g/2,this.curveY-g/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()))},l.prototype.manipulate=function(g){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+g.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+g.y-this.manipulationStartY),z.prototype.manipulate.call(this,g)},l.prototype.resize=function(g){this.activeGrip===this.curveGrip&&(this.curveX=g.x,this.curveY=g.y),z.prototype.resize.call(this,g),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},l.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},l.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},l.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual()},l.prototype.scale=function(g,W){this.curveX=this.curveX*g,this.curveY=this.curveY*W,z.prototype.scale.call(this,g,W)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return g.typeName=l.typeName,g},l.prototype.restoreState=function(g){z.prototype.restoreState.call(this,g);var W=g;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},l.typeName="CurveMarker",l.title="Curve marker",l.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>',l}(ht),wt=function(){function z(l,g){g===void 0&&(g=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=l,this.cancelable=g}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),ze=function(z){function l(g,W,Q){var H=z.call(this,g,!1)||this;return H.dataUrl=W,H.state=Q,H}return Ae(l,z),l}(wt),lt=function(z){function l(g,W,Q){Q===void 0&&(Q=!1);var H=z.call(this,g,Q)||this;return H.marker=W,H}return Ae(l,z),l}(wt),Mt=function(){function z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return z.prototype.addEventListener=function(l,g){this[l].push(g)},z.prototype.removeEventListener=function(l,g){var W=this[l].indexOf(g);W>-1&&this[l].splice(W,1)},z}(),Ht=function(){function z(l){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Oe,this._isOpen=!1,this.undoRedoManager=new We,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 Mt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new we(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=l,this.targetRoot=document.body,this.width=l.clientWidth,this.height=l.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[ot,Ee,be,Ye,at,Se,se,ke,Ve,ne,st,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ot,Ee,be,Ye,Se,se,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ot,Ee,be,Ye,se]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(l){var g=this;this._availableMarkerTypes.splice(0),l.forEach(function(W){if(typeof W=="string"){var Q=g.ALL_MARKER_TYPES.find(function(H){return H.typeName===W});Q!==void 0&&g._availableMarkerTypes.push(Q)}else g._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(l){this._zoomLevel=l,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},z.prototype.show=function(){var l=this;this.styles.styleSheetRoot===void 0&&ae.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ae.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(g){return g(new wt(l))})},z.prototype.render=function(){return Te(this,void 0,void 0,function(){var l;return Ce(this,function(g){switch(g.label){case 0:return this.setCurrentMarker(),(l=new ce).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.markersOnly=this.renderMarkersOnly,l.width=this.renderWidth,l.height=this.renderHeight,[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return g.sent(),[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,g.sent()]}})})},z.prototype.close=function(l){var g=this;if(l===void 0&&(l=!1),this.isOpen){var W=!1;l||this.eventListeners.beforeclose.forEach(function(Q){var H=new wt(g,!0);Q(H),H.defaultPrevented&&(W=!0)}),W||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Q){return Q(new wt(g))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var l,g=[],W=0;W<arguments.length;W++)g[W]=arguments[W];(l=this._availableMarkerTypes).push.apply(l,g)},z.prototype.addRenderEventListener=function(l){this.addEventListener("render",function(g){l(g.dataUrl,g.state)})},z.prototype.removeRenderEventListener=function(l){},z.prototype.addCloseEventListener=function(l){this.addEventListener("close",function(){l()})},z.prototype.removeCloseEventListener=function(l){},z.prototype.setupResizeObserver=function(){var l=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return l.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},z.prototype.onPopupTargetResize=function(){var l=1*this.target.clientWidth/this.target.clientHeight,g=this.editorCanvas.clientWidth/l>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*l:this.editorCanvas.clientWidth,W=g<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/l;this.resize(g,W)},z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},z.prototype.resize=function(l,g){this._isResizing=!0;var W=l/this.imageWidth,Q=g/this.imageHeight;this.imageWidth=Math.round(l),this.imageHeight=Math.round(g),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(W,Q),this._isResizing=!1},z.prototype.scaleMarkers=function(l,g){var W,Q=this;this._currentMarker&&this._currentMarker instanceof Ye?this._currentMarker.scale(l,g):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(H){H!==Q._currentMarker&&H.scale(l,g)}),W!==void 0&&this.setCurrentMarker(W)},z.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},z.prototype.setTopLeft=function(){var l=this.editingTarget.getBoundingClientRect(),g=this.editorCanvas.getBoundingClientRect();this.left=l.left-g.left,this.top=l.top-g.top},z.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},z.prototype.addDefs=function(){for(var l,g=[],W=0;W<arguments.length;W++)g[W]=arguments[W];this.defs=de.createDefs(),this.addDefsToImage(),(l=this.defs).append.apply(l,g)},z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},z.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},z.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},z.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var l=document.createElement("a");l.href="https://markerjs.com/",l.target="_blank",l.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>',l.title="Powered by marker.js",l.style.display="grid",l.style.alignItems="center",l.style.justifyItems="center",l.style.padding="3px",l.style.width="20px",l.style.height="20px",this.logoUI.appendChild(l),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Pe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.removeMarker=function(l){this.markerImage.removeChild(l.container),this.markers.indexOf(l)>-1&&this.markers.splice(this.markers.indexOf(l),1),l.dispose()},z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},z.prototype.toolbarButtonClicked=function(l,g){if(l==="marker"&&g!==void 0)this.createNewMarker(g);else if(l==="action")switch(g){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},z.prototype.deleteSelectedMarker=function(){var l=this;if(this._currentMarker!==void 0){var g=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var H=new lt(l,l._currentMarker,!0);Q(H),H.defaultPrevented&&(g=!0)}),!g){var W=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Q){return Q(new lt(l,W))})}}},z.prototype.clear=function(){var l=this,g=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(me){var Qe=new lt(l,void 0,!0);me(Qe),Qe.defaultPrevented&&(g=!0)}),!g)){this.setCurrentMarker();for(var W=function(me){var Qe=Q.markers[me];Q.setCurrentMarker(Q.markers[me]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(Xe){return Xe(new lt(l,Qe))})},Q=this,H=this.markers.length-1;H>=0;H--)W(H);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.prototype.showNotesEditor=function(){var l;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=(l=this._currentMarker.notes)!==null&&l!==void 0?l:"",this.overlayContainer.appendChild(this.notesArea))},z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var l=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var g=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===g.width&&W.height===g.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(g),Q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(H){return H(new wt(l))})}else this.undoRedoManager.replaceLastUndoStep(g),this.eventListeners.statechange.forEach(function(H){return H(new wt(l))})}},z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},z.prototype.undoStep=function(){var l=this,g=this.undoRedoManager.undo();g!==void 0&&(this.restoreState(g),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new wt(l))}))},z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},z.prototype.redoStep=function(){var l=this,g=this.undoRedoManager.redo();g!==void 0&&(this.restoreState(g),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new wt(l))}))},z.prototype.stepZoom=function(){var l=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=l<this.zoomSteps.length-1?this.zoomSteps[l+1]:this.zoomSteps[0]},z.prototype.panTo=function(l){this.contentDiv.scrollBy({left:this.prevPanPoint.x-l.x,top:this.prevPanPoint.y-l.y}),this.prevPanPoint=l},z.prototype.startRenderAndClose=function(){return Te(this,void 0,void 0,function(){var l,g,W=this;return Ce(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return l=Q.sent(),g=this.getState(),this.eventListeners.render.forEach(function(H){return H(new ze(W,l,g))}),this.close(!0),[2]}})})},z.prototype.getState=function(l){l===!0&&this.setCurrentMarker();var g={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return g.markers.push(W.getState())}),g},z.prototype.restoreState=function(l){var g=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);l.markers.forEach(function(W){var Q=g._availableMarkerTypes.find(function(me){return me.typeName===W.typeName});if(Q!==void 0){var H=g.addNewMarker(Q);H.restoreState(W),g.markers.push(H)}}),l.width&&l.height&&(l.width!==this.imageWidth||l.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/l.width,this.imageHeight/l.height),this.eventListeners.restorestate.forEach(function(W){return W(new wt(g))})},z.prototype.addNewMarker=function(l){var g=de.createGroup();return this.markerImage.appendChild(g),new l(g,this.overlayContainer,this.settings)},z.prototype.createNewMarker=function(l){var g,W=this;(g=typeof l=="string"?this._availableMarkerTypes.find(function(Q){return Q.typeName===l}):l)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(g),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(g.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Q){return Q(new lt(W,W._currentMarker))}))},z.prototype.markerCreated=function(l){var g=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(l),this.setCurrentMarker(l),l instanceof Ee&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ee):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new lt(g,g._currentMarker))})},z.prototype.colorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=l,this.settings.defaultStrokeColor=l)},z.prototype.fillColorChanged=function(l){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=l)},z.prototype.markerStateChanged=function(l){var g=this;this.eventListeners.markerchange.forEach(function(W){return W(new lt(g,l))})},z.prototype.setCurrentMarker=function(l){var g=this;this._currentMarker!==l&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new lt(g,g._currentMarker))})),this._currentMarker=l,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(W){return W(new lt(g,g._currentMarker))}))},z.prototype.onPointerDown=function(l){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||l.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var g=this.markers.find(function(W){return W.ownsTarget(l.target)});g!==void 0?(this.setCurrentMarker(g),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:l.clientX,y:l.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(l.clientX,l.clientY))},z.prototype.onDblClick=function(l){if(this._isFocused||this.focus(),this.mode==="select"){var g=this.markers.find(function(W){return W.ownsTarget(l.target)});g!==void 0&&g!==this._currentMarker&&this.setCurrentMarker(g),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(l.clientX,l.clientY),l.target):this.setCurrentMarker()}},z.prototype.onPointerMove=function(l){this.touchPoints!==1&&l.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||l.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(l.clientX,l.clientY)):this.zoomLevel>1&&this.panTo({x:l.clientX,y:l.clientY}))},z.prototype.onPointerUp=function(l){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(l.clientX,l.clientY)),this.isDragging=!1,this.addUndoStep()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(l){this._currentMarker===void 0||this.notesArea!==void 0||l.key!=="Delete"&&l.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(l,g){var W=this.markerImage.getBoundingClientRect();return{x:(l-W.left)/this.zoomLevel,y:(g-W.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},z.prototype.addLicenseKey=function(l){re.addKey(l)},z.prototype.addEventListener=function(l,g){this.eventListeners.addEventListener(l,g)},z.prototype.removeEventListener=function(l,g){this.eventListeners.removeEventListener(l,g)},z.prototype.renderState=function(l){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(l),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.prototype.focus=function(){var l=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(g){return g(new wt(l))}))},z.prototype.blur=function(){var l=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(g){return g(new wt(l))}))},z.instanceCounter=0,z}();/* **********************************
|
|
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(z,l){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,W){g.__proto__=W}||function(g,W){for(var Q in W)Object.prototype.hasOwnProperty.call(W,Q)&&(g[Q]=W[Q])})(z,l)};function zt(z,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function g(){this.constructor=z}qt(z,l),z.prototype=l===null?Object.create(l):(g.prototype=l.prototype,new g)}function Lt(z,l,g,W){return new(g||(g=Promise))(function(Q,H){function me(ft){try{Xe(W.next(ft))}catch(Je){H(Je)}}function Qe(ft){try{Xe(W.throw(ft))}catch(Je){H(Je)}}function Xe(ft){var Je;ft.done?Q(ft.value):(Je=ft.value,Je instanceof g?Je:new g(function(St){St(Je)})).then(me,Qe)}Xe((W=W.apply(z,l||[])).next())})}function Yr(z,l){var g,W,Q,H,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return H={next:Qe(0),throw:Qe(1),return:Qe(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function Qe(Xe){return function(ft){return function(Je){if(g)throw new TypeError("Generator is already executing.");for(;me;)try{if(g=1,W&&(Q=2&Je[0]?W.return:Je[0]?W.throw||((Q=W.return)&&Q.call(W),0):W.next)&&!(Q=Q.call(W,Je[1])).done)return Q;switch(W=0,Q&&(Je=[2&Je[0],Q.value]),Je[0]){case 0:case 1:Q=Je;break;case 4:return me.label++,{value:Je[1],done:!1};case 5:me.label++,W=Je[1],Je=[0];continue;case 7:Je=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Je[0]!==6&&Je[0]!==2)){me=0;continue}if(Je[0]===3&&(!Q||Je[1]>Q[0]&&Je[1]<Q[3])){me.label=Je[1];break}if(Je[0]===6&&me.label<Q[1]){me.label=Q[1],Q=Je;break}if(Q&&me.label<Q[2]){me.label=Q[2],me.ops.push(Je);break}Q[2]&&me.ops.pop(),me.trys.pop();continue}Je=l.call(z,me)}catch(St){Je=[6,St],W=0}finally{g=Q=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([Xe,ft])}}}var on=function(){function z(){}return z.addKey=function(l){z.key=l},Object.defineProperty(z,"isLicensed",{get:function(){return!!z.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(z.key)},enumerable:!1,configurable:!0}),z}(),Et=function(){function z(){}return z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},z.setAttributes=function(l,g){for(var W=0,Q=g;W<Q.length;W++){var H=Q[W],me=H[0],Qe=H[1];l.setAttribute(me,Qe)}},z.createRect=function(l,g,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","rect");return Q.setAttribute("width",l.toString()),Q.setAttribute("height",g.toString()),W&&z.setAttributes(Q,W),Q},z.createLine=function(l,g,W,Q,H){var me=document.createElementNS("http://www.w3.org/2000/svg","line");return me.setAttribute("x1",l.toString()),me.setAttribute("y1",g.toString()),me.setAttribute("x2",W.toString()),me.setAttribute("y2",Q.toString()),H&&z.setAttributes(me,H),me},z.createPolygon=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",l),g&&z.setAttributes(W,g),W},z.createCircle=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(l/2).toString()),W.setAttribute("cy",(l/2).toString()),W.setAttribute("r",l.toString()),g&&z.setAttributes(W,g),W},z.createEllipse=function(l,g,W){var Q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Q.setAttribute("cx",(l/2).toString()),Q.setAttribute("cy",(g/2).toString()),Q.setAttribute("rx",(l/2).toString()),Q.setAttribute("ry",(g/2).toString()),W&&z.setAttributes(Q,W),Q},z.createGroup=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","g");return l&&z.setAttributes(g,l),g},z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},z.createMarker=function(l,g,W,Q,H,me,Qe){var Xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return z.setAttributes(Xe,[["id",l],["orient",g],["markerWidth",W.toString()],["markerHeight",Q.toString()],["refX",H.toString()],["refY",me.toString()]]),Xe.appendChild(Qe),Xe},z.createText=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","text");return g.setAttribute("x","0"),g.setAttribute("y","0"),l&&z.setAttributes(g,l),g},z.createTSpan=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=l,g&&z.setAttributes(W,g),W},z.createImage=function(l){var g=document.createElementNS("http://www.w3.org/2000/svg","image");return l&&z.setAttributes(g,l),g},z.createPoint=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=l,W.y=g,W},z.createPath=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",l),g&&z.setAttributes(W,g),W},z.createElement=function(l,g){var W=document.createElementNS("http://www.w3.org/2000/svg",l);return g&&z.setAttributes(W,g),W},z.getHollowRectanglePath=function(l,g,W,Q,H,me,Qe,Xe){return"M"+l+","+g+"V"+(g+Q)+"H"+(l+W)+"V"+g+"H"+H+"V"+me+"H"+(H+Qe)+"V"+(me+Xe)+"H"+H+"V"+g+"Z"},z}(),Nr=function(){function z(l){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+l+"_"}return Object.defineProperty(z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#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(z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),z.prototype.addClass=function(l){return this.styleSheet===void 0&&this.addStyleSheet(),l.name=""+this.classNamePrefix+l.localName,this.classes.push(l),this.styleSheet.sheet.insertRule("."+l.name+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length),l},z.prototype.addRule=function(l){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(l),this.styleSheet.sheet.insertRule(l.selector+" {"+l.style+"}",this.styleSheet.sheet.cssRules.length)},z.prototype.addStyleSheet=function(){var l;this.styleSheet=document.createElement("style"),((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).appendChild(this.styleSheet),this.addRule(new ur("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ur("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ur("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Cr("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Cr("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},z.prototype.removeStyleSheet=function(){var l;this.styleSheet&&(((l=this.styleSheetRoot)!==null&&l!==void 0?l:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},z}(),ur=function(z,l){this.selector=z,this.style=l},Cr=function(z,l){this.localName=z,this.style=l},Fr=function(){function z(){this.blocks=[],this.display=""}return z.prototype.addButtonBlock=function(l){l.className=this.blockClassName,l.buttonClassName=this.buttonClassName,l.buttonColorsClassName=this.buttonColorsClassName,l.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(l)},z.prototype.addElementBlock=function(l){l.className===void 0&&(l.className=this.blockClassName),this.blocks.push(l)},z.prototype.getUI=function(){var l=document.createElement("div");return l.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,l.style.display=this.display,this.blocks.forEach(function(g){return l.appendChild(g.getUI())}),l},z}(),tn=function(){function z(){}return z.prototype.getUI=function(){var l=document.createElement("div");if(l.className=this.className,this.minWidth!==void 0&&(l.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":l.style.justifyContent="flex-start";break;case"center":l.style.justifyContent="center";break;case"end":l.style.justifyContent="flex-end"}return l.style.whiteSpace="nowrap",l},z}(),sn=function(z){function l(){var g=z!==null&&z.apply(this,arguments)||this;return g.buttons=[],g}return zt(l,z),l.prototype.addButton=function(g){g.className=this.buttonClassName,g.colorsClassName=this.buttonColorsClassName,g.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(g)},l.prototype.getUI=function(){var g=z.prototype.getUI.call(this);return this.buttons.forEach(function(W){return g.appendChild(W.getUI())}),g},l}(tn),Ft=function(){function z(l,g){this._isActive=!1,this._isHidden=!1,this._icon=l,this.title=g,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(z.prototype,"icon",{get:function(){return this._icon},set:function(l){this._icon=l,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isActive",{get:function(){return this._isActive},set:function(l){this._isActive=l,this.adjustClassName()},enumerable:!1,configurable:!0}),z.prototype.getUI=function(){var l=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 l.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},z.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,"")))},z.prototype.hide=function(){this._isHidden=!0},z}(),vt=function(z){function l(){var g=z!==null&&z.apply(this,arguments)||this;return g.elements=[],g}return zt(l,z),l.prototype.addElement=function(g){this.elements.push(g)},l.prototype.getUI=function(){var g=z.prototype.getUI.call(this);return this.elements.forEach(function(W){return g.appendChild(W)}),g},l}(tn),ar=function(){function z(l,g){this.horizontal=l,this.vertical=g}return Object.defineProperty(z.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),z.prototype.getVerticalLength=function(l){return l/this.ratio},z.prototype.getHorizontalLength=function(l){return l*this.ratio},z}(),rn=function(){function z(){}return z.getIcon=function(l,g){if(l>0&&g>0){var W=new ar(l,g),Q=W.ratio>=1?20:W.getHorizontalLength(20),H=W.ratio<1?20:W.getVerticalLength(20),me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(me);var Qe=Et.createDefs();me.appendChild(Qe);var Xe=Et.createElement("clipPath",[["id","text-bg-clip"]]);Qe.appendChild(Xe);var ft=Et.createPath(Et.getHollowRectanglePath((24-Q)/2,(24-H)/2,Q,H,(24-Q)/2+2,(24-H)/2+2,Q-4,H-4));me.appendChild(ft);var Je=Et.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Je.appendChild(Et.createTSpan(l+":"+g)),me.appendChild(Je);var St=Je.getBBox();Et.setAttributes(Je,[["x",((24-St.width)/2).toString()],["y",((24-St.height)/2-St.y).toString()]]);var It=Et.createPath(Et.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(St.width))/2,(24-Math.ceil(St.height))/2,Math.ceil(St.width),Math.ceil(St.height)));return Xe.appendChild(It),Et.setAttributes(ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(me),me.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},z}(),Or=function(z){function l(g,W,Q){var H=z.call(this,g,W)||this;return H.isDropdownOpen=!1,H.onClick=H.dropdownButtonClicked,H.dropdownButtons=Q,H}return zt(l,z),l.prototype.setupDropdown=function(){var g=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=g.className,W.colorsClassName=g.colorsClassName,g.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},l.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},l.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},l.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},l.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},l.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},l}(Ft),_t=function(){function z(l,g){this.GRIP_SIZE=10,this.color=l,this.fillColor=g,this.visual=Et.createGroup(),this.visual.appendChild(Et.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Et.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},z.prototype.setCenter=function(l,g){this.visual.childNodes.forEach(function(W){return Et.setAttributes(W,[["cx",l.toString()],["cy",g.toString()]])})},z}(),or=function(){function z(l,g,W,Q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=l,this.canvasHeight=g,this.margin=W,this.container=Q,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(l){this._aspectRatio=l,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.gridContainer&&Et.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(l){this._zoomFactor=l,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),z.prototype.open=function(){var l=this;this.cropShadeElement=Et.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Et.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var g=0;g<this.numberOfGridLines;g++)this.horizontalGridLines.push(Et.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Et.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return l.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return l.gridContainer.appendChild(W)}),this.cropRectElement=Et.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new _t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},z.prototype.setCropRectangle=function(l){this.cropRect=l;var g=Object.assign({},this.cropRect);this.zoomFactor!==1&&(g.width=this.cropRect.width*this.zoomFactor,g.height=this.cropRect.height*this.zoomFactor,g.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-g.width/2,g.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-g.height/2),Et.setAttributes(this.cropRectElement,[["x",g.x.toString()],["y",g.y.toString()],["width",g.width.toString()],["height",g.height.toString()]]);var W=g.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(H,me){var Qe=g.y+W*(me+1);Et.setAttributes(H,[["x1",""+g.x],["y1",""+Qe],["x2",""+(g.x+g.width)],["y2",""+Qe]])});var Q=g.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(H,me){var Qe=g.x+Q*(me+1);Et.setAttributes(H,[["x1",""+Qe],["y1",""+g.y],["x2",""+Qe],["y2",""+(g.y+g.height)]])}),Et.setAttributes(this.cropShadeElement,[["d",Et.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,g.x,g.y,g.width,g.height)]]),this.topLeftGrip.setCenter(g.x,g.y),this.topRightGrip.setCenter(g.x+g.width,g.y),this.bottomLeftGrip.setCenter(g.x,g.y+g.height),this.bottomRightGrip.setCenter(g.x+g.width,g.y+g.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},z.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)},z.prototype.clientToLocalCoordinates=function(l,g){var W=this.container.getBoundingClientRect();return{x:l-W.left+this.margin,y:g-W.top+this.margin}},z.prototype.onPointerDown=function(l){this.container.setPointerCapture(l.pointerId),this.previousPoint=this.clientToLocalCoordinates(l.clientX,l.clientY),this.cropRectElement===l.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(l.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(l.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(l.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(l.target)&&(this.activeGrip=this.bottomRightGrip)},z.prototype.onPointerMove=function(l){if(this.isMoving)this.move(this.clientToLocalCoordinates(l.clientX,l.clientY));else if(this.activeGrip){var g=this.clientToLocalCoordinates(l.clientX,l.clientY);this.resize(g)}l.preventDefault()},z.prototype.onPointerUp=function(l){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(l.pointerId)},z.prototype.move=function(l){var g=l.x-this.previousPoint.x,W=l.y-this.previousPoint.y;this.zoomFactor!==1&&(g=-g/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+g),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=l},z.prototype.resize=function(l){var g=Object.assign({},this.cropRect),W=l.x-this.previousPoint.x,Q=l.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:g.x+W<this.margin&&(W=this.margin-g.x),g.x+=W,g.width=this.cropRect.x+this.cropRect.width-g.x;break;case this.bottomRightGrip:case this.topRightGrip:g.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-g.width),g.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(g.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),g.height=this.aspectRatio.getVerticalLength(g.width)):(g.y+=Q,g.height=this.cropRect.y+this.cropRect.height-g.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?g.height=this.aspectRatio.getVerticalLength(g.width):g.height+=Q}g.width<10&&(g.x=this.cropRect.x,g.width=10),g.height<10&&(g.y=this.cropRect.y,g.height=10),this.previousPoint=l,g.x>=this.margin&&g.y>=this.margin&&g.x-this.margin+g.width<=this.canvasWidth&&g.y-this.margin+g.height<=this.canvasHeight&&(this.cropRect=g,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var l=this.cropRect.x+this.cropRect.width/2,g=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),Q=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<Q/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=Q,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=l-this.cropRect.width/2,this.cropRect.y=g-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)}},z.prototype.getRescaledRect=function(l,g,W,Q,H,me){var Qe=W/l,Xe=Q/g;return{x:(H.x-me)*Qe+me,y:(H.y-me)*Xe+me,width:H.width*Qe,height:H.height*Xe}},z.prototype.scaleCanvas=function(l,g){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,l,g,this.cropRect,this.margin);this.canvasWidth=l,this.canvasHeight=g,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},z}(),Xr=function(){function z(l){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=l,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(z.prototype,"angle",{get:function(){return this._angle},set:function(l){this._angle=l,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),z.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},z.prototype.onPointerDown=function(l){this.controlContainer.setPointerCapture(l.pointerId),this.isDragging=!0,this.previousPoint={x:l.clientX,y:l.clientY}},z.prototype.onPointerMove=function(l){this.isDragging&&(this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.previousPoint.x=l.clientX)},z.prototype.onPointerUp=function(l){this.isDragging&&this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(l.pointerId)},z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var l=this.angleLabelText.getBBox();Et.setAttributes(this.angleLabelElement,[["x",((this.width-l.width)/2).toString()],["y",(this.height/2).toString()]])}},z.prototype.positionScaleShape=function(){if(this.scaleShape){var l=this.scaleShape.transform.baseVal.getItem(0);l.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(l,0)}},z.prototype.getVisual=function(){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg"),l.setAttribute("width",this.width+"px"),l.setAttribute("height",this.height+"px"),l.setAttribute("viewBox","0 0 "+this.width+" "+this.height),l.style.flexShrink="0",document.body.appendChild(l);for(var g="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var Q=W%5==0?this.height/3:this.height/6;g+="h4v"+-Q+"h1v"+Q}g+="v1H0Z",this.scaleShape=Et.createPath(g);var H=Et.createTransform();this.scaleShape.transform.baseVal.appendItem(H),l.appendChild(this.scaleShape),this.angleLabelElement=Et.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Et.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var me=Et.createTSpan("");return me.innerHTML="°",this.angleLabelElement.appendChild(me),l.appendChild(this.angleLabelElement),document.body.removeChild(l),l},z}(),ln=function(){function z(){this.naturalSize=!1,this.imageType="image/png"}return z.prototype.rasterize=function(l,g,W,Q,H,me,Qe){var Xe=this;return new Promise(function(ft){var Je=document.createElement("canvas");Je.width=l.width.baseVal.value-2*Q,Je.height=l.height.baseVal.value-2*Q;var St=1,It=1;Xe.naturalSize===!0?(St=g.naturalWidth/(l.width.baseVal.value-2*Q)/me,It=g.naturalHeight/(l.height.baseVal.value-2*Q)/Qe,Je.width=g.naturalWidth/me,Je.height=g.naturalHeight/Qe):Xe.width!==void 0&&Xe.height!==void 0&&(St=Xe.width/W.width,It=Xe.height/W.height,Je.width*=St,Je.height*=It);var $t=Je.getContext("2d");$t.translate(Je.width/2,Je.height/2),$t.rotate(H*Math.PI/180),$t.scale(me,Qe),$t.translate(-Je.width/2,-Je.height/2),$t.drawImage(g,0,0,Je.width,Je.height);var jr=document.createElement("canvas");jr.width=W.width*St,jr.height=W.height*It,jr.getContext("2d").putImageData($t.getImageData((W.x-Q)*St,(W.y-Q)*It,W.width*St,W.height*It),0,0),ft(jr.toDataURL(Xe.imageType,Xe.imageQuality))})},z}(),qe=function(){function z(l){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=z.instanceCounter++,this.styles=new Nr(this.instanceNo),this.target=l,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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(l){this._zoomToCropEnabled=l,l?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(l){this._gridLines=l,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(l){this._rotationAngle=l,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"aspectRatio",{get:function(){var l;return(l=this._aspectRatio)!==null&&l!==void 0?l:this.aspectRatios[0]},set:function(l){this._aspectRatio=l},enumerable:!1,configurable:!0}),z.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},z.prototype.show=function(){this.showUI(),this.open()},z.prototype.close=function(l){l===void 0&&(l=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),l||this.closeEventListeners.forEach(function(g){return g()}),this._isOpen=!1)},z.prototype.addRenderEventListener=function(l){this.renderEventListeners.push(l)},z.prototype.removeRenderEventListener=function(l){this.renderEventListeners.indexOf(l)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(l),1)},z.prototype.addCloseEventListener=function(l){this.closeEventListeners.push(l)},z.prototype.removeCloseEventListener=function(l){this.closeEventListeners.indexOf(l)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(l),1)},z.prototype.setupResizeObserver=function(){var l=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.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))},z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var l=1*this.target.clientWidth/this.target.clientHeight,g=this.contentDiv.clientWidth/l>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*l:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=g+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/l;this.resize(g,W)}},z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},z.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",Et.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},z.prototype.resize=function(l,g){this.imageWidth=Math.round(l),this.imageHeight=Math.round(g),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()},z.prototype.setEditingTarget=function(){var l=document.createElement("canvas");l.width=this.target.naturalWidth,l.height=this.target.naturalHeight,l.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var g=l.toDataURL();Et.setAttributes(this.editingTarget,[["href",g]]),this.setEditingTargetSize()},z.prototype.setTopLeft=function(){var l=this.target.getBoundingClientRect(),g=this.editorCanvas.getBoundingClientRect();this.left=l.left-g.left-this.CANVAS_MARGIN,this.top=l.top-g.top-this.CANVAS_MARGIN},z.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=Et.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Et.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Et.createGroup(),this.editingTargetRotationScaleContainer=Et.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var l=Et.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(l);var g=Et.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(g),this.editingTargetContainer=Et.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)},z.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},z.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Et.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new or(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()},z.prototype.zoomToCrop=function(){if(this.cropRect){var l=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,g=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=l+"px "+g+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-l+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-g+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},z.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)},z.prototype.cropRectChanged=function(l){this.cropRect=l,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},z.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.prototype.showUI=function(){switch(this.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 l=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,g=this.target.offsetTop>l+this.CANVAS_MARGIN?this.target.offsetTop-(l+this.CANVAS_MARGIN):0;this.coverDiv.style.top=g+"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},z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},z.prototype.addTopToolbar=function(){var l=this;this.topToolbar=new Fr,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 g=new sn;g.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(g);var W=[];this.aspectRatios.forEach(function(It){var $t=new Ft(rn.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);$t.onClick=function(){return l.ratioButtonClicked(It)},W.push($t)}),this.aspectRatioButton=new Or(rn.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,g.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Q=new Ft('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");Q.isActive=this.isGridVisible,Q.onClick=function(){l.isGridVisible=!l.isGridVisible,Q.isActive=l.isGridVisible},g.addButton(Q);var H=new Ft('<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(H.isActive=this.zoomToCropEnabled,H.onClick=function(){l.zoomToCropEnabled=!l.zoomToCropEnabled,H.isActive=l.zoomToCropEnabled},g.addButton(H),!on.isLicensed){var me=new vt;this.topToolbar.addElementBlock(me);var Qe=document.createElement("div");Qe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Xe=document.createElement("a");Xe.style.color="currentColor",Xe.href="https://markerjs.com/products/cropro",Xe.target="_blank",Xe.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>',Qe.appendChild(Xe),me.addElement(Qe)}var ft=new sn;ft.minWidth=3*this.toolbarHeight+"px",ft.contentAlign="end",this.topToolbar.addButtonBlock(ft);var Je=new Ft('<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");Je.onClick=this.startRenderAndClose,ft.addButton(Je),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Je.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var St=new Ft('<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");St.onClick=this.close,ft.addButton(St),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(St.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var l=this;this.bottomToolbar=new Fr,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 g=new sn;g.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(g);var W=new Ft('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");W.onClick=this.rotateLeftButtonClicked,g.addButton(W);var Q=new Ft('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");Q.onClick=this.rotateRightButtonClicked,g.addButton(Q);var H=new vt;H.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(H),this.straightener=new Xr("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(ft){l.rotateBy(ft),l.straightener.angle=l.rotationAngle},H.addElement(this.straightener.getUI());var me=new sn;me.minWidth=2*this.toolbarHeight+"px",me.contentAlign="end",this.bottomToolbar.addButtonBlock(me);var Qe=new Ft('<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");Qe.onClick=this.flipHorizontallyButtonClicked,me.addButton(Qe);var Xe=new Ft('<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");Xe.onClick=this.flipVerticallyButtonClicked,me.addButton(Xe)},z.prototype.ratioButtonClicked=function(l){this.aspectRatio=l,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=rn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ar(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},z.prototype.restoreState=function(l){if(l){var g=this.cropLayer.getRescaledRect(l.width,l.height,this.imageWidth,this.imageHeight,l.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(g),this.cropRectChanged(g),this.flippedHorizontally=l.flippedHorizontally,this.flippedVertically=l.flippedVertically,this.applyFlip(),this.rotationAngle=l.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(l,g){var W=this.cropImage.getBoundingClientRect();return{x:l-W.left,y:g-W.top}},z.prototype.onWindowResize=function(){this.positionUI()},z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var l=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=l+"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()},z.prototype.rotateLeftButtonClicked=function(){var l=this.rotationAngle-90;this.rotationAngle%90!=0&&(l+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(l)},z.prototype.rotateRightButtonClicked=function(){var l=this.rotationAngle+90;this.rotationAngle%90!=0&&(l-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(l)},z.prototype.rotateTo=function(l){l=(l=l>180?l-360:l)<=-180?l+360:l,this.rotationAngle=l,this.applyRotation()},z.prototype.rotateBy=function(l){this.rotateTo((this.rotationAngle+l)%360)},z.prototype.applyRotation=function(){var l=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var g=this.editingTargetRotationContainer.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(g,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=l},z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},z.prototype.startRenderAndClose=function(){return Lt(this,void 0,void 0,function(){var l,g;return Yr(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return l=W.sent(),g=this.getState(),this.renderEventListeners.forEach(function(Q){return Q(l,g)}),this.close(!0),[2]}})})},z.prototype.render=function(){return Lt(this,void 0,void 0,function(){var l;return Yr(this,function(g){switch(g.label){case 0:return(l=new ln).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.width=this.renderWidth,l.height=this.renderHeight,this.unzoomFromCrop(),Et.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,l.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 g.sent(),[4,l.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,g.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Cr("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 Cr("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Cr("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var l=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Cr("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*l)+`px;
|
|
height: `+(this.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Cr("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Cr("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new ur("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ur("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Cr("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 Cr("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Cr("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 Cr("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*l)+`px;
|
|
padding: `+l+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Cr("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},z.instanceCounter=0,z}(),At=Z("8hTe"),un=Z.n(At),vn=/<pre[^>]*>/g;function dn(z){var l=document.createElement("div");return l.innerHTML=z,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var cn=Ie.a=function(z){var l=z.value,g=l===void 0?"":l,W=z.edit,Q=W===void 0?!1:W,H=z.className,me=z.showTextOnly,Qe=z.showLines,Xe=z.replaces,ft=z.zoomImg,Je=z.hasMask,St=z.style,It=St===void 0?{}:St,$t=z.stylesPrev,jr=$t===void 0?{}:$t,Mr=String(g),He=Object(k.useRef)(),Rt=Object(k.useRef)(),er=Object(k.useState)(""),kt=Object(G.a)(er,2),nr=kt[0],Xt=kt[1],dr=Object(k.useState)("office"),Pt=Object(G.a)(dr,2),bt=Pt[0],jt=Pt[1],sr=function(){var Ut=new qe(Rt.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var kr=Object(M.a)(P.a.mark(function Gt(yr){var Jt;return P.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return He.current.style.display="none",mr.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yr}});case 3:Jt=mr.sent,Jt!=null&&Jt.id&&Xe(Rt.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Jt==null?void 0:Jt.id,"?type=").concat(Jt.content_type));case 5:case"end":return mr.stop()}},Gt)}));return function(Gt){return kr.apply(this,arguments)}}()),Ut.show()},Vt=function(){var Ut=new Ht(Rt.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var kr=Object(M.a)(P.a.mark(function Gt(yr){var Jt;return P.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(He.current.style.display="none",!Rt.current){mr.next=6;break}return mr.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yr.dataUrl}});case 4:Jt=mr.sent,Jt!=null&&Jt.id&&Xe(Rt.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Jt==null?void 0:Jt.id,"?type=").concat(Jt.content_type));case 6:case"end":return mr.stop()}},Gt)}));return function(Gt){return kr.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},Qt=Object(k.useMemo)(function(){try{var cr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,kr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Mr=Mr.replace(cr,"("+ee.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+ee.a.API_SERVER+"/api/attachments/").replace(kr,'"'+ee.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),Mr=Mr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(yn){}var Gt=V(Mr),yr=E();if(Mr.match(/\[TOC\]/)&&(Gt=Gt.replace("<p>[TOC]</p>",D()),T()),Gt=Gt.replace(/(__special_katext_id_\d+__)/g,function(yn,mr){var Wr=yr[mr],Qn=Wr.type,Yn=Wr.expression;return Object(oe.renderToString)(dn(Yn)||"",{displayMode:Qn==="block",throwOnError:!1,output:"html"})}),Gt=Gt.replace(/▁/g,"\u2581\u2581\u2581"),b(),me){var Jt=document.createElement("div");return Jt.innerHTML=Gt,Jt.innerText}return setTimeout(function(){return hn()},500),Gt},[Mr]),tr=Object(k.useRef)();p.WebkitLineClamp=Qe,Qe&&(It=Object(B.a)(Object(B.a)({},It),p));function vr(cr){var Ut=cr.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ft){var kr=Ut.getAttribute("src");Xt(kr),jt("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Gt=Ut.getAttribute("href");if(Gt.indexOf("office")>-1)cr.preventDefault(),Xt(Gt),jt("office");else if(Gt.indexOf("application/pdf")>-1)cr.preventDefault(),Xt(Gt),jt("pdf");else if(Gt.indexOf("type=text")>-1)cr.preventDefault(),Xt(Gt),jt("html");else if(Gt.startsWith("#")){cr.preventDefault();var yr=document.getElementById(Gt.replace("#",""));yr&&yr.scrollIntoView(!0)}}}var hn=function(){var Ut,kr=(Ut=tr.current)===null||Ut===void 0?void 0:Ut.querySelectorAll("video");kr==null||kr.forEach(function(Gt){if(Gt.oncontextmenu=function(){return!1},Gt.src.indexOf(".m3u8")>-1&&!Gt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var yr=new Y.a;yr.loadSource(Gt.src),yr.attachMedia(Gt)}}})};Object(k.useEffect)(function(){if(tr.current&&Qt&&(Qt.match(vn)&&window.PR.prettyPrint()),tr.current)return tr.current.addEventListener("click",vr),function(){tr.current.removeEventListener("click",vr),b(),T()}},[Qt,tr.current,vr]);var Cn=function(Ut){if(!Q)return;Ut.target.nodeName==="IMG"?(He.current.style.display="flex",He.current.style.width=Ut.target.clientWidth+"px",He.current.style.height=Ut.target.clientHeight+"px",He.current.style.top=Ut.target.offsetTop+"px",He.current.style.left=Ut.target.offsetLeft+"px",Rt.current.src=Ut.target.getAttribute("src")):He.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:tr,style:Object(B.a)({},It),className:"".concat(H||""," markdown-body ").concat(un.a.mdBody),onMouseOver:Cn,dangerouslySetInnerHTML:{__html:Qt}}),y.a.createElement("div",{ref:He,className:un.a.button},y.a.createElement(q.a,null,y.a.createElement(J.a,{onClick:function(){return sr()}},"\u88C1\u526A"),y.a.createElement(J.a,{onClick:function(){return Vt()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Rt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(he.a,{close:!0,data:nr,hasMask:Je,type:nr!=null&&nr.length?bt:"",style:Object(B.a)({},jr),onClose:function(){return Xt("")}}))}},"9VGf":function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return L});var le=Z("q1tI"),q=Z.n(le);function L(J,B){var M=Object(le.useRef)();Object(le.useEffect)(function(){M.current=J}),Object(le.useEffect)(function(){function G(){M.current()}if(B!==null){var F=setInterval(G,B);return function(){return clearInterval(F)}}},[B])}},"A/g1":function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD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oA9Hvj7ftmhMAkFbZyaxaQH1a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},BU3w:function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return M});var le=Z("MNnm"),q="rc-util-key";function L(G){if(G.attachTo)return G.attachTo;var F=document.querySelector("head");return F||document.body}function J(G){var F,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(le.a)())return null;var k=document.createElement("style");if((F=P.csp)===null||F===void 0?void 0:F.nonce){var y;k.nonce=(y=P.csp)===null||y===void 0?void 0:y.nonce}k.innerHTML=G;var C=L(P),O=C.firstChild;return P.prepend&&C.prepend?C.prepend(k):P.prepend&&O?C.insertBefore(k,O):C.appendChild(k),k}var B=new Map;function M(G,F){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=L(P);if(!B.has(k)){var y=J("",P),C=y.parentNode;B.set(k,C),C.removeChild(y)}var O=Array.from(B.get(k).children).find(function(s){return s.tagName==="STYLE"&&s[q]===F});if(O){var R,A;if(((R=P.csp)===null||R===void 0?void 0:R.nonce)&&O.nonce!==((A=P.csp)===null||A===void 0?void 0:A.nonce)){var S;O.nonce=(S=P.csp)===null||S===void 0?void 0:S.nonce}return O.innerHTML!==G&&(O.innerHTML=G),O}var c=J(G,P);return c[q]=F,c}},Bd2K:function(Ke,Ie,Z){(function(le){le(Z("VrN/"),Z("osHv"))})(function(le){le.defineOption("autoCloseTags",!1,function(P,k,y){if(y!=le.Init&&y&&P.removeKeyMap("autoCloseTags"),!k)return;var C={name:"autoCloseTags"};(typeof k!="object"||k.whenClosing!==!1)&&(C["'/'"]=function(O){return M(O)}),(typeof k!="object"||k.whenOpening!==!1)&&(C["'>'"]=function(O){return J(O)}),P.addKeyMap(C)});var q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["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 J(P){if(P.getOption("disableInput"))return le.Pass;for(var k=P.listSelections(),y=[],C=P.getOption("autoCloseTags"),O=0;O<k.length;O++){if(!k[O].empty())return le.Pass;var R=k[O].head,A=P.getTokenAt(R),S=le.innerMode(P.getMode(),A.state),c=S.state,s=S.mode.xmlCurrentTag&&S.mode.xmlCurrentTag(c),u=s&&s.name;if(!u)return le.Pass;var h=S.mode.configuration=="html",T=typeof C=="object"&&C.dontCloseTags||h&&q,p=typeof C=="object"&&C.indentTags||h&&L;A.end>R.ch&&(u=u.slice(0,u.length-A.end+R.ch));var f=u.toLowerCase();if(!u||A.type=="string"&&(A.end!=R.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&s.close||A.string.indexOf("/")==R.ch-A.start-1||T&&G(T,f)>-1||F(P,S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(c)||[],u,R,!0))return le.Pass;var D=typeof C=="object"&&C.emptyTags;if(D&&G(D,u)>-1){y[O]={text:"/>",newPos:le.Pos(R.line,R.ch+2)};continue}var v=p&&G(p,f)>-1;y[O]={indent:v,text:">"+(v?`
|
|
|
|
`:"")+"</"+u+">",newPos:v?le.Pos(R.line+1,0):le.Pos(R.line,R.ch+1)}}for(var m=typeof C=="object"&&C.dontIndentOnAutoClose,O=k.length-1;O>=0;O--){var a=y[O];P.replaceRange(a.text,k[O].head,k[O].anchor,"+insert");var d=P.listSelections().slice(0);d[O]={head:a.newPos,anchor:a.newPos},P.setSelections(d),!m&&a.indent&&(P.indentLine(a.newPos.line,null,!0),P.indentLine(a.newPos.line+1,null,!0))}}function B(P,k){for(var y=P.listSelections(),C=[],O=k?"/":"</",R=P.getOption("autoCloseTags"),A=typeof R=="object"&&R.dontIndentOnSlash,S=0;S<y.length;S++){if(!y[S].empty())return le.Pass;var c=y[S].head,s=P.getTokenAt(c),u=le.innerMode(P.getMode(),s.state),h=u.state;if(k&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=c.ch-1))return le.Pass;var T,p=u.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(p&&u.mode.name=="javascript")T=O+"script";else if(p&&u.mode.name=="css")T=O+"style";else{var f=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(h);if(!f||f.length&&F(P,f,f[f.length-1],c))return le.Pass;T=O+f[f.length-1]}P.getLine(c.line).charAt(s.end)!=">"&&(T+=">"),C[S]=T}if(P.replaceSelections(C),y=P.listSelections(),!A)for(var S=0;S<y.length;S++)(S==y.length-1||y[S].head.line<y[S+1].head.line)&&P.indentLine(y[S].head.line)}function M(P){return P.getOption("disableInput")?le.Pass:B(P,!0)}le.commands.closeTag=function(P){return B(P)};function G(P,k){if(P.indexOf)return P.indexOf(k);for(var y=0,C=P.length;y<C;++y)if(P[y]==k)return y;return-1}function F(P,k,y,C,O){if(!le.scanForClosingTag)return!1;var R=Math.min(P.lastLine()+1,C.line+500),A=le.scanForClosingTag(P,C,null,R);if(!A||A.tag!=y)return!1;for(var S=O?1:0,c=k.length-1;c>=0&&k[c]==y;c--)++S;C=A.to;for(var c=1;c<S;c++){var s=le.scanForClosingTag(P,C,null,R);if(!s||s.tag!=y)return!1;C=s.to}return!0}})},BjJ7:function(Ke,Ie,Z){"use strict";Z.d(Ie,"d",function(){return q}),Z.d(Ie,"c",function(){return L}),Z.d(Ie,"e",function(){return J}),Z.d(Ie,"b",function(){return B}),Z.d(Ie,"a",function(){return G});var le=Z("m3rI");function q(F){var P=!0;if(F.length>0){for(var k=0;k<F.length;k++)if(F[k].compile_success==0||!F[k].compile_success){P=!1;break}}else P=!1;return P}function L(F){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",k=[],y=0;y<F.length;y++){var C=F[y],O=P?"".concat(P,"/").concat(C.name):"".concat(C.name);k.push({title:C.name,isLeaf:!(C.type==="tree"),key:O})}return k}function J(F,P,k){for(var y=0;y<F.length;y++){var C=F[y];if(C.key===P){C.children=k;break}C.children&&J(C.children,P,k)}return F}function B(F,P,k){var y;return function(){var C=this,O=arguments,R=function(){y=null,k||F.apply(C,O)},A=k&&!y;clearTimeout(y),y=setTimeout(R,P),A&&F.apply(C,O)}}var M=!0,G=le.a.API_SERVER},"C+DQ":function(Ke,Ie,Z){},DlQD:function(Ke,Ie,Z){(function(le,q){Ke.exports=q()})(this,function(){"use strict";function le(Ee,ge){for(var be=0;be<ge.length;be++){var ne=ge[be];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(Ee,ne.key,ne)}}function q(Ee,ge,be){return ge&&le(Ee.prototype,ge),be&&le(Ee,be),Ee}function L(Ee,ge){if(!Ee)return;if(typeof Ee=="string")return J(Ee,ge);var be=Object.prototype.toString.call(Ee).slice(8,-1);if(be==="Object"&&Ee.constructor&&(be=Ee.constructor.name),be==="Map"||be==="Set")return Array.from(Ee);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return J(Ee,ge)}function J(Ee,ge){(ge==null||ge>Ee.length)&&(ge=Ee.length);for(var be=0,ne=new Array(ge);be<ge;be++)ne[be]=Ee[be];return ne}function B(Ee,ge){var be;if(typeof Symbol=="undefined"||Ee[Symbol.iterator]==null){if(Array.isArray(Ee)||(be=L(Ee))||ge&&Ee&&typeof Ee.length=="number"){be&&(Ee=be);var ne=0;return function(){return ne>=Ee.length?{done:!0}:{done:!1,value:Ee[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return be=Ee[Symbol.iterator](),be.next.bind(be)}function M(Ee,ge){return ge={exports:{}},Ee(ge,ge.exports),ge.exports}var G=M(function(Ee){function ge(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function be(ne){Ee.exports.defaults=ne}Ee.exports={defaults:ge(),getDefaults:ge,changeDefaults:be}}),F=G.defaults,P=G.getDefaults,k=G.changeDefaults,y=/[&<>"']/,C=/[&<>"']/g,O=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},S=function(ge){return A[ge]};function c(Ee,ge){if(ge){if(y.test(Ee))return Ee.replace(C,S)}else if(O.test(Ee))return Ee.replace(R,S);return Ee}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(Ee){return Ee.replace(s,function(ge,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var h=/(^|[^\[])\^/g;function T(Ee,ge){Ee=Ee.source||Ee,ge=ge||"";var be={replace:function(ie,se){return se=se.source||se,se=se.replace(h,"$1"),Ee=Ee.replace(ie,se),be},getRegex:function(){return new RegExp(Ee,ge)}};return be}var p=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ee,ge,be){if(Ee){var ne;try{ne=decodeURIComponent(u(be)).replace(p,"").toLowerCase()}catch(ie){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ge&&!f.test(be)&&(be=o(ge,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(ie){return null}return be}var v={},m=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(Ee,ge){v[" "+Ee]||(m.test(Ee)?v[" "+Ee]=Ee+"/":v[" "+Ee]=N(Ee,"/",!0)),Ee=v[" "+Ee];var be=Ee.indexOf(":")===-1;return ge.substring(0,2)==="//"?be?ge:Ee.replace(a,"$1")+ge:ge.charAt(0)==="/"?be?ge:Ee.replace(d,"$1")+ge:Ee+ge}var E={exec:function(){}};function b(Ee){for(var ge=1,be,ne;ge<arguments.length;ge++){be=arguments[ge];for(ne in be)Object.prototype.hasOwnProperty.call(be,ne)&&(Ee[ne]=be[ne])}return Ee}function x(Ee,ge){var be=Ee.replace(/\|/g,function(se,ue,ke){for(var Se=!1,Ve=ue;--Ve>=0&&ke[Ve]==="\\";)Se=!Se;return Se?"|":" |"}),ne=be.split(/ \|/),ie=0;if(ne.length>ge)ne.splice(ge);else for(;ne.length<ge;)ne.push("");for(;ie<ne.length;ie++)ne[ie]=ne[ie].trim().replace(/\\\|/g,"|");return ne}function N(Ee,ge,be){var ne=Ee.length;if(ne===0)return"";for(var ie=0;ie<ne;){var se=Ee.charAt(ne-ie-1);if(se===ge&&!be)ie++;else if(se!==ge&&be)ie++;else break}return Ee.substr(0,ne-ie)}function U(Ee,ge){if(Ee.indexOf(ge[1])===-1)return-1;for(var be=Ee.length,ne=0,ie=0;ie<be;ie++)if(Ee[ie]==="\\")ie++;else if(Ee[ie]===ge[0])ne++;else if(Ee[ie]===ge[1]&&(ne--,ne<0))return ie;return-1}function K(Ee){Ee&&Ee.sanitize&&!Ee.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 V={escape:c,unescape:u,edit:T,cleanUrl:D,resolveUrl:o,noopTest:E,merge:b,splitCells:x,rtrim:N,findClosingBracket:U,checkSanitizeDeprecation:K},_=G.defaults,I=V.rtrim,Y=V.splitCells,ee=V.escape,oe=V.findClosingBracket;function he(Ee,ge,be){var ne=ge.href,ie=ge.title?ee(ge.title):null,se=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:be,href:ne,title:ie,text:se}:{type:"image",raw:be,href:ne,title:ie,text:ee(se)}}function Le(Ee,ge){var be=Ee.match(/^(\s+)(?:```)/);if(be===null)return ge;var ne=be[1];return ge.split(`
|
|
`).map(function(ie){var se=ie.match(/^\s+/);if(se===null)return ie;var ue=se[0];return ue.length>=ne.length?ie.slice(ne.length):ie}).join(`
|
|
`)}var xe=function(){function Ee(be){this.options=be||_}var ge=Ee.prototype;return ge.space=function(ne){var ie=this.rules.block.newline.exec(ne);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},ge.code=function(ne,ie){var se=this.rules.block.code.exec(ne);if(se){var ue=ie[ie.length-1];if(ue&&ue.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var ke=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:I(ke,`
|
|
`)}}},ge.fences=function(ne){var ie=this.rules.block.fences.exec(ne);if(ie){var se=ie[0],ue=Le(se,ie[3]||"");return{type:"code",raw:se,lang:ie[2]?ie[2].trim():ie[2],text:ue}}},ge.heading=function(ne){var ie=this.rules.block.heading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ge.nptable=function(ne){var ie=this.rules.block.nptable.exec(ne);if(ie){var se={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(se.header.length===se.align.length){var ue=se.align.length,ke;for(ke=0;ke<ue;ke++)/^ *-+: *$/.test(se.align[ke])?se.align[ke]="right":/^ *:-+: *$/.test(se.align[ke])?se.align[ke]="center":/^ *:-+ *$/.test(se.align[ke])?se.align[ke]="left":se.align[ke]=null;for(ue=se.cells.length,ke=0;ke<ue;ke++)se.cells[ke]=Y(se.cells[ke],se.header.length);return se}}},ge.hr=function(ne){var ie=this.rules.block.hr.exec(ne);if(ie)return{type:"hr",raw:ie[0]}},ge.blockquote=function(ne){var ie=this.rules.block.blockquote.exec(ne);if(ie){var se=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:se}}},ge.list=function(ne){var ie=this.rules.block.list.exec(ne);if(ie){for(var se=ie[0],ue=ie[2],ke=ue.length>1,Se=ue[ue.length-1]===")",Ve={type:"list",raw:se,ordered:ke,start:ke?+ue.slice(0,-1):"",loose:!1,items:[]},at=ie[0].match(this.rules.block.item),We=!1,mt,wt,ze,lt,Mt,Ht,qt,zt=at.length,Lt=0;Lt<zt;Lt++)mt=at[Lt],se=mt,wt=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
|
|
`)&&(wt-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),Lt!==zt-1&&(ze=this.rules.block.bullet.exec(at[Lt+1])[0],(ke?ze.length===1||!Se&&ze[ze.length-1]===")":ze.length>1||this.options.smartLists&&ze!==ue)&&(lt=at.slice(Lt+1).join(`
|
|
`),Ve.raw=Ve.raw.substring(0,Ve.raw.length-lt.length),Lt=zt-1)),Mt=We||/\n\n(?!\s*$)/.test(mt),Lt!==zt-1&&(We=mt.charAt(mt.length-1)===`
|
|
`,Mt||(Mt=We)),Mt&&(Ve.loose=!0),Ht=/^\[[ xX]\] /.test(mt),qt=void 0,Ht&&(qt=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),Ve.items.push({type:"list_item",raw:se,task:Ht,checked:qt,loose:Mt,text:mt});return Ve}},ge.html=function(ne){var ie=this.rules.block.html.exec(ne);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ge.def=function(ne){var ie=this.rules.block.def.exec(ne);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var se=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:se,raw:ie[0],href:ie[2],title:ie[3]}}},ge.table=function(ne){var ie=this.rules.block.table.exec(ne);if(ie){var se={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(se.header.length===se.align.length){se.raw=ie[0];var ue=se.align.length,ke;for(ke=0;ke<ue;ke++)/^ *-+: *$/.test(se.align[ke])?se.align[ke]="right":/^ *:-+: *$/.test(se.align[ke])?se.align[ke]="center":/^ *:-+ *$/.test(se.align[ke])?se.align[ke]="left":se.align[ke]=null;for(ue=se.cells.length,ke=0;ke<ue;ke++)se.cells[ke]=Y(se.cells[ke].replace(/^ *\| *| *\| *$/g,""),se.header.length);return se}}},ge.lheading=function(ne){var ie=this.rules.block.lheading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ge.paragraph=function(ne){var ie=this.rules.block.paragraph.exec(ne);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},ge.text=function(ne,ie){var se=this.rules.block.text.exec(ne);if(se){var ue=ie[ie.length-1];return ue&&ue.type==="text"?{raw:se[0],text:se[0]}:{type:"text",raw:se[0],text:se[0]}}},ge.escape=function(ne){var ie=this.rules.inline.escape.exec(ne);if(ie)return{type:"escape",raw:ie[0],text:ee(ie[1])}},ge.tag=function(ne,ie,se){var ue=this.rules.inline.tag.exec(ne);if(ue)return!ie&&/^<a /i.test(ue[0])?ie=!0:ie&&/^<\/a>/i.test(ue[0])&&(ie=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:ie,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):ee(ue[0]):ue[0]}},ge.link=function(ne){var ie=this.rules.inline.link.exec(ne);if(ie){var se=oe(ie[2],"()");if(se>-1){var ue=ie[0].indexOf("!")===0?5:4,ke=ue+ie[1].length+se;ie[2]=ie[2].substring(0,se),ie[0]=ie[0].substring(0,ke).trim(),ie[3]=""}var Se=ie[2],Ve="";if(this.options.pedantic){var at=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);at?(Se=at[1],Ve=at[3]):Ve=""}else Ve=ie[3]?ie[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var We=he(ie,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:Ve&&Ve.replace(this.rules.inline._escapes,"$1")},ie[0]);return We}},ge.reflink=function(ne,ie){var se;if((se=this.rules.inline.reflink.exec(ne))||(se=this.rules.inline.nolink.exec(ne))){var ue=(se[2]||se[1]).replace(/\s+/g," ");if(ue=ie[ue.toLowerCase()],!ue||!ue.href){var ke=se[0].charAt(0);return{type:"text",raw:ke,text:ke}}var Se=he(se,ue,se[0]);return Se}},ge.strong=function(ne,ie,se){se===void 0&&(se="");var ue=this.rules.inline.strong.start.exec(ne);if(ue&&(!ue[1]||ue[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){ie=ie.slice(-1*ne.length);var ke=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var Se;(ue=ke.exec(ie))!=null;)if(Se=this.rules.inline.strong.middle.exec(ie.slice(0,ue.index+3)),Se)return{type:"strong",raw:ne.slice(0,Se[0].length),text:ne.slice(2,Se[0].length-2)}}},ge.em=function(ne,ie,se){se===void 0&&(se="");var ue=this.rules.inline.em.start.exec(ne);if(ue&&(!ue[1]||ue[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){ie=ie.slice(-1*ne.length);var ke=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var Se;(ue=ke.exec(ie))!=null;)if(Se=this.rules.inline.em.middle.exec(ie.slice(0,ue.index+2)),Se)return{type:"em",raw:ne.slice(0,Se[0].length),text:ne.slice(1,Se[0].length-1)}}},ge.codespan=function(ne){var ie=this.rules.inline.code.exec(ne);if(ie){var se=ie[2].replace(/\n/g," "),ue=/[^ ]/.test(se),ke=se.startsWith(" ")&&se.endsWith(" ");return ue&&ke&&(se=se.substring(1,se.length-1)),se=ee(se,!0),{type:"codespan",raw:ie[0],text:se}}},ge.br=function(ne){var ie=this.rules.inline.br.exec(ne);if(ie)return{type:"br",raw:ie[0]}},ge.del=function(ne){var ie=this.rules.inline.del.exec(ne);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ge.autolink=function(ne,ie){var se=this.rules.inline.autolink.exec(ne);if(se){var ue,ke;return se[2]==="@"?(ue=ee(this.options.mangle?ie(se[1]):se[1]),ke="mailto:"+ue):(ue=ee(se[1]),ke=ue),{type:"link",raw:se[0],text:ue,href:ke,tokens:[{type:"text",raw:ue,text:ue}]}}},ge.url=function(ne,ie){var se;if(se=this.rules.inline.url.exec(ne)){var ue,ke;if(se[2]==="@")ue=ee(this.options.mangle?ie(se[0]):se[0]),ke="mailto:"+ue;else{var Se;do Se=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Se!==se[0]);ue=ee(se[0]),se[1]==="www."?ke="http://"+ue:ke=ue}return{type:"link",raw:se[0],text:ue,href:ke,tokens:[{type:"text",raw:ue,text:ue}]}}},ge.inlineText=function(ne,ie,se){var ue=this.rules.inline.text.exec(ne);if(ue){var ke;return ie?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):ee(ue[0]):ue[0]:ke=ee(this.options.smartypants?se(ue[0]):ue[0]),{type:"text",raw:ue[0],text:ke}}},Ee}(),Ae=V.noopTest,Te=V.edit,Ce=V.merge,pe={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:Ae,table:Ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Te(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Te(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Te(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=Te(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Te(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Te(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Ce({},pe),pe.gfm=Ce({},pe.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*|$)"}),pe.gfm.nptable=Te(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Te(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Ce({},pe.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Ae,paragraph:Te(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ae,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:Ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};de._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",de.punctuation=Te(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Te(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Te(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Te(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Te(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Te(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Te(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Te(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Te(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Te(de._blockSkip,"g").getRegex(),de.overlapSkip=Te(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Te(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Te(de.tag).replace("comment",pe._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Te(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Te(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Te(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ce({},de),de.pedantic=Ce({},de.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ce({},de.normal,{escape:Te(de.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),de.gfm.url=Te(de.gfm.url,"i").replace("email",de.gfm._extended_email).getRegex(),de.breaks=Ce({},de.gfm,{br:Te(de.br).replace("{2,}","*").getRegex(),text:Te(de.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var re={block:pe,inline:de},ce=G.defaults,ae=re.block,we=re.inline;function De(Ee){return Ee.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 ye(Ee){var ge="",be,ne,ie=Ee.length;for(be=0;be<ie;be++)ne=Ee.charCodeAt(be),Math.random()>.5&&(ne="x"+ne.toString(16)),ge+="&#"+ne+";";return ge}var Me=function(){function Ee(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||ce,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:ae.normal,inline:we.normal};this.options.pedantic?(ne.block=ae.pedantic,ne.inline=we.pedantic):this.options.gfm&&(ne.block=ae.gfm,this.options.breaks?ne.inline=we.breaks:ne.inline=we.gfm),this.tokenizer.rules=ne}Ee.lex=function(ne,ie){var se=new Ee(ie);return se.lex(ne)};var ge=Ee.prototype;return ge.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(ne,ie,se){ie===void 0&&(ie=[]),se===void 0&&(se=!0),ne=ne.replace(/^ +$/gm,"");for(var ue,ke,Se,Ve;ne;){if(ue=this.tokenizer.space(ne)){ne=ne.substring(ue.raw.length),ue.type&&ie.push(ue);continue}if(ue=this.tokenizer.code(ne,ie)){ne=ne.substring(ue.raw.length),ue.type?ie.push(ue):(Ve=ie[ie.length-1],Ve.raw+=`
|
|
`+ue.raw,Ve.text+=`
|
|
`+ue.text);continue}if(ue=this.tokenizer.fences(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.heading(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.nptable(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.hr(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.blockquote(ne)){ne=ne.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],se),ie.push(ue);continue}if(ue=this.tokenizer.list(ne)){for(ne=ne.substring(ue.raw.length),Se=ue.items.length,ke=0;ke<Se;ke++)ue.items[ke].tokens=this.blockTokens(ue.items[ke].text,[],!1);ie.push(ue);continue}if(ue=this.tokenizer.html(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(se&&(ue=this.tokenizer.def(ne))){ne=ne.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.lheading(ne)){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(se&&(ue=this.tokenizer.paragraph(ne))){ne=ne.substring(ue.raw.length),ie.push(ue);continue}if(ue=this.tokenizer.text(ne,ie)){ne=ne.substring(ue.raw.length),ue.type?ie.push(ue):(Ve=ie[ie.length-1],Ve.raw+=`
|
|
`+ue.raw,Ve.text+=`
|
|
`+ue.text);continue}if(ne){var at="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return ie},ge.inline=function(ne){var ie,se,ue,ke,Se,Ve,at=ne.length;for(ie=0;ie<at;ie++){Ve=ne[ie];switch(Ve.type){case"paragraph":case"text":case"heading":{Ve.tokens=[],this.inlineTokens(Ve.text,Ve.tokens);break}case"table":{for(Ve.tokens={header:[],cells:[]},ke=Ve.header.length,se=0;se<ke;se++)Ve.tokens.header[se]=[],this.inlineTokens(Ve.header[se],Ve.tokens.header[se]);for(ke=Ve.cells.length,se=0;se<ke;se++)for(Se=Ve.cells[se],Ve.tokens.cells[se]=[],ue=0;ue<Se.length;ue++)Ve.tokens.cells[se][ue]=[],this.inlineTokens(Se[ue],Ve.tokens.cells[se][ue]);break}case"blockquote":{this.inline(Ve.tokens);break}case"list":{for(ke=Ve.items.length,se=0;se<ke;se++)this.inline(Ve.items[se].tokens);break}}}return ne},ge.inlineTokens=function(ne,ie,se,ue,ke){ie===void 0&&(ie=[]),se===void 0&&(se=!1),ue===void 0&&(ue=!1),ke===void 0&&(ke="");var Se,Ve=ne,at;if(this.tokens.links){var We=Object.keys(this.tokens.links);if(We.length>0)for(;(at=this.tokenizer.rules.inline.reflinkSearch.exec(Ve))!=null;)We.includes(at[0].slice(at[0].lastIndexOf("[")+1,-1))&&(Ve=Ve.slice(0,at.index)+"["+"a".repeat(at[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(at=this.tokenizer.rules.inline.blockSkip.exec(Ve))!=null;)Ve=Ve.slice(0,at.index)+"["+"a".repeat(at[0].length-2)+"]"+Ve.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Se=this.tokenizer.escape(ne)){ne=ne.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.tag(ne,se,ue)){ne=ne.substring(Se.raw.length),se=Se.inLink,ue=Se.inRawBlock,ie.push(Se);continue}if(Se=this.tokenizer.link(ne)){ne=ne.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,ue)),ie.push(Se);continue}if(Se=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,ue)),ie.push(Se);continue}if(Se=this.tokenizer.strong(ne,Ve,ke)){ne=ne.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],se,ue),ie.push(Se);continue}if(Se=this.tokenizer.em(ne,Ve,ke)){ne=ne.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],se,ue),ie.push(Se);continue}if(Se=this.tokenizer.codespan(ne)){ne=ne.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.br(ne)){ne=ne.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.del(ne)){ne=ne.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],se,ue),ie.push(Se);continue}if(Se=this.tokenizer.autolink(ne,ye)){ne=ne.substring(Se.raw.length),ie.push(Se);continue}if(!se&&(Se=this.tokenizer.url(ne,ye))){ne=ne.substring(Se.raw.length),ie.push(Se);continue}if(Se=this.tokenizer.inlineText(ne,ue,De)){ne=ne.substring(Se.raw.length),ke=Se.raw.slice(-1),ie.push(Se);continue}if(ne){var mt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return ie},q(Ee,null,[{key:"rules",get:function(){return{block:ae,inline:we}}}]),Ee}(),Pe=G.defaults,Ne=V.cleanUrl,Fe=V.escape,Be=function(){function Ee(be){this.options=be||Pe}var ge=Ee.prototype;return ge.code=function(ne,ie,se){var ue=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ke=this.options.highlight(ne,ue);ke!=null&&ke!==ne&&(se=!0,ne=ke)}return ue?'<pre><code class="'+this.options.langPrefix+Fe(ue,!0)+'">'+(se?ne:Fe(ne,!0))+`</code></pre>
|
|
`:"<pre><code>"+(se?ne:Fe(ne,!0))+`</code></pre>
|
|
`},ge.blockquote=function(ne){return`<blockquote>
|
|
`+ne+`</blockquote>
|
|
`},ge.html=function(ne){return ne},ge.heading=function(ne,ie,se,ue){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+ue.slug(se)+'">'+ne+"</h"+ie+`>
|
|
`:"<h"+ie+">"+ne+"</h"+ie+`>
|
|
`},ge.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ge.list=function(ne,ie,se){var ue=ie?"ol":"ul",ke=ie&&se!==1?' start="'+se+'"':"";return"<"+ue+ke+`>
|
|
`+ne+"</"+ue+`>
|
|
`},ge.listitem=function(ne){return"<li>"+ne+`</li>
|
|
`},ge.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(ne){return"<p>"+ne+`</p>
|
|
`},ge.table=function(ne,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ne+`</thead>
|
|
`+ie+`</table>
|
|
`},ge.tablerow=function(ne){return`<tr>
|
|
`+ne+`</tr>
|
|
`},ge.tablecell=function(ne,ie){var se=ie.header?"th":"td",ue=ie.align?"<"+se+' align="'+ie.align+'">':"<"+se+">";return ue+ne+"</"+se+`>
|
|
`},ge.strong=function(ne){return"<strong>"+ne+"</strong>"},ge.em=function(ne){return"<em>"+ne+"</em>"},ge.codespan=function(ne){return"<code>"+ne+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(ne){return"<del>"+ne+"</del>"},ge.link=function(ne,ie,se){if(ne=Ne(this.options.sanitize,this.options.baseUrl,ne),ne===null)return se;var ue='<a href="'+Fe(ne)+'"';return ie&&(ue+=' title="'+ie+'"'),ue+=">"+se+"</a>",ue},ge.image=function(ne,ie,se){if(ne=Ne(this.options.sanitize,this.options.baseUrl,ne),ne===null)return se;var ue='<img src="'+ne+'" alt="'+se+'"';return ie&&(ue+=' title="'+ie+'"'),ue+=this.options.xhtml?"/>":">",ue},ge.text=function(ne){return ne},Ee}(),Ue=function(){function Ee(){}var ge=Ee.prototype;return ge.strong=function(ne){return ne},ge.em=function(ne){return ne},ge.codespan=function(ne){return ne},ge.del=function(ne){return ne},ge.html=function(ne){return ne},ge.text=function(ne){return ne},ge.link=function(ne,ie,se){return""+se},ge.image=function(ne,ie,se){return""+se},ge.br=function(){return""},Ee}(),nt=function(){function Ee(){this.seen={}}var ge=Ee.prototype;return ge.slug=function(ne){var ie=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var se=ie;do this.seen[se]++,ie=se+"-"+this.seen[se];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Ee}(),it=G.defaults,$e=V.unescape,tt=function(){function Ee(be){this.options=be||it,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new nt}Ee.parse=function(ne,ie){var se=new Ee(ie);return se.parse(ne)};var ge=Ee.prototype;return ge.parse=function(ne,ie){ie===void 0&&(ie=!0);var se="",ue,ke,Se,Ve,at,We,mt,wt,ze,lt,Mt,Ht,qt,zt,Lt,Yr,on,Et,Nr=ne.length;for(ue=0;ue<Nr;ue++){lt=ne[ue];switch(lt.type){case"space":continue;case"hr":{se+=this.renderer.hr();continue}case"heading":{se+=this.renderer.heading(this.parseInline(lt.tokens),lt.depth,$e(this.parseInline(lt.tokens,this.textRenderer)),this.slugger);continue}case"code":{se+=this.renderer.code(lt.text,lt.lang,lt.escaped);continue}case"table":{for(wt="",mt="",Ve=lt.header.length,ke=0;ke<Ve;ke++)mt+=this.renderer.tablecell(this.parseInline(lt.tokens.header[ke]),{header:!0,align:lt.align[ke]});for(wt+=this.renderer.tablerow(mt),ze="",Ve=lt.cells.length,ke=0;ke<Ve;ke++){for(We=lt.tokens.cells[ke],mt="",at=We.length,Se=0;Se<at;Se++)mt+=this.renderer.tablecell(this.parseInline(We[Se]),{header:!1,align:lt.align[Se]});ze+=this.renderer.tablerow(mt)}se+=this.renderer.table(wt,ze);continue}case"blockquote":{ze=this.parse(lt.tokens),se+=this.renderer.blockquote(ze);continue}case"list":{for(Mt=lt.ordered,Ht=lt.start,qt=lt.loose,Ve=lt.items.length,ze="",ke=0;ke<Ve;ke++)Lt=lt.items[ke],Yr=Lt.checked,on=Lt.task,zt="",Lt.task&&(Et=this.renderer.checkbox(Yr),qt?Lt.tokens.length>0&&Lt.tokens[0].type==="text"?(Lt.tokens[0].text=Et+" "+Lt.tokens[0].text,Lt.tokens[0].tokens&&Lt.tokens[0].tokens.length>0&&Lt.tokens[0].tokens[0].type==="text"&&(Lt.tokens[0].tokens[0].text=Et+" "+Lt.tokens[0].tokens[0].text)):Lt.tokens.unshift({type:"text",text:Et}):zt+=Et),zt+=this.parse(Lt.tokens,qt),ze+=this.renderer.listitem(zt,on,Yr);se+=this.renderer.list(ze,Mt,Ht);continue}case"html":{se+=this.renderer.html(lt.text);continue}case"paragraph":{se+=this.renderer.paragraph(this.parseInline(lt.tokens));continue}case"text":{for(ze=lt.tokens?this.parseInline(lt.tokens):lt.text;ue+1<Nr&&ne[ue+1].type==="text";)lt=ne[++ue],ze+=`
|
|
`+(lt.tokens?this.parseInline(lt.tokens):lt.text);se+=ie?this.renderer.paragraph(ze):ze;continue}default:{var ur='Token with "'+lt.type+'" type was not found.';if(this.options.silent){console.error(ur);return}else throw new Error(ur)}}}return se},ge.parseInline=function(ne,ie){ie=ie||this.renderer;var se="",ue,ke,Se=ne.length;for(ue=0;ue<Se;ue++){ke=ne[ue];switch(ke.type){case"escape":{se+=ie.text(ke.text);break}case"html":{se+=ie.html(ke.text);break}case"link":{se+=ie.link(ke.href,ke.title,this.parseInline(ke.tokens,ie));break}case"image":{se+=ie.image(ke.href,ke.title,ke.text);break}case"strong":{se+=ie.strong(this.parseInline(ke.tokens,ie));break}case"em":{se+=ie.em(this.parseInline(ke.tokens,ie));break}case"codespan":{se+=ie.codespan(ke.text);break}case"br":{se+=ie.br();break}case"del":{se+=ie.del(this.parseInline(ke.tokens,ie));break}case"text":{se+=ie.text(ke.text);break}default:{var Ve='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(Ve);return}else throw new Error(Ve)}}}return se},Ee}(),ct=V.merge,et=V.checkSanitizeDeprecation,ot=V.escape,Oe=G.getDefaults,ht=G.changeDefaults,st=G.defaults;function je(Ee,ge,be){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof ge=="function"&&(be=ge,ge=null),ge=ct({},je.defaults,ge||{}),et(ge),be){var ne=ge.highlight,ie;try{ie=Me.lex(Ee,ge)}catch(Se){return be(Se)}var se=function(Ve){var at;if(!Ve)try{at=tt.parse(ie,ge)}catch(We){Ve=We}return ge.highlight=ne,Ve?be(Ve):be(null,at)};if(!ne||ne.length<3)return se();if(delete ge.highlight,!ie.length)return se();var ue=0;je.walkTokens(ie,function(Se){Se.type==="code"&&(ue++,setTimeout(function(){ne(Se.text,Se.lang,function(Ve,at){if(Ve)return se(Ve);at!=null&&at!==Se.text&&(Se.text=at,Se.escaped=!0),ue--,ue===0&&se()})},0))}),ue===0&&se();return}try{var ke=Me.lex(Ee,ge);return ge.walkTokens&&je.walkTokens(ke,ge.walkTokens),tt.parse(ke,ge)}catch(Se){if(Se.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+ot(Se.message+"",!0)+"</pre>";throw Se}}je.options=je.setOptions=function(Ee){return ct(je.defaults,Ee),ht(je.defaults),je},je.getDefaults=Oe,je.defaults=st,je.use=function(Ee){var ge=ct({},Ee);if(Ee.renderer&&function(){var ne=je.defaults.renderer||new Be,ie=function(ke){var Se=ne[ke];ne[ke]=function(){for(var Ve=arguments.length,at=new Array(Ve),We=0;We<Ve;We++)at[We]=arguments[We];var mt=Ee.renderer[ke].apply(ne,at);return mt===!1&&(mt=Se.apply(ne,at)),mt}};for(var se in Ee.renderer)ie(se);ge.renderer=ne}(),Ee.tokenizer&&function(){var ne=je.defaults.tokenizer||new xe,ie=function(ke){var Se=ne[ke];ne[ke]=function(){for(var Ve=arguments.length,at=new Array(Ve),We=0;We<Ve;We++)at[We]=arguments[We];var mt=Ee.tokenizer[ke].apply(ne,at);return mt===!1&&(mt=Se.apply(ne,at)),mt}};for(var se in Ee.tokenizer)ie(se);ge.tokenizer=ne}(),Ee.walkTokens){var be=je.defaults.walkTokens;ge.walkTokens=function(ne){Ee.walkTokens(ne),be&&be(ne)}}je.setOptions(ge)},je.walkTokens=function(Ee,ge){for(var be=B(Ee),ne;!(ne=be()).done;){var ie=ne.value;ge(ie);switch(ie.type){case"table":{for(var se=B(ie.tokens.header),ue;!(ue=se()).done;){var ke=ue.value;je.walkTokens(ke,ge)}for(var Se=B(ie.tokens.cells),Ve;!(Ve=Se()).done;)for(var at=Ve.value,We=B(at),mt;!(mt=We()).done;){var wt=mt.value;je.walkTokens(wt,ge)}break}case"list":{je.walkTokens(ie.items,ge);break}default:ie.tokens&&je.walkTokens(ie.tokens,ge)}}},je.Parser=tt,je.parser=tt.parse,je.Renderer=Be,je.TextRenderer=Ue,je.Lexer=Me,je.lexer=Me.lex,je.Tokenizer=xe,je.Slugger=nt,je.parse=je;var Ye=je;return Ye})},E7E6:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454Dh58iQdPPiJBk0fKN1E9KyU8gehUKjVcuIOPciAOCRYJ5J95JFHy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4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){var q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},L=le.Pos;le.defineOption("autoCloseBrackets",!1,function(A,S,c){c&&c!=le.Init&&(A.removeKeyMap(B),A.state.closeBrackets=null),S&&(M(J(S,"pairs")),A.state.closeBrackets=S,A.addKeyMap(B))});function J(A,S){return S=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[S]!=null?A[S]:q[S]}var B={Backspace:P,Enter:k};function M(A){for(var S=0;S<A.length;S++){var c=A.charAt(S),s="'"+c+"'";B[s]||(B[s]=G(c))}}M(q.pairs+"`");function G(A){return function(S){return C(S,A)}}function F(A){var S=A.state.closeBrackets;if(!S||S.override)return S;var c=A.getModeAt(A.getCursor());return c.closeBrackets||S}function P(A){var S=F(A);if(!S||A.getOption("disableInput"))return le.Pass;for(var c=J(S,"pairs"),s=A.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return le.Pass;var h=O(A,s[u].head);if(!h||c.indexOf(h)%2!=0)return le.Pass}for(var u=s.length-1;u>=0;u--){var T=s[u].head;A.replaceRange("",L(T.line,T.ch-1),L(T.line,T.ch+1),"+delete")}}function k(A){var S=F(A),c=S&&J(S,"explode");if(!c||A.getOption("disableInput"))return le.Pass;for(var s=A.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return le.Pass;var h=O(A,s[u].head);if(!h||c.indexOf(h)%2!=0)return le.Pass}A.operation(function(){var T=A.lineSeparator()||`
|
|
`;A.replaceSelection(T+T,null),A.execCommand("goCharLeft"),s=A.listSelections();for(var p=0;p<s.length;p++){var f=s[p].head.line;A.indentLine(f,null,!0),A.indentLine(f+1,null,!0)}})}function y(A){var S=le.cmpPos(A.anchor,A.head)>0;return{anchor:new L(A.anchor.line,A.anchor.ch+(S?-1:1)),head:new L(A.head.line,A.head.ch+(S?1:-1))}}function C(A,S){var c=F(A);if(!c||A.getOption("disableInput"))return le.Pass;var s=J(c,"pairs"),u=s.indexOf(S);if(u==-1)return le.Pass;for(var h=J(c,"closeBefore"),T=J(c,"triples"),p=s.charAt(u+1)==S,f=A.listSelections(),D=u%2==0,v,m=0;m<f.length;m++){var a=f[m],d=a.head,o,E=A.getRange(d,L(d.line,d.ch+1));if(D&&!a.empty())o="surround";else if((p||!D)&&E==S)p&&R(A,d)?o="both":T.indexOf(S)>=0&&A.getRange(d,L(d.line,d.ch+3))==S+S+S?o="skipThree":o="skip";else if(p&&d.ch>1&&T.indexOf(S)>=0&&A.getRange(L(d.line,d.ch-2),d)==S+S){if(d.ch>2&&/\bstring/.test(A.getTokenTypeAt(L(d.line,d.ch-2))))return le.Pass;o="addFour"}else if(p){var b=d.ch==0?" ":A.getRange(L(d.line,d.ch-1),d);if(!le.isWordChar(E)&&b!=S&&!le.isWordChar(b))o="both";else return le.Pass}else if(D&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))o="both";else return le.Pass;if(!v)v=o;else if(v!=o)return le.Pass}var x=u%2?s.charAt(u-1):S,N=u%2?S:s.charAt(u+1);A.operation(function(){if(v=="skip")A.execCommand("goCharRight");else if(v=="skipThree")for(var U=0;U<3;U++)A.execCommand("goCharRight");else if(v=="surround"){for(var K=A.getSelections(),U=0;U<K.length;U++)K[U]=x+K[U]+N;A.replaceSelections(K,"around"),K=A.listSelections().slice();for(var U=0;U<K.length;U++)K[U]=y(K[U]);A.setSelections(K)}else v=="both"?(A.replaceSelection(x+N,null),A.triggerElectric(x+N),A.execCommand("goCharLeft")):v=="addFour"&&(A.replaceSelection(x+x+x+x,"before"),A.execCommand("goCharRight"))})}function O(A,S){var c=A.getRange(L(S.line,S.ch-1),L(S.line,S.ch+1));return c.length==2?c:null}function R(A,S){var c=A.getTokenAt(L(S.line,S.ch+1));return/\bstring/.test(c.type)&&c.start==S.ch&&(S.ch==0||!/\bstring/.test(A.getTokenTypeAt(S)))}})},FOrL:function(Ke,Ie,Z){Ke.exports=Z.p+"static/nodata.a6b3f948.png"},FPkq:function(Ke,Ie,Z){Ke.exports=Z.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k4b2EFVfTt29NQ8l+zKf4EIUbi4kAnhz7ohuLiH1qCwwo62cf9ccf3l0jibh1DckPy3lKzmTcbYQWV9+k7HlArOjaEjmejRm9yaWmzOMMKMncCp9x9dwlkYEeEQUCB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HxKac9i45I+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},GfqC:function(Ke,Ie,Z){"use strict";var le=Z("q1tI"),q=Z.n(le),L=Z("TSYQ"),J=Z.n(L);function B(V,_){var I="cannot "+V.method+" "+V.action+" "+_.status+"'",Y=new Error(I);return Y.status=_.status,Y.method=V.method,Y.url=V.action,Y}function M(V){var _=V.responseText||V.response;if(!_)return _;try{return JSON.parse(_)}catch(I){return _}}function G(V){var _=new XMLHttpRequest;V.onProgress&&_.upload&&(_.upload.onprogress=function(oe){oe.total>0&&(oe.percent=oe.loaded/oe.total*100),V.onProgress(oe)});var I=new FormData;V.data&&Object.keys(V.data).forEach(function(ee){var oe=V.data[ee];if(Array.isArray(oe)){oe.forEach(function(he){I.append(ee+"[]",he)});return}I.append(ee,V.data[ee])}),V.file instanceof Blob?I.append(V.filename,V.file,V.file.name):I.append(V.filename,V.file),_.onerror=function(oe){V.onError(oe)},_.onload=function(){return _.status<200||_.status>=300?V.onError(B(V,_),M(_)):V.onSuccess(M(_),_)},_.open(V.method,V.action,!0),V.withCredentials&&"withCredentials"in _&&(_.withCredentials=!0);var Y=V.headers||{};return Y["X-Requested-With"]!==null&&_.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Y).forEach(function(ee){Y[ee]!==null&&_.setRequestHeader(ee,Y[ee])}),_.send(I),{abort:function(){_.abort()}}}var F=+new Date,P=0;function k(){return"rc-upload-"+F+"-"+ ++P}function y(V,_){return V.indexOf(_,V.length-_.length)!==-1}var C=function(V,_){if(V&&_){var I=Array.isArray(_)?_:_.split(","),Y=V.name||"",ee=V.type||"",oe=ee.replace(/\/.*$/,"");return I.some(function(he){var Le=he.trim();return Le.charAt(0)==="."?y(Y.toLowerCase(),Le.toLowerCase()):/\/\*$/.test(Le)?oe===Le.replace(/\/.*$/,""):ee===Le})}return!0};function O(V,_){var I=V.createReader(),Y=[];function ee(){I.readEntries(function(oe){var he=Array.prototype.slice.apply(oe);Y=Y.concat(he);var Le=!he.length;Le?_(Y):ee()})}ee()}var R=function(_,I,Y){var ee=function oe(he,Le){Le=Le||"",he.isFile?he.file(function(xe){Y(xe)&&(he.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=he.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),I([xe]))}):he.isDirectory&&O(he,function(xe){xe.forEach(function(Ae){oe(Ae,""+Le+he.name+"/")})})};_.forEach(function(oe){ee(oe.webkitGetAsEntry())})},A=R,S=Object.assign||function(V){for(var _=1;_<arguments.length;_++){var I=arguments[_];for(var Y in I)Object.prototype.hasOwnProperty.call(I,Y)&&(V[Y]=I[Y])}return V},c=function(){function V(_,I){var Y=[],ee=!0,oe=!1,he=void 0;try{for(var Le=_[Symbol.iterator](),xe;!(ee=(xe=Le.next()).done)&&!(Y.push(xe.value),I&&Y.length===I);ee=!0);}catch(Ae){oe=!0,he=Ae}finally{try{!ee&&Le.return&&Le.return()}finally{if(oe)throw he}}return Y}return function(_,I){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return V(_,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function V(_,I){for(var Y=0;Y<I.length;Y++){var ee=I[Y];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(_,ee.key,ee)}}return function(_,I,Y){return I&&V(_.prototype,I),Y&&V(_,Y),_}}();function u(V,_,I){return _ in V?Object.defineProperty(V,_,{value:I,enumerable:!0,configurable:!0,writable:!0}):V[_]=I,V}function h(V,_){var I={};for(var Y in V){if(_.indexOf(Y)>=0)continue;if(!Object.prototype.hasOwnProperty.call(V,Y))continue;I[Y]=V[Y]}return I}function T(V,_){if(!(V instanceof _))throw new TypeError("Cannot call a class as a function")}function p(V,_){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:V}function f(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);V.prototype=Object.create(_&&_.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(V,_):V.__proto__=_)}var D=function(_){return Object.keys(_).reduce(function(I,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(I[Y]=_[Y]),I},{})},v=function(V){f(_,V);function _(){var I,Y,ee,oe;T(this,_);for(var he=arguments.length,Le=Array(he),xe=0;xe<he;xe++)Le[xe]=arguments[xe];return oe=(Y=(ee=p(this,(I=_.__proto__||Object.getPrototypeOf(_)).call.apply(I,[this].concat(Le))),ee),ee.state={uid:k()},ee.reqs={},ee.onChange=function(Ae){var Te=Ae.target.files;ee.uploadFiles(Te),ee.reset()},ee.onClick=function(Ae){var Te=ee.fileInput;if(!Te)return;var Ce=ee.props,pe=Ce.children,de=Ce.onClick;pe&&pe.type==="button"&&(Te.parentNode.focus(),Te.parentNode.querySelector("button").blur()),Te.click(),de&&de(Ae)},ee.onKeyDown=function(Ae){Ae.key==="Enter"&&ee.onClick()},ee.onFileDrop=function(Ae){var Te=ee.props.multiple;if(Ae.preventDefault(),Ae.type==="dragover")return;if(ee.props.directory)A(Array.prototype.slice.call(Ae.dataTransfer.items),ee.uploadFiles,function(pe){return C(pe,ee.props.accept)});else{var Ce=Array.prototype.slice.call(Ae.dataTransfer.files).filter(function(pe){return C(pe,ee.props.accept)});Te===!1&&(Ce=Ce.slice(0,1)),ee.uploadFiles(Ce)}},ee.uploadFiles=function(Ae){var Te=Array.prototype.slice.call(Ae);Te.map(function(Ce){return Ce.uid=k(),Ce}).forEach(function(Ce){ee.upload(Ce,Te)})},ee.saveFileInput=function(Ae){ee.fileInput=Ae},Y),p(ee,oe)}return s(_,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(Y,ee){var oe=this,he=this.props;if(!he.beforeUpload)return setTimeout(function(){return oe.post(Y)},0);var Le=he.beforeUpload(Y,ee);Le&&Le.then?Le.then(function(xe){var Ae=Object.prototype.toString.call(xe);return Ae==="[object File]"||Ae==="[object Blob]"?oe.post(xe):oe.post(Y)}).catch(function(xe){console.log(xe)}):Le!==!1&&setTimeout(function(){return oe.post(Y)},0);return}},{key:"post",value:function(Y){var ee=this;if(!this._isMounted)return;var oe=this.props,he=oe.onStart,Le=oe.onProgress,xe=oe.transformFile,Ae=xe===void 0?function(Te){return Te}:xe;new Promise(function(Te){var Ce=oe.action;return typeof Ce=="function"&&(Ce=Ce(Y)),Te(Ce)}).then(function(Te){var Ce=Y.uid,pe=oe.customRequest||G,de=Promise.resolve(Ae(Y)).then(function(re){var ce=oe.data;return typeof ce=="function"&&(ce=ce(re)),Promise.all([re,ce])}).catch(function(re){console.error(re)});de.then(function(re){var ce=c(re,2),ae=ce[0],we=ce[1],De={action:Te,filename:oe.name,data:we,file:ae,headers:oe.headers,withCredentials:oe.withCredentials,method:oe.method||"post",onProgress:Le?function(ye){Le(ye,Y)}:null,onSuccess:function(Me,Pe){delete ee.reqs[Ce],oe.onSuccess(Me,Y,Pe)},onError:function(Me,Pe){delete ee.reqs[Ce],oe.onError(Me,Pe,Y)}};he(Y),ee.reqs[Ce]=pe(De)})})}},{key:"reset",value:function(){this.setState({uid:k()})}},{key:"abort",value:function(Y){var ee=this.reqs;if(Y){var oe=Y;Y&&Y.uid&&(oe=Y.uid),ee[oe]&&ee[oe].abort&&ee[oe].abort(),delete ee[oe]}else Object.keys(ee).forEach(function(he){ee[he]&&ee[he].abort&&ee[he].abort(),delete ee[he]})}},{key:"render",value:function(){var Y,ee=this.props,oe=ee.component,he=ee.prefixCls,Le=ee.className,xe=ee.disabled,Ae=ee.id,Te=ee.style,Ce=ee.multiple,pe=ee.accept,de=ee.children,re=ee.directory,ce=ee.openFileDialogOnClick,ae=ee.onMouseEnter,we=ee.onMouseLeave,De=h(ee,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ye=J()((Y={},u(Y,he,!0),u(Y,he+"-disabled",xe),u(Y,Le,Le),Y)),Me=xe?{}:{onClick:ce?this.onClick:function(){},onKeyDown:ce?this.onKeyDown:function(){},onMouseEnter:ae,onMouseLeave:we,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return q.a.createElement(oe,S({},Me,{className:ye,role:"button",style:Te}),q.a.createElement("input",S({},D(De),{id:Ae,type:"file",ref:this.saveFileInput,onClick:function(Ne){return Ne.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:pe,directory:re?"directory":null,webkitdirectory:re?"webkitdirectory":null,multiple:Ce,onChange:this.onChange})),de)}}]),_}(le.Component),m=v,a=Object.assign||function(V){for(var _=1;_<arguments.length;_++){var I=arguments[_];for(var Y in I)Object.prototype.hasOwnProperty.call(I,Y)&&(V[Y]=I[Y])}return V},d=function(){function V(_,I){for(var Y=0;Y<I.length;Y++){var ee=I[Y];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(_,ee.key,ee)}}return function(_,I,Y){return I&&V(_.prototype,I),Y&&V(_,Y),_}}();function o(V,_){if(!(V instanceof _))throw new TypeError("Cannot call a class as a function")}function E(V,_){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:V}function b(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);V.prototype=Object.create(_&&_.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(V,_):V.__proto__=_)}function x(){}var N=function(V){b(_,V);function _(){var I,Y,ee,oe;o(this,_);for(var he=arguments.length,Le=Array(he),xe=0;xe<he;xe++)Le[xe]=arguments[xe];return oe=(Y=(ee=E(this,(I=_.__proto__||Object.getPrototypeOf(_)).call.apply(I,[this].concat(Le))),ee),ee.saveUploader=function(Ae){ee.uploader=Ae},Y),E(ee,oe)}return d(_,[{key:"abort",value:function(Y){this.uploader.abort(Y)}},{key:"render",value:function(){return q.a.createElement(m,a({},this.props,{ref:this.saveUploader}))}}]),_}(le.Component);N.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:x,onError:x,onSuccess:x,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=N,K=Ie.a=U},HmJG:function(Ke,Ie,Z){},HpTS:function(Ke,Ie,Z){Ke.exports=Z.p+"static/small_program.f74069ec.png"},JWDV:function(Ke,Ie,Z){Ke.exports=Z.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLq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(Ke,Ie,Z){Ke.exports=Z.p+"static/qrcode.54870d9b.png"},LdHM:function(Ke,Ie,Z){"use strict";Z.d(Ie,"b",function(){return h}),Z.d(Ie,"a",function(){return p});var le=Z("1OyB"),q=Z("vuIU"),L=Z("Ji7U"),J=Z("LK+K"),B=Z("q1tI"),M=Z("rePB"),G=Z("Ff2n"),F=Z("ODXe"),P=Z("4IlW"),k=Z("bX4T"),y=Z("YrtM"),C=Z("TSYQ"),O=Z.n(C),R=Z("+nKL"),A=Z("8OUc"),S=function(Y,ee){var oe=Y.prefixCls,he=Y.id,Le=Y.flattenOptions,xe=Y.childrenAsData,Ae=Y.values,Te=Y.searchValue,Ce=Y.multiple,pe=Y.defaultActiveFirstOption,de=Y.height,re=Y.itemHeight,ce=Y.notFoundContent,ae=Y.open,we=Y.menuItemSelectedIcon,De=Y.virtual,ye=Y.onSelect,Me=Y.onToggleOpen,Pe=Y.onActiveValue,Ne=Y.onScroll,Fe=Y.onMouseEnter,Be="".concat(oe,"-item"),Ue=Object(y.a)(function(){return Le},[ae,Le],function(Ye,Ee){return Ee[0]&&Ye[1]!==Ee[1]}),nt=B.useRef(null),it=function(Ee){Ee.preventDefault()},$e=function(Ee){nt.current&&nt.current.scrollTo({index:Ee})},tt=function(Ee){for(var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=Ue.length,ne=0;ne<be;ne+=1){var ie=(Ee+ne*ge+be)%be,se=Ue[ie],ue=se.group,ke=se.data;if(!ue&&!ke.disabled)return ie}return-1},ct=B.useState(function(){return tt(0)}),et=Object(F.a)(ct,2),ot=et[0],Oe=et[1],ht=function(Ee){Oe(Ee);var ge=Ue[Ee];if(!ge){Pe(null,-1);return}Pe(ge.data.value,Ee)};B.useEffect(function(){ht(pe!==!1?tt(0):-1)},[Ue.length,Te]),B.useEffect(function(){var Ye=setTimeout(function(){if(!Ce&&ae&&Ae.size===1){var Ee=Array.from(Ae)[0],ge=Ue.findIndex(function(be){var ne=be.data;return ne.value===Ee});ht(ge),$e(ge)}});return function(){return clearTimeout(Ye)}},[ae]);var st=function(Ee){Ee!==void 0&&ye(Ee,{selected:!Ae.has(Ee)}),Ce||Me(!1)};if(B.useImperativeHandle(ee,function(){return{onKeyDown:function(Ee){var ge=Ee.which;switch(ge){case P.a.UP:case P.a.DOWN:{var be=0;if(ge===P.a.UP?be=-1:ge===P.a.DOWN&&(be=1),be!==0){var ne=tt(ot+be,be);$e(ne),ht(ne)}break}case P.a.ENTER:{var ie=Ue[ot];ie&&!ie.data.disabled?st(ie.data.value):st(void 0),ae&&Ee.preventDefault();break}case P.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(Ee){$e(Ee)}}}),Ue.length===0)return B.createElement("div",{role:"listbox",id:"".concat(he,"_list"),className:"".concat(Be,"-empty"),onMouseDown:it},ce);function je(Ye){var Ee=Ue[Ye];if(!Ee)return null;var ge=Ee.data||{},be=ge.value,ne=ge.label,ie=ge.children,se=Object(k.a)(ge,!0),ue=xe?ie:ne;return Ee?B.createElement("div",Object.assign({"aria-label":typeof ue=="string"?ue:null},se,{key:Ye,role:"option",id:"".concat(he,"_list_").concat(Ye),"aria-selected":Ae.has(be)}),be):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(he,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(ot-1),je(ot),je(ot+1)),B.createElement(R.a,{itemKey:"key",ref:nt,data:Ue,height:de,itemHeight:re,fullHeight:!1,onMouseDown:it,onScroll:Ne,virtual:De,onMouseEnter:Fe},function(Ye,Ee){var ge,be=Ye.group,ne=Ye.groupOption,ie=Ye.data,se=ie.label,ue=ie.key;if(be)return B.createElement("div",{className:O()(Be,"".concat(Be,"-group"))},se!==void 0?se:ue);var ke=ie.disabled,Se=ie.value,Ve=ie.title,at=ie.children,We=ie.style,mt=ie.className,wt=Object(G.a)(ie,["disabled","value","title","children","style","className"]),ze=Ae.has(Se),lt="".concat(Be,"-option"),Mt=O()(Be,lt,mt,(ge={},Object(M.a)(ge,"".concat(lt,"-grouped"),ne),Object(M.a)(ge,"".concat(lt,"-active"),ot===Ee&&!ke),Object(M.a)(ge,"".concat(lt,"-disabled"),ke),Object(M.a)(ge,"".concat(lt,"-selected"),ze),ge)),Ht=xe?at:se,qt=!we||typeof we=="function"||ze;return B.createElement("div",Object.assign({},wt,{"aria-selected":ze,className:Mt,title:Ve,onMouseMove:function(){if(ot===Ee||ke)return;ht(Ee)},onClick:function(){ke||st(Se)},style:We}),B.createElement("div",{className:"".concat(lt,"-content")},Ht||Se),B.isValidElement(we)||ze,qt&&B.createElement(A.a,{className:"".concat(Be,"-option-state"),customizeIcon:we,customizeIconProps:{isSelected:ze}},ze?"\u2713":null))}))},c=B.forwardRef(S);c.displayName="OptionList";var s=c,u=function(){return null};u.isSelectOption=!0;var h=u,T=function(){return null};T.isSelectOptGroup=!0;var p=T,f=Z("VTBJ"),D=Z("Zm9Q");function v(I){var Y=I.key,ee=I.props,oe=ee.children,he=ee.value,Le=Object(G.a)(ee,["children","value"]);return Object(f.a)({key:Y,value:he!==void 0?he:Y,children:oe},Le)}function m(I){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(I).map(function(ee,oe){if(!B.isValidElement(ee)||!ee.type)return null;var he=ee.type.isSelectOptGroup,Le=ee.key,xe=ee.props,Ae=xe.children,Te=Object(G.a)(xe,["children"]);return Y||!he?v(ee):Object(f.a)(Object(f.a)({key:"__RC_SELECT_GRP__".concat(Le===null?oe:Le,"__"),label:Le},Te),{},{options:m(Ae)})}).filter(function(ee){return ee})}var a=Z("2Qr1"),d=Z("qNPg"),o=Z("U8pU"),E=Z("Kwbf"),b=Z("WKfj");function x(I){var Y=I.mode,ee=I.options,oe=I.children,he=I.backfill,Le=I.allowClear,xe=I.placeholder,Ae=I.getInputElement,Te=I.showSearch,Ce=I.onSearch,pe=I.defaultOpen,de=I.autoFocus,re=I.labelInValue,ce=I.value,ae=I.inputValue,we=I.optionLabelProp,De=Y==="multiple"||Y==="tags",ye=Te!==void 0?Te:De||Y==="combobox",Me=ee||m(oe);if(Object(E.a)(Y!=="tags"||Me.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Pe=Me.some(function(Be){return Be.options?Be.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(E.a)(!Pe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(Y!=="combobox"||!we,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(Y==="combobox"||!he,"`backfill` only works with `combobox` mode."),Object(E.a)(Y==="combobox"||!Ae,"`getInputElement` only work with `combobox` mode."),Object(E.b)(Y!=="combobox"||!Ae||!Le||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!ye&&Y!=="combobox"&&Y!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!pe||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ce!=null){var Ne=Object(b.d)(ce);Object(E.a)(!re||Ne.every(function(Be){return Object(o.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!De||Array.isArray(ce),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Fe=null;Object(D.a)(oe).some(function(Be){if(!B.isValidElement(Be)||!Be.type)return!1;var Ue=Be.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var nt=Object(D.a)(Be.props.children).every(function(it){return!B.isValidElement(it)||!Be.type||it.type.isSelectOption?!0:(Fe=it.type,!1)});return!nt}return Fe=Ue,!0}),Fe&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(E.a)(ae===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=x,U=Object(d.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:m,flattenOptions:a.d,getLabeledValue:a.e,filterOptions:a.b,isValueDisabled:a.g,findValueOption:a.c,warningProps:N,fillOptionsWithMissingValue:a.a}),K=function(I){Object(L.a)(ee,I);var Y=Object(J.a)(ee);function ee(){var oe;return Object(le.a)(this,ee),oe=Y.apply(this,arguments),oe.selectRef=B.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(q.a)(ee,[{key:"render",value:function(){return B.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),ee}(B.Component);K.Option=h,K.OptGroup=p;var V=K,_=Ie.c=V},M8RZ:function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return P});var le=Z("fWQN"),q=Z("mtLc"),L=Z("yKVA"),J=Z("879j"),B=Z("q1tI"),M=Z.n(B),G=Z("i8i4"),F=Z.n(G),P=function(k){Object(L.a)(C,k);var y=Object(J.a)(C);function C(O){var R;Object(le.a)(this,C),R=y.call(this,O);var A=window.document;return R.node=A.createElement("div"),A.body.appendChild(R.node),R}return Object(q.a)(C,[{key:"render",value:function(){var R=this.props.children;return Object(G.createPortal)(R,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(M.a.Component)},Nmxd:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1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vGREYnbruOgrn7MwKvlEg9gvLpG1E2000ntKNh5O82EznQobvkVF9S732LIgus6rg0RHTNCsdYJA7oWB7jLJdlOIxzfUwwbTHY+zSy+ccldAkbtRjimThroCYAzA46bqUl6JmxOh+IH8mbq1K65NXLuIIAnymqAMQbyNRrhtvT0qkQgqe4lRof7RHKdEe6Y9XEe0NVDBLzsnrMwcmbp/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},Ohmc:function(Ke,Ie,Z){Ke.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ke,Ie,Z){"use strict";var le=Z("2qtc"),q=Z("kLXV"),L=Z("rAM+"),J=Z("miYZ"),B=Z("tsqr"),M=Z("9og8"),G=Z("tJVT"),F=Z("jrin"),P=Z("WmNS"),k=Z.n(P),y=Z("q1tI"),C=Z.n(y),O=Z("VrN/"),R=Z.n(O),A=Z("bdgK"),S=Z("p77/"),c=Z("Bd2K"),s=Z("ELLl"),u=Z("19Vz"),h=Z("lZu9"),T=Z("+NIl"),p=Z("kSUc"),f=Z("9Bee"),D=function(Se){var Ve=Se.value,at=Ve===void 0?"":Ve,We=Se.className,mt=Se.showTextOnly,wt=Se.showLines,ze=Se.style,lt=ze===void 0?{}:ze,Mt=Object(y.useMemo)(function(){return""},[at]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:Mt}}))},v=Z("0Owb"),m=Z("dejd"),a=Z("C+DQ"),d=Z("1vsH"),o=Z("m3rI"),E=[{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 Ve=Se.onActionCallback,at=Se.title,We=Se.icon,mt=Se.actionName,wt=Se.className,ze=wt===void 0?"":wt,lt=Se.children;function Mt(){Ve(mt)}return C.a.createElement("a",{title:at,className:ze,onClick:Mt},C.a.createElement("i",{className:"md-iconfont ".concat(We)}),lt)}var x=function(Se){var Ve=Se.watch,at=Se.showNullButton,We=Se.onActionCallback,mt=Se.fullScreen,wt=Se.insertTemp,ze=Se.hidetoolBar,lt=Se.uuid,Mt=Se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.D)("_educoder_session"),"&key=").concat(lt,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Ht=[].concat(E,[{title:"".concat(Ve?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ve?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!ze&&Ht.map(function(qt,zt){return C.a.createElement("li",{key:zt},qt.actionName?C.a.createElement(b,Object(v.a)({},qt,{onActionCallback:We})):C.a.createElement("span",{className:"v-line"}))}),at?C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:We},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,wt&&C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(wt),onActionCallback:We},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.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:We})))},N=Z("M8RZ"),U=Z("+L6B"),K=Z("2/Rp"),V=Z("y8nQ"),_=Z("Vl3Y"),I=Z("5NDa"),Y=Z("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},oe=function(Se){var Ve=Se.callback,at=Se.onCancel;function We(mt){Ve(mt)}return C.a.createElement(_.a,Object(v.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:We}),C.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(Y.a,null)),C.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(Y.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(K.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},he=Z("7ahc"),Le=Z("k1fw"),xe=Z("HmJG"),Ae=Z("BjJ7"),Te=_.a.useForm,Ce={width:280,marginRight:10},pe={labelCol:{span:5},wrapperCol:{span:19}},de=function(Se){var Ve=Se.callback,at=Se.onCancel,We=Te(),mt=Object(G.a)(We,1),wt=mt[0],ze=Object(y.useRef)();function lt(qt){Ve(Object(Le.a)(Object(Le.a)({},qt),{},{name:ze.current}))}function Mt(qt,zt){wt.setFieldsValue({src:"/api/attachments/".concat(qt.id,"?type=").concat(qt.content_type),type:zt.type})}function Ht(qt){var zt=qt.target.files[0];ze.current=zt.name,ce(zt,Mt)}return C.a.createElement(_.a,Object(v.a)({form:wt},pe,{className:"upload-image-panel",onFinish:lt}),C.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(_.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},C.a.createElement(Y.a,{style:Ce})),C.a.createElement(re,{onFileChange:Ht}))),C.a.createElement(_.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},C.a.createElement(Y.a,{style:{width:264}})),C.a.createElement(_.a.Item,{style:{textAlign:"right"}},C.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(K.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))};function re(Se){var Ve=Se.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Ve}))}function ce(Se,Ve){if(!Se)throw new String("\u6CA1\u6709\u6587\u4EF6");var at=new FormData;at.append("editormd-image-file",Se),at.append("file_param_name","editormd-image-file"),at.append("byxhr","true");var We=new window.XMLHttpRequest;We.withCredentials=!0,We.addEventListener("load",function(mt){Ve(JSON.parse(mt.target.responseText),Se)},!1),We.addEventListener("error",function(mt){console.error(mt)},!1),We.open("POST","".concat(Ae.a,"/api/attachments.json")),We.send(at)}var ae=Z("giR+"),we=Z("fyUT"),De=Z("7Kak"),ye=Z("9yH6"),Me=ye.a.Group,Pe={margin:"0 8px"},Ne=function(Se){var Ve=Se.callback,at=Se.onCancel;function We(mt){Ve(mt)}return C.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:We},C.a.createElement("div",{className:"flex-container"},C.a.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Pe},"\u884C\u6570"),C.a.createElement(_.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(we.a,null)),C.a.createElement("span",{style:Pe},"\u5217\u6570"),C.a.createElement(_.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(we.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12}},C.a.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(_.a.Item,{name:"align"},C.a.createElement(Me,null,C.a.createElement(ye.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(ye.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(ye.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(ye.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(K.a,{type:"ghost",onClick:at},"\u53D6\u6D88")))},Fe=Z("ErOA"),Be=Z("7Cbv"),Ue="link",nt="upload-image",it="code-block",$e="add-table",tt="------------",ct={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},et=Z("9VGf"),ot,Oe;function ht(){}var st=0,je=1e4,Ye="\u2581",Ee=`
|
|
**\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 ge(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}var be=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=be?"Cmd":"Ctrl",ie=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],se=(ot={},Object(F.a)(ot,ne+"-B","bold"),Object(F.a)(ot,ne+"-I","italic"),ot),ue=(Oe={},Object(F.a)(Oe,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Oe,it,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Oe,nt,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Oe,$e,"\u6DFB\u52A0\u8868\u683C"),Oe),ke=Ie.a=function(Se){var Ve=Se.defaultValue,at=Ve===void 0?"":Ve,We=Se.onChange,mt=Se.width,wt=mt===void 0?"100%":mt,ze=Se.height,lt=ze===void 0?400:ze,Mt=Se.miniToolbar,Ht=Mt===void 0?!1:Mt,qt=Se.isFocus,zt=qt===void 0?!1:qt,Lt=Se.watch,Yr=Se.insertTemp,on=Se.mode,Et=on===void 0?"markdown":on,Nr=Se.id,ur=Nr===void 0?"markdown-editor-id":Nr,Cr=Se.showResizeBar,Fr=Cr===void 0?!1:Cr,tn=Se.noStorage,sn=tn===void 0?!1:tn,Ft=Se.showNullButton,vt=Ft===void 0?!1:Ft,ar=Se.hidetoolBar,rn=ar===void 0?!1:ar,Or=Se.fullScreen,_t=Or===void 0?!1:Or,or=Se.onBlur,Xr=Se.onCMBeforeChange,ln=Se.onFullScreen,qe=Se.className,At=qe===void 0?"":qe,un=Se.disablePaste,vn=un===void 0?!1:un,dn=Se.placeholder,cn=dn===void 0?"":dn,z=Se.values,l=z===void 0?"":z,g=Object(y.useState)(null),W=Object(G.a)(g,2),Q=W[0],H=W[1],me=Object(y.useState)(at),Qe=Object(G.a)(me,2),Xe=Qe[0],ft=Qe[1],Je=Object(y.useState)(Lt),St=Object(G.a)(Je,2),It=St[0],$t=St[1],jr=Object(y.useState)(_t),Mr=Object(G.a)(jr,2),He=Mr[0],Rt=Mr[1],er=Object(y.useState)(""),kt=Object(G.a)(er,2),nr=kt[0],Xt=kt[1],dr=Object(y.useState)(0),Pt=Object(G.a)(dr,2),bt=Pt[0],jt=Pt[1],sr=Object(y.useState)(lt),Vt=Object(G.a)(sr,2),Qt=Vt[0],tr=Vt[1],vr=Object(y.useState)(!1),hn=Object(G.a)(vr,2),Cn=hn[0],cr=hn[1],Ut=Object(y.useRef)(Object(Be.a)()),kr=Object(y.useRef)(!1),Gt=Object(y.useRef)(),yr=Object(y.useRef)(),Jt=Object(y.useRef)(),yn=Object(y.useRef)(),mr=Object(y.useRef)(),Wr=function(){var yt=Object(M.a)(k.a.mark(function Dt(){var Ct,Nt;return k.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return rr.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:Nt=rr.sent,Nt!=null&&(Ct=Nt.attachments)!==null&&Ct!==void 0&&Ct.length&&(console.log("cm:",Q,yr),Nt.attachments.map(function(Wt){Wt.content_type.indexOf("image")>-1?Q.replaceSelection(".concat(Wt.content_type,")")):Wt.content_type.indexOf("video")>-1?Q.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Wt.content_type.indexOf("pdf")>-1?Q.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):Q.replaceSelection("[".concat(Wt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}));case 4:case"end":return rr.stop()}},Dt)}));return function(){return yt.apply(this,arguments)}}();Object(y.useEffect)(function(){ft(l),Q==null||Q.setValue(l)},[l]),Object(y.useEffect)(function(){ln==null||ln(He)},[He]),Object(y.useEffect)(function(){if(yr.current){var yt=R.a.fromTextArea(yr.current,{mode:Et,lineNumbers:!Ht,lineWrapping:!0,value:at,autoCloseTags:!0,autoCloseBrackets:!0});zt&&yt.focus();function Dt(Ct,Nt){if(vn){Nt.preventDefault();return}var Kt=Nt.clipboardData;if(Kt){var rr=Kt.types.toString(),Wt=Kt.items;if(rr==="Files"||Kt.types.indexOf("Files")>-1){if(Nt.preventDefault(),Et=="stex")return;try{var br,Hr=Wt[1];((br=Wt[0])===null||br===void 0?void 0:br.kind)==="file"&&(Hr=Wt[0]);var Bt=Hr.getAsFile(),Rn=Bt.name.split(".").pop();ce(Bt,function(Yt){if(Yt.id){var Ar,nn,an;(Bt==null||((Ar=Bt.type)===null||Ar===void 0)?void 0:Ar.indexOf("image"))>-1?yt.replaceSelection(".concat(Yt.content_type,")")):(Bt==null||((nn=Bt.type)===null||nn===void 0)?void 0:nn.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Bt==null||((an=Bt.type)===null||an===void 0)?void 0:an.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Bt.type,'&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):ie.includes(Rn)?yt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):yt.replaceSelection("[".concat(Bt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})}catch(Yt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Dt),yt.on("dragleave",function(Ct,Nt){Jt.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(Ct,Nt){Jt.current.classList.add("mouse-hover-md")}),yt.on("drop",function(Ct,Nt){Jt.current.classList.add("mouse-hover-md");var Kt;if(Kt=Nt.dataTransfer.files,Kt.length>0){Nt.preventDefault(),Nt.stopPropagation();for(var rr=function(Hr){var Bt=Kt[Hr],Rn=Bt.name.split(".").pop();ce(Bt,function(Yt){if(Yt.id){var Ar,nn,an;(Bt==null||((Ar=Bt.type)===null||Ar===void 0)?void 0:Ar.indexOf("image"))>-1?yt.replaceSelection(".concat(Yt.content_type,")")):(Bt==null||((nn=Bt.type)===null||nn===void 0)?void 0:nn.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,'"></video>')):(Bt==null||((an=Bt.type)===null||an===void 0)?void 0:an.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Bt.type,'&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):ie.includes(Rn)?yt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,'?type=office&disposition=inline" target="_blank">').concat(Bt.name,"</a>")):yt.replaceSelection("[".concat(Bt.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Yt.id,"?type=").concat(Yt.content_type,")"))}else(Yt==null?void 0:Yt.status)===401&&(document.location.href="/user/login")})},Wt=0;Wt<Kt.length;Wt++)rr(Wt)}}),H(yt),function(){yt.off("paste",Dt)}}},[]);var Qn=Object(y.useCallback)(function(){if(Jt.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[Qt,Jt,He]);Object(y.useEffect)(function(){function yt(){var Ct=new A.default(function(Nt){var Kt=Object(L.a)(Nt),rr;try{for(Kt.s();!(rr=Kt.n()).done;){var Wt=rr.value;(Wt.target.offsetHeight>0||Wt.target.offsetWidth>0)&&(Qn(),Q.setSize("100%","100%"),Q.refresh())}}catch(br){Kt.e(br)}finally{Kt.f()}});return Ct.observe(yr.current.parentElement),Ct}if(Q){var Dt=yt();return function(){Dt.unobserve(yr.current.parentElement)}}},[Q,Qn]),Object(y.useEffect)(function(){if(Q){for(var yt=[],Dt=function(){var Wt=Nt[Ct];Kt=Object(G.a)(Wt,2);var br=Kt[0],Hr=Kt[1],Bt=Object(F.a)({},br,function(){Yn(Hr)});yt.push(Bt),Q.addKeyMap(Bt)},Ct=0,Nt=Object.entries(se);Ct<Nt.length;Ct++){var Kt;Dt()}return Gt.current=setInterval(function(){kr.current&&Wr()},4e3),function(){clearInterval(Gt.current);var rr=Object(L.a)(yt),Wt;try{for(rr.s();!(Wt=rr.n()).done;){var br=Wt.value;Q.removeKeyMap(br)}}catch(Hr){rr.e(Hr)}finally{rr.f()}}}},[Q]),Object(y.useEffect)(function(){_t!==He&&Rt(_t)},[_t]),Object(et.a)(function(){if(!sn&&bt>0){var yt=new Date().getTime(),Dt=window.sessionStorage.getItem(ur);yt>=bt+je&&(!Dt||Dt!==Xe)&&(window.sessionStorage.setItem(ur,Xe),cr(!0))}},je),Object(y.useEffect)(function(){$t(Lt)},[Q,Lt]),Object(y.useEffect)(function(){Q&&(zt&&Q.focus())},[Q,zt]),Object(y.useEffect)(function(){if(It&&Q){var yt=Q.getScrollerElement();function Dt(Ct){var Nt=Ct.target;if(mr.current){var Kt=Nt.scrollTop/Nt.scrollHeight;mr.current.scrollTop=mr.current.scrollHeight*Kt}}return yt.addEventListener("scroll",Dt),function(){yt.removeEventListener("scroll",Dt)}}},[Q,It]),Object(y.useEffect)(function(){if(Q&&Xr){function yt(Dt,Ct){Xr(Dt,Ct)}return Q.on("beforeChange",yt),function(){Q.off("beforeChange",yt)}}},[Q,Xr]),Object(y.useEffect)(function(){if(Q&&or){function yt(){or(Q.getValue())}return Q.on("blur",yt),function(){Q.off("blur",yt)}}},[Q,or]),Object(y.useEffect)(function(){if(Q){function yt(Dt){var Ct=Dt.getValue();ft(Ct),jt(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),We&&We(Ct)}return Q.on("change",yt),function(){Q.off("change",yt)}}},[Q,We]),Object(y.useEffect)(function(){Q&&(at==null?(Q.setValue(""),ft("")):at!==Q.getValue()&&(Q.setValue(at),ft(at),Q.setCursor(Q.lineCount(),0)))},[Q,at]);var Yn=Object(y.useCallback)(function(yt){var Dt=Q.getCursor(),Ct=Q.getSelection(),Nt=Ct.split(`
|
|
`);switch(yt){case"bold":return Q.replaceSelection("**"+Ct+"**"),Ct===""&&Q.setCursor(Dt.line,Dt.ch+2),Q.focus();case"italic":return Q.replaceSelection("*"+Ct+"*"),Ct===""&&Q.setCursor(Dt.line,Dt.ch+1),Q.focus();case"code":return Q.replaceSelection("`"+Ct+"`"),Ct===""&&Q.setCursor(Dt.line,Dt.ch+1),Q.focus();case"inline-latex":return Q.replaceSelection("`$$"+Ct+"$$`"),Ct===""&&Q.setCursor(Dt.line,Dt.ch+3),Q.focus();case"latex":return Q.replaceSelection("```latex\n"+Ct+"\n```"),Q.setCursor(Dt.line+1,Ct.length+1),Q.focus();case"line-break":return Q.replaceSelection(`<br/>
|
|
`),Q.focus();case"list-ul":return Ct===""?Q.replaceSelection("- "+Ct):Q.replaceSelection(Nt.map(function(Kt){return Kt===""?"":"- ".concat(Kt)}).join(`
|
|
`)),Q.focus();case"list-ol":return Ct===""?Q.replaceSelection("1. "+Ct):Q.replaceSelection(Nt.map(function(Kt,rr){return Kt===""?"":"".concat(rr+1,". ").concat(Kt)}).join(`
|
|
`)),Q.focus();case"add-null-ch":return Ct===""&&Q.setCursor(Dt.line,Dt.ch+1),Q.replaceSelection(Ye),Q.focus();case"inster-template-1":return Ct===""&&Q.setCursor(Dt.line,Dt.ch),Q.replaceSelection(Ee),Q.focus();case"eraser":return Q.setValue(""),Q.focus();case"trigger-watch":return $t(!It),Q.focus();case"trigger-full-screen":return Rt(!He),Q.focus();case Ue:Xt(Ue);return;case it:Xt(it);return;case nt:Xt(nt);return;case $e:Xt($e);return;default:throw new Error}},[Q,It,He]),wn=Object(y.useCallback)(function(yt){Xt("");switch(nr){case Ue:var Dt=yt.title,Ct=yt.link;return Q.replaceSelection("[".concat(Dt,"](").concat(Ct,")")),Q.focus();case it:var Nt=yt.language,Kt=yt.content;return Q.replaceSelection(["```"+Nt,Kt,"```"].join(`
|
|
`)),Q.focus();case nt:var rr=yt.src,Wt=yt.alt,br=yt.name;return rr.indexOf("type=image")>-1?Q.replaceSelection(".concat(rr,' "').concat(Wt||"",'" )')):rr.indexOf("type=application/pdf")>-1?Q.replaceSelection('<a href="'.concat(rr,'&disposition=inline" target="_blank">').concat(br,"</a>")):Q.replaceSelection('<a href="'.concat(rr,'" target="_blank">').concat(br,"</a>")),Q.focus();case $e:for(var Hr=yt.row,Bt=yt.col,Rn=yt.align,Yt=`
|
|
`,Ar=0;Ar<Hr;Ar++){for(var nn=[],an=[],Wi=0;Wi<Bt;Wi++)Ar===1&&an.push(ct[Rn]),nn.push(" ");Ar===1&&(Yt+="| ".concat(an.join(" | "),` |
|
|
`)),Yt+="| ".concat(nn.join(Bt===1?"":" | "),` |
|
|
`)}return Q.replaceSelection(Yt+`
|
|
`),Q.focus();default:throw new Error}},[Q,nr]),Fi=Object(y.useMemo)(function(){switch(nr){case Ue:return C.a.createElement(oe,{callback:wn,onCancel:Jr});case it:return C.a.createElement(he.b,{callback:wn,onCancel:Jr});case nt:return C.a.createElement(de,{callback:wn,onCancel:Jr});case $e:return C.a.createElement(Ne,{callback:wn,onCancel:Jr});default:return null}},[nr]);function Jr(){Xt("")}Object(y.useEffect)(function(){if(yn.current){var yt=yn.current,Dt=!1,Ct=0;function Nt(Wt){Dt=!0,Ct=Wt.pageY}function Kt(){Dt=!1}function rr(Wt){if(Dt){var br=Wt.pageY-Ct;br<0&&(br=0),br>300&&(br=300);var Hr=lt+br+"px";tr(Hr)}}return yt.addEventListener("mousedown",Nt),document.addEventListener("mousemove",rr),document.addEventListener("mouseup",Kt),function(){yt.removeEventListener("mousedown",Nt),document.removeEventListener("mousemove",rr),document.removeEventListener("mouseup",Kt)}}},[Q,yn]),Object(y.useEffect)(function(){tr(lt)},[lt]);var fi=ge(wt),fn=ge(Qt),Xn={width:fi,height:fn},ji=Object(y.useMemo)(function(){if(bt){var yt=new Date(bt),Dt=yt.getHours(),Ct=yt.getMinutes(),Nt=yt.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,Ct=Ct<10?"0"+Ct:Ct,Nt=Nt<10?"0"+Nt:Nt,"".concat(Dt,":").concat(Ct,":").concat(Nt)}return 0},[bt]);function Nn(){window.sessionStorage.removeItem(ur),cr(!1),jt(0)}function Xa(){cr(!1),jt(0),Q.setValue(window.sessionStorage.getItem(ur))}function da(yt,Dt){var Ct=Q.getValue();Ct=Ct.replace(yt,Dt),ft(Ct),Q==null||Q.setValue(Ct)}return C.a.createElement(y.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:Jt},C.a.createElement("div",{className:"markdown-editor-container ".concat(At," ").concat(It?"on-preview":""," ").concat(Ht?"mini":""," ").concat(He?"full-screen":""),style:Xn},C.a.createElement(x,{insertTemp:Yr,watch:It,fullScreen:He,showNullButton:vt,onActionCallback:Yn,hidetoolBar:rn,uuid:Ut.current,setOpenPhones:function(){kr.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:yr,placeholder:cn})),It?C.a.createElement("div",{ref:mr,className:"preview-container"},Et==="stex"&&C.a.createElement(D,{value:Xe}),Et!=="stex"&&C.a.createElement(f.a,{edit:!0,value:Xe,replaces:da})):null))),Fr?C.a.createElement("a",{ref:yn,className:"editor-resize"}):null,C.a.createElement(N.a,null,ue[nr]?C.a.createElement(q.a,{centered:!0,title:ue[nr],visible:!0,onCancel:Jr,footer:null},Fi):null))}},RMFE:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0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qHJYhQIDABAR6FiYCBAikBAQ6dQ7LECBAYAICPQsTAQIEUgICnTqHZQgQIDABgZ6FiQABAikBgU6dwzIECBCYgEDPwkSAAIGUgECnzmEZAgQITECgZ2EiQIBASkCgU+ewDAECBCYg0LMwESBAICUg0KlzWIYAAQITEOhZmAgQIJASEOjUOSxDgACBCQj0LEwECBBICXz/dJvP5/PTP/V3BAgQIHAg4D/oA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Ke,Ie){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Z,le,q,L=!1,J,B;window.PR_SHOULD_USE_CONTINUATION=!0;var M,G;(function(){var F=window,P=["break,continue,do,else,for,if,return,while"],k=[P,"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"],y=[k,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[y,"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"],O=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],R=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],A="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",S=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="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",s=[P,"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"],u=[P,"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"],h=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[C,R,O,S,c,s,u,h],p=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,f="str",D="kwd",v="com",m="typ",a="lit",d="pun",o="pln",E="tag",b="dec",x="src",N="atn",U="atv",K="nocode",V="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(ye){for(var Me=0,Pe=!1,Ne=!1,Fe=0,Be=ye.length;Fe<Be;++Fe){var Ue=ye[Fe];if(Ue.ignoreCase)Ne=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Pe=!0,Ne=!1;break}}var nt={b:8,t:9,n:10,v:11,f:12,r:13};function it(ot){var Oe=ot.charCodeAt(0);if(Oe!==92)return Oe;var ht=ot.charAt(1);return Oe=nt[ht],Oe||("0"<=ht&&ht<="7"?parseInt(ot.substring(1),8):ht==="u"||ht==="x"?parseInt(ot.substring(2),16):ot.charCodeAt(1))}function $e(ot){if(ot<32)return(ot<16?"\\x0":"\\x")+ot.toString(16);var Oe=String.fromCharCode(ot);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function tt(ot){var Oe=ot.substring(1,ot.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")),ht=[],st=Oe[0]==="^",je=["["];st&&je.push("^");for(var Ye=st?1:0,Ee=Oe.length;Ye<Ee;++Ye){var ge=Oe[Ye];if(/\\[bdsw]/i.test(ge))je.push(ge);else{var be=it(ge),ne;Ye+2<Ee&&Oe[Ye+1]==="-"?(ne=it(Oe[Ye+2]),Ye+=2):ne=be,ht.push([be,ne]),ne<65||be>122||(ne<65||be>90||ht.push([Math.max(65,be)|32,Math.min(ne,90)|32]),ne<97||be>122||ht.push([Math.max(97,be)&~32,Math.min(ne,122)&~32]))}}ht.sort(function(ke,Se){return ke[0]-Se[0]||Se[1]-ke[1]});for(var ie=[],se=[],Ye=0;Ye<ht.length;++Ye){var ue=ht[Ye];ue[0]<=se[1]+1?se[1]=Math.max(se[1],ue[1]):ie.push(se=ue)}for(var Ye=0;Ye<ie.length;++Ye){var ue=ie[Ye];je.push($e(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&je.push("-"),je.push($e(ue[1])))}return je.push("]"),je.join("")}function ct(ot){for(var Oe=ot.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")),ht=Oe.length,st=[],je=0,Ye=0;je<ht;++je){var Ee=Oe[je];if(Ee==="(")++Ye;else if(Ee.charAt(0)==="\\"){var ge=+Ee.substring(1);ge&&(ge<=Ye?st[ge]=-1:Oe[je]=$e(ge))}}for(var je=1;je<st.length;++je)st[je]===-1&&(st[je]=++Me);for(var je=0,Ye=0;je<ht;++je){var Ee=Oe[je];if(Ee==="(")++Ye,st[Ye]||(Oe[je]="(?:");else if(Ee.charAt(0)==="\\"){var ge=+Ee.substring(1);ge&&ge<=Ye&&(Oe[je]="\\"+st[ge])}}for(var je=0;je<ht;++je)Oe[je]==="^"&&Oe[je+1]!=="^"&&(Oe[je]="");if(ot.ignoreCase&&Pe)for(var je=0;je<ht;++je){var Ee=Oe[je],be=Ee.charAt(0);Ee.length>=2&&be==="["?Oe[je]=tt(Ee):be!=="\\"&&(Oe[je]=Ee.replace(/[a-zA-Z]/g,function(se){var ue=se.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Oe.join("")}for(var et=[],Fe=0,Be=ye.length;Fe<Be;++Fe){var Ue=ye[Fe];if(Ue.global||Ue.multiline)throw new Error(""+Ue);et.push("(?:"+ct(Ue)+")")}return new RegExp(et.join("|"),Ne?"gi":"g")}function I(ye,Me){var Pe=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Fe=0,Be=[],Ue=0;function nt(it){var $e=it.nodeType;if($e==1){if(Pe.test(it.className))return;for(var tt=it.firstChild;tt;tt=tt.nextSibling)nt(tt);var ct=it.nodeName.toLowerCase();(ct==="br"||ct==="li")&&(Ne[Ue]=`
|
|
`,Be[Ue<<1]=Fe++,Be[Ue++<<1|1]=it)}else if($e==3||$e==4){var et=it.nodeValue;et.length&&(Me?et=et.replace(/\r\n?/g,`
|
|
`):et=et.replace(/[ \t\r\n]+/g," "),Ne[Ue]=et,Be[Ue<<1]=Fe,Fe+=et.length,Be[Ue++<<1|1]=it)}}return nt(ye),{sourceCode:Ne.join("").replace(/\n$/,""),spans:Be}}function Y(ye,Me,Pe,Ne,Fe){if(!Pe)return;var Be={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Pe,spans:null,basePos:Me,decorations:null};Ne(Be),Fe.push.apply(Fe,Be.decorations)}var ee=/\S/;function oe(ye){for(var Me=void 0,Pe=ye.firstChild;Pe;Pe=Pe.nextSibling){var Ne=Pe.nodeType;Me=Ne===1?Me?ye:Pe:Ne===3&&ee.test(Pe.nodeValue)?ye:Me}return Me===ye?void 0:Me}function he(ye,Me){var Pe={},Ne;(function(){for(var Ue=ye.concat(Me),nt=[],it={},$e=0,tt=Ue.length;$e<tt;++$e){var ct=Ue[$e],et=ct[3];if(et)for(var ot=et.length;--ot>=0;)Pe[et.charAt(ot)]=ct;var Oe=ct[1],ht=""+Oe;it.hasOwnProperty(ht)||(nt.push(Oe),it[ht]=null)}nt.push(/[\0-\uffff]/),Ne=_(nt)})();var Fe=Me.length,Be=function(Ue){for(var nt=Ue.sourceCode,it=Ue.basePos,$e=Ue.sourceNode,tt=[it,o],ct=0,et=nt.match(Ne)||[],ot={},Oe=0,ht=et.length;Oe<ht;++Oe){var st=et[Oe],je=ot[st],Ye=void 0,Ee;if(typeof je=="string")Ee=!1;else{var ge=Pe[st.charAt(0)];if(ge)Ye=st.match(ge[1]),je=ge[0];else{for(var be=0;be<Fe;++be)if(ge=Me[be],Ye=st.match(ge[1]),Ye){je=ge[0];break}Ye||(je=o)}Ee=je.length>=5&&je.substring(0,5)==="lang-",Ee&&!(Ye&&typeof Ye[1]=="string")&&(Ee=!1,je=x),Ee||(ot[st]=je)}var ne=ct;if(ct+=st.length,!Ee)tt.push(it+ne,je);else{var ie=Ye[1],se=st.indexOf(ie),ue=se+ie.length;Ye[2]&&(ue=st.length-Ye[2].length,se=ue-ie.length);var ke=je.substring(5);Y($e,it+ne,st.substring(0,se),Be,tt),Y($e,it+ne+se,ie,de(ke,ie),tt),Y($e,it+ne+ue,st.substring(ue),Be,tt)}}Ue.decorations=tt};return Be}function Le(ye){var Me=[],Pe=[];ye.tripleQuotedStrings?Me.push([f,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Me.push([f,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([f,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Pe.push([f,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=ye.hashComments;Ne&&(ye.cStyleComments?(Ne>1?Me.push([v,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([v,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Pe.push([f,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([v,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Pe.push([v,/^\/\/[^\r\n]*/,null]),Pe.push([v,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=ye.regexLiterals;if(Fe){var Be=Fe>1?"":`
|
|
\r`,Ue=Be?".":"[\\S\\s]",nt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Pe.push(["lang-regex",RegExp("^"+V+"("+nt+")")])}var it=ye.types;it&&Pe.push([m,it]);var $e=(""+ye.keywords).replace(/^ | $/g,"");$e.length&&Pe.push([D,new RegExp("^(?:"+$e.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([o,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(tt+="(?!s*/)"),Pe.push([a,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[a,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[d,new RegExp(tt),null]),he(Me,Pe)}var xe=Le({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ae(ye,Me,Pe){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Be=ye.ownerDocument,Ue=Be.createElement("li");ye.firstChild;)Ue.appendChild(ye.firstChild);var nt=[Ue];function it(Oe){var ht=Oe.nodeType;if(ht==1&&!Ne.test(Oe.className))if(Oe.nodeName==="br")$e(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var st=Oe.firstChild;st;st=st.nextSibling)it(st);else if((ht==3||ht==4)&&Pe){var je=Oe.nodeValue,Ye=je.match(Fe);if(Ye){var Ee=je.substring(0,Ye.index);Oe.nodeValue=Ee;var ge=je.substring(Ye.index+Ye[0].length);if(ge){var be=Oe.parentNode;be.insertBefore(Be.createTextNode(ge),Oe.nextSibling)}$e(Oe),Ee||Oe.parentNode.removeChild(Oe)}}}function $e(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function ht(Ye,Ee){var ge=Ee?Ye.cloneNode(!1):Ye,be=Ye.parentNode;if(be){var ne=ht(be,1),ie=Ye.nextSibling;ne.appendChild(ge);for(var se=ie;se;se=ie)ie=se.nextSibling,ne.appendChild(se)}return ge}for(var st=ht(Oe.nextSibling,0),je;(je=st.parentNode)&&je.nodeType===1;)st=je;nt.push(st)}for(var tt=0;tt<nt.length;++tt)it(nt[tt]);Me===(Me|0)&&nt[0].setAttribute("value",Me);var ct=Be.createElement("ol");ct.className="linenums";for(var et=Math.max(0,Me-1|0)||0,tt=0,ot=nt.length;tt<ot;++tt)Ue=nt[tt],Ue.className="L"+(tt+et)%10,Ue.firstChild||Ue.appendChild(Be.createTextNode("\xA0")),ct.appendChild(Ue);ye.appendChild(ct)}function Te(ye){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Pe=/\n/g,Ne=ye.sourceCode,Fe=Ne.length,Be=0,Ue=ye.spans,nt=Ue.length,it=0,$e=ye.decorations,tt=$e.length,ct=0;$e[tt]=Fe;var et,ot;for(ot=et=0;ot<tt;)$e[ot]!==$e[ot+2]?($e[et++]=$e[ot++],$e[et++]=$e[ot++]):ot+=2;for(tt=et,ot=et=0;ot<tt;){for(var Oe=$e[ot],ht=$e[ot+1],st=ot+2;st+2<=tt&&$e[st+1]===ht;)st+=2;$e[et++]=Oe,$e[et++]=ht,ot=st}tt=$e.length=et;var je=ye.sourceNode,Ye="";je&&(Ye=je.style.display,je.style.display="none");try{for(var Ee=null;it<nt;){var ge=Ue[it],be=Ue[it+2]||Fe,ne=$e[ct+2]||Fe,st=Math.min(be,ne),ie=Ue[it+1],se;if(ie.nodeType!==1&&(se=Ne.substring(Be,st))){Me&&(se=se.replace(Pe,"\r")),ie.nodeValue=se;var ue=ie.ownerDocument,ke=ue.createElement("span");ke.className=$e[ct+1];var Se=ie.parentNode;Se.replaceChild(ke,ie),ke.appendChild(ie),Be<be&&(Ue[it+1]=ie=ue.createTextNode(Ne.substring(st,be)),Se.insertBefore(ie,ke.nextSibling))}Be=st,Be>=be&&(it+=2),Be>=ne&&(ct+=2)}}finally{je&&(je.style.display=Ye)}}var Ce={};function pe(ye,Me){for(var Pe=Me.length;--Pe>=0;){var Ne=Me[Pe];Ce.hasOwnProperty(Ne)?F.console&&console.warn("cannot override language handler %s",Ne):Ce[Ne]=ye}}function de(ye,Me){return ye&&Ce.hasOwnProperty(ye)||(ye=/^\s*</.test(Me)?"default-markup":"default-code"),Ce[ye]}pe(xe,["default-code"]),pe(he([],[[o,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[v,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["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"]),pe(he([[o,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),pe(he([],[[U,/^[\s\S]+/]]),["uq.val"]),pe(Le({keywords:C,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),pe(Le({keywords:"null,true,false"}),["json"]),pe(Le({keywords:R,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),pe(Le({keywords:O,cStyleComments:!0}),["java"]),pe(Le({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Le({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Le({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Le({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Le({keywords:S,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Le({keywords:A,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(he([],[[f,/^[\s\S]+/]]),["regex"]);function re(ye){var Me=ye.langExtension;try{var Pe=I(ye.sourceNode,ye.pre),Ne=Pe.sourceCode;ye.sourceCode=Ne,ye.spans=Pe.spans,ye.basePos=0,de(Me,Ne)(ye),Te(ye)}catch(Fe){F.console&&console.log(Fe&&Fe.stack||Fe)}}function ce(ye,Me,Pe){var Ne=Pe||!1,Fe=Me||null,Be=document.createElement("div");Be.innerHTML="<pre>"+ye+"</pre>",Be=Be.firstChild,Ne&&Ae(Be,Ne,!0);var Ue={langExtension:Fe,numberLines:Ne,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Ue),Be.innerHTML}function ae(ye,Me){var Pe=Me||document.body,Ne=Pe.ownerDocument||document;function Fe(ge){return Pe.getElementsByTagName(ge)}for(var Be=[Fe("pre"),Fe("code"),Fe("xmp")],Ue=[],nt=0;nt<Be.length;++nt)for(var it=0,$e=Be[nt].length;it<$e;++it)Ue.push(Be[nt][it]);Be=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var ct=0,et=/\blang(?:uage)?-([\w.]+)(?!\S)/,ot=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,ht=/pre|xmp/i,st=/^code$/i,je=/^(?:pre|code|xmp)$/i,Ye={};function Ee(){for(var ge=F.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;ct<Ue.length&&tt.now()<ge;ct++){for(var be=Ue[ct],ne=Ye,ie=be;ie=ie.previousSibling;){var se=ie.nodeType,ue=(se===7||se===8)&&ie.nodeValue;if(ue?!/^\??prettify\b/.test(ue):se!==3||/\S/.test(ie.nodeValue))break;if(ue){ne={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(zt,Lt,Yr){ne[Lt]=Yr});break}}var ke=be.className;if((ne!==Ye||ot.test(ke))&&!Oe.test(ke)){for(var Se=!1,Ve=be.parentNode;Ve;Ve=Ve.parentNode){var at=Ve.tagName;if(je.test(at)&&Ve.className&&ot.test(Ve.className)){Se=!0;break}}if(!Se){be.className+=" prettyprinted";var We=ne.lang;if(!We){We=ke.match(et);var mt;!We&&(mt=oe(be))&&st.test(mt.tagName)&&(We=mt.className.match(et)),We&&(We=We[1])}var wt;if(ht.test(be.tagName))wt=1;else{var ze=be.currentStyle,lt=Ne.defaultView,Mt=ze?ze.whiteSpace:lt&<.getComputedStyle?lt.getComputedStyle(be,null).getPropertyValue("white-space"):0;wt=Mt&&Mt.substring(0,3)==="pre"}var Ht=ne.linenums;(Ht=Ht==="true"||+Ht)||(Ht=ke.match(/\blinenums\b(?::(\d+))?/),Ht=Ht?Ht[1]&&Ht[1].length?+Ht[1]:!0:!1),Ht&&Ae(be,Ht,wt);var qt={langExtension:We,sourceNode:be,numberLines:Ht,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};re(qt)}}}ct<Ue.length?F.setTimeout(Ee,250):typeof ye=="function"&&ye()}Ee()}var we=F.PR={createSimpleLexer:he,registerLangHandler:pe,sourceDecorator:Le,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:U,PR_COMMENT:v,PR_DECLARATION:b,PR_KEYWORD:D,PR_LITERAL:a,PR_NOCODE:K,PR_PLAIN:o,PR_PUNCTUATION:d,PR_SOURCE:x,PR_STRING:f,PR_TAG:E,PR_TYPE:m,prettyPrintOne:L?F.prettyPrintOne=ce:M=ce,prettyPrint:G=L?F.prettyPrint=ae:G=ae},De=F.define;typeof De=="function"&&De.amd&&De("google-code-prettify",[],function(){return we})})()},SMhR:function(Ke,Ie){Ke.exports="data:image/png;base64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DZtM0NIJ+sbTZAbgB5U9s8qW02QDZt861OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI2ffDkgT2qbJwF5UttsgLwJyJPa5gaQG0De0jY3gGza5gaQG22zAXKjbZ4EZAPkTUBuANm0zac6kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjR+ole1zZvaZgPkRtvcAPIkIJu22QDZtM3fCsiNttkAudE2TwKyaZtN22yAbNrmBpAbbbMBsgGyaZu3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Ke,Ie,Z){Ke.exports=Z.p+"static/lockclose.365036e8.svg"},UZu5:function(Ke,Ie,Z){},"VrN/":function(Ke,Ie,Z){(function(le,q){Ke.exports=q()})(this,function(){"use strict";var le=navigator.userAgent,q=navigator.platform,L=/gecko\/\d/i.test(le),J=/MSIE \d/.test(le),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(le),M=/Edge\/(\d+)/.exec(le),G=J||B||M,F=G&&(J?document.documentMode||6:+(M||B)[1]),P=!M&&/WebKit\//.test(le),k=P&&/Qt\/\d+\.\d+/.test(le),y=!M&&/Chrome\//.test(le),C=/Opera\//.test(le),O=/Apple Computer/.test(navigator.vendor),R=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(le),A=/PhantomJS/.test(le),S=!M&&/AppleWebKit/.test(le)&&/Mobile\/\w+/.test(le),c=/Android/.test(le),s=S||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(le),u=S||/Mac/.test(q),h=/\bCrOS\b/.test(le),T=/win/i.test(q),p=C&&le.match(/Version\/(\d*\.\d*)/);p&&(p=Number(p[1])),p&&p>=15&&(C=!1,P=!0);var f=u&&(k||C&&(p==null||p<12.11)),D=L||G&&F>=9;function v(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var n=e.className,r=v(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function a(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function d(e,t){return a(e).appendChild(t)}function o(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var w=0;w<t.length;++w)i.appendChild(t[w]);return i}function E(e,t,n,r){var i=o(e,t,n,r);return i.setAttribute("role","presentation"),i}var b;document.createRange?b=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:b=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function x(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var n=e.className;v(t).test(n)||(e.className+=(n?" ":"")+t)}function K(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!v(n[r]).test(t)&&(t+=" "+n[r]);return t}var V=function(e){e.select()};S?V=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(V=function(e){try{e.select()}catch(t){}});function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Y(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var w=r||0,j=i||0;;){var X=e.indexOf(" ",w);if(X<0||X>=t)return j+(t-w);j+=X-w,j+=n-j%n,w=X+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var he=50,Le={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ae={origin:"*mouse"},Te={origin:"+move"};function Ce(e,t,n){for(var r=0,i=0;;){var w=e.indexOf(" ",r);w==-1&&(w=e.length);var j=w-r;if(w==e.length||i+j>=t)return r+Math.min(j,t-i);if(i+=w-r,i+=n-i%n,r=w+1,i>=t)return r}}var pe=[""];function de(e){for(;pe.length<=e;)pe.push(re(pe)+" ");return pe[e]}function re(e){return e[e.length-1]}function ce(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ae(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function we(){}function De(e,t){var n;return Object.create?n=Object.create(e):(we.prototype=e,n=new we),t&&I(t,n),n}var ye=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Pe(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function Ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fe=/[\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 Be(e){return e.charCodeAt(0)>=768&&Fe.test(e)}function Ue(e,t,n){for(;(n<0?t>0:t<e.length)&&Be(e.charAt(t));)t+=n;return t}function nt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,w=r<0?Math.ceil(i):Math.floor(i);if(w==t)return e(w)?t:n;e(w)?n=w:t=w+r}}function it(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,w=0;w<e.length;++w){var j=e[w];(j.from<n&&j.to>t||t==n&&j.to==t)&&(r(Math.max(j.from,t),Math.min(j.to,n),j.level==1?"rtl":"ltr",w),i=!0)}i||r(t,n,"ltr")}var $e=null;function tt(e,t,n){var r;$e=null;for(var i=0;i<e.length;++i){var w=e[i];if(w.from<t&&w.to>t)return i;w.to==t&&(w.from!=w.to&&n=="before"?r=i:$e=i),w.from==t&&(w.from!=w.to&&n!="before"?r=i:$e=i)}return r!=null?r:$e}var ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,w=/[LRr]/,j=/[Lb1n]/,X=/[1n]/;function $(te,fe,ve){this.level=te,this.from=fe,this.to=ve}return function(te,fe){var ve=fe=="ltr"?"L":"R";if(te.length==0||fe=="ltr"&&!r.test(te))return!1;for(var _e=te.length,Re=[],Ge=0;Ge<_e;++Ge)Re.push(n(te.charCodeAt(Ge)));for(var Ze=0,rt=ve;Ze<_e;++Ze){var ut=Re[Ze];ut=="m"?Re[Ze]=rt:rt=ut}for(var pt=0,dt=ve;pt<_e;++pt){var gt=Re[pt];gt=="1"&&dt=="r"?Re[pt]="n":w.test(gt)&&(dt=gt,gt=="r"&&(Re[pt]="R"))}for(var Tt=1,xt=Re[0];Tt<_e-1;++Tt){var Ot=Re[Tt];Ot=="+"&&xt=="1"&&Re[Tt+1]=="1"?Re[Tt]="1":Ot==","&&xt==Re[Tt+1]&&(xt=="1"||xt=="n")&&(Re[Tt]=xt),xt=Ot}for(var lr=0;lr<_e;++lr){var Rr=Re[lr];if(Rr==",")Re[lr]="N";else if(Rr=="%"){var fr=void 0;for(fr=lr+1;fr<_e&&Re[fr]=="%";++fr);for(var qr=lr&&Re[lr-1]=="!"||fr<_e&&Re[fr]=="1"?"1":"N",Kr=lr;Kr<fr;++Kr)Re[Kr]=qr;lr=fr-1}}for(var Er=0,Vr=ve;Er<_e;++Er){var _r=Re[Er];Vr=="L"&&_r=="1"?Re[Er]="L":w.test(_r)&&(Vr=_r)}for(var Sr=0;Sr<_e;++Sr)if(i.test(Re[Sr])){var xr=void 0;for(xr=Sr+1;xr<_e&&i.test(Re[xr]);++xr);for(var pr=(Sr?Re[Sr-1]:ve)=="L",Qr=(xr<_e?Re[xr]:ve)=="L",ci=pr==Qr?pr?"L":"R":ve,Pn=Sr;Pn<xr;++Pn)Re[Pn]=ci;Sr=xr-1}for(var Pr=[],xn,Dr=0;Dr<_e;)if(j.test(Re[Dr])){var Qa=Dr;for(++Dr;Dr<_e&&j.test(Re[Dr]);++Dr);Pr.push(new $(0,Qa,Dr))}else{var Tn=Dr,Kn=Pr.length,Vn=fe=="rtl"?1:0;for(++Dr;Dr<_e&&Re[Dr]!="L";++Dr);for(var Ur=Tn;Ur<Dr;)if(X.test(Re[Ur])){Tn<Ur&&(Pr.splice(Kn,0,new $(1,Tn,Ur)),Kn+=Vn);var hi=Ur;for(++Ur;Ur<Dr&&X.test(Re[Ur]);++Ur);Pr.splice(Kn,0,new $(2,hi,Ur)),Kn+=Vn,Tn=Ur}else++Ur;Tn<Dr&&Pr.splice(Kn,0,new $(1,Tn,Dr))}return fe=="ltr"&&(Pr[0].level==1&&(xn=te.match(/^\s+/))&&(Pr[0].from=xn[0].length,Pr.unshift(new $(0,0,xn[0].length))),re(Pr).level==1&&(xn=te.match(/\s+$/))&&(re(Pr).to-=xn[0].length,Pr.push(new $(0,_e-xn[0].length,_e)))),fe=="rtl"?Pr.reverse():Pr}}();function et(e,t){var n=e.order;return n==null&&(n=e.order=ct(e.text,t)),n}var ot=[],Oe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ot).concat(n)}};function ht(e,t){return e._handlers&&e._handlers[t]||ot}function st(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var w=oe(i,n);w>-1&&(r[t]=i.slice(0,w).concat(i.slice(w+1)))}}}function je(e,t){var n=ht(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ye(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),je(e,n||t.type,e,t),se(t)||t.codemirrorIgnore}function Ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function ge(e,t){return ht(e,t).length>0}function be(e){e.prototype.on=function(t,n){Oe(this,t,n)},e.prototype.off=function(t,n){st(this,t,n)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function se(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){ne(e),ie(e)}function ke(e){return e.target||e.srcElement}function Se(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var Ve=function(){if(G&&F<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),at;function We(e){if(at==null){var t=o("span","\u200B");d(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(at=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&F<8))}var n=at?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var mt;function wt(e){if(mt!=null)return mt;var t=d(e,document.createTextNode("A\u062EA")),n=b(t,0,1).getBoundingClientRect(),r=b(t,1,2).getBoundingClientRect();return a(e),!n||n.left==n.right?!1:mt=r.right-n.right<3}var ze=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var w=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),j=w.indexOf("\r");j!=-1?(n.push(w.slice(0,j)),t+=j+1):(n.push(w),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},lt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Mt=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ht=null;function qt(e){if(Ht!=null)return Ht;var t=d(e,o("span","x")),n=t.getBoundingClientRect(),r=b(t,0,1).getBoundingClientRect();return Ht=Math.abs(n.left-r.left)>1}var zt={},Lt={};function Yr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),zt[e]=t}function on(e,t){Lt[e]=t}function Et(e){if(typeof e=="string"&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&typeof e.name=="string"&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];typeof t=="string"&&(t={name:t}),e=De(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Et("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Et("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Nr(e,t){t=Et(t);var n=zt[t.name];if(!n)return Nr(e,"text/plain");var r=n(e,t);if(ur.hasOwnProperty(t.name)){var i=ur[t.name];for(var w in i){if(!i.hasOwnProperty(w))continue;r.hasOwnProperty(w)&&(r["_"+w]=r[w]),r[w]=i[w]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var j in t.modeProps)r[j]=t.modeProps[j];return r}var ur={};function Cr(e,t){var n=ur.hasOwnProperty(e)?ur[e]:ur[e]={};I(t,n)}function Fr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function tn(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function sn(e,t,n){return e.startState?e.startState(t,n):!0}var Ft=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(j){return n?j.toLowerCase():j},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var w=this.string.slice(this.pos).match(e);return w&&w.index>0?null:(w&&t!==!1&&(this.pos+=w[0].length),w)}},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function vt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],w=i.chunkSize();if(t<w){n=i;break}t-=w}return n.lines[t]}function ar(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(w){var j=w.text;i==n.line&&(j=j.slice(0,n.ch)),i==t.line&&(j=j.slice(t.ch)),r.push(j),++i}),r}function rn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Or(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function _t(e){if(e.parent==null)return null;for(var t=e.parent,n=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function or(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],w=i.height;if(t<w){e=i;continue e}t-=w,n+=i.chunkSize()}return n}while(!e.lines);for(var j=0;j<e.lines.length;++j){var X=e.lines[j],$=X.height;if(t<$)break;t-=$}return n+j}function Xr(e,t){return t>=e.first&&t<e.first+e.size}function ln(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function qe(e,t,n){if(n===void 0&&(n=null),!(this instanceof qe))return new qe(e,t,n);this.line=e,this.ch=t,this.sticky=n}function At(e,t){return e.line-t.line||e.ch-t.ch}function un(e,t){return e.sticky==t.sticky&&At(e,t)==0}function vn(e){return qe(e.line,e.ch)}function dn(e,t){return At(e,t)<0?t:e}function cn(e,t){return At(e,t)<0?e:t}function z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function l(e,t){if(t.line<e.first)return qe(e.first,0);var n=e.first+e.size-1;return t.line>n?qe(n,vt(e,n).text.length):g(t,vt(e,t.line).text.length)}function g(e,t){var n=e.ch;return n==null||n>t?qe(e.line,t):n<0?qe(e.line,0):e}function W(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=l(e,t[r]);return n}var Q=function(e,t){this.state=e,this.lookAhead=t},H=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};H.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},H.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}},H.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},H.fromSaved=function(e,t,n){return t instanceof Q?new H(e,Fr(e.mode,t.state),n,t.lookAhead):new H(e,Fr(e.mode,t),n)},H.prototype.save=function(e){var t=e!==!1?Fr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Q(t,this.maxLookAhead):t};function me(e,t,n,r){var i=[e.state.modeGen],w={};Mr(e,t.text,e.doc.mode,n,function(te,fe){return i.push(te,fe)},w,r);for(var j=n.state,X=function(te){n.baseTokens=i;var fe=e.state.overlays[te],ve=1,_e=0;n.state=!0,Mr(e,t.text,fe.mode,n,function(Re,Ge){for(var Ze=ve;_e<Re;){var rt=i[ve];rt>Re&&i.splice(ve,1,Re,i[ve+1],rt),ve+=2,_e=Math.min(Re,rt)}if(!Ge)return;if(fe.opaque)i.splice(Ze,ve-Ze,Re,"overlay "+Ge),ve=Ze+2;else for(;Ze<ve;Ze+=2){var ut=i[Ze+1];i[Ze+1]=(ut?ut+" ":"")+"overlay "+Ge}},w),n.state=j,n.baseTokens=null,n.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)X($);return{styles:i,classes:w.bgClass||w.textClass?w:null}}function Qe(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Xe(e,_t(t)),i=t.text.length>e.options.maxHighlightLength&&Fr(e.doc.mode,r.state),w=me(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=w.styles,w.classes?t.styleClasses=w.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xe(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new H(r,!0,t);var w=He(e,t,n),j=w>r.first&&vt(r,w-1).stateAfter,X=j?H.fromSaved(r,j,w):new H(r,sn(r.mode),w);return r.iter(w,t,function($){ft(e,$.text,X);var te=X.line;$.stateAfter=te==t-1||te%5==0||te>=i.viewFrom&&te<i.viewTo?X.save():null,X.nextLine()}),n&&(r.modeFrontier=X.line),X}function ft(e,t,n,r){var i=e.doc.mode,w=new Ft(t,e.options.tabSize,n);for(w.start=w.pos=r||0,t==""&&Je(i,n.state);!w.eol();)St(i,w,n.state),w.start=w.pos}function Je(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=tn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function St(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=tn(e,n).mode);var w=e.token(t,n);if(t.pos>t.start)return w}throw new Error("Mode "+e.name+" failed to advance stream.")}var It=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,r){var i=e.doc,w=i.mode,j;t=l(i,t);var X=vt(i,t.line),$=Xe(e,t.line,n),te=new Ft(X.text,e.options.tabSize,$),fe;for(r&&(fe=[]);(r||te.pos<t.ch)&&!te.eol();)te.start=te.pos,j=St(w,te,$.state),r&&fe.push(new It(te,j,Fr(i.mode,$.state)));return r?fe:new It(te,j,$.state)}function jr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Mr(e,t,n,r,i,w,j){var X=n.flattenSpans;X==null&&(X=e.options.flattenSpans);var $=0,te=null,fe=new Ft(t,e.options.tabSize,r),ve,_e=e.options.addModeClass&&[null];for(t==""&&jr(Je(n,r.state),w);!fe.eol();){if(fe.pos>e.options.maxHighlightLength?(X=!1,j&&ft(e,t,r,fe.pos),fe.pos=t.length,ve=null):ve=jr(St(n,fe,r.state,_e),w),_e){var Re=_e[0].name;Re&&(ve="m-"+(ve?Re+" "+ve:Re))}if(!X||te!=ve){for(;$<fe.start;)$=Math.min(fe.start,$+5e3),i($,te);te=ve}fe.start=fe.pos}for(;$<fe.pos;){var Ge=Math.min(fe.pos,$+5e3);i(Ge,te),$=Ge}}function He(e,t,n){for(var r,i,w=e.doc,j=n?-1:t-(e.doc.mode.innerMode?1e3:100),X=t;X>j;--X){if(X<=w.first)return w.first;var $=vt(w,X-1),te=$.stateAfter;if(te&&(!n||X+(te instanceof Q?te.lookAhead:0)<=w.modeFrontier))return X;var fe=Y($.text,null,e.options.tabSize);(i==null||r>fe)&&(i=X-1,r=fe)}return i}function Rt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=vt(e,r).stateAfter;if(i&&(!(i instanceof Q)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var er=!1,kt=!1;function nr(){er=!0}function Xt(){kt=!0}function dr(e,t,n){this.marker=e,this.from=t,this.to=n}function Pt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function bt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function jt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function sr(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var w=e[i],j=w.marker,X=w.from==null||(j.inclusiveLeft?w.from<=t:w.from<t);if(X||w.from==t&&j.type=="bookmark"&&(!n||!w.marker.insertLeft)){var $=w.to==null||(j.inclusiveRight?w.to>=t:w.to>t);(r||(r=[])).push(new dr(j,w.from,$?null:w.to))}}return r}function Vt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var w=e[i],j=w.marker,X=w.to==null||(j.inclusiveRight?w.to>=t:w.to>t);if(X||w.from==t&&j.type=="bookmark"&&(!n||w.marker.insertLeft)){var $=w.from==null||(j.inclusiveLeft?w.from<=t:w.from<t);(r||(r=[])).push(new dr(j,$?null:w.from-t,w.to==null?null:w.to-t))}}return r}function Qt(e,t){if(t.full)return null;var n=Xr(e,t.from.line)&&vt(e,t.from.line).markedSpans,r=Xr(e,t.to.line)&&vt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,w=t.to.ch,j=At(t.from,t.to)==0,X=sr(n,i,j),$=Vt(r,w,j),te=t.text.length==1,fe=re(t.text).length+(te?i:0);if(X)for(var ve=0;ve<X.length;++ve){var _e=X[ve];if(_e.to==null){var Re=Pt($,_e.marker);Re?te&&(_e.to=Re.to==null?null:Re.to+fe):_e.to=i}}if($)for(var Ge=0;Ge<$.length;++Ge){var Ze=$[Ge];if(Ze.to!=null&&(Ze.to+=fe),Ze.from==null){var rt=Pt(X,Ze.marker);rt||(Ze.from=fe,te&&(X||(X=[])).push(Ze))}else Ze.from+=fe,te&&(X||(X=[])).push(Ze)}X&&(X=tr(X)),$&&$!=X&&($=tr($));var ut=[X];if(!te){var pt=t.text.length-2,dt;if(pt>0&&X)for(var gt=0;gt<X.length;++gt)X[gt].to==null&&(dt||(dt=[])).push(new dr(X[gt].marker,null,null));for(var Tt=0;Tt<pt;++Tt)ut.push(dt);ut.push($)}return ut}function tr(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function vr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Re){if(Re.markedSpans)for(var Ge=0;Ge<Re.markedSpans.length;++Ge){var Ze=Re.markedSpans[Ge].marker;Ze.readOnly&&(!r||oe(r,Ze)==-1)&&(r||(r=[])).push(Ze)}}),!r)return null;for(var i=[{from:t,to:n}],w=0;w<r.length;++w)for(var j=r[w],X=j.find(0),$=0;$<i.length;++$){var te=i[$];if(At(te.to,X.from)<0||At(te.from,X.to)>0)continue;var fe=[$,1],ve=At(te.from,X.from),_e=At(te.to,X.to);(ve<0||!j.inclusiveLeft&&!ve)&&fe.push({from:te.from,to:X.from}),(_e>0||!j.inclusiveRight&&!_e)&&fe.push({from:X.to,to:te.to}),i.splice.apply(i,fe),$+=fe.length-3}return i}function hn(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function Cn(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function cr(e){return e.inclusiveLeft?-1:0}function Ut(e){return e.inclusiveRight?1:0}function kr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),w=At(r.from,i.from)||cr(e)-cr(t);if(w)return-w;var j=At(r.to,i.to)||Ut(e)-Ut(t);return j||t.id-e.id}function Gt(e,t){var n=kt&&e.markedSpans,r;if(n)for(var i=void 0,w=0;w<n.length;++w)i=n[w],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||kr(r,i.marker)<0)&&(r=i.marker);return r}function yr(e){return Gt(e,!0)}function Jt(e){return Gt(e,!1)}function yn(e,t){var n=kt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var w=n[i];w.marker.collapsed&&(w.from==null||w.from<t)&&(w.to==null||w.to>t)&&(!r||kr(r,w.marker)<0)&&(r=w.marker)}return r}function mr(e,t,n,r,i){var w=vt(e,t),j=kt&&w.markedSpans;if(j)for(var X=0;X<j.length;++X){var $=j[X];if(!$.marker.collapsed)continue;var te=$.marker.find(0),fe=At(te.from,n)||cr($.marker)-cr(i),ve=At(te.to,r)||Ut($.marker)-Ut(i);if(fe>=0&&ve<=0||fe<=0&&ve>=0)continue;if(fe<=0&&($.marker.inclusiveRight&&i.inclusiveLeft?At(te.to,n)>=0:At(te.to,n)>0)||fe>=0&&($.marker.inclusiveRight&&i.inclusiveLeft?At(te.from,r)<=0:At(te.from,r)<0))return!0}}function Wr(e){for(var t;t=yr(e);)e=t.find(-1,!0).line;return e}function Qn(e){for(var t;t=Jt(e);)e=t.find(1,!0).line;return e}function Yn(e){for(var t,n;t=Jt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function wn(e,t){var n=vt(e,t),r=Wr(n);return n==r?t:_t(r)}function Fi(e,t){if(t>e.lastLine())return t;var n=vt(e,t),r;if(!Jr(e,n))return t;for(;r=Jt(n);)n=r.find(1,!0).line;return _t(n)+1}function Jr(e,t){var n=kt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&fi(e,t,r))return!0}}function fi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return fi(e,r.line,Pt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,w=0;w<t.markedSpans.length;++w)if(i=t.markedSpans[w],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&fi(e,t,i))return!0}function fn(e){e=Wr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var w=n.parent;w;n=w,w=n.parent)for(var j=0;j<w.children.length;++j){var X=w.children[j];if(X==n)break;t+=X.height}return t}function Xn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=yr(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Jt(r);){var w=n.find(0,!0);t-=r.text.length-w.from.ch,r=w.to.line,t+=r.text.length-w.to.ch}return t}function ji(e){var t=e.display,n=e.doc;t.maxLine=vt(n,n.first),t.maxLineLength=Xn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Xn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Nn=function(e,t,n){this.text=e,Cn(this,t),this.height=n?n(this):1};Nn.prototype.lineNo=function(){return _t(this)},be(Nn);function Xa(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),hn(e),Cn(e,n);var i=r?r(e):1;i!=e.height&&Or(e,i)}function da(e){e.parent=null,hn(e)}var yt={},Dt={};function Ct(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Dt:yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Nt(e,t){var n=E("span",null,null,P?"padding-right: .1px":null),r={pre:E("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var w=i?t.rest[i-1]:t.line,j=void 0;r.pos=0,r.addToken=rr,wt(e.display.measure)&&(j=et(w,e.doc.direction))&&(r.addToken=br(r.addToken,j)),r.map=[];var X=t!=e.display.externalMeasured&&_t(w);Bt(w,r,Qe(e,w,X)),w.styleClasses&&(w.styleClasses.bgClass&&(r.bgClass=K(w.styleClasses.bgClass,r.bgClass||"")),w.styleClasses.textClass&&(r.textClass=K(w.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(We(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(P){var $=r.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=K(r.pre.className,r.textClass||"")),r}function Kt(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function rr(e,t,n,r,i,w,j){if(!t)return;var X=e.splitSpaces?Wt(t,e.trailingSpace):t,$=e.cm.state.specialChars,te=!1,fe;if(!$.test(t))e.col+=t.length,fe=document.createTextNode(X),e.map.push(e.pos,e.pos+t.length,fe),G&&F<9&&(te=!0),e.pos+=t.length;else{fe=document.createDocumentFragment();for(var ve=0;;){$.lastIndex=ve;var _e=$.exec(t),Re=_e?_e.index-ve:t.length-ve;if(Re){var Ge=document.createTextNode(X.slice(ve,ve+Re));G&&F<9?fe.appendChild(o("span",[Ge])):fe.appendChild(Ge),e.map.push(e.pos,e.pos+Re,Ge),e.col+=Re,e.pos+=Re}if(!_e)break;ve+=Re+1;var Ze=void 0;if(_e[0]==" "){var rt=e.cm.options.tabSize,ut=rt-e.col%rt;Ze=fe.appendChild(o("span",de(ut),"cm-tab")),Ze.setAttribute("role","presentation"),Ze.setAttribute("cm-text"," "),e.col+=ut}else _e[0]=="\r"||_e[0]==`
|
|
`?(Ze=fe.appendChild(o("span",_e[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ze.setAttribute("cm-text",_e[0]),e.col+=1):(Ze=e.cm.options.specialCharPlaceholder(_e[0]),Ze.setAttribute("cm-text",_e[0]),G&&F<9?fe.appendChild(o("span",[Ze])):fe.appendChild(Ze),e.col+=1);e.map.push(e.pos,e.pos+1,Ze),e.pos++}}if(e.trailingSpace=X.charCodeAt(t.length-1)==32,n||r||i||te||w||j){var pt=n||"";r&&(pt+=r),i&&(pt+=i);var dt=o("span",[fe],pt,w);if(j)for(var gt in j)j.hasOwnProperty(gt)&>!="style"&>!="class"&&dt.setAttribute(gt,j[gt]);return e.content.appendChild(dt)}e.content.appendChild(fe)}function Wt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var w=e.charAt(i);w==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(w="\xA0"),r+=w,n=w==" "}return r}function br(e,t){return function(n,r,i,w,j,X,$){i=i?i+" cm-force-border":"cm-force-border";for(var te=n.pos,fe=te+r.length;;){for(var ve=void 0,_e=0;_e<t.length&&!(ve=t[_e],ve.to>te&&ve.from<=te);_e++);if(ve.to>=fe)return e(n,r,i,w,j,X,$);e(n,r.slice(0,ve.to-te),i,w,null,X,$),w=null,r=r.slice(ve.to-te),te=ve.to}}}function Hr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Bt(e,t,n){var r=e.markedSpans,i=e.text,w=0;if(!r){for(var j=1;j<n.length;j+=2)t.addToken(t,i.slice(w,w=n[j]),Ct(n[j+1],t.cm.options));return}for(var X=i.length,$=0,te=1,fe="",ve,_e,Re=0,Ge,Ze,rt,ut,pt;;){if(Re==$){Ge=Ze=rt=_e="",pt=null,ut=null,Re=Infinity;for(var dt=[],gt=void 0,Tt=0;Tt<r.length;++Tt){var xt=r[Tt],Ot=xt.marker;if(Ot.type=="bookmark"&&xt.from==$&&Ot.widgetNode)dt.push(Ot);else if(xt.from<=$&&(xt.to==null||xt.to>$||Ot.collapsed&&xt.to==$&&xt.from==$)){if(xt.to!=null&&xt.to!=$&&Re>xt.to&&(Re=xt.to,Ze=""),Ot.className&&(Ge+=" "+Ot.className),Ot.css&&(_e=(_e?_e+";":"")+Ot.css),Ot.startStyle&&xt.from==$&&(rt+=" "+Ot.startStyle),Ot.endStyle&&xt.to==Re&&(gt||(gt=[])).push(Ot.endStyle,xt.to),Ot.title&&((pt||(pt={})).title=Ot.title),Ot.attributes)for(var lr in Ot.attributes)(pt||(pt={}))[lr]=Ot.attributes[lr];Ot.collapsed&&(!ut||kr(ut.marker,Ot)<0)&&(ut=xt)}else xt.from>$&&Re>xt.from&&(Re=xt.from)}if(gt)for(var Rr=0;Rr<gt.length;Rr+=2)gt[Rr+1]==Re&&(Ze+=" "+gt[Rr]);if(!ut||ut.from==$)for(var fr=0;fr<dt.length;++fr)Hr(t,0,dt[fr]);if(ut&&(ut.from||0)==$){if(Hr(t,(ut.to==null?X+1:ut.to)-$,ut.marker,ut.from==null),ut.to==null)return;ut.to==$&&(ut=!1)}}if($>=X)break;for(var qr=Math.min(X,Re);;){if(fe){var Kr=$+fe.length;if(!ut){var Er=Kr>qr?fe.slice(0,qr-$):fe;t.addToken(t,Er,ve?ve+Ge:Ge,rt,$+Er.length==Re?Ze:"",_e,pt)}if(Kr>=qr){fe=fe.slice(qr-$),$=qr;break}$=Kr,rt=""}fe=i.slice(w,w=n[te++]),ve=Ct(n[te++],t.cm.options)}}}function Rn(e,t,n){this.line=t,this.rest=Yn(t),this.size=this.rest?_t(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Jr(e,t)}function Yt(e,t,n){for(var r=[],i,w=t;w<n;w=i){var j=new Rn(e.doc,vt(e.doc,w),w);i=w+j.size,r.push(j)}return r}var Ar=null;function nn(e){Ar?Ar.ops.push(e):e.ownsGroup=Ar={ops:[e],delayedCallbacks:[]}}function an(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Wi(e,t){var n=e.ownsGroup;if(!n)return;try{an(n)}finally{Ar=null,t(n)}}var pi=null;function Lr(e,t){var n=ht(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Ar?i=Ar.delayedCallbacks:pi?i=pi:(i=pi=[],setTimeout(Os,0));for(var w=function(X){i.push(function(){return n[X].apply(null,r)})},j=0;j<n.length;++j)w(j)}function Os(){var e=pi;pi=null;for(var t=0;t<e.length;++t)e[t]()}function Ja(e,t,n,r){for(var i=0;i<t.changes.length;i++){var w=t.changes[i];w=="text"?Is(e,t):w=="gutter"?qa(e,t,n,r):w=="class"?ca(e,t):w=="widget"&&Ps(e,t,r)}t.changes=null}function mi(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&F<8&&(e.node.style.zIndex=2)),e.node}function Ms(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=mi(t);t.background=r.insertBefore(o("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Za(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Nt(e,t)}function Is(e,t){var n=t.text.className,r=Za(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ca(e,t)):n&&(t.text.className=n)}function ca(e,t){Ms(e,t),t.line.wrapClass?mi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function qa(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=mi(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var w=t.line.gutterMarkers;if(e.options.lineNumbers||w){var j=mi(t),X=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(X),j.insertBefore(X,t.text),t.line.gutterClass&&(X.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!w||!w["CodeMirror-linenumbers"])&&(t.lineNumber=X.appendChild(o("div",ln(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),w)for(var $=0;$<e.display.gutterSpecs.length;++$){var te=e.display.gutterSpecs[$].className,fe=w.hasOwnProperty(te)&&w[te];fe&&X.appendChild(o("div",[fe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[te]+"px; width: "+r.gutterWidth[te]+"px"))}}}function Ps(e,t,n){t.alignable&&(t.alignable=null);for(var r=v("CodeMirror-linewidget"),i=t.node.firstChild,w=void 0;i;i=w)w=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);$a(e,t,n)}function Ns(e,t,n,r){var i=Za(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ca(e,t),qa(e,t,n,r),$a(e,t,r),t.node}function $a(e,t,n){if(eo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)eo(e,t.rest[r],t,n,!1)}function eo(e,t,n,r,i){if(!t.widgets)return;for(var w=mi(n),j=0,X=t.widgets;j<X.length;++j){var $=X[j],te=o("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Bs($,te,n,r),e.display.input.setUneditable(te),i&&$.above?w.insertBefore(te,n.gutter||n.text):w.appendChild(te),Lr($,"redraw")}}function Bs(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function gi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),d(t.display.measure,o("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Sn(e,t){for(var n=ke(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function ha(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function to(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=d(e.measure,o("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function bn(e){return he-e.display.nativeBarWidth}function Bn(e){return e.display.scroller.clientWidth-bn(e)-e.display.barWidth}function fa(e){return e.display.scroller.clientHeight-bn(e)-e.display.barHeight}function Us(e,t,n){var r=e.options.lineWrapping,i=r&&Bn(e);if(!t.measure.heights||r&&t.measure.width!=i){var w=t.measure.heights=[];if(r){t.measure.width=i;for(var j=t.text.firstChild.getClientRects(),X=0;X<j.length-1;X++){var $=j[X],te=j[X+1];Math.abs($.bottom-te.bottom)>2&&w.push(($.bottom+te.top)/2-n.top)}}w.push(n.bottom-n.top)}}function ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(_t(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=Wr(t);var n=_t(t),r=e.display.externalMeasured=new Rn(e.doc,t,n);r.lineN=n;var i=r.built=Nt(e,r);return r.text=i.pre,d(e.display.lineMeasure,i.pre),r}function no(e,t,n,r){return En(e,Jn(e,t),n,r)}function pa(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[jn(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Jn(e,t){var n=_t(t),r=pa(e,n);r&&!r.text?r=null:r&&r.changes&&(Ja(e,r,n,Ea(e)),e.curOp.forceUpdate=!0),r||(r=Fs(e,t));var i=ro(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function En(e,t,n,r,i){t.before&&(n=-1);var w=n+(r||""),j;return t.cache.hasOwnProperty(w)?j=t.cache[w]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),j=Ws(e,t,n,r),j.bogus||(t.cache[w]=j)),{left:j.left,right:j.right,top:i?j.rtop:j.top,bottom:i?j.rbottom:j.bottom}}var io={left:0,right:0,top:0,bottom:0};function ao(e,t,n){for(var r,i,w,j,X,$,te=0;te<e.length;te+=3)if(X=e[te],$=e[te+1],t<X?(i=0,w=1,j="left"):t<$?(i=t-X,w=i+1):(te==e.length-3||t==$&&e[te+3]>t)&&(w=$-X,i=w-1,t>=$&&(j="right")),i!=null){if(r=e[te+2],X==$&&n==(r.insertLeft?"left":"right")&&(j=n),n=="left"&&i==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],j="left";if(n=="right"&&i==$-X)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)r=e[(te+=3)+2],j="right";break}return{node:r,start:i,end:w,collapse:j,coverStart:X,coverEnd:$}}function js(e,t){var n=io;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function Ws(e,t,n,r){var i=ao(t.map,n,r),w=i.node,j=i.start,X=i.end,$=i.collapse,te;if(w.nodeType==3){for(var fe=0;fe<4;fe++){for(;j&&Be(t.line.text.charAt(i.coverStart+j));)--j;for(;i.coverStart+X<i.coverEnd&&Be(t.line.text.charAt(i.coverStart+X));)++X;if(G&&F<9&&j==0&&X==i.coverEnd-i.coverStart?te=w.parentNode.getBoundingClientRect():te=js(b(w,j,X).getClientRects(),r),te.left||te.right||j==0)break;X=j,j=j-1,$="right"}G&&F<11&&(te=Hs(e.display.measure,te))}else{j>0&&($=r="right");var ve;e.options.lineWrapping&&(ve=w.getClientRects()).length>1?te=ve[r=="right"?ve.length-1:0]:te=w.getBoundingClientRect()}if(G&&F<9&&!j&&(!te||!te.left&&!te.right)){var _e=w.parentNode.getClientRects()[0];_e?te={left:_e.left,right:_e.left+qn(e.display),top:_e.top,bottom:_e.bottom}:te=io}for(var Re=te.top-t.rect.top,Ge=te.bottom-t.rect.top,Ze=(Re+Ge)/2,rt=t.view.measure.heights,ut=0;ut<rt.length-1&&!(Ze<rt[ut]);ut++);var pt=ut?rt[ut-1]:0,dt=rt[ut],gt={left:($=="right"?te.right:te.left)-t.rect.left,right:($=="left"?te.left:te.right)-t.rect.left,top:pt,bottom:dt};return!te.left&&!te.right&&(gt.bogus=!0),e.options.singleCursorHeightPerLine||(gt.rtop=Re,gt.rbottom=Ge),gt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function oo(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 so(e){e.display.externalMeasure=null,a(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)oo(e.display.view[t])}function vi(e){so(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function lo(){return y&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function uo(){return y&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ma(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=gi(e.widgets[n]));return t}function Gi(e,t,n,r,i){if(!i){var w=ma(t);n.top+=w,n.bottom+=w}if(r=="line")return n;r||(r="local");var j=fn(t);if(r=="local"?j+=Hi(e.display):j-=e.display.viewOffset,r=="page"||r=="window"){var X=e.display.lineSpace.getBoundingClientRect();j+=X.top+(r=="window"?0:uo());var $=X.left+(r=="window"?0:lo());n.left+=$,n.right+=$}return n.top+=j,n.bottom+=j,n}function co(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=lo(),i-=uo();else if(n=="local"||!n){var w=e.display.sizer.getBoundingClientRect();r+=w.left,i+=w.top}var j=e.display.lineSpace.getBoundingClientRect();return{left:r-j.left,top:i-j.top}}function ga(e,t,n,r,i){return r||(r=vt(e.doc,t.line)),Gi(e,r,no(e,r,t.ch,i),n)}function pn(e,t,n,r,i,w){r=r||vt(e.doc,t.line),i||(i=Jn(e,r));function j(Ge,Ze){var rt=En(e,i,Ge,Ze?"right":"left",w);return Ze?rt.left=rt.right:rt.right=rt.left,Gi(e,r,rt,n)}var X=et(r,e.doc.direction),$=t.ch,te=t.sticky;if($>=r.text.length?($=r.text.length,te="before"):$<=0&&($=0,te="after"),!X)return j(te=="before"?$-1:$,te=="before");function fe(Ge,Ze,rt){var ut=X[Ze],pt=ut.level==1;return j(rt?Ge-1:Ge,pt!=rt)}var ve=tt(X,$,te),_e=$e,Re=fe($,ve,te=="before");return _e!=null&&(Re.other=fe($,_e,te!="before")),Re}function ho(e,t){var n=0;t=l(e.doc,t),e.options.lineWrapping||(n=qn(e.display)*t.ch);var r=vt(e.doc,t.line),i=fn(r)+Hi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function va(e,t,n,r,i){var w=qe(e,t,n);return w.xRel=i,r&&(w.outside=r),w}function ya(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return va(r.first,0,null,-1,-1);var i=or(r,n),w=r.first+r.size-1;if(i>w)return va(r.first+r.size-1,vt(r,w).text.length,null,1,1);t<0&&(t=0);for(var j=vt(r,i);;){var X=Gs(e,j,i,t,n),$=yn(j,X.ch+(X.xRel>0||X.outside>0?1:0));if(!$)return X;var te=$.find(1);if(te.line==i)return te;j=vt(r,i=te.line)}}function fo(e,t,n,r){r-=ma(t);var i=t.text.length,w=nt(function(j){return En(e,n,j-1).bottom<=r},i,0);return i=nt(function(j){return En(e,n,j).top>r},w,i),{begin:w,end:i}}function po(e,t,n,r){n||(n=Jn(e,t));var i=Gi(e,t,En(e,n,r),"line").top;return fo(e,t,n,i)}function ba(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Gs(e,t,n,r,i){i-=fn(t);var w=Jn(e,t),j=ma(t),X=0,$=t.text.length,te=!0,fe=et(t,e.doc.direction);if(fe){var ve=(e.options.lineWrapping?Ks:zs)(e,t,n,w,fe,r,i);te=ve.level!=1,X=te?ve.from:ve.to-1,$=te?ve.to:ve.from-1}var _e=null,Re=null,Ge=nt(function(Tt){var xt=En(e,w,Tt);return xt.top+=j,xt.bottom+=j,ba(xt,r,i,!1)?(xt.top<=i&&xt.left<=r&&(_e=Tt,Re=xt),!0):!1},X,$),Ze,rt,ut=!1;if(Re){var pt=r-Re.left<Re.right-r,dt=pt==te;Ge=_e+(dt?0:1),rt=dt?"after":"before",Ze=pt?Re.left:Re.right}else{!te&&(Ge==$||Ge==X)&&Ge++,rt=Ge==0?"after":Ge==t.text.length?"before":En(e,w,Ge-(te?1:0)).bottom+j<=i==te?"after":"before";var gt=pn(e,qe(n,Ge,rt),"line",t,w);Ze=gt.left,ut=i<gt.top?-1:i>=gt.bottom?1:0}return Ge=Ue(t.text,Ge,1),va(n,Ge,rt,ut,r-Ze)}function zs(e,t,n,r,i,w,j){var X=nt(function(ve){var _e=i[ve],Re=_e.level!=1;return ba(pn(e,qe(n,Re?_e.to:_e.from,Re?"before":"after"),"line",t,r),w,j,!0)},0,i.length-1),$=i[X];if(X>0){var te=$.level!=1,fe=pn(e,qe(n,te?$.from:$.to,te?"after":"before"),"line",t,r);ba(fe,w,j,!0)&&fe.top>j&&($=i[X-1])}return $}function Ks(e,t,n,r,i,w,j){var X=fo(e,t,r,j),$=X.begin,te=X.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var fe=null,ve=null,_e=0;_e<i.length;_e++){var Re=i[_e];if(Re.from>=te||Re.to<=$)continue;var Ge=Re.level!=1,Ze=En(e,r,Ge?Math.min(te,Re.to)-1:Math.max($,Re.from)).right,rt=Ze<w?w-Ze+1e9:Ze-w;(!fe||ve>rt)&&(fe=Re,ve=rt)}return fe||(fe=i[i.length-1]),fe.from<$&&(fe={from:$,to:fe.to,level:fe.level}),fe.to>te&&(fe={from:fe.from,to:te,level:fe.level}),fe}var Un;function Zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Un==null){Un=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Un.appendChild(document.createTextNode("x")),Un.appendChild(o("br"));Un.appendChild(document.createTextNode("x"))}d(e.measure,Un);var n=Un.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),a(e.measure),n||1}function qn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),n=o("pre",[t],"CodeMirror-line-like");d(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ea(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,w=t.gutters.firstChild,j=0;w;w=w.nextSibling,++j){var X=e.display.gutterSpecs[j].className;n[X]=w.offsetLeft+w.clientLeft+i,r[X]=w.clientWidth}return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function xa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function mo(e){var t=Zn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/qn(e.display)-3);return function(i){if(Jr(e.doc,i))return 0;var w=0;if(i.widgets)for(var j=0;j<i.widgets.length;j++)i.widgets[j].height&&(w+=i.widgets[j].height);return n?w+(Math.ceil(i.text.length/r)||1)*t:w+t}}function Ca(e){var t=e.doc,n=mo(e);t.iter(function(r){var i=n(r);i!=r.height&&Or(r,i)})}function Fn(e,t,n,r){var i=e.display;if(!n&&ke(t).getAttribute("cm-not-content")=="true")return null;var w,j,X=i.lineSpace.getBoundingClientRect();try{w=t.clientX-X.left,j=t.clientY-X.top}catch(ve){return null}var $=ya(e,w,j),te;if(r&&$.xRel>0&&(te=vt(e.doc,$.line).text).length==$.ch){var fe=Y(te,te.length,e.options.tabSize)-te.length;$=qe($.line,Math.max(0,Math.round((w-to(e.display).left)/qn(e.display))-fe))}return $}function jn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Gr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)kt&&wn(e.doc,t)<i.viewTo&&kn(e);else if(n<=i.viewFrom)kt&&Fi(e.doc,n+r)>i.viewFrom?kn(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)kn(e);else if(t<=i.viewFrom){var w=zi(e,n,n+r,1);w?(i.view=i.view.slice(w.index),i.viewFrom=w.lineN,i.viewTo+=r):kn(e)}else if(n>=i.viewTo){var j=zi(e,t,t,-1);j?(i.view=i.view.slice(0,j.index),i.viewTo=j.lineN):kn(e)}else{var X=zi(e,t,t,-1),$=zi(e,n,n+r,1);X&&$?(i.view=i.view.slice(0,X.index).concat(Yt(e,X.lineN,$.lineN)).concat(i.view.slice($.index)),i.viewTo+=r):kn(e)}var te=i.externalMeasured;te&&(n<te.lineN?te.lineN+=r:t<te.lineN+te.size&&(i.externalMeasured=null))}function Dn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var w=r.view[jn(e,t)];if(w.node==null)return;var j=w.changes||(w.changes=[]);oe(j,n)==-1&&j.push(n)}function kn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,t,n,r){var i=jn(e,t),w,j=e.display.view;if(!kt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var X=e.display.viewFrom,$=0;$<i;$++)X+=j[$].size;if(X!=t){if(r>0){if(i==j.length-1)return null;w=X+j[i].size-t,i++}else w=X-t;t+=w,n+=w}for(;wn(e.doc,n)!=n;){if(i==(r<0?0:j.length-1))return null;n+=r*j[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Vs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Yt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Yt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(jn(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Yt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,jn(e,n)))),r.viewTo=n}function go(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function yi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vo(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),w=r.selection=document.createDocumentFragment(),j=0;j<n.sel.ranges.length;j++){if(!t&&j==n.sel.primIndex)continue;var X=n.sel.ranges[j];if(X.from().line>=e.display.viewTo||X.to().line<e.display.viewFrom)continue;var $=X.empty();($||e.options.showCursorWhenSelecting)&&yo(e,X.head,i),$||Qs(e,X,w)}return r}function yo(e,t,n){var r=pn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(o("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var w=n.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));w.style.display="",w.style.left=r.other.left+"px",w.style.top=r.other.top+"px",w.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Ki(e,t){return e.top-t.top||e.left-t.left}function Qs(e,t,n){var r=e.display,i=e.doc,w=document.createDocumentFragment(),j=to(e.display),X=j.left,$=Math.max(r.sizerWidth,Bn(e)-r.sizer.offsetLeft)-j.right,te=i.direction=="ltr";function fe(dt,gt,Tt,xt){gt<0&&(gt=0),gt=Math.round(gt),xt=Math.round(xt),w.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+dt+`px;
|
|
top: `+gt+"px; width: "+(Tt==null?$-dt:Tt)+`px;
|
|
height: `+(xt-gt)+"px"))}function ve(dt,gt,Tt){var xt=vt(i,dt),Ot=xt.text.length,lr,Rr;function fr(Er,Vr){return ga(e,qe(dt,Er),"div",xt,Vr)}function qr(Er,Vr,_r){var Sr=po(e,xt,null,Er),xr=Vr=="ltr"==(_r=="after")?"left":"right",pr=_r=="after"?Sr.begin:Sr.end-(/\s/.test(xt.text.charAt(Sr.end-1))?2:1);return fr(pr,xr)[xr]}var Kr=et(xt,i.direction);return it(Kr,gt||0,Tt==null?Ot:Tt,function(Er,Vr,_r,Sr){var xr=_r=="ltr",pr=fr(Er,xr?"left":"right"),Qr=fr(Vr-1,xr?"right":"left"),ci=gt==null&&Er==0,Pn=Tt==null&&Vr==Ot,Pr=Sr==0,xn=!Kr||Sr==Kr.length-1;if(Qr.top-pr.top<=3){var Dr=(te?ci:Pn)&&Pr,Qa=(te?Pn:ci)&&xn,Tn=Dr?X:(xr?pr:Qr).left,Kn=Qa?$:(xr?Qr:pr).right;fe(Tn,pr.top,Kn-Tn,pr.bottom)}else{var Vn,Ur,hi,Ya;xr?(Vn=te&&ci&&Pr?X:pr.left,Ur=te?$:qr(Er,_r,"before"),hi=te?X:qr(Vr,_r,"after"),Ya=te&&Pn&&xn?$:Qr.right):(Vn=te?qr(Er,_r,"before"):X,Ur=!te&&ci&&Pr?$:pr.right,hi=!te&&Pn&&xn?X:Qr.left,Ya=te?qr(Vr,_r,"after"):$),fe(Vn,pr.top,Ur-Vn,pr.bottom),pr.bottom<Qr.top&&fe(X,pr.bottom,null,Qr.top),fe(hi,Qr.top,Ya-hi,Qr.bottom)}(!lr||Ki(pr,lr)<0)&&(lr=pr),Ki(Qr,lr)<0&&(lr=Qr),(!Rr||Ki(pr,Rr)<0)&&(Rr=pr),Ki(Qr,Rr)<0&&(Rr=Qr)}),{start:lr,end:Rr}}var _e=t.from(),Re=t.to();if(_e.line==Re.line)ve(_e.line,_e.ch,Re.ch);else{var Ge=vt(i,_e.line),Ze=vt(i,Re.line),rt=Wr(Ge)==Wr(Ze),ut=ve(_e.line,_e.ch,rt?Ge.text.length+1:null).end,pt=ve(Re.line,rt?0:null,Re.ch).start;rt&&(ut.top<pt.top-2?(fe(ut.right,ut.top,null,ut.bottom),fe(X,pt.top,pt.left,pt.bottom)):fe(ut.right,ut.top,pt.left-ut.right,ut.bottom)),ut.bottom<pt.top&&fe(X,ut.bottom,null,pt.top)}n.appendChild(w)}function Sa(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||$n(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function bo(e){e.state.focused||(e.display.input.focus(),Aa(e))}function Eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,$n(e))},100)}function Aa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sa(e)}function $n(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],w=e.options.lineWrapping,j=void 0,X=0;if(i.hidden)continue;if(G&&F<8){var $=i.node.offsetTop+i.node.offsetHeight;j=$-n,n=$}else{var te=i.node.getBoundingClientRect();j=te.bottom-te.top,!w&&i.text.firstChild&&(X=i.text.firstChild.getBoundingClientRect().right-te.left-1)}var fe=i.line.height-j;if((fe>.005||fe<-.005)&&(Or(i.line,j),xo(i.line),i.rest))for(var ve=0;ve<i.rest.length;ve++)xo(i.rest[ve]);if(X>e.display.sizerWidth){var _e=Math.ceil(X/qn(e.display));_e>e.display.maxLineLength&&(e.display.maxLineLength=_e,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function xo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Qi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Hi(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,w=or(t,r),j=or(t,i);if(n&&n.ensure){var X=n.ensure.from.line,$=n.ensure.to.line;X<w?(w=X,j=or(t,fn(vt(t,X))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=j&&(w=or(t,fn(vt(t,$))-e.wrapper.clientHeight),j=$)}return{from:w,to:Math.max(j,w+1)}}function Ys(e,t){if(Ye(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!A){var w=o("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Hi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+bn(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(w),w.scrollIntoView(i),e.display.lineSpace.removeChild(w)}}function Xs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?qe(t.line,t.ch+1,"before"):t);for(var w=0;w<5;w++){var j=!1,X=pn(e,t),$=!n||n==t?X:pn(e,n);i={left:Math.min(X.left,$.left),top:Math.min(X.top,$.top)-r,right:Math.max(X.left,$.left),bottom:Math.max(X.bottom,$.bottom)+r};var te=Ta(e,i),fe=e.doc.scrollTop,ve=e.doc.scrollLeft;if(te.scrollTop!=null&&(Ei(e,te.scrollTop),Math.abs(e.doc.scrollTop-fe)>1&&(j=!0)),te.scrollLeft!=null&&(Wn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ve)>1&&(j=!0)),!j)break}return i}function Js(e,t){var n=Ta(e,t);n.scrollTop!=null&&Ei(e,n.scrollTop),n.scrollLeft!=null&&Wn(e,n.scrollLeft)}function Ta(e,t){var n=e.display,r=Zn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,w=fa(e),j={};t.bottom-t.top>w&&(t.bottom=t.top+w);var X=e.doc.height+ha(n),$=t.top<r,te=t.bottom>X-r;if(t.top<i)j.scrollTop=$?0:t.top;else if(t.bottom>i+w){var fe=Math.min(t.top,(te?X:t.bottom)-w);fe!=i&&(j.scrollTop=fe)}var ve=e.options.fixedGutter?0:n.gutters.offsetWidth,_e=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ve,Re=Bn(e)-n.gutters.offsetWidth,Ge=t.right-t.left>Re;return Ge&&(t.right=t.left+Re),t.left<10?j.scrollLeft=0:t.left<_e?j.scrollLeft=Math.max(0,t.left+ve-(Ge?0:10)):t.right>Re+_e-3&&(j.scrollLeft=t.right+(Ge?0:10)-Re),j}function wa(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ei(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){(t!=null||n!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ho(e,t.from),r=ho(e,t.to);Co(e,n,r,t.margin)}}function Co(e,t,n,r){var i=Ta(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,i.scrollLeft,i.scrollTop)}function Ei(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;L||Da(e,{top:t}),So(e,t,!0),L&&Da(e),Si(e,100)}function So(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Wn(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Do(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ha(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+bn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Hn=function(e,t,n){this.cm=n;var r=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Oe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var w=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+w)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Hn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hn.prototype.zeroWidthHack=function(){var e=u&&!R?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},Hn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),w=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);w!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Hn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ci=function(){};Ci.prototype.update=function(){return{bottom:0,right:0}},Ci.prototype.setScrollLeft=function(){},Ci.prototype.setScrollTop=function(){},Ci.prototype.clear=function(){};function ti(e,t){t||(t=xi(e));var n=e.display.barWidth,r=e.display.barHeight;Ao(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vi(e),Ao(e,xi(e)),n=e.display.barWidth,r=e.display.barHeight}function Ao(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var To={native:Hn,null:Ci};function wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new To[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Wn(e,t):Ei(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Gn(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:++qs},nn(e.curOp)}function zn(e){var t=e.curOp;t&&Wi(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;$s(n)})}function $s(e){for(var t=e.ops,n=0;n<t.length;n++)el(t[n]);for(var r=0;r<t.length;r++)tl(t[r]);for(var i=0;i<t.length;i++)rl(t[i]);for(var w=0;w<t.length;w++)nl(t[w]);for(var j=0;j<t.length;j++)il(t[j])}function el(e){var t=e.cm,n=t.display;ol(t),e.updateMaxLine&&ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ra(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vi(t),e.barMeasure=xi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=no(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+bn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Bn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.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&&Wn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ti(t,e.barMeasure),e.updatedDisplay&&La(t,e.barMeasure),e.selectionChanged&&Sa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&bo(e.cm)}function il(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Ro(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&So(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Wn(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xs(t,l(r,e.scrollToPos.from),l(r,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,i)}var w=e.maybeHiddenMarkers,j=e.maybeUnhiddenMarkers;if(w)for(var X=0;X<w.length;++X)w[X].lines.length||je(w[X],"hide");if(j)for(var $=0;$<j.length;++$)j[$].lines.length&&je(j[$],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&je(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zr(e,t){if(e.curOp)return t();Gn(e);try{return t()}finally{zn(e)}}function Tr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gn(e);try{return t.apply(e,arguments)}finally{zn(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);Gn(this);try{return e.apply(this,arguments)}finally{zn(this)}}}function wr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gn(t);try{return e.apply(this,arguments)}finally{zn(t)}}}function Si(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=Xe(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(w){if(r.line>=e.display.viewFrom){var j=w.styles,X=w.text.length>e.options.maxHighlightLength?Fr(t.mode,r.state):null,$=me(e,w,r,!0);X&&(r.state=X),w.styles=$.styles;var te=w.styleClasses,fe=$.classes;fe?w.styleClasses=fe:te&&(w.styleClasses=null);for(var ve=!j||j.length!=w.styles.length||te!=fe&&(!te||!fe||te.bgClass!=fe.bgClass||te.textClass!=fe.textClass),_e=0;!ve&&_e<j.length;++_e)ve=j[_e]!=w.styles[_e];ve&&i.push(r.line),w.stateAfter=r.save(),r.nextLine()}else w.text.length<=e.options.maxHighlightLength&&ft(e,w.text,r),w.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Zr(e,function(){for(var w=0;w<i.length;w++)Dn(e,i[w],"text")})}var Xi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Qi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Bn(e),this.force=n,this.dims=Ea(e),this.events=[]};Xi.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},Xi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)je.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=bn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=bn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=N();if(!t||!x(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&x(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ra(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return kn(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&go(e)==0)return!1;ko(e)&&(kn(e),t.dims=Ea(e));var i=r.first+r.size,w=Math.max(t.visible.from-e.options.viewportMargin,r.first),j=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<w&&w-n.viewFrom<20&&(w=Math.max(r.first,n.viewFrom)),n.viewTo>j&&n.viewTo-j<20&&(j=Math.min(i,n.viewTo)),kt&&(w=wn(e.doc,w),j=Fi(e.doc,j));var X=w!=n.viewFrom||j!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,w,j),n.viewOffset=fn(vt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var $=go(e);if(!X&&$==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=sl(e);return $>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),$>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),a(n.cursorDiv),a(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,X&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Si(e,400)),n.updateLineNumbers=null,!0}function Ro(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Bn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ha(e.display)-fa(e),n.top)}),t.visible=Qi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Qi(e.display,e.doc,n));if(!Ra(e,t))break;Vi(e);var i=xi(e);yi(e),ti(e,i),La(e,i),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 Da(e,t){var n=new Xi(e,t);if(Ra(e,n)){Vi(e),Ro(e,n);var r=xi(e);yi(e),ti(e,r),La(e,r),n.finish()}}function ul(e,t,n){var r=e.display,i=e.options.lineNumbers,w=r.lineDiv,j=w.firstChild;function X(Ge){var Ze=Ge.nextSibling;return P&&u&&e.display.currentWheelTarget==Ge?Ge.style.display="none":Ge.parentNode.removeChild(Ge),Ze}for(var $=r.view,te=r.viewFrom,fe=0;fe<$.length;fe++){var ve=$[fe];if(!ve.hidden)if(!ve.node||ve.node.parentNode!=w){var _e=Ns(e,ve,te,n);w.insertBefore(_e,j)}else{for(;j!=ve.node;)j=X(j);var Re=i&&t!=null&&t<=te&&ve.lineNumber;ve.changes&&(oe(ve.changes,"gutter")>-1&&(Re=!1),Ja(e,ve,te,n)),Re&&(a(ve.lineNumber),ve.lineNumber.appendChild(document.createTextNode(ln(e.options,te)))),j=ve.node.nextSibling}te+=ve.size}for(;j;)j=X(j)}function ka(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function La(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+bn(e)+"px"}function Do(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=xa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,w=r+"px",j=0;j<n.length;j++)if(!n[j].hidden){e.options.fixedGutter&&(n[j].gutter&&(n[j].gutter.style.left=w),n[j].gutterBackground&&(n[j].gutterBackground.style.left=w));var X=n[j].alignable;if(X)for(var $=0;$<X.length;$++)X[$].style.left=w}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function ko(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ln(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(o("div",[o("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),w=i.firstChild.offsetWidth,j=i.offsetWidth-w;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(w,r.lineGutter.offsetWidth-j)+1,r.lineNumWidth=r.lineNumInnerWidth+j,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ka(e.display),!0}return!1}function _a(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var w=e[i],j=null;if(typeof w!="string"&&(j=w.style,w=w.className),w=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:w,style:j})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Lo(e){var t=e.gutters,n=e.gutterSpecs;a(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],w=i.className,j=i.style,X=t.appendChild(o("div",null,"CodeMirror-gutter "+w));j&&(X.style.cssText=j),w=="CodeMirror-linenumbers"&&(e.lineGutter=X,X.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ka(e)}function Ai(e){Lo(e.display),Gr(e),Do(e)}function dl(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=E("div",null,"CodeMirror-code"),i.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=o("div",null,"CodeMirror-cursors"),i.measure=o("div",null,"CodeMirror-measure"),i.lineMeasure=o("div",null,"CodeMirror-measure"),i.lineSpace=E("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var w=E("div",[i.lineSpace],"CodeMirror-lines");i.mover=o("div",[w],null,"position: relative"),i.sizer=o("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=o("div",null,null,"position: absolute; height: "+he+"px; width: 1px;"),i.gutters=o("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=o("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=o("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),G&&F<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!P&&!(L&&s)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=_a(r.gutters,r.lineNumbers),Lo(i),n.init(i)}var Ji=0,$r=null;G?$r=-.53:L?$r=15:y?$r=-.7:O&&($r=-1/3);function _o(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function cl(e){var t=_o(e);return t.x*=$r,t.y*=$r,t}function Oo(e,t){var n=_o(t),r=n.x,i=n.y,w=e.display,j=w.scroller,X=j.scrollWidth>j.clientWidth,$=j.scrollHeight>j.clientHeight;if(!(r&&X||i&&$))return;if(i&&u&&P){e:for(var te=t.target,fe=w.view;te!=j;te=te.parentNode)for(var ve=0;ve<fe.length;ve++)if(fe[ve].node==te){e.display.currentWheelTarget=te;break e}}if(r&&!L&&!C&&$r!=null){i&&$&&Ei(e,Math.max(0,j.scrollTop+i*$r)),Wn(e,Math.max(0,j.scrollLeft+r*$r)),(!i||i&&$)&&ne(t),w.wheelStartX=null;return}if(i&&$r!=null){var _e=i*$r,Re=e.doc.scrollTop,Ge=Re+w.wrapper.clientHeight;_e<0?Re=Math.max(0,Re+_e-50):Ge=Math.min(e.doc.height,Ge+_e+50),Da(e,{top:Re,bottom:Ge})}Ji<20&&(w.wheelStartX==null?(w.wheelStartX=j.scrollLeft,w.wheelStartY=j.scrollTop,w.wheelDX=r,w.wheelDY=i,setTimeout(function(){if(w.wheelStartX==null)return;var Ze=j.scrollLeft-w.wheelStartX,rt=j.scrollTop-w.wheelStartY,ut=rt&&w.wheelDY&&rt/w.wheelDY||Ze&&w.wheelDX&&Ze/w.wheelDX;if(w.wheelStartX=w.wheelStartY=null,!ut)return;$r=($r*Ji+ut)/(Ji+1),++Ji},200)):(w.wheelDX+=r,w.wheelDY+=i))}var en=function(e,t){this.ranges=e,this.primIndex=t};en.prototype.primary=function(){return this.ranges[this.primIndex]},en.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!un(n.anchor,r.anchor)||!un(n.head,r.head))return!1}return!0},en.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Zt(vn(this.ranges[t].anchor),vn(this.ranges[t].head));return new en(e,this.primIndex)},en.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},en.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(At(t,r.from())>=0&&At(e,r.to())<=0)return n}return-1};var Zt=function(e,t){this.anchor=e,this.head=t};Zt.prototype.from=function(){return cn(this.anchor,this.head)},Zt.prototype.to=function(){return dn(this.anchor,this.head)},Zt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function mn(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(_e,Re){return At(_e.from(),Re.from())}),n=oe(t,i);for(var w=1;w<t.length;w++){var j=t[w],X=t[w-1],$=At(X.to(),j.from());if(r&&!j.empty()?$>0:$>=0){var te=cn(X.from(),j.from()),fe=dn(X.to(),j.to()),ve=X.empty()?j.from()==j.head:X.from()==X.head;w<=n&&--n,t.splice(--w,2,new Zt(ve?fe:te,ve?te:fe))}}return new en(t,n)}function Ln(e,t){return new en([new Zt(e,t||e)],0)}function _n(e){return e.text?qe(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mo(e,t){if(At(e,t.from)<0)return e;if(At(e,t.to)<=0)return _n(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=_n(t).ch-t.to.ch),qe(n,r)}function Oa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Zt(Mo(i.anchor,t),Mo(i.head,t)))}return mn(e.cm,n,e.sel.primIndex)}function Io(e,t,n){return e.line==t.line?qe(n.line,e.ch-t.ch+n.ch):qe(n.line+(e.line-t.line),e.ch)}function hl(e,t,n){for(var r=[],i=qe(e.first,0),w=i,j=0;j<t.length;j++){var X=t[j],$=Io(X.from,i,w),te=Io(_n(X),i,w);if(i=X.to,w=te,n=="around"){var fe=e.sel.ranges[j],ve=At(fe.head,fe.anchor)<0;r[j]=new Zt(ve?te:$,ve?$:te)}else r[j]=new Zt($,$)}return new en(r,e.sel.primIndex)}function Ma(e){e.doc.mode=Nr(e.options,e.doc.modeOption),Ti(e)}function Ti(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,Si(e,100),e.state.modeGen++,e.curOp&&Gr(e)}function Po(e,t){return t.from.ch==0&&t.to.ch==0&&re(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ia(e,t,n,r){function i(pt){return n?n[pt]:null}function w(pt,dt,gt){Xa(pt,dt,gt,r),Lr(pt,"change",pt,t)}function j(pt,dt){for(var gt=[],Tt=pt;Tt<dt;++Tt)gt.push(new Nn(te[Tt],i(Tt),r));return gt}var X=t.from,$=t.to,te=t.text,fe=vt(e,X.line),ve=vt(e,$.line),_e=re(te),Re=i(te.length-1),Ge=$.line-X.line;if(t.full)e.insert(0,j(0,te.length)),e.remove(te.length,e.size-te.length);else if(Po(e,t)){var Ze=j(0,te.length-1);w(ve,ve.text,Re),Ge&&e.remove(X.line,Ge),Ze.length&&e.insert(X.line,Ze)}else if(fe==ve)if(te.length==1)w(fe,fe.text.slice(0,X.ch)+_e+fe.text.slice($.ch),Re);else{var rt=j(1,te.length-1);rt.push(new Nn(_e+fe.text.slice($.ch),Re,r)),w(fe,fe.text.slice(0,X.ch)+te[0],i(0)),e.insert(X.line+1,rt)}else if(te.length==1)w(fe,fe.text.slice(0,X.ch)+te[0]+ve.text.slice($.ch),i(0)),e.remove(X.line+1,Ge);else{w(fe,fe.text.slice(0,X.ch)+te[0],i(0)),w(ve,_e+ve.text.slice($.ch),Re);var ut=j(1,te.length-1);Ge>1&&e.remove(X.line+1,Ge-1),e.insert(X.line+1,ut)}Lr(e,"change",e,t)}function On(e,t,n){function r(i,w,j){if(i.linked)for(var X=0;X<i.linked.length;++X){var $=i.linked[X];if($.doc==w)continue;var te=j&&$.sharedHist;if(n&&!te)continue;t($.doc,te),r($.doc,i,te)}}r(e,null,!0)}function No(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ca(e),Ma(e),Bo(e),e.options.lineWrapping||ji(e),e.options.mode=t.modeOption,Gr(e)}function Bo(e){(e.doc.direction=="rtl"?U:m)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Zr(e,function(){Bo(e),Gr(e)})}function Zi(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 Pa(e,t){var n={from:vn(t.from),to:_n(t),text:ar(e,t.from,t.to)};return jo(e,n,t.from.line,t.to.line+1),On(e,function(r){return jo(r,n,t.from.line,t.to.line+1)},!0),n}function Uo(e){for(;e.length;){var t=re(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Uo(e.done),re(e.done);if(e.done.length&&!re(e.done).ranges)return re(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Fo(e,t,n,r){var i=e.history;i.undone.length=0;var w=+new Date,j,X;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>w-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(j=pl(i,i.lastOp==r)))X=re(j.changes),At(t.from,t.to)==0&&At(t.from,X.to)==0?X.to=_n(t):j.changes.push(Pa(e,t));else{var $=re(i.done);for((!$||!$.ranges)&&qi(e.sel,i.done),j={changes:[Pa(e,t)],generation:i.generation},i.done.push(j);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=w,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,X||je(e,"historyAdded")}function ml(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,w=r&&r.origin;n==i.lastSelOp||w&&i.lastSelOrigin==w&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==w||ml(e,w,re(i.done),t))?i.done[i.done.length-1]=t:qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=w,i.lastSelOp=n,r&&r.clearRedo!==!1&&Uo(i.undone)}function qi(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function jo(e,t,n,r){var i=t["spans_"+e.id],w=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(j){j.markedSpans&&((i||(i=t["spans_"+e.id]={}))[w]=j.markedSpans),++w})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(vl(n[i]));return r}function Wo(e,t){var n=yl(e,t),r=Qt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var w=n[i],j=r[i];if(w&&j){e:for(var X=0;X<j.length;++X){for(var $=j[X],te=0;te<w.length;++te)if(w[te].marker==$.marker)continue e;w.push($)}}else j&&(n[i]=j)}return n}function ri(e,t,n){for(var r=[],i=0;i<e.length;++i){var w=e[i];if(w.ranges){r.push(n?en.prototype.deepCopy.call(w):w);continue}var j=w.changes,X=[];r.push({changes:X});for(var $=0;$<j.length;++$){var te=j[$],fe=void 0;if(X.push({from:te.from,to:te.to,text:te.text}),t)for(var ve in te)(fe=ve.match(/^spans_(\d+)$/))&&(oe(t,Number(fe[1]))>-1&&(re(X)[ve]=te[ve],delete te[ve]))}}return r}function Na(e,t,n,r){if(r){var i=e.anchor;if(n){var w=At(t,i)<0;w!=At(n,i)<0?(i=t,t=n):w!=At(t,n)<0&&(t=n)}return new Zt(i,t)}else return new Zt(n||t,t)}function $i(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ir(e,new en([Na(e.sel.primary(),t,n,i)],0),r)}function Ho(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),w=0;w<e.sel.ranges.length;w++)r[w]=Na(e.sel.ranges[w],t[w],null,i);var j=mn(e.cm,r,e.sel.primIndex);Ir(e,j,n)}function Ba(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ir(e,mn(e.cm,i,e.sel.primIndex),r)}function Go(e,t,n,r){Ir(e,Ln(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var w=0;w<i.length;w++)this.ranges[w]=new Zt(l(e,i[w].anchor),l(e,i[w].head))},origin:n&&n.origin};return je(e,"beforeSelectionChange",e,r),e.cm&&je(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?mn(e.cm,r.ranges,r.ranges.length-1):t}function zo(e,t,n){var r=e.history.done,i=re(r);i&&i.ranges?(r[r.length-1]=t,ea(e,t,n)):Ir(e,t,n)}function Ir(e,t,n){ea(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ea(e,t,n){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(At(t.primary().head,e.sel.primary().head)<0?-1:1);Ko(e,Qo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&ei(e.cm)}function Ko(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ee(e.cm)),Lr(e,"cursorActivity",e)}function Vo(e){Ko(e,Qo(e,e.sel,null,!1))}function Qo(e,t,n,r){for(var i,w=0;w<t.ranges.length;w++){var j=t.ranges[w],X=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[w],$=ta(e,j.anchor,X&&X.anchor,n,r),te=ta(e,j.head,X&&X.head,n,r);(i||$!=j.anchor||te!=j.head)&&(i||(i=t.ranges.slice(0,w)),i[w]=new Zt($,te))}return i?mn(e.cm,i,t.primIndex):t}function ni(e,t,n,r,i){var w=vt(e,t.line);if(w.markedSpans)for(var j=0;j<w.markedSpans.length;++j){var X=w.markedSpans[j],$=X.marker,te="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,fe="selectRight"in $?!$.selectRight:$.inclusiveRight;if((X.from==null||(te?X.from<=t.ch:X.from<t.ch))&&(X.to==null||(fe?X.to>=t.ch:X.to>t.ch))){if(i&&(je($,"beforeCursorEnter"),$.explicitlyCleared))if(w.markedSpans){--j;continue}else break;if(!$.atomic)continue;if(n){var ve=$.find(r<0?1:-1),_e=void 0;if((r<0?fe:te)&&(ve=Yo(e,ve,-r,ve&&ve.line==t.line?w:null)),ve&&ve.line==t.line&&(_e=At(ve,n))&&(r<0?_e<0:_e>0))return ni(e,ve,t,r,i)}var Re=$.find(r<0?-1:1);return(r<0?te:fe)&&(Re=Yo(e,Re,r,Re.line==t.line?w:null)),Re?ni(e,Re,t,r,i):null}}return t}function ta(e,t,n,r,i){var w=r||1,j=ni(e,t,n,w,i)||!i&&ni(e,t,n,w,!0)||ni(e,t,n,-w,i)||!i&&ni(e,t,n,-w,!0);return j||(e.cantEdit=!0,qe(e.first,0))}function Yo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?l(e,qe(t.line-1)):null:n>0&&t.ch==(r||vt(e,t.line)).text.length?t.line<e.first+e.size-1?qe(t.line+1,0):null:new qe(t.line,t.ch+n)}function Xo(e){e.setSelection(qe(e.firstLine(),0),qe(e.lastLine()),xe)}function Jo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,w,j,X){i&&(r.from=l(e,i)),w&&(r.to=l(e,w)),j&&(r.text=j),X!==void 0&&(r.origin=X)}),je(e,"beforeChange",e,r),e.cm&&je(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ii(e,t,n){if(e.cm){if(!e.cm.curOp)return Tr(e.cm,ii)(e,t,n);if(e.cm.state.suppressEdits)return}if((ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))&&(t=Jo(e,t,!0),!t))return;var r=er&&!n&&vr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Zo(e,t)}function Zo(e,t){if(t.text.length==1&&t.text[0]==""&&At(t.from,t.to)==0)return;var n=Oa(e,t);Fo(e,t,n,e.cm?e.cm.curOp.id:NaN),wi(e,t,n,Qt(e,t));var r=[];On(e,function(i,w){!w&&oe(r,i.history)==-1&&(ts(i.history,t),r.push(i.history)),wi(i,t,null,Qt(i,t))})}function ra(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,w,j=e.sel,X=t=="undo"?i.done:i.undone,$=t=="undo"?i.undone:i.done,te=0;te<X.length&&!(w=X[te],n?w.ranges&&!w.equals(e.sel):!w.ranges);te++);if(te==X.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(w=X.pop(),w.ranges){if(qi(w,$),n&&!w.equals(e.sel)){Ir(e,w,{clearRedo:!1});return}j=w}else if(r){X.push(w);return}else break;var fe=[];qi(j,$),$.push({changes:fe,generation:i.generation}),i.generation=w.generation||++i.maxGeneration;for(var ve=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),_e=function(Ze){var rt=w.changes[Ze];if(rt.origin=t,ve&&!Jo(e,rt,!1))return X.length=0,{};fe.push(Pa(e,rt));var ut=Ze?Oa(e,rt):re(X);wi(e,rt,ut,Wo(e,rt)),!Ze&&e.cm&&e.cm.scrollIntoView({from:rt.from,to:_n(rt)});var pt=[];On(e,function(dt,gt){!gt&&oe(pt,dt.history)==-1&&(ts(dt.history,rt),pt.push(dt.history)),wi(dt,rt,null,Wo(dt,rt))})},Re=w.changes.length-1;Re>=0;--Re){var Ge=_e(Re);if(Ge)return Ge.v}}function qo(e,t){if(t==0)return;if(e.first+=t,e.sel=new en(ce(e.sel.ranges,function(i){return new Zt(qe(i.anchor.line+t,i.anchor.ch),qe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Gr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Dn(e.cm,r,"gutter")}}function wi(e,t,n,r){if(e.cm&&!e.cm.curOp)return Tr(e.cm,wi)(e,t,n,r);if(t.to.line<e.first){qo(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 i=t.text.length-1-(e.first-t.from.line);qo(e,i),t={from:qe(e.first,0),to:qe(t.to.line+i,t.to.ch),text:[re(t.text)],origin:t.origin}}var w=e.lastLine();t.to.line>w&&(t={from:t.from,to:qe(w,vt(e,w).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ar(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?El(e.cm,t,r):Ia(e,t,r),ea(e,n,xe),e.cantEdit&&ta(e,qe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,n){var r=e.doc,i=e.display,w=t.from,j=t.to,X=!1,$=w.line;e.options.lineWrapping||($=_t(Wr(vt(r,w.line))),r.iter($,j.line+1,function(Re){if(Re==i.maxLine)return X=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ee(e),Ia(r,t,n,mo(e)),e.options.lineWrapping||(r.iter($,w.line+t.text.length,function(Re){var Ge=Xn(Re);Ge>i.maxLineLength&&(i.maxLine=Re,i.maxLineLength=Ge,i.maxLineChanged=!0,X=!1)}),X&&(e.curOp.updateMaxLine=!0)),Rt(r,w.line),Si(e,400);var te=t.text.length-(j.line-w.line)-1;t.full?Gr(e):w.line==j.line&&t.text.length==1&&!Po(e.doc,t)?Dn(e,w.line,"text"):Gr(e,w.line,j.line+1,te);var fe=ge(e,"changes"),ve=ge(e,"change");if(ve||fe){var _e={from:w,to:j,text:t.text,removed:t.removed,origin:t.origin};ve&&Lr(e,"change",e,_e),fe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(_e)}e.display.selForContextMenu=null}function ai(e,t,n,r,i){var w;r||(r=n),At(r,n)<0&&(w=[r,n],n=w[0],r=w[1]),typeof t=="string"&&(t=e.splitLines(t)),ii(e,{from:n,to:r,text:t,origin:i})}function $o(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function es(e,t,n,r){for(var i=0;i<e.length;++i){var w=e[i],j=!0;if(w.ranges){w.copied||(w=e[i]=w.deepCopy(),w.copied=!0);for(var X=0;X<w.ranges.length;X++)$o(w.ranges[X].anchor,t,n,r),$o(w.ranges[X].head,t,n,r);continue}for(var $=0;$<w.changes.length;++$){var te=w.changes[$];if(n<te.from.line)te.from=qe(te.from.line+r,te.from.ch),te.to=qe(te.to.line+r,te.to.ch);else if(t<=te.to.line){j=!1;break}}j||(e.splice(0,i+1),i=0)}}function ts(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;es(e.done,n,r,i),es(e.undone,n,r,i)}function Ri(e,t,n,r){var i=t,w=t;return typeof t=="number"?w=vt(e,z(e,t)):i=_t(t),i==null?null:(r(w,i)&&e.cm&&Dn(e.cm,i,n),w)}function Di(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Di.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,da(i),Lr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function ki(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}ki.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var w=Math.min(t,i-e),j=r.height;if(r.removeInner(e,w),this.height-=j-r.height,i==w&&(this.children.splice(n--,1),r.parent=null),(t-=w)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Di))){var X=[];this.collapse(X),this.children=[new Di(X)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],w=i.chunkSize();if(e<=w){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var j=i.lines.length%25+25,X=j;X<i.lines.length;){var $=new Di(i.lines.slice(X,X+=25));i.height-=$.height,this.children.splice(++r,0,$),$.parent=this}i.lines=i.lines.slice(0,j),this.maybeSpill()}break}e-=w}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new ki(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=oe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new ki(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],w=i.chunkSize();if(e<w){var j=Math.min(t,w-e);if(i.iterN(e,j,n))return!0;if((t-=j)==0)break;e=0}else e-=w}}};var Li=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Li.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=_t(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var w=gi(this);Or(n,Math.max(0,n.height-w)),e&&(Zr(e,function(){rs(e,n,-w),Dn(e,r,"widget")}),Lr(e,"lineWidgetCleared",e,this,r))},Li.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=gi(this)-t;if(!i)return;Jr(this.doc,r)||Or(r,r.height+i),n&&Zr(n,function(){n.curOp.forceUpdate=!0,rs(n,r,i),Lr(n,"lineWidgetChanged",n,e,_t(r))})},be(Li);function rs(e,t,n){fn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&wa(e,n)}function xl(e,t,n,r){var i=new Li(e,n,r),w=e.cm;return w&&i.noHScroll&&(w.display.alignWidgets=!0),Ri(e,t,"widget",function(j){var X=j.widgets||(j.widgets=[]);if(i.insertAt==null?X.push(i):X.splice(Math.min(X.length-1,Math.max(0,i.insertAt)),0,i),i.line=j,w&&!Jr(e,j)){var $=fn(j)<e.scrollTop;Or(j,j.height+gi(i)),$&&wa(w,i.height),w.curOp.forceUpdate=!0}return!0}),w&&Lr(w,"lineWidgetAdded",w,i,typeof t=="number"?t:_t(t)),i}var ns=0,Mn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ns};Mn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gn(e),ge(this,"clear")){var n=this.find();n&&Lr(this,"clear",n.from,n.to)}for(var r=null,i=null,w=0;w<this.lines.length;++w){var j=this.lines[w],X=Pt(j.markedSpans,this);e&&!this.collapsed?Dn(e,_t(j),"text"):e&&(X.to!=null&&(i=_t(j)),X.from!=null&&(r=_t(j))),j.markedSpans=bt(j.markedSpans,X),X.from==null&&this.collapsed&&!Jr(this.doc,j)&&e&&Or(j,Zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var te=Wr(this.lines[$]),fe=Xn(te);fe>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=fe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Gr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&Lr(e,"markerCleared",e,this,r,i),t&&zn(e),this.parent&&this.parent.clear()},Mn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var w=this.lines[i],j=Pt(w.markedSpans,this);if(j.from!=null&&(n=qe(t?w:_t(w),j.from),e==-1))return n;if(j.to!=null&&(r=qe(t?w:_t(w),j.to),e==1))return r}return n&&{from:n,to:r}},Mn.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;Zr(r,function(){var i=t.line,w=_t(t.line),j=pa(r,w);if(j&&(oo(j),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Jr(n.doc,i)&&n.height!=null){var X=n.height;n.height=null;var $=gi(n)-X;$&&Or(i,i.height+$)}Lr(r,"markerChanged",r,e)})},Mn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Mn.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Mn);function oi(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Tr(e.cm,oi)(e,t,n,r,i);var w=new Mn(e,i),j=At(t,n);if(r&&I(r,w,!1),j>0||j==0&&w.clearWhenEmpty!==!1)return w;if(w.replacedWith&&(w.collapsed=!0,w.widgetNode=E("span",[w.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||w.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(w.widgetNode.insertLeft=!0)),w.collapsed){if(mr(e,t.line,t,n,w)||t.line!=n.line&&mr(e,n.line,t,n,w))throw new Error("Inserting collapsed marker partially overlapping an existing one");Xt()}w.addToHistory&&Fo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var X=t.line,$=e.cm,te;if(e.iter(X,n.line+1,function(ve){$&&w.collapsed&&!$.options.lineWrapping&&Wr(ve)==$.display.maxLine&&(te=!0),w.collapsed&&X!=t.line&&Or(ve,0),jt(ve,new dr(w,X==t.line?t.ch:null,X==n.line?n.ch:null)),++X}),w.collapsed&&e.iter(t.line,n.line+1,function(ve){Jr(e,ve)&&Or(ve,0)}),w.clearOnEnter&&Oe(w,"beforeCursorEnter",function(){return w.clear()}),w.readOnly&&(nr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),w.collapsed&&(w.id=++ns,w.atomic=!0),$){if(te&&($.curOp.updateMaxLine=!0),w.collapsed)Gr($,t.line,n.line+1);else if(w.className||w.startStyle||w.endStyle||w.css||w.attributes||w.title)for(var fe=t.line;fe<=n.line;fe++)Dn($,fe,"text");w.atomic&&Vo($.doc),Lr($,"markerAdded",$,w)}return w}var _i=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};_i.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Lr(this,"clear")},_i.prototype.find=function(e,t){return this.primary.find(e,t)},be(_i);function Cl(e,t,n,r,i){r=I(r),r.shared=!1;var w=[oi(e,t,n,r,i)],j=w[0],X=r.widgetNode;return On(e,function($){X&&(r.widgetNode=X.cloneNode(!0)),w.push(oi($,l($,t),l($,n),r,i));for(var te=0;te<$.linked.length;++te)if($.linked[te].isParent)return;j=re(w)}),new _i(w,j)}function is(e){return e.findMarks(qe(e.first,0),e.clipPos(qe(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),w=e.clipPos(i.from),j=e.clipPos(i.to);if(At(w,j)){var X=oi(e,w,j,r.primary,r.primary.type);r.markers.push(X),X.parent=r}}}function Al(e){for(var t=function(r){var i=e[r],w=[i.primary.doc];On(i.primary.doc,function($){return w.push($)});for(var j=0;j<i.markers.length;j++){var X=i.markers[j];oe(w,X.doc)==-1&&(X.parent=null,i.markers.splice(j--,1))}},n=0;n<e.length;n++)t(n)}var Tl=0,zr=function(e,t,n,r,i){if(!(this instanceof zr))return new zr(e,t,n,r,i);n==null&&(n=0),ki.call(this,[new Di([new Nn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var w=qe(n,0);this.sel=Ln(w),this.history=new Zi(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ia(this,{from:w,to:w,text:e}),Ir(this,Ln(w),xe)};zr.prototype=De(ki.prototype,{constructor:zr,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=rn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:wr(function(e){var t=qe(this.first,0),n=this.first+this.size-1;ii(this,{from:t,to:qe(n,vt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bi(this.cm,0,0),Ir(this,Ln(t),xe)}),replaceRange:function(e,t,n,r){t=l(this,t),n=n?l(this,n):t,ai(this,e,t,n,r)},getRange:function(e,t,n){var r=ar(this,l(this,e),l(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Xr(this,e))return vt(this,e)},getLineNumber:function(e){return _t(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=vt(this,e)),Wr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return l(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:wr(function(e,t,n){Go(this,l(this,typeof e=="number"?qe(e,t||0):e),null,n)}),setSelection:wr(function(e,t,n){Go(this,l(this,e),l(this,t||e),n)}),extendSelection:wr(function(e,t,n){$i(this,l(this,e),t&&l(this,t),n)}),extendSelections:wr(function(e,t){Ho(this,W(this,e),t)}),extendSelectionsBy:wr(function(e,t){var n=ce(this.sel.ranges,e);Ho(this,W(this,n),t)}),setSelections:wr(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new Zt(l(this,e[i].anchor),l(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ir(this,mn(this.cm,r,t),n)}),addSelection:wr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Zt(l(this,e),l(this,t||e))),Ir(this,mn(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=ar(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=ar(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:wr(function(e,t,n){for(var r=[],i=this.sel,w=0;w<i.ranges.length;w++){var j=i.ranges[w];r[w]={from:j.from(),to:j.to(),text:this.splitLines(e[w]),origin:n}}for(var X=t&&t!="end"&&hl(this,r,t),$=r.length-1;$>=0;$--)ii(this,r[$]);X?zo(this,X):this.cm&&ei(this.cm)}),undo:wr(function(){ra(this,"undo")}),redo:wr(function(){ra(this,"redo")}),undoSelection:wr(function(){ra(this,"undo",!0)}),redoSelection:wr(function(){ra(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Zi(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:ri(this.history.done),undone:ri(this.history.undone)}},setHistory:function(e){var t=this.history=new Zi(this.history.maxGeneration);t.done=ri(e.done.slice(0),null,!0),t.undone=ri(e.undone.slice(0),null,!0)},setGutterMarker:wr(function(e,t,n){return Ri(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Ne(i)&&(r.gutterMarkers=null),!0})}),clearGutter:wr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Ri(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Ne(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Xr(this,e))return null;if(t=e,e=vt(this,e),!e)return null}else if(t=_t(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:wr(function(e,t,n){return Ri(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(v(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:wr(function(e,t,n){return Ri(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",w=r[i];if(w)if(n==null)r[i]=null;else{var j=w.match(v(n));if(!j)return!1;var X=j.index+j[0].length;r[i]=w.slice(0,j.index)+(!j.index||X==w.length?"":" ")+w.slice(X)||null}else return!1;return!0})}),addLineWidget:wr(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return oi(this,l(this,e),l(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=l(this,e),oi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=l(this,e);var t=[],n=vt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=l(this,e),t=l(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(w){var j=w.markedSpans;if(j)for(var X=0;X<j.length;X++){var $=j[X];!($.to!=null&&i==e.line&&e.ch>=$.to||$.from==null&&i!=e.line||$.from!=null&&i==t.line&&$.from>=t.ch)&&(!n||n($.marker))&&r.push($.marker.parent||$.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var w=i.text.length+r;if(w>e)return t=e,!0;e-=w,++n}),l(this,qe(n,t))},indexFromPos:function(e){e=l(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new zr(rn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new zr(rn(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,is(this)),r},unlinkDoc:function(e){if(e instanceof hr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(is(this));break}if(e.history==this.history){var r=[e.id];On(e,function(i){return r.push(i.id)},!0),e.history=new Zi(null),e.history.done=ri(this.history.done,r),e.history.undone=ri(this.history.undone,r)}},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):ze(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:wr(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)})}),zr.prototype.eachLine=zr.prototype.iter;var as=0;function wl(e){var t=this;if(os(t),Ye(t,e)||Sn(t.display,e))return;ne(e),G&&(as=+new Date);var n=Fn(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,w=Array(i),j=0,X=function(){++j==i&&Tr(t,function(){n=l(t.doc,n);var Re={from:n,to:n,text:t.doc.splitLines(w.filter(function(Ge){return Ge!=null}).join(t.doc.lineSeparator())),origin:"paste"};ii(t.doc,Re),zo(t.doc,Ln(l(t.doc,n),l(t.doc,_n(Re))))})()},$=function(Re,Ge){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,Re.type)==-1){X();return}var Ze=new FileReader;Ze.onerror=function(){return X()},Ze.onload=function(){var rt=Ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(rt)){X();return}w[Ge]=rt,X()},Ze.readAsText(Re)},te=0;te<r.length;te++)$(r[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var fe=e.dataTransfer.getData("Text");if(fe){var ve;if(t.state.draggingText&&!t.state.draggingText.copy&&(ve=t.listSelections()),ea(t.doc,Ln(n,n)),ve)for(var _e=0;_e<ve.length;++_e)ai(t.doc,"",ve[_e].anchor,ve[_e].head,"drag");t.replaceSelection(fe,"around","paste"),t.display.input.focus()}}catch(Re){}}}function Rl(e,t){if(G&&(!e.state.draggingText||+new Date-as<100)){ue(t);return}if(Ye(e,t)||Sn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!O){var n=o("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),C&&n.parentNode.removeChild(n)}}function Dl(e,t){var n=Fn(e,t);if(!n)return;var r=document.createDocumentFragment();yo(e,n,r),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),d(e.display.dragCursor,r)}function os(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var w=0;w<n.length;w++)e(n[w])})}var ls=!1;function kl(){if(ls)return;Ll(),ls=!0}function Ll(){var e;Oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(_l)},100))}),Oe(window,"blur",function(){return ss($n)})}function _l(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var In={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"},Oi=0;Oi<10;Oi++)In[Oi+48]=In[Oi+96]=String(Oi);for(var na=65;na<=90;na++)In[na]=String.fromCharCode(na);for(var Mi=1;Mi<=12;Mi++)In[Mi+111]=In[Mi+63235]="F"+Mi;var An={};An.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"},An.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"},An.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"},An.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"]},An.default=u?An.macDefault:An.pcDefault;function Ol(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,w,j=0;j<t.length-1;j++){var X=t[j];if(/^(cmd|meta|m)$/i.test(X))w=!0;else if(/^a(lt)?$/i.test(X))n=!0;else if(/^(c|ctrl|control)$/i.test(X))r=!0;else if(/^s(hift)?$/i.test(X))i=!0;else throw new Error("Unrecognized modifier name: "+X)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),w&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ml(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=ce(n.split(" "),Ol),w=0;w<i.length;w++){var j=void 0,X=void 0;w==i.length-1?(X=i.join(" "),j=r):(X=i.slice(0,w+1).join(" "),j="...");var $=t[X];if(!$)t[X]=j;else if($!=j)throw new Error("Inconsistent bindings for "+X)}delete e[n]}for(var te in t)e[te]=t[te];return e}function si(e,t,n,r){t=ia(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return si(e,t.fallthrough,n,r);for(var w=0;w<t.fallthrough.length;w++){var j=si(e,t.fallthrough[w],n,r);if(j)return j}}}function us(e){var t=typeof e=="string"?e:In[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ds(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(f?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(f?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(C&&e.keyCode==34&&e.char)return!1;var n=In[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),ds(n,e,t))}function ia(e){return typeof e=="string"?An[e]:e}function li(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var w=t(n[i]);r.length&&At(w.from,re(r).to)<=0;){var j=r.pop();if(At(j.from,w.from)<0){w.from=j.from;break}}r.push(w)}Zr(e,function(){for(var X=r.length-1;X>=0;X--)ai(e.doc,"",r[X].from,r[X].to,"+delete");ei(e)})}function Ua(e,t,n){var r=Ue(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Fa(e,t,n){var r=Ua(e,t.ch,n);return r==null?null:new qe(t.line,r,n<0?"after":"before")}function ja(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var w=et(n,t.doc.direction);if(w){var j=i<0?re(w):w[0],X=i<0==(j.level==1),$=X?"after":"before",te;if(j.level>0||t.doc.direction=="rtl"){var fe=Jn(t,n);te=i<0?n.text.length-1:0;var ve=En(t,fe,te).top;te=nt(function(_e){return En(t,fe,_e).top==ve},i<0==(j.level==1)?j.from:j.to-1,te),$=="before"&&(te=Ua(n,te,1))}else te=i<0?j.to:j.from;return new qe(r,te,$)}}return new qe(r,i<0?n.text.length:0,i<0?"before":"after")}function Il(e,t,n,r){var i=et(t,e.doc.direction);if(!i)return Fa(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var w=tt(i,n.ch,n.sticky),j=i[w];if(e.doc.direction=="ltr"&&j.level%2==0&&(r>0?j.to>n.ch:j.from<n.ch))return Fa(t,n,r);var X=function(ut,pt){return Ua(t,ut instanceof qe?ut.ch:ut,pt)},$,te=function(ut){return e.options.lineWrapping?($=$||Jn(e,t),po(e,t,$,ut)):{begin:0,end:t.text.length}},fe=te(n.sticky=="before"?X(n,-1):n.ch);if(e.doc.direction=="rtl"||j.level==1){var ve=j.level==1==r<0,_e=X(n,ve?1:-1);if(_e!=null&&(ve?_e<=j.to&&_e<=fe.end:_e>=j.from&&_e>=fe.begin)){var Re=ve?"before":"after";return new qe(n.line,_e,Re)}}var Ge=function(ut,pt,dt){for(var gt=function(lr,Rr){return Rr?new qe(n.line,X(lr,1),"before"):new qe(n.line,lr,"after")};ut>=0&&ut<i.length;ut+=pt){var Tt=i[ut],xt=pt>0==(Tt.level!=1),Ot=xt?dt.begin:X(dt.end,-1);if(Tt.from<=Ot&&Ot<Tt.to)return gt(Ot,xt);if(Ot=xt?Tt.from:X(Tt.to,-1),dt.begin<=Ot&&Ot<dt.end)return gt(Ot,xt)}},Ze=Ge(w+r,r,fe);if(Ze)return Ze;var rt=r>0?fe.end:X(fe.begin,-1);return rt!=null&&!(r>0&&rt==t.text.length)&&(Ze=Ge(r>0?0:i.length-1,r,te(rt)),Ze)?Ze:null}var Ii={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return li(e,function(t){if(t.empty()){var n=vt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:qe(t.head.line+1,0)}:{from:t.head,to:qe(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return li(e,function(t){return{from:qe(t.from().line,0),to:l(e.doc,qe(t.to().line+1,0))}})},delLineLeft:function(e){return li(e,function(t){return{from:qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return li(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return li(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return hs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Te)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Te)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?fs(e,t.head):r},Te)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var w=n[i].from(),j=Y(e.getLine(w.line),w.ch,r);t.push(de(r-j%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zr(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,w=vt(e.doc,i.line).text;if(w){if(i.ch==w.length&&(i=new qe(i.line,i.ch-1)),i.ch>0)i=new qe(i.line,i.ch+1),e.replaceRange(w.charAt(i.ch-1)+w.charAt(i.ch-2),qe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var j=vt(e.doc,i.line-1).text;j&&(i=new qe(i.line,1),e.replaceRange(w.charAt(0)+e.doc.lineSeparator()+j.charAt(j.length-1),qe(i.line-1,j.length-1),i,"+transpose"))}}n.push(new Zt(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Zr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ei(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function hs(e,t){var n=vt(e.doc,t),r=Wr(n);return r!=n&&(t=_t(r)),ja(!0,e,r,t,1)}function Pl(e,t){var n=vt(e.doc,t),r=Qn(n);return r!=n&&(t=_t(r)),ja(!0,e,n,t,-1)}function fs(e,t){var n=hs(e,t.line),r=vt(e.doc,n.line),i=et(r,e.doc.direction);if(!i||i[0].level==0){var w=Math.max(n.ch,r.text.search(/\S/)),j=t.line==n.line&&t.ch<=w&&t.ch;return qe(n.line,j?0:w,n.sticky)}return n}function aa(e,t,n){if(typeof t=="string"&&(t=Ii[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Le}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=si(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&si(t,e.options.extraKeys,n,e)||si(t,e.options.keyMap,n,e)}var Bl=new ee;function Pi(e,t,n,r){var i=e.state.keySeq;if(i){if(us(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ps(e,i+" "+t,n,r))return!0}return ps(e,t,n,r)}function ps(e,t,n,r){var i=Nl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Lr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(ne(n),Sa(e)),!!i}function ms(e,t){var n=cs(t,!0);return n?t.shiftKey&&!e.state.keySeq?Pi(e,"Shift-"+n,t,function(r){return aa(e,r,!0)})||Pi(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return aa(e,r)}):Pi(e,n,t,function(r){return aa(e,r)}):!1}function Ul(e,t,n){return Pi(e,"'"+n+"'",t,function(r){return aa(e,r,!0)})}var Wa=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Ye(t,e))return;G&&F<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=ms(t,e);C&&(Wa=r?n:null,!r&&n==88&&!Mt&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),L&&!u&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(m(t,"CodeMirror-crosshair"),st(document,"keyup",n),st(document,"mouseover",n))}Oe(document,"keyup",n),Oe(document,"mouseover",n)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function ys(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Sn(t.display,e)||Ye(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(C&&n==Wa){Wa=null,ne(e);return}if(C&&(!e.which||e.which<10)&&ms(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,Ha=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ha.prototype.compare=function(e,t,n){return this.time+jl>e&&At(t,this.pos)==0&&n==this.button};var Ni,Bi;function Wl(e,t){var n=+new Date;return Bi&&Bi.compare(n,e,t)?(Ni=Bi=null,"triple"):Ni&&Ni.compare(n,e,t)?(Bi=new Ha(n,e,t),Ni=null,"double"):(Ni=new Ha(n,e,t),Bi=null,"single")}function bs(e){var t=this,n=t.display;if(Ye(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Sn(n,e)){P||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ga(t,e))return;var r=Fn(t,e),i=Se(e),w=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,i,r,w,e))return;i==1?r?zl(t,r,w,e):ke(e)==n.scroller&&ne(e):i==2?(r&&$i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(D?t.display.input.onContextMenu(e):Eo(t))}function Hl(e,t,n,r,i){var w="Click";return r=="double"?w="Double"+w:r=="triple"&&(w="Triple"+w),w=(t==1?"Left":t==2?"Middle":"Right")+w,Pi(e,ds(w,i),i,function(j){if(typeof j=="string"&&(j=Ii[j]),!j)return!1;var X=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),X=j(e,n)!=Le}finally{e.state.suppressEdits=!1}return X})}function Gl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var w=h?n.shiftKey&&n.metaKey:n.altKey;i.unit=w?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=u?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(u?n.altKey:n.ctrlKey)),i}function zl(e,t,n,r){G?setTimeout(_(bo,e),0):e.curOp.focus=N();var i=Gl(e,n,r),w=e.doc.sel,j;e.options.dragDrop&&Ve&&!e.isReadOnly()&&n=="single"&&(j=w.contains(t))>-1&&(At((j=w.ranges[j]).from(),t)<0||t.xRel>0)&&(At(j.to(),t)>0||t.xRel<0)?Kl(e,r,t,i):Vl(e,r,t,i)}function Kl(e,t,n,r){var i=e.display,w=!1,j=Tr(e,function(te){P&&(i.scroller.draggable=!1),e.state.draggingText=!1,st(i.wrapper.ownerDocument,"mouseup",j),st(i.wrapper.ownerDocument,"mousemove",X),st(i.scroller,"dragstart",$),st(i.scroller,"drop",j),w||(ne(te),r.addNew||$i(e.doc,n,null,null,r.extend),P&&!O||G&&F==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),X=function(te){w=w||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},$=function(){return w=!0};P&&(i.scroller.draggable=!0),e.state.draggingText=j,j.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Oe(i.wrapper.ownerDocument,"mouseup",j),Oe(i.wrapper.ownerDocument,"mousemove",X),Oe(i.scroller,"dragstart",$),Oe(i.scroller,"drop",j),Eo(e),setTimeout(function(){return i.input.focus()},20)}function Es(e,t,n){if(n=="char")return new Zt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Zt(qe(t.line,0),l(e.doc,qe(t.line+1,0)));var r=n(e,t);return new Zt(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,w=e.doc;ne(t);var j,X,$=w.sel,te=$.ranges;if(r.addNew&&!r.extend?(X=w.sel.contains(n),X>-1?j=te[X]:j=new Zt(n,n)):(j=w.sel.primary(),X=w.sel.primIndex),r.unit=="rectangle")r.addNew||(j=new Zt(n,n)),n=Fn(e,t,!0,!0),X=-1;else{var fe=Es(e,n,r.unit);r.extend?j=Na(j,fe.anchor,fe.head,r.extend):j=fe}r.addNew?X==-1?(X=te.length,Ir(w,mn(e,te.concat([j]),X),{scroll:!1,origin:"*mouse"})):te.length>1&&te[X].empty()&&r.unit=="char"&&!r.extend?(Ir(w,mn(e,te.slice(0,X).concat(te.slice(X+1)),0),{scroll:!1,origin:"*mouse"}),$=w.sel):Ba(w,X,j,Ae):(X=0,Ir(w,new en([j],0),Ae),$=w.sel);var ve=n;function _e(dt){if(At(ve,dt)==0)return;if(ve=dt,r.unit=="rectangle"){for(var gt=[],Tt=e.options.tabSize,xt=Y(vt(w,n.line).text,n.ch,Tt),Ot=Y(vt(w,dt.line).text,dt.ch,Tt),lr=Math.min(xt,Ot),Rr=Math.max(xt,Ot),fr=Math.min(n.line,dt.line),qr=Math.min(e.lastLine(),Math.max(n.line,dt.line));fr<=qr;fr++){var Kr=vt(w,fr).text,Er=Ce(Kr,lr,Tt);lr==Rr?gt.push(new Zt(qe(fr,Er),qe(fr,Er))):Kr.length>Er&>.push(new Zt(qe(fr,Er),qe(fr,Ce(Kr,Rr,Tt))))}gt.length||gt.push(new Zt(n,n)),Ir(w,mn(e,$.ranges.slice(0,X).concat(gt),X),{origin:"*mouse",scroll:!1}),e.scrollIntoView(dt)}else{var Vr=j,_r=Es(e,dt,r.unit),Sr=Vr.anchor,xr;At(_r.anchor,Sr)>0?(xr=_r.head,Sr=cn(Vr.from(),_r.anchor)):(xr=_r.anchor,Sr=dn(Vr.to(),_r.head));var pr=$.ranges.slice(0);pr[X]=Ql(e,new Zt(l(w,Sr),xr)),Ir(w,mn(e,pr,X),Ae)}}var Re=i.wrapper.getBoundingClientRect(),Ge=0;function Ze(dt){var gt=++Ge,Tt=Fn(e,dt,!0,r.unit=="rectangle");if(!Tt)return;if(At(Tt,ve)!=0){e.curOp.focus=N(),_e(Tt);var xt=Qi(i,w);(Tt.line>=xt.to||Tt.line<xt.from)&&setTimeout(Tr(e,function(){Ge==gt&&Ze(dt)}),150)}else{var Ot=dt.clientY<Re.top?-20:dt.clientY>Re.bottom?20:0;Ot&&setTimeout(Tr(e,function(){if(Ge!=gt)return;i.scroller.scrollTop+=Ot,Ze(dt)}),50)}}function rt(dt){e.state.selectingText=!1,Ge=Infinity,dt&&(ne(dt),i.input.focus()),st(i.wrapper.ownerDocument,"mousemove",ut),st(i.wrapper.ownerDocument,"mouseup",pt),w.history.lastSelOrigin=null}var ut=Tr(e,function(dt){dt.buttons===0||!Se(dt)?rt(dt):Ze(dt)}),pt=Tr(e,rt);e.state.selectingText=pt,Oe(i.wrapper.ownerDocument,"mousemove",ut),Oe(i.wrapper.ownerDocument,"mouseup",pt)}function Ql(e,t){var n=t.anchor,r=t.head,i=vt(e.doc,n.line);if(At(n,r)==0&&n.sticky==r.sticky)return t;var w=et(i);if(!w)return t;var j=tt(w,n.ch,n.sticky),X=w[j];if(X.from!=n.ch&&X.to!=n.ch)return t;var $=j+(X.from==n.ch==(X.level!=1)?0:1);if($==0||$==w.length)return t;var te;if(r.line!=n.line)te=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var fe=tt(w,r.ch,r.sticky),ve=fe-j||(r.ch-n.ch)*(X.level==1?-1:1);fe==$-1||fe==$?te=ve<0:te=ve>0}var _e=w[$+(te?-1:0)],Re=te==(_e.level==1),Ge=Re?_e.from:_e.to,Ze=Re?"after":"before";return n.ch==Ge&&n.sticky==Ze?t:new Zt(new qe(n.line,Ge,Ze),r)}function xs(e,t,n,r){var i,w;if(t.touches)i=t.touches[0].clientX,w=t.touches[0].clientY;else try{i=t.clientX,w=t.clientY}catch(_e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ne(t);var j=e.display,X=j.lineDiv.getBoundingClientRect();if(w>X.bottom||!ge(e,n))return se(t);w-=X.top-j.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var te=j.gutters.childNodes[$];if(te&&te.getBoundingClientRect().right>=i){var fe=or(e.doc,w),ve=e.display.gutterSpecs[$];return je(e,n,e,fe,ve.className,t),se(t)}}}function Ga(e,t){return xs(e,t,"gutterClick",!0)}function Cs(e,t){if(Sn(e.display,t)||Yl(e,t))return;if(Ye(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Yl(e,t){return ge(e,"gutterContextMenu")?xs(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var ui={toString:function(){return"CodeMirror.Init"}},As={},oa={};function Xl(e){var t=e.optionHandlers;function n(r,i,w,j){e.defaults[r]=i,w&&(t[r]=j?function(X,$,te){te!=ui&&w(X,$,te)}:w)}e.defineOption=n,e.Init=ui,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ma(r)},!0),n("indentUnit",2,Ma,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Ti(r),vi(r),Gr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var w=[],j=r.doc.first;r.doc.iter(function($){for(var te=0;;){var fe=$.text.indexOf(i,te);if(fe==-1)break;te=fe+i.length,w.push(qe(j,fe))}j++});for(var X=w.length-1;X>=0;X--)ai(r.doc,i,w[X],qe(w[X].line,w[X].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,w){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),w!=ui&&r.refresh()}),n("specialCharPlaceholder",Kt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!T),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ss(r),Ai(r)},!0),n("keyMap","default",function(r,i,w){var j=ia(i),X=w!=ui&&ia(w);X&&X.detach&&X.detach(r,j),j.attach&&j.attach(r,X||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=_a(i,r.options.lineNumbers),Ai(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?xa(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return ti(r)},!0),n("scrollbarStyle","native",function(r){wo(r),ti(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=_a(r.options.gutters,i),Ai(r)},!0),n("firstLineNumber",1,Ai,!0),n("lineNumberFormatter",function(r){return r},Ai,!0),n("showCursorWhenSelecting",!1,yi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&($n(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yi,!0),n("singleCursorHeightPerLine",!0,yi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ti,!0),n("addModeClass",!1,Ti,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Ti,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=ui;if(!t!=!r){var i=e.display.dragFunctions,w=t?Oe:st;w(e.display.scroller,"dragstart",i.start),w(e.display.scroller,"dragenter",i.enter),w(e.display.scroller,"dragover",i.over),w(e.display.scroller,"dragleave",i.leave),w(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ca(e),Gr(e),vi(e),setTimeout(function(){return ti(e)},100)}function hr(e,t){var n=this;if(!(this instanceof hr))return new hr(e,t);this.options=t=t?I(t):{},I(As,t,!1);var r=t.value;typeof r=="string"?r=new zr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new hr.inputStyles[t.inputStyle](this),w=this.display=new dl(e,r,i,t);w.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ee,keySeq:null,specialChars:null},t.autofocus&&!s&&w.input.focus(),G&&F<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),kl(),Gn(this),this.curOp.forceUpdate=!0,No(this,r),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Aa(n)},20):$n(this);for(var j in oa)oa.hasOwnProperty(j)&&oa[j](this,t[j],ui);ko(this),t.finishInit&&t.finishInit(this);for(var X=0;X<za.length;++X)za[X](this);zn(this),P&&t.lineWrapping&&getComputedStyle(w.lineDiv).textRendering=="optimizelegibility"&&(w.lineDiv.style.textRendering="auto")}hr.defaults=As,hr.optionHandlers=oa;function ql(e){var t=e.display;Oe(t.scroller,"mousedown",Tr(e,bs)),G&&F<11?Oe(t.scroller,"dblclick",Tr(e,function($){if(Ye(e,$))return;var te=Fn(e,$);if(!te||Ga(e,$)||Sn(e.display,$))return;ne($);var fe=e.findWordAt(te);$i(e.doc,fe.anchor,fe.head)})):Oe(t.scroller,"dblclick",function($){return Ye(e,$)||ne($)}),Oe(t.scroller,"contextmenu",function($){return Cs(e,$)}),Oe(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||Cs(e,$)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function w($){if($.touches.length!=1)return!1;var te=$.touches[0];return te.radiusX<=1&&te.radiusY<=1}function j($,te){if(te.left==null)return!0;var fe=te.left-$.left,ve=te.top-$.top;return fe*fe+ve*ve>20*20}Oe(t.scroller,"touchstart",function($){if(!Ye(e,$)&&!w($)&&!Ga(e,$)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function($){var te=t.activeTouch;if(te&&!Sn(t,$)&&te.left!=null&&!te.moved&&new Date-te.start<300){var fe=e.coordsChar(t.activeTouch,"page"),ve;!te.prev||j(te,te.prev)?ve=new Zt(fe,fe):!te.prev.prev||j(te,te.prev.prev)?ve=e.findWordAt(fe):ve=new Zt(qe(fe.line,0),l(e.doc,qe(fe.line+1,0))),e.setSelection(ve.anchor,ve.head),e.focus(),ne($)}i()}),Oe(t.scroller,"touchcancel",i),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ei(e,t.scroller.scrollTop),Wn(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function($){return Oo(e,$)}),Oe(t.scroller,"DOMMouseScroll",function($){return Oo(e,$)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){Ye(e,$)||ue($)},over:function($){Ye(e,$)||(Dl(e,$),ue($))},start:function($){return Rl(e,$)},drop:Tr(e,wl),leave:function($){Ye(e,$)||os(e)}};var X=t.input.getField();Oe(X,"keyup",function($){return vs.call(e,$)}),Oe(X,"keydown",Tr(e,gs)),Oe(X,"keypress",Tr(e,ys)),Oe(X,"focus",function($){return Aa(e,$)}),Oe(X,"blur",function($){return $n(e,$)})}var za=[];hr.defineInitHook=function(e){return za.push(e)};function Ui(e,t,n,r){var i=e.doc,w;n==null&&(n="add"),n=="smart"&&(i.mode.indent?w=Xe(e,t).state:n="prev");var j=e.options.tabSize,X=vt(i,t),$=Y(X.text,null,j);X.stateAfter&&(X.stateAfter=null);var te=X.text.match(/^\s*/)[0],fe;if(!r&&!/\S/.test(X.text))fe=0,n="not";else if(n=="smart"&&(fe=i.mode.indent(w,X.text.slice(te.length),X.text),fe==Le||fe>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?fe=Y(vt(i,t-1).text,null,j):fe=0:n=="add"?fe=$+e.options.indentUnit:n=="subtract"?fe=$-e.options.indentUnit:typeof n=="number"&&(fe=$+n),fe=Math.max(0,fe);var ve="",_e=0;if(e.options.indentWithTabs)for(var Re=Math.floor(fe/j);Re;--Re)_e+=j,ve+=" ";if(_e<fe&&(ve+=de(fe-_e)),ve!=te)return ai(i,ve,qe(t,0),qe(t,te.length),"+input"),X.stateAfter=null,!0;for(var Ge=0;Ge<i.sel.ranges.length;Ge++){var Ze=i.sel.ranges[Ge];if(Ze.head.line==t&&Ze.head.ch<te.length){var rt=qe(t,te.length);Ba(i,Ge,new Zt(rt,rt));break}}}var gn=null;function sa(e){gn=e}function Ka(e,t,n,r,i){var w=e.doc;e.display.shift=!1,r||(r=w.sel);var j=+new Date-200,X=i=="paste"||e.state.pasteIncoming>j,$=ze(t),te=null;if(X&&r.ranges.length>1)if(gn&&gn.text.join(`
|
|
`)==t){if(r.ranges.length%gn.text.length==0){te=[];for(var fe=0;fe<gn.text.length;fe++)te.push(w.splitLines(gn.text[fe]))}}else $.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(te=ce($,function(ut){return[ut]}));for(var ve=e.curOp.updateInput,_e=r.ranges.length-1;_e>=0;_e--){var Re=r.ranges[_e],Ge=Re.from(),Ze=Re.to();Re.empty()&&(n&&n>0?Ge=qe(Ge.line,Ge.ch-n):e.state.overwrite&&!X?Ze=qe(Ze.line,Math.min(vt(w,Ze.line).text.length,Ze.ch+re($).length)):X&&gn&&gn.lineWise&&gn.text.join(`
|
|
`)==$.join(`
|
|
`)&&(Ge=Ze=qe(Ge.line,0)));var rt={from:Ge,to:Ze,text:te?te[_e%te.length]:$,origin:i||(X?"paste":e.state.cutIncoming>j?"cut":"+input")};ii(e.doc,rt),Lr(e,"inputRead",e,rt)}t&&!X&&ws(e,t),ei(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ve),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Zr(t,function(){return Ka(t,n,0,null,"paste")}),!0}function ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var w=e.getModeAt(i.head),j=!1;if(w.electricChars){for(var X=0;X<w.electricChars.length;X++)if(t.indexOf(w.electricChars.charAt(X))>-1){j=Ui(e,i.head.line,"smart");break}}else w.electricInput&&(w.electricInput.test(vt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(j=Ui(e,i.head.line,"smart")));j&&Lr(e,"electricInput",e,i.head.line)}}function Rs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,w={anchor:qe(i,0),head:qe(i+1,0)};n.push(w),t.push(e.getRange(w.anchor,w.head))}return{text:t,ranges:n}}function Ds(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function ks(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),S&&(e.style.border="1px solid black"),Ds(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var w=this.options,j=w[r];if(w[r]==i&&r!="mode")return;w[r]=i,t.hasOwnProperty(r)&&Tr(this,t[r])(this,i,j),je(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](ia(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,w=0;w<i.length;++w)if(i[w]==r||i[w].name==r)return i.splice(w,1),!0},addOverlay:Br(function(r,i){var w=r.token?r:e.getMode(this.options,r);if(w.startState)throw new Error("Overlays may not be stateful.");ae(this.state.overlays,{mode:w,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(j){return j.priority}),this.state.modeGen++,Gr(this)}),removeOverlay:Br(function(r){for(var i=this.state.overlays,w=0;w<i.length;++w){var j=i[w].modeSpec;if(j==r||typeof r=="string"&&j.name==r){i.splice(w,1),this.state.modeGen++,Gr(this);return}}}),indentLine:Br(function(r,i,w){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Xr(this.doc,r)&&Ui(this,r,i,w)}),indentSelection:Br(function(r){for(var i=this.doc.sel.ranges,w=-1,j=0;j<i.length;j++){var X=i[j];if(X.empty())X.head.line>w&&(Ui(this,X.head.line,r,!0),w=X.head.line,j==this.doc.sel.primIndex&&ei(this));else{var $=X.from(),te=X.to(),fe=Math.max(w,$.line);w=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ve=fe;ve<w;++ve)Ui(this,ve,r);var _e=this.doc.sel.ranges;$.ch==0&&i.length==_e.length&&_e[j].from().ch>0&&Ba(this.doc,j,new Zt($,_e[j].to()),xe)}}}),getTokenAt:function(r,i){return $t(this,r,i)},getLineTokens:function(r,i){return $t(this,qe(r),i,!0)},getTokenTypeAt:function(r){r=l(this.doc,r);var i=Qe(this,vt(this.doc,r.line)),w=0,j=(i.length-1)/2,X=r.ch,$;if(X==0)$=i[2];else for(;;){var te=w+j>>1;if((te?i[te*2-1]:0)>=X)j=te;else if(i[te*2+1]<X)w=te+1;else{$=i[te*2+2];break}}var fe=$?$.indexOf("overlay "):-1;return fe<0?$:fe==0?null:$.slice(0,fe-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var w=[];if(!n.hasOwnProperty(i))return w;var j=n[i],X=this.getModeAt(r);if(typeof X[i]=="string")j[X[i]]&&w.push(j[X[i]]);else if(X[i])for(var $=0;$<X[i].length;$++){var te=j[X[i][$]];te&&w.push(te)}else X.helperType&&j[X.helperType]?w.push(j[X.helperType]):j[X.name]&&w.push(j[X.name]);for(var fe=0;fe<j._global.length;fe++){var ve=j._global[fe];ve.pred(X,this)&&oe(w,ve.val)==-1&&w.push(ve.val)}return w},getStateAfter:function(r,i){var w=this.doc;return r=z(w,r==null?w.first+w.size-1:r),Xe(this,r+1,i).state},cursorCoords:function(r,i){var w,j=this.doc.sel.primary();return r==null?w=j.head:typeof r=="object"?w=l(this.doc,r):w=r?j.from():j.to(),pn(this,w,i||"page")},charCoords:function(r,i){return ga(this,l(this.doc,r),i||"page")},coordsChar:function(r,i){return r=co(this,r,i||"page"),ya(this,r.left,r.top)},lineAtHeight:function(r,i){return r=co(this,{top:r,left:0},i||"page").top,or(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,w){var j=!1,X;if(typeof r=="number"){var $=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>$&&(r=$,j=!0),X=vt(this.doc,r)}else X=r;return Gi(this,X,{top:0,left:0},i||"page",w||j).top+(j?this.doc.height-fn(X):0)},defaultTextHeight:function(){return Zn(this.display)},defaultCharWidth:function(){return qn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,w,j,X){var $=this.display;r=pn(this,l(this.doc,r));var te=r.bottom,fe=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),$.sizer.appendChild(i),j=="over")te=r.top;else if(j=="above"||j=="near"){var ve=Math.max($.wrapper.clientHeight,this.doc.height),_e=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(j=="above"||r.bottom+i.offsetHeight>ve)&&r.top>i.offsetHeight?te=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=ve&&(te=r.bottom),fe+i.offsetWidth>_e&&(fe=_e-i.offsetWidth)}i.style.top=te+"px",i.style.left=i.style.right="",X=="right"?(fe=$.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(X=="left"?fe=0:X=="middle"&&(fe=($.sizer.clientWidth-i.offsetWidth)/2),i.style.left=fe+"px"),w&&Js(this,{left:fe,top:te,right:fe+i.offsetWidth,bottom:te+i.offsetHeight})},triggerOnKeyDown:Br(gs),triggerOnKeyPress:Br(ys),triggerOnKeyUp:vs,triggerOnMouseDown:Br(bs),execCommand:function(r){if(Ii.hasOwnProperty(r))return Ii[r].call(null,this)},triggerElectric:Br(function(r){ws(this,r)}),findPosH:function(r,i,w,j){var X=1;i<0&&(X=-1,i=-i);for(var $=l(this.doc,r),te=0;te<i&&!($=Va(this.doc,$,X,w,j),$.hitSide);++te);return $},moveH:Br(function(r,i){var w=this;this.extendSelectionsBy(function(j){return w.display.shift||w.doc.extend||j.empty()?Va(w.doc,j.head,r,i,w.options.rtlMoveVisually):r<0?j.from():j.to()},Te)}),deleteH:Br(function(r,i){var w=this.doc.sel,j=this.doc;w.somethingSelected()?j.replaceSelection("",null,"+delete"):li(this,function(X){var $=Va(j,X.head,r,i,!1);return r<0?{from:$,to:X.head}:{from:X.head,to:$}})}),findPosV:function(r,i,w,j){var X=1,$=j;i<0&&(X=-1,i=-i);for(var te=l(this.doc,r),fe=0;fe<i;++fe){var ve=pn(this,te,"div");if($==null?$=ve.left:ve.left=$,te=Ls(this,ve,X,w),te.hitSide)break}return te},moveV:Br(function(r,i){var w=this,j=this.doc,X=[],$=!this.display.shift&&!j.extend&&j.sel.somethingSelected();if(j.extendSelectionsBy(function(fe){if($)return r<0?fe.from():fe.to();var ve=pn(w,fe.head,"div");fe.goalColumn!=null&&(ve.left=fe.goalColumn),X.push(ve.left);var _e=Ls(w,ve,r,i);return i=="page"&&fe==j.sel.primary()&&wa(w,ga(w,_e,"div").top-ve.top),_e},Te),X.length)for(var te=0;te<j.sel.ranges.length;te++)j.sel.ranges[te].goalColumn=X[te]}),findWordAt:function(r){var i=this.doc,w=vt(i,r.line).text,j=r.ch,X=r.ch;if(w){var $=this.getHelper(r,"wordChars");(r.sticky=="before"||X==w.length)&&j?--j:++X;for(var te=w.charAt(j),fe=Pe(te,$)?function(ve){return Pe(ve,$)}:/\s/.test(te)?function(ve){return/\s/.test(ve)}:function(ve){return!/\s/.test(ve)&&!Pe(ve)};j>0&&fe(w.charAt(j-1));)--j;for(;X<w.length&&fe(w.charAt(X));)++X}return new Zt(qe(r.line,j),qe(r.line,X))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Br(function(r,i){bi(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-bn(this)-this.display.barHeight,width:r.scrollWidth-bn(this)-this.display.barWidth,clientHeight:fa(this),clientWidth:Bn(this)}},scrollIntoView:Br(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:qe(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Zs(this,r):Co(this,r.from,r.to,r.margin)}),setSize:Br(function(r,i){var w=this,j=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};r!=null&&(this.display.wrapper.style.width=j(r)),i!=null&&(this.display.wrapper.style.height=j(i)),this.options.lineWrapping&&so(this);var X=this.display.viewFrom;this.doc.iter(X,this.display.viewTo,function($){if($.widgets){for(var te=0;te<$.widgets.length;te++)if($.widgets[te].noHScroll){Dn(w,X,"widget");break}}++X}),this.curOp.forceUpdate=!0,je(this,"refresh",this)}),operation:function(r){return Zr(this,r)},startOperation:function(){return Gn(this)},endOperation:function(){return zn(this)},refresh:Br(function(){var r=this.display.cachedTextHeight;Gr(this),this.curOp.forceUpdate=!0,vi(this),bi(this,this.doc.scrollLeft,this.doc.scrollTop),ka(this.display),(r==null||Math.abs(r-Zn(this.display))>.5||this.options.lineWrapping)&&Ca(this),je(this,"refresh",this)}),swapDoc:Br(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),No(this,r),vi(this),this.display.input.reset(),bi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Lr(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(r,i,w){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=w},e.registerGlobalHelper=function(r,i,w,j){e.registerHelper(r,i,j),n[r]._global.push({pred:w,val:j})}}function Va(e,t,n,r,i){var w=t,j=n,X=vt(e,t.line),$=i&&e.direction=="rtl"?-n:n;function te(){var pt=t.line+$;return pt<e.first||pt>=e.first+e.size?!1:(t=new qe(pt,t.ch,t.sticky),X=vt(e,pt))}function fe(pt){var dt;if(r=="codepoint"){var gt=X.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(gt)?dt=null:dt=new qe(t.line,Math.max(0,Math.min(X.text.length,t.ch+n*(gt>=55296&><56320?2:1))),-n)}else i?dt=Il(e.cm,X,t,n):dt=Fa(X,t,n);if(dt==null)if(!pt&&te())t=ja(i,e.cm,X,t.line,$);else return!1;else t=dt;return!0}if(r=="char"||r=="codepoint")fe();else if(r=="column")fe(!0);else if(r=="word"||r=="group")for(var ve=null,_e=r=="group",Re=e.cm&&e.cm.getHelper(t,"wordChars"),Ge=!0;!(n<0&&!fe(!Ge));Ge=!1){var Ze=X.text.charAt(t.ch)||`
|
|
`,rt=Pe(Ze,Re)?"w":_e&&Ze==`
|
|
`?"n":!_e||/\s/.test(Ze)?null:"p";if(_e&&!Ge&&!rt&&(rt="s"),ve&&ve!=rt){n<0&&(n=1,fe(),t.sticky="after");break}if(rt&&(ve=rt),n>0&&!fe(!Ge))break}var ut=ta(e,t,w,j,!0);return un(w,ut)&&(ut.hitSide=!0),ut}function Ls(e,t,n,r){var i=e.doc,w=t.left,j;if(r=="page"){var X=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(X-.5*Zn(e.display),3);j=(n>0?t.bottom:t.top)+n*$}else r=="line"&&(j=n>0?t.bottom+3:t.top-3);for(var te;!(te=ya(e,w,j),!te.outside);){if(n<0?j<=0:j>=i.height){te.hitSide=!0;break}j+=n*5}return te}var ir=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ir.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;Ds(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function w(X){for(var $=X.target;$;$=$.parentNode){if($==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}Oe(i,"paste",function(X){if(!w(X)||Ye(r,X)||Ts(X,r))return;F<=11&&setTimeout(Tr(r,function(){return t.updateFromDOM()}),20)}),Oe(i,"compositionstart",function(X){t.composing={data:X.data,done:!1}}),Oe(i,"compositionupdate",function(X){t.composing||(t.composing={data:X.data,done:!1})}),Oe(i,"compositionend",function(X){t.composing&&(X.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(i,"touchstart",function(){return n.forceCompositionEnd()}),Oe(i,"input",function(){t.composing||t.readFromDOMSoon()});function j(X){if(!w(X)||Ye(r,X))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()}),X.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var $=Rs(r);sa({lineWise:!0,text:$.text}),X.type=="cut"&&r.operation(function(){r.setSelections($.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(X.clipboardData){X.clipboardData.clearData();var te=gn.text.join(`
|
|
`);if(X.clipboardData.setData("Text",te),X.clipboardData.getData("Text")==te){X.preventDefault();return}}var fe=ks(),ve=fe.firstChild;r.display.lineSpace.insertBefore(fe,r.display.lineSpace.firstChild),ve.value=gn.text.join(`
|
|
`);var _e=document.activeElement;V(ve),setTimeout(function(){r.display.lineSpace.removeChild(fe),_e.focus(),_e==i&&n.showPrimarySelection()},50)}Oe(i,"copy",j),Oe(i,"cut",j)},ir.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ir.prototype.prepareSelection=function(){var e=vo(this.cm,!1);return e.focus=document.activeElement==this.div,e},ir.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},ir.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ir.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var w=la(t,e.anchorNode,e.anchorOffset),j=la(t,e.focusNode,e.focusOffset);if(w&&!w.bad&&j&&!j.bad&&At(cn(w,j),r)==0&&At(dn(w,j),i)==0)return;var X=t.display.view,$=r.line>=t.display.viewFrom&&_s(t,r)||{node:X[0].measure.map[2],offset:0},te=i.line<t.display.viewTo&&_s(t,i);if(!te){var fe=X[X.length-1].measure,ve=fe.maps?fe.maps[fe.maps.length-1]:fe.map;te={node:ve[ve.length-1],offset:ve[ve.length-2]-ve[ve.length-3]}}if(!$||!te){e.removeAllRanges();return}var _e=e.rangeCount&&e.getRangeAt(0),Re;try{Re=b($.node,$.offset,te.offset,te.node)}catch(Ge){}Re&&(!L&&t.state.focused?(e.collapse($.node,$.offset),Re.collapsed||(e.removeAllRanges(),e.addRange(Re))):(e.removeAllRanges(),e.addRange(Re)),_e&&e.anchorNode==null?e.addRange(_e):L&&this.startGracePeriod()),this.rememberSelection()},ir.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)},ir.prototype.showMultipleSelections=function(e){d(this.cm.display.cursorDiv,e.cursors),d(this.cm.display.selectionDiv,e.selection)},ir.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ir.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},ir.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ir.prototype.blur=function(){this.div.blur()},ir.prototype.getField=function(){return this.div},ir.prototype.supportsTouch=function(){return!0},ir.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zr(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)},ir.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ir.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=la(t,e.anchorNode,e.anchorOffset),r=la(t,e.focusNode,e.focusOffset);n&&r&&Zr(t,function(){Ir(t.doc,Ln(n,r),xe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},ir.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=qe(r.line-1,vt(e.doc,r.line-1).length)),i.ch==vt(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=qe(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var w,j,X;r.line==t.viewFrom||(w=jn(e,r.line))==0?(j=_t(t.view[0].line),X=t.view[0].node):(j=_t(t.view[w].line),X=t.view[w-1].node.nextSibling);var $=jn(e,i.line),te,fe;if($==t.view.length-1?(te=t.viewTo-1,fe=t.lineDiv.lastChild):(te=_t(t.view[$+1].line)-1,fe=t.view[$+1].node.previousSibling),!X)return!1;for(var ve=e.doc.splitLines(tu(e,X,fe,j,te)),_e=ar(e.doc,qe(j,0),qe(te,vt(e.doc,te).text.length));ve.length>1&&_e.length>1;)if(re(ve)==re(_e))ve.pop(),_e.pop(),te--;else if(ve[0]==_e[0])ve.shift(),_e.shift(),j++;else break;for(var Re=0,Ge=0,Ze=ve[0],rt=_e[0],ut=Math.min(Ze.length,rt.length);Re<ut&&Ze.charCodeAt(Re)==rt.charCodeAt(Re);)++Re;for(var pt=re(ve),dt=re(_e),gt=Math.min(pt.length-(ve.length==1?Re:0),dt.length-(_e.length==1?Re:0));Ge<gt&&pt.charCodeAt(pt.length-Ge-1)==dt.charCodeAt(dt.length-Ge-1);)++Ge;if(ve.length==1&&_e.length==1&&j==r.line)for(;Re&&Re>r.ch&&pt.charCodeAt(pt.length-Ge-1)==dt.charCodeAt(dt.length-Ge-1);)Re--,Ge++;ve[ve.length-1]=pt.slice(0,pt.length-Ge).replace(/^\u200b+/,""),ve[0]=ve[0].slice(Re).replace(/\u200b+$/,"");var Tt=qe(j,Re),xt=qe(te,_e.length?re(_e).length-Ge:0);if(ve.length>1||ve[0]||At(Tt,xt))return ai(e.doc,ve,Tt,xt,"+input"),!0},ir.prototype.ensurePolled=function(){this.forceCompositionEnd()},ir.prototype.reset=function(){this.forceCompositionEnd()},ir.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},ir.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)},ir.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Zr(this.cm,function(){return Gr(e.cm)})},ir.prototype.setUneditable=function(e){e.contentEditable="false"},ir.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Tr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},ir.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ir.prototype.onContextMenu=function(){},ir.prototype.resetPosition=function(){},ir.prototype.needsContentAttribute=!0;function _s(e,t){var n=pa(e,t.line);if(!n||n.hidden)return null;var r=vt(e.doc,t.line),i=ro(n,r,t.line),w=et(r,e.doc.direction),j="left";if(w){var X=tt(w,t.ch);j=X%2?"right":"left"}var $=ao(i.map,t.ch,j);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function di(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var w="",j=!1,X=e.doc.lineSeparator(),$=!1;function te(Re){return function(Ge){return Ge.id==Re}}function fe(){j&&(w+=X,$&&(w+=X),j=$=!1)}function ve(Re){Re&&(fe(),w+=Re)}function _e(Re){if(Re.nodeType==1){var Ge=Re.getAttribute("cm-text");if(Ge){ve(Ge);return}var Ze=Re.getAttribute("cm-marker"),rt;if(Ze){var ut=e.findMarks(qe(r,0),qe(i+1,0),te(+Ze));ut.length&&(rt=ut[0].find(0))&&ve(ar(e.doc,rt.from,rt.to).join(X));return}if(Re.getAttribute("contenteditable")=="false")return;var pt=/^(pre|div|p|li|table|br)$/i.test(Re.nodeName);if(!/^br$/i.test(Re.nodeName)&&Re.textContent.length==0)return;pt&&fe();for(var dt=0;dt<Re.childNodes.length;dt++)_e(Re.childNodes[dt]);/^(pre|p)$/i.test(Re.nodeName)&&($=!0),pt&&(j=!0)}else Re.nodeType==3&&ve(Re.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(_e(t),t==n);)t=t.nextSibling,$=!1;return w}function la(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return di(e.clipPos(qe(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var w=e.display.view[i];if(w.node==r)return ru(w,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!x(r,t))return di(qe(_t(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var w=e.rest?re(e.rest):e.line;return di(qe(_t(w),w.text.length),i)}var j=t.nodeType==3?t:null,X=t;for(!j&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(j=t.firstChild,n&&(n=j.nodeValue.length));X.parentNode!=r;)X=X.parentNode;var $=e.measure,te=$.maps;function fe(rt,ut,pt){for(var dt=-1;dt<(te?te.length:0);dt++)for(var gt=dt<0?$.map:te[dt],Tt=0;Tt<gt.length;Tt+=3){var xt=gt[Tt+2];if(xt==rt||xt==ut){var Ot=_t(dt<0?e.line:e.rest[dt]),lr=gt[Tt]+pt;return(pt<0||xt!=rt)&&(lr=gt[Tt+(pt?1:0)]),qe(Ot,lr)}}}var ve=fe(j,X,n);if(ve)return di(ve,i);for(var _e=X.nextSibling,Re=j?j.nodeValue.length-n:0;_e;_e=_e.nextSibling){if(ve=fe(_e,_e.firstChild,0),ve)return di(qe(ve.line,ve.ch-Re),i);Re+=_e.textContent.length}for(var Ge=X.previousSibling,Ze=n;Ge;Ge=Ge.previousSibling){if(ve=fe(Ge,Ge.firstChild,-1),ve)return di(qe(ve.line,ve.ch+Ze),i);Ze+=Ge.textContent.length}}var gr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};gr.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),S&&(i.style.width="0px"),Oe(i,"input",function(){G&&F>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Oe(i,"paste",function(j){if(Ye(r,j)||Ts(j,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function w(j){if(Ye(r,j))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var X=Rs(r);sa({lineWise:!0,text:X.text}),j.type=="cut"?r.setSelections(X.ranges,null,xe):(n.prevInput="",i.value=X.text.join(`
|
|
`),V(i))}else return;j.type=="cut"&&(r.state.cutIncoming=+new Date)}Oe(i,"cut",w),Oe(i,"copy",w),Oe(e.scroller,"paste",function(j){if(Sn(e,j)||Ye(r,j))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var X=new Event("paste");X.clipboardData=j.clipboardData,i.dispatchEvent(X)}),Oe(e.lineSpace,"selectstart",function(j){Sn(e,j)||ne(j)}),Oe(i,"compositionstart",function(){var j=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:j,range:r.markText(j,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Oe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},gr.prototype.createField=function(e){this.wrapper=ks(),this.textarea=this.wrapper.firstChild},gr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},gr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vo(e);if(e.options.moveInputWithCursor){var i=pn(e,n.sel.primary().head,"div"),w=t.wrapper.getBoundingClientRect(),j=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+j.top-w.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+j.left-w.left))}return r},gr.prototype.showSelection=function(e){var t=this.cm,n=t.display;d(n.cursorDiv,e.cursors),d(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},gr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&V(this.textarea),G&&F>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",G&&F>=9&&(this.hasSelection=null))},gr.prototype.getField=function(){return this.textarea},gr.prototype.supportsTouch=function(){return!1},gr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},gr.prototype.blur=function(){this.textarea.blur()},gr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},gr.prototype.receivedFocus=function(){this.slowPoll()},gr.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()})},gr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},gr.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||lt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(G&&F>=9&&this.hasSelection===i||u&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var w=i.charCodeAt(0);if(w==8203&&!r&&(r="\u200B"),w==8666)return this.reset(),this.cm.execCommand("undo")}for(var j=0,X=Math.min(r.length,i.length);j<X&&r.charCodeAt(j)==i.charCodeAt(j);)++j;return Zr(t,function(){Ka(t,i.slice(j),r.length-j,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},gr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},gr.prototype.onKeyPress=function(){G&&F>=9&&(this.hasSelection=null),this.fastPoll()},gr.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var w=Fn(n,e),j=r.scroller.scrollTop;if(!w||C)return;var X=n.options.resetSelectionOnContextMenu;X&&n.doc.sel.contains(w)==-1&&Tr(n,Ir)(n.doc,Ln(w),xe);var $=i.style.cssText,te=t.wrapper.style.cssText,fe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-fe.top-5)+"px; left: "+(e.clientX-fe.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ve;P&&(ve=window.scrollY),r.input.focus(),P&&window.scrollTo(null,ve),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Re,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function _e(){if(i.selectionStart!=null){var Ze=n.somethingSelected(),rt="\u200B"+(Ze?i.value:"");i.value="\u21DA",i.value=rt,t.prevInput=Ze?"":"\u200B",i.selectionStart=1,i.selectionEnd=rt.length,r.selForContextMenu=n.doc.sel}}function Re(){if(t.contextMenuPending!=Re)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,i.style.cssText=$,G&&F<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=j),i.selectionStart!=null){(!G||G&&F<9)&&_e();var Ze=0,rt=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Tr(n,Xo)(n):Ze++<10?r.detectingSelectAll=setTimeout(rt,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(rt,200)}}if(G&&F>=9&&_e(),D){ue(e);var Ge=function(){st(window,"mouseup",Ge),setTimeout(Re,20)};Oe(window,"mouseup",Ge)}else setTimeout(Re,50)},gr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},gr.prototype.setUneditable=function(){},gr.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?I(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=N();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=X.getValue()}var i;if(e.form&&(Oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var w=e.form;i=w.submit;try{var j=w.submit=function(){r(),w.submit=i,w.submit(),w.submit=j}}catch($){}}t.finishInit=function($){$.save=r,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,r(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var X=hr(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return X}function iu(e){e.off=st,e.on=Oe,e.wheelEventPixels=cl,e.Doc=zr,e.splitLines=ze,e.countColumn=Y,e.findColumn=Ce,e.isWordChar=Me,e.Pass=Le,e.signal=je,e.Line=Nn,e.changeEnd=_n,e.scrollbarModel=To,e.Pos=qe,e.cmpPos=At,e.modes=zt,e.mimeModes=Lt,e.resolveMode=Et,e.getMode=Nr,e.modeExtensions=ur,e.extendMode=Cr,e.copyState=Fr,e.startState=sn,e.innerMode=tn,e.commands=Ii,e.keyMap=An,e.keyName=cs,e.isModifierKey=us,e.lookupKey=si,e.normalizeKeyMap=Ml,e.StringStream=Ft,e.SharedTextMarker=_i,e.TextMarker=Mn,e.LineWidget=Li,e.e_preventDefault=ne,e.e_stopPropagation=ie,e.e_stop=ue,e.addClass=U,e.contains=x,e.rmClass=m,e.keyNames=In}Xl(hr),$l(hr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ua in zr.prototype)zr.prototype.hasOwnProperty(ua)&&oe(au,ua)<0&&(hr.prototype[ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(zr.prototype[ua]));return be(zr),hr.inputStyles={textarea:gr,contenteditable:ir},hr.defineMode=function(e){!hr.defaults.mode&&e!="null"&&(hr.defaults.mode=e),Yr.apply(this,arguments)},hr.defineMIME=on,hr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),hr.defineMIME("text/plain","null"),hr.defineExtension=function(e,t){hr.prototype[e]=t},hr.defineDocExtension=function(e,t){zr.prototype[e]=t},hr.fromTextArea=nu,iu(hr),hr.version="5.58.2",hr})},W6BS:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAAN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7pzh37pypadW1a9dKqRgODg7Y399nMhmTZZm5ecIxUTpgkR4yiQ+IFhPiLCeOZpSFB3GTXDdwdIv17hmarR4//MGT3PGL+1z/bo/em6/S/84pmg89zwPrj/COd55mMDkirNWwkx3G0QsUB2/Ba57jjq0OZTxGOS46ryYJ82jApetPcTDYJ6yt4tshtVoIuUMz7NI/HqJ1SthscMfOHZy9+y62trbwPO/WbuHf3z7TmvlcLDVmMBgwHIwYjSbMJ3Nm0ZxI5p3JjHk6RkbCgVfDsgN8ArP3N5juM5jdJD26xrOjq9TzCcfzkGYYcXrrbTz6xDs5OrrMeHzIjck+2eiA65OYdrjOPace5NzOw/hO10zW5ZDm27VDUxdLnMtwOctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Ke,Ie,Z){Ke.exports=Z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ke,Ie,Z){"use strict";Z.r(Ie),Z.d(Ie,"ResizableTextArea",function(){return oe});var le=Z("wx14"),q=Z("1OyB"),L=Z("vuIU"),J=Z("Ji7U"),B=Z("LK+K"),M=Z("q1tI"),G=Z("VTBJ"),F=Z("rePB"),P=Z("Zm9Q"),k=Z("Kwbf"),y=Z("c+Xe"),C=Z("m+aA"),O=Z("bdgK"),R=new Map;function A(xe){xe.forEach(function(Ae){var Te,Ce=Ae.target;(Te=R.get(Ce))===null||Te===void 0||Te.forEach(function(pe){return pe(Ce)})})}var S=new O.default(A),c=null,s=null;function u(xe,Ae){R.has(xe)||(R.set(xe,new Set),S.observe(xe)),R.get(xe).add(Ae)}function h(xe,Ae){R.has(xe)&&(R.get(xe).delete(Ae),R.get(xe).size||(S.unobserve(xe),R.delete(xe)))}var T=function(xe){Object(J.a)(Te,xe);var Ae=Object(B.a)(Te);function Te(){return Object(q.a)(this,Te),Ae.apply(this,arguments)}return Object(L.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(M.Component),p=M.createContext(null);function f(xe){var Ae=xe.children,Te=xe.onBatchResize,Ce=M.useRef(0),pe=M.useRef([]),de=M.useContext(p),re=M.useCallback(function(ce,ae,we){Ce.current+=1;var De=Ce.current;pe.current.push({size:ce,element:ae,data:we}),Promise.resolve().then(function(){De===Ce.current&&(Te==null||Te(pe.current),pe.current=[])}),de==null||de(ce,ae,we)},[Te,de]);return M.createElement(p.Provider,{value:re},Ae)}function D(xe){var Ae=xe.children,Te=xe.disabled,Ce=M.useRef(null),pe=M.useRef(null),de=M.useContext(p),re=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ce=M.isValidElement(Ae)&&Object(y.c)(Ae),ae=ce?Ae.ref:null,we=M.useMemo(function(){return Object(y.a)(ae,Ce)},[ae,Ce]),De=M.useRef(xe);De.current=xe;var ye=M.useCallback(function(Me){var Pe=De.current,Ne=Pe.onResize,Fe=Pe.data,Be=Me.getBoundingClientRect(),Ue=Be.width,nt=Be.height,it=Me.offsetWidth,$e=Me.offsetHeight,tt=Math.floor(Ue),ct=Math.floor(nt);if(re.current.width!==tt||re.current.height!==ct||re.current.offsetWidth!==it||re.current.offsetHeight!==$e){var et={width:tt,height:ct,offsetWidth:it,offsetHeight:$e};re.current=et;var ot=it===Math.round(Ue)?Ue:it,Oe=$e===Math.round(nt)?nt:$e,ht=Object(G.a)(Object(G.a)({},et),{},{offsetWidth:ot,offsetHeight:Oe});de==null||de(ht,Me,Fe),Ne&&Promise.resolve().then(function(){Ne(ht,Me)})}},[]);return M.useEffect(function(){var Me=Object(C.a)(Ce.current)||Object(C.a)(pe.current);return Me&&!Te&&u(Me,ye),function(){return h(Me,ye)}},[Ce.current,Te]),M.createElement(T,{ref:pe},ce?M.cloneElement(Ae,{ref:we}):Ae)}var v="rc-observer-key";function m(xe){var Ae=xe.children,Te=Object(P.a)(Ae);return Te.map(function(Ce,pe){var de=(Ce==null?void 0:Ce.key)||"".concat(v,"-").concat(pe);return M.createElement(D,Object(le.a)({},xe,{key:de}),Ce)})}m.Collection=f;var a=m,d=Z("bT9E"),o=Z("TSYQ"),E=Z.n(o),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
|
|
`,x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},U;function K(xe){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ae&&N[Te])return N[Te];var Ce=window.getComputedStyle(xe),pe=Ce.getPropertyValue("box-sizing")||Ce.getPropertyValue("-moz-box-sizing")||Ce.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Ce.getPropertyValue("padding-bottom"))+parseFloat(Ce.getPropertyValue("padding-top")),re=parseFloat(Ce.getPropertyValue("border-bottom-width"))+parseFloat(Ce.getPropertyValue("border-top-width")),ce=x.map(function(we){return"".concat(we,":").concat(Ce.getPropertyValue(we))}).join(";"),ae={sizingStyle:ce,paddingSize:de,borderSize:re,boxSizing:pe};return Ae&&Te&&(N[Te]=ae),ae}function V(xe){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ce=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),xe.getAttribute("wrap")?U.setAttribute("wrap",xe.getAttribute("wrap")):U.removeAttribute("wrap");var pe=K(xe,Ae),de=pe.paddingSize,re=pe.borderSize,ce=pe.boxSizing,ae=pe.sizingStyle;U.setAttribute("style","".concat(ae,";").concat(b)),U.value=xe.value||xe.placeholder||"";var we=Number.MIN_SAFE_INTEGER,De=Number.MAX_SAFE_INTEGER,ye=U.scrollHeight,Me;if(ce==="border-box"?ye+=re:ce==="content-box"&&(ye-=de),Te!==null||Ce!==null){U.value=" ";var Pe=U.scrollHeight-de;Te!==null&&(we=Pe*Te,ce==="border-box"&&(we=we+de+re),ye=Math.max(we,ye)),Ce!==null&&(De=Pe*Ce,ce==="border-box"&&(De=De+de+re),Me=ye>De?"":"hidden",ye=Math.min(De,ye))}return{height:ye,minHeight:we,maxHeight:De,overflowY:Me,resize:"none"}}var _=Z("Gytx"),I=Z.n(_),Y;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(xe){Object(J.a)(Te,xe);var Ae=Object(B.a)(Te);function Te(Ce){var pe;return Object(q.a)(this,Te),pe=Ae.call(this,Ce),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(de){pe.textArea=de},pe.handleResize=function(de){var re=pe.state.resizeStatus,ce=pe.props,ae=ce.autoSize,we=ce.onResize;if(re!==Y.NONE)return;typeof we=="function"&&we(de),ae&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var de=pe.props.autoSize;if(!de||!pe.textArea)return;var re=de.minRows,ce=de.maxRows,ae=V(pe.textArea,!1,re,ce);pe.setState({textareaStyles:ae,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var de=pe.props,re=de.prefixCls,ce=re===void 0?"rc-textarea":re,ae=de.autoSize,we=de.onResize,De=de.className,ye=de.disabled,Me=pe.state,Pe=Me.textareaStyles,Ne=Me.resizeStatus,Fe=Object(d.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=E()(ce,De,Object(F.a)({},"".concat(ce,"-disabled"),ye));"value"in Fe&&(Fe.value=Fe.value||"");var Ue=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),Pe),Ne===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(a,{onResize:pe.handleResize,disabled:!(ae||we)},M.createElement("textarea",Object(le.a)({},Fe,{className:Be,style:Ue,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:Y.NONE},pe}return Object(L.a)(Te,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!I()(pe.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 pe=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,de)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(M.Component),oe=ee,he=function(xe){Object(J.a)(Te,xe);var Ae=Object(B.a)(Te);function Te(Ce){var pe;Object(q.a)(this,Te),pe=Ae.call(this,Ce),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(re){pe.resizableTextArea=re},pe.handleChange=function(re){var ce=pe.props.onChange;pe.setValue(re.target.value,function(){pe.resizableTextArea.resizeTextarea()}),ce&&ce(re)},pe.handleKeyDown=function(re){var ce=pe.props,ae=ce.onPressEnter,we=ce.onKeyDown;re.keyCode===13&&ae&&ae(re),we&&we(re)};var de=typeof Ce.value=="undefined"||Ce.value===null?Ce.defaultValue:Ce.value;return pe.state={value:de},pe}return Object(L.a)(Te,[{key:"setValue",value:function(pe,de){"value"in this.props||this.setState({value:pe},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(le.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Te}(M.Component),Le=Ie.default=he},ZW9T:function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return T});var le=Z("k1fw"),q=Z("miYZ"),L=Z("tsqr"),J=Z("rAM+"),B=Z("tJVT"),M=Z("PpiC"),G=Z("q1tI"),F=Z.n(G),P=Z("bdgK");function k(p,f,D,v,m){var a=f.getWordUntilPosition(D),d={startLineNumber:D.lineNumber,endLineNumber:D.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},o=v.map(function(E){return{label:E,kind:p.languages.CompletionItemKind.Keyword,insertText:E,insertTextRules:p.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:d}});return m.map(function(E){o.push(Object(le.a)(Object(le.a)({},E),{},{range:d}))}),o}var y=function(p){var f={label:"ifelse",kind:p.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:p.languages.CompletionItemInsertTextRule.InsertAsSnippet},D=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];p.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(d,o){var E=k(p,d,o,D,[f]);return{suggestions:E}}});var v=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];p.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(d,o){var E=[{label:"print",kind:p.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:p.languages.CompletionItemInsertTextRule.InsertAsSnippet}],b=k(p,d,o,v,E);return{suggestions:b}}});var m=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];p.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(d,o){var E=[f,{label:"main",kind:p.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:p.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:p.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:p.languages.CompletionItemInsertTextRule.InsertAsSnippet}],b=k(p,d,o,m,E);return{suggestions:b}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",O=Z("LvDl");function R(p){return/^\d+$/.test(p)?"".concat(p,"px"):p}function A(){}var S=!1,c={"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 s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=p;if(Array.isArray(p)){for(var D=0;D<p.length;D++){var v=c[p[D]];if(v)return v}return f[0]}return c[f]||f}var u=null,h=Ie.b=function(p){var f=p.width,D=f===void 0?"100%":f,v=p.height,m=v===void 0?"100%":v,a=p.value,d=p.language,o=d===void 0?"javascript":d,E=p.style,b=E===void 0?{}:E,x=p.options,N=x===void 0?{}:x,U=p.overrideServices,K=U===void 0?{}:U,V=p.theme,_=V===void 0?"vs-dark":V,I=p.onEditBlur,Y=p.onSave,ee=p.autoHeight,oe=ee===void 0?!1:ee,he=p.forbidCopy,Le=he===void 0?!1:he,xe=p.onChange,Ae=xe===void 0?A:xe,Te=p.editorDidMount,Ce=Te===void 0?A:Te,pe=p.onFocus,de=pe===void 0?A:pe,re=p.filename,ce=re===void 0?"educoder.txt":re,ae=Object(M.a)(p,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),we=Object(G.useRef)(),De=Object(G.useRef)({}),ye=Object(G.useRef)(),Me=Object(G.useRef)(!1),Pe=Object(G.useRef)(),Ne=Object(G.useState)(!1),Fe=Object(B.a)(Ne,2),Be=Fe[0],Ue=Fe[1];function nt(){var se;return we.current&&(se=new P.default(function(ue){var ke=Object(J.a)(ue),Se;try{for(ke.s();!(Se=ke.n()).done;){var Ve=Se.value;(Ve.target.offsetHeight>0||Ve.target.offsetWidth>0)&&De.current.instance.layout()}}catch(at){ke.e(at)}finally{ke.f()}}),se.observe(we.current)),se}function it(){L.b.warn(decodeURIComponent(C))}var $e=function(){var ue=De.current.instance;if(a!=null&&ue&&Be){var ke=ue.getModel();ke&&a!==ke.getValue()&&(S=!0,ke.setValue(a),ue.layout(),S=!1)}};Object(G.useEffect)(function(){ye.current&&clearTimeout(ye.current),ye.current=setTimeout(function(){$e()},500)},[a,Be,De.current]);function tt(){var se=De.current.instance;if(se){var ue=se.getSelection(),ke=De.current.pastePos||{},Se=new u.Range(ke.startLineNumber||ue.endLineNumber,ke.startColumn||ue.endColumn,ke.endLineNumber||ue.endLineNumber,ke.endColumn||ue.endColumn);setTimeout(function(){se.executeEdits("",[{range:Se,text:""}])},300)}}function ct(se){(window.navigator.platform.match("Mac")?se.metaKey:se.ctrlKey)&&se.keyCode==83&&(se.preventDefault(),Y())}var et=function(){if(oe&&De.current.instance){var ue=De.current.instance.getContentHeight();ne(ue<m?m:ue)}else ne(m)};function ot(se){var ue=document.createEvent("MouseEvents");ue.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),se.dispatchEvent(ue)}function Oe(se,ue){var ke=window.URL||window.webkitURL||window,Se=new Blob([ue]),Ve=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ve.href=ke.createObjectURL(Se),Ve.download=se,ot(Ve)}Object(G.useEffect)(function(){et()},[et]),Object(G.useEffect)(function(){we.current&&!Be&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(se){try{u=se,De.current.instance=u.editor.create(we.current,{value:a,language:s(o),theme:_,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},K);var ue=De.current.instance;if(Ce(ue,u),setTimeout(function(){et(),De.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Oe(ce||"educoder.txt",ue.getValue())}})},500),De.current.subscription=ue.onDidChangeModelContent(function(Se){Me.current?clearTimeout(Pe.current):(et(),Ae(ue.getValue(),Se)),Pe.current=setTimeout(function(){Me.current=!1},500)}),window.Monaco||y(u),Le&&(ue.addCommand(u.KeyMod.CtrlCmd|u.KeyMod.Shift|u.KeyCode.KEY_V,function(){return it(),null}),ue.addCommand(u.KeyMod.CtrlCmd|u.KeyCode.KEY_C,function(){return it(),null})),window.Monaco=u,I&&ue.onDidBlurEditorWidget(function(){I(ue.getValue())}),de&&ue.onDidFocusEditorText(function(){de(ue.getValue())}),Le){ue.addCommand(u.KeyMod.CtrlCmd|u.KeyCode.KEY_V,function(){return it(),null}),ue.onDidPaste(function(Se){De.current.pastePos=Se});try{window.addEventListener("paste",tt)}catch(Se){}}var ke=nt();return Ue(!0),function(){var Se=De.current.instance;Se.dispose();var Ve=Se.getModel();Ve&&Ve.dispose(),De.current.subscription&&De.current.subscription.dispose(),Le&&window.removeEventListener("paste",tt),ke.unobserve(we.current)}}catch(Se){}})},[]),Object(G.useEffect)(function(){var se=De.current.instance;if(se&&Be)return document.addEventListener("keydown",ct,!1),function(){document.removeEventListener("keydown",ct)}},[Y,Be]),Object(G.useEffect)(function(){var se=De.current.instance;if(se&&Be){var ue=s(o);u.editor.setModelLanguage(se.getModel(),ue),console.log("language:",o,se.getModel(),ue)}},[o,Be]),Object(G.useEffect)(function(){var se=De.current.instance;se&&Be&&u.editor.setTheme(_)},[_,Be]),Object(G.useEffect)(function(){var se=De.current.instance;se&&Be&&(se.updateOptions(Object(le.a)({},N)),setTimeout(function(){se.getModel().updateOptions(Object(le.a)({},N))},200))},[JSON.stringify(N),Be]),Object(G.useEffect)(function(){var se=De.current.instance;se&&Be&&se.layout()},[D,m,Be]);var ht=Object(G.useState)(R(D)),st=Object(B.a)(ht,2),je=st[0],Ye=st[1],Ee=Object(G.useState)(R(m)),ge=Object(B.a)(Ee,2),be=ge[0],ne=ge[1],ie=Object(le.a)(Object(le.a)({},b),{},{width:je,height:be});return F.a.createElement("div",{className:"my-monaco-editor",ref:we,style:ie})};function T(p){var f=p.width,D=f===void 0?"100%":f,v=p.height,m=v===void 0?"100%":v,a=p.original,d=p.modified,o=p.language,E=p.options,b=E===void 0?{}:E,x=Object(G.useRef)(),N=Object(G.useState)(null),U=Object(B.a)(N,2),K=U[0],V=U[1];function _(oe){var he;return x.current&&(he=new P.default(function(Le){var xe=Object(J.a)(Le),Ae;try{for(xe.s();!(Ae=xe.n()).done;){var Te=Ae.value;(Te.target.offsetHeight>0||Te.target.offsetWidth>0)&&oe.layout()}}catch(Ce){xe.e(Ce)}finally{xe.f()}}),he.observe(x.current)),he}Object(G.useEffect)(function(){x.current&&Z.e(27).then(Z.t.bind(null,"M/lh",7)).then(function(oe){u=oe;var he=u.editor.createDiffEditor(x.current,Object(le.a)(Object(le.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},b),{},{wordWrap:!0}));V(he);var Le=_(he);return function(){he.dispose();var xe=he.getModel();xe&&xe.dispose(),Le.unobserve(x.current)}})},[]),Object(G.useEffect)(function(){K&&K.setModel({original:u.editor.createModel(a,o),modified:u.editor.createModel(d,o)})},[a,d,o,K]);var I=R(D),Y=R(m),ee={width:I,height:Y};return F.a.createElement("div",{className:"my-diff-editor",ref:x,style:ee})}},ZpRC:function(Ke,Ie,Z){"use strict";function le(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function q(y,C){return(!C||y!=="hidden")&&y!=="visible"&&y!=="clip"}function L(y,C){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var O=getComputedStyle(y,null);return q(O.overflowY,C)||q(O.overflowX,C)||function(R){var A=function(S){if(!S.ownerDocument||!S.ownerDocument.defaultView)return null;try{return S.ownerDocument.defaultView.frameElement}catch(c){return null}}(R);return!!A&&(A.clientHeight<R.scrollHeight||A.clientWidth<R.scrollWidth)}(y)}return!1}function J(y,C,O,R,A,S,c,s){return S<y&&c>C||S>y&&c<C?0:S<=y&&s<=O||c>=C&&s>=O?S-y-R:c>C&&s<O||S<y&&s>O?c-C+A:0}var B=function(y,C){var O=window,R=C.scrollMode,A=C.block,S=C.inline,c=C.boundary,s=C.skipOverflowHiddenElements,u=typeof c=="function"?c:function(Pe){return Pe!==c};if(!le(y))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,T=[],p=y;le(p)&&u(p);){if((p=p.parentElement)===h){T.push(p);break}p!=null&&p===document.body&&L(p)&&!L(document.documentElement)||p!=null&&L(p,s)&&T.push(p)}for(var f=O.visualViewport?O.visualViewport.width:innerWidth,D=O.visualViewport?O.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,a=y.getBoundingClientRect(),d=a.height,o=a.width,E=a.top,b=a.right,x=a.bottom,N=a.left,U=A==="start"||A==="nearest"?E:A==="end"?x:E+d/2,K=S==="center"?N+o/2:S==="end"?b:N,V=[],_=0;_<T.length;_++){var I=T[_],Y=I.getBoundingClientRect(),ee=Y.height,oe=Y.width,he=Y.top,Le=Y.right,xe=Y.bottom,Ae=Y.left;if(R==="if-needed"&&E>=0&&N>=0&&x<=D&&b<=f&&E>=he&&x<=xe&&N>=Ae&&b<=Le)return V;var Te=getComputedStyle(I),Ce=parseInt(Te.borderLeftWidth,10),pe=parseInt(Te.borderTopWidth,10),de=parseInt(Te.borderRightWidth,10),re=parseInt(Te.borderBottomWidth,10),ce=0,ae=0,we="offsetWidth"in I?I.offsetWidth-I.clientWidth-Ce-de:0,De="offsetHeight"in I?I.offsetHeight-I.clientHeight-pe-re:0;if(h===I)ce=A==="start"?U:A==="end"?U-D:A==="nearest"?J(m,m+D,D,pe,re,m+U,m+U+d,d):U-D/2,ae=S==="start"?K:S==="center"?K-f/2:S==="end"?K-f:J(v,v+f,f,Ce,de,v+K,v+K+o,o),ce=Math.max(0,ce+m),ae=Math.max(0,ae+v);else{ce=A==="start"?U-he-pe:A==="end"?U-xe+re+De:A==="nearest"?J(he,xe,ee,pe,re+De,U,U+d,d):U-(he+ee/2)+De/2,ae=S==="start"?K-Ae-Ce:S==="center"?K-(Ae+oe/2)+we/2:S==="end"?K-Le+de+we:J(Ae,Le,oe,Ce,de+we,K,K+o,o);var ye=I.scrollLeft,Me=I.scrollTop;U+=Me-(ce=Math.max(0,Math.min(Me+ce,I.scrollHeight-ee+De))),K+=ye-(ae=Math.max(0,Math.min(ye+ae,I.scrollWidth-oe+we)))}V.push({el:I,top:ce,left:ae})}return V};function M(y){return y===Object(y)&&Object.keys(y).length!==0}function G(y,C){C===void 0&&(C="auto");var O="scrollBehavior"in document.body.style;y.forEach(function(R){var A=R.el,S=R.top,c=R.left;A.scroll&&O?A.scroll({top:S,left:c,behavior:C}):(A.scrollTop=S,A.scrollLeft=c)})}function F(y){return y===!1?{block:"end",inline:"nearest"}:M(y)?y:{block:"start",inline:"nearest"}}function P(y,C){var O=!y.ownerDocument.documentElement.contains(y);if(M(C)&&typeof C.behavior=="function")return C.behavior(O?[]:B(y,C));if(O)return;var R=F(C);return G(B(y,R),R.behavior)}var k=Ie.a=P},Zss7:function(Ke,Ie,Z){var le;(function(q){var L=/^\s+/,J=/\s+$/,B=0,M=q.round,G=q.min,F=q.max,P=q.random;function k(re,ce){if(re=re||"",ce=ce||{},re instanceof k)return re;if(!(this instanceof k))return new k(re,ce);var ae=y(re);this._originalInput=re,this._r=ae.r,this._g=ae.g,this._b=ae.b,this._a=ae.a,this._roundA=M(100*this._a)/100,this._format=ce.format||ae.format,this._gradientType=ce.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=ae.ok,this._tc_id=B++}k.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),ce,ae,we,De,ye,Me;return ce=re.r/255,ae=re.g/255,we=re.b/255,ce<=.03928?De=ce/12.92:De=q.pow((ce+.055)/1.055,2.4),ae<=.03928?ye=ae/12.92:ye=q.pow((ae+.055)/1.055,2.4),we<=.03928?Me=we/12.92:Me=q.pow((we+.055)/1.055,2.4),.2126*De+.7152*ye+.0722*Me},setAlpha:function(re){return this._a=V(re),this._roundA=M(100*this._a)/100,this},toHsv:function(){var re=A(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=A(this._r,this._g,this._b),ce=M(re.h*360),ae=M(re.s*100),we=M(re.v*100);return this._a==1?"hsv("+ce+", "+ae+"%, "+we+"%)":"hsva("+ce+", "+ae+"%, "+we+"%, "+this._roundA+")"},toHsl:function(){var re=O(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=O(this._r,this._g,this._b),ce=M(re.h*360),ae=M(re.s*100),we=M(re.l*100);return this._a==1?"hsl("+ce+", "+ae+"%, "+we+"%)":"hsla("+ce+", "+ae+"%, "+we+"%, "+this._roundA+")"},toHex:function(re){return c(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return s(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(_(this._r,255)*100)+"%",g:M(_(this._g,255)*100)+"%",b:M(_(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(_(this._r,255)*100)+"%, "+M(_(this._g,255)*100)+"%, "+M(_(this._b,255)*100)+"%)":"rgba("+M(_(this._r,255)*100)+"%, "+M(_(this._g,255)*100)+"%, "+M(_(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[c(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var ce="#"+u(this._r,this._g,this._b,this._a),ae=ce,we=this._gradientType?"GradientType = 1, ":"";if(re){var De=k(re);ae="#"+u(De._r,De._g,De._b,De._a)}return"progid:DXImageTransform.Microsoft.gradient("+we+"startColorstr="+ce+",endColorstr="+ae+")"},toString:function(re){var ce=!!re;re=re||this._format;var ae=!1,we=this._a<1&&this._a>=0,De=!ce&&we&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return De?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(ae=this.toRgbString()),re==="prgb"&&(ae=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(ae=this.toHexString()),re==="hex3"&&(ae=this.toHexString(!0)),re==="hex4"&&(ae=this.toHex8String(!0)),re==="hex8"&&(ae=this.toHex8String()),re==="name"&&(ae=this.toName()),re==="hsl"&&(ae=this.toHslString()),re==="hsv"&&(ae=this.toHsvString()),ae||this.toHexString())},clone:function(){return k(this.toString())},_applyModification:function(re,ce){var ae=re.apply(null,[this].concat([].slice.call(ce)));return this._r=ae._r,this._g=ae._g,this._b=ae._b,this.setAlpha(ae._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(T,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(re,ce){return re.apply(null,[this].concat([].slice.call(ce)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(a,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(d,arguments)},tetrad:function(){return this._applyCombination(o,arguments)}},k.fromRatio=function(re,ce){if(typeof re=="object"){var ae={};for(var we in re)re.hasOwnProperty(we)&&(we==="a"?ae[we]=re[we]:ae[we]=Le(re[we]));re=ae}return k(re,ce)};function y(re){var ce={r:0,g:0,b:0},ae=1,we=null,De=null,ye=null,Me=!1,Pe=!1;return typeof re=="string"&&(re=pe(re)),typeof re=="object"&&(Ce(re.r)&&Ce(re.g)&&Ce(re.b)?(ce=C(re.r,re.g,re.b),Me=!0,Pe=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Ce(re.h)&&Ce(re.s)&&Ce(re.v)?(we=Le(re.s),De=Le(re.v),ce=S(re.h,we,De),Me=!0,Pe="hsv"):Ce(re.h)&&Ce(re.s)&&Ce(re.l)&&(we=Le(re.s),ye=Le(re.l),ce=R(re.h,we,ye),Me=!0,Pe="hsl"),re.hasOwnProperty("a")&&(ae=re.a)),ae=V(ae),{ok:Me,format:re.format||Pe,r:G(255,F(ce.r,0)),g:G(255,F(ce.g,0)),b:G(255,F(ce.b,0)),a:ae}}function C(re,ce,ae){return{r:_(re,255)*255,g:_(ce,255)*255,b:_(ae,255)*255}}function O(re,ce,ae){re=_(re,255),ce=_(ce,255),ae=_(ae,255);var we=F(re,ce,ae),De=G(re,ce,ae),ye,Me,Pe=(we+De)/2;if(we==De)ye=Me=0;else{var Ne=we-De;Me=Pe>.5?Ne/(2-we-De):Ne/(we+De);switch(we){case re:ye=(ce-ae)/Ne+(ce<ae?6:0);break;case ce:ye=(ae-re)/Ne+2;break;case ae:ye=(re-ce)/Ne+4;break}ye/=6}return{h:ye,s:Me,l:Pe}}function R(re,ce,ae){var we,De,ye;re=_(re,360),ce=_(ce,100),ae=_(ae,100);function Me(Fe,Be,Ue){return Ue<0&&(Ue+=1),Ue>1&&(Ue-=1),Ue<1/6?Fe+(Be-Fe)*6*Ue:Ue<1/2?Be:Ue<2/3?Fe+(Be-Fe)*(2/3-Ue)*6:Fe}if(ce===0)we=De=ye=ae;else{var Pe=ae<.5?ae*(1+ce):ae+ce-ae*ce,Ne=2*ae-Pe;we=Me(Ne,Pe,re+1/3),De=Me(Ne,Pe,re),ye=Me(Ne,Pe,re-1/3)}return{r:we*255,g:De*255,b:ye*255}}function A(re,ce,ae){re=_(re,255),ce=_(ce,255),ae=_(ae,255);var we=F(re,ce,ae),De=G(re,ce,ae),ye,Me,Pe=we,Ne=we-De;if(Me=we===0?0:Ne/we,we==De)ye=0;else{switch(we){case re:ye=(ce-ae)/Ne+(ce<ae?6:0);break;case ce:ye=(ae-re)/Ne+2;break;case ae:ye=(re-ce)/Ne+4;break}ye/=6}return{h:ye,s:Me,v:Pe}}function S(re,ce,ae){re=_(re,360)*6,ce=_(ce,100),ae=_(ae,100);var we=q.floor(re),De=re-we,ye=ae*(1-ce),Me=ae*(1-De*ce),Pe=ae*(1-(1-De)*ce),Ne=we%6,Fe=[ae,Me,ye,ye,Pe,ae][Ne],Be=[Pe,ae,ae,Me,ye,ye][Ne],Ue=[ye,ye,Pe,ae,ae,Me][Ne];return{r:Fe*255,g:Be*255,b:Ue*255}}function c(re,ce,ae,we){var De=[he(M(re).toString(16)),he(M(ce).toString(16)),he(M(ae).toString(16))];return we&&De[0].charAt(0)==De[0].charAt(1)&&De[1].charAt(0)==De[1].charAt(1)&&De[2].charAt(0)==De[2].charAt(1)?De[0].charAt(0)+De[1].charAt(0)+De[2].charAt(0):De.join("")}function s(re,ce,ae,we,De){var ye=[he(M(re).toString(16)),he(M(ce).toString(16)),he(M(ae).toString(16)),he(xe(we))];return De&&ye[0].charAt(0)==ye[0].charAt(1)&&ye[1].charAt(0)==ye[1].charAt(1)&&ye[2].charAt(0)==ye[2].charAt(1)&&ye[3].charAt(0)==ye[3].charAt(1)?ye[0].charAt(0)+ye[1].charAt(0)+ye[2].charAt(0)+ye[3].charAt(0):ye.join("")}function u(re,ce,ae,we){var De=[he(xe(we)),he(M(re).toString(16)),he(M(ce).toString(16)),he(M(ae).toString(16))];return De.join("")}k.equals=function(re,ce){return!re||!ce?!1:k(re).toRgbString()==k(ce).toRgbString()},k.random=function(){return k.fromRatio({r:P(),g:P(),b:P()})};function h(re,ce){ce=ce===0?0:ce||10;var ae=k(re).toHsl();return ae.s-=ce/100,ae.s=I(ae.s),k(ae)}function T(re,ce){ce=ce===0?0:ce||10;var ae=k(re).toHsl();return ae.s+=ce/100,ae.s=I(ae.s),k(ae)}function p(re){return k(re).desaturate(100)}function f(re,ce){ce=ce===0?0:ce||10;var ae=k(re).toHsl();return ae.l+=ce/100,ae.l=I(ae.l),k(ae)}function D(re,ce){ce=ce===0?0:ce||10;var ae=k(re).toRgb();return ae.r=F(0,G(255,ae.r-M(255*-(ce/100)))),ae.g=F(0,G(255,ae.g-M(255*-(ce/100)))),ae.b=F(0,G(255,ae.b-M(255*-(ce/100)))),k(ae)}function v(re,ce){ce=ce===0?0:ce||10;var ae=k(re).toHsl();return ae.l-=ce/100,ae.l=I(ae.l),k(ae)}function m(re,ce){var ae=k(re).toHsl(),we=(ae.h+ce)%360;return ae.h=we<0?360+we:we,k(ae)}function a(re){var ce=k(re).toHsl();return ce.h=(ce.h+180)%360,k(ce)}function d(re){var ce=k(re).toHsl(),ae=ce.h;return[k(re),k({h:(ae+120)%360,s:ce.s,l:ce.l}),k({h:(ae+240)%360,s:ce.s,l:ce.l})]}function o(re){var ce=k(re).toHsl(),ae=ce.h;return[k(re),k({h:(ae+90)%360,s:ce.s,l:ce.l}),k({h:(ae+180)%360,s:ce.s,l:ce.l}),k({h:(ae+270)%360,s:ce.s,l:ce.l})]}function E(re){var ce=k(re).toHsl(),ae=ce.h;return[k(re),k({h:(ae+72)%360,s:ce.s,l:ce.l}),k({h:(ae+216)%360,s:ce.s,l:ce.l})]}function b(re,ce,ae){ce=ce||6,ae=ae||30;var we=k(re).toHsl(),De=360/ae,ye=[k(re)];for(we.h=(we.h-(De*ce>>1)+720)%360;--ce;)we.h=(we.h+De)%360,ye.push(k(we));return ye}function x(re,ce){ce=ce||6;for(var ae=k(re).toHsv(),we=ae.h,De=ae.s,ye=ae.v,Me=[],Pe=1/ce;ce--;)Me.push(k({h:we,s:De,v:ye})),ye=(ye+Pe)%1;return Me}k.mix=function(re,ce,ae){ae=ae===0?0:ae||50;var we=k(re).toRgb(),De=k(ce).toRgb(),ye=ae/100,Me={r:(De.r-we.r)*ye+we.r,g:(De.g-we.g)*ye+we.g,b:(De.b-we.b)*ye+we.b,a:(De.a-we.a)*ye+we.a};return k(Me)},k.readability=function(re,ce){var ae=k(re),we=k(ce);return(q.max(ae.getLuminance(),we.getLuminance())+.05)/(q.min(ae.getLuminance(),we.getLuminance())+.05)},k.isReadable=function(re,ce,ae){var we=k.readability(re,ce),De,ye;ye=!1,De=de(ae);switch(De.level+De.size){case"AAsmall":case"AAAlarge":ye=we>=4.5;break;case"AAlarge":ye=we>=3;break;case"AAAsmall":ye=we>=7;break}return ye},k.mostReadable=function(re,ce,ae){var we=null,De=0,ye,Me,Pe,Ne;ae=ae||{},Me=ae.includeFallbackColors,Pe=ae.level,Ne=ae.size;for(var Fe=0;Fe<ce.length;Fe++)ye=k.readability(re,ce[Fe]),ye>De&&(De=ye,we=k(ce[Fe]));return k.isReadable(re,we,{level:Pe,size:Ne})||!Me?we:(ae.includeFallbackColors=!1,k.mostReadable(re,["#fff","#000"],ae))};var N=k.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"},U=k.hexNames=K(N);function K(re){var ce={};for(var ae in re)re.hasOwnProperty(ae)&&(ce[re[ae]]=ae);return ce}function V(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function _(re,ce){ee(re)&&(re="100%");var ae=oe(re);return re=G(ce,F(0,parseFloat(re))),ae&&(re=parseInt(re*ce,10)/100),q.abs(re-ce)<1e-6?1:re%ce/parseFloat(ce)}function I(re){return G(1,F(0,re))}function Y(re){return parseInt(re,16)}function ee(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function oe(re){return typeof re=="string"&&re.indexOf("%")!=-1}function he(re){return re.length==1?"0"+re:""+re}function Le(re){return re<=1&&(re=re*100+"%"),re}function xe(re){return q.round(parseFloat(re)*255).toString(16)}function Ae(re){return Y(re)/255}var Te=function(){var re="[-\\+]?\\d+%?",ce="[-\\+]?\\d*\\.\\d+%?",ae="(?:"+ce+")|(?:"+re+")",we="[\\s|\\(]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")\\s*\\)?",De="[\\s|\\(]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")\\s*\\)?";return{CSS_UNIT:new RegExp(ae),rgb:new RegExp("rgb"+we),rgba:new RegExp("rgba"+De),hsl:new RegExp("hsl"+we),hsla:new RegExp("hsla"+De),hsv:new RegExp("hsv"+we),hsva:new RegExp("hsva"+De),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 Ce(re){return!!Te.CSS_UNIT.exec(re)}function pe(re){re=re.replace(L,"").replace(J,"").toLowerCase();var ce=!1;if(N[re])re=N[re],ce=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ae;return(ae=Te.rgb.exec(re))?{r:ae[1],g:ae[2],b:ae[3]}:(ae=Te.rgba.exec(re))?{r:ae[1],g:ae[2],b:ae[3],a:ae[4]}:(ae=Te.hsl.exec(re))?{h:ae[1],s:ae[2],l:ae[3]}:(ae=Te.hsla.exec(re))?{h:ae[1],s:ae[2],l:ae[3],a:ae[4]}:(ae=Te.hsv.exec(re))?{h:ae[1],s:ae[2],v:ae[3]}:(ae=Te.hsva.exec(re))?{h:ae[1],s:ae[2],v:ae[3],a:ae[4]}:(ae=Te.hex8.exec(re))?{r:Y(ae[1]),g:Y(ae[2]),b:Y(ae[3]),a:Ae(ae[4]),format:ce?"name":"hex8"}:(ae=Te.hex6.exec(re))?{r:Y(ae[1]),g:Y(ae[2]),b:Y(ae[3]),format:ce?"name":"hex"}:(ae=Te.hex4.exec(re))?{r:Y(ae[1]+""+ae[1]),g:Y(ae[2]+""+ae[2]),b:Y(ae[3]+""+ae[3]),a:Ae(ae[4]+""+ae[4]),format:ce?"name":"hex8"}:(ae=Te.hex3.exec(re))?{r:Y(ae[1]+""+ae[1]),g:Y(ae[2]+""+ae[2]),b:Y(ae[3]+""+ae[3]),format:ce?"name":"hex"}:!1}function de(re){var ce,ae;return re=re||{level:"AA",size:"small"},ce=(re.level||"AA").toUpperCase(),ae=(re.size||"small").toLowerCase(),ce!=="AA"&&ce!=="AAA"&&(ce="AA"),ae!=="small"&&ae!=="large"&&(ae="small"),{level:ce,size:ae}}Ke.exports?Ke.exports=k:!(le=function(){return k}.call(Ie,Z,Ie,Ke),le!==void 0&&(Ke.exports=le))})(Math)},bT9E:function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return q});var le=Z("VTBJ");function q(L,J){var B=Object(le.a)({},L);return Array.isArray(J)&&J.forEach(function(M){delete B[M]}),B}},c5Ni:function(Ke,Ie,Z){},cRFk:function(Ke,Ie,Z){Ke.exports=Z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ke,Ie,Z){Ke.exports=Z.p+"static/choose.4ad1045f.svg"},dejd:function(Ke,Ie,Z){},djh8:function(Ke,Ie,Z){Ke.exports=Z.p+"static/qrCode.42927872.png"},dmUQ:function(Ke,Ie,Z){"use strict";var le=Z("Ff2n"),q=Z("rePB"),L=Z("1OyB"),J=Z("vuIU"),B=Z("Ji7U"),M=Z("md7G"),G=Z("foSv"),F=Z("q1tI"),P=Z.n(F),k=Z("TSYQ"),y=Z.n(k),C=Z("4IlW");function O(d,o){var E=Object.keys(d);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(d);o&&(b=b.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),E.push.apply(E,b)}return E}function R(d){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?O(Object(E),!0).forEach(function(b){Object(q.a)(d,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(E)):O(Object(E)).forEach(function(b){Object.defineProperty(d,b,Object.getOwnPropertyDescriptor(E,b))})}return d}function A(d){var o=S();return function(){var b=Object(G.a)(d),x;if(o){var N=Object(G.a)(this).constructor;x=Reflect.construct(b,arguments,N)}else x=b.apply(this,arguments);return Object(M.a)(this,x)}}function S(){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(d){return!1}}function c(){}function s(d){d.preventDefault()}var u=function(o){return o.replace(/[^\w.-]+/g,"")},h=200,T=600,p=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,f=function(o){return o!=null},D=function(o,E){return E===o||typeof E=="number"&&typeof o=="number"&&isNaN(E)&&isNaN(o)},v=function(d){Object(B.a)(E,d);var o=A(E);function E(b){var x;Object(L.a)(this,E),x=o.call(this,b),x.onKeyDown=function(K){var V=x.props,_=V.onKeyDown,I=V.onPressEnter;if(K.keyCode===C.a.UP){var Y=x.getRatio(K);x.up(K,Y,null),x.stop()}else if(K.keyCode===C.a.DOWN){var ee=x.getRatio(K);x.down(K,ee,null),x.stop()}else K.keyCode===C.a.ENTER&&I&&I(K);if(x.recordCursorPosition(),x.lastKeyCode=K.keyCode,_){for(var oe=arguments.length,he=new Array(oe>1?oe-1:0),Le=1;Le<oe;Le++)he[Le-1]=arguments[Le];_.apply(void 0,[K].concat(he))}},x.onKeyUp=function(K){var V=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),V){for(var _=arguments.length,I=new Array(_>1?_-1:0),Y=1;Y<_;Y++)I[Y-1]=arguments[Y];V.apply(void 0,[K].concat(I))}},x.onChange=function(K){var V=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(K)),x.setState({inputValue:x.rawInput}),V(x.toNumber(x.rawInput))},x.onMouseUp=function(){var K=x.props.onMouseUp;x.recordCursorPosition(),K&&K.apply(void 0,arguments)},x.onFocus=function(){var K;x.setState({focused:!0}),(K=x.props).onFocus.apply(K,arguments)},x.onBlur=function(){var K=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var V=x.getCurrentValidValue(x.state.inputValue),_=x.setValue(V,c);if(K){var I=x.input.value,Y=x.getInputDisplayValue({focus:!1,value:_});x.input.value=Y&&Number(Y),K.apply(void 0,arguments),x.input.value=I}},x.getRatio=function(K){var V=1;return K.metaKey||K.ctrlKey?V=.1:K.shiftKey&&(V=10),V},x.getFullNum=function(K){return isNaN(K)?K:/e/i.test(String(K))?Number(K).toFixed(18).replace(/\.?0+$/,""):K},x.getPrecision=function(K){if(f(x.props.precision))return x.props.precision;var V=String(K);if(V.indexOf("e-")>=0)return parseInt(V.slice(V.indexOf("e-")+2),10);var _=0;return V.indexOf(".")>=0&&(_=V.length-V.indexOf(".")-1),_},x.getInputDisplayValue=function(K){var V=K||x.state,_=V.focused,I=V.inputValue,Y=V.value,ee;_?ee=I:ee=x.toPrecisionAsStep(Y),ee==null&&(ee="");var oe=x.formatWrapper(ee);return f(x.props.decimalSeparator)&&(oe=oe.toString().replace(".",x.props.decimalSeparator)),oe},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(K){}},x.restoreByAfter=function(K){if(K===void 0)return!1;var V=x.input.value,_=V.lastIndexOf(K);if(_===-1)return!1;var I=x.cursorBefore.length;return x.lastKeyCode===C.a.DELETE&&x.cursorBefore.charAt(I-1)===K[0]?(x.fixCaret(I,I),!0):_+K.length===V.length?(x.fixCaret(_,_),!0):!1},x.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(V,_){var I=K.substring(_);return x.restoreByAfter(I)})},x.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(K,V,_){x.pressingUpOrDown=!0,x.step("down",K,V,_)},x.up=function(K,V,_){x.pressingUpOrDown=!0,x.step("up",K,V,_)},x.saveInput=function(K){x.input=K};var N=b.value;N===void 0&&(N=b.defaultValue),x.state={focused:b.autoFocus};var U=x.getValidValue(x.toNumber(N));return x.state=R(R({},x.state),{},{inputValue:x.toPrecisionAsStep(U),value:U}),x}return Object(J.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var N=this.props,U=N.value,K=N.onChange,V=N.max,_=N.min,I=this.state.focused;if(x){if(!D(x.value,U)||!D(x.max,V)||!D(x.min,_)){var Y=I?U:this.getValidValue(U),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var oe="value"in this.props?U:this.state.value;"max"in this.props&&x.max!==V&&typeof oe=="number"&&oe>V&&K&&K(V),"min"in this.props&&x.min!==_&&typeof oe=="number"&&oe<_&&K&&K(_)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var he=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===C.a.BACKSPACE?he=this.cursorStart-1:this.lastKeyCode===C.a.DELETE&&(he=this.cursorStart):he=this.input.value.length,this.fixCaret(he,he)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Le){}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(x){var N=x;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(x){var N=x.target.value.trim().replace(/。/g,".");return f(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(x);return isNaN(K)?x:(K<N&&(K=N),K>U&&(K=U),K)}},{key:"setValue",value:function(x,N){var U=this.props.precision,K=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),V=this.state.value,_=V===void 0?null:V,I=this.state.inputValue,Y=I===void 0?null:I,ee=typeof K=="number"?K.toFixed(U):"".concat(K),oe=K!==_||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},N)):this.setState({value:K,inputValue:this.toPrecisionAsStep(x)},N),oe&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,K=U.precision,V=U.step;if(f(K))return K;var _=this.getPrecision(N),I=this.getPrecision(V),Y=this.getPrecision(x);return x?Math.max(Y,_+I):_+I}},{key:"getPrecisionFactor",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(x,N);return Math.pow(10,U)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var N=Math.abs(this.getMaxPrecision(x));return isNaN(N)?x.toString():Number(x).toFixed(N)}},{key:"toNumber",value:function(x){var N=this.props.precision,U=this.state.focused,K=x&&x.length>16&&U;return this.isNotCompleteNumber(x)||K?x:f(N)?Math.round(x*Math.pow(10,N))/Math.pow(10,N):Number(x)}},{key:"upStep",value:function(x,N){var U=this.props.step,K=this.getPrecisionFactor(x,N),V=Math.abs(this.getMaxPrecision(x,N)),_=((K*x+K*U*N)/K).toFixed(V);return this.toNumber(_)}},{key:"downStep",value:function(x,N){var U=this.props.step,K=this.getPrecisionFactor(x,N),V=Math.abs(this.getMaxPrecision(x,N)),_=((K*x-K*U*N)/K).toFixed(V);return this.toNumber(_)}},{key:"step",value:function(x,N){var U=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var _=this.props;if(_.disabled)return;var I=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(I))return;var Y=this["".concat(x,"Step")](I,K),ee=Y>_.max||Y<_.min;if(Y>_.max?Y=_.max:Y<_.min&&(Y=_.min),this.setValue(Y,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){U[x](N,K,!0)},V?h:T)}},{key:"fixCaret",value:function(x,N){if(x===void 0||N===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,K=this.input.selectionEnd;(x!==U||N!==K)&&this.input.setSelectionRange(x,N)}catch(V){}}},{key:"render",value:function(){var x,N=this.props,U=N.prefixCls,K=N.disabled,V=N.readOnly,_=N.useTouch,I=N.autoComplete,Y=N.upHandler,ee=N.downHandler,oe=N.className,he=N.max,Le=N.min,xe=N.style,Ae=N.title,Te=N.onMouseEnter,Ce=N.onMouseLeave,pe=N.onMouseOver,de=N.onMouseOut,re=N.required,ce=N.onClick,ae=N.tabIndex,we=N.type,De=N.placeholder,ye=N.id,Me=N.inputMode,Pe=N.pattern,Ne=N.step,Fe=N.maxLength,Be=N.autoFocus,Ue=N.name,nt=N.onPaste,it=N.onInput,$e=Object(le.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),tt=this.state,ct=tt.value,et=tt.focused,ot=y()(U,(x={},Object(q.a)(x,oe,!!oe),Object(q.a)(x,"".concat(U,"-disabled"),K),Object(q.a)(x,"".concat(U,"-focused"),et),x)),Oe={};Object.keys($e).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Oe[ue]=$e[ue])});var ht=!V&&!K,st=this.getInputDisplayValue(null),je=(ct||ct===0)&&(isNaN(ct)||Number(ct)>=he),Ye=(ct||ct===0)&&(isNaN(ct)||Number(ct)<=Le),Ee=je||K||V,ge=Ye||K||V,be=y()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(q.a)({},"".concat(U,"-handler-up-disabled"),Ee)),ne=y()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(q.a)({},"".concat(U,"-handler-down-disabled"),ge)),ie=_?{onTouchStart:Ee?c:this.up,onTouchEnd:this.stop}:{onMouseDown:Ee?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},se=_?{onTouchStart:ge?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:ot,style:xe,title:Ae,onMouseEnter:Te,onMouseLeave:Ce,onMouseOver:pe,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(U,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":Ee,className:be}),Y||P.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:s})),P.a.createElement("span",Object.assign({unselectable:"on"},se,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:ne}),ee||P.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:s}))),P.a.createElement("div",{className:"".concat(U,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":he,"aria-valuenow":ct,required:re,type:we,placeholder:De,onPaste:nt,onClick:ce,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:ae,autoComplete:I,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ht?this.onKeyDown:c,onKeyUp:ht?this.onKeyUp:c,autoFocus:Be,maxLength:Fe,readOnly:V,disabled:K,max:he,min:Le,step:Ne,name:Ue,title:Ae,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Pe,inputMode:Me,onInput:it},Oe))))}}]),E}(P.a.Component);v.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:p,min:-p,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:u,required:!1,autoComplete:"off"};var m=v,a=Ie.a=m},h78n:function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return x});var le=Z("q1tI"),q=Z.n(le),L=Z("TSYQ"),J=Z.n(L),B={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(K){var V=K.map(function(){return Object(le.useRef)()}),_=Object(le.useRef)();return Object(le.useEffect)(function(){var I=Date.now(),Y=!1;Object.keys(V).forEach(function(ee){var oe=V[ee].current;if(!oe)return;Y=!0;var he=oe.style;he.transitionDuration=".3s, .3s, .3s, .06s",_.current&&I-_.current<100&&(he.transitionDuration="0s, 0s")}),Y&&(_.current=Date.now())}),[V]};function G(){return G=Object.assign||function(U){for(var K=1;K<arguments.length;K++){var V=arguments[K];for(var _ in V)Object.prototype.hasOwnProperty.call(V,_)&&(U[_]=V[_])}return U},G.apply(this,arguments)}function F(U,K){return O(U)||C(U,K)||k(U,K)||P()}function P(){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 k(U,K){if(!U)return;if(typeof U=="string")return y(U,K);var V=Object.prototype.toString.call(U).slice(8,-1);if(V==="Object"&&U.constructor&&(V=U.constructor.name),V==="Map"||V==="Set")return Array.from(U);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return y(U,K)}function y(U,K){(K==null||K>U.length)&&(K=U.length);for(var V=0,_=new Array(K);V<K;V++)_[V]=U[V];return _}function C(U,K){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var V=[],_=!0,I=!1,Y=void 0;try{for(var ee=U[Symbol.iterator](),oe;!(_=(oe=ee.next()).done)&&!(V.push(oe.value),K&&V.length===K);_=!0);}catch(he){I=!0,Y=he}finally{try{!_&&ee.return!=null&&ee.return()}finally{if(I)throw Y}}return V}function O(U){if(Array.isArray(U))return U}function R(U,K){if(U==null)return{};var V=A(U,K),_,I;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(U);for(I=0;I<Y.length;I++){if(_=Y[I],K.indexOf(_)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,_))continue;V[_]=U[_]}}return V}function A(U,K){if(U==null)return{};var V={},_=Object.keys(U),I,Y;for(Y=0;Y<_.length;Y++){if(I=_[Y],K.indexOf(I)>=0)continue;V[I]=U[I]}return V}var S=function(K){var V=K.className,_=K.percent,I=K.prefixCls,Y=K.strokeColor,ee=K.strokeLinecap,oe=K.strokeWidth,he=K.style,Le=K.trailColor,xe=K.trailWidth,Ae=K.transition,Te=R(K,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Te.gapPosition;var Ce=Array.isArray(_)?_:[_],pe=Array.isArray(Y)?Y:[Y],de=M(Ce),re=F(de,1),ce=re[0],ae=oe/2,we=100-oe/2,De="M ".concat(ee==="round"?ae:0,",").concat(ae,`
|
|
L `).concat(ee==="round"?we:100,",").concat(ae),ye="0 0 100 ".concat(oe),Me=0;return q.a.createElement("svg",G({className:J()("".concat(I,"-line"),V),viewBox:ye,preserveAspectRatio:"none",style:he},Te),q.a.createElement("path",{className:"".concat(I,"-line-trail"),d:De,strokeLinecap:ee,stroke:Le,strokeWidth:xe||oe,fillOpacity:"0"}),Ce.map(function(Pe,Ne){var Fe={strokeDasharray:"".concat(Pe,"px, 100px"),strokeDashoffset:"-".concat(Me,"px"),transition:Ae||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Be=pe[Ne]||pe[pe.length-1];return Me+=Pe,q.a.createElement("path",{key:Ne,className:"".concat(I,"-line-path"),d:De,strokeLinecap:ee,stroke:Be,strokeWidth:oe,fillOpacity:"0",ref:ce[Ne],style:Fe})}))};S.defaultProps=B;var c=S;function s(){return s=Object.assign||function(U){for(var K=1;K<arguments.length;K++){var V=arguments[K];for(var _ in V)Object.prototype.hasOwnProperty.call(V,_)&&(U[_]=V[_])}return U},s.apply(this,arguments)}function u(U,K){return D(U)||f(U,K)||T(U,K)||h()}function h(){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 T(U,K){if(!U)return;if(typeof U=="string")return p(U,K);var V=Object.prototype.toString.call(U).slice(8,-1);if(V==="Object"&&U.constructor&&(V=U.constructor.name),V==="Map"||V==="Set")return Array.from(U);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return p(U,K)}function p(U,K){(K==null||K>U.length)&&(K=U.length);for(var V=0,_=new Array(K);V<K;V++)_[V]=U[V];return _}function f(U,K){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var V=[],_=!0,I=!1,Y=void 0;try{for(var ee=U[Symbol.iterator](),oe;!(_=(oe=ee.next()).done)&&!(V.push(oe.value),K&&V.length===K);_=!0);}catch(he){I=!0,Y=he}finally{try{!_&&ee.return!=null&&ee.return()}finally{if(I)throw Y}}return V}function D(U){if(Array.isArray(U))return U}function v(U,K){if(U==null)return{};var V=m(U,K),_,I;if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(U);for(I=0;I<Y.length;I++){if(_=Y[I],K.indexOf(_)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,_))continue;V[_]=U[_]}}return V}function m(U,K){if(U==null)return{};var V={},_=Object.keys(U),I,Y;for(Y=0;Y<_.length;Y++){if(I=_[Y],K.indexOf(I)>=0)continue;V[I]=U[I]}return V}var a=0;function d(U){return+U.replace("%","")}function o(U){return Array.isArray(U)?U:[U]}function E(U,K,V,_){var I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,Y=arguments.length>5?arguments[5]:void 0,ee=50-_/2,oe=0,he=-ee,Le=0,xe=-2*ee;switch(Y){case"left":oe=-ee,he=0,Le=2*ee,xe=0;break;case"right":oe=ee,he=0,Le=-2*ee,xe=0;break;case"bottom":he=ee,xe=2*ee;break;default:}var Ae="M 50,50 m ".concat(oe,",").concat(he,`
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(Le,",").concat(-xe,`
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-Le,",").concat(xe),Te=Math.PI*2*ee,Ce={stroke:V,strokeDasharray:"".concat(K/100*(Te-I),"px ").concat(Te,"px"),strokeDashoffset:"-".concat(I/2+U/100*(Te-I),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ae,pathStyle:Ce}}var b=function(K){var V=K.prefixCls,_=K.strokeWidth,I=K.trailWidth,Y=K.gapDegree,ee=K.gapPosition,oe=K.trailColor,he=K.strokeLinecap,Le=K.style,xe=K.className,Ae=K.strokeColor,Te=K.percent,Ce=v(K,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),pe=Object(le.useMemo)(function(){return a+=1,a},[]),de=E(0,100,oe,_,Y,ee),re=de.pathString,ce=de.pathStyle,ae=o(Te),we=o(Ae),De=we.find(function(Fe){return Object.prototype.toString.call(Fe)==="[object Object]"}),ye=M(ae),Me=u(ye,1),Pe=Me[0],Ne=function(){var Be=0;return ae.map(function(Ue,nt){var it=we[nt]||we[we.length-1],$e=Object.prototype.toString.call(it)==="[object Object]"?"url(#".concat(V,"-gradient-").concat(pe,")"):"",tt=E(Be,Ue,it,_,Y,ee);return Be+=Ue,q.a.createElement("path",{key:nt,className:"".concat(V,"-circle-path"),d:tt.pathString,stroke:$e,strokeLinecap:he,strokeWidth:_,opacity:Ue===0?0:1,fillOpacity:"0",style:tt.pathStyle,ref:Pe[nt]})})};return q.a.createElement("svg",s({className:J()("".concat(V,"-circle"),xe),viewBox:"0 0 100 100",style:Le},Ce),De&&q.a.createElement("defs",null,q.a.createElement("linearGradient",{id:"".concat(V,"-gradient-").concat(pe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(De).sort(function(Fe,Be){return d(Fe)-d(Be)}).map(function(Fe,Be){return q.a.createElement("stop",{key:Be,offset:Fe,stopColor:De[Fe]})}))),q.a.createElement("path",{className:"".concat(V,"-circle-trail"),d:re,stroke:oe,strokeLinecap:he,strokeWidth:I||_,fillOpacity:"0",style:ce}),Ne().reverse())};b.defaultProps=B;var x=b,N={Line:c,Circle:x}},isY5:function(Ke,Ie,Z){"use strict";Z.r(Ie);var le=Z("5Dmo"),q=Z("3S7+"),L=Z("giR+"),J=Z("fyUT"),B=Z("+L6B"),M=Z("2/Rp"),G=Z("/zsF"),F=Z("PArb"),P=Z("14J3"),k=Z("BMrR"),y=Z("jCWc"),C=Z("kPKH"),O=Z("sPJy"),R=Z("bE4q"),A=Z("miYZ"),S=Z("tsqr"),c=Z("9og8"),s=Z("k1fw"),u=Z("y8nQ"),h=Z("Vl3Y"),T=Z("2qtc"),p=Z("kLXV"),f=Z("tJVT"),D=Z("WmNS"),v=Z.n(D),m=Z("q1tI"),a=Z.n(m),d=Z("Ty5D"),o=Z("9kvl"),E=Z("55Ip"),b=Z("jhfD"),x=Z("/MfK"),N=Z("kaH+"),U=Z("ErOA"),K=Z("Ot1p"),V=Z("dhSg"),_=Z("p5ED"),I=Z("wd/R"),Y=Z.n(I),ee=Z("m3rI"),oe=Z("XYT7"),he=Z("5NDa"),Le=Z("5rEg"),xe=function(Fe){var Be=Fe.shixunHomeworks,Ue=Fe.dispatch,nt=Object(d.i)(),it=Object(m.useState)(!0),$e=Object(f.a)(it,2),tt=$e[0],ct=$e[1],et=h.a.useForm(),ot=Object(f.a)(et,1),Oe=ot[0];return a.a.createElement(a.a.Fragment,null,a.a.createElement(p.a,{centered:!0,title:"\u8C03\u5206",visible:Be.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(c.a)(v.a.mark(function ht(){var st,je;return v.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Oe.validateFields();case 2:return st=Oe.getFieldsValue(),Ee.next=5,Object(U.a)("/api/student_works/".concat(Be.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(s.a)({},st)});case 5:je=Ee.sent,je.status===0&&(S.b.success("\u8BC4\u9605\u6210\u529F"),Oe.resetFields(),Ue({type:"shixunHomeworks/setActionTabs",payload:{}}),Ue({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(s.a)({},nt)}));case 7:case"end":return Ee.stop()}},ht)})),onCancel:function(){Ue({type:"shixunHomeworks/setActionTabs",payload:{}})}},a.a.createElement("p",{className:"tc"},"\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"),a.a.createElement(h.a,{form:Oe,layout:"horizontal"},a.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},a.a.createElement(h.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},a.a.createElement(J.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),a.a.createElement("span",{className:"ml10"},"\u5206")),a.a.createElement("div",null,a.a.createElement(h.a.Item,{name:"comment"},a.a.createElement(Le.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},Ae=Object(o.a)(function(Ne){var Fe=Ne.shixunHomeworks;return{shixunHomeworks:Fe}})(xe),Te=Z("pAaK"),Ce=Z.n(Te),pe=Z("9Bee"),de=Z("LvDl"),re=Z("500L"),ce=function(Fe){var Be=Fe.classroomList,Ue=Fe.loading,nt=Fe.dispatch,it=Object(d.i)(),$e=h.a.useForm(),tt=Object(f.a)($e,1),ct=tt[0];return a.a.createElement(p.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:Be.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(c.a)(v.a.mark(function et(){var ot,Oe,ht,st;return v.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.next=2,ct.validateFields();case 2:return Oe=Object(s.a)({},ct.getFieldValue()),ht=Be.actionTabs.selectArrs,Oe.attachment_ids=(ot=Oe.attachment_ids)===null||ot===void 0?void 0:ot.map(function(Ee){return Ee.response.id}),Ye.next=7,Object(oe.R)(Object(s.a)(Object(s.a)({},Oe),{},{homeworkId:ht.work_id}));case 7:st=Ye.sent,st.status===0&&(ct.resetFields(),nt({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(s.a)({},Be.actionTabs.params)}),nt({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return Ye.stop()}},et)})),onCancel:function(){ct.resetFields(),nt({type:"classroomList/setActionTabs",payload:{}})}},a.a.createElement(h.a,{form:ct,initialValues:{}},a.a.createElement(h.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},a.a.createElement(re.b,null)),a.a.createElement(h.a.Item,{name:"description"},a.a.createElement(Le.a.TextArea,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",rows:7}))))},ae=Object(o.a)(function(Ne){var Fe=Ne.classroomList,Be=Ne.loading;return{classroomList:Fe,loading:Be}})(ce),we=Z("1vsH"),De=Z("xKgJ"),ye=Z("lzim"),Me=function(Fe){var Be,Ue,nt,it,$e,tt,ct,et,ot,Oe,ht,st,je,Ye,Ee,ge,be,ne,ie,se,ue=Fe.shixunHomeworks,ke=Fe.globalSetting,Se=Fe.loading,Ve=Fe.user,at=Fe.dispatch,We=Object(d.i)(),mt=Object(m.useRef)(),wt=Ve.userInfo,ze=ue.studentWorkDetail,lt=ue.studentWorkCommon,Mt=ue.studentWorkSupplyDetail,Ht=ue.workList,qt=Object(m.useState)(""),zt=Object(f.a)(qt,2),Lt=zt[0],Yr=zt[1],on=Object(m.useState)({show:!1,type:0,active:null}),Et=Object(f.a)(on,2),Nr=Et[0],ur=Et[1],Cr=p.a.useModal(),Fr=Object(f.a)(Cr,2),tn=Fr[0],sn=Fr[1],Ft=Object(m.useState)({last:!1}),vt=Object(f.a)(Ft,2),ar=vt[0],rn=vt[1],Or=Object(m.useState)({last:!1}),_t=Object(f.a)(Or,2),or=_t[0],Xr=_t[1],ln=h.a.useForm(),qe=Object(f.a)(ln,1),At=qe[0],un=Object(m.useState)(!1),vn=Object(f.a)(un,2),dn=vn[0],cn=vn[1],z=Object(m.useState)(""),l=Object(f.a)(z,2),g=l[0],W=l[1],Q=Object(m.useState)({content:"",type:""}),H=Object(f.a)(Q,2),me=H[0],Qe=H[1],Xe=Object(d.h)(),ft=function(){at({type:"shixunHomeworks/getStudentWorkCommon",payload:Object(s.a)({},We)})};Object(m.useEffect)(function(){at({type:"shixunHomeworks/getStudentWorkDetail",payload:Object(s.a)({},We)}),at({type:"shixunHomeworks/getStudentWorkSupplyDetail",payload:Object(s.a)({},We)}),ft(),Je(),mt.current.onclick=function(He){He.target.nodeName==="IMG"&&He.target.alt!==""&&V.a.publish("preview-image",He.target.src)}},[We.categoryId,We.userId]);function Je(){return St.apply(this,arguments)}function St(){return St=Object(c.a)(v.a.mark(function He(){var Rt,er,kt,nr,Xt,dr,Pt,bt,jt,sr;return v.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return nr=JSON.parse(sessionStorage.all_student_works_params||"{}"),Xt={},Xe!=null&&(Rt=Xe.query)!==null&&Rt!==void 0&&Rt.ids&&(Xt.course_group=Xe==null||((dr=Xe.query)===null||dr===void 0)?void 0:dr.ids.split(",")),Qt.next=5,at({type:"shixunHomeworks/getAllStudentWorks",payload:Object(s.a)(Object(s.a)(Object(s.a)({},We),nr),Xt)});case 5:Pt=Qt.sent,bt=(er=Pt.all_student_works)===null||er===void 0?void 0:er.map(function(tr){return String(tr.student_work_id)}).indexOf(We.userId),bt===((kt=Pt.all_student_works)===null||kt===void 0?void 0:kt.length)-1?rn({last:!0}):rn((jt=Pt.all_student_works)===null||jt===void 0?void 0:jt[bt+1]),bt===0?Xr({last:!0}):Xr((sr=Pt.all_student_works)===null||sr===void 0?void 0:sr[bt-1]);case 9:case"end":return Qt.stop()}},He)})),St.apply(this,arguments)}Object(m.useEffect)(function(){return at({type:"globalSetting/footerToggle",payload:!1}),function(){at({type:"globalSetting/footerToggle",payload:!0})}},[]);var It=function(Rt){tn.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var er=Object(c.a)(v.a.mark(function nr(){var Xt;return v.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,at({type:"shixunHomeworks/deleteReply",payload:{object_id:Rt.id,object_type:"journals_for_message"}});case 2:Xt=Pt.sent,Xt.status===0&&(S.b.success("\u5220\u9664\u6210\u529F"),ft());case 4:case"end":return Pt.stop()}},nr)}));function kt(){return er.apply(this,arguments)}return kt}()})},$t=function(Rt){tn.confirm({title:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var er=Object(c.a)(v.a.mark(function nr(){var Xt;return v.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(oe.k)({score_id:Rt.comment_id,userId:We.userId});case 2:Xt=Pt.sent,Xt.status===0&&(S.b.success("\u5220\u9664\u6210\u529F"),ft());case 4:case"end":return Pt.stop()}},nr)}));function kt(){return er.apply(this,arguments)}return kt}()})},jr=function(){var He=Object(c.a)(v.a.mark(function Rt(er){var kt,nr;return v.a.wrap(function(dr){for(;;)switch(dr.prev=dr.next){case 0:return er.attachment_ids=(kt=er.attachment_ids)===null||kt===void 0?void 0:kt.map(function(Pt){var bt;return Pt==null||((bt=Pt.response)===null||bt===void 0)?void 0:bt.id}),dr.next=3,Object(oe.e)(Object(s.a)(Object(s.a)({},er),{},{userId:We.userId}));case 3:nr=dr.sent,nr.status===0&&(At.resetFields(),S.b.success("\u63D0\u4EA4\u6210\u529F"),ft());case 5:case"end":return dr.stop()}},Rt)}));return function(er){return He.apply(this,arguments)}}(),Mr=function(){var He=Object(c.a)(v.a.mark(function Rt(er){var kt,nr,Xt,dr,Pt,bt,jt,sr,Vt;return v.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:if(kt=At.getFieldsValue(),nr=kt.comment,Xt=kt.score,dr=kt.attachment_ids,Pt=!Object(de.isNil)(Xt),!(nr||Pt||dr)){tr.next=5;break}return p.a.confirm({centered:!0,okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:a.a.createElement("div",{className:"tc"},"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539"),onOk:function(){if(At.resetFields(),er==="last"){var hn,Cn;o.d.push(Xe!=null&&(hn=Xe.query)!==null&&hn!==void 0&&hn.ids?"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(or==null?void 0:or.student_work_id,"?ids=").concat(Xe==null||((Cn=Xe.query)===null||Cn===void 0)?void 0:Cn.ids):"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(or==null?void 0:or.student_work_id))}else if(er==="read"){var cr,Ut;o.d.push(Xe!=null&&(cr=Xe.query)!==null&&cr!==void 0&&cr.ids?"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(ar==null?void 0:ar.student_work_id,"?ids=").concat(Xe==null||((Ut=Xe.query)===null||Ut===void 0)?void 0:Ut.ids):"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(ar==null?void 0:ar.student_work_id))}else o.d.push("/classrooms/".concat(We.coursesId,"/common_homework/").concat(We.categoryId,"/detail"))}}),tr.abrupt("return");case 5:er==="last"?o.d.push(Xe!=null&&(bt=Xe.query)!==null&&bt!==void 0&&bt.ids?"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(or==null?void 0:or.student_work_id,"?ids=").concat(Xe==null||((jt=Xe.query)===null||jt===void 0)?void 0:jt.ids):"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(or==null?void 0:or.student_work_id)):er==="read"?o.d.push(Xe!=null&&(sr=Xe.query)!==null&&sr!==void 0&&sr.ids?"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(ar==null?void 0:ar.student_work_id,"?ids=").concat(Xe==null||((Vt=Xe.query)===null||Vt===void 0)?void 0:Vt.ids):"/classrooms/".concat(We==null?void 0:We.coursesId,"/common_homework/").concat(We==null?void 0:We.categoryId,"/review/").concat(ar==null?void 0:ar.student_work_id)):o.d.push("/classrooms/".concat(We.coursesId,"/common_homework/").concat(We.categoryId,"/detail"));case 6:case"end":return tr.stop()}},Rt)}));return function(er){return He.apply(this,arguments)}}();return a.a.createElement("section",{className:"edu-container",ref:mt},a.a.createElement("section",{className:"animated fadeIn"},a.a.createElement("aside",{className:"mt10"},wt&&a.a.createElement(R.a,{separator:">"},a.a.createElement(R.a.Item,null,a.a.createElement(E.a,{to:"/classrooms/".concat(We.coursesId,"/common_homework/").concat(ze!=null&&(Be=ze.category)!==null&&Be!==void 0&&Be.main?"":ze==null||((Ue=ze.category)===null||Ue===void 0)?void 0:Ue.category_id)},wt==null||((nt=wt.course)===null||nt===void 0)?void 0:nt.course_name)),a.a.createElement(R.a.Item,null,a.a.createElement(E.a,{to:"/classrooms/".concat(We.coursesId,"/common_homework/").concat(ze!=null&&(it=ze.category)!==null&&it!==void 0&&it.main?"":ze==null||(($e=ze.category)===null||$e===void 0)?void 0:$e.category_id)},ze==null||((tt=ze.category)===null||tt===void 0)?void 0:tt.category_name)),a.a.createElement(R.a.Item,null,a.a.createElement(E.a,{to:"/classrooms/".concat(We.coursesId,"/common_homework/").concat(We.categoryId,"/detail")},"\u4F5C\u4E1A\u8BE6\u60C5")),a.a.createElement(R.a.Item,null,ze==null?void 0:ze.author_name))),a.a.createElement("aside",{className:[Ce.a.title,"mt20"].join(" ")},a.a.createElement(k.a,{style:{width:"100%"}},a.a.createElement(C.a,{flex:"1"},a.a.createElement(E.a,{to:"/classrooms/".concat(We.coursesId,"/common_homework")},a.a.createElement(b.a,{className:"font16 c-black"})),a.a.createElement("strong",{className:"font20 ml5"},ze==null?void 0:ze.homework_name),a.a.createElement(we.k,{status:ze==null?void 0:ze.homework_status})),a.a.createElement(C.a,null,Object(De.s)()&&(ze==null||((ct=ze.homework_status)===null||ct===void 0)?void 0:ct.includes("\u8865\u4EA4\u4E2D"))&&a.a.createElement("span",{onClick:function(){at({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:We,selectArrs:{homework_id:We.commonHomeworkId,work_id:We.userId}}})},className:"c-blue current font14"},"\u8865\u4EA4\u9644\u4EF6"))))),a.a.createElement("ul",{className:Ce.a["nav-tab"]},a.a.createElement("li",{className:"active"},"\u4F5C\u4E1A\u8BE6\u60C5"),Object(De.u)()&&a.a.createElement("li",null,a.a.createElement(E.a,{to:"/classrooms/".concat(We.coursesId,"/common_homework/").concat(We.categoryId,"/lab-report-view/").concat(We.userId)}," ","\u5B9E\u9A8C\u62A5\u544A"," "))),a.a.createElement("section",{className:[Ce.a.bg,"pt30","pl30","pr30","pb30"].join(" ")},(ze==null?void 0:ze.description)&&a.a.createElement("aside",null,a.a.createElement("div",{className:"font16"},"\u5185\u5BB9"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(pe.a,{value:(ze==null?void 0:ze.description)||"\u6682\u65E0\uFF5E"})),ze==null||((et=ze.attachments)===null||et===void 0)?void 0:et.map(function(He,Rt){return a.a.createElement("div",{className:"pl30",key:Rt},a.a.createElement("a",{href:"".concat(ee.a.API_SERVER).concat(He.url),onClick:function(kt){kt.preventDefault(),Qe({type:He.file_type,content:ee.a.API_SERVER+He.url})}},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},He.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},He.filesize)))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:" c-light-black"},Y()(ze.commit_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ze.commit_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),a.a.createElement("span",{className:"ml30 c-light-black"},Y()(ze.update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ze.update_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(ze==null?void 0:ze.redo_description)&&a.a.createElement("aside",null,a.a.createElement(F.a,null),a.a.createElement("div",{className:"font16"},"\u91CD\u505A\u8BB0\u5F55"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(pe.a,{value:(ze==null?void 0:ze.redo_description)||"\u6682\u65E0\uFF5E"})),ze==null||((ot=ze.redo_attachments)===null||ot===void 0)?void 0:ot.map(function(He,Rt){return a.a.createElement("div",{className:"pl30",key:Rt},a.a.createElement("a",{href:"".concat(ee.a.API_SERVER).concat(He.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},He.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},He.filesize)))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:" c-light-black"},Y()(ze.redo_commit_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ze.commit_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u63D0\u4EA4"),a.a.createElement("span",{className:"ml30 c-light-black"},Y()(ze.redo_update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},ze.update_user_name),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0"))),(Mt==null?void 0:Mt.revise_reason)&&a.a.createElement("aside",null,a.a.createElement(F.a,null),a.a.createElement("div",{className:"font16"},"\u8865\u4EA4\u5185\u5BB9"),a.a.createElement("div",{className:"pl30 mt20"},a.a.createElement(pe.a,{value:(Mt==null?void 0:Mt.revise_reason)||"\u6682\u65E0\uFF5E"})),Mt==null||((Oe=Mt.revise_attachments)===null||Oe===void 0)?void 0:Oe.map(function(He,Rt){return a.a.createElement("div",{className:"pl30",key:Rt},a.a.createElement("a",{href:"".concat(ee.a.API_SERVER).concat(He.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},He.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},He.filesize)))}),a.a.createElement("aside",{className:"tr"},a.a.createElement("span",{className:"ml30 c-light-black"},Y()(Mt.atta_update_time).format("YYYY-MM-DD HH:mm")),a.a.createElement("span",{className:"ml10"},Mt.atta_update_user),a.a.createElement("span",{className:"ml10 c-light-black"},"\u66F4\u65B0")))),(ze==null?void 0:ze.anonymous_comment)&&Object(De.i)()&&a.a.createElement("section",{className:[Ce.a.bg,"mt30","pt30","pl30","pr30","pb30"].join(" ")},a.a.createElement("p",null,"\u533F\u8BC4\u5B66\u751F"),!!(ze!=null&&(ht=ze.no_commented_user_names)!==null&&ht!==void 0&&ht.length)&&a.a.createElement("p",null,"\u672A\u5B8C\u6210\u533F\u8BC4\uFF1A",ze.no_commented_user_names.join("\u3001")),a.a.createElement("div",null,"\u5DF2\u5B8C\u6210\u533F\u8BC4\uFF1A",(st=ze.commented_user_names)===null||st===void 0?void 0:st.join("\u3001"))),(Object(De.h)()||(ze==null||((je=ze.homework_status)===null||je===void 0)?void 0:je.includes("\u533F\u8BC4\u4E2D")))&&a.a.createElement("section",null,a.a.createElement("aside",{className:[Ce.a.replyList,"bg-white"].join(" ")},a.a.createElement(k.a,{gutter:[10,20]},a.a.createElement(C.a,{flex:1},!!(lt!=null&&(Ye=lt.comment_scores)!==null&&Ye!==void 0&&Ye.length)&&a.a.createElement("span",{className:"font-16"},"\u5168\u90E8\u8BC4\u9605(",lt==null?void 0:lt.comment_count,")")),a.a.createElement(C.a,{style:{lineHeight:"40px"}},Object(De.c)()&&(lt==null?void 0:lt.ultimate)&&a.a.createElement("span",{className:"font-16 c-blue current",onClick:function(){at({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:ze,id:We.userId,params:We}})}},"\u8C03\u5206")),a.a.createElement(C.a,null,Object(De.i)()&&((ze==null||((Ee=ze.homework_status)===null||Ee===void 0)?void 0:Ee.includes("\u63D0\u4EA4\u4E2D"))||(ze==null||((ge=ze.homework_status)===null||ge===void 0)?void 0:ge.includes("\u8865\u4EA4\u4E2D"))||(ze==null||((be=ze.homework_status)===null||be===void 0)?void 0:be.includes("\u8FDB\u884C\u4E2D")))&&a.a.createElement(M.a,{style:{width:"124px",height:"40px"},type:"primary",onClick:function(){return cn(!0)}},"\u6253\u56DE\u91CD\u505A"))),!lt.is_author&&!(lt!=null&<.ultimate)&&(Object(De.c)()||(ze==null||((ne=ze.homework_status)===null||ne===void 0)?void 0:ne.includes("\u533F\u8BC4\u4E2D")))&&a.a.createElement("aside",null,a.a.createElement(h.a,{layout:"vertical",form:At,onFinish:function(Rt){return jr(Rt)}},a.a.createElement(h.a.Item,{label:"\u8BC4\u8BED",name:"comment",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BC4\u8BED"}]},a.a.createElement(K.a,{defaultValue:"",height:250})),a.a.createElement("div",null,a.a.createElement(h.a.Item,{name:"attachment_ids"},a.a.createElement(re.b,null))),a.a.createElement("div",{className:"mt10"},a.a.createElement(k.a,null,a.a.createElement(C.a,{flex:"1"},a.a.createElement(k.a,{align:"middle",justify:"start"},a.a.createElement(C.a,null,a.a.createElement(h.a.Item,{noStyle:!0,name:"score",rules:[{required:!Object(De.c)(),message:"\u8BF7\u586B\u5199\u5206\u6570"}]},a.a.createElement(J.a,{step:.1,min:0,style:{width:100},size:"large",placeholder:"\u8BF7\u586B\u5199\u5206\u6570"}))),a.a.createElement(C.a,null,a.a.createElement("span",{className:"ml5 mr20"},"\u5206")))),a.a.createElement(C.a,null))),a.a.createElement("aside",{className:"".concat(Ce.a.buttonFixed)},a.a.createElement("aside",{className:"edu-container"},a.a.createElement(k.a,{align:"middle"},a.a.createElement(C.a,{flex:"1"},a.a.createElement(M.a,{type:"default",onClick:function(){return Mr("list")}},"\u8FD4\u56DE\u5217\u8868")),a.a.createElement(C.a,{flex:"1",className:"tr"},!Object(De.s)()&&a.a.createElement(M.a,{type:"default",onClick:function(){return Mr("last")},disabled:or==null?void 0:or.last},"\u4E0A\u4E00\u4E2A"),!Object(De.s)()&&a.a.createElement(M.a,{type:"default",disabled:ar==null?void 0:ar.last,style:{marginLeft:"20px",marginRight:"20px"},onClick:function(){return Mr("read")}},"\u4E0B\u4E00\u4E2A"),a.a.createElement(M.a,{htmlType:"submit",type:"primary"},"\u63D0\u4EA4\u8BC4\u9605"))))))),a.a.createElement(F.a,null),(Object(De.h)()||(ze==null||((ie=ze.homework_status)===null||ie===void 0)?void 0:ie.includes("\u533F\u8BC4\u4E2D")))&&(lt==null||((se=lt.comment_scores)===null||se===void 0)?void 0:se.map(function(He,Rt){var er,kt,nr,Xt,dr,Pt;return a.a.createElement("aside",{key:Rt},a.a.createElement(k.a,{gutter:[12,12],key:Rt},a.a.createElement(C.a,{flex:"40px"},(He==null?void 0:He.user_image_url)==="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:ye.b}),(He==null?void 0:He.user_image_url)!=="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:"".concat(ee.a.IMG_SERVER,"/images/").concat(He==null?void 0:He.user_image_url)})),a.a.createElement(C.a,{flex:"1"},a.a.createElement(k.a,{align:"middle"},a.a.createElement(C.a,{span:24},a.a.createElement(k.a,null,a.a.createElement(C.a,{flex:1},a.a.createElement("span",{className:"c-light-black"},He==null?void 0:He.user_name),a.a.createElement("span",{className:"c-light-black ml10"},Y()(He==null?void 0:He.comment_time).format("YYYY-MM-DD HH:mm")),He.score!==null&&a.a.createElement("span",{className:"ml30 c-orange"},He.score,"\u5206")),a.a.createElement(C.a,null,Rt===0?a.a.createElement("aside",null,He.delete&&a.a.createElement("span",{className:"c-blue current",onClick:function(){$t(He)}},"\u5220\u9664"),He.can_appeal&&a.a.createElement("span",{className:"c-blue current",onClick:function(){ur({show:!0,type:1,active:Rt})}},"\u7533\u8BC9"),He.can_reply&&a.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return ur({show:!0,type:0,active:Rt})}},"\u56DE\u590D")):a.a.createElement("aside",null,He.delete&&a.a.createElement("span",{className:"c-blue current",onClick:function(){$t(He)}},"\u5220\u9664"),He.can_appeal&&a.a.createElement("span",{className:"c-blue current",onClick:function(){ur({show:!0,type:1,active:Rt})}},"\u7533\u8BC9"),He.can_reply&&a.a.createElement("span",{className:"c-blue current ml10",onClick:function(){return ur({show:!0,type:0,active:Rt})}},"\u56DE\u590D"),!He.can_reply&&a.a.createElement("span",{className:"c-light-black ml10"},"\u5931\u6548"))))),a.a.createElement(C.a,{span:24},He.content&&a.a.createElement(pe.a,{value:He.content}),!He.content&&a.a.createElement("span",{className:"c-light-black"},"\u6682\u672A\u5199\u8BC4\u8BED"),He==null||((er=He.attachments)===null||er===void 0)?void 0:er.map(function(bt,jt){return a.a.createElement("div",{key:jt},a.a.createElement("a",{href:"".concat(ee.a.API_SERVER).concat(bt.url)},a.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),a.a.createElement("span",{className:"ml10 c-black"},bt.title),a.a.createElement("span",{className:"c-light-black ml20 font12"},bt.filesize)))})),a.a.createElement("div",{className:"w100"},a.a.createElement(F.a,null),a.a.createElement("aside",{className:[Ce.a.comment,"w100"].join(" ")},He.appeal_info&&He.appeal_info!=""&&a.a.createElement("aside",null,a.a.createElement(k.a,null,a.a.createElement(C.a,{span:24},a.a.createElement(k.a,null,a.a.createElement(C.a,{flex:"50px"},(He==null||((kt=He.appeal_info)===null||kt===void 0)?void 0:kt.user_image_url)==="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:ye.b}),(He==null||((nr=He.appeal_info)===null||nr===void 0)?void 0:nr.user_image_url)!=="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:"".concat(ee.a.IMG_SERVER,"/images/").concat(He==null||((Xt=He.appeal_info)===null||Xt===void 0)?void 0:Xt.user_image_url)})),a.a.createElement(C.a,{flex:"1"},a.a.createElement(k.a,null,a.a.createElement(C.a,{flex:"1"},He==null||((dr=He.appeal_info)===null||dr===void 0)?void 0:dr.user_name,a.a.createElement("span",{className:"c-light-black ml10"},Y()(He==null||((Pt=He.appeal_info)===null||Pt===void 0)?void 0:Pt.time).format("YYYY-MM-DD HH:mm")),(He==null?void 0:He.appeal_status)===1&&a.a.createElement("span",{className:"tag-style bg-blue ml10"},"\u7533\u8BC9\u4E2D"),(He==null?void 0:He.appeal_status)===2&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u5DF2\u64A4\u9500"),(He==null?void 0:He.appeal_status)===3&&a.a.createElement("span",{className:"tag-style bg-blue ml10"},"\u7533\u8BC9\u6210\u529F"),(He==null?void 0:He.appeal_status)===4&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u88AB\u62D2\u7EDD"),(He==null?void 0:He.appeal_status)===5&&a.a.createElement("span",{className:"tag-style bg-grey-ede c-light-black ml10"},"\u7533\u8BC9\u5931\u8D25")),a.a.createElement(C.a,null,(He==null?void 0:He.appeal_status)===1&&He.can_appeal&&a.a.createElement("span",{onClick:function(){p.a.confirm({title:a.a.createElement("div",null,"\u64A4\u9500\u7533\u8BC9\u540E\uFF0C\u65E0\u6CD5\u518D\u5BF9\u672C\u8BC4\u9605\u8BB0\u5F55\u8FDB\u884C\u7533\u8BC9",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u7533\u8BC9"),onOk:function(){var jt=Object(c.a)(v.a.mark(function Vt(){return v.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:ft();case 1:case"end":return tr.stop()}},Vt)}));function sr(){return jt.apply(this,arguments)}return sr}()})},className:"c-blue current"},"\u64A4\u9500\u7533\u8BC9"),(He==null?void 0:He.appeal_status)===1&&Object(De.c)()&&a.a.createElement("span",{onClick:function(){p.a.confirm({title:a.a.createElement("div",null,"\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u5E9F\u5F03\uFF0C\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u5C06\u88AB\u8FDD\u89C4\u6263\u5206",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u63A5\u53D7\u7533\u8BC9"),onOk:function(){var jt=Object(c.a)(v.a.mark(function Vt(){var Qt;return v.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(U.a)("/api/student_works/".concat(We.userId,"/deal_appeal_score.json"),{method:"post",body:{score_id:He.score_id,status:3}});case 2:Qt=vr.sent,(Qt==null?void 0:Qt.status)===0&&ft();case 4:case"end":return vr.stop()}},Vt)}));function sr(){return jt.apply(this,arguments)}return sr}()})},className:"c-red current"},"\u63A5\u53D7\u7533\u8BC9"),(He==null?void 0:He.appeal_status)===1&&Object(De.c)()&&a.a.createElement("span",{onClick:function(){p.a.confirm({title:a.a.createElement("div",null,"\u6B64\u533F\u8BC4\u6210\u7EE9\u5C06\u88AB\u8BA4\u4E3A\u5408\u7406",a.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u62D2\u7EDD\u7533\u8BC9"),onOk:function(){var jt=Object(c.a)(v.a.mark(function Vt(){var Qt;return v.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(U.a)("/api/student_works/".concat(We.userId,"/deal_appeal_score.json"),{method:"post",body:{score_id:He.score_id,status:4}});case 2:Qt=vr.sent,(Qt==null?void 0:Qt.status)===0&&ft();case 4:case"end":return vr.stop()}},Vt)}));function sr(){return jt.apply(this,arguments)}return sr}()})},className:"c-light-black current ml10"},"\u62D2\u7EDD\u7533\u8BC9"))),a.a.createElement(pe.a,{value:He==null?void 0:He.appeal_info.content})),a.a.createElement(C.a,null))))),He.journals.map(function(bt,jt){var sr,Vt,Qt,tr;return a.a.createElement("aside",{key:jt},a.a.createElement(k.a,{key:jt},a.a.createElement(C.a,{span:24},a.a.createElement(k.a,null,a.a.createElement(C.a,{flex:"50px"},(bt==null||((sr=bt.user_info)===null||sr===void 0)?void 0:sr.user_image_url)==="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:ye.b}),(bt==null||((Vt=bt.user_info)===null||Vt===void 0)?void 0:Vt.user_image_url)!=="--"&&a.a.createElement("img",{className:Ce.a.headpic,width:"40",src:"".concat(ee.a.IMG_SERVER,"/images/").concat(bt==null||((Qt=bt.user_info)===null||Qt===void 0)?void 0:Qt.user_image_url)})),a.a.createElement(C.a,{flex:"1"},bt==null||((tr=bt.user_info)===null||tr===void 0)?void 0:tr.user_name,a.a.createElement("span",{className:"c-light-black ml10"},Y()(bt==null?void 0:bt.time).format("YYYY-MM-DD HH:mm")),a.a.createElement(pe.a,{value:bt.content})),a.a.createElement(C.a,null,(bt==null?void 0:bt.can_delete)&&a.a.createElement(q.a,{title:"\u5220\u9664"},a.a.createElement(x.a,{className:"current c-light-black",onClick:function(){It(bt)}})))))),jt!==He.journals.length-1&&a.a.createElement(F.a,null))})))),Nr.show&&Rt===Nr.active&&a.a.createElement("aside",{className:["bg-white"].join(" ")},a.a.createElement(K.a,{onChange:function(jt){Yr(jt)},height:150,isFocus:!0,watch:!0}),a.a.createElement(k.a,null,a.a.createElement(C.a,{span:24,className:"tr"},a.a.createElement(M.a,{type:"default",size:"large",onClick:Object(c.a)(v.a.mark(function bt(){return v.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:ur({show:!1,type:0,active:Rt});case 1:case"end":return sr.stop()}},bt)}))},"\u53D6\u6D88"),a.a.createElement(M.a,{type:"primary",size:"large",className:"ml20",onClick:Object(c.a)(v.a.mark(function bt(){var jt;return v.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(!(Lt==="")){Vt.next=4;break}S.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Vt.next=14;break;case 4:if(!(Nr.type===0)){Vt.next=10;break}return Vt.next=7,Object(oe.f)({comment:Lt,userId:We.userId,score_id:He.score_id});case 7:jt=Vt.sent,Vt.next=13;break;case 10:return Vt.next=12,Object(oe.g)({comment:Lt,score_id:He.score_id,userId:We.userId});case 12:jt=Vt.sent;case 13:jt.status===0&&(S.b.success("\u64CD\u4F5C\u6210\u529F"),ur({show:!1,type:0,active:Rt}),ft());case 14:case"end":return Vt.stop()}},bt)}))},Nr.type===0?"\u56DE\u590D":"\u7533\u8BC9")))))),a.a.createElement(F.a,null))})))),a.a.createElement(Ae,null),a.a.createElement(ae,null),a.a.createElement(N.a,null),a.a.createElement(p.a,{title:"\u786E\u8BA4\u6253\u56DE\u91CD\u505A",visible:dn,destroyOnClose:!0,forceRender:!0,onCancel:function(){cn(!1)},onOk:Object(c.a)(v.a.mark(function He(){var Rt;return v.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(g){kt.next=3;break}return S.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),kt.abrupt("return");case 3:return kt.next=5,Object(U.a)("/api/student_works/".concat(We.userId,"/redo_modal.json"),{method:"post",body:{comment:g,id:We.userId}});case 5:Rt=kt.sent,(Rt==null?void 0:Rt.status)===0&&(S.b.info("\u6253\u56DE\u91CD\u505A\u6210\u529F"),cn(!1),ft());case 7:case"end":return kt.stop()}},He)})),width:700},a.a.createElement("div",{style:{padding:"32px"}},a.a.createElement("span",null,"\u786E\u8BA4\u5C06",ze==null?void 0:ze.author_name,"\u7684\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417"),a.a.createElement("div",{style:{marginTop:"20px"}},a.a.createElement("label",null,a.a.createElement("span",{style:{marginRight:"5px",color:"red"}},"*"),"\u8BC4\u8BED\uFF1A"),a.a.createElement(K.a,{className:Ce.a.MdEditor,onChange:function(Rt){return W(Rt)},defaultValue:"",height:250})))),sn,a.a.createElement(_.a,{close:!0,data:me==null?void 0:me.content,type:me==null?void 0:me.type,onClose:function(){return Qe({content:"",type:""})}}))},Pe=Ie.default=Object(o.a)(function(Ne){var Fe=Ne.shixunHomeworks,Be=Ne.loading,Ue=Ne.user,nt=Ne.globalSetting;return{shixunHomeworks:Fe,globalSetting:nt,user:Ue,loading:Be.effects}})(Me)},ji0R:function(Ke,Ie,Z){Ke.exports=Z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Ke,Ie,Z){Ke.exports=Z.p+"static/question.cb52bef9.gif"},kPYp:function(Ke,Ie){Ke.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/yWGX2YZtv5untT0dJ7SpOZrAX9mLTeIYarAIIQEYLrZTQNNFj7A8rx6/GrPfDncPmdihV6Y9nkA+Ot4nrIXaDSGElH6KfjdzpBSpVo8ttVU8Xitx/7hw/imWmYD4wXy6Iqjje9mOGYj/uX0bjYf/5nsaLcpY9fqDZ5hNTD8/wi+27bB+CzfOVcqSiq0BMPdRpiBUNANmHNvJUQo1ZFls0lTuXupnOw+0UVamMsCz+eHCuf3MWgUjZ3w76kUZQeW8j4iOnadXmCUNQI3xvsIbl7bX70MEdKpFLutcCA7iz/BxvfrfY2hNVXDb2v2s/TkU/Lf8SZXrtOcUxFfF8P1AiNVSYj0aihUGOoCu/vFFVpQlpmQX1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7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Ke,Ie,Z){},"kaH+":function(Ke,Ie,Z){"use strict";var le=Z("+L6B"),q=Z("2/Rp"),L=Z("tJVT"),J=Z("q1tI"),B=Z.n(J),M=Z("UZu5"),G=Z.n(M),F=Z("dhSg"),P=Z("rLCj"),k=Z("dF/Y"),y=Z("4i/N");Ie.a=function(){var C=Object(J.useState)(""),O=Object(L.a)(C,2),R=O[0],A=O[1],S=Object(J.useState)(0),c=Object(L.a)(S,2),s=c[0],u=c[1],h=Object(J.useRef)("");Object(J.useEffect)(function(){var D=F.a.subscribe("preview-image",function(v){A(v),document.body.style.overflow="hidden"});return D},[]),Object(J.useEffect)(function(){return document.addEventListener("keydown",T),function(){document.removeEventListener("keydown",T)}},[]),Object(J.useEffect)(function(){h.current=R},[R]);function T(D){D.keyCode==27&&h.current&&p()}function p(){document.body.style.overflow="auto",A("")}function f(){u(s+90)}return B.a.createElement(J.Fragment,null,R?B.a.createElement("div",{className:"image-preview-container"},B.a.createElement("div",{className:"button-group"},B.a.createElement(q.a,{onClick:f},"\u65CB\u8F6C",B.a.createElement(P.a,null)),B.a.createElement(q.a,{href:R},"\u4E0B\u8F7D",B.a.createElement(k.a,null)),B.a.createElement(q.a,{onClick:p},"\u5173\u95ED",B.a.createElement(y.a,null))),B.a.createElement("div",{className:"preview-wrp-group"},B.a.createElement("img",{className:"image-preview",src:R,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(s,"deg)")}}))):null)}},l2Kq:function(Ke,Ie,Z){Ke.exports=Z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ke,Ie,Z){(function(le){le(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(le){"use strict";le.defineMode("markdown",function(q,L){var J=le.getMode(q,"text/html"),B=J.name=="null";function M(_){if(le.findModeByName){var I=le.findModeByName(_);I&&(_=I.mime||I.mimes[0])}var Y=le.getMode(q,_);return Y.name=="null"?null:Y}L.highlightFormatting===void 0&&(L.highlightFormatting=!1),L.maxBlockquoteDepth===void 0&&(L.maxBlockquoteDepth=0),L.taskLists===void 0&&(L.taskLists=!1),L.strikethrough===void 0&&(L.strikethrough=!1),L.emoji===void 0&&(L.emoji=!1),L.fencedCodeBlockHighlighting===void 0&&(L.fencedCodeBlockHighlighting=!0),L.fencedCodeBlockDefaultMode===void 0&&(L.fencedCodeBlockDefaultMode="text/plain"),L.xml===void 0&&(L.xml=!0),L.tokenTypeOverrides===void 0&&(L.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var F in G)G.hasOwnProperty(F)&&L.tokenTypeOverrides[F]&&(G[F]=L.tokenTypeOverrides[F]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,k=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,C=L.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ {0,3}(?:\={1,}|-{2,})\s*$/,R=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,S=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,s=" ";function u(_,I,Y){return I.f=I.inline=Y,Y(_,I)}function h(_,I,Y){return I.f=I.block=Y,Y(_,I)}function T(_){return!_||!/\S/.test(_.string)}function p(_){if(_.linkTitle=!1,_.linkHref=!1,_.linkText=!1,_.em=!1,_.strong=!1,_.strikethrough=!1,_.quote=0,_.indentedCode=!1,_.f==D){var I=B;if(!I){var Y=le.innerMode(J,_.htmlState);I=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}I&&(_.f=d,_.block=f,_.htmlState=null)}return _.trailingSpace=0,_.trailingSpaceNewLine=!1,_.prevLine=_.thisLine,_.thisLine={stream:null},null}function f(_,I){var Y=_.column()===I.indentation,ee=T(I.prevLine.stream),oe=I.indentedCode,he=I.prevLine.hr,Le=I.list!==!1,xe=(I.listStack[I.listStack.length-1]||0)+3;I.indentedCode=!1;var Ae=I.indentation;if(I.indentationDiff===null&&(I.indentationDiff=I.indentation,Le)){for(I.list=null;Ae<I.listStack[I.listStack.length-1];)I.listStack.pop(),I.listStack.length?I.indentation=I.listStack[I.listStack.length-1]:I.list=!1;I.list!==!1&&(I.indentationDiff=Ae-I.listStack[I.listStack.length-1])}var Te=!ee&&!he&&!I.prevLine.header&&(!Le||!oe)&&!I.prevLine.fencedCodeEnd,Ce=(I.list===!1||he||ee)&&I.indentation<=xe&&_.match(P),pe=null;if(I.indentationDiff>=4&&(oe||I.prevLine.fencedCodeEnd||I.prevLine.header||ee))return _.skipToEnd(),I.indentedCode=!0,G.code;if(_.eatSpace())return null;if(Y&&I.indentation<=xe&&(pe=_.match(C))&&pe[1].length<=6)return I.quote=0,I.header=pe[1].length,I.thisLine.header=!0,L.highlightFormatting&&(I.formatting="header"),I.f=I.inline,m(I);if(I.indentation<=xe&&_.eat(">"))return I.quote=Y?1:I.quote+1,L.highlightFormatting&&(I.formatting="quote"),_.eatSpace(),m(I);if(!Ce&&!I.setext&&Y&&I.indentation<=xe&&(pe=_.match(k))){var de=pe[1]?"ol":"ul";return I.indentation=Ae+_.current().length,I.list=!0,I.quote=0,I.listStack.push(I.indentation),I.em=!1,I.strong=!1,I.code=!1,I.strikethrough=!1,L.taskLists&&_.match(y,!1)&&(I.taskList=!0),I.f=I.inline,L.highlightFormatting&&(I.formatting=["list","list-"+de]),m(I)}else{if(Y&&I.indentation<=xe&&(pe=_.match(A,!0)))return I.quote=0,I.fencedEndRE=new RegExp(pe[1]+"+ *$"),I.localMode=L.fencedCodeBlockHighlighting&&M(pe[2]||L.fencedCodeBlockDefaultMode),I.localMode&&(I.localState=le.startState(I.localMode)),I.f=I.block=v,L.highlightFormatting&&(I.formatting="code-block"),I.code=-1,m(I);if(I.setext||(!Te||!Le)&&!I.quote&&I.list===!1&&!I.code&&!Ce&&!S.test(_.string)&&(pe=_.lookAhead(1))&&(pe=pe.match(O)))return I.setext?(I.header=I.setext,I.setext=0,_.skipToEnd(),L.highlightFormatting&&(I.formatting="header")):(I.header=pe[0].charAt(0)=="="?1:2,I.setext=I.header),I.thisLine.header=!0,I.f=I.inline,m(I);if(Ce)return _.skipToEnd(),I.hr=!0,I.thisLine.hr=!0,G.hr;if(_.peek()==="[")return u(_,I,N)}return u(_,I,I.inline)}function D(_,I){var Y=J.token(_,I.htmlState);if(!B){var ee=le.innerMode(J,I.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||I.md_inside&&_.current().indexOf(">")>-1)&&(I.f=d,I.block=f,I.htmlState=null)}return Y}function v(_,I){var Y=I.listStack[I.listStack.length-1]||0,ee=I.indentation<Y,oe=Y+3;if(I.fencedEndRE&&I.indentation<=oe&&(ee||_.match(I.fencedEndRE))){L.highlightFormatting&&(I.formatting="code-block");var he;return ee||(he=m(I)),I.localMode=I.localState=null,I.block=f,I.f=d,I.fencedEndRE=null,I.code=0,I.thisLine.fencedCodeEnd=!0,ee?h(_,I,I.block):he}else return I.localMode?I.localMode.token(_,I.localState):(_.skipToEnd(),G.code)}function m(_){var I=[];if(_.formatting){I.push(G.formatting),typeof _.formatting=="string"&&(_.formatting=[_.formatting]);for(var Y=0;Y<_.formatting.length;Y++)I.push(G.formatting+"-"+_.formatting[Y]),_.formatting[Y]==="header"&&I.push(G.formatting+"-"+_.formatting[Y]+"-"+_.header),_.formatting[Y]==="quote"&&(!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=_.quote?I.push(G.formatting+"-"+_.formatting[Y]+"-"+_.quote):I.push("error"))}if(_.taskOpen)return I.push("meta"),I.length?I.join(" "):null;if(_.taskClosed)return I.push("property"),I.length?I.join(" "):null;if(_.linkHref?I.push(G.linkHref,"url"):(_.strong&&I.push(G.strong),_.em&&I.push(G.em),_.strikethrough&&I.push(G.strikethrough),_.emoji&&I.push(G.emoji),_.linkText&&I.push(G.linkText),_.code&&I.push(G.code),_.image&&I.push(G.image),_.imageAltText&&I.push(G.imageAltText,"link"),_.imageMarker&&I.push(G.imageMarker)),_.header&&I.push(G.header,G.header+"-"+_.header),_.quote&&(I.push(G.quote),!L.maxBlockquoteDepth||L.maxBlockquoteDepth>=_.quote?I.push(G.quote+"-"+_.quote):I.push(G.quote+"-"+L.maxBlockquoteDepth)),_.list!==!1){var ee=(_.listStack.length-1)%3;ee?ee===1?I.push(G.list2):I.push(G.list3):I.push(G.list1)}return _.trailingSpaceNewLine?I.push("trailing-space-new-line"):_.trailingSpace&&I.push("trailing-space-"+(_.trailingSpace%2?"a":"b")),I.length?I.join(" "):null}function a(_,I){return _.match(R,!0)?m(I):void 0}function d(_,I){var Y=I.text(_,I);if(typeof Y!="undefined")return Y;if(I.list)return I.list=null,m(I);if(I.taskList){var ee=_.match(y,!0)[1]===" ";return ee?I.taskOpen=!0:I.taskClosed=!0,L.highlightFormatting&&(I.formatting="task"),I.taskList=!1,m(I)}if(I.taskOpen=!1,I.taskClosed=!1,I.header&&_.match(/^#+$/,!0))return L.highlightFormatting&&(I.formatting="header"),m(I);var oe=_.next();if(I.linkTitle){I.linkTitle=!1;var he=oe;oe==="("&&(he=")"),he=(he+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+he+"\\\\]+|\\\\\\\\|\\\\.)"+he;if(_.match(new RegExp(Le),!0))return G.linkHref}if(oe==="`"){var xe=I.formatting;L.highlightFormatting&&(I.formatting="code"),_.eatWhile("`");var Ae=_.current().length;if(I.code==0&&(!I.quote||Ae==1))return I.code=Ae,m(I);if(Ae==I.code){var Te=m(I);return I.code=0,Te}else return I.formatting=xe,m(I)}else if(I.code)return m(I);if(oe==="\\"&&(_.next(),L.highlightFormatting)){var Ce=m(I),pe=G.formatting+"-escape";return Ce?Ce+" "+pe:pe}if(oe==="!"&&_.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return I.imageMarker=!0,I.image=!0,L.highlightFormatting&&(I.formatting="image"),m(I);if(oe==="["&&I.imageMarker&&_.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return I.imageMarker=!1,I.imageAltText=!0,L.highlightFormatting&&(I.formatting="image"),m(I);if(oe==="]"&&I.imageAltText){L.highlightFormatting&&(I.formatting="image");var Ce=m(I);return I.imageAltText=!1,I.image=!1,I.inline=I.f=E,Ce}if(oe==="["&&!I.image)return I.linkText&&_.match(/^.*?\]/)||(I.linkText=!0,L.highlightFormatting&&(I.formatting="link")),m(I);if(oe==="]"&&I.linkText){L.highlightFormatting&&(I.formatting="link");var Ce=m(I);return I.linkText=!1,I.inline=I.f=_.match(/\(.*?\)| ?\[.*?\]/,!1)?E:d,Ce}if(oe==="<"&&_.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){I.f=I.inline=o,L.highlightFormatting&&(I.formatting="link");var Ce=m(I);return Ce?Ce+=" ":Ce="",Ce+G.linkInline}if(oe==="<"&&_.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){I.f=I.inline=o,L.highlightFormatting&&(I.formatting="link");var Ce=m(I);return Ce?Ce+=" ":Ce="",Ce+G.linkEmail}if(L.xml&&oe==="<"&&_.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=_.string.indexOf(">",_.pos);if(de!=-1){var re=_.string.substring(_.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(I.md_inside=!0)}return _.backUp(1),I.htmlState=le.startState(J),h(_,I,D)}if(L.xml&&oe==="<"&&_.match(/^\/\w*?>/))return I.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var ce=1,ae=_.pos==1?" ":_.string.charAt(_.pos-2);ce<3&&_.eat(oe);)ce++;var we=_.peek()||" ",De=!/\s/.test(we)&&(!c.test(we)||/\s/.test(ae)||c.test(ae)),ye=!/\s/.test(ae)&&(!c.test(ae)||/\s/.test(we)||c.test(we)),Me=null,Pe=null;if(ce%2&&(!I.em&&De&&(oe==="*"||!ye||c.test(ae))?Me=!0:I.em==oe&&ye&&(oe==="*"||!De||c.test(we))&&(Me=!1)),ce>1&&(!I.strong&&De&&(oe==="*"||!ye||c.test(ae))?Pe=!0:I.strong==oe&&ye&&(oe==="*"||!De||c.test(we))&&(Pe=!1)),Pe!=null||Me!=null){L.highlightFormatting&&(I.formatting=Me==null?"strong":Pe==null?"em":"strong em"),Me===!0&&(I.em=oe),Pe===!0&&(I.strong=oe);var Te=m(I);return Me===!1&&(I.em=!1),Pe===!1&&(I.strong=!1),Te}}else if(oe===" "&&(_.eat("*")||_.eat("_"))){if(_.peek()===" ")return m(I);_.backUp(1)}if(L.strikethrough){if(oe==="~"&&_.eatWhile(oe)){if(I.strikethrough){L.highlightFormatting&&(I.formatting="strikethrough");var Te=m(I);return I.strikethrough=!1,Te}else if(_.match(/^[^\s]/,!1))return I.strikethrough=!0,L.highlightFormatting&&(I.formatting="strikethrough"),m(I)}else if(oe===" "&&_.match(/^~~/,!0)){if(_.peek()===" ")return m(I);_.backUp(2)}}if(L.emoji&&oe===":"&&_.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){I.emoji=!0,L.highlightFormatting&&(I.formatting="emoji");var Ne=m(I);return I.emoji=!1,Ne}return oe===" "&&(_.match(/^ +$/,!1)?I.trailingSpace++:I.trailingSpace&&(I.trailingSpaceNewLine=!0)),m(I)}function o(_,I){var Y=_.next();if(Y===">"){I.f=I.inline=d,L.highlightFormatting&&(I.formatting="link");var ee=m(I);return ee?ee+=" ":ee="",ee+G.linkInline}return _.match(/^[^>]+/,!0),G.linkInline}function E(_,I){if(_.eatSpace())return null;var Y=_.next();return Y==="("||Y==="["?(I.f=I.inline=x(Y==="("?")":"]"),L.highlightFormatting&&(I.formatting="link-string"),I.linkHref=!0,m(I)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(_){return function(I,Y){var ee=I.next();if(ee===_){Y.f=Y.inline=d,L.highlightFormatting&&(Y.formatting="link-string");var oe=m(Y);return Y.linkHref=!1,oe}return I.match(b[_]),Y.linkHref=!0,m(Y)}}function N(_,I){return _.match(/^([^\]\\]|\\.)*\]:/,!1)?(I.f=U,_.next(),L.highlightFormatting&&(I.formatting="link"),I.linkText=!0,m(I)):u(_,I,d)}function U(_,I){if(_.match(/^\]:/,!0)){I.f=I.inline=K,L.highlightFormatting&&(I.formatting="link");var Y=m(I);return I.linkText=!1,Y}return _.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function K(_,I){return _.eatSpace()?null:(_.match(/^[^\s]+/,!0),_.peek()===void 0?I.linkTitle=!0:_.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),I.f=I.inline=d,G.linkHref+" url")}var V={startState:function(){return{f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:d,text:a,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(_){return{f:_.f,prevLine:_.prevLine,thisLine:_.thisLine,block:_.block,htmlState:_.htmlState&&le.copyState(J,_.htmlState),indentation:_.indentation,localMode:_.localMode,localState:_.localMode?le.copyState(_.localMode,_.localState):null,inline:_.inline,text:_.text,formatting:!1,linkText:_.linkText,linkTitle:_.linkTitle,linkHref:_.linkHref,code:_.code,em:_.em,strong:_.strong,strikethrough:_.strikethrough,emoji:_.emoji,header:_.header,setext:_.setext,hr:_.hr,taskList:_.taskList,list:_.list,listStack:_.listStack.slice(0),quote:_.quote,indentedCode:_.indentedCode,trailingSpace:_.trailingSpace,trailingSpaceNewLine:_.trailingSpaceNewLine,md_inside:_.md_inside,fencedEndRE:_.fencedEndRE}},token:function(_,I){if(I.formatting=!1,_!=I.thisLine.stream){if(I.header=0,I.hr=!1,_.match(/^\s*$/,!0))return p(I),null;if(I.prevLine=I.thisLine,I.thisLine={stream:_},I.taskList=!1,I.trailingSpace=0,I.trailingSpaceNewLine=!1,!I.localState&&(I.f=I.block,I.f!=D)){var Y=_.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(I.indentation=Y,I.indentationDiff=null,Y>0)return null}}return I.f(_,I)},innerMode:function(_){return _.block==D?{state:_.htmlState,mode:J}:_.localState?{state:_.localState,mode:_.localMode}:{state:_,mode:V}},indent:function(_,I,Y){return _.block==D&&J.indent?J.indent(_.htmlState,I,Y):_.localState&&_.localMode.indent?_.localMode.indent(_.localState,I,Y):le.Pass},blankLine:p,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return V},"xml"),le.defineMIME("text/markdown","markdown"),le.defineMIME("text/x-markdown","markdown")})},lzim:function(Ke,Ie,Z){"use strict";var le=Z("E7E6"),q=Z.n(le);Z.d(Ie,"A",function(){return q.a});var L=Z("/GNS"),J=Z.n(L);Z.d(Ie,"z",function(){return J.a});var B=Z("FOrL"),M=Z.n(B);Z.d(Ie,"t",function(){return M.a});var G=Z("HpTS"),F=Z.n(G);Z.d(Ie,"B",function(){return F.a});var P=Z("tWlo"),k=Z.n(P);Z.d(Ie,"b",function(){return k.a});var y=Z("7ZXX"),C=Z.n(y);Z.d(Ie,"n",function(){return C.a});var O=Z("GABl"),R=Z.n(O);Z.d(Ie,"g",function(){return R.a});var A=Z("onxn"),S=Z.n(A);Z.d(Ie,"p",function(){return S.a});var c=Z("nKGa"),s=Z.n(c);Z.d(Ie,"o",function(){return s.a});var u=Z("4qgm"),h=Z.n(u);Z.d(Ie,"D",function(){return h.a});var T=Z("JeFH"),p=Z.n(T);Z.d(Ie,"c",function(){return p.a});var f=Z("ji0R"),D=Z.n(f);Z.d(Ie,"k",function(){return D.a});var v=Z("W6BS"),m=Z.n(v);Z.d(Ie,"E",function(){return m.a});var a=Z("kPYp"),d=Z.n(a);Z.d(Ie,"F",function(){return d.a});var o=Z("nukY"),E=Z.n(o),b=Z("4u4S"),x=Z.n(b),N=Z("yslc"),U=Z.n(N),K=Z("l2Kq"),V=Z.n(K),_=Z("RMFE"),I=Z.n(_);Z.d(Ie,"q",function(){return I.a});var Y=Z("TGq3"),ee=Z.n(Y);Z.d(Ie,"r",function(){return ee.a});var oe=Z("SMhR"),he=Z.n(oe);Z.d(Ie,"C",function(){return he.a});var Le=Z("8/bI"),xe=Z.n(Le);Z.d(Ie,"l",function(){return xe.a});var Ae=Z("JWDV"),Te=Z.n(Ae);Z.d(Ie,"e",function(){return Te.a});var Ce=Z("Xsq0"),pe=Z.n(Ce);Z.d(Ie,"s",function(){return pe.a});var de=Z("Ohmc"),re=Z.n(de);Z.d(Ie,"d",function(){return re.a});var ce=Z("csWT"),ae=Z.n(ce);Z.d(Ie,"f",function(){return ae.a});var we=Z("7v3h"),De=Z.n(we);Z.d(Ie,"m",function(){return De.a});var ye=Z("cRFk"),Me=Z.n(ye);Z.d(Ie,"y",function(){return Me.a});var Pe=Z("kPWJ"),Ne=Z.n(Pe);Z.d(Ie,"x",function(){return Ne.a});var Fe=Z("qgvg"),Be=Z.n(Fe);Z.d(Ie,"u",function(){return Be.a});var Ue=Z("FPkq"),nt=Z.n(Ue);Z.d(Ie,"w",function(){return nt.a});var it=Z("A/g1"),$e=Z.n(it);Z.d(Ie,"h",function(){return $e.a});var tt=Z("Nmxd"),ct=Z.n(tt);Z.d(Ie,"i",function(){return ct.a});var et=Z("5D2P"),ot=Z.n(et);Z.d(Ie,"j",function(){return ot.a});var Oe=Z("djh8"),ht=Z.n(Oe);Z.d(Ie,"v",function(){return ht.a});var st=Z("Jq4h"),je=Z.n(st);Z.d(Ie,"a",function(){return je.a})},nKGa:function(Ke,Ie,Z){Ke.exports=Z.p+"static/export_exercise-template.f7655c19.png"},nukY:function(Ke,Ie){Ke.exports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SGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Ke,Ie,Z){(function(le){le(Z("VrN/"))})(function(le){"use strict";var q=le.Pos;function L(c,s){return c.line-s.line||c.ch-s.ch}var J="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=J+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+J+"]["+B+"]*)","g");function G(c,s,u,h){this.line=s,this.ch=u,this.cm=c,this.text=c.getLine(s),this.min=h?Math.max(h.from,c.firstLine()):c.firstLine(),this.max=h?Math.min(h.to-1,c.lastLine()):c.lastLine()}function F(c,s){var u=c.cm.getTokenTypeAt(q(c.line,s));return u&&/\btag\b/.test(u)}function P(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function k(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function y(c){for(;;){var s=c.text.indexOf(">",c.ch);if(s==-1){if(P(c))continue;return}if(!F(c,s+1)){c.ch=s+1;continue}var u=c.text.lastIndexOf("/",s),h=u>-1&&!/\S/.test(c.text.slice(u+1,s));return c.ch=s+1,h?"selfClose":"regular"}}function C(c){for(;;){var s=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(s==-1){if(k(c))continue;return}if(!F(c,s+1)){c.ch=s;continue}M.lastIndex=s,c.ch=s;var u=M.exec(c.text);if(u&&u.index==s)return u}}function O(c){for(;;){M.lastIndex=c.ch;var s=M.exec(c.text);if(!s){if(P(c))continue;return}if(!F(c,s.index+1)){c.ch=s.index+1;continue}return c.ch=s.index+s[0].length,s}}function R(c){for(;;){var s=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(s==-1){if(k(c))continue;return}if(!F(c,s+1)){c.ch=s;continue}var u=c.text.lastIndexOf("/",s),h=u>-1&&!/\S/.test(c.text.slice(u+1,s));return c.ch=s+1,h?"selfClose":"regular"}}function A(c,s){for(var u=[];;){var h=O(c),T,p=c.line,f=c.ch-(h?h[0].length:0);if(!h||!(T=y(c)))return;if(T=="selfClose")continue;if(h[1]){for(var D=u.length-1;D>=0;--D)if(u[D]==h[2]){u.length=D;break}if(D<0&&(!s||s==h[2]))return{tag:h[2],from:q(p,f),to:q(c.line,c.ch)}}else u.push(h[2])}}function S(c,s){for(var u=[];;){var h=R(c);if(!h)return;if(h=="selfClose"){C(c);continue}var T=c.line,p=c.ch,f=C(c);if(!f)return;if(f[1])u.push(f[2]);else{for(var D=u.length-1;D>=0;--D)if(u[D]==f[2]){u.length=D;break}if(D<0&&(!s||s==f[2]))return{tag:f[2],from:q(c.line,c.ch),to:q(T,p)}}}}le.registerHelper("fold","xml",function(c,s){for(var u=new G(c,s.line,0);;){var h=O(u);if(!h||u.line!=s.line)return;var T=y(u);if(!T)return;if(!h[1]&&T!="selfClose"){var p=q(u.line,u.ch),f=A(u,h[2]);return f&&L(f.from,p)>0?{from:p,to:f.from}:null}}}),le.findMatchingTag=function(c,s,u){var h=new G(c,s.line,s.ch,u);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var T=y(h),p=T&&q(h.line,h.ch),f=T&&C(h);if(!T||!f||L(h,s)>0)return;var D={from:q(h.line,h.ch),to:p,tag:f[2]};return T=="selfClose"?{open:D,close:null,at:"open"}:f[1]?{open:S(h,f[2]),close:D,at:"close"}:(h=new G(c,p.line,p.ch,u),{open:D,close:A(h,f[2]),at:"open"})},le.findEnclosingTag=function(c,s,u,h){for(var T=new G(c,s.line,s.ch,u);;){var p=S(T,h);if(!p)break;var f=new G(c,s.line,s.ch,u),D=A(f,p.tag);if(D)return{open:p,close:D}}},le.scanForClosingTag=function(c,s,u,h){var T=new G(c,s.line,s.ch,h?{from:0,to:h}:null);return A(T,u)}})},p5ED:function(Ke,Ie,Z){"use strict";var le=Z("+L6B"),q=Z("2/Rp"),L=Z("5Dmo"),J=Z("3S7+"),B=Z("k1fw"),M=Z("9og8"),G=Z("tJVT"),F=Z("WmNS"),P=Z.n(F),k=Z("q1tI"),y=Z.n(k),C=Z("vHTk"),O=Z.n(C),R=Z("yEEn"),A=Z("ZW9T"),S=Z("1vsH"),c=Z("V0Rq"),s=Z("m3rI"),u=function(T){var p=T.name,f=T.data,D=T.theme,v=T.type,m=T.filename,a=T.monacoEditor,d=T.className,o=T.style,E=T.close,b=T.onClose,x=T.hasMask,N=T.otherData,U=N===void 0?{}:N,K=Object(k.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),V=Object(G.a)(K,2),_=V[0],I=V[1],Y=Object(k.useState)(""),ee=Object(G.a)(Y,2),oe=ee[0],he=ee[1],Le=Object(k.useState)(),xe=Object(G.a)(Le,2),Ae=xe[0],Te=xe[1],Ce=window.ENV==="build"?"/react/build/office.html":"/office.html",pe,de=1024*1024,re=10*de,ce=Object(k.useRef)();v==="office"&&(pe=Object(S.P)(f).filesize,pe>re&&(v="other")),m&&(a.filename=m),Object(k.useEffect)(function(){var ye,Me,Pe=(ye=document.cookie)===null||ye===void 0||((Me=ye.replace(/\s/g,""))===null||Me===void 0)?void 0:Me.split(";");Pe==null||Pe.map(function(Ne){var Fe=Ne.split("=");Fe[0]==="_educoder_session"&&he(Fe[1])})},[]),Object(k.useEffect)(function(){v==="office"&&ae()},[v]);var ae=function(){var ye=Object(M.a)(P.a.mark(function Me(){var Pe,Ne,Fe;return P.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return console.log("data:",f),Pe=f,f.startsWith("http")||(Pe=location.origin+Pe),Ne=new URL(Pe).pathname.split("/").pop(),Ue.next=6,Object(c.U)({attachment_id:Ne});case 6:Fe=Ue.sent,Te(Fe);case 8:case"end":return Ue.stop()}},Me)}));return function(){return ye.apply(this,arguments)}}(),we=function(){if(f.startsWith("http")||f.startsWith("blob:")){De();return}Object(S.x)(m||"educoder",f,m)},De=function(){Object(S.v)(m||"educoder",decodeURIComponent(f))};return y.a.createElement("div",{style:Object(B.a)({},o||{}),className:"".concat(x&&O.a.bgBlack," ").concat(v?O.a.wrp:"hide")},E&&y.a.createElement("div",{className:O.a.close,ref:ce},y.a.createElement(J.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ce.current}},y.a.createElement("span",{onClick:De},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(J.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ce.current}},y.a.createElement("span",{className:"",onClick:function(){b(),Te(null)}},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(O.a[d]," ").concat(d," ").concat(O.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&y.a.createElement(A.b,a)),v==="audio"&&y.a.createElement("audio",{src:"".concat((f==null?void 0:f.indexOf("http://"))>-1||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),v==="video"&&y.a.createElement(y.a.Fragment,null,(f==null?void 0:f.indexOf("/api"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),v==="office"&&Ae&&y.a.createElement("iframe",{src:"".concat(Ce,"?key=").concat(Ae.key,"&url=").concat(s.a.API_SERVER+Ae.url,"&callbackUrl=").concat(s.a.API_SERVER+Ae.callbackUrl,"&fileType=").concat(Ae.fileType,"&title=").concat(Ae.title,"&model=view")}),(v==="xlsx"||v==="doc"||v==="pptx"||v==="docx")&&y.a.createElement("iframe",{src:"".concat(Ce,"?key=").concat(U.key,"&url=").concat(s.a.API_SERVER+U.url,"&callbackUrl=").concat(s.a.API_SERVER+U.callbackUrl,"&fileType=").concat(U.fileType,"&title=").concat(U.title,"&model=").concat(U.model)}),v==="html"&&y.a.createElement("iframe",{src:f+"&disposition=inline"}),v==="pdf"&&y.a.createElement("embed",{className:O.a.embed,src:f,type:"application/pdf"}),v==="image"&&y.a.createElement("img",{src:"".concat((f==null?void 0:f.indexOf("http://"))>-1||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(f)}),v==="other"&&y.a.createElement("div",null,y.a.createElement(q.a,{type:"primary",size:"large",onClick:we},y.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&y.a.createElement(q.a,{type:"primary",size:"large",onClick:we},y.a.createElement(R.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ie.a=u},"p77/":function(Ke,Ie,Z){},pAaK:function(Ke,Ie,Z){Ke.exports={flex_box_center:"flex_box_center___3d46B",flex_space_between:"flex_space_between___3a07p",flex_box_vertical_center:"flex_box_vertical_center___3U-TP",flex_box_center_end:"flex_box_center_end___2f78_",flex_box_column:"flex_box_column___2G3XJ",bg:"bg___1MTM3",title:"title___161Lo",replyList:"replyList___3TAxX","nav-tab":"nav-tab___2QveN",buttonFixed:"buttonFixed___3jsue",exitComment:"exitComment___2ZV_r",nextComment:"nextComment___1M4hZ",modal:"modal___14a4J",MdEditor:"MdEditor___2fxIJ"}},qgvg:function(Ke,Ie){Ke.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCx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gBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"rAM+":function(Ke,Ie,Z){"use strict";Z.d(Ie,"a",function(){return q});var le=Z("Qw5x");function q(L,J){var B;if(typeof Symbol=="undefined"||L[Symbol.iterator]==null){if(Array.isArray(L)||(B=Object(le.a)(L))||J&&L&&typeof L.length=="number"){B&&(L=B);var M=0,G=function(){};return{s:G,n:function(){return M>=L.length?{done:!0}:{done:!1,value:L[M++]}},e:function(C){throw C},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var F=!0,P=!1,k;return{s:function(){B=L[Symbol.iterator]()},n:function(){var C=B.next();return F=C.done,C},e:function(C){P=!0,k=C},f:function(){try{!F&&B.return!=null&&B.return()}finally{if(P)throw k}}}}},rUJ1:function(Ke,Ie){const Z=/[&<>"']/,le=/[&<>"']/g,q=/[<>"']|&(?!#?\w+;)/,L=/[<>"']|&(?!#?\w+;)/g,J={"&":"&","<":"<",">":">",'"':""","'":"'"},B=v=>J[v];function M(v,m){if(m){if(Z.test(v))return v.replace(le,B)}else if(q.test(v))return v.replace(L,B);return v}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(v){return v.replace(G,(m,a)=>(a=a.toLowerCase(),a==="colon"?":":a.charAt(0)==="#"?a.charAt(1)==="x"?String.fromCharCode(parseInt(a.substring(2),16)):String.fromCharCode(+a.substring(1)):""))}const P=/(^|[^\[])\^/g;function k(v,m){v=v.source||v,m=m||"";const a={replace:(d,o)=>(o=o.source||o,o=o.replace(P,"$1"),v=v.replace(d,o),a),getRegex:()=>new RegExp(v,m)};return a}const y=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(v,m,a){if(v){let d;try{d=decodeURIComponent(F(a)).replace(y,"").toLowerCase()}catch(o){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}m&&!C.test(a)&&(a=s(m,a));try{a=encodeURI(a).replace(/%25/g,"%")}catch(d){return null}return a}const R={},A=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(v,m){R[" "+v]||(A.test(v)?R[" "+v]=v+"/":R[" "+v]=p(v,"/",!0)),v=R[" "+v];const a=v.indexOf(":")===-1;return m.substring(0,2)==="//"?a?m:v.replace(S,"$1")+m:m.charAt(0)==="/"?a?m:v.replace(c,"$1")+m:v+m}const u={exec:function(){}};function h(v){let m=1,a,d;for(;m<arguments.length;m++){a=arguments[m];for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(v[d]=a[d])}return v}function T(v,m){const a=v.replace(/\|/g,(E,b,x)=>{let N=!1,U=b;for(;--U>=0&&x[U]==="\\";)N=!N;return N?"|":" |"}),d=a.split(/ \|/);let o=0;if(d.length>m)d.splice(m);else for(;d.length<m;)d.push("");for(;o<d.length;o++)d[o]=d[o].trim().replace(/\\\|/g,"|");return d}function p(v,m,a){const d=v.length;if(d===0)return"";let o=0;for(;o<d;){const E=v.charAt(d-o-1);if(E===m&&!a)o++;else if(E!==m&&a)o++;else break}return v.substr(0,d-o)}function f(v,m){if(v.indexOf(m[1])===-1)return-1;const a=v.length;let d=0,o=0;for(;o<a;o++)if(v[o]==="\\")o++;else if(v[o]===m[0])d++;else if(v[o]===m[1]&&(d--,d<0))return o;return-1}function D(v){v&&v.sanitize&&!v.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")}Ke.exports={escape:M,unescape:F,edit:k,cleanUrl:O,resolveUrl:s,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yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(Ke,Ie,Z){typeof window!="undefined"&&function(q,L){Ke.exports=L()}(this,function(){return function(le){var q={};function L(J){if(q[J])return q[J].exports;var B=q[J]={i:J,l:!1,exports:{}};return le[J].call(B.exports,B,B.exports,L),B.l=!0,B.exports}return L.m=le,L.c=q,L.d=function(J,B,M){L.o(J,B)||Object.defineProperty(J,B,{enumerable:!0,get:M})},L.r=function(J){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})},L.t=function(J,B){if(B&1&&(J=L(J)),B&8)return J;if(B&4&&typeof J=="object"&&J&&J.__esModule)return J;var M=Object.create(null);if(L.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:J}),B&2&&typeof J!="string")for(var G in J)L.d(M,G,function(F){return J[F]}.bind(null,G));return M},L.n=function(J){var B=J&&J.__esModule?function(){return J.default}:function(){return J};return L.d(B,"a",B),B},L.o=function(J,B){return Object.prototype.hasOwnProperty.call(J,B)},L.p="/dist/",L(L.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(le,q,L){"use strict";var J=Object.prototype.hasOwnProperty,B="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(B=!1));function G(y,C,O){this.fn=y,this.context=C,this.once=O||!1}function F(y,C,O,R,A){if(typeof O!="function")throw new TypeError("The listener must be a function");var S=new G(O,R||y,A),c=B?B+C:C;return y._events[c]?y._events[c].fn?y._events[c]=[y._events[c],S]:y._events[c].push(S):(y._events[c]=S,y._eventsCount++),y}function P(y,C){--y._eventsCount===0?y._events=new M:delete y._events[C]}function k(){this._events=new M,this._eventsCount=0}k.prototype.eventNames=function(){var C=[],O,R;if(this._eventsCount===0)return C;for(R in O=this._events)J.call(O,R)&&C.push(B?R.slice(1):R);return Object.getOwnPropertySymbols?C.concat(Object.getOwnPropertySymbols(O)):C},k.prototype.listeners=function(C){var O=B?B+C:C,R=this._events[O];if(!R)return[];if(R.fn)return[R.fn];for(var A=0,S=R.length,c=new Array(S);A<S;A++)c[A]=R[A].fn;return c},k.prototype.listenerCount=function(C){var O=B?B+C:C,R=this._events[O];return R?R.fn?1:R.length:0},k.prototype.emit=function(C,O,R,A,S,c){var s=B?B+C:C;if(!this._events[s])return!1;var u=this._events[s],h=arguments.length,T,p;if(u.fn){u.once&&this.removeListener(C,u.fn,void 0,!0);switch(h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,O),!0;case 3:return u.fn.call(u.context,O,R),!0;case 4:return u.fn.call(u.context,O,R,A),!0;case 5:return u.fn.call(u.context,O,R,A,S),!0;case 6:return u.fn.call(u.context,O,R,A,S,c),!0}for(p=1,T=new Array(h-1);p<h;p++)T[p-1]=arguments[p];u.fn.apply(u.context,T)}else{var f=u.length,D;for(p=0;p<f;p++){u[p].once&&this.removeListener(C,u[p].fn,void 0,!0);switch(h){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,O);break;case 3:u[p].fn.call(u[p].context,O,R);break;case 4:u[p].fn.call(u[p].context,O,R,A);break;default:if(!T)for(D=1,T=new Array(h-1);D<h;D++)T[D-1]=arguments[D];u[p].fn.apply(u[p].context,T)}}}return!0},k.prototype.on=function(C,O,R){return F(this,C,O,R,!1)},k.prototype.once=function(C,O,R){return F(this,C,O,R,!0)},k.prototype.removeListener=function(C,O,R,A){var S=B?B+C:C;if(!this._events[S])return this;if(!O)return P(this,S),this;var c=this._events[S];if(c.fn)c.fn===O&&(!A||c.once)&&(!R||c.context===R)&&P(this,S);else{for(var s=0,u=[],h=c.length;s<h;s++)(c[s].fn!==O||A&&!c[s].once||R&&c[s].context!==R)&&u.push(c[s]);u.length?this._events[S]=u.length===1?u[0]:u:P(this,S)}return this},k.prototype.removeAllListeners=function(C){var O;return C?(O=B?B+C:C,this._events[O]&&P(this,O)):(this._events=new M,this._eventsCount=0),this},k.prototype.off=k.prototype.removeListener,k.prototype.addListener=k.prototype.on,k.prefixed=B,k.EventEmitter=k,le.exports=k},"./node_modules/url-toolkit/src/url-toolkit.js":function(le,q,L){(function(J){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(k,y,C){if(C=C||{},k=k.trim(),y=y.trim(),!y){if(!C.alwaysNormalize)return k;var O=P.parseURL(k);if(!O)throw new Error("Error trying to parse base URL.");return O.path=P.normalizePath(O.path),P.buildURLFromParts(O)}var R=P.parseURL(y);if(!R)throw new Error("Error trying to parse relative URL.");if(R.scheme)return C.alwaysNormalize?(R.path=P.normalizePath(R.path),P.buildURLFromParts(R)):y;var A=P.parseURL(k);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var S=M.exec(A.path);A.netLoc=S[1],A.path=S[2]}A.netLoc&&!A.path&&(A.path="/");var c={scheme:A.scheme,netLoc:R.netLoc,path:null,params:R.params,query:R.query,fragment:R.fragment};if(!R.netLoc&&(c.netLoc=A.netLoc,R.path[0]!=="/"))if(!R.path)c.path=A.path,R.params||(c.params=A.params,R.query||(c.query=A.query));else{var s=A.path,u=s.substring(0,s.lastIndexOf("/")+1)+R.path;c.path=P.normalizePath(u)}return c.path===null&&(c.path=C.alwaysNormalize?P.normalizePath(R.path):R.path),P.buildURLFromParts(c)},parseURL:function(k){var y=B.exec(k);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(k){for(k=k.split("").reverse().join("").replace(G,"");k.length!==(k=k.replace(F,"")).length;);return k.split("").reverse().join("")},buildURLFromParts:function(k){return k.scheme+k.netLoc+k.path+k.params+k.query+k.fragment}};le.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(le,q,L){function J(C){var O={};function R(S){if(O[S])return O[S].exports;var c=O[S]={i:S,l:!1,exports:{}};return C[S].call(c.exports,c,c.exports,R),c.l=!0,c.exports}R.m=C,R.c=O,R.i=function(S){return S},R.d=function(S,c,s){R.o(S,c)||Object.defineProperty(S,c,{configurable:!1,enumerable:!0,get:s})},R.r=function(S){Object.defineProperty(S,"__esModule",{value:!0})},R.n=function(S){var c=S&&S.__esModule?function(){return S.default}:function(){return S};return R.d(c,"a",c),c},R.o=function(S,c){return Object.prototype.hasOwnProperty.call(S,c)},R.p="/",R.oe=function(S){throw console.error(S),S};var A=R(R.s=ENTRY_MODULE);return A.default||A}var B="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function G(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(C){return!isNaN(1*C)}function P(C,O,R){var A={};A[R]=[];var S=O.toString(),c=S.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return A;for(var s=c[1],u=new RegExp("(\\\\n|\\W)"+G(s)+M,"g"),h;h=u.exec(S);){if(h[3]==="dll-reference")continue;A[R].push(h[3])}for(u=new RegExp("\\("+G(s)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+M,"g");h=u.exec(S);)C[h[2]]||(A[R].push(h[1]),C[h[2]]=L(h[1]).m),A[h[2]]=A[h[2]]||[],A[h[2]].push(h[4]);for(var T=Object.keys(A),p=0;p<T.length;p++)for(var f=0;f<A[T[p]].length;f++)F(A[T[p]][f])&&(A[T[p]][f]=1*A[T[p]][f]);return A}function k(C){var O=Object.keys(C);return O.reduce(function(R,A){return R||C[A].length>0},!1)}function y(C,O){for(var R={main:[O]},A={main:[]},S={main:{}};k(R);)for(var c=Object.keys(R),s=0;s<c.length;s++){var u=c[s],h=R[u],T=h.pop();if(S[u]=S[u]||{},S[u][T]||!C[u][T])continue;S[u][T]=!0,A[u]=A[u]||[],A[u].push(T);for(var p=P(C,C[u][T],u),f=Object.keys(p),D=0;D<f.length;D++)R[f[D]]=R[f[D]]||[],R[f[D]]=R[f[D]].concat(p[f[D]])}return A}le.exports=function(C,O){O=O||{};var R={main:L.m},A=O.all?{main:Object.keys(R.main)}:y(R,C),S="";Object.keys(A).filter(function(T){return T!=="main"}).forEach(function(T){for(var p=0;A[T][p];)p++;A[T].push(p),R[T][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",S=S+"var "+T+" = ("+J.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+A[T].map(function(f){return""+JSON.stringify(f)+": "+R[T][f].toString()}).join(",")+`});
|
|
`}),S=S+"new (("+J.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+A.main.map(function(T){return""+JSON.stringify(T)+": "+R.main[T].toString()}).join(",")+"}))(self);";var c=new window.Blob([S],{type:"text/javascript"});if(O.bare)return c;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,u=s.createObjectURL(c),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"hlsDefaultConfig",function(){return D}),L.d(q,"mergeConfig",function(){return m}),L.d(q,"enableStreamingMode",function(){return a});var J=L("./src/controller/abr-controller.ts"),B=L("./src/controller/audio-stream-controller.ts"),M=L("./src/controller/audio-track-controller.ts"),G=L("./src/controller/subtitle-stream-controller.ts"),F=L("./src/controller/subtitle-track-controller.ts"),P=L("./src/controller/buffer-controller.ts"),k=L("./src/controller/timeline-controller.ts"),y=L("./src/controller/cap-level-controller.ts"),C=L("./src/controller/fps-controller.ts"),O=L("./src/controller/eme-controller.ts"),R=L("./src/controller/cmcd-controller.ts"),A=L("./src/utils/xhr-loader.ts"),S=L("./src/utils/fetch-loader.ts"),c=L("./src/utils/cues.ts"),s=L("./src/utils/mediakeys-helper.ts"),u=L("./src/utils/logger.ts");function h(){return h=Object.assign||function(d){for(var o=1;o<arguments.length;o++){var E=arguments[o];for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(d[b]=E[b])}return d},h.apply(this,arguments)}function T(d,o){var E=Object.keys(d);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(d);o&&(b=b.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),E.push.apply(E,b)}return E}function p(d){for(var o=1;o<arguments.length;o++){var E=arguments[o]!=null?arguments[o]:{};o%2?T(Object(E),!0).forEach(function(b){f(d,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(E)):T(Object(E)).forEach(function(b){Object.defineProperty(d,b,Object.getOwnPropertyDescriptor(E,b))})}return d}function f(d,o,E){return o in d?Object.defineProperty(d,o,{value:E,enumerable:!0,configurable:!0,writable:!0}):d[o]=E,d}var D=p(p({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:A.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:J.default,bufferController:P.default,capLevelController:y.default,fpsController:C.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:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},v()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:F.default,timelineController:k.TimelineController,audioStreamController:B.default,audioTrackController:M.default,emeController:O.default,cmcdController:R.default});function v(){return{cueHandler:c.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 m(d,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},d,o)}function a(d){var o=d.loader;if(o!==S.default&&o!==A.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var E=Object(S.fetchSupported)();E&&(d.loader=S.default,d.progressive=!0,d.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/polyfills/number.ts"),B=L("./src/utils/ewma-bandwidth-estimator.ts"),M=L("./src/events.ts"),G=L("./src/utils/buffer-helper.ts"),F=L("./src/errors.ts"),P=L("./src/types/loader.ts"),k=L("./src/utils/logger.ts");function y(R,A){for(var S=0;S<A.length;S++){var c=A[S];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(R,c.key,c)}}function C(R,A,S){return A&&y(R.prototype,A),S&&y(R,S),R}var O=function(){function R(S){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=S;var c=S.config;this.bwEstimator=new B.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var A=R.prototype;return A.registerListeners=function(){var c=this.hls;c.on(M.Events.FRAG_LOADING,this.onFragLoading,this),c.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(M.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var c=this.hls;c.off(M.Events.FRAG_LOADING,this.onFragLoading,this),c.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(M.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},A.onFragLoading=function(c,s){var u=s.frag;if(u.type===P.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=u,this.partCurrent=(h=s.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(c,s){var u=this.hls.config;s.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,u=this.hls,h=u.autoLevelEnabled,T=u.config,p=u.media;if(!c||!p)return;var f=s?s.stats:c.stats,D=s?s.duration:c.duration;if(f.aborted){k.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||p.paused||!p.playbackRate||!p.readyState)return;var v=performance.now()-f.loading.start,m=Math.abs(p.playbackRate);if(v<=500*D/m)return;var a=u.levels,d=u.minAutoLevel,o=a[c.level],E=f.total||Math.max(f.loaded,Math.round(D*o.maxBitrate/8)),b=Math.max(1,f.bwEstimate?f.bwEstimate/8:f.loaded*1e3/v),x=(E-f.loaded)/b,N=p.currentTime,U=(G.BufferHelper.bufferInfo(p,N,T.maxBufferHole).end-N)/m;if(U>=2*D/m||x<=U)return;var K=Number.POSITIVE_INFINITY,V;for(V=c.level-1;V>d;V--){var _=a[V].maxBitrate;if(K=D*_/(8*.8*b),K<U)break}if(K>=x)return;var I=this.bwEstimator.getEstimate();k.logger.warn("Fragment "+c.sn+(s?" part "+s.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+V+`
|
|
Current BW estimate: `+(Object(J.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+x.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+K.toFixed(3)+` s
|
|
Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=V,this.bwEstimator.sample(v,f.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),u.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:f})},A.onFragLoaded=function(c,s){var u=s.frag,h=s.part;if(u.type===P.PlaylistLevelType.MAIN&&Object(J.isFiniteNumber)(u.sn)){var T=h?h.stats:u.stats,p=h?h.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var f=this.hls.levels[u.level],D=(f.loaded?f.loaded.bytes:0)+T.loaded,v=(f.loaded?f.loaded.duration:0)+p;f.loaded={bytes:D,duration:v},f.realBitrate=Math.round(8*D/v)}if(u.bitrateTest){var m={stats:T,frag:u,part:h,id:u.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,m),u.bitrateTest=!1}}},A.onFragBuffered=function(c,s){var u=s.frag,h=s.part,T=h?h.stats:u.stats;if(T.aborted)return;if(u.type!==P.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var p=T.parsing.end-T.loading.start;this.bwEstimator.sample(p,T.loaded),T.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},A.onError=function(c,s){switch(s.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},A.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},A.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,u=this.hls,h=u.maxAutoLevel,T=u.config,p=u.minAutoLevel,f=u.media,D=s?s.duration:c?c.duration:0,v=f?f.currentTime:0,m=f&&f.playbackRate!==0?Math.abs(f.playbackRate):1,a=this.bwEstimator?this.bwEstimator.getEstimate():T.abrEwmaDefaultEstimate,d=(G.BufferHelper.bufferInfo(f,v,T.maxBufferHole).end-v)/m,o=this.findBestLevel(a,p,h,d,T.abrBandWidthFactor,T.abrBandWidthUpFactor);if(o>=0)return o;k.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=D?Math.min(D,T.maxStarvationDelay):T.maxStarvationDelay,b=T.abrBandWidthFactor,x=T.abrBandWidthUpFactor;if(!d){var N=this.bitrateTestDelay;if(N){var U=D?Math.min(D,T.maxLoadingDelay):T.maxLoadingDelay;E=U-N,k.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),b=x=1}}return o=this.findBestLevel(a,p,h,d+E,b,x),Math.max(o,0)},A.findBestLevel=function(c,s,u,h,T,p){for(var f,D=this.fragCurrent,v=this.partCurrent,m=this.lastLoadedFragLevel,a=this.hls.levels,d=a[m],o=!!(d!=null&&(f=d.details)!==null&&f!==void 0&&f.live),E=d==null?void 0:d.codecSet,b=v?v.duration:D?D.duration:0,x=u;x>=s;x--){var N=a[x];if(!N||E&&N.codecSet!==E)continue;var U=N.details,K=(v?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||b,V=void 0;x<=m?V=T*c:V=p*c;var _=a[x].maxBitrate,I=_*K/V;if(k.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(V)+"/"+_+"/"+K+"/"+h+"/"+I),V>_&&(!I||o&&!this.bitrateTestDelay||I<h))return x}return-1},C(R,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,s=this.bwEstimator;if(c!==-1&&(!s||!s.canEstimate()))return c;var u=this.getNextABRAutoLevel();return c!==-1&&(u=Math.min(c,u)),u},set:function(c){this._nextAutoLevel=c}}]),R}();q.default=O},"./src/controller/audio-stream-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/polyfills/number.ts"),B=L("./src/controller/base-stream-controller.ts"),M=L("./src/events.ts"),G=L("./src/utils/buffer-helper.ts"),F=L("./src/controller/fragment-tracker.ts"),P=L("./src/types/level.ts"),k=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),C=L("./src/demux/chunk-cache.ts"),O=L("./src/demux/transmuxer-interface.ts"),R=L("./src/types/transmuxer.ts"),A=L("./src/controller/fragment-finders.ts"),S=L("./src/utils/discontinuities.ts"),c=L("./src/errors.ts"),s=L("./src/utils/logger.ts");function u(){return u=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var a in m)Object.prototype.hasOwnProperty.call(m,a)&&(D[a]=m[a])}return D},u.apply(this,arguments)}function h(D,v){D.prototype=Object.create(v.prototype),D.prototype.constructor=D,T(D,v)}function T(D,v){return T=Object.setPrototypeOf||function(a,d){return a.__proto__=d,a},T(D,v)}var p=100,f=function(D){h(v,D);function v(a,d){var o;return o=D.call(this,a,d,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var m=v.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var d=this.hls;d.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(M.Events.ERROR,this.onError,this),d.on(M.Events.BUFFER_RESET,this.onBufferReset,this),d.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var d=this.hls;d.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(M.Events.ERROR,this.onError,this),d.off(M.Events.BUFFER_RESET,this.onBufferReset,this),d.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(d,o){var E=o.frag,b=o.id,x=o.initPTS;if(b==="main"){var N=E.cc;this.initPTS[E.cc]=x,this.log("InitPTS for cc: "+N+" found from main: "+x),this.videoTrackCC=N,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(d){if(!this.levels){this.startPosition=d,this.state=B.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,o>0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},m.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var d,o=this.levels,E=this.trackId,b=o==null||((d=o[E])===null||d===void 0)?void 0:d.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var x,N=performance.now(),U=this.retryDate;(!U||N>=U||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var V=K.frag,_=K.part,I=K.cache,Y=K.complete;if(this.initPTS[V.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var ee=I.flush(),oe={frag:V,part:_,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(oe),Y&&D.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+V.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var he=this.getLoadPosition(),Le=G.BufferHelper.bufferInfo(this.mediaBuffer,he,this.config.maxBufferHole),xe=Object(A.fragmentWithinToleranceTest)(Le.end,this.config.maxFragLookUpTolerance,V);xe<0&&(s.logger.log("Waiting fragment cc ("+V.cc+") @ "+V.start+" cancelled because another fragment at "+Le.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},m.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:d,E=o.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},m.doTickIdle=function(){var d,o,E=this.hls,b=this.levels,x=this.media,N=this.trackId,U=E.config;if(!b||!b[N])return;if(!x&&(this.startFragRequested||!U.startFragPrefetch))return;var K=b[N],V=K.details;if(!V||V.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(V)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,k.PlaylistLevelType.AUDIO));var _=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,k.PlaylistLevelType.AUDIO);if(_===null)return;var I=_.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(I>=Y&&!ee)return;if(!ee&&this._streamEnded(_,V)){E.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var oe=V.fragments,he=oe[0].start,Le=_.end;if(ee){var xe=this.getLoadPosition();Le=xe,V.PTSKnown&&xe<he&&((_.end>he||_.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=he+.05))}var Ae=this.getNextFragment(Le,V);if(!Ae){this.bufferFlushed=!0;return}((d=Ae.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((o=Ae.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(Ae,V):this.loadFragment(Ae,V,Le)},m.getMaxBufferLength=function(){var d=D.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,k.PlaylistLevelType.MAIN);return o===null?d:Math.max(d,o.len)},m.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(d,o){var E=o.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(b){return new P.Level(b)})},m.onAudioTrackSwitching=function(d,o){var E=!!o.url;this.trackId=o.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(p):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(d,o){this.mainDetails=o.details},m.onAudioTrackLoaded=function(d,o){var E,b=this.levels,x=o.details,N=o.id;if(!b){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var U=b[N],K=0;if(x.live||(E=U.details)!==null&&E!==void 0&&E.live){var V=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!V)return;!U.details&&x.hasProgramDateTime&&V.hasProgramDateTime?(Object(S.alignMediaPlaylistByPDT)(x,V),K=x.fragments[0].start):K=this.alignPlaylists(x,U.details)}U.details=x,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(U.details,K),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=B.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(d){var o,E=d.frag,b=d.part,x=d.payload,N=this.config,U=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var V=K[U];console.assert(V,"Audio track is defined on fragment load progress");var _=V.details;console.assert(_,"Audio track details are defined on fragment load progress");var I=N.defaultAudioCodec||V.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new O.default(this.hls,k.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[E.cc],oe=(o=E.initSegment)===null||o===void 0?void 0:o.data;if(ee!==void 0){var he=!1,Le=b?b.index:-1,xe=Le!==-1,Ae=new R.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,x.byteLength,Le,xe);Y.push(x,oe,I,"",E,b,_.totalduration,he,Ae,ee)}else{s.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+_.startSN+" ,"+_.endSN+"],track "+U);var Te=this.waitingData=this.waitingData||{frag:E,part:b,cache:new C.default,complete:!1},Ce=Te.cache;Ce.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,d)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(d,o){var E=o.tracks.audio;E&&(this.mediaBuffer=E.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},m.onFragBuffered=function(d,o){var E=o.frag,b=o.part;if(E.type!==k.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(b?" p: "+b.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,b)},m.onError=function(d,o){switch(o.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.PlaylistLevelType.AUDIO,o);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=o.fatal?B.State.ERROR:B.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var E=!0,b=this.getFwdBufferInfo(this.mediaBuffer,k.PlaylistLevelType.AUDIO);b&&b.len>.5&&(E=!this.reduceMaxBufferLength(b.len)),E&&(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}},m.onBufferFlushed=function(d,o){var E=o.type;E===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(d){var o,E="audio",b=this.hls,x=d.remuxResult,N=d.chunkMeta,U=this.getCurrentContext(N);if(!U){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var K=U.frag,V=U.part,_=x.audio,I=x.text,Y=x.id3,ee=x.initSegment;if(this.fragContextChanged(K))return;if(this.state=B.State.PARSING,this.audioSwitch&&_&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,K,N),b.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:E,tracks:ee.tracks})),_){var oe=_.startPTS,he=_.endPTS,Le=_.startDTS,xe=_.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:he,startDTS:Le,endDTS:xe}),K.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,oe,he,Le,xe),this.bufferFragmentData(_,K,V,N)}if(Y!=null&&(o=Y.samples)!==null&&o!==void 0&&o.length){var Ae=u({frag:K,id:E},Y);b.trigger(M.Events.FRAG_PARSING_METADATA,Ae)}if(I){var Te=u({frag:K,id:E},I);b.trigger(M.Events.FRAG_PARSING_USERDATA,Te)}},m._bufferInitSegment=function(d,o,E){if(this.state!==B.State.PARSING)return;d.video&&delete d.video;var b=d.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(M.Events.BUFFER_CODECS,d);var x=b.initSegment;if(x!=null&&x.byteLength){var N={type:"audio",frag:o,part:null,chunkMeta:E,parent:o.type,data:x};this.hls.trigger(M.Events.BUFFER_APPENDING,N)}this.tick()},m.loadFragment=function(d,o,E){var b=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||b===F.FragmentState.NOT_LOADED||b===F.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):o.live&&!Object(J.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,d,o,E)))},m.completeAudioSwitch=function(){var d=this.hls,o=this.media,E=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:E})},v}(B.default);q.default=f},"./src/controller/audio-track-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts"),B=L("./src/errors.ts"),M=L("./src/controller/base-playlist-controller.ts"),G=L("./src/types/loader.ts");function F(O,R){for(var A=0;A<R.length;A++){var S=R[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(O,S.key,S)}}function P(O,R,A){return R&&F(O.prototype,R),A&&F(O,A),O}function k(O,R){O.prototype=Object.create(R.prototype),O.prototype.constructor=O,y(O,R)}function y(O,R){return y=Object.setPrototypeOf||function(S,c){return S.__proto__=c,S},y(O,R)}var C=function(O){k(R,O);function R(S){var c;return c=O.call(this,S,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var A=R.prototype;return A.registerListeners=function(){var c=this.hls;c.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(J.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var c=this.hls;c.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(J.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,O.prototype.destroy.call(this)},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},A.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},A.onAudioTrackLoaded=function(c,s){var u=s.id,h=s.details,T=this.tracksInGroup[u];if(!T){this.warn("Invalid audio track id "+u);return}var p=T.details;T.details=s.details,this.log("audioTrack "+u+" loaded ["+h.startSN+"-"+h.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,s,p))},A.onLevelLoading=function(c,s){this.switchLevel(s.level)},A.onLevelSwitching=function(c,s){this.switchLevel(s.level)},A.switchLevel=function(c){var s=this.hls.levels[c];if(!(s!=null&&s.audioGroupIds))return;var u=s.audioGroupIds[s.urlId];if(this.groupId!==u){this.groupId=u;var h=this.tracks.filter(function(p){return!u||p.groupId===u});this.selectDefaultTrack&&!h.some(function(p){return p.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var T={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(J.Events.AUDIO_TRACKS_UPDATED,T),this.selectInitialTrack()}},A.onError=function(c,s){if(O.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},A.setAudioTrack=function(c){var s=this.tracksInGroup;if(c<0||c>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=s[this.trackId];this.log("Now switching to audio-track index "+c);var h=s[c],T=h.id,p=h.groupId,f=p===void 0?"":p,D=h.name,v=h.type,m=h.url;if(this.trackId=c,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(J.Events.AUDIO_TRACK_SWITCHING,{id:T,groupId:f,name:D,type:v,url:m}),h.details&&!h.details.live)return;var a=this.switchParams(h.url,u==null?void 0:u.details);this.loadPlaylist(a)},A.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,u=this.findTrackId(s)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(c){for(var s=this.tracksInGroup,u=0;u<s.length;u++){var h=s[u];if((!this.selectDefaultTrack||h.default)&&(!c||c===h.name))return h.id}return-1},A.loadPlaylist=function(c){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var u=s.id,h=s.groupId,T=s.url;if(c)try{T=c.addDirectives(T)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(J.Events.AUDIO_TRACK_LOADING,{url:T,id:u,groupId:h,deliveryDirectives:c||null})}},P(R,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),R}(M.default);q.default=C},"./src/controller/base-playlist-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return P});var J=L("./src/polyfills/number.ts"),B=L("./src/types/level.ts"),M=L("./src/controller/level-helper.ts"),G=L("./src/utils/logger.ts"),F=L("./src/errors.ts"),P=function(){function k(C,O){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,O+":"),this.warn=G.logger.warn.bind(G.logger,O+":"),this.hls=C}var y=k.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(O,R){R.fatal&&R.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(O,R){var A=R==null?void 0:R.renditionReports;if(A)for(var S=0;S<A.length;S++){var c=A[S],s=""+c.URI;if(s===O.substr(-s.length)){var u=parseInt(c["LAST-MSN"]),h=parseInt(c["LAST-PART"]);if(R&&this.hls.config.lowLatencyMode){var T=Math.min(R.age-R.partTarget,R.targetduration);h!==void 0&&T>R.partTarget&&(h+=1)}if(Object(J.isFiniteNumber)(u))return new B.HlsUrlParameters(u,Object(J.isFiniteNumber)(h)?h:void 0,B.HlsSkip.No)}}},y.loadPlaylist=function(O){},y.shouldLoadTrack=function(O){return this.canLoad&&O&&!!O.url&&(!O.details||O.details.live)},y.playlistLoaded=function(O,R,A){var S=this,c=R.details,s=R.stats,u=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-u,c.live||A!=null&&A.live){if(c.reloaded(A),A&&this.log("live playlist "+O+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),A&&c.fragments.length>0&&Object(M.mergeDetails)(A,c),!this.canLoad||!c.live)return;var h,T=void 0,p=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var f=this.hls.config.lowLatencyMode,D=c.lastPartSn,v=c.endSN,m=c.lastPartIndex,a=m!==-1,d=D===v,o=f?0:m;a?(T=d?v+1:D,p=d?o:m+1):T=v+1;var E=c.age,b=E+c.ageHeader,x=Math.min(b-c.partTarget,c.targetduration*1.5);if(x>0){if(A&&x>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+x+" with playlist age: "+c.age),x=0;else{var N=Math.floor(x/c.targetduration);if(T+=N,p!==void 0){var U=Math.round(x%c.targetduration/c.partTarget);p+=U}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+x+" skip sn "+N+" to part "+p)}c.tuneInGoal=x}if(h=this.getDeliveryDirectives(c,R.deliveryDirectives,T,p),f||!d){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(c,R.deliveryDirectives,T,p);var K=Object(M.computeReloadInterval)(c,s);T!==void 0&&c.canBlockReload&&(K-=c.partTarget||1),this.log("reload live playlist "+O+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return S.loadPlaylist(h)},K)}else this.clearTimer()},y.getDeliveryDirectives=function(O,R,A,S){var c=Object(B.getSkipValue)(O,A);return R!=null&&R.skip&&O.deltaUpdateFailed&&(A=R.msn,S=R.part,c=B.HlsSkip.No),new B.HlsUrlParameters(A,S,c)},y.retryLoadingOrFail=function(O){var R=this,A=this.hls.config,S=this.retryCount<A.levelLoadingMaxRetry;if(S){var c;if(this.retryCount++,O.details.indexOf("LoadTimeOut")>-1&&(c=O.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+O.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*A.levelLoadingRetryDelay,A.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return R.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+O.details+'"')}}else this.warn('cannot recover from error "'+O.details+'"'),this.clearTimer(),O.fatal=!0;return S},k}()},"./src/controller/base-stream-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"State",function(){return v}),L.d(q,"default",function(){return m});var J=L("./src/polyfills/number.ts"),B=L("./src/task-loop.ts"),M=L("./src/controller/fragment-tracker.ts"),G=L("./src/utils/buffer-helper.ts"),F=L("./src/utils/logger.ts"),P=L("./src/events.ts"),k=L("./src/errors.ts"),y=L("./src/types/transmuxer.ts"),C=L("./src/utils/mp4-tools.ts"),O=L("./src/utils/discontinuities.ts"),R=L("./src/controller/fragment-finders.ts"),A=L("./src/controller/level-helper.ts"),S=L("./src/loader/fragment-loader.ts"),c=L("./src/crypt/decrypter.ts"),s=L("./src/utils/time-ranges.ts"),u=L("./src/types/loader.ts");function h(a,d){for(var o=0;o<d.length;o++){var E=d[o];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(a,E.key,E)}}function T(a,d,o){return d&&h(a.prototype,d),o&&h(a,o),a}function p(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function f(a,d){a.prototype=Object.create(d.prototype),a.prototype.constructor=a,D(a,d)}function D(a,d){return D=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},D(a,d)}var v={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"},m=function(a){f(d,a);function d(E,b,x){var N;return N=a.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=v.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=x,N.log=F.logger.log.bind(F.logger,x+":"),N.warn=F.logger.warn.bind(F.logger,x+":"),N.hls=E,N.fragmentLoader=new S.default(E.config),N.fragmentTracker=b,N.config=E.config,N.decrypter=new c.default(E,E.config),E.on(P.Events.KEY_LOADED,N.onKeyLoaded,p(N)),N}var o=d.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(b){},o.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=v.STOPPED},o._streamEnded=function(b,x){var N=this.fragCurrent,U=this.fragmentTracker;if(!x.live&&N&&N.sn===x.endSN&&!b.nextStart){var K=U.getState(N);return K===M.FragmentState.PARTIAL||K===M.FragmentState.OK}return!1},o.onMediaAttached=function(b,x){var N=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===v.STOPPED&&this.startLoad(U.startPosition)},o.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()},o.onMediaSeeking=function(){var b=this.config,x=this.fragCurrent,N=this.media,U=this.mediaBuffer,K=this.state,V=N?N.currentTime:0,_=G.BufferHelper.bufferInfo(U||N,V,b.maxBufferHole);if(this.log("media seeking to "+(Object(J.isFiniteNumber)(V)?V.toFixed(3):V)+", state: "+K),K===v.ENDED)this.resetLoadingState();else if(x&&!_.len){var I=b.maxFragLookUpTolerance,Y=x.start-I,ee=x.start+x.duration+I,oe=V>ee;(V<Y||oe)&&(oe&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=V),!this.loadedmetadata&&!_.len&&(this.nextLoadPosition=this.startPosition=V),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(b,x){if(this.state!==v.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=v.IDLE;var N=this.levels[x.frag.level].details;N&&this.loadFragment(x.frag,N,x.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),a.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=v.STOPPED,this.hls.off(P.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,a.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(b,x){this.log("Loading key for "+b.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=v.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(P.Events.KEY_LOADING,{frag:b})},o.loadFragment=function(b,x,N){this._loadFragForPlayback(b,x,N)},o._loadFragForPlayback=function(b,x,N){var U=this,K=function(_){if(U.fragContextChanged(b)){U.warn("Fragment "+b.sn+(_.part?" p: "+_.part.index:"")+" of level "+b.level+" was dropped during download."),U.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,U._handleFragmentLoadProgress(_)};this._doFragLoad(b,x,N,K).then(function(V){if(!V)return;U.fragLoadError=0;var _=U.state;if(U.fragContextChanged(b)){(_===v.FRAG_LOADING||_===v.BACKTRACKING||!U.fragCurrent&&_===v.PARSING)&&(U.fragmentTracker.removeFragment(b),U.state=v.IDLE);return}if("payload"in V&&(U.log("Loaded fragment "+b.sn+" of level "+b.level),U.hls.trigger(P.Events.FRAG_LOADED,V),U.state===v.BACKTRACKING)){U.fragmentTracker.backtrack(b,V),U.resetFragmentLoading(b);return}U._handleFragmentLoadComplete(V)}).catch(function(V){U.warn(V),U.resetFragmentLoading(b)})},o.flushMainBuffer=function(b,x,N){if(N===void 0&&(N=null),!(b-x))return;var U={startOffset:b,endOffset:x,type:N};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,U)},o._loadInitSegment=function(b){var x=this;this._doFragLoad(b).then(function(N){if(!N||x.fragContextChanged(b)||!x.levels)throw new Error("init load aborted");return N}).then(function(N){var U=x.hls,K=N.payload,V=b.decryptdata;if(K&&K.byteLength>0&&V&&V.key&&V.iv&&V.method==="AES-128"){var _=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(K),V.key.buffer,V.iv.buffer).then(function(I){var Y=self.performance.now();return U.trigger(P.Events.FRAG_DECRYPTED,{frag:b,payload:I,stats:{tstart:_,tdecrypt:Y}}),N.payload=I,N})}return N}).then(function(N){var U=x.fragCurrent,K=x.hls,V=x.levels;if(!V)throw new Error("init load aborted, missing levels");var _=V[b.level].details;console.assert(_,"Level details are defined when init segment is loaded");var I=b.stats;x.state=v.IDLE,x.fragLoadError=0,b.data=new Uint8Array(N.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),N.frag===U&&K.trigger(P.Events.FRAG_BUFFERED,{stats:I,frag:U,part:null,id:b.type}),x.tick()}).catch(function(N){x.warn(N),x.resetFragmentLoading(b)})},o.fragContextChanged=function(b){var x=this.fragCurrent;return!b||!x||b.level!==x.level||b.sn!==x.sn||b.urlId!==x.urlId},o.fragBufferedComplete=function(b,x){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+s.default.toString(G.BufferHelper.getBuffered(N))),this.state=v.IDLE,this.tick()},o._handleFragmentLoadComplete=function(b){var x=this.transmuxer;if(!x)return;var N=b.frag,U=b.part,K=b.partsLoaded,V=!K||K.length===0||K.some(function(I){return!I}),_=new y.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,U?U.index:-1,!V);x.flush(_)},o._handleFragmentLoadProgress=function(b){},o._doFragLoad=function(b,x,N,U){var K=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(b.start,N||0),this.config.lowLatencyMode&&x){var V=x.partList;if(V&&U){N>b.end&&x.fragmentHint&&(b=x.fragmentHint);var _=this.getNextPart(V,b,N);if(_>-1){var I=V[_];return this.log("Loading part sn: "+b.sn+" p: "+I.index+" cc: "+b.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+_+"-"+(V.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=v.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:b,part:V[_],targetBufferTime:N}),this.doFragPartsLoad(b,V,_,U).catch(function(Y){return K.handleFragLoadError(Y)})}else if(!b.url||this.loadedEndOfParts(V,N))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(N.toFixed(3))),Object(J.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=v.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:b,targetBufferTime:N}),this.fragmentLoader.load(b,U).catch(function(Y){return K.handleFragLoadError(Y)})},o.doFragPartsLoad=function(b,x,N,U){var K=this;return new Promise(function(V,_){var I=[],Y=function ee(oe){var he=x[oe];K.fragmentLoader.loadPart(b,he,U).then(function(Le){I[he.index]=Le;var xe=Le.part;K.hls.trigger(P.Events.FRAG_LOADED,Le);var Ae=x[oe+1];if(Ae&&Ae.fragment===b)ee(oe+1);else return V({frag:b,part:xe,partsLoaded:I})}).catch(_)};Y(N)})},o.handleFragLoadError=function(b){var x=b.data;return x&&x.details===k.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(P.Events.ERROR,x),null},o._handleTransmuxerFlush=function(b){var x=this.getCurrentContext(b);if(!x||this.state!==v.PARSING){this.fragCurrent||(this.state=v.IDLE);return}var N=x.frag,U=x.part,K=x.level,V=self.performance.now();N.stats.parsing.end=V,U&&(U.stats.parsing.end=V),this.updateLevelTiming(N,U,K,b.partial)},o.getCurrentContext=function(b){var x=this.levels,N=b.level,U=b.sn,K=b.part;if(!x||!x[N])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+N+". The current chunk will not be buffered."),null;var V=x[N],_=K>-1?Object(A.getPartWith)(V,U,K):null,I=_?_.fragment:Object(A.getFragmentWithSN)(V,U,this.fragCurrent);return I?{frag:I,part:_,level:V}:null},o.bufferFragmentData=function(b,x,N,U){if(!b||this.state!==v.PARSING)return;var K=b.data1,V=b.data2,_=K;if(K&&V&&(_=Object(C.appendUint8Array)(K,V)),!_||!_.length)return;var I={type:b.type,frag:x,part:N,chunkMeta:U,parent:x.type,data:_};this.hls.trigger(P.Events.BUFFER_APPENDING,I),b.dropped&&b.independent&&!N&&this.flushBufferGap(x)},o.flushBufferGap=function(b){var x=this.media;if(!x)return;if(!G.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,b.start);return}var N=x.currentTime,U=G.BufferHelper.bufferInfo(x,N,0),K=b.duration,V=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),_=Math.max(Math.min(b.start-V,U.end-V),N+V);b.start-_>V&&this.flushMainBuffer(_,b.start)},o.getFwdBufferInfo=function(b,x){var N=this.config,U=this.getLoadPosition();if(!Object(J.isFiniteNumber)(U))return null;var K=G.BufferHelper.bufferInfo(b,U,N.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var V=this.fragmentTracker.getBufferedFrag(U,x);if(V&&K.nextStart<V.end)return G.BufferHelper.bufferInfo(b,U,Math.max(K.nextStart,N.maxBufferHole))}return K},o.getMaxBufferLength=function(b){var x=this.config,N;return b?N=Math.max(8*x.maxBufferSize/b,x.maxBufferLength):N=x.maxBufferLength,Math.min(N,x.maxMaxBufferLength)},o.reduceMaxBufferLength=function(b){var x=this.config,N=b||x.maxBufferLength;return x.maxMaxBufferLength>=N?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(b,x){var N,U,K=x.fragments,V=K.length;if(!V)return null;var _=this.config,I=K[0].start,Y;if(x.live){var ee=_.initialLiveManifestSize;if(V<ee)return this.warn("Not enough fragments to start playback (have: "+V+", need: "+ee+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(x,K),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:b)}else b<=I&&(Y=K[0]);if(!Y){var oe=_.lowLatencyMode?x.partEnd:x.fragmentEnd;Y=this.getFragmentAtPosition(b,oe,x)}return(N=Y)!==null&&N!==void 0&&N.initSegment&&!((U=Y)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},o.getNextPart=function(b,x,N){for(var U=-1,K=!1,V=!0,_=0,I=b.length;_<I;_++){var Y=b[_];if(V=V&&!Y.independent,U>-1&&N<Y.start)break;var ee=Y.loaded;!ee&&(K||Y.independent||V)&&Y.fragment===x&&(U=_),K=ee}return U},o.loadedEndOfParts=function(b,x){var N=b[b.length-1];return N&&x>N.start&&N.loaded},o.getInitialLiveFragment=function(b,x){var N=this.fragPrevious,U=null;if(N){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),U=Object(R.findFragmentByPDT)(x,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var K=N.sn+1;if(K>=b.startSN&&K<=b.endSN){var V=x[K-b.startSN];N.cc===V.cc&&(U=V,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(R.findFragWithCC)(x,N.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var _=this.hls.liveSyncPosition;_!==null&&(U=this.getFragmentAtPosition(_,this.bitrateTest?b.fragmentEnd:b.edge,b))}return U},o.getFragmentAtPosition=function(b,x,N){var U=this.config,K=this.fragPrevious,V=N.fragments,_=N.endSN,I=N.fragmentHint,Y=U.maxFragLookUpTolerance,ee=!!(U.lowLatencyMode&&N.partList&&I);ee&&I&&!this.bitrateTest&&(V=V.concat(I),_=I.sn);var oe;if(b<x){var he=b>x-Y?0:Y;oe=Object(R.findFragmentByPTS)(K,V,b,he)}else oe=V[V.length-1];if(oe){var Le=oe.sn-N.startSN,xe=K&&oe.level===K.level,Ae=V[Le+1],Te=this.fragmentTracker.getState(oe);if(Te===M.FragmentState.BACKTRACKED){oe=null;for(var Ce=Le;V[Ce]&&this.fragmentTracker.getState(V[Ce])===M.FragmentState.BACKTRACKED;)K?oe=V[Ce--]:oe=V[--Ce];oe||(oe=Ae)}else K&&oe.sn===K.sn&&!ee&&(xe&&(oe.sn<_&&this.fragmentTracker.getState(Ae)!==M.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Ae.sn),oe=Ae):oe=null))}return oe},o.synchronizeToLiveEdge=function(b){var x=this.config,N=this.media;if(!N)return;var U=this.hls.liveSyncPosition,K=N.currentTime,V=b.fragments[0].start,_=b.edge,I=K>=V-x.maxFragLookUpTolerance&&K<=_;if(U!==null&&N.duration>U&&(K<U||!I)){var Y=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*b.targetduration;(!I&&N.readyState<4||K<_-Y)&&(this.loadedmetadata||(this.nextLoadPosition=U),N.readyState&&(this.warn("Playback: "+K.toFixed(3)+" is located too far from the end of live sliding playlist: "+_+", reset currentTime to : "+U.toFixed(3)),N.currentTime=U))}},o.alignPlaylists=function(b,x){var N=this.levels,U=this.levelLastLoaded,K=this.fragPrevious,V=U!==null?N[U]:null,_=b.fragments.length;if(!_)return this.warn("No fragments in live playlist"),0;var I=b.fragments[0].start,Y=!x,ee=b.alignedSliding&&Object(J.isFiniteNumber)(I);if(Y||!ee&&!I){Object(O.alignStream)(K,V,b);var oe=b.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+b.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+_),oe}return I},o.waitForCdnTuneIn=function(b){var x=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*x)},o.setStartPosition=function(b,x){var N=this.startPosition;if(N<x&&(N=-1),N===-1||this.lastCurrentTime===-1){var U=b.startTimeOffset;Object(J.isFiniteNumber)(U)?(N=x+U,U<0&&(N+=b.totalduration),N=Math.min(Math.max(x,N),x+b.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+N),this.startPosition=N):b.live?N=this.hls.liveSyncPosition||x:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},o.getLoadPosition=function(){var b=this.media,x=0;return this.loadedmetadata&&b?x=b.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},o.handleFragLoadAborted=function(b,x){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(x?" part"+x.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},o.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=v.IDLE)},o.onFragmentOrKeyLoadError=function(b,x){if(x.fatal)return;var N=x.frag;if(!N||N.type!==b)return;var U=this.fragCurrent;console.assert(U&&N.sn===U.sn&&N.level===U.level&&N.urlId===U.urlId,"Frag load error must match current frag to retry");var K=this.config;if(this.fragLoadError+1<=K.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var V=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+b+" "+N.level+" failed to load, retrying in "+V+"ms"),this.retryDate=self.performance.now()+V,this.fragLoadError++,this.state=v.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(b===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=v.IDLE):(F.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=v.ERROR)},o.afterBufferFlushed=function(b,x,N){if(!b)return;var U=G.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(x,U,N),this.state===v.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=v.IDLE},o.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[b].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(b,x,N,U){var K=this,V=N.details;console.assert(!!V,"level.details must be defined");var _=Object.keys(b.elementaryStreams).reduce(function(I,Y){var ee=b.elementaryStreams[Y];if(ee){var oe=ee.endPTS-ee.startPTS;if(oe<=0)return K.warn("Could not parse fragment "+b.sn+" "+Y+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),I||!1;var he=U?0:Object(A.updateFragPTSDTS)(V,b,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return K.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:V,level:N,drift:he,type:Y,frag:b,start:ee.startPTS,end:ee.endPTS}),!0}return I},!1);_?(this.state=v.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:b,part:x})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},T(d,[{key:"state",get:function(){return this._state},set:function(b){var x=this._state;x!==b&&(this._state=b,this.log(x+"->"+b))}}]),d}(B.default)},"./src/controller/buffer-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return R});var J=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),M=L("./src/utils/logger.ts"),G=L("./src/errors.ts"),F=L("./src/utils/buffer-helper.ts"),P=L("./src/utils/mediasource-helper.ts"),k=L("./src/loader/fragment.ts"),y=L("./src/controller/buffer-operation-queue.ts"),C=Object(P.getMediaSource)(),O=/([ha]vc.)(?:\.[^.,]+)+/,R=function(){function A(c){var s=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 u=s.hls,h=s.media,T=s.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),h&&(s.updateMediaElementDuration(),u.trigger(B.Events.MEDIA_ATTACHED,{media:h})),T&&T.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var S=A.prototype;return S.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},S.destroy=function(){this.unregisterListeners(),this.details=null},S.registerListeners=function(){var s=this.hls;s.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(B.Events.BUFFER_RESET,this.onBufferReset,this),s.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(B.Events.BUFFER_EOS,this.onBufferEos,this),s.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(B.Events.FRAG_PARSED,this.onFragParsed,this),s.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},S.unregisterListeners=function(){var s=this.hls;s.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(B.Events.BUFFER_RESET,this.onBufferReset,this),s.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(B.Events.BUFFER_EOS,this.onBufferEos,this),s.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(B.Events.FRAG_PARSED,this.onFragParsed,this),s.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},S._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},S.onManifestParsed=function(s,u){var h=2;(u.audio&&!u.video||!u.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},S.onMediaAttaching=function(s,u){var h=this.media=u.media;if(h&&C){var T=this.mediaSource=new C;T.addEventListener("sourceopen",this._onMediaSourceOpen),T.addEventListener("sourceended",this._onMediaSourceEnded),T.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(T),this._objectUrl=h.src}},S.onMediaDetaching=function(){var s=this.media,u=this.mediaSource,h=this._objectUrl;if(u){if(M.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(T){M.logger.warn("[buffer-controller]: onMediaDetaching: "+T.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(h&&self.URL.revokeObjectURL(h),s.src===h?(s.removeAttribute("src"),s.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(B.Events.MEDIA_DETACHED,void 0)},S.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(u){var h=s.sourceBuffer[u];try{h&&(s.removeBufferListeners(u),s.mediaSource&&s.mediaSource.removeSourceBuffer(h),s.sourceBuffer[u]=void 0)}catch(T){M.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",T)}}),this._initSourceBuffer()},S.onBufferCodecs=function(s,u){var h=this,T=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(p){if(T){var f=h.tracks[p];if(f&&typeof f.buffer.changeType=="function"){var D=u[p],v=D.codec,m=D.levelCodec,a=D.container,d=(f.levelCodec||f.codec).replace(O,"$1"),o=(m||v).replace(O,"$1");if(d!==o){var E=a+";codecs="+(m||v);h.appendChangeType(p,E)}}}else h.pendingTracks[p]=u[p]}),T)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},S.appendChangeType=function(s,u){var h=this,T=this.operationQueue,p={execute:function(){var D=h.sourceBuffer[s];D&&(M.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+u),D.changeType(u)),T.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(D){M.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",D)}};T.append(p,s)},S.onBufferAppending=function(s,u){var h=this,T=this.hls,p=this.operationQueue,f=this.tracks,D=u.data,v=u.type,m=u.frag,a=u.part,d=u.chunkMeta,o=d.buffering[v],E=self.performance.now();o.start=E;var b=m.stats.buffering,x=a?a.stats.buffering:null;b.start===0&&(b.start=E),x&&x.start===0&&(x.start=E);var N=f.audio,U=v==="audio"&&d.id===1&&(N==null?void 0:N.container)==="audio/mpeg",K={execute:function(){if(o.executeStart=self.performance.now(),U){var _=h.sourceBuffer[v];if(_){var I=m.start-_.timestampOffset;Math.abs(I)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+I+") sn: "+m.sn+")"),_.timestampOffset=m.start)}}h.appendExecutor(D,v)},onStart:function(){},onComplete:function(){var _=self.performance.now();o.executeEnd=o.end=_,b.first===0&&(b.first=_),x&&x.first===0&&(x.first=_);var I=h.sourceBuffer,Y={};for(var ee in I)Y[ee]=F.BufferHelper.getBuffered(I[ee]);h.appendError=0,h.hls.trigger(B.Events.BUFFER_APPENDED,{type:v,frag:m,part:a,chunkMeta:d,parent:m.type,timeRanges:Y})},onError:function(_){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+v+" SourceBuffer",_);var I={type:G.ErrorTypes.MEDIA_ERROR,parent:m.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:_,fatal:!1};_.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=G.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,I.details=G.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>T.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+T.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),T.trigger(B.Events.ERROR,I)}};p.append(K,v)},S.onBufferFlushing=function(s,u){var h=this,T=this.operationQueue,p=function(D){return{execute:h.removeExecutor.bind(h,D,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(B.Events.BUFFER_FLUSHED,{type:D})},onError:function(m){M.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",m)}}};u.type?T.append(p(u.type),u.type):this.getSourceBufferTypes().forEach(function(f){T.append(p(f),f)})},S.onFragParsed=function(s,u){var h=this,T=u.frag,p=u.part,f=[],D=p?p.elementaryStreams:T.elementaryStreams;D[k.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(D[k.ElementaryStreamTypes.AUDIO]&&f.push("audio"),D[k.ElementaryStreamTypes.VIDEO]&&f.push("video"));var v=function(){var a=self.performance.now();T.stats.buffering.end=a,p&&(p.stats.buffering.end=a);var d=p?p.stats:T.stats;h.hls.trigger(B.Events.FRAG_BUFFERED,{frag:T,part:p,stats:d,id:T.type})};f.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+T.type+" level: "+T.level+" sn: "+T.sn),this.blockBuffers(v,f)},S.onFragChanged=function(s,u){this.flushBackBuffer()},S.onBufferEos=function(s,u){var h=this,T=this.getSourceBufferTypes().reduce(function(p,f){var D=h.sourceBuffer[f];return(!u.type||u.type===f)&&(D&&!D.ended&&(D.ended=!0,M.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),p&&!!(!D||D.ended)},!0);T&&this.blockBuffers(function(){var p=h.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},S.onLevelUpdated=function(s,u){var h=u.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},S.flushBackBuffer=function(){var s=this.hls,u=this.details,h=this.media,T=this.sourceBuffer;if(!h||u===null)return;var p=this.getSourceBufferTypes();if(!p.length)return;var f=u.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(J.isFiniteNumber)(f)||f<0)return;var D=h.currentTime,v=u.levelTargetDuration,m=Math.max(f,v),a=Math.floor(D/v)*v-m;p.forEach(function(d){var o=T[d];if(o){var E=F.BufferHelper.getBuffered(o);E.length>0&&a>E.start(0)&&(s.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:a}),u.live&&s.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:a}),s.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:a,type:d}))}})},S.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,u=this.hls,h=this.media,T=this.mediaSource,p=s.fragments[0].start+s.totalduration,f=h.duration,D=Object(J.isFiniteNumber)(T.duration)?T.duration:0;s.live&&u.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),T.duration=Infinity,this.updateSeekableRange(s)):(p>D&&p>f||!Object(J.isFiniteNumber)(f))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),T.duration=p)},S.updateSeekableRange=function(s){var u=this.mediaSource,h=s.fragments,T=h.length;if(T&&s.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var p=Math.max(0,h[0].start),f=Math.max(p,p+s.totalduration);u.setLiveSeekableRange(p,f)}},S.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,u=this.operationQueue,h=this.pendingTracks,T=Object.keys(h).length;if(T&&!s||T===2){this.createSourceBuffers(h),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(f){u.executeNext(f)})}},S.createSourceBuffers=function(s){var u=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var T=0;for(var p in s)if(!u[p]){var f=s[p];if(!f)throw Error("source buffer exists for track "+p+", however track does not");var D=f.levelCodec||f.codec,v=f.container+";codecs="+D;M.logger.log("[buffer-controller]: creating sourceBuffer("+v+")");try{var m=u[p]=h.addSourceBuffer(v),a=p;this.addBufferListener(a,"updatestart",this._onSBUpdateStart),this.addBufferListener(a,"updateend",this._onSBUpdateEnd),this.addBufferListener(a,"error",this._onSBUpdateError),this.tracks[p]={buffer:m,codec:D,container:f.container,levelCodec:f.levelCodec,id:f.id},T++}catch(d){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:v})}}T&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},S._onSBUpdateStart=function(s){var u=this.operationQueue,h=u.current(s);h.onStart()},S._onSBUpdateEnd=function(s){var u=this.operationQueue,h=u.current(s);h.onComplete(),u.shiftAndExecuteNext(s)},S._onSBUpdateError=function(s,u){M.logger.error("[buffer-controller]: "+s+" SourceBuffer error",u),this.hls.trigger(B.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(s);h&&h.onError(u)},S.removeExecutor=function(s,u,h){var T=this.media,p=this.mediaSource,f=this.operationQueue,D=this.sourceBuffer,v=D[s];if(!T||!p||!v){M.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(s);return}var m=Object(J.isFiniteNumber)(T.duration)?T.duration:Infinity,a=Object(J.isFiniteNumber)(p.duration)?p.duration:Infinity,d=Math.max(0,u),o=Math.min(h,m,a);o>d?(M.logger.log("[buffer-controller]: Removing ["+d+","+o+"] from the "+s+" SourceBuffer"),console.assert(!v.updating,s+" sourceBuffer must not be updating"),v.remove(d,o)):f.shiftAndExecuteNext(s)},S.appendExecutor=function(s,u){var h=this.operationQueue,T=this.sourceBuffer,p=T[u];if(!p){M.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(u);return}p.ended=!1,console.assert(!p.updating,u+" sourceBuffer must not be updating"),p.appendBuffer(s)},S.blockBuffers=function(s,u){var h=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var T=this.operationQueue,p=u.map(function(f){return T.appendBlocker(f)});Promise.all(p).then(function(){s(),u.forEach(function(f){var D=h.sourceBuffer[f];(!D||!D.updating)&&T.shiftAndExecuteNext(f)})})},S.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},S.addBufferListener=function(s,u,h){var T=this.sourceBuffer[s];if(!T)return;var p=h.bind(this,s);this.listeners[s].push({event:u,listener:p}),T.addEventListener(u,p)},S.removeBufferListeners=function(s){var u=this.sourceBuffer[s];if(!u)return;this.listeners[s].forEach(function(h){u.removeEventListener(h.event,h.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return B});var J=L("./src/utils/logger.ts"),B=function(){function M(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var G=M.prototype;return G.append=function(P,k){var y=this.queues[k];y.push(P),y.length===1&&this.buffers[k]&&this.executeNext(k)},G.insertAbort=function(P,k){var y=this.queues[k];y.unshift(P),this.executeNext(k)},G.appendBlocker=function(P){var k,y=new Promise(function(O){k=O}),C={execute:k,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(C,P),y},G.executeNext=function(P){var k=this.buffers,y=this.queues,C=k[P],O=y[P];if(O.length){var R=O[0];try{R.execute()}catch(A){J.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),R.onError(A),(!C||!C.updating)&&(O.shift(),this.executeNext(P))}}},G.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},G.current=function(P){return this.queues[P][0]},M}()},"./src/controller/cap-level-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts");function B(F,P){for(var k=0;k<P.length;k++){var y=P[k];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(F,y.key,y)}}function M(F,P,k){return P&&B(F.prototype,P),k&&B(F,k),F}var G=function(){function F(k){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=k,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=F.prototype;return P.setStreamController=function(y){this.streamController=y},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var y=this.hls;y.on(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var y=this.hls;y.off(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(y,C){F.isLevelAllowed(C.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(C.droppedLevel)},P.onMediaAttaching=function(y,C){this.media=C.media instanceof HTMLVideoElement?C.media:null},P.onManifestParsed=function(y,C){var O=this.hls;this.restrictedLevels=[],this.firstLevel=C.firstLevel,O.config.capLevelToPlayerSize&&C.video&&this.startCapping()},P.onBufferCodecs=function(y,C){var O=this.hls;O.config.capLevelToPlayerSize&&C.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var C=this.hls;C.autoLevelCapping=this.getMaxLevel(y.length-1),C.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=C.autoLevelCapping}}},P.getMaxLevel=function(y){var C=this,O=this.hls.levels;if(!O.length)return-1;var R=O.filter(function(A,S){return F.isLevelAllowed(S,C.restrictedLevels)&&S<=y});return this.clientRect=null,F.getMaxLevelByMediaSize(R,this.mediaWidth,this.mediaHeight)},P.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()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,C={width:0,height:0};if(y){var O=y.getBoundingClientRect();C.width=O.width,C.height=O.height,!C.width&&!C.height&&(C.width=O.right-O.left||y.width||0,C.height=O.bottom-O.top||y.height||0)}return this.clientRect=C,C},F.isLevelAllowed=function(y,C){return C===void 0&&(C=[]),C.indexOf(y)===-1},F.getMaxLevelByMediaSize=function(y,C,O){if(!y||!y.length)return-1;for(var R=function(u,h){return h?u.width!==h.width||u.height!==h.height:!0},A=y.length-1,S=0;S<y.length;S+=1){var c=y[S];if((c.width>=C||c.height>=O)&&R(c,y[S+1])){A=S;break}}return A},M(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(C){}return y}}]),F}();q.default=G},"./src/controller/cmcd-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return R});var J=L("./src/events.ts"),B=L("./src/types/cmcd.ts"),M=L("./src/utils/buffer-helper.ts"),G=L("./src/utils/logger.ts");function F(A,S){for(var c=0;c<S.length;c++){var s=S[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(A,s.key,s)}}function P(A,S,c){return S&&F(A.prototype,S),c&&F(A,c),A}function k(A,S){var c=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(c)return(c=c.call(A)).next.bind(c);if(Array.isArray(A)||(c=y(A))||S&&A&&typeof A.length=="number"){c&&(A=c);var s=0;return function(){return s>=A.length?{done:!0}:{done:!1,value:A[s++]}}}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 y(A,S){if(!A)return;if(typeof A=="string")return C(A,S);var c=Object.prototype.toString.call(A).slice(8,-1);if(c==="Object"&&A.constructor&&(c=A.constructor.name),c==="Map"||c==="Set")return Array.from(A);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return C(A,S)}function C(A,S){(S==null||S>A.length)&&(S=A.length);for(var c=0,s=new Array(S);c<S;c++)s[c]=A[c];return s}function O(){return O=Object.assign||function(A){for(var S=1;S<arguments.length;S++){var c=arguments[S];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(A[s]=c[s])}return A},O.apply(this,arguments)}var R=function(){function A(c){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(T){try{s.apply(T,{ot:B.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(p){G.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(T){try{var p=T.frag,f=s.hls.levels[p.level],D=s.getObjectType(p),v={d:p.duration*1e3,ot:D};(D===B.CMCDObjectType.VIDEO||D===B.CMCDObjectType.AUDIO||D==B.CMCDObjectType.MUXED)&&(v.br=f.bitrate/1e3,v.tb=s.getTopBandwidth(D),v.bl=s.getBufferLength(D)),s.apply(T,v)}catch(m){G.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=c;var u=this.config=c.config,h=u.cmcd;h!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||A.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var S=A.prototype;return S.registerListeners=function(){var s=this.hls;s.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(J.Events.BUFFER_CREATED,this.onBufferCreated,this)},S.unregisterListeners=function(){var s=this.hls;s.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(J.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},S.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},S.onMediaAttached=function(s,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},S.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},S.onBufferCreated=function(s,u){var h,T;this.audioBuffer=(h=u.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(T=u.tracks.video)===null||T===void 0?void 0:T.buffer},S.createData=function(){var s;return{v:B.CMCDVersion,sf:B.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},S.apply=function(s,u){u===void 0&&(u={}),O(u,this.createData());var h=u.ot===B.CMCDObjectType.INIT||u.ot===B.CMCDObjectType.VIDEO||u.ot===B.CMCDObjectType.MUXED;if(this.starved&&h&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var T=A.toHeaders(u);if(!Object.keys(T).length)return;s.headers||(s.headers={}),O(s.headers,T)}else{var p=A.toQuery(u);if(!p)return;s.url=A.appendQueryToUri(s.url,p)}},S.getObjectType=function(s){var u=s.type;return u==="subtitle"?B.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?B.CMCDObjectType.INIT:u==="audio"?B.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},S.getTopBandwidth=function(s){for(var u=0,h=s===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,T=k(h),p;!(p=T()).done;){var f=p.value;f.bitrate>u&&(u=f.bitrate)}return u>0?u:NaN},S.getBufferLength=function(s){var u=this.hls.media,h=s===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!u)return NaN;var T=M.BufferHelper.bufferInfo(h,u.currentTime,this.config.maxBufferHole);return T.len*1e3},S.createPlaylistLoader=function(){var s=this.config.pLoader,u=this.applyPlaylistData,h=s||this.config.loader;return function(){function T(f){this.loader=void 0,this.loader=new h(f)}var p=T.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(D,v,m){u(D),this.loader.load(D,v,m)},P(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},S.createFragmentLoader=function(){var s=this.config.fLoader,u=this.applyFragmentData,h=s||this.config.loader;return function(){function T(f){this.loader=void 0,this.loader=new h(f)}var p=T.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(D,v,m){u(D),this.loader.load(D,v,m)},P(T,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),T}()},A.uuid=function(){var s=URL.createObjectURL(new Blob),u=s.toString();return URL.revokeObjectURL(s),u.substr(u.lastIndexOf("/")+1)},A.serialize=function(s){for(var u=[],h=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},T=function(U){return Math.round(U)},p=function(U){return T(U/100)*100},f=function(U){return encodeURIComponent(U)},D={br:T,d:T,bl:p,dl:p,mtp:p,nor:f,rtp:p,tb:T},v=Object.keys(s||{}).sort(),m=k(v),a;!(a=m()).done;){var d=a.value,o=s[d];if(!h(o))continue;if(d==="v"&&o===1)continue;if(d=="pr"&&o===1)continue;var E=D[d];E&&(o=E(o));var b=typeof o,x=void 0;d==="ot"||d==="sf"||d==="st"?x=d+"="+o:b==="boolean"?x=d:b==="number"?x=d+"="+o:x=d+"="+JSON.stringify(o),u.push(x)}return u.join(",")},A.toHeaders=function(s){for(var u=Object.keys(s),h={},T=["Object","Request","Session","Status"],p=[{},{},{},{}],f={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,v=u;D<v.length;D++){var m=v[D],a=f[m]!=null?f[m]:1;p[a][m]=s[m]}for(var d=0;d<p.length;d++){var o=A.serialize(p[d]);o&&(h["CMCD-"+T[d]]=o)}return h},A.toQuery=function(s){return"CMCD="+encodeURIComponent(A.serialize(s))},A.appendQueryToUri=function(s,u){if(!u)return s;var h=s.includes("?")?"&":"?";return""+s+h+u},A}()},"./src/controller/eme-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts"),B=L("./src/errors.ts"),M=L("./src/utils/logger.ts"),G=L("./src/utils/mediakeys-helper.ts");function F(R,A){for(var S=0;S<A.length;S++){var c=A[S];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(R,c.key,c)}}function P(R,A,S){return A&&F(R.prototype,A),S&&F(R,S),R}var k=3,y=function(A,S,c){var s={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(u){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:c.audioRobustness||""})}),S.forEach(function(u){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:c.videoRobustness||""})}),[s]},C=function(A,S,c,s){switch(A){case G.KeySystems.WIDEVINE:return y(S,c,s);default:throw new Error("Unknown key-system: "+A)}},O=function(){function R(S){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=S,this._config=S.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var A=R.prototype;return A.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},A._registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A._unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A.getLicenseServerUrl=function(c){switch(c){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},A._attemptKeySystemAccess=function(c,s,u){var h=this,T=C(c,s,u,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(c,T);this.mediaKeysPromise=p.then(function(f){return h._onMediaKeySystemAccessObtained(c,f)}),p.catch(function(f){M.logger.error('Failed to obtain key-system "'+c+'" access:',f)})},A._onMediaKeySystemAccessObtained=function(c,s){var u=this;M.logger.log('Access for key-system "'+c+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:c};this._mediaKeysList.push(h);var T=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(p){return h.mediaKeys=p,M.logger.log('Media-keys created for key-system "'+c+'"'),u._onMediaKeysCreated(),p});return T.catch(function(p){M.logger.error("Failed to create media-keys:",p)}),T},A._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},A._onNewMediaKeySession=function(c){var s=this;M.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(u){s._onKeySessionMessage(c,u.message)},!1)},A._onKeySessionMessage=function(c,s){M.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(u){M.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),c.update(u)})},A.onMediaEncrypted=function(c){var s=this;if(M.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(T){if(!s._media)return;s._attemptSetMediaKeys(T),s._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(u).catch(u)},A._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(c,s){var u=this,h=this._mediaKeysList[0];if(!h){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var T=h.mediaKeysSession;if(!T){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+c+'" init data type'),h.mediaKeysSessionInitialized=!0,T.generateRequest(c,s).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(p){M.logger.error("Error generating key-session request:",p),u.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(c,s,u){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,c,s,u);var T=this._licenseXhrSetup;if(T)try{T.call(this.hls,h,c),T=void 0}catch(p){M.logger.error(p)}try{h.readyState||h.open("POST",c,!0),T&&T.call(this.hls,h,c)}catch(p){throw new Error("issue setting up KeySystem license XHR "+p)}return h},A._onLicenseRequestReadyStageChange=function(c,s,u,h){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var T=c.response,p=this._licenseResponseCallback;if(p)try{T=p.call(this.hls,c,s)}catch(D){M.logger.error(D)}h(T)}else{if(M.logger.error("License Request XHR failed ("+s+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>k){this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var f=k-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+f+" attempts left"),this._requestLicense(u,h)}break}},A._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},A._requestLicense=function(c,s){M.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(u.mediaKeySystemDomain),T=this._createLicenseXhr(h,c,s);M.logger.log("Sending license request to URL: "+h);var p=this._generateLicenseRequestChallenge(u,c);T.send(p)}catch(f){M.logger.error("Failure requesting DRM license: "+f),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var u=s.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var c=this._media,s=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(c,s){if(!this._emeEnabled)return;var u=s.levels.map(function(T){return T.audioCodec}).filter(function(T){return!!T}),h=s.levels.map(function(T){return T.videoCodec}).filter(function(T){return!!T});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,u,h)},P(R,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),R}();q.default=O},"./src/controller/fps-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts"),B=L("./src/utils/logger.ts"),M=function(){function G(P){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=P,this.registerListeners()}var F=G.prototype;return F.setStreamController=function(k){this.streamController=k},F.registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(k,y){var C=this.hls.config;if(C.capLevelOnFPSDrop){var O=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=O,O&&typeof O.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),C.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(k,y,C){var O=performance.now();if(y){if(this.lastTime){var R=O-this.lastTime,A=C-this.lastDroppedFrames,S=y-this.lastDecodedFrames,c=1e3*A/R,s=this.hls;if(s.trigger(J.Events.FPS_DROP,{currentDropped:A,currentDecoded:S,totalDroppedFrames:C}),c>0&&A>s.config.fpsDroppedMonitoringThreshold*S){var u=s.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=u)&&(u=u-1,s.trigger(J.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:s.currentLevel}),s.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=O,this.lastDroppedFrames=C,this.lastDecodedFrames=y}},F.checkFPSInterval=function(){var k=this.media;if(k)if(this.isVideoPlaybackQualityAvailable){var y=k.getVideoPlaybackQuality();this.checkFPS(k,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(k,k.webkitDecodedFrameCount,k.webkitDroppedFrameCount)},G}();q.default=M},"./src/controller/fragment-finders.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"findFragmentByPDT",function(){return M}),L.d(q,"findFragmentByPTS",function(){return G}),L.d(q,"fragmentWithinToleranceTest",function(){return F}),L.d(q,"pdtWithinToleranceTest",function(){return P}),L.d(q,"findFragWithCC",function(){return k});var J=L("./src/polyfills/number.ts"),B=L("./src/utils/binary-search.ts");function M(y,C,O){if(C===null||!Array.isArray(y)||!y.length||!Object(J.isFiniteNumber)(C))return null;var R=y[0].programDateTime;if(C<(R||0))return null;var A=y[y.length-1].endProgramDateTime;if(C>=(A||0))return null;O=O||0;for(var S=0;S<y.length;++S){var c=y[S];if(P(C,O,c))return c}return null}function G(y,C,O,R){O===void 0&&(O=0),R===void 0&&(R=0);var A=null;if(y?A=C[y.sn-C[0].sn+1]||null:O===0&&C[0].start===0&&(A=C[0]),A&&F(O,R,A)===0)return A;var S=B.default.search(C,F.bind(null,O,R));return S||A}function F(y,C,O){y===void 0&&(y=0),C===void 0&&(C=0);var R=Math.min(C,O.duration+(O.deltaPTS?O.deltaPTS:0));return O.start+O.duration-R<=y?1:O.start-R>y&&O.start?-1:0}function P(y,C,O){var R=Math.min(C,O.duration+(O.deltaPTS?O.deltaPTS:0))*1e3,A=O.endProgramDateTime||0;return A-R>y}function k(y,C){return B.default.search(y,function(O){return O.cc<C?1:O.cc>C?-1:0})}},"./src/controller/fragment-tracker.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"FragmentState",function(){return M}),L.d(q,"FragmentTracker",function(){return G});var J=L("./src/events.ts"),B=L("./src/types/loader.ts"),M;(function(k){k.NOT_LOADED="NOT_LOADED",k.BACKTRACKED="BACKTRACKED",k.APPENDING="APPENDING",k.PARTIAL="PARTIAL",k.OK="OK"})(M||(M={}));var G=function(){function k(C){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=C,this._registerListeners()}var y=k.prototype;return y._registerListeners=function(){var O=this.hls;O.on(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),O.on(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),O.on(J.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var O=this.hls;O.off(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),O.off(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),O.off(J.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(O,R){if(R===B.PlaylistLevelType.MAIN){var A=this.activeFragment,S=this.activeParts;if(!A)return null;if(S)for(var c=S.length;c--;){var s=S[c],u=s?s.end:A.appendedPTS;if(s.start<=O&&u!==void 0&&O<=u)return c>9&&(this.activeParts=S.slice(c-9)),s}else if(A.start<=O&&A.appendedPTS!==void 0&&O<=A.appendedPTS)return A}return this.getBufferedFrag(O,R)},y.getBufferedFrag=function(O,R){for(var A=this.fragments,S=Object.keys(A),c=S.length;c--;){var s=A[S[c]];if((s==null?void 0:s.body.type)===R&&s.buffered){var u=s.body;if(u.start<=O&&O<=u.end)return u}}return null},y.detectEvictedFragments=function(O,R,A){var S=this;Object.keys(this.fragments).forEach(function(c){var s=S.fragments[c];if(!s)return;if(!s.buffered){s.body.type===A&&S.removeFragment(s.body);return}var u=s.range[O];if(!u)return;u.time.some(function(h){var T=!S.isTimeBuffered(h.startPTS,h.endPTS,R);return T&&S.removeFragment(s.body),T})})},y.detectPartialFragments=function(O){var R=this,A=this.timeRanges,S=O.frag,c=O.part;if(!A||S.sn==="initSegment")return;var s=P(S),u=this.fragments[s];if(!u)return;Object.keys(A).forEach(function(h){var T=S.elementaryStreams[h];if(!T)return;var p=A[h],f=c!==null||T.partial===!0;u.range[h]=R.getBufferedTimes(S,c,f,p)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},y.fragBuffered=function(O){var R=P(O),A=this.fragments[R];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},y.getBufferedTimes=function(O,R,A,S){for(var c={time:[],partial:A},s=R?R.start:O.start,u=R?R.end:O.end,h=O.minEndPTS||u,T=O.maxStartPTS||s,p=0;p<S.length;p++){var f=S.start(p)-this.bufferPadding,D=S.end(p)+this.bufferPadding;if(T>=f&&h<=D){c.time.push({startPTS:Math.max(s,S.start(p)),endPTS:Math.min(u,S.end(p))});break}else if(s<D&&u>f)c.partial=!0,c.time.push({startPTS:Math.max(s,S.start(p)),endPTS:Math.min(u,S.end(p))});else if(u<=f)break}return c},y.getPartialFragment=function(O){var R=null,A,S,c,s=0,u=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(T){var p=h[T];if(!p)return;F(p)&&(S=p.body.start-u,c=p.body.end+u,O>=S&&O<=c&&(A=Math.min(O-S,c-O),s<=A&&(R=p.body,s=A)))}),R},y.getState=function(O){var R=P(O),A=this.fragments[R];return A?A.buffered?F(A)?M.PARTIAL:M.OK:A.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},y.backtrack=function(O,R){var A=P(O),S=this.fragments[A];if(!S||S.backtrack)return null;var c=S.backtrack=R||S.loaded;return S.loaded=null,c},y.getBacktrackData=function(O){var R=P(O),A=this.fragments[R];if(A){var S,c=A.backtrack;if(c!=null&&(S=c.payload)!==null&&S!==void 0&&S.byteLength)return c;this.removeFragment(O)}return null},y.isTimeBuffered=function(O,R,A){for(var S,c,s=0;s<A.length;s++){if(S=A.start(s)-this.bufferPadding,c=A.end(s)+this.bufferPadding,O>=S&&R<=c)return!0;if(R<=S)return!1}return!1},y.onFragLoaded=function(O,R){var A=R.frag,S=R.part;if(A.sn==="initSegment"||A.bitrateTest||S)return;var c=P(A);this.fragments[c]={body:A,loaded:R,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(O,R){var A=this,S=R.frag,c=R.part,s=R.timeRanges;if(S.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=S,c){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(c)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(h){var T=s[h];if(A.detectEvictedFragments(h,T),!c)for(var p=0;p<T.length;p++)S.appendedPTS=Math.max(T.end(p),S.appendedPTS||0)})},y.onFragBuffered=function(O,R){this.detectPartialFragments(R)},y.hasFragment=function(O){var R=P(O);return!!this.fragments[R]},y.removeFragmentsInRange=function(O,R,A){var S=this;Object.keys(this.fragments).forEach(function(c){var s=S.fragments[c];if(!s)return;if(s.buffered){var u=s.body;u.type===A&&u.start<R&&u.end>O&&S.removeFragment(u)}})},y.removeFragment=function(O){var R=P(O);O.stats.loaded=0,O.clearElementaryStreamInfo(),delete this.fragments[R]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},k}();function F(k){var y,C;return k.buffered&&(((y=k.range.video)===null||y===void 0?void 0:y.partial)||((C=k.range.audio)===null||C===void 0?void 0:C.partial))}function P(k){return k.type+"_"+k.level+"_"+k.urlId+"_"+k.sn}},"./src/controller/gap-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"STALL_MINIMUM_DURATION_MS",function(){return F}),L.d(q,"MAX_START_GAP_JUMP",function(){return P}),L.d(q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return k}),L.d(q,"SKIP_BUFFER_RANGE_START",function(){return y}),L.d(q,"default",function(){return C});var J=L("./src/utils/buffer-helper.ts"),B=L("./src/errors.ts"),M=L("./src/events.ts"),G=L("./src/utils/logger.ts"),F=250,P=2,k=.1,y=.05,C=function(){function O(A,S,c,s){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=A,this.media=S,this.fragmentTracker=c,this.hls=s}var R=O.prototype;return R.destroy=function(){this.hls=this.fragmentTracker=this.media=null},R.poll=function(S){var c=this.config,s=this.media,u=this.stalled,h=s.currentTime,T=s.seeking,p=this.seeking&&!T,f=!this.seeking&&T;if(this.seeking=T,h!==S){if(this.moved=!0,u!==null){if(this.stallReported){var D=self.performance.now()-u;G.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((f||p)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!J.BufferHelper.getBuffered(s).length)return;var v=J.BufferHelper.bufferInfo(s,h,0),m=v.len>0,a=v.nextStart||0;if(!m&&!a)return;if(T){var d=v.len>P,o=!a||a-h>P&&!this.fragmentTracker.getPartialFragment(h);if(d||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,b=Math.max(a,v.start||0)-h,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=x==null||((E=x.details)===null||E===void 0)?void 0:E.live,U=N?x.details.targetduration*2:P;if(b>0&&b<=U){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(u===null){this.stalled=K;return}var V=K-u;!T&&V>=F&&this._reportStall(v.len);var _=J.BufferHelper.bufferInfo(s,h,c.maxBufferHole);this._tryFixBufferStall(_,V)},R._tryFixBufferStall=function(S,c){var s=this.config,u=this.fragmentTracker,h=this.media,T=h.currentTime,p=u.getPartialFragment(T);if(p){var f=this._trySkipBufferHole(p);if(f)return}S.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},R._reportStall=function(S){var c=this.hls,s=this.media,u=this.stallReported;u||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+S+")"),c.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:S}))},R._trySkipBufferHole=function(S){for(var c=this.config,s=this.hls,u=this.media,h=u.currentTime,T=0,p=J.BufferHelper.getBuffered(u),f=0;f<p.length;f++){var D=p.start(f);if(h+c.maxBufferHole>=T&&h<D){var v=Math.max(D+y,u.currentTime+k);return G.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+v),this.moved=!0,this.stalled=null,u.currentTime=v,S&&s.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+v,frag:S}),v}T=p.end(f)}return 0},R._tryNudgeBuffer=function(){var S=this.config,c=this.hls,s=this.media,u=s.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<S.nudgeMaxRetry){var T=u+h*S.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+u+" to "+T),s.currentTime=T,c.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+S.nudgeMaxRetry+" nudges"),c.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},O}()},"./src/controller/id3-track-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts"),B=L("./src/utils/texttrack-utils.ts"),M=L("./src/demux/id3.ts"),G=.25,F=function(){function P(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var k=P.prototype;return k.destroy=function(){this._unregisterListeners()},k._registerListeners=function(){var C=this.hls;C.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},k._unregisterListeners=function(){var C=this.hls;C.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},k.onMediaAttached=function(C,O){this.media=O.media},k.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},k.getID3Track=function(C){if(!this.media)return;for(var O=0;O<C.length;O++){var R=C[O];if(R.kind==="metadata"&&R.label==="id3")return Object(B.sendAddTrackEvent)(R,this.media),R}return this.media.addTextTrack("metadata","id3")},k.onFragParsingMetadata=function(C,O){if(!this.media)return;var R=O.frag,A=O.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var S=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<A.length;c++){var s=M.getID3Frames(A[c].data);if(s){var u=A[c].pts,h=c<A.length-1?A[c+1].pts:R.end,T=h-u;T<=0&&(h=u+G);for(var p=0;p<s.length;p++){var f=s[p];if(!M.isTimeStampFrame(f)){var D=new S(u,h,"");D.value=f,this.id3Track.addCue(D)}}}}},k.onBufferFlushing=function(C,O){var R=O.startOffset,A=O.endOffset,S=O.type;if(!S||S==="audio"){var c=this.id3Track;c&&Object(B.removeCuesInRange)(c,R,A)}},P}();q.default=F},"./src/controller/latency-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return P});var J=L("./src/errors.ts"),B=L("./src/events.ts"),M=L("./src/utils/logger.ts");function G(k,y){for(var C=0;C<y.length;C++){var O=y[C];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(k,O.key,O)}}function F(k,y,C){return y&&G(k.prototype,y),C&&G(k,C),k}var P=function(){function k(C){var O=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 O.timeupdate()},this.hls=C,this.config=C.config,this.registerListeners()}var y=k.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},y.onMediaAttached=function(O,R){this.media=R.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(O,R){var A=R.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(O,R){if(R.details!==J.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var O=this.media,R=this.levelDetails;if(!O||!R)return;this.currentTime=O.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var S=this.config,c=S.lowLatencyMode,s=S.maxLiveSyncPlaybackRate;if(!c||s===1)return;var u=this.targetLatency;if(u===null)return;var h=A-u,T=Math.min(this.maxLatency,u+R.targetduration),p=h<T;if(R.live&&p&&h>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,s)),D=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;O.playbackRate=Math.min(f,Math.max(1,D))}else O.playbackRate!==1&&O.playbackRate!==0&&(O.playbackRate=1)},y.estimateLiveEdge=function(){var O=this.levelDetails;return O===null?null:O.edge+O.age},y.computeLatency=function(){var O=this.estimateLiveEdge();return O===null?null:O-this.currentTime},F(k,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var O=this.config,R=this.levelDetails;return O.liveMaxLatencyDuration!==void 0?O.liveMaxLatencyDuration:R?O.liveMaxLatencyDurationCount*R.targetduration:0}},{key:"targetLatency",get:function(){var O=this.levelDetails;if(O===null)return null;var R=O.holdBack,A=O.partHoldBack,S=O.targetduration,c=this.config,s=c.liveSyncDuration,u=c.liveSyncDurationCount,h=c.lowLatencyMode,T=this.hls.userConfig,p=h&&A||R;(T.liveSyncDuration||T.liveSyncDurationCount||p===0)&&(p=s!==void 0?s:u*S);var f=S,D=1;return p+Math.min(this.stallCount*D,f)}},{key:"liveSyncPosition",get:function(){var O=this.estimateLiveEdge(),R=this.targetLatency,A=this.levelDetails;if(O===null||R===null||A===null)return null;var S=A.edge,c=O-R-this.edgeStalled,s=S-A.totalduration,u=S-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(s,c),u)}},{key:"drift",get:function(){var O=this.levelDetails;return O===null?1:O.drift}},{key:"edgeStalled",get:function(){var O=this.levelDetails;if(O===null)return 0;var R=(this.config.lowLatencyMode&&O.partTarget||O.targetduration)*3;return Math.max(O.age-R,0)}},{key:"forwardBufferLength",get:function(){var O=this.media,R=this.levelDetails;if(!O||!R)return 0;var A=O.buffered.length;return A?O.buffered.end(A-1):R.edge-this.currentTime}}]),k}()},"./src/controller/level-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return c});var J=L("./src/types/level.ts"),B=L("./src/events.ts"),M=L("./src/errors.ts"),G=L("./src/utils/codecs.ts"),F=L("./src/controller/level-helper.ts"),P=L("./src/controller/base-playlist-controller.ts"),k=L("./src/types/loader.ts");function y(){return y=Object.assign||function(s){for(var u=1;u<arguments.length;u++){var h=arguments[u];for(var T in h)Object.prototype.hasOwnProperty.call(h,T)&&(s[T]=h[T])}return s},y.apply(this,arguments)}function C(s,u){for(var h=0;h<u.length;h++){var T=u[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function O(s,u,h){return u&&C(s.prototype,u),h&&C(s,h),s}function R(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,A(s,u)}function A(s,u){return A=Object.setPrototypeOf||function(T,p){return T.__proto__=p,T},A(s,u)}var S=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){R(u,s);function u(T){var p;return p=s.call(this,T,"[level-controller]")||this,p._levels=[],p._firstLevel=-1,p._startLevel=void 0,p.currentLevelIndex=-1,p.manualLevelIndex=-1,p.onParsedComplete=void 0,p._registerListeners(),p}var h=u.prototype;return h._registerListeners=function(){var p=this.hls;p.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(B.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var p=this.hls;p.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(B.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},h.startLoad=function(){var p=this._levels;p.forEach(function(f){f.loadError=0}),s.prototype.startLoad.call(this)},h.onManifestLoaded=function(p,f){var D=[],v=[],m=[],a,d={},o,E=!1,b=!1,x=!1;if(f.levels.forEach(function(V){var _=V.attrs;E=E||!!(V.width&&V.height),b=b||!!V.videoCodec,x=x||!!V.audioCodec,S&&V.audioCodec&&V.audioCodec.indexOf("mp4a.40.34")!==-1&&(V.audioCodec=void 0);var I=V.bitrate+"-"+V.attrs.RESOLUTION+"-"+V.attrs.CODECS;o=d[I],o?o.url.push(V.url):(o=new J.Level(V),d[I]=o,D.push(o)),_&&(_.AUDIO&&Object(F.addGroupId)(o,"audio",_.AUDIO),_.SUBTITLES&&Object(F.addGroupId)(o,"text",_.SUBTITLES))}),(E||b)&&x&&(D=D.filter(function(V){var _=V.videoCodec,I=V.width,Y=V.height;return!!_||!!(I&&Y)})),D=D.filter(function(V){var _=V.audioCodec,I=V.videoCodec;return(!_||Object(G.isCodecSupportedInMp4)(_,"audio"))&&(!I||Object(G.isCodecSupportedInMp4)(I,"video"))}),f.audioTracks&&(v=f.audioTracks.filter(function(V){return!V.audioCodec||Object(G.isCodecSupportedInMp4)(V.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(v)),f.subtitles&&(m=f.subtitles,Object(F.assignTrackIdsByGroup)(m)),D.length>0){a=D[0].bitrate,D.sort(function(V,_){return V.bitrate-_.bitrate}),this._levels=D;for(var N=0;N<D.length;N++)if(D[N].bitrate===a){this._firstLevel=N,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+a);break}var U=x&&!b,K={levels:D,audioTracks:v,subtitleTracks:m,firstLevel:this._firstLevel,stats:f.stats,audio:x,video:b,altAudio:!U&&v.some(function(V){return!!V.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,K),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:f.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(p,f){if(s.prototype.onError.call(this,p,f),f.fatal)return;var D=f.context,v=this._levels[this.currentLevelIndex];if(D&&(D.type===k.PlaylistContextType.AUDIO_TRACK&&v.audioGroupIds&&D.groupId===v.audioGroupIds[v.urlId]||D.type===k.PlaylistContextType.SUBTITLE_TRACK&&v.textGroupIds&&D.groupId===v.textGroupIds[v.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,a=!0,d;switch(f.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(f.frag){var o=this._levels[f.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(d=f.frag.level)):d=f.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(a=!1),d=D.level),m=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:d=f.level,m=!0;break}d!==void 0&&this.recoverLevel(f,d,m,a)},h.recoverLevel=function(p,f,D,v){var m=p.details,a=this._levels[f];if(a.loadError++,D){var d=this.retryLoadingOrFail(p);if(d)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(v){var o=a.url.length;if(o>1&&a.loadError<o)p.levelRetry=!0,this.redundantFailover(f);else if(this.manualLevelIndex===-1){var E=f===0?this._levels.length-1:f-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(m+": switch to "+E),p.levelRetry=!0,this.hls.nextAutoLevel=E)}}},h.redundantFailover=function(p){var f=this._levels[p],D=f.url.length;if(D>1){var v=(f.urlId+1)%D;this.warn("Switching to redundant URL-id "+v),this._levels.forEach(function(m){m.urlId=v}),this.level=p}},h.onFragLoaded=function(p,f){var D=f.frag;if(D!==void 0&&D.type===k.PlaylistLevelType.MAIN){var v=this._levels[D.level];v!==void 0&&(v.fragmentError=0,v.loadError=0)}},h.onLevelLoaded=function(p,f){var D,v=f.level,m=f.details,a=this._levels[v];if(!a){var d;this.warn("Invalid level index "+v),(d=f.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(m.deltaUpdateFailed=!0);return}v===this.currentLevelIndex?(a.fragmentError===0&&(a.loadError=0,this.retryCount=0),this.playlistLoaded(v,f,a.details)):(D=f.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(m.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(p,f){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var v=-1,m=this.hls.audioTracks[f.id].groupId,a=0;a<D.audioGroupIds.length;a++)if(D.audioGroupIds[a]===m){v=a;break}v!==D.urlId&&(D.urlId=v,this.startLoad())}},h.loadPlaylist=function(p){var f=this.currentLevelIndex,D=this._levels[f];if(this.canLoad&&D&&D.url.length>0){var v=D.urlId,m=D.url[v];if(p)try{m=p.addDirectives(m)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("Attempt loading level index "+f+(p?" at sn "+p.msn+" part "+p.part:"")+" with URL-id "+v+" "+m),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:m,level:f,id:v,deliveryDirectives:p||null})}},h.removeLevel=function(p,f){var D=function(a,d){return d!==f},v=this._levels.filter(function(m,a){return a!==p?!0:m.url.length>1&&f!==void 0?(m.url=m.url.filter(D),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(D)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(D)),m.urlId=0,!0):!1}).map(function(m,a){var d=m.details;return d!=null&&d.fragments&&d.fragments.forEach(function(o){o.level=a}),m});this._levels=v,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:v})},O(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(p){var f,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===p&&(f=D[p])!==null&&f!==void 0&&f.details)return;if(p<0||p>=D.length){var v=p<0;if(this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:v,reason:"invalid level idx"}),v)return;p=Math.min(p,D.length-1)}this.clearTimer();var m=this.currentLevelIndex,a=D[m],d=D[p];this.log("switching to level "+p+" from "+m),this.currentLevelIndex=p;var o=y({},d,{level:p,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete o._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,o);var E=d.details;if(!E||E.live){var b=this.switchParams(d.uri,a==null?void 0:a.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(p){this.manualLevelIndex=p,this._startLevel===void 0&&(this._startLevel=p),p!==-1&&(this.level=p)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(p){this._firstLevel=p}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var p=this.hls.config.startLevel;return p!==void 0?p:this._firstLevel}else return this._startLevel},set:function(p){this._startLevel=p}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(p){this.level=p,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=p)}}]),u}(P.default)},"./src/controller/level-helper.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"addGroupId",function(){return M}),L.d(q,"assignTrackIdsByGroup",function(){return G}),L.d(q,"updatePTS",function(){return F}),L.d(q,"updateFragPTSDTS",function(){return k}),L.d(q,"mergeDetails",function(){return y}),L.d(q,"mapPartIntersection",function(){return C}),L.d(q,"mapFragmentIntersection",function(){return O}),L.d(q,"adjustSliding",function(){return R}),L.d(q,"addSliding",function(){return A}),L.d(q,"computeReloadInterval",function(){return S}),L.d(q,"getFragmentWithSN",function(){return c}),L.d(q,"getPartWith",function(){return s});var J=L("./src/polyfills/number.ts"),B=L("./src/utils/logger.ts");function M(u,h,T){switch(h){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(T);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(T);break}}function G(u){var h={};u.forEach(function(T){var p=T.groupId||"";T.id=h[p]=h[p]||0,h[p]++})}function F(u,h,T){var p=u[h],f=u[T];P(p,f)}function P(u,h){var T=h.startPTS;if(Object(J.isFiniteNumber)(T)){var p=0,f;h.sn>u.sn?(p=T-u.start,f=u):(p=u.start-T,f=h),f.duration!==p&&(f.duration=p)}else if(h.sn>u.sn){var D=u.cc===h.cc;D&&u.minEndPTS?h.start=u.start+(u.minEndPTS-u.start):h.start=u.start+u.duration}else h.start=Math.max(u.start-h.duration,0)}function k(u,h,T,p,f,D){var v=p-T;v<=0&&(B.logger.warn("Fragment should have a positive duration",h),p=T+h.duration,D=f+h.duration);var m=T,a=p,d=h.startPTS,o=h.endPTS;if(Object(J.isFiniteNumber)(d)){var E=Math.abs(d-T);Object(J.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(E,h.deltaPTS):h.deltaPTS=E,m=Math.max(T,d),T=Math.min(T,d),f=Math.min(f,h.startDTS),a=Math.min(p,o),p=Math.max(p,o),D=Math.max(D,h.endDTS)}h.duration=p-T;var b=T-h.start;h.appendedPTS=p,h.start=h.startPTS=T,h.maxStartPTS=m,h.startDTS=f,h.endPTS=p,h.minEndPTS=a,h.endDTS=D;var x=h.sn;if(!u||x<u.startSN||x>u.endSN)return 0;var N,U=x-u.startSN,K=u.fragments;for(K[U]=h,N=U;N>0;N--)P(K[N],K[N-1]);for(N=U;N<K.length-1;N++)P(K[N],K[N+1]);return u.fragmentHint&&P(K[K.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,b}function y(u,h){for(var T=null,p=u.fragments,f=p.length-1;f>=0;f--){var D=p[f].initSegment;if(D){T=D;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var v=0,m;if(O(u,h,function(N,U){N.relurl&&(v=N.cc-U.cc),Object(J.isFiniteNumber)(N.startPTS)&&Object(J.isFiniteNumber)(N.endPTS)&&(U.start=U.startPTS=N.startPTS,U.startDTS=N.startDTS,U.appendedPTS=N.appendedPTS,U.maxStartPTS=N.maxStartPTS,U.endPTS=N.endPTS,U.endDTS=N.endDTS,U.minEndPTS=N.minEndPTS,U.duration=N.endPTS-N.startPTS,U.duration&&(m=U),h.PTSKnown=h.alignedSliding=!0),U.elementaryStreams=N.elementaryStreams,U.loader=N.loader,U.stats=N.stats,U.urlId=N.urlId,N.initSegment&&(U.initSegment=N.initSegment,T=N.initSegment)}),T){var a=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;a.forEach(function(N){var U;(!N.initSegment||N.initSegment.relurl===((U=T)===null||U===void 0?void 0:U.relurl))&&(N.initSegment=T)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(N){return!N}),h.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=h.skippedSegments;d--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var o=h.fragments;if(v){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<o.length;E++)o[E].cc+=v}h.skippedSegments&&(h.startCC=h.fragments[0].cc),C(u.partList,h.partList,function(N,U){U.elementaryStreams=N.elementaryStreams,U.stats=N.stats}),m?k(h,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):R(u,h),o.length&&(h.totalduration=h.edge-o[0].start),h.driftStartTime=u.driftStartTime,h.driftStart=u.driftStart;var b=h.advancedDateTime;if(h.advanced&&b){var x=h.edge;h.driftStart||(h.driftStartTime=b,h.driftStart=x),h.driftEndTime=b,h.driftEnd=x}else h.driftEndTime=u.driftEndTime,h.driftEnd=u.driftEnd,h.advancedDateTime=u.advancedDateTime}function C(u,h,T){if(u&&h)for(var p=0,f=0,D=u.length;f<=D;f++){var v=u[f],m=h[f+p];v&&m&&v.index===m.index&&v.fragment.sn===m.fragment.sn?T(v,m):p--}}function O(u,h,T){for(var p=h.skippedSegments,f=Math.max(u.startSN,h.startSN)-h.startSN,D=(u.fragmentHint?1:0)+(p?h.endSN:Math.min(u.endSN,h.endSN))-h.startSN,v=h.startSN-u.startSN,m=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,a=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,d=f;d<=D;d++){var o=a[v+d],E=m[d];p&&!E&&d<p&&(E=h.fragments[d]=o),o&&E&&T(o,E)}}function R(u,h){var T=h.startSN+h.skippedSegments-u.startSN,p=u.fragments;if(T<0||T>=p.length)return;A(h,p[T].start)}function A(u,h){if(h){for(var T=u.fragments,p=u.skippedSegments;p<T.length;p++)T[p].start+=h;u.fragmentHint&&(u.fragmentHint.start+=h)}}function S(u,h){var T=1e3*u.levelTargetDuration,p=T/2,f=u.age,D=f>0&&f<T*3,v=h.loading.end-h.loading.start,m,a=u.availabilityDelay;if(u.updated===!1)if(D){var d=333*u.misses;m=Math.max(Math.min(p,v*2),d),u.availabilityDelay=(u.availabilityDelay||0)+m}else m=p;else D?(a=Math.min(a||T/2,f),u.availabilityDelay=a,m=a+T-f):m=T-v;return Math.round(m)}function c(u,h,T){if(!u||!u.details)return null;var p=u.details,f=p.fragments[h-p.startSN];return f||(f=p.fragmentHint,f&&f.sn===h?f:h<p.startSN&&T&&T.sn===h?T:null)}function s(u,h,T){if(!u||!u.details)return null;var p=u.details.partList;if(p)for(var f=p.length;f--;){var D=p[f];if(D.index===T&&D.fragment.sn===h)return D}return null}},"./src/controller/stream-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return p});var J=L("./src/polyfills/number.ts"),B=L("./src/controller/base-stream-controller.ts"),M=L("./src/is-supported.ts"),G=L("./src/events.ts"),F=L("./src/utils/buffer-helper.ts"),P=L("./src/controller/fragment-tracker.ts"),k=L("./src/types/loader.ts"),y=L("./src/loader/fragment.ts"),C=L("./src/demux/transmuxer-interface.ts"),O=L("./src/types/transmuxer.ts"),R=L("./src/controller/gap-controller.ts"),A=L("./src/errors.ts"),S=L("./src/utils/logger.ts");function c(f,D){for(var v=0;v<D.length;v++){var m=D[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function s(f,D,v){return D&&c(f.prototype,D),v&&c(f,v),f}function u(f,D){f.prototype=Object.create(D.prototype),f.prototype.constructor=f,h(f,D)}function h(f,D){return h=Object.setPrototypeOf||function(m,a){return m.__proto__=a,m},h(f,D)}var T=100,p=function(f){u(D,f);function D(m,a){var d;return d=f.call(this,m,a,"[stream-controller]")||this,d.audioCodecSwap=!1,d.gapController=null,d.level=-1,d._forceStartLoad=!1,d.altAudio=!1,d.audioOnly=!1,d.fragPlaying=null,d.onvplaying=null,d.onvseeked=null,d.fragLastKbps=0,d.stalled=!1,d.couldBacktrack=!1,d.audioCodecSwitch=!1,d.videoBuffer=null,d._registerListeners(),d}var v=D.prototype;return v._registerListeners=function(){var a=this.hls;a.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.on(G.Events.ERROR,this.onError,this),a.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),a.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var a=this.hls;a.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),a.off(G.Events.ERROR,this.onError,this),a.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),a.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),a.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),a.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),a.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),a.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},v.startLoad=function(a){if(this.levels){var d=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(T),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=o.startLevel;E===-1&&(o.config.testBandwidth?(E=0,this.bitrateTest=!0):E=o.nextAutoLevel),this.level=o.nextLoadLevel=E,this.loadedmetadata=!1}d>0&&a===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),a=d),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},v.stopLoad=function(){this._forceStartLoad=!1,f.prototype.stopLoad.call(this)},v.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var a,d=this.levels,o=this.level,E=d==null||((a=d[o])===null||a===void 0)?void 0:a.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var b,x=self.performance.now(),N=this.retryDate;(!N||x>=N||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},v.onTickEnd=function(){f.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},v.doTickIdle=function(){var a,d,o=this.hls,E=this.levelLastLoaded,b=this.levels,x=this.media,N=o.config,U=o.nextLoadLevel;if(E===null||!x&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[U])return;var K=b[U];this.level=o.nextLoadLevel=U;var V=K.details;if(!V||this.state===B.State.WAITING_LEVEL||V.live&&this.levelLastLoaded!==U){this.state=B.State.WAITING_LEVEL;return}var _=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,k.PlaylistLevelType.MAIN);if(_===null)return;var I=_.len,Y=this.getMaxBufferLength(K.maxBitrate);if(I>=Y)return;if(this._streamEnded(_,V)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ee),this.state=B.State.ENDED;return}var oe=_.end,he=this.getNextFragment(oe,V);if(this.couldBacktrack&&!this.fragPrevious&&he&&he.sn!=="initSegment"){var Le=he.sn-V.startSN;Le>1&&(he=V.fragments[Le-1],this.fragmentTracker.removeFragment(he))}if(he&&this.fragmentTracker.getState(he)===P.FragmentState.OK&&this.nextLoadPosition>oe){var xe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,xe,k.PlaylistLevelType.MAIN),he=this.getNextFragment(this.nextLoadPosition,V)}if(!he)return;he.initSegment&&!he.initSegment.data&&!this.bitrateTest&&(he=he.initSegment),((a=he.decryptdata)===null||a===void 0?void 0:a.keyFormat)==="identity"&&!((d=he.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(he,V):this.loadFragment(he,V,oe)},v.loadFragment=function(a,d,o){var E,b=this.fragmentTracker.getState(a);if(this.fragCurrent=a,b===P.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(a);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else b=P.FragmentState.NOT_LOADED}b===P.FragmentState.NOT_LOADED||b===P.FragmentState.PARTIAL?a.sn==="initSegment"?this._loadInitSegment(a):this.bitrateTest?(a.bitrateTest=!0,this.log("Fragment "+a.sn+" of level "+a.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(a)):(this.startFragRequested=!0,f.prototype.loadFragment.call(this,a,d,o)):b===P.FragmentState.APPENDING?this.reduceMaxBufferLength(a.duration)&&this.fragmentTracker.removeFragment(a):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},v.getAppendedFrag=function(a){var d=this.fragmentTracker.getAppendedFrag(a,k.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},v.getBufferedFrag=function(a){return this.fragmentTracker.getBufferedFrag(a,k.PlaylistLevelType.MAIN)},v.followingBufferedFrag=function(a){return a?this.getBufferedFrag(a.end+.5):null},v.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},v.nextLevelSwitch=function(){var a=this.levels,d=this.media;if(d!=null&&d.readyState){var o,E=this.getAppendedFrag(d.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!d.paused&&a){var b=this.hls.nextLoadLevel,x=a[b],N=this.fragLastKbps;N&&this.fragCurrent?o=this.fragCurrent.duration*x.maxBitrate/(1e3*N)+1:o=0}else o=0;var U=this.getBufferedFrag(d.currentTime+o);if(U){var K=this.followingBufferedFrag(U);if(K){this.abortCurrentFrag();var V=K.maxStartPTS?K.maxStartPTS:K.start,_=K.duration,I=Math.max(U.end,V+Math.min(Math.max(_-this.config.maxFragLookUpTolerance,_*.5),_*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},v.abortCurrentFrag=function(){var a=this.fragCurrent;this.fragCurrent=null,a!=null&&a.loader&&a.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},v.flushMainBuffer=function(a,d){f.prototype.flushMainBuffer.call(this,a,d,this.altAudio?"video":null)},v.onMediaAttached=function(a,d){f.prototype.onMediaAttached.call(this,a,d);var o=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new R.default(this.config,o,this.fragmentTracker,this.hls)},v.onMediaDetaching=function(){var a=this.media;a&&(a.removeEventListener("playing",this.onvplaying),a.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),f.prototype.onMediaDetaching.call(this)},v.onMediaPlaying=function(){this.tick()},v.onMediaSeeked=function(){var a=this.media,d=a?a.currentTime:null;Object(J.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},v.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},v.onManifestParsed=function(a,d){var o=!1,E=!1,b;d.levels.forEach(function(x){b=x.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(o=!0),b.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=o&&E&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},v.onLevelLoading=function(a,d){var o=this.levels;if(!o||this.state!==B.State.IDLE)return;var E=o[d.level];(!E.details||E.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(E.details))&&(this.state=B.State.WAITING_LEVEL)},v.onLevelLoaded=function(a,d){var o,E=this.levels,b=d.level,x=d.details,N=x.totalduration;if(!E){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+N);var U=this.fragCurrent;U&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==d.level&&U.loader&&(this.state=B.State.IDLE,U.loader.abort()));var K=E[b],V=0;if(x.live||(o=K.details)!==null&&o!==void 0&&o.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;V=this.alignPlaylists(x,K.details)}if(K.details=x,this.levelLastLoaded=b,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:x,level:b}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=B.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,V),this.tick()},v._handleFragmentLoadProgress=function(a){var d,o=a.frag,E=a.part,b=a.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var N=x[o.level],U=N.details;if(!U){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var K=N.videoCodec,V=U.PTSKnown||!U.live,_=(d=o.initSegment)===null||d===void 0?void 0:d.data,I=this._getAudioCodec(N),Y=this.transmuxer=this.transmuxer||new C.default(this.hls,k.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=E?E.index:-1,oe=ee!==-1,he=new O.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,b.byteLength,ee,oe),Le=this.initPTS[o.cc];Y.push(b,_,I,K,o,E,U.totalduration,V,he,Le)},v.onAudioTrackSwitching=function(a,d){var o=this.altAudio,E=!!d.url,b=d.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;o&&N.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:b})}},v.onAudioTrackSwitched=function(a,d){var o=d.id,E=!!this.hls.audioTracks[o].url;if(E){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=E,this.tick()},v.onBufferCreated=function(a,d){var o=d.tracks,E,b,x=!1;for(var N in o){var U=o[N];if(U.id==="main"){if(b=N,E=U,N==="video"){var K=o[N];K&&(this.videoBuffer=K.buffer)}}else x=!0}x&&E?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},v.onFragBuffered=function(a,d){var o=d.frag,E=d.part;if(o&&o.type!==k.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(E?" p: "+E.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var b=E?E.stats:o.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,E)},v.onError=function(a,d){switch(d.details){case A.ErrorDetails.FRAG_LOAD_ERROR:case A.ErrorDetails.FRAG_LOAD_TIMEOUT:case A.ErrorDetails.KEY_LOAD_ERROR:case A.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.PlaylistLevelType.MAIN,d);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=B.State.ERROR):!d.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var o=!0,E=this.getFwdBufferInfo(this.media,k.PlaylistLevelType.MAIN);E&&E.len>.5&&(o=!this.reduceMaxBufferLength(E.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},v.checkBuffer=function(){var a=this.media,d=this.gapController;if(!a||!d||!a.readyState)return;var o=F.BufferHelper.getBuffered(a);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=a.currentTime},v.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},v.onBufferFlushed=function(a,d){var o=d.type;if(o!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(o===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,o,k.PlaylistLevelType.MAIN)}},v.onLevelsUpdated=function(a,d){this.levels=d.levels},v.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},v.seekToStartPos=function(){var a=this.media,d=a.currentTime,o=this.startPosition;if(o>=0&&d<o){if(a.seeking){S.logger.log("could not seek to "+o+", already seeking at "+d);return}var E=F.BufferHelper.getBuffered(a),b=E.length?E.start(0):0,x=b-o;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(S.logger.log("adjusting start position by "+x+" to match buffer start"),o+=x,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+d),a.currentTime=o}},v._getAudioCodec=function(a){var d=this.config.defaultAudioCodec||a.audioCodec;return this.audioCodecSwap&&d&&(this.log("Swapping audio codec"),d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5"),d},v._loadBitrateTestFrag=function(a){var d=this;this._doFragLoad(a).then(function(o){var E=d.hls;if(!o||E.nextLoadLevel||d.fragContextChanged(a))return;d.fragLoadError=0,d.state=B.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var b=a.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),E.trigger(G.Events.FRAG_LOADED,o)})},v._handleTransmuxComplete=function(a){var d,o="main",E=this.hls,b=a.remuxResult,x=a.chunkMeta,N=this.getCurrentContext(x);if(!N){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var U=N.frag,K=N.part,V=N.level,_=b.video,I=b.text,Y=b.id3,ee=b.initSegment,oe=this.altAudio?void 0:b.audio;if(this.fragContextChanged(U))return;if(this.state=B.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(V,ee.tracks,U,x),E.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:o,tracks:ee.tracks}));var he=ee.initPTS,Le=ee.timescale;Object(J.isFiniteNumber)(he)&&(this.initPTS[U.cc]=he,E.trigger(G.Events.INIT_PTS_FOUND,{frag:U,id:o,initPTS:he,timescale:Le}))}if(_&&b.independent!==!1){if(V.details){var xe=_.startPTS,Ae=_.endPTS,Te=_.startDTS,Ce=_.endDTS;if(K)K.elementaryStreams[_.type]={startPTS:xe,endPTS:Ae,startDTS:Te,endDTS:Ce};else if(_.firstKeyFrame&&_.independent&&(this.couldBacktrack=!0),_.dropped&&_.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<xe){this.backtrack(U);return}U.setElementaryStreamInfo(_.type,U.start,Ae,U.start,Ce,!0)}U.setElementaryStreamInfo(_.type,xe,Ae,Te,Ce),this.bufferFragmentData(_,U,K,x)}}else if(b.independent===!1){this.backtrack(U);return}if(oe){var de=oe.startPTS,re=oe.endPTS,ce=oe.startDTS,ae=oe.endDTS;K&&(K.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:re,startDTS:ce,endDTS:ae}),U.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,de,re,ce,ae),this.bufferFragmentData(oe,U,K,x)}if(Y!=null&&(d=Y.samples)!==null&&d!==void 0&&d.length){var we={frag:U,id:o,samples:Y.samples};E.trigger(G.Events.FRAG_PARSING_METADATA,we)}if(I){var De={frag:U,id:o,samples:I.samples};E.trigger(G.Events.FRAG_PARSING_USERDATA,De)}},v._bufferInitSegment=function(a,d,o,E){var b=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!d.audio&&!d.video,this.altAudio&&!this.audioOnly&&delete d.audio;var x=d.audio,N=d.video,U=d.audiovideo;if(x){var K=a.audioCodec,V=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(K&&(K.indexOf("mp4a.40.5")!==-1?K="mp4a.40.2":K="mp4a.40.5"),x.metadata.channelCount!==1&&V.indexOf("firefox")===-1&&(K="mp4a.40.5")),V.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(K="mp4a.40.2",this.log("Android: force audio codec to "+K)),a.audioCodec&&a.audioCodec!==K&&this.log('Swapping manifest audio codec "'+a.audioCodec+'" for "'+K+'"'),x.levelCodec=K,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(K||"")+"/"+(a.audioCodec||"")+"/"+x.codec+"]")}N&&(N.levelCodec=a.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(a.videoCodec||"")+"/"+N.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(a.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,d),Object.keys(d).forEach(function(_){var I=d[_],Y=I.initSegment;Y!=null&&Y.byteLength&&b.hls.trigger(G.Events.BUFFER_APPENDING,{type:_,data:Y,frag:o,part:null,chunkMeta:E,parent:o.type})}),this.tick()},v.backtrack=function(a){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(a);var d=this.fragmentTracker.backtrack(a);this.fragPrevious=null,this.nextLoadPosition=a.start,d?this.resetFragmentLoading(a):this.state=B.State.BACKTRACKING},v.checkFragmentChanged=function(){var a=this.media,d=null;if(a&&a.readyState>1&&a.seeking===!1){var o=a.currentTime;if(F.BufferHelper.isBuffered(a,o)?d=this.getAppendedFrag(o):F.BufferHelper.isBuffered(a,o+.1)&&(d=this.getAppendedFrag(o+.1)),d){var E=this.fragPlaying,b=d.level;(!E||d.sn!==E.sn||E.level!==b||d.urlId!==E.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:d}),(!E||E.level!==b)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=d)}}},s(D,[{key:"nextLevel",get:function(){var a=this.nextBufferedFrag;return a?a.level:-1}},{key:"currentLevel",get:function(){var a=this.media;if(a){var d=this.getAppendedFrag(a.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var a=this.media;if(a){var d=this.getAppendedFrag(a.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"SubtitleStreamController",function(){return u});var J=L("./src/events.ts"),B=L("./src/utils/logger.ts"),M=L("./src/utils/buffer-helper.ts"),G=L("./src/controller/fragment-finders.ts"),F=L("./src/utils/discontinuities.ts"),P=L("./src/controller/level-helper.ts"),k=L("./src/controller/fragment-tracker.ts"),y=L("./src/controller/base-stream-controller.ts"),C=L("./src/types/loader.ts"),O=L("./src/types/level.ts");function R(h,T){for(var p=0;p<T.length;p++){var f=T[p];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(h,f.key,f)}}function A(h,T,p){return T&&R(h.prototype,T),p&&R(h,p),h}function S(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,c(h,T)}function c(h,T){return c=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},c(h,T)}var s=500,u=function(h){S(T,h);function T(f,D){var v;return v=h.call(this,f,D,"[subtitle-stream-controller]")||this,v.levels=[],v.currentTrackId=-1,v.tracksBuffered=[],v.mainDetails=null,v._registerListeners(),v}var p=T.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var D=this.hls;D.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(J.Events.ERROR,this.onError,this),D.on(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var D=this.hls;D.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(J.Events.ERROR,this.onError,this),D.off(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(s),this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},p.onLevelLoaded=function(D,v){this.mainDetails=v.details},p.onSubtitleFragProcessed=function(D,v){var m=v.frag,a=v.success;if(this.fragPrevious=m,this.state=y.State.IDLE,!a)return;var d=this.tracksBuffered[this.currentTrackId];if(!d)return;for(var o,E=m.start,b=0;b<d.length;b++)if(E>=d[b].start&&E<=d[b].end){o=d[b];break}var x=m.start+m.duration;o?o.end=x:(o={start:E,end:x},d.push(o)),this.fragmentTracker.fragBuffered(m)},p.onBufferFlushing=function(D,v){var m=v.startOffset,a=v.endOffset;if(m===0&&a!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,o=this.levels;if(!o.length||!o[d]||!o[d].details)return;var E=o[d].details,b=E.targetduration,x=a-b;if(x<=0)return;v.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(N){for(var U=0;U<N.length;){if(N[U].end<=x){N.shift();continue}else if(N[U].start<x)N[U].start=x;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(m,x,C.PlaylistLevelType.SUBTITLE)}},p.onError=function(D,v){var m,a=v.frag;if(!a||a.type!==C.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},p.onSubtitleTracksUpdated=function(D,v){var m=this,a=v.subtitleTracks;this.tracksBuffered=[],this.levels=a.map(function(d){return new O.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){m.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(D,v){if(this.currentTrackId=v.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(s)},p.onSubtitleTrackLoaded=function(D,v){var m,a=v.details,d=v.id,o=this.currentTrackId,E=this.levels;if(!E.length)return;var b=E[o];if(d>=E.length||d!==o||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,a.live||(m=b.details)!==null&&m!==void 0&&m.live){var x=this.mainDetails;if(a.deltaUpdateFailed||!x)return;var N=x.fragments[0];if(!b.details)a.hasProgramDateTime&&x.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(a,x):N&&Object(P.addSliding)(a,N.start);else{var U=this.alignPlaylists(a,b.details);U===0&&N&&Object(P.addSliding)(a,N.start)}}if(b.details=a,this.levelLastLoaded=d,this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var K=Object(G.findFragmentByPTS)(null,a.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},p._handleFragmentLoadComplete=function(D){var v=D.frag,m=D.payload,a=v.decryptdata,d=this.hls;if(this.fragContextChanged(v))return;if(m&&m.byteLength>0&&a&&a.key&&a.iv&&a.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),a.key.buffer,a.iv.buffer).then(function(E){var b=performance.now();d.trigger(J.Events.FRAG_DECRYPTED,{frag:v,payload:E,stats:{tstart:o,tdecrypt:b}})})}},p.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var D,v=this.currentTrackId,m=this.levels;if(!m.length||!m[v]||!m[v].details)return;var a=m[v].details,d=a.targetduration,o=this.config,E=this.media,b=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-d,o.maxBufferHole),x=b.end,N=b.len,U=this.getMaxBufferLength()+d;if(N>U)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var K=a.fragments,V=K.length,_=a.edge,I,Y=this.fragPrevious;if(x<_){var ee=o.maxFragLookUpTolerance;Y&&a.hasProgramDateTime&&(I=Object(G.findFragmentByPDT)(K,Y.endProgramDateTime,ee)),I||(I=Object(G.findFragmentByPTS)(Y,K,x,ee),!I&&Y&&Y.start<K[0].start&&(I=K[0]))}else I=K[V-1];(D=I)!==null&&D!==void 0&&D.encrypted?(B.logger.log("Loading key for "+I.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(J.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===k.FragmentState.NOT_LOADED&&this.loadFragment(I,a,x)}},p.loadFragment=function(D,v,m){this.fragCurrent=D,h.prototype.loadFragment.call(this,D,v,m)},A(T,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),T}(y.default)},"./src/controller/subtitle-track-controller.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/events.ts"),B=L("./src/utils/texttrack-utils.ts"),M=L("./src/controller/base-playlist-controller.ts"),G=L("./src/types/loader.ts");function F(R,A){for(var S=0;S<A.length;S++){var c=A[S];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(R,c.key,c)}}function P(R,A,S){return A&&F(R.prototype,A),S&&F(R,S),R}function k(R,A){R.prototype=Object.create(A.prototype),R.prototype.constructor=R,y(R,A)}function y(R,A){return y=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},y(R,A)}var C=function(R){k(A,R);function A(c){var s;return s=R.call(this,c,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var S=A.prototype;return S.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,R.prototype.destroy.call(this)},S.registerListeners=function(){var s=this.hls;s.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(J.Events.ERROR,this.onError,this)},S.unregisterListeners=function(){var s=this.hls;s.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(J.Events.ERROR,this.onError,this)},S.onMediaAttached=function(s,u){if(this.media=u.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)},S.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},S.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 s=O(this.media.textTracks);s.forEach(function(u){Object(B.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},S.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},S.onManifestParsed=function(s,u){this.tracks=u.subtitleTracks},S.onSubtitleTrackLoaded=function(s,u){var h=u.id,T=u.details,p=this.trackId,f=this.tracksInGroup[p];if(!f){this.warn("Invalid subtitle track id "+h);return}var D=f.details;f.details=u.details,this.log("subtitle track "+h+" loaded ["+T.startSN+"-"+T.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,u,D))},S.onLevelLoading=function(s,u){this.switchLevel(u.level)},S.onLevelSwitching=function(s,u){this.switchLevel(u.level)},S.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.textGroupIds))return;var h=u.textGroupIds[u.urlId];if(this.groupId!==h){var T=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(v){return!h||v.groupId===h});this.tracksInGroup=p;var f=this.findTrackId(T==null?void 0:T.name)||this.findTrackId();this.groupId=h;var D={subtitleTracks:p};this.log("Updating subtitle tracks, "+p.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(J.Events.SUBTITLE_TRACKS_UPDATED,D),f!==-1&&this.setSubtitleTrack(f,T)}},S.findTrackId=function(s){for(var u=this.tracksInGroup,h=0;h<u.length;h++){var T=u[h];if((!this.selectDefaultTrack||T.default)&&(!s||s===T.name))return T.id}return-1},S.onError=function(s,u){if(R.prototype.onError.call(this,s,u),u.fatal||!u.context)return;u.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},S.loadPlaylist=function(s){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var h=u.id,T=u.groupId,p=u.url;if(s)try{p=s.addDirectives(p)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(J.Events.SUBTITLE_TRACK_LOADING,{url:p,id:h,groupId:T,deliveryDirectives:s||null})}},S.toggleTrackModes=function(s){var u=this,h=this.media,T=this.subtitleDisplay,p=this.trackId;if(!h)return;var f=O(h.textTracks),D=f.filter(function(a){return a.groupId===u.groupId});if(s===-1)[].slice.call(f).forEach(function(a){a.mode="disabled"});else{var v=D[p];v&&(v.mode="disabled")}var m=D[s];m&&(m.mode=T?"showing":"hidden")},S.setSubtitleTrack=function(s,u){var h,T=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(h=T[s])!==null&&h!==void 0&&h.details)||s<-1||s>=T.length)return;this.clearTimer();var p=T[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,p){var f=p.id,D=p.groupId,v=D===void 0?"":D,m=p.name,a=p.type,d=p.url;this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:f,groupId:v,name:m,type:a,url:d});var o=this.switchParams(p.url,u==null?void 0:u.details);this.loadPlaylist(o)}else this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:s})},S.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,u=O(this.media.textTracks),h=0;h<u.length;h++)if(u[h].mode==="hidden")s=h;else if(u[h].mode==="showing"){s=h;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},P(A,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,u)}}]),A}(M.default);function O(R){for(var A=[],S=0;S<R.length;S++){var c=R[S];c.kind==="subtitles"&&c.label&&A.push(R[S])}return A}q.default=C},"./src/controller/timeline-controller.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"TimelineController",function(){return O});var J=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),M=L("./src/utils/cea-608-parser.ts"),G=L("./src/utils/output-filter.ts"),F=L("./src/utils/webvtt-parser.ts"),P=L("./src/utils/texttrack-utils.ts"),k=L("./src/utils/imsc1-ttml-parser.ts"),y=L("./src/types/loader.ts"),C=L("./src/utils/logger.ts"),O=function(){function c(u){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=S(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.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 h=new G.default(this,"textTrack1"),T=new G.default(this,"textTrack2"),p=new G.default(this,"textTrack3"),f=new G.default(this,"textTrack4");this.cea608Parser1=new M.default(1,h,T),this.cea608Parser2=new M.default(3,p,f)}u.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(B.Events.FRAG_LOADING,this.onFragLoading,this),u.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=c.prototype;return s.destroy=function(){var h=this.hls;h.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(B.Events.FRAG_LOADING,this.onFragLoading,this),h.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(h,T,p,f,D){for(var v=!1,m=D.length;m--;){var a=D[m],d=A(a[0],a[1],T,p);if(d>=0&&(a[0]=Math.min(a[0],T),a[1]=Math.max(a[1],p),v=!0,d/(p-T)>.5))return}if(v||D.push([T,p]),this.config.renderTextTracksNatively){var o=this.captionsTracks[h];this.Cues.newCue(o,T,p,f)}else{var E=this.Cues.newCue(null,T,p,f);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:E,track:h})}},s.onInitPtsFound=function(h,T){var p=this,f=T.frag,D=T.id,v=T.initPTS,m=T.timescale,a=this.unparsedVttFrags;D==="main"&&(this.initPTS[f.cc]=v,this.timescale[f.cc]=m),a.length&&(this.unparsedVttFrags=[],a.forEach(function(d){p.onFragLoaded(B.Events.FRAG_LOADED,d)}))},s.getExistingTrack=function(h){var T=this.media;if(T)for(var p=0;p<T.textTracks.length;p++){var f=T.textTracks[p];if(f[h])return f}return null},s.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},s.createNativeTrack=function(h){if(this.captionsTracks[h])return;var T=this.captionsProperties,p=this.captionsTracks,f=this.media,D=T[h],v=D.label,m=D.languageCode,a=this.getExistingTrack(h);if(a)p[h]=a,Object(P.clearCurrentCues)(p[h]),Object(P.sendAddTrackEvent)(p[h],f);else{var d=this.createTextTrack("captions",v,m);d&&(d[h]=!0,p[h]=d)}},s.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var T=this.captionsProperties[h];if(!T)return;var p=T.label,f={_id:h,label:p,kind:"captions",default:T.media?!!T.media.default:!1,closedCaptions:T.media};this.nonNativeCaptionsTracks[h]=f,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[f]})},s.createTextTrack=function(h,T,p){var f=this.media;return f?f.addTextTrack(h,T,p):void 0},s.onMediaAttaching=function(h,T){this.media=T.media,this._cleanTracks()},s.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(T){Object(P.clearCurrentCues)(h[T]),delete h[T]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=S(),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())},s._cleanTracks=function(){var h=this.media;if(!h)return;var T=h.textTracks;if(T)for(var p=0;p<T.length;p++)Object(P.clearCurrentCues)(T[p])},s.onSubtitleTracksUpdated=function(h,T){var p=this;this.textTracks=[];var f=T.subtitleTracks||[],D=f.some(function(d){return d.textCodec===k.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var v=this.tracks&&f&&this.tracks.length===f.length;if(this.tracks=f||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(d,o){var E;if(o<m.length){for(var b=null,x=0;x<m.length;x++)if(R(m[x],d)){b=m[x];break}b&&(E=b)}E?Object(P.clearCurrentCues)(E):(E=p.createTextTrack("subtitles",d.name,d.lang),E&&(E.mode="disabled")),E&&(E.groupId=d.groupId,p.textTracks.push(E))})}else if(!v&&this.tracks&&this.tracks.length){var a=this.tracks.map(function(d){return{label:d.name,kind:d.type.toLowerCase(),default:d.default,subtitleTrack:d}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:a})}}},s.onManifestLoaded=function(h,T){var p=this;this.config.enableCEA708Captions&&T.captions&&T.captions.forEach(function(f){var D=/(?:CC|SERVICE)([1-4])/.exec(f.instreamId);if(!D)return;var v="textTrack"+D[1],m=p.captionsProperties[v];if(!m)return;m.label=f.name,f.lang&&(m.languageCode=f.lang),m.media=f})},s.onFragLoading=function(h,T){var p=this.cea608Parser1,f=this.cea608Parser2,D=this.lastSn,v=this.lastPartIndex;if(!this.enabled||!(p&&f))return;if(T.frag.type===y.PlaylistLevelType.MAIN){var m,a,d=T.frag.sn,o=(m=T==null||((a=T.part)===null||a===void 0)?void 0:a.index)!=null?m:-1;d===D+1||d===D&&o===v+1||(p.reset(),f.reset()),this.lastSn=d,this.lastPartIndex=o}},s.onFragLoaded=function(h,T){var p=T.frag,f=T.payload,D=this.initPTS,v=this.unparsedVttFrags;if(p.type===y.PlaylistLevelType.SUBTITLE)if(f.byteLength){if(!Object(J.isFiniteNumber)(D[p.cc])){v.push(T),D.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var m=p.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var a=this.tracks[p.level],d=this.vttCCs;d[p.cc]||(d[p.cc]={start:p.start,prevCC:this.prevCC,new:!0},this.prevCC=p.cc),a&&a.textCodec===k.IMSC1_CODEC?this._parseIMSC1(p,f):this._parseVTTs(p,f,d)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(h,T){var p=this,f=this.hls;Object(k.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(D){p._appendCues(D,h.level),f.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(D){C.logger.log("Failed to parse IMSC1: "+D),f.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:D})})},s._parseVTTs=function(h,T,p){var f=this,D=this.hls;Object(F.parseWebVTT)(T,this.initPTS[h.cc],this.timescale[h.cc],p,h.cc,h.start,function(v){f._appendCues(v,h.level),D.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(v){f._fallbackToIMSC1(h,T),C.logger.log("Failed to parse VTT cue: "+v),D.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:v})})},s._fallbackToIMSC1=function(h,T){var p=this,f=this.tracks[h.level];f.textCodec||Object(k.parseIMSC1)(T,this.initPTS[h.cc],this.timescale[h.cc],function(){f.textCodec=k.IMSC1_CODEC,p._parseIMSC1(h,T)},function(){f.textCodec="wvtt"})},s._appendCues=function(h,T){var p=this.hls;if(this.config.renderTextTracksNatively){var f=this.textTracks[T];if(f.mode==="disabled")return;h.forEach(function(m){return Object(P.addCueToTrack)(f,m)})}else{var D=this.tracks[T],v=D.default?"default":"subtitles"+T;p.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:h,track:v})}},s.onFragDecrypted=function(h,T){var p=T.frag;if(p.type===y.PlaylistLevelType.SUBTITLE){if(!Object(J.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(T);return}this.onFragLoaded(B.Events.FRAG_LOADED,T)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(h,T){var p=this.cea608Parser1,f=this.cea608Parser2;if(!this.enabled||!(p&&f))return;for(var D=0;D<T.samples.length;D++){var v=T.samples[D].bytes;if(v){var m=this.extractCea608Data(v);p.addData(T.samples[D].pts,m[0]),f.addData(T.samples[D].pts,m[1])}}},s.onBufferFlushing=function(h,T){var p=T.startOffset,f=T.endOffset,D=T.endOffsetSubtitles,v=T.type,m=this.media;if(!m||m.currentTime<f)return;if(!v||v==="video"){var a=this.captionsTracks;Object.keys(a).forEach(function(o){return Object(P.removeCuesInRange)(a[o],p,f)})}if(this.config.renderTextTracksNatively&&(p===0&&D!==void 0)){var d=this.textTracks;Object.keys(d).forEach(function(o){return Object(P.removeCuesInRange)(d[o],p,D)})}},s.extractCea608Data=function(h){for(var T=h[0]&31,p=2,f=[[],[]],D=0;D<T;D++){var v=h[p++],m=127&h[p++],a=127&h[p++],d=(4&v)!==0,o=3&v;if(m===0&&a===0)continue;d&&((o===0||o===1)&&(f[o].push(m),f[o].push(a)))}return f},c}();function R(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function A(c,s,u,h){return Math.min(s,h)-Math.max(c,u)}function S(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return J});var J=function(){function B(G,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=F}var M=B.prototype;return M.decrypt=function(F,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,F)},B}()},"./src/crypt/aes-decryptor.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"removePadding",function(){return B}),L.d(q,"default",function(){return M});var J=L("./src/utils/typed-array.ts");function B(G){var F=G.byteLength,P=F&&new DataView(G.buffer).getUint8(F-1);return P?Object(J.sliceUint8)(G,0,F-P):G}var M=function(){function G(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var F=G.prototype;return F.uint8ArrayToUint32Array_=function(k){for(var y=new DataView(k),C=new Uint32Array(4),O=0;O<4;O++)C[O]=y.getUint32(O*4);return C},F.initTable=function(){var k=this.sBox,y=this.invSBox,C=this.subMix,O=C[0],R=C[1],A=C[2],S=C[3],c=this.invSubMix,s=c[0],u=c[1],h=c[2],T=c[3],p=new Uint32Array(256),f=0,D=0,v=0;for(v=0;v<256;v++)v<128?p[v]=v<<1:p[v]=v<<1^283;for(v=0;v<256;v++){var m=D^D<<1^D<<2^D<<3^D<<4;m=m>>>8^m&255^99,k[f]=m,y[m]=f;var a=p[f],d=p[a],o=p[d],E=p[m]*257^m*16843008;O[f]=E<<24|E>>>8,R[f]=E<<16|E>>>16,A[f]=E<<8|E>>>24,S[f]=E,E=o*16843009^d*65537^a*257^f*16843008,s[m]=E<<24|E>>>8,u[m]=E<<16|E>>>16,h[m]=E<<8|E>>>24,T[m]=E,f?(f=a^p[p[p[o^a]]],D^=p[p[D]]):f=D=1}},F.expandKey=function(k){for(var y=this.uint8ArrayToUint32Array_(k),C=!0,O=0;O<y.length&&C;)C=y[O]===this.key[O],O++;if(C)return;this.key=y;var R=this.keySize=y.length;if(R!==4&&R!==6&&R!==8)throw new Error("Invalid aes key size="+R);var A=this.ksRows=(R+6+1)*4,S,c,s=this.keySchedule=new Uint32Array(A),u=this.invKeySchedule=new Uint32Array(A),h=this.sBox,T=this.rcon,p=this.invSubMix,f=p[0],D=p[1],v=p[2],m=p[3],a,d;for(S=0;S<A;S++){if(S<R){a=s[S]=y[S];continue}d=a,S%R===0?(d=d<<8|d>>>24,d=h[d>>>24]<<24|h[d>>>16&255]<<16|h[d>>>8&255]<<8|h[d&255],d^=T[S/R|0]<<24):R>6&&S%R===4&&(d=h[d>>>24]<<24|h[d>>>16&255]<<16|h[d>>>8&255]<<8|h[d&255]),s[S]=a=(s[S-R]^d)>>>0}for(c=0;c<A;c++)S=A-c,c&3?d=s[S]:d=s[S-4],c<4||S<=4?u[c]=d:u[c]=f[h[d>>>24]]^D[h[d>>>16&255]]^v[h[d>>>8&255]]^m[h[d&255]],u[c]=u[c]>>>0},F.networkToHostOrderSwap=function(k){return k<<24|(k&65280)<<8|(k&16711680)>>8|k>>>24},F.decrypt=function(k,y,C){for(var O=this.keySize+6,R=this.invKeySchedule,A=this.invSBox,S=this.invSubMix,c=S[0],s=S[1],u=S[2],h=S[3],T=this.uint8ArrayToUint32Array_(C),p=T[0],f=T[1],D=T[2],v=T[3],m=new Int32Array(k),a=new Int32Array(m.length),d,o,E,b,x,N,U,K,V,_,I,Y,ee,oe,he=this.networkToHostOrderSwap;y<m.length;){for(V=he(m[y]),_=he(m[y+1]),I=he(m[y+2]),Y=he(m[y+3]),x=V^R[0],N=Y^R[1],U=I^R[2],K=_^R[3],ee=4,oe=1;oe<O;oe++)d=c[x>>>24]^s[N>>16&255]^u[U>>8&255]^h[K&255]^R[ee],o=c[N>>>24]^s[U>>16&255]^u[K>>8&255]^h[x&255]^R[ee+1],E=c[U>>>24]^s[K>>16&255]^u[x>>8&255]^h[N&255]^R[ee+2],b=c[K>>>24]^s[x>>16&255]^u[N>>8&255]^h[U&255]^R[ee+3],x=d,N=o,U=E,K=b,ee=ee+4;d=A[x>>>24]<<24^A[N>>16&255]<<16^A[U>>8&255]<<8^A[K&255]^R[ee],o=A[N>>>24]<<24^A[U>>16&255]<<16^A[K>>8&255]<<8^A[x&255]^R[ee+1],E=A[U>>>24]<<24^A[K>>16&255]<<16^A[x>>8&255]<<8^A[N&255]^R[ee+2],b=A[K>>>24]<<24^A[x>>16&255]<<16^A[N>>8&255]<<8^A[U&255]^R[ee+3],a[y]=he(d^p),a[y+1]=he(b^f),a[y+2]=he(E^D),a[y+3]=he(o^v),p=V,f=_,D=I,v=Y,y=y+4}return a.buffer},G}()},"./src/crypt/decrypter.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return y});var J=L("./src/crypt/aes-crypto.ts"),B=L("./src/crypt/fast-aes-key.ts"),M=L("./src/crypt/aes-decryptor.ts"),G=L("./src/utils/logger.ts"),F=L("./src/utils/mp4-tools.ts"),P=L("./src/utils/typed-array.ts"),k=16,y=function(){function C(R,A,S){var c=S===void 0?{}:S,s=c.removePKCS7Padding,u=s===void 0?!0:s;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=R,this.config=A,this.removePKCS7Padding=u,u)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(T){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var O=C.prototype;return O.destroy=function(){this.observer=null},O.isSync=function(){return this.config.enableSoftwareAES},O.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var S=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(S):S},O.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},O.decrypt=function(A,S,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),S,c);var u=this.flush();u&&s(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),S,c).then(s)},O.softwareDecrypt=function(A,S,c){var s=this.currentIV,u=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(A=Object(F.appendUint8Array)(h,A),this.remainderData=null);var T=this.getValidChunk(A);if(!T.length)return null;s&&(c=s);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new M.default),p.expandKey(S);var f=u;return this.currentResult=p.decrypt(T.buffer,0,c),this.currentIV=Object(P.sliceUint8)(T,-16).buffer,f||null},O.webCryptoDecrypt=function(A,S,c){var s=this,u=this.subtle;return(this.key!==S||!this.fastAesKey)&&(this.key=S,this.fastAesKey=new B.default(u,S)),this.fastAesKey.expandKey().then(function(h){if(!u)return Promise.reject(new Error("web crypto not initialized"));var T=new J.default(u,c);return T.decrypt(A.buffer,h)}).catch(function(h){return s.onWebCryptoError(h,A,S,c)})},O.onWebCryptoError=function(A,S,c,s){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(S,c,s)},O.getValidChunk=function(A){var S=A,c=A.length-A.length%k;return c!==A.length&&(S=Object(P.sliceUint8)(A,0,c),this.remainderData=Object(P.sliceUint8)(A,c)),S},O.logOnce=function(A){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},C}()},"./src/crypt/fast-aes-key.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return J});var J=function(){function B(G,F){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=F}var M=B.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/demux/base-audio-demuxer.ts"),B=L("./src/demux/adts.ts"),M=L("./src/utils/logger.ts"),G=L("./src/demux/id3.ts");function F(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,P(y,C)}function P(y,C){return P=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},P(y,C)}var k=function(y){F(C,y);function C(R,A){var S;return S=y.call(this)||this,S.observer=void 0,S.config=void 0,S.observer=R,S.config=A,S}var O=C.prototype;return O.resetInitSegment=function(A,S,c){y.prototype.resetInitSegment.call(this,A,S,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:c,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var S=G.getID3Data(A,0)||[],c=S.length,s=A.length;c<s;c++)if(B.probe(A,c))return M.logger.log("ADTS sync word found !"),!0;return!1},O.canParse=function(A,S){return B.canParse(A,S)},O.appendFrame=function(A,S,c){B.initTrackConfig(A,this.observer,S,c,A.manifestCodec);var s=B.appendFrame(A,S,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},C}(J.default);k.minProbeByteLength=9,q.default=k},"./src/demux/adts.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"getAudioConfig",function(){return G}),L.d(q,"isHeaderPattern",function(){return F}),L.d(q,"getHeaderLength",function(){return P}),L.d(q,"getFullFrameLength",function(){return k}),L.d(q,"canGetFrameLength",function(){return y}),L.d(q,"isHeader",function(){return C}),L.d(q,"canParse",function(){return O}),L.d(q,"probe",function(){return R}),L.d(q,"initTrackConfig",function(){return A}),L.d(q,"getFrameDuration",function(){return S}),L.d(q,"parseFrameHeader",function(){return c}),L.d(q,"appendFrame",function(){return s});var J=L("./src/utils/logger.ts"),B=L("./src/errors.ts"),M=L("./src/events.ts");function G(u,h,T,p){var f,D,v,m,a=navigator.userAgent.toLowerCase(),d=p,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((h[T+2]&192)>>>6)+1;var E=(h[T+2]&60)>>>2;if(E>o.length-1){u.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return v=(h[T+2]&1)<<2,v|=(h[T+3]&192)>>>6,J.logger.log("manifest codec:"+p+", ADTS type:"+f+", samplingIndex:"+E),/firefox/i.test(a)?E>=6?(f=5,m=new Array(4),D=E-3):(f=2,m=new Array(2),D=E):a.indexOf("android")!==-1?(f=2,m=new Array(2),D=E):(f=5,m=new Array(4),p&&(p.indexOf("mp4a.40.29")!==-1||p.indexOf("mp4a.40.5")!==-1)||!p&&E>=6?D=E-3:((p&&p.indexOf("mp4a.40.2")!==-1&&(E>=6&&v===1||/vivaldi/i.test(a))||!p&&v===1)&&(f=2,m=new Array(2)),D=E)),m[0]=f<<3,m[0]|=(E&14)>>1,m[1]|=(E&1)<<7,m[1]|=v<<3,f===5&&(m[1]|=(D&14)>>1,m[2]=(D&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:o[E],channelCount:v,codec:"mp4a.40."+f,manifestCodec:d}}function F(u,h){return u[h]===255&&(u[h+1]&246)===240}function P(u,h){return u[h+1]&1?7:9}function k(u,h){return(u[h+3]&3)<<11|u[h+4]<<3|(u[h+5]&224)>>>5}function y(u,h){return h+5<u.length}function C(u,h){return h+1<u.length&&F(u,h)}function O(u,h){return y(u,h)&&F(u,h)&&k(u,h)<=u.length-h}function R(u,h){if(C(u,h)){var T=P(u,h);if(h+T>=u.length)return!1;var p=k(u,h);if(p<=T)return!1;var f=h+p;return f===u.length||C(u,f)}return!1}function A(u,h,T,p,f){if(!u.samplerate){var D=G(h,T,p,f);if(!D)return;u.config=D.config,u.samplerate=D.samplerate,u.channelCount=D.channelCount,u.codec=D.codec,u.manifestCodec=D.manifestCodec,J.logger.log("parsed codec:"+u.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function S(u){return 1024*9e4/u}function c(u,h,T,p,f){var D=P(u,h),v=k(u,h);if(v-=D,v>0){var m=T+p*f;return{headerLength:D,frameLength:v,stamp:m}}}function s(u,h,T,p,f){var D=S(u.samplerate),v=c(h,T,p,f,D);if(v){var m=v.frameLength,a=v.headerLength,d=v.stamp,o=a+m,E=Math.max(0,T+o-h.length),b;E?(b=new Uint8Array(o-a),b.set(h.subarray(T+a,h.length),0)):b=h.subarray(T+a,T+o);var x={unit:b,pts:d};return E||u.samples.push(x),{sample:x,length:o,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"initPTSFn",function(){return k});var J=L("./src/polyfills/number.ts"),B=L("./src/demux/id3.ts"),M=L("./src/demux/dummy-demuxed-track.ts"),G=L("./src/utils/mp4-tools.ts"),F=L("./src/utils/typed-array.ts"),P=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var C=y.prototype;return C.resetInitSegment=function(R,A,S){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},C.resetTimeStamp=function(){},C.resetContiguity=function(){},C.canParse=function(R,A){return!1},C.appendFrame=function(R,A,S){},C.demux=function(R,A){this.cachedData&&(R=Object(G.appendUint8Array)(this.cachedData,R),this.cachedData=null);var S=B.getID3Data(R,0),c=S?S.length:0,s,u,h=this._audioTrack,T=this._id3Track,p=S?B.getTimeStamp(S):void 0,f=R.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=k(p,A)),S&&S.length>0&&T.samples.push({pts:this.initPTS,dts:this.initPTS,data:S}),u=this.initPTS;c<f;){if(this.canParse(R,c)){var D=this.appendFrame(h,R,c);D?(this.frameIndex++,u=D.sample.pts,c+=D.length,s=c):c=f}else B.canParse(R,c)?(S=B.getID3Data(R,c),T.samples.push({pts:u,dts:u,data:S}),c+=S.length,s=c):c++;if(c===f&&s!==f){var v=Object(F.sliceUint8)(R,s);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:h,avcTrack:Object(M.dummyTrack)(),id3Track:T,textTrack:Object(M.dummyTrack)()}},C.demuxSampleAes=function(R,A,S){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},C.flush=function(R){var A=this.cachedData;return A&&(this.cachedData=null,this.demux(A,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},C.destroy=function(){},y}(),k=function(C,O){return Object(J.isFiniteNumber)(C)?C*90:O*9e4};q.default=P},"./src/demux/chunk-cache.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return J});var J=function(){function M(){this.chunks=[],this.dataLength=0}var G=M.prototype;return G.push=function(P){this.chunks.push(P),this.dataLength+=P.length},G.flush=function(){var P=this.chunks,k=this.dataLength,y;if(P.length)P.length===1?y=P[0]:y=B(P,k);else return new Uint8Array(0);return this.reset(),y},G.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function B(M,G){for(var F=new Uint8Array(G),P=0,k=0;k<M.length;k++){var y=M[k];F.set(y,P),P+=y.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"dummyTrack",function(){return J});function J(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/utils/logger.ts"),B=function(){function M(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var G=M.prototype;return G.loadWord=function(){var P=this.data,k=this.bytesAvailable,y=P.byteLength-k,C=new Uint8Array(4),O=Math.min(4,k);if(O===0)throw new Error("no bytes available");C.set(P.subarray(y,y+O)),this.word=new DataView(C.buffer).getUint32(0),this.bitsAvailable=O*8,this.bytesAvailable-=O},G.skipBits=function(P){var k;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,k=P>>3,P-=k>>3,this.bytesAvailable-=k,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},G.readBits=function(P){var k=Math.min(this.bitsAvailable,P),y=this.word>>>32-k;return P>32&&J.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=k,this.bitsAvailable>0?this.word<<=k:this.bytesAvailable>0&&this.loadWord(),k=P-k,k>0&&this.bitsAvailable?y<<k|this.readBits(k):y},G.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},G.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(P){for(var k=8,y=8,C,O=0;O<P;O++)y!==0&&(C=this.readEG(),y=(k+C+256)%256),k=y===0?k:y},G.readSPS=function(){var P=0,k=0,y=0,C=0,O,R,A,S=this.readUByte.bind(this),c=this.readBits.bind(this),s=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),T=this.skipEG.bind(this),p=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);S();var D=S();if(c(5),h(3),S(),p(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var v=s();if(v===3&&h(1),p(),p(),h(1),u())for(R=v!==3?8:12,A=0;A<R;A++)u()&&(A<6?f(16):f(64))}p();var m=s();if(m===0)s();else if(m===1)for(h(1),T(),T(),O=s(),A=0;A<O;A++)T();p(),h(1);var a=s(),d=s(),o=c(1);o===0&&h(1),h(1),u()&&(P=s(),k=s(),y=s(),C=s());var E=[1,1];if(u()&&u()){var b=S();switch(b){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[S()<<8|S(),S()<<8|S()];break}}}return{width:Math.ceil((a+1)*16-P*2-k*2),height:(2-o)*(d+1)*16-(o?2:4)*(y+C),pixelRatio:E}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();q.default=B},"./src/demux/id3.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"isHeader",function(){return J}),L.d(q,"isFooter",function(){return B}),L.d(q,"getID3Data",function(){return M}),L.d(q,"canParse",function(){return F}),L.d(q,"getTimeStamp",function(){return P}),L.d(q,"isTimeStampFrame",function(){return k}),L.d(q,"getID3Frames",function(){return C}),L.d(q,"decodeFrame",function(){return O}),L.d(q,"utf8ArrayToStr",function(){return s}),L.d(q,"testables",function(){return u});var J=function(f,D){return D+10<=f.length&&(f[D]===73&&f[D+1]===68&&f[D+2]===51&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},B=function(f,D){return D+10<=f.length&&(f[D]===51&&f[D+1]===68&&f[D+2]===73&&(f[D+3]<255&&f[D+4]<255&&(f[D+6]<128&&f[D+7]<128&&f[D+8]<128&&f[D+9]<128)))},M=function(f,D){for(var v=D,m=0;J(f,D);){m+=10;var a=G(f,D+6);m+=a,B(f,D+10)&&(m+=10),D+=m}return m>0?f.subarray(v,v+m):void 0},G=function(f,D){var v=0;return v=(f[D]&127)<<21,v|=(f[D+1]&127)<<14,v|=(f[D+2]&127)<<7,v|=f[D+3]&127,v},F=function(f,D){return J(f,D)&&G(f,D+6)+10<=f.length-D},P=function(f){for(var D=C(f),v=0;v<D.length;v++){var m=D[v];if(k(m))return c(m)}return},k=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},y=function(f){var D=String.fromCharCode(f[0],f[1],f[2],f[3]),v=G(f,4),m=10;return{type:D,size:v,data:f.subarray(m,m+v)}},C=function(f){for(var D=0,v=[];J(f,D);){var m=G(f,D+6);D+=10;for(var a=D+m;D+8<a;){var d=y(f.subarray(D)),o=O(d);o&&v.push(o),D+=d.size+10}B(f,D)&&(D+=10)}return v},O=function(f){return f.type==="PRIV"?R(f):f.type[0]==="W"?S(f):A(f)},R=function(f){if(f.size<2)return;var D=s(f.data,!0),v=new Uint8Array(f.data.subarray(D.length+1));return{key:f.type,info:D,data:v.buffer}},A=function(f){if(f.size<2)return;if(f.type==="TXXX"){var D=1,v=s(f.data.subarray(D),!0);D+=v.length+1;var m=s(f.data.subarray(D));return{key:f.type,info:v,data:m}}var a=s(f.data.subarray(1));return{key:f.type,data:a}},S=function(f){if(f.type==="WXXX"){if(f.size<2)return;var D=1,v=s(f.data.subarray(D),!0);D+=v.length+1;var m=s(f.data.subarray(D));return{key:f.type,info:v,data:m}}var a=s(f.data);return{key:f.type,data:a}},c=function(f){if(f.data.byteLength===8){var D=new Uint8Array(f.data),v=D[3]&1,m=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return m/=45,v&&(m+=4772185884e-2),Math.round(m)}return},s=function(f,D){D===void 0&&(D=!1);var v=T();if(v){var m=v.decode(f);if(D){var a=m.indexOf("\0");return a!==-1?m.substring(0,a):m}return m.replace(/\0/g,"")}for(var d=f.length,o,E,b,x="",N=0;N<d;){if(o=f[N++],o===0&&D)return x;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(o);break;case 12:case 13:E=f[N++],x+=String.fromCharCode((o&31)<<6|E&63);break;case 14:E=f[N++],b=f[N++],x+=String.fromCharCode((o&15)<<12|(E&63)<<6|(b&63)<<0);break;default:}}return x},u={decodeTextFrame:A},h;function T(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/demux/base-audio-demuxer.ts"),B=L("./src/demux/id3.ts"),M=L("./src/utils/logger.ts"),G=L("./src/demux/mpegaudio.ts");function F(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,P(y,C)}function P(y,C){return P=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},P(y,C)}var k=function(y){F(C,y);function C(){return y.apply(this,arguments)||this}var O=C.prototype;return O.resetInitSegment=function(A,S,c){y.prototype.resetInitSegment.call(this,A,S,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:c,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var S=B.getID3Data(A,0)||[],c=S.length,s=A.length;c<s;c++)if(G.probe(A,c))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},O.canParse=function(A,S){return G.canParse(A,S)},O.appendFrame=function(A,S,c){return this.initPTS===null?void 0:G.appendFrame(A,S,c,this.initPTS,this.frameIndex)},C}(J.default);k.minProbeByteLength=4,q.default=k},"./src/demux/mp4demuxer.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/utils/mp4-tools.ts"),B=L("./src/demux/dummy-demuxed-track.ts"),M=function(){function G(P,k){this.remainderData=null,this.config=void 0,this.config=k}var F=G.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},G.probe=function(k){return Object(J.findBox)({data:k,start:0,end:Math.min(k.length,16384)},["moof"]).length>0},F.demux=function(k){var y=k,C=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(J.appendUint8Array)(this.remainderData,k));var O=Object(J.segmentValidRange)(y);this.remainderData=O.remainder,C.samples=O.valid||new Uint8Array}else C.samples=y;return{audioTrack:Object(B.dummyTrack)(),avcTrack:C,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},F.flush=function(){var k=Object(B.dummyTrack)();return k.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:k,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},F.demuxSampleAes=function(k,y,C){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},G}();M.minProbeByteLength=1024,q.default=M},"./src/demux/mpegaudio.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"appendFrame",function(){return P}),L.d(q,"parseHeader",function(){return k}),L.d(q,"isHeaderPattern",function(){return y}),L.d(q,"isHeader",function(){return C}),L.d(q,"canParse",function(){return O}),L.d(q,"probe",function(){return R});var J=null,B=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function P(A,S,c,s,u){if(c+24>S.length)return;var h=k(S,c);if(h&&c+h.frameLength<=S.length){var T=h.samplesPerFrame*9e4/h.sampleRate,p=s+u*T,f={unit:S.subarray(c,c+h.frameLength),pts:p,dts:p};return A.config=[],A.channelCount=h.channelCount,A.samplerate=h.sampleRate,A.samples.push(f),{sample:f,length:h.frameLength,missing:0}}}function k(A,S){var c=A[S+1]>>3&3,s=A[S+1]>>1&3,u=A[S+2]>>4&15,h=A[S+2]>>2&3;if(c!==1&&u!==0&&u!==15&&h!==3){var T=A[S+2]>>1&1,p=A[S+3]>>6,f=c===3?3-s:s===3?3:4,D=B[f*14+u-1]*1e3,v=c===3?0:c===2?1:2,m=M[v*3+h],a=p===3?1:2,d=G[c][s],o=F[s],E=d*8*o,b=Math.floor(d*D/m+T)*o;if(J===null){var x=navigator.userAgent||"",N=x.match(/Chrome\/(\d+)/i);J=N?parseInt(N[1]):0}var U=!!J&&J<=87;return U&&s===2&&D>=224e3&&p===0&&(A[S+3]=A[S+3]|128),{sampleRate:m,channelCount:a,frameLength:b,samplesPerFrame:E}}}function y(A,S){return A[S]===255&&(A[S+1]&224)===224&&(A[S+1]&6)!==0}function C(A,S){return S+1<A.length&&y(A,S)}function O(A,S){var c=4;return y(A,S)&&c<=A.length-S}function R(A,S){if(S+1<A.length&&y(A,S)){var c=4,s=k(A,S),u=c;s!=null&&s.frameLength&&(u=s.frameLength);var h=S+u;return h===A.length||C(A,h)}return!1}},"./src/demux/sample-aes.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/crypt/decrypter.ts"),B=L("./src/demux/tsdemuxer.ts"),M=function(){function G(P,k,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new J.default(P,k,{removePKCS7Padding:!1})}var F=G.prototype;return F.decryptBuffer=function(k,y){this.decrypter.decrypt(k,this.keyData.key.buffer,this.keyData.iv.buffer,y)},F.decryptAacSample=function(k,y,C,O){var R=k[y].unit,A=R.subarray(16,R.length-R.length%16),S=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),c=this;this.decryptBuffer(S,function(s){var u=new Uint8Array(s);R.set(u,16),O||c.decryptAacSamples(k,y+1,C)})},F.decryptAacSamples=function(k,y,C){for(;;y++){if(y>=k.length){C();return}if(k[y].unit.length<32)continue;var O=this.decrypter.isSync();if(this.decryptAacSample(k,y,C,O),!O)return}},F.getAvcEncryptedData=function(k){for(var y=Math.floor((k.length-48)/160)*16+16,C=new Int8Array(y),O=0,R=32;R<=k.length-16;R+=160,O+=16)C.set(k.subarray(R,R+16),O);return C},F.getAvcDecryptedUnit=function(k,y){for(var C=new Uint8Array(y),O=0,R=32;R<=k.length-16;R+=160,O+=16)k.set(C.subarray(O,O+16),R);return k},F.decryptAvcSample=function(k,y,C,O,R,A){var S=Object(B.discardEPB)(R.data),c=this.getAvcEncryptedData(S),s=this;this.decryptBuffer(c.buffer,function(u){R.data=s.getAvcDecryptedUnit(S,u),A||s.decryptAvcSamples(k,y,C+1,O)})},F.decryptAvcSamples=function(k,y,C,O){if(k instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,C=0){if(y>=k.length){O();return}for(var R=k[y].units;!(C>=R.length);C++){var A=R[C];if(A.data.length<=48||A.type!==1&&A.type!==5)continue;var S=this.decrypter.isSync();if(this.decryptAvcSample(k,y,C,O,A,S),!S)return}}},G}();q.default=M},"./src/demux/transmuxer-interface.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return R});var J=L("./node_modules/webworkify-webpack/index.js"),B=L.n(J),M=L("./src/events.ts"),G=L("./src/demux/transmuxer.ts"),F=L("./src/utils/logger.ts"),P=L("./src/errors.ts"),k=L("./src/utils/mediasource-helper.ts"),y=L("./node_modules/eventemitter3/index.js"),C=L.n(y),O=Object(k.getMediaSource)()||{isTypeSupported:function(){return!1}},R=function(){function A(c,s,u,h){var T=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=c,this.id=s,this.onTransmuxComplete=u,this.onFlush=h;var p=c.config,f=function(d,o){o=o||{},o.frag=T.frag,o.id=T.id,c.trigger(d,o)};this.observer=new y.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,f),this.observer.on(M.Events.ERROR,f);var D={mp4:O.isTypeSupported("video/mp4"),mpeg:O.isTypeSupported("audio/mpeg"),mp3:O.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var m;try{m=this.worker=J("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(a){c.trigger(M.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(a.message+" ("+a.filename+":"+a.lineno+")")})},m.postMessage({cmd:"init",typeSupported:D,vendor:v,id:s,config:JSON.stringify(p)})}catch(a){F.logger.warn("Error in worker:",a),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new G.default(this.observer,D,p,v,s),this.worker=null}}else this.transmuxer=new G.default(this.observer,D,p,v,s)}var S=A.prototype;return S.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},S.push=function(s,u,h,T,p,f,D,v,m,a){var d=this;m.transmuxing.start=self.performance.now();var o=this.transmuxer,E=this.worker,b=f?f.start:p.start,x=p.decryptdata,N=this.frag,U=!(N&&p.cc===N.cc),K=!(N&&m.level===N.level),V=N?m.sn-N.sn:-1,_=this.part?m.part-this.part.index:1,I=!K&&(V===1||V===0&&_===1),Y=self.performance.now();(K||V||p.stats.parsing.start===0)&&(p.stats.parsing.start=Y),f&&(_||!I)&&(f.stats.parsing.start=Y);var ee=new G.TransmuxState(U,I,v,K,b);if(!I||U){F.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
|
|
discontinuity: `+U+`
|
|
trackSwitch: `+K+`
|
|
contiguous: `+I+`
|
|
accurateTimeOffset: `+v+`
|
|
timeOffset: `+b);var oe=new G.TransmuxConfig(h,T,u,D,a);this.configureTransmuxer(oe)}if(this.frag=p,this.part=f,E)E.postMessage({cmd:"demux",data:s,decryptdata:x,chunkMeta:m,state:ee},s instanceof ArrayBuffer?[s]:[]);else if(o){var he=o.push(s,x,m,ee);Object(G.isPromise)(he)?he.then(function(Le){d.handleTransmuxComplete(Le)}):this.handleTransmuxComplete(he)}},S.flush=function(s){var u=this;s.transmuxing.start=self.performance.now();var h=this.transmuxer,T=this.worker;if(T)T.postMessage({cmd:"flush",chunkMeta:s});else if(h){var p=h.flush(s);Object(G.isPromise)(p)?p.then(function(f){u.handleFlushResult(f,s)}):this.handleFlushResult(p,s)}},S.handleFlushResult=function(s,u){var h=this;s.forEach(function(T){h.handleTransmuxComplete(T)}),this.onFlush(u)},S.onWorkerMessage=function(s){var u=s.data,h=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,h.trigger(u.event,u.data);break}}},S.configureTransmuxer=function(s){var u=this.worker,h=this.transmuxer;u?u.postMessage({cmd:"configure",config:s}):h&&h.configure(s)},S.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},A}()},"./src/demux/transmuxer-worker.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return P});var J=L("./src/demux/transmuxer.ts"),B=L("./src/events.ts"),M=L("./src/utils/logger.ts"),G=L("./node_modules/eventemitter3/index.js"),F=L.n(G);function P(R){var A=new G.EventEmitter,S=function(s,u){R.postMessage({event:s,data:u})};A.on(B.Events.FRAG_DECRYPTED,S),A.on(B.Events.ERROR,S),R.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var u=JSON.parse(s.config);R.transmuxer=new J.default(A,s.typeSupported,u,s.vendor,s.id),Object(M.enableLogs)(u.debug),S("init",null);break}case"configure":{R.transmuxer.configure(s.config);break}case"demux":{var h=R.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(J.isPromise)(h)?h.then(function(f){k(R,f)}):k(R,h);break}case"flush":{var T=s.chunkMeta,p=R.transmuxer.flush(T);Object(J.isPromise)(p)?p.then(function(f){C(R,f,T)}):C(R,p,T);break}default:break}})}function k(R,A){if(O(A.remuxResult))return;var S=[],c=A.remuxResult,s=c.audio,u=c.video;s&&y(S,s),u&&y(S,u),R.postMessage({event:"transmuxComplete",data:A},S)}function y(R,A){A.data1&&R.push(A.data1.buffer),A.data2&&R.push(A.data2.buffer)}function C(R,A,S){A.forEach(function(c){k(R,c)}),R.postMessage({event:"flush",data:S})}function O(R){return!R.audio&&!R.video&&!R.text&&!R.id3&&!R.initSegment}},"./src/demux/transmuxer.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return u}),L.d(q,"isPromise",function(){return p}),L.d(q,"TransmuxConfig",function(){return f}),L.d(q,"TransmuxState",function(){return D});var J=L("./src/events.ts"),B=L("./src/errors.ts"),M=L("./src/crypt/decrypter.ts"),G=L("./src/demux/aacdemuxer.ts"),F=L("./src/demux/mp4demuxer.ts"),P=L("./src/demux/tsdemuxer.ts"),k=L("./src/demux/mp3demuxer.ts"),y=L("./src/remux/mp4-remuxer.ts"),C=L("./src/remux/passthrough-remuxer.ts"),O=L("./src/demux/chunk-cache.ts"),R=L("./src/utils/mp4-tools.ts"),A=L("./src/utils/logger.ts"),S;try{S=self.performance.now.bind(self.performance)}catch(v){A.logger.debug("Unable to use Performance API on this environment"),S=self.Date.now}var c=[{demux:P.default,remux:y.default},{demux:F.default,remux:C.default},{demux:G.default,remux:y.default},{demux:k.default,remux:y.default}],s=1024;c.forEach(function(v){var m=v.demux;s=Math.max(s,m.minProbeByteLength)});var u=function(){function v(a,d,o,E,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 O.default,this.observer=a,this.typeSupported=d,this.config=o,this.vendor=E,this.id=b}var m=v.prototype;return m.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},m.push=function(d,o,E,b){var x=this,N=E.transmuxing;N.executeStart=S();var U=new Uint8Array(d),K=this.cache,V=this.config,_=this.currentTransmuxState,I=this.transmuxConfig;b&&(this.currentTransmuxState=b);var Y=h(U,o);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(V.enableSoftwareAES){var oe=ee.softwareDecrypt(U,Y.key.buffer,Y.iv.buffer);if(!oe)return N.executeEnd=S(),T(E);U=new Uint8Array(oe)}else return this.decryptionPromise=ee.webCryptoDecrypt(U,Y.key.buffer,Y.iv.buffer).then(function(Me){var Pe=x.push(Me,null,E);return x.decryptionPromise=null,Pe}),this.decryptionPromise}var he=b||_,Le=he.contiguous,xe=he.discontinuity,Ae=he.trackSwitch,Te=he.accurateTimeOffset,Ce=he.timeOffset,pe=I.audioCodec,de=I.videoCodec,re=I.defaultInitPts,ce=I.duration,ae=I.initSegmentData;if((xe||Ae)&&this.resetInitSegment(ae,pe,de,ce),xe&&this.resetInitialTimestamp(re),Le||this.resetContiguity(),this.needsProbing(U,xe,Ae)){if(K.dataLength){var we=K.flush();U=Object(R.appendUint8Array)(we,U)}this.configureTransmuxer(U,I)}var De=this.transmux(U,Y,Ce,Te,E),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,N.executeEnd=S(),De},m.flush=function(d){var o=this,E=d.transmuxing;E.executeStart=S();var b=this.decrypter,x=this.cache,N=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return o.flush(d)});var K=[],V=N.timeOffset;if(b){var _=b.flush();_&&K.push(this.push(_,null,d))}var I=x.dataLength;x.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return I>=s&&this.observer.emit(J.Events.ERROR,J.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=S(),[T(d)];var oe=Y.flush(V);return p(oe)?oe.then(function(he){return o.flushRemux(K,he,d),K}):(this.flushRemux(K,oe,d),K)},m.flushRemux=function(d,o,E){var b=o.audioTrack,x=o.avcTrack,N=o.id3Track,U=o.textTrack,K=this.currentTransmuxState,V=K.accurateTimeOffset,_=K.timeOffset;A.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var I=this.remuxer.remux(b,x,N,U,_,V,!0,this.id);d.push({remuxResult:I,chunkMeta:E}),E.transmuxing.executeEnd=S()},m.resetInitialTimestamp=function(d){var o=this.demuxer,E=this.remuxer;if(!o||!E)return;o.resetTimeStamp(d),E.resetTimeStamp(d)},m.resetContiguity=function(){var d=this.demuxer,o=this.remuxer;if(!d||!o)return;d.resetContiguity(),o.resetNextTimestamp()},m.resetInitSegment=function(d,o,E,b){var x=this.demuxer,N=this.remuxer;if(!x||!N)return;x.resetInitSegment(o,E,b),N.resetInitSegment(d,o,E)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(d,o,E,b,x){var N;return o&&o.method==="SAMPLE-AES"?N=this.transmuxSampleAes(d,o,E,b,x):N=this.transmuxUnencrypted(d,E,b,x),N},m.transmuxUnencrypted=function(d,o,E,b){var x=this.demuxer.demux(d,o,!1,!this.config.progressive),N=x.audioTrack,U=x.avcTrack,K=x.id3Track,V=x.textTrack,_=this.remuxer.remux(N,U,K,V,o,E,!1,this.id);return{remuxResult:_,chunkMeta:b}},m.transmuxSampleAes=function(d,o,E,b,x){var N=this;return this.demuxer.demuxSampleAes(d,o,E).then(function(U){var K=N.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,E,b,!1,N.id);return{remuxResult:K,chunkMeta:x}})},m.configureTransmuxer=function(d,o){for(var E=this.config,b=this.observer,x=this.typeSupported,N=this.vendor,U=o.audioCodec,K=o.defaultInitPts,V=o.duration,_=o.initSegmentData,I=o.videoCodec,Y,ee=0,oe=c.length;ee<oe;ee++)if(c[ee].demux.probe(d)){Y=c[ee];break}Y||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:F.default,remux:C.default});var he=this.demuxer,Le=this.remuxer,xe=Y.remux,Ae=Y.demux;(!Le||!(Le instanceof xe))&&(this.remuxer=new xe(b,E,x,N)),(!he||!(he instanceof Ae))&&(this.demuxer=new Ae(b,E,x),this.probe=Ae.probe),this.resetInitSegment(_,U,I,V),this.resetInitialTimestamp(K)},m.needsProbing=function(d,o,E){return!this.demuxer||!this.remuxer||o||E},m.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new M.default(this.observer,this.config)),d},v}();function h(v,m){var a=null;return v.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(a=m),a}var T=function(m){return{remuxResult:{},chunkMeta:m}};function p(v){return"then"in v&&v.then instanceof Function}var f=function(m,a,d,o,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=a,this.initSegmentData=d,this.duration=o,this.defaultInitPts=E},D=function(m,a,d,o,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=a,this.accurateTimeOffset=d,this.trackSwitch=o,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"discardEPB",function(){return T});var J=L("./src/demux/adts.ts"),B=L("./src/demux/mpegaudio.ts"),M=L("./src/demux/exp-golomb.ts"),G=L("./src/demux/id3.ts"),F=L("./src/demux/sample-aes.ts"),P=L("./src/events.ts"),k=L("./src/utils/mp4-tools.ts"),y=L("./src/utils/logger.ts"),C=L("./src/errors.ts"),O={video:1,audio:2,id3:3,text:4},R=function(){function p(D,v,m){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=v,this.typeSupported=m}p.probe=function(v){var m=p.syncOffset(v);return m<0?!1:(m&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},p.syncOffset=function(v){for(var m=Math.min(1e3,v.length-3*188),a=0;a<m;){if(v[a]===71&&v[a+188]===71&&v[a+2*188]===71)return a;a++}return-1},p.createTrack=function(v,m){return{container:v==="video"||v==="audio"?"video/mp2t":void 0,type:v,id:O[v],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:v==="audio"?m:void 0}};var f=p.prototype;return f.resetInitSegment=function(v,m,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=p.createTrack("video",a),this._audioTrack=p.createTrack("audio",a),this._id3Track=p.createTrack("id3",a),this._txtTrack=p.createTrack("text",a),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=v,this.videoCodec=m,this._duration=a},f.resetTimeStamp=function(){},f.resetContiguity=function(){var v=this._audioTrack,m=this._avcTrack,a=this._id3Track;v&&(v.pesData=null),m&&(m.pesData=null),a&&(a.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},f.demux=function(v,m,a,d){a===void 0&&(a=!1),d===void 0&&(d=!1),a||(this.sampleAes=null);var o,E=this._avcTrack,b=this._audioTrack,x=this._id3Track,N=E.pid,U=E.pesData,K=b.pid,V=x.pid,_=b.pesData,I=x.pesData,Y=!1,ee=this.pmtParsed,oe=this._pmtId,he=v.length;if(this.remainderData&&(v=Object(k.appendUint8Array)(this.remainderData,v),he=v.length,this.remainderData=null),he<188&&!d)return this.remainderData=v,{audioTrack:b,avcTrack:E,id3Track:x,textTrack:this._txtTrack};var Le=Math.max(0,p.syncOffset(v));he-=(he+Le)%188,he<v.byteLength&&!d&&(this.remainderData=new Uint8Array(v.buffer,he,v.buffer.byteLength-he));for(var xe=Le;xe<he;xe+=188)if(v[xe]===71){var Ae=!!(v[xe+1]&64),Te=((v[xe+1]&31)<<8)+v[xe+2],Ce=(v[xe+3]&48)>>4,pe=void 0;if(Ce>1){if(pe=xe+5+v[xe+4],pe===xe+188)continue}else pe=xe+4;switch(Te){case N:Ae&&(U&&(o=s(U))&&this.parseAVCPES(o,!1),U={data:[],size:0}),U&&(U.data.push(v.subarray(pe,xe+188)),U.size+=xe+188-pe);break;case K:Ae&&(_&&(o=s(_))&&(b.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),_={data:[],size:0}),_&&(_.data.push(v.subarray(pe,xe+188)),_.size+=xe+188-pe);break;case V:Ae&&(I&&(o=s(I))&&this.parseID3PES(o),I={data:[],size:0}),I&&(I.data.push(v.subarray(pe,xe+188)),I.size+=xe+188-pe);break;case 0:Ae&&(pe+=v[pe]+1),oe=this._pmtId=S(v,pe);break;case oe:{Ae&&(pe+=v[pe]+1);var de=c(v,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,a);N=de.avc,N>0&&(E.pid=N),K=de.audio,K>0&&(b.pid=K,b.isAAC=de.isAAC),V=de.id3,V>0&&(x.pid=V),Y&&!ee&&(y.logger.log("reparse from beginning"),Y=!1,xe=Le-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=U,b.pesData=_,x.pesData=I;var re={audioTrack:b,avcTrack:E,id3Track:x,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(re),re},f.flush=function(){var v=this.remainderData;this.remainderData=null;var m;return v?m=this.demux(v,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},f.extractRemainingSamples=function(v){var m=v.audioTrack,a=v.avcTrack,d=v.id3Track,o=a.pesData,E=m.pesData,b=d.pesData,x;o&&(x=s(o))?(this.parseAVCPES(x,!0),a.pesData=null):a.pesData=o,E&&(x=s(E))?(m.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),m.pesData=null):(E!=null&&E.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=E),b&&(x=s(b))?(this.parseID3PES(x),d.pesData=null):d.pesData=b},f.demuxSampleAes=function(v,m,a){var d=this.demux(v,a,!0,!this.config.progressive),o=this.sampleAes=new F.default(this.observer,this.config,m);return this.decrypt(d,o)},f.decrypt=function(v,m){return new Promise(function(a){var d=v.audioTrack,o=v.avcTrack;d.samples&&d.isAAC?m.decryptAacSamples(d.samples,0,function(){o.samples?m.decryptAvcSamples(o.samples,0,0,function(){a(v)}):a(v)}):o.samples&&m.decryptAvcSamples(o.samples,0,0,function(){a(v)})})},f.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},f.parseAVCPES=function(v,m){var a=this,d=this._avcTrack,o=this.parseAVCNALu(v.data),E=!1,b=this.avcSample,x,N=!1;v.data=null,b&&o.length&&!d.audFound&&(u(b,d),b=this.avcSample=A(!1,v.pts,v.dts,"")),o.forEach(function(U){switch(U.type){case 1:{x=!0,b||(b=a.avcSample=A(!0,v.pts,v.dts,"")),E&&(b.debug+="NDR "),b.frame=!0;var K=U.data;if(N&&K.length>4){var V=new M.default(K).readSliceType();(V===2||V===4||V===7||V===9)&&(b.key=!0)}break}case 5:x=!0,b||(b=a.avcSample=A(!0,v.pts,v.dts,"")),E&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{x=!0,E&&b&&(b.debug+="SEI ");var _=new M.default(T(U.data));_.readUByte();for(var I=0,Y=0,ee=!1,oe=0;!ee&&_.bytesAvailable>1;){I=0;do oe=_.readUByte(),I+=oe;while(oe===255);Y=0;do oe=_.readUByte(),Y+=oe;while(oe===255);if(I===4&&_.bytesAvailable!==0){ee=!0;var he=_.readUByte();if(he===181){var Le=_.readUShort();if(Le===49){var xe=_.readUInt();if(xe===1195456820){var Ae=_.readUByte();if(Ae===3){for(var Te=_.readUByte(),Ce=_.readUByte(),pe=31&Te,de=[Te,Ce],re=0;re<pe;re++)de.push(_.readUByte()),de.push(_.readUByte()),de.push(_.readUByte());h(a._txtTrack.samples,{type:3,pts:v.pts,bytes:de})}}}}}else if(I===5&&_.bytesAvailable!==0){if(ee=!0,Y>16){for(var ce=[],ae=0;ae<16;ae++)ce.push(_.readUByte().toString(16)),(ae===3||ae===5||ae===7||ae===9)&&ce.push("-");for(var we=Y-16,De=new Uint8Array(we),ye=0;ye<we;ye++)De[ye]=_.readUByte();h(a._txtTrack.samples,{pts:v.pts,payloadType:I,uuid:ce.join(""),userData:Object(G.utf8ArrayToStr)(De),userDataBytes:De})}}else if(Y<_.bytesAvailable)for(var Me=0;Me<Y;Me++)_.readUByte()}break}case 7:if(x=!0,N=!0,E&&b&&(b.debug+="SPS "),!d.sps){var Pe=new M.default(U.data),Ne=Pe.readSPS();d.width=Ne.width,d.height=Ne.height,d.pixelRatio=Ne.pixelRatio,d.sps=[U.data],d.duration=a._duration;for(var Fe=U.data.subarray(1,4),Be="avc1.",Ue=0;Ue<3;Ue++){var nt=Fe[Ue].toString(16);nt.length<2&&(nt="0"+nt),Be+=nt}d.codec=Be}break;case 8:x=!0,E&&b&&(b.debug+="PPS "),d.pps||(d.pps=[U.data]);break;case 9:x=!1,d.audFound=!0,b&&u(b,d),b=a.avcSample=A(!1,v.pts,v.dts,E?"AUD ":"");break;case 12:x=!1;break;default:x=!1,b&&(b.debug+="unknown NAL "+U.type+" ");break}if(b&&x){var it=b.units;it.push(U)}}),m&&b&&(u(b,d),this.avcSample=null)},f.getLastNalUnit=function(){var v,m=this.avcSample,a;if(!m||m.units.length===0){var d=this._avcTrack.samples;m=d[d.length-1]}if((v=m)!==null&&v!==void 0&&v.units){var o=m.units;a=o[o.length-1]}return a},f.parseAVCNALu=function(v){var m=v.byteLength,a=this._avcTrack,d=a.naluState||0,o=d,E=[],b=0,x,N,U,K=-1,V=0;for(d===-1&&(K=0,V=v[0]&31,d=0,b=1);b<m;){if(x=v[b++],!d){d=x?0:1;continue}if(d===1){d=x?0:2;continue}if(!x)d=3;else if(x===1){if(K>=0){var _={data:v.subarray(K,b-d-1),type:V};E.push(_)}else{var I=this.getLastNalUnit();if(I&&(o&&b<=4-o&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-o))),N=b-d-1,N>0)){var Y=new Uint8Array(I.data.byteLength+N);Y.set(I.data,0),Y.set(v.subarray(0,N),I.data.byteLength),I.data=Y,I.state=0}}b<m?(U=v[b]&31,K=b,V=U,d=0):d=-1}else d=0}if(K>=0&&d>=0){var ee={data:v.subarray(K,m),type:V,state:d};E.push(ee)}if(E.length===0){var oe=this.getLastNalUnit();if(oe){var he=new Uint8Array(oe.data.byteLength+v.byteLength);he.set(oe.data,0),he.set(v,oe.data.byteLength),oe.data=he}}return a.naluState=d,E},f.parseAACPES=function(v){var m=0,a=this._audioTrack,d=this.aacOverFlow,o=v.data;if(d){this.aacOverFlow=null;var E=d.sample.unit.byteLength,b=Math.min(d.missing,E),x=E-b;d.sample.unit.set(o.subarray(0,b),x),a.samples.push(d.sample),m=d.missing}var N,U;for(N=m,U=o.length;N<U-1&&!J.isHeader(o,N);N++);if(N!==m){var K,V;if(N<U-1?(K="AAC PES did not start with ADTS header,offset:"+N,V=!1):(K="no ADTS header found in AAC PES",V=!0),y.logger.warn("parsing error:"+K),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:V,reason:K}),V)return}J.initTrackConfig(a,this.observer,o,N,this.audioCodec);var _;if(v.pts!==void 0)_=v.pts;else if(d){var I=J.getFrameDuration(a.samplerate);_=d.sample.pts+I}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;N<U;)if(J.isHeader(o,N)){if(N+5<U){var ee=J.appendFrame(a,o,N,_,Y);if(ee)if(ee.missing)this.aacOverFlow=ee;else{N+=ee.length,Y++;continue}}break}else N++},f.parseMPEGPES=function(v){var m=v.data,a=m.length,d=0,o=0,E=v.pts;if(E===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<a;)if(B.isHeader(m,o)){var b=B.appendFrame(this._audioTrack,m,o,E,d);if(b)o+=b.length,d++;else break}else o++},f.parseID3PES=function(v){if(v.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(v)},p}();R.minProbeByteLength=188;function A(p,f,D,v){return{key:p,frame:!1,pts:f,dts:D,units:[],debug:v,length:0}}function S(p,f){return(p[f+10]&31)<<8|p[f+11]}function c(p,f,D,v){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},a=(p[f+1]&15)<<8|p[f+2],d=f+3+a-4,o=(p[f+10]&15)<<8|p[f+11];for(f+=12+o;f<d;){var E=(p[f+1]&31)<<8|p[f+2];switch(p[f]){case 207:if(!v){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=E);break;case 21:m.id3===-1&&(m.id3=E);break;case 219:if(!v){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=E);break;case 3:case 4:D?m.audio===-1&&(m.audio=E,m.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}f+=((p[f+3]&15)<<8|p[f+4])+5}return m}function s(p){var f=0,D,v,m,a,d,o=p.data;if(!p||p.size===0)return null;for(;o[0].length<19&&o.length>1;){var E=new Uint8Array(o[0].length+o[1].length);E.set(o[0]),E.set(o[1],o[0].length),o[0]=E,o.splice(1,1)}D=o[0];var b=(D[0]<<16)+(D[1]<<8)+D[2];if(b===1){if(v=(D[4]<<8)+D[5],v&&v>p.size-6)return null;var x=D[7];x&192&&(a=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,x&64?(d=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,a-d>60*9e4&&(y.logger.warn(Math.round((a-d)/9e4)+"s delta between PTS and DTS, align them"),a=d)):d=a),m=D[8];var N=m+9;if(p.size<=N)return null;p.size-=N;for(var U=new Uint8Array(p.size),K=0,V=o.length;K<V;K++){D=o[K];var _=D.byteLength;if(N)if(N>_){N-=_;continue}else D=D.subarray(N),_-=N,N=0;U.set(D,f),f+=_}return v&&(v-=m+3),{data:U,pts:a,dts:d,len:v}}return null}function u(p,f){if(p.units.length&&p.frame){if(p.pts===void 0){var D=f.samples,v=D.length;if(v){var m=D[v-1];p.pts=m.pts,p.dts=m.dts}else{f.dropped++;return}}f.samples.push(p)}p.debug.length&&y.logger.log(p.pts+"/"+p.dts+":"+p.debug)}function h(p,f){var D=p.length;if(D>0){if(f.pts>=p[D-1].pts)p.push(f);else for(var v=D-1;v>=0;v--)if(f.pts<p[v].pts){p.splice(v,0,f);break}}else p.push(f)}function T(p){for(var f=p.byteLength,D=[],v=1;v<f-2;)p[v]===0&&p[v+1]===0&&p[v+2]===3?(D.push(v+2),v+=2):v++;if(D.length===0)return p;var m=f-D.length,a=new Uint8Array(m),d=0;for(v=0;v<m;d++,v++)d===D[0]&&(d++,D.shift()),a[v]=p[d];return a}q.default=R},"./src/errors.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"ErrorTypes",function(){return J}),L.d(q,"ErrorDetails",function(){return B});var J;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(J||(J={}));var B;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"Events",function(){return J});var J;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(J||(J={}))},"./src/hls.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return p});var J=L("./node_modules/url-toolkit/src/url-toolkit.js"),B=L.n(J),M=L("./src/loader/playlist-loader.ts"),G=L("./src/loader/key-loader.ts"),F=L("./src/controller/id3-track-controller.ts"),P=L("./src/controller/latency-controller.ts"),k=L("./src/controller/level-controller.ts"),y=L("./src/controller/fragment-tracker.ts"),C=L("./src/controller/stream-controller.ts"),O=L("./src/is-supported.ts"),R=L("./src/utils/logger.ts"),A=L("./src/config.ts"),S=L("./node_modules/eventemitter3/index.js"),c=L.n(S),s=L("./src/events.ts"),u=L("./src/errors.ts");function h(f,D){for(var v=0;v<D.length;v++){var m=D[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}function T(f,D,v){return D&&h(f.prototype,D),v&&h(f,v),f}var p=function(){f.isSupported=function(){return Object(O.isSupported)()};function f(v){v===void 0&&(v={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new S.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 m=this.config=Object(A.mergeConfig)(f.DefaultConfig,v);this.userConfig=v,Object(R.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(A.enableStreamingMode)(m);var a=m.abrController,d=m.bufferController,o=m.capLevelController,E=m.fpsController,b=this.abrController=new a(this),x=this.bufferController=new d(this),N=this.capLevelController=new o(this),U=new E(this),K=new M.default(this),V=new G.default(this),_=new F.default(this),I=this.levelController=new k.default(this),Y=new y.FragmentTracker(this),ee=this.streamController=new C.default(this,Y);N.setStreamController(ee),U.setStreamController(ee);var oe=[I,ee];this.networkControllers=oe;var he=[K,V,b,x,N,U,_,Y];this.audioTrackController=this.createController(m.audioTrackController,null,oe),this.createController(m.audioStreamController,Y,oe),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,oe),this.createController(m.subtitleStreamController,Y,oe),this.createController(m.timelineController,null,he),this.emeController=this.createController(m.emeController,null,he),this.cmcdController=this.createController(m.cmcdController,null,he),this.latencyController=this.createController(P.default,null,he),this.coreComponents=he}var D=f.prototype;return D.createController=function(m,a,d){if(m){var o=a?new m(this,a):new m(this);return d&&d.push(o),o}return null},D.on=function(m,a,d){d===void 0&&(d=this),this._emitter.on(m,a,d)},D.once=function(m,a,d){d===void 0&&(d=this),this._emitter.once(m,a,d)},D.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},D.off=function(m,a,d,o){d===void 0&&(d=this),this._emitter.off(m,a,d,o)},D.listeners=function(m){return this._emitter.listeners(m)},D.emit=function(m,a,d){return this._emitter.emit(m,a,d)},D.trigger=function(m,a){if(this.config.debug)return this.emit(m,m,a);try{return this.emit(m,m,a)}catch(d){R.logger.error("An internal error happened while handling event "+m+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.trigger(s.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:d})}return!1},D.listenerCount=function(m){return this._emitter.listenerCount(m)},D.destroy=function(){R.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},D.attachMedia=function(m){R.logger.log("attachMedia"),this._media=m,this.trigger(s.Events.MEDIA_ATTACHING,{media:m})},D.detachMedia=function(){R.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(m){this.stopLoad();var a=this.media,d=this.url,o=this.url=J.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});R.logger.log("loadSource:"+o),a&&d&&d!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(a)),this.trigger(s.Events.MANIFEST_LOADING,{url:m})},D.startLoad=function(m){m===void 0&&(m=-1),R.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(a){a.startLoad(m)})},D.stopLoad=function(){R.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},D.swapAudioCodec=function(){R.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){R.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},D.removeLevel=function(m,a){a===void 0&&(a=0),this.levelController.removeLevel(m,a)},T(f,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){R.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){R.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){R.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){R.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){R.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var a=!!m;a!==this.config.capLevelToPlayerSize&&(a?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=a)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(R.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,a=this.config.minAutoBitrate;if(!m)return 0;for(var d=m.length,o=0;o<d;o++)if(m[o].maxBitrate>a)return o;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,a=this.autoLevelCapping,d;return a===-1&&m&&m.length?d=m.length-1:d=a,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var a=this.audioTrackController;a&&(a.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var a=this.subtitleTrackController;a&&(a.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var a=this.subtitleTrackController;a&&(a.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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 s.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return f.defaultConfig?f.defaultConfig:A.hlsDefaultConfig},set:function(m){f.defaultConfig=m}}]),f}();p.defaultConfig=void 0},"./src/is-supported.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"isSupported",function(){return M}),L.d(q,"changeTypeSupported",function(){return G});var J=L("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var F=Object(J.getMediaSource)();if(!F)return!1;var P=B(),k=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!k&&!!y}function G(){var F,P=B();return typeof(P==null||((F=P.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return R}),L.d(q,"LoadError",function(){return S});var J=L("./src/polyfills/number.ts"),B=L("./src/errors.ts");function M(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,y(c,s)}function G(c){var s=typeof Map=="function"?new Map:void 0;return G=function(h){if(h===null||!k(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(h))return s.get(h);s.set(h,T)}function T(){return F(h,arguments,C(this).constructor)}return T.prototype=Object.create(h.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),y(T,h)},G(c)}function F(c,s,u){return P()?F=Reflect.construct:F=function(T,p,f){var D=[null];D.push.apply(D,p);var v=Function.bind.apply(T,D),m=new v;return f&&y(m,f.prototype),m},F.apply(null,arguments)}function P(){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(c){return!1}}function k(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function y(c,s){return y=Object.setPrototypeOf||function(h,T){return h.__proto__=T,h},y(c,s)}function C(c){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},C(c)}var O=Math.pow(2,17),R=function(){function c(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var s=c.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(h,T){var p=this,f=h.url;if(!f)return Promise.reject(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var D=this.config,v=D.fLoader,m=D.loader;return new Promise(function(a,d){p.loader&&p.loader.destroy();var o=p.loader=h.loader=v?new v(D):new m(D),E=A(h),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:O};h.stats=o.stats,o.load(E,b,{onSuccess:function(N,U,K,V){p.resetLoader(h,o),a({frag:h,part:null,payload:N.data,networkDetails:V})},onError:function(N,U,K){p.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:N,networkDetails:K}))},onAbort:function(N,U,K){p.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:K}))},onTimeout:function(N,U,K){p.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:K}))},onProgress:function(N,U,K,V){T&&T({frag:h,part:null,payload:K,networkDetails:V})}})})},s.loadPart=function(h,T,p){var f=this;this.abort();var D=this.config,v=D.fLoader,m=D.loader;return new Promise(function(a,d){f.loader&&f.loader.destroy();var o=f.loader=h.loader=v?new v(D):new m(D),E=A(h,T),b={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:O};T.stats=o.stats,o.load(E,b,{onSuccess:function(N,U,K,V){f.resetLoader(h,o),f.updateStatsFromPart(h,T);var _={frag:h,part:T,payload:N.data,networkDetails:V};p(_),a(_)},onError:function(N,U,K){f.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:T,response:N,networkDetails:K}))},onAbort:function(N,U,K){h.stats.aborted=T.stats.aborted,f.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:T,networkDetails:K}))},onTimeout:function(N,U,K){f.resetLoader(h,o),d(new S({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:T,networkDetails:K}))}})})},s.updateStatsFromPart=function(h,T){var p=h.stats,f=T.stats,D=f.total;if(p.loaded+=f.loaded,D){var v=Math.round(h.duration/T.duration),m=Math.min(Math.round(p.loaded/D),v),a=v-m,d=a*Math.round(p.loaded/m);p.total=p.loaded+d}else p.total=Math.max(p.loaded,p.total);var o=p.loading,E=f.loading;o.start?o.first+=E.first-E.start:(o.start=E.start,o.first=E.first),o.end=E.end},s.resetLoader=function(h,T){h.loader=null,this.loader===T&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),T.destroy()},c}();function A(c,s){s===void 0&&(s=null);var u=s||c,h={frag:c,part:s,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},T=u.byteRangeStartOffset,p=u.byteRangeEndOffset;return Object(J.isFiniteNumber)(T)&&Object(J.isFiniteNumber)(p)&&(h.rangeStart=T,h.rangeEnd=p),h}var S=function(c){M(s,c);function s(u){for(var h,T=arguments.length,p=new Array(T>1?T-1:0),f=1;f<T;f++)p[f-1]=arguments[f];return h=c.call.apply(c,[this].concat(p))||this,h.data=void 0,h.data=u,h}return s}(G(Error))},"./src/loader/fragment.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"ElementaryStreamTypes",function(){return R}),L.d(q,"BaseSegment",function(){return A}),L.d(q,"Fragment",function(){return S}),L.d(q,"Part",function(){return c});var J=L("./src/polyfills/number.ts"),B=L("./node_modules/url-toolkit/src/url-toolkit.js"),M=L.n(B),G=L("./src/utils/logger.ts"),F=L("./src/loader/level-key.ts"),P=L("./src/loader/load-stats.ts");function k(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,y(s,u)}function y(s,u){return y=Object.setPrototypeOf||function(T,p){return T.__proto__=p,T},y(s,u)}function C(s,u){for(var h=0;h<u.length;h++){var T=u[h];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(s,T.key,T)}}function O(s,u,h){return u&&C(s.prototype,u),h&&C(s,h),s}var R;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(R||(R={}));var A=function(){function s(h){var T;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(T={},T[R.AUDIO]=null,T[R.VIDEO]=null,T[R.AUDIOVIDEO]=null,T),this.baseurl=h}var u=s.prototype;return u.setByteRange=function(T,p){var f=T.split("@",2),D=[];f.length===1?D[0]=p?p.byteRangeEndOffset:0:D[0]=parseInt(f[1]),D[1]=parseInt(f[0])+D[0],this._byteRange=D},O(s,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(T){this._url=T}}]),s}(),S=function(s){k(u,s);function u(T,p){var f;return f=s.call(this,p)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkey=void 0,f.type=void 0,f.loader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new P.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.type=T,f}var h=u.prototype;return h.createInitializationVector=function(p){for(var f=new Uint8Array(16),D=12;D<16;D++)f[D]=p>>8*(15-D)&255;return f},h.setDecryptDataFromLevelKey=function(p,f){var D=p;return(p==null?void 0:p.method)==="AES-128"&&p.uri&&!p.iv&&(D=F.LevelKey.fromURI(p.uri),D.method=p.method,D.iv=this.createInitializationVector(f),D.keyFormat="identity"),D},h.setElementaryStreamInfo=function(p,f,D,v,m,a){a===void 0&&(a=!1);var d=this.elementaryStreams,o=d[p];if(!o){d[p]={startPTS:f,endPTS:D,startDTS:v,endDTS:m,partial:a};return}o.startPTS=Math.min(o.startPTS,f),o.endPTS=Math.max(o.endPTS,D),o.startDTS=Math.min(o.startDTS,v),o.endDTS=Math.max(o.endDTS,m)},h.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[R.AUDIO]=null,p[R.VIDEO]=null,p[R.AUDIOVIDEO]=null},O(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var p=this.sn;typeof p!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),p=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,p)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(J.isFiniteNumber)(this.programDateTime))return null;var p=Object(J.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+p*1e3}},{key:"encrypted",get:function(){var p;return!!((p=this.decryptdata)!==null&&p!==void 0&&p.keyFormat&&this.decryptdata.uri)}}]),u}(A),c=function(s){k(u,s);function u(h,T,p,f,D){var v;v=s.call(this,p)||this,v.fragOffset=0,v.duration=0,v.gap=!1,v.independent=!1,v.relurl=void 0,v.fragment=void 0,v.index=void 0,v.stats=new P.LoadStats,v.duration=h.decimalFloatingPoint("DURATION"),v.gap=h.bool("GAP"),v.independent=h.bool("INDEPENDENT"),v.relurl=h.enumeratedString("URI"),v.fragment=T,v.index=f;var m=h.enumeratedString("BYTERANGE");return m&&v.setByteRange(m,D),D&&(v.fragOffset=D.fragOffset+D.duration),v}return O(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var T=this.elementaryStreams;return!!(T.audio||T.video||T.audiovideo)}}]),u}(A)},"./src/loader/key-loader.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return G});var J=L("./src/events.ts"),B=L("./src/errors.ts"),M=L("./src/utils/logger.ts"),G=function(){function F(k){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=k,this._registerListeners()}var P=F.prototype;return P._registerListeners=function(){this.hls.on(J.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(J.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var C=this.loaders[y];C&&C.destroy()}this.loaders={}},P.onKeyLoading=function(y,C){var O=C.frag,R=O.type,A=this.loaders[R];if(!O.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var S=O.decryptdata.uri;if(S!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(A&&(M.logger.warn("abort previous key loader for type:"+R),A.abort()),!S){M.logger.warn("key uri is falsy");return}var s=c.loader,u=O.loader=this.loaders[R]=new s(c);this.decrypturl=S,this.decryptkey=null;var h={url:S,frag:O,responseType:"arraybuffer"},T={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,T,p)}else this.decryptkey&&(O.decryptdata.key=this.decryptkey,this.hls.trigger(J.Events.KEY_LOADED,{frag:O}))},P.loadsuccess=function(y,C,O){var R=O.frag;if(!R.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=R.decryptdata.key=new Uint8Array(y.data),R.loader=null,delete this.loaders[R.type],this.hls.trigger(J.Events.KEY_LOADED,{frag:R})},P.loaderror=function(y,C){var O=C.frag,R=O.loader;R&&R.abort(),delete this.loaders[O.type],this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:O,response:y})},P.loadtimeout=function(y,C){var O=C.frag,R=O.loader;R&&R.abort(),delete this.loaders[O.type],this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:O})},F}()},"./src/loader/level-details.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"LevelDetails",function(){return F});var J=L("./src/polyfills/number.ts");function B(P,k){for(var y=0;y<k.length;y++){var C=k[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(P,C.key,C)}}function M(P,k,y){return k&&B(P.prototype,k),y&&B(P,y),P}var G=10,F=function(){function P(y){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=y}var k=P.prototype;return k.reloaded=function(C){if(!C){this.advanced=!0,this.updated=!0;return}var O=this.lastPartSn-C.lastPartSn,R=this.lastPartIndex-C.lastPartIndex;this.updated=this.endSN!==C.endSN||!!R||!!O,this.advanced=this.endSN>C.endSN||O>0||O===0&&R>0,this.updated||this.advanced?this.misses=Math.floor(C.misses*.6):this.misses=C.misses+1,this.availabilityDelay=C.availabilityDelay},M(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(J.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var C=this.driftEndTime-this.driftStartTime;if(C>0){var O=this.driftEnd-this.driftStart;return O*1e3/C}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var C;return(C=this.fragments)!==null&&C!==void 0&&C.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 C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"LevelKey",function(){return F});var J=L("./node_modules/url-toolkit/src/url-toolkit.js"),B=L.n(J);function M(P,k){for(var y=0;y<k.length;y++){var C=k[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(P,C.key,C)}}function G(P,k,y){return k&&M(P.prototype,k),y&&M(P,y),P}var F=function(){P.fromURL=function(y,C){return new P(y,C)},P.fromURI=function(y){return new P(y)};function P(k,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(J.buildAbsoluteURL)(k,y,{alwaysNormalize:!0}):this._uri=k}return G(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"LoadStats",function(){return J});var J=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(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return u});var J=L("./src/polyfills/number.ts"),B=L("./node_modules/url-toolkit/src/url-toolkit.js"),M=L.n(B),G=L("./src/loader/fragment.ts"),F=L("./src/loader/level-details.ts"),P=L("./src/loader/level-key.ts"),k=L("./src/utils/attr-list.ts"),y=L("./src/utils/logger.ts"),C=L("./src/utils/codecs.ts"),O=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,R=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),S=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("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function s(D){var v,m;return c.test((v=(m=B.parseURL(D))===null||m===void 0?void 0:m.path)!=null?v:"")}var u=function(){function D(){}return D.findGroup=function(m,a){for(var d=0;d<m.length;d++){var o=m[d];if(o.id===a)return o}},D.convertAVC1ToAVCOTI=function(m){var a=m.split(".");if(a.length>2){var d=a.shift()+".";return d+=parseInt(a.shift()).toString(16),d+=("000"+parseInt(a.shift()).toString(16)).substr(-4),d}return m},D.resolve=function(m,a){return B.buildAbsoluteURL(a,m,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(m,a){var d=[],o={},E=!1;O.lastIndex=0;for(var b;(b=O.exec(m))!=null;)if(b[1]){var x=new k.AttrList(b[1]),N={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:D.resolve(b[2],a)},U=x.decimalResolution("RESOLUTION");U&&(N.width=U.width,N.height=U.height),h((x.CODECS||"").split(/[ ,]+/).filter(function(V){return V}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=D.convertAVC1ToAVCOTI(N.videoCodec)),d.push(N)}else if(b[3]){var K=new k.AttrList(b[3]);K["DATA-ID"]&&(E=!0,o[K["DATA-ID"]]=K)}return{levels:d,sessionData:E?o:null}},D.parseMasterPlaylistMedia=function(m,a,d,o){o===void 0&&(o=[]);var E,b=[],x=0;for(R.lastIndex=0;(E=R.exec(m))!==null;){var N=new k.AttrList(E[1]);if(N.TYPE===d){var U={attrs:N,bitrate:0,id:x++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:d,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?D.resolve(N.URI,a):""};if(o.length){var K=D.findGroup(o,U.groupId)||o[0];T(U,K,"audioCodec"),T(U,K,"textCodec")}b.push(U)}}return b},D.parseLevelPlaylist=function(m,a,d,o,E){var b=new F.LevelDetails(a),x=b.fragments,N=null,U=0,K=0,V=0,_=0,I=null,Y=new G.Fragment(o,a),ee,oe,he,Le=-1,xe=!1;for(A.lastIndex=0,b.m3u8=m;(ee=A.exec(m))!==null;){xe&&(xe=!1,Y=new G.Fragment(o,a),Y.start=V,Y.sn=U,Y.cc=_,Y.level=d,N&&(Y.initSegment=N,Y.rawProgramDateTime=N.rawProgramDateTime));var Ae=ee[1];if(Ae){Y.duration=parseFloat(Ae);var Te=(" "+ee[2]).slice(1);Y.title=Te||null,Y.tagList.push(Te?["INF",Ae,Te]:["INF",Ae])}else if(ee[3])Object(J.isFiniteNumber)(Y.duration)&&(Y.start=V,he&&(Y.levelkey=he),Y.sn=U,Y.level=d,Y.cc=_,Y.urlId=E,x.push(Y),Y.relurl=(" "+ee[3]).slice(1),f(Y,I),I=Y,V+=Y.duration,U++,K=0,xe=!0);else if(ee[4]){var Ce=(" "+ee[4]).slice(1);I?Y.setByteRange(Ce,I):Y.setByteRange(Ce)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Le===-1&&(Le=x.length);else{if(ee=ee[0].match(S),!ee){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<ee.length&&!(typeof ee[oe]!="undefined");oe++);var pe=(" "+ee[oe]).slice(1),de=(" "+ee[oe+1]).slice(1),re=ee[oe+2]?(" "+ee[oe+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":b.type=de.toUpperCase();break;case"MEDIA-SEQUENCE":U=b.startSN=parseInt(de);break;case"SKIP":{var ce=new k.AttrList(de),ae=ce.decimalInteger("SKIPPED-SEGMENTS");if(Object(J.isFiniteNumber)(ae)){b.skippedSegments=ae;for(var we=ae;we--;)x.unshift(null);U+=ae}var De=ce.enumeratedString("RECENTLY-REMOVED-DATERANGES");De&&(b.recentlyRemovedDateranges=De.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(de);break;case"VERSION":b.version=parseInt(de);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(de||re)&&Y.tagList.push(re?[de,re]:[de]);break;case"DIS":_++;case"GAP":Y.tagList.push([pe]);break;case"BITRATE":Y.tagList.push([pe,de]);break;case"DISCONTINUITY-SEQ":_=parseInt(de);break;case"KEY":{var ye,Me=new k.AttrList(de),Pe=Me.enumeratedString("METHOD"),Ne=Me.URI,Fe=Me.hexadecimalInteger("IV"),Be=Me.enumeratedString("KEYFORMATVERSIONS"),Ue=Me.enumeratedString("KEYID"),nt=(ye=Me.enumeratedString("KEYFORMAT"))!=null?ye:"identity",it=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(it.indexOf(nt)>-1){y.logger.warn("Keyformat "+nt+" is not supported from the manifest");continue}else if(nt!=="identity")continue;Pe&&(he=P.LevelKey.fromURL(a,Ne),Ne&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Pe)>=0&&(he.method=Pe,he.keyFormat=nt,Ue&&(he.keyID=Ue),Be&&(he.keyFormatVersions=Be),he.iv=Fe));break}case"START":{var $e=new k.AttrList(de),tt=$e.decimalFloatingPoint("TIME-OFFSET");Object(J.isFiniteNumber)(tt)&&(b.startTimeOffset=tt);break}case"MAP":{var ct=new k.AttrList(de);Y.relurl=ct.URI,ct.BYTERANGE&&Y.setByteRange(ct.BYTERANGE),Y.level=d,Y.sn="initSegment",he&&(Y.levelkey=he),Y.initSegment=null,N=Y,xe=!0;break}case"SERVER-CONTROL":{var et=new k.AttrList(de);b.canBlockReload=et.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=et.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&et.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=et.optionalFloat("PART-HOLD-BACK",0),b.holdBack=et.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ot=new k.AttrList(de);b.partTarget=ot.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Oe=b.partList;Oe||(Oe=b.partList=[]);var ht=K>0?Oe[Oe.length-1]:void 0,st=K++,je=new G.Part(new k.AttrList(de),Y,a,st,ht);Oe.push(je),Y.duration+=je.duration;break}case"PRELOAD-HINT":{var Ye=new k.AttrList(de);b.preloadHint=Ye;break}case"RENDITION-REPORT":{var Ee=new k.AttrList(de);b.renditionReports=b.renditionReports||[],b.renditionReports.push(Ee);break}default:y.logger.warn("line parsed but not handled: "+ee);break}}}I&&!I.relurl?(x.pop(),V-=I.duration,b.partList&&(b.fragmentHint=I)):b.partList&&(f(Y,I),Y.cc=_,b.fragmentHint=Y);var ge=x.length,be=x[0],ne=x[ge-1];if(V+=b.skippedSegments*b.targetduration,V>0&&ge&&ne){b.averagetargetduration=V/ge;var ie=ne.sn;b.endSN=ie!=="initSegment"?ie:0,be&&(b.startCC=be.cc,be.initSegment||b.fragments.every(function(se){return se.relurl&&s(se.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new G.Fragment(o,a),Y.relurl=ne.relurl,Y.level=d,Y.sn="initSegment",be.initSegment=Y,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(V+=b.fragmentHint.duration),b.totalduration=V,b.endCC=_,Le>0&&p(x,Le),b},D}();function h(D,v){["video","audio","text"].forEach(function(m){var a=D.filter(function(o){return Object(C.isCodecType)(o,m)});if(a.length){var d=a.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});v[m+"Codec"]=d.length>0?d[0]:a[0],D=D.filter(function(o){return a.indexOf(o)===-1})}}),v.unknownCodecs=D}function T(D,v,m){var a=v[m];a&&(D[m]=a)}function p(D,v){for(var m=D[v],a=v;a--;){var d=D[a];if(!d)return;d.programDateTime=m.programDateTime-d.duration*1e3,m=d}}function f(D,v){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):v!=null&&v.programDateTime&&(D.programDateTime=v.endProgramDateTime),Object(J.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/polyfills/number.ts"),B=L("./src/events.ts"),M=L("./src/errors.ts"),G=L("./src/utils/logger.ts"),F=L("./src/utils/mp4-tools.ts"),P=L("./src/loader/m3u8-parser.ts"),k=L("./src/types/loader.ts"),y=L("./src/utils/attr-list.ts");function C(A){var S=A.type;switch(S){case k.PlaylistContextType.AUDIO_TRACK:return k.PlaylistLevelType.AUDIO;case k.PlaylistContextType.SUBTITLE_TRACK:return k.PlaylistLevelType.SUBTITLE;default:return k.PlaylistLevelType.MAIN}}function O(A,S){var c=A.url;return(c===void 0||c.indexOf("data:")===0)&&(c=S.url),c}var R=function(){function A(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var S=A.prototype;return S.registerListeners=function(){var s=this.hls;s.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.unregisterListeners=function(){var s=this.hls;s.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},S.createInternalLoader=function(s){var u=this.hls.config,h=u.pLoader,T=u.loader,p=h||T,f=new p(u);return s.loader=f,this.loaders[s.type]=f,f},S.getInternalLoader=function(s){return this.loaders[s.type]},S.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},S.destroyInternalLoaders=function(){for(var s in this.loaders){var u=this.loaders[s];u&&u.destroy(),this.resetInternalLoader(s)}},S.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},S.onManifestLoading=function(s,u){var h=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:k.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},S.onLevelLoading=function(s,u){var h=u.id,T=u.level,p=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:null,level:T,responseType:"text",type:k.PlaylistContextType.LEVEL,url:p,deliveryDirectives:f})},S.onAudioTrackLoading=function(s,u){var h=u.id,T=u.groupId,p=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:k.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:f})},S.onSubtitleTrackLoading=function(s,u){var h=u.id,T=u.groupId,p=u.url,f=u.deliveryDirectives;this.load({id:h,groupId:T,level:null,responseType:"text",type:k.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:f})},S.load=function(s){var u,h=this.hls.config,T=this.getInternalLoader(s);if(T){var p=T.context;if(p&&p.url===s.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),T.abort()}var f,D,v,m;switch(s.type){case k.PlaylistContextType.MANIFEST:f=h.manifestLoadingMaxRetry,D=h.manifestLoadingTimeOut,v=h.manifestLoadingRetryDelay,m=h.manifestLoadingMaxRetryTimeout;break;case k.PlaylistContextType.LEVEL:case k.PlaylistContextType.AUDIO_TRACK:case k.PlaylistContextType.SUBTITLE_TRACK:f=0,D=h.levelLoadingTimeOut;break;default:f=h.levelLoadingMaxRetry,D=h.levelLoadingTimeOut,v=h.levelLoadingRetryDelay,m=h.levelLoadingMaxRetryTimeout;break}if(T=this.createInternalLoader(s),(u=s.deliveryDirectives)!==null&&u!==void 0&&u.part){var a;if(s.type===k.PlaylistContextType.LEVEL&&s.level!==null?a=this.hls.levels[s.level].details:s.type===k.PlaylistContextType.AUDIO_TRACK&&s.id!==null?a=this.hls.audioTracks[s.id].details:s.type===k.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(a=this.hls.subtitleTracks[s.id].details),a){var d=a.partTarget,o=a.targetduration;d&&o&&(D=Math.min(Math.max(d*3,o*.8)*1e3,D))}}var E={timeout:D,maxRetry:f,retryDelay:v,maxRetryDelay:m,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(s,E,b)},S.loadsuccess=function(s,u,h,T){if(T===void 0&&(T=null),h.isSidxRequest){this.handleSidxRequest(s,h),this.handlePlaylistLoaded(s,u,h,T);return}this.resetInternalLoader(h.type);var p=s.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,h,"no EXTM3U delimiter",T);return}u.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,u,h,T):this.handleMasterPlaylist(s,u,h,T)},S.loaderror=function(s,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!1,s)},S.loadtimeout=function(s,u,h){h===void 0&&(h=null),this.handleNetworkError(u,h,!0)},S.handleMasterPlaylist=function(s,u,h,T){var p=this.hls,f=s.data,D=O(s,h),v=P.default.parseMasterPlaylist(f,D),m=v.levels,a=v.sessionData;if(!m.length){this.handleManifestParsingError(s,h,"no level found in manifest",T);return}var d=m.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),o=m.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),E=P.default.parseMasterPlaylistMedia(f,D,"AUDIO",d),b=P.default.parseMasterPlaylistMedia(f,D,"SUBTITLES",o),x=P.default.parseMasterPlaylistMedia(f,D,"CLOSED-CAPTIONS");if(E.length){var N=E.some(function(U){return!U.url});!N&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}p.trigger(B.Events.MANIFEST_LOADED,{levels:m,audioTracks:E,subtitles:b,captions:x,url:D,stats:u,networkDetails:T,sessionData:a})},S.handleTrackOrLevelPlaylist=function(s,u,h,T){var p=this.hls,f=h.id,D=h.level,v=h.type,m=O(s,h),a=Object(J.isFiniteNumber)(f)?f:0,d=Object(J.isFiniteNumber)(D)?D:a,o=C(h),E=P.default.parseLevelPlaylist(s.data,m,d,o,a);if(!E.fragments.length){p.trigger(B.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(v===k.PlaylistContextType.MANIFEST){var b={attrs:new y.AttrList({}),bitrate:0,details:E,name:"",url:m};p.trigger(B.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:m,stats:u,networkDetails:T,sessionData:null})}if(u.parsing.end=performance.now(),E.needSidxRanges){var x,N=(x=E.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:N,isSidxRequest:!0,type:v,level:D,levelDetails:E,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=E,this.handlePlaylistLoaded(s,u,h,T)},S.handleSidxRequest=function(s,u){var h=Object(F.parseSegmentIndex)(new Uint8Array(s.data));if(!h)return;var T=h.references,p=u.levelDetails;T.forEach(function(f,D){var v=f.info,m=p.fragments[D];m.byteRange.length===0&&m.setByteRange(String(1+v.end-v.start)+"@"+String(v.start)),m.initSegment&&m.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},S.handleManifestParsingError=function(s,u,h,T){this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===k.PlaylistContextType.MANIFEST,url:s.url,reason:h,response:s,context:u,networkDetails:T})},S.handleNetworkError=function(s,u,h,T){h===void 0&&(h=!1),G.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var p=M.ErrorDetails.UNKNOWN,f=!1,D=this.getInternalLoader(s);switch(s.type){case k.PlaylistContextType.MANIFEST:p=h?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case k.PlaylistContextType.LEVEL:p=h?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case k.PlaylistContextType.AUDIO_TRACK:p=h?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case k.PlaylistContextType.SUBTITLE_TRACK:p=h?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}D&&this.resetInternalLoader(s.type);var v={type:M.ErrorTypes.NETWORK_ERROR,details:p,fatal:f,url:s.url,loader:D,context:s,networkDetails:u};T&&(v.response=T),this.hls.trigger(B.Events.ERROR,v)},S.handlePlaylistLoaded=function(s,u,h,T){var p=h.type,f=h.level,D=h.id,v=h.groupId,m=h.loader,a=h.levelDetails,d=h.deliveryDirectives;if(!(a!=null&&a.targetduration)){this.handleManifestParsingError(s,h,"invalid target duration",T);return}if(!m)return;a.live&&(m.getCacheAge&&(a.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(a.ageHeader))&&(a.ageHeader=0));switch(p){case k.PlaylistContextType.MANIFEST:case k.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:a,level:f||0,id:D||0,stats:u,networkDetails:T,deliveryDirectives:d});break;case k.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:a,id:D||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:d});break;case k.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:a,id:D||0,groupId:v||"",stats:u,networkDetails:T,deliveryDirectives:d});break}},A}();q.default=R},"./src/polyfills/number.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"isFiniteNumber",function(){return J}),L.d(q,"MAX_SAFE_INTEGER",function(){return B});var J=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(le,q,L){"use strict";L.r(q);var J=function(){function B(){}return B.getSilentFrame=function(G,F){switch(G){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===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(F===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(F===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(F===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},B}();q.default=J},"./src/remux/mp4-generator.ts":function(le,q,L){"use strict";L.r(q);var J=Math.pow(2,32)-1,B=function(){function M(){}return M.init=function(){M.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 F;for(F in M.types)M.types.hasOwnProperty(F)&&(M.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var P=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]),k=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]);M.HDLR_TYPES={video:P,audio:k};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=C,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var O=new Uint8Array([105,115,111,109]),R=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,O,A,O,R),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,y))},M.box=function(F){for(var P=8,k=arguments.length,y=new Array(k>1?k-1:0),C=1;C<k;C++)y[C-1]=arguments[C];for(var O=y.length,R=O;O--;)P+=y[O].byteLength;var A=new Uint8Array(P);for(A[0]=P>>24&255,A[1]=P>>16&255,A[2]=P>>8&255,A[3]=P&255,A.set(F,4),O=0,P=8;O<R;O++)A.set(y[O],P),P+=y[O].byteLength;return A},M.hdlr=function(F){return M.box(M.types.hdlr,M.HDLR_TYPES[F])},M.mdat=function(F){return M.box(M.types.mdat,F)},M.mdhd=function(F,P){P*=F;var k=Math.floor(P/(J+1)),y=Math.floor(P%(J+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,k>>24,k>>16&255,k>>8&255,k&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},M.mdia=function(F){return M.box(M.types.mdia,M.mdhd(F.timescale,F.duration),M.hdlr(F.type),M.minf(F))},M.mfhd=function(F){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},M.minf=function(F){return F.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(F)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(F))},M.moof=function(F,P,k){return M.box(M.types.moof,M.mfhd(F),M.traf(k,P))},M.moov=function(F){for(var P=F.length,k=[];P--;)k[P]=M.trak(F[P]);return M.box.apply(null,[M.types.moov,M.mvhd(F[0].timescale,F[0].duration)].concat(k).concat(M.mvex(F)))},M.mvex=function(F){for(var P=F.length,k=[];P--;)k[P]=M.trex(F[P]);return M.box.apply(null,[M.types.mvex].concat(k))},M.mvhd=function(F,P){P*=F;var k=Math.floor(P/(J+1)),y=Math.floor(P%(J+1)),C=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,k>>24,k>>16&255,k>>8&255,k&255,y>>24,y>>16&255,y>>8&255,y&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 M.box(M.types.mvhd,C)},M.sdtp=function(F){var P=F.samples||[],k=new Uint8Array(4+P.length),y,C;for(y=0;y<P.length;y++)C=P[y].flags,k[y+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return M.box(M.types.sdtp,k)},M.stbl=function(F){return M.box(M.types.stbl,M.stsd(F),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(F){var P=[],k=[],y,C,O;for(y=0;y<F.sps.length;y++)C=F.sps[y],O=C.byteLength,P.push(O>>>8&255),P.push(O&255),P=P.concat(Array.prototype.slice.call(C));for(y=0;y<F.pps.length;y++)C=F.pps[y],O=C.byteLength,k.push(O>>>8&255),k.push(O&255),k=k.concat(Array.prototype.slice.call(C));var R=M.box(M.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|F.sps.length].concat(P).concat([F.pps.length]).concat(k))),A=F.width,S=F.height,c=F.pixelRatio[0],s=F.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,A>>8&255,A&255,S>>8&255,S&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]),R,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},M.esds=function(F){var P=F.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(F.config).concat([6,1,2]))},M.mp4a=function(F){var P=F.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),M.box(M.types.esds,M.esds(F)))},M.mp3=function(F){var P=F.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},M.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(F)):M.box(M.types.stsd,M.STSD,M.mp4a(F)):M.box(M.types.stsd,M.STSD,M.avc1(F))},M.tkhd=function(F){var P=F.id,k=F.duration*F.timescale,y=F.width,C=F.height,O=Math.floor(k/(J+1)),R=Math.floor(k%(J+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,R>>24,R>>16&255,R>>8&255,R&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,y>>8&255,y&255,0,0,C>>8&255,C&255,0,0]))},M.traf=function(F,P){var k=M.sdtp(F),y=F.id,C=Math.floor(P/(J+1)),O=Math.floor(P%(J+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,O>>24,O>>16&255,O>>8&255,O&255])),M.trun(F,k.length+16+20+8+16+8+8),k)},M.trak=function(F){return F.duration=F.duration||4294967295,M.box(M.types.trak,M.tkhd(F),M.mdia(F))},M.trex=function(F){var P=F.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(F,P){var k=F.samples||[],y=k.length,C=12+16*y,O=new Uint8Array(C),R,A,S,c,s,u;for(P+=8+C,O.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),R=0;R<y;R++)A=k[R],S=A.duration,c=A.size,s=A.flags,u=A.cts,O.set([S>>>24&255,S>>>16&255,S>>>8&255,S&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*R);return M.box(M.types.trun,O)},M.initSegment=function(F){M.types||M.init();var P=M.moov(F),k=new Uint8Array(M.FTYP.byteLength+P.byteLength);return k.set(M.FTYP),k.set(P,M.FTYP.byteLength),k},M}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,q.default=B},"./src/remux/mp4-remuxer.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return u}),L.d(q,"normalizePts",function(){return h});var J=L("./src/polyfills/number.ts"),B=L("./src/remux/aac-helper.ts"),M=L("./src/remux/mp4-generator.ts"),G=L("./src/events.ts"),F=L("./src/errors.ts"),P=L("./src/utils/logger.ts"),k=L("./src/types/loader.ts"),y=L("./src/utils/timescale-conversion.ts");function C(){return C=Object.assign||function(D){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var a in m)Object.prototype.hasOwnProperty.call(m,a)&&(D[a]=m[a])}return D},C.apply(this,arguments)}var O=10*1e3,R=1024,A=1152,S=null,c=null,s=!1,u=function(){function D(m,a,d,o){if(o===void 0&&(o=""),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=m,this.config=a,this.typeSupported=d,this.ISGenerated=!1,S===null){var E=navigator.userAgent||"",b=E.match(/Chrome\/(\d+)/i);S=b?parseInt(b[1]):0}if(c===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);c=x?parseInt(x[1]):0}s=!!S&&S<75||!!c&&c<600}var v=D.prototype;return v.destroy=function(){},v.resetTimeStamp=function(a){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=a},v.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},v.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},v.getVideoStartPts=function(a){var d=!1,o=a.reduce(function(E,b){var x=b.pts-E;return x<-4294967296?(d=!0,h(E,b.pts)):x>0?E:b.pts},a[0].pts);return d&&P.logger.debug("PTS rollover detected"),o},v.remux=function(a,d,o,E,b,x,N,U){var K,V,_,I,Y,ee,oe=b,he=b,Le=a.pid>-1,xe=d.pid>-1,Ae=d.samples.length,Te=a.samples.length>0,Ce=Ae>1,pe=(!Le||Te)&&(!xe||Ce)||this.ISGenerated||N;if(pe){this.ISGenerated||(_=this.generateIS(a,d,b));var de=this.isVideoContiguous,re=-1;if(Ce&&(re=T(d.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,re>0){P.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+Ae+" video samples due to a missing keyframe");var ce=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(re),d.dropped+=re,he+=(d.samples[0].pts-ce)/(d.timescale||9e4)}else re===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ae+" video samples"),ee=!1);if(this.ISGenerated){if(Te&&Ce){var ae=this.getVideoStartPts(d.samples),we=h(a.samples[0].pts,ae)-ae,De=we/d.inputTimeScale;oe+=Math.max(0,De),he+=Math.max(0,-De)}if(Te){if(a.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),_=this.generateIS(a,d,b)),V=this.remuxAudio(a,oe,this.isAudioContiguous,x,xe||Ce||U===k.PlaylistLevelType.AUDIO?he:void 0),Ce){var ye=V?V.endPTS-V.startPTS:0;d.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),_=this.generateIS(a,d,b)),K=this.remuxVideo(d,he,de,ye)}}else Ce&&(K=this.remuxVideo(d,he,de,0));K&&(K.firstKeyFrame=re,K.independent=re!==-1)}}return this.ISGenerated&&(o.samples.length&&(Y=this.remuxID3(o,b)),E.samples.length&&(I=this.remuxText(E,b))),{audio:V,video:K,initSegment:_,independent:ee,text:I,id3:Y}},v.generateIS=function(a,d,o){var E=a.samples,b=d.samples,x=this.typeSupported,N={},U=!Object(J.isFiniteNumber)(this._initPTS),K="audio/mp4",V,_,I;if(U&&(V=_=Infinity),a.config&&E.length&&(a.timescale=a.samplerate,a.isAAC||(x.mpeg?(K="audio/mpeg",a.codec=""):x.mp3&&(a.codec="mp3")),N.audio={id:"audio",container:K,codec:a.codec,initSegment:!a.isAAC&&x.mpeg?new Uint8Array(0):M.default.initSegment([a]),metadata:{channelCount:a.channelCount}},U&&(I=a.inputTimeScale,V=_=E[0].pts-Math.round(I*o))),d.sps&&d.pps&&b.length&&(d.timescale=d.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:M.default.initSegment([d]),metadata:{width:d.width,height:d.height}},U)){I=d.inputTimeScale;var Y=this.getVideoStartPts(b),ee=Math.round(I*o);_=Math.min(_,h(b[0].dts,Y)-ee),V=Math.min(V,Y-ee)}if(Object.keys(N).length)return this.ISGenerated=!0,U&&(this._initPTS=V,this._initDTS=_),{tracks:N,initPTS:V,timescale:I}},v.remuxVideo=function(a,d,o,E){var b=a.inputTimeScale,x=a.samples,N=[],U=x.length,K=this._initPTS,V=this.nextAvcDts,_=8,I,Y,ee,oe=Number.POSITIVE_INFINITY,he=Number.NEGATIVE_INFINITY,Le=0,xe=!1;if(!o||V===null){var Ae=d*b,Te=x[0].pts-h(x[0].dts,x[0].pts);V=Ae-Te}for(var Ce=0;Ce<U;Ce++){var pe=x[Ce];if(pe.pts=h(pe.pts-K,V),pe.dts=h(pe.dts-K,V),pe.dts>pe.pts){var de=9e4*.2;Le=Math.max(Math.min(Le,pe.pts-pe.dts),-1*de)}pe.dts<x[Ce>0?Ce-1:Ce].dts&&(xe=!0)}xe&&x.sort(function(wt,ze){var lt=wt.dts-ze.dts,Mt=wt.pts-ze.pts;return lt||Mt}),Y=x[0].dts,ee=x[x.length-1].dts;var re=Math.round((ee-Y)/(U-1));if(Le<0){if(Le<re*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-re,!0)+" ms");for(var ce=Le,ae=0;ae<U;ae++)x[ae].dts=ce=Math.max(ce,x[ae].pts-re),x[ae].pts=Math.max(ce,x[ae].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Le,!0)+" ms to overcome this issue");for(var we=0;we<U;we++)x[we].dts=x[we].dts+Le}Y=x[0].dts}if(o){var De=Y-V,ye=De>re,Me=De<-1;if(ye||Me){ye?P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(De,!0)+" ms ("+De+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-De,!0)+" ms ("+De+"dts) overlapping between fragments detected"),Y=V;var Pe=x[0].pts-De;x[0].dts=Y,x[0].pts=Pe,P.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Pe,!0)+"/"+Object(y.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(De,!0)+" ms")}}s&&(Y=Math.max(0,Y));for(var Ne=0,Fe=0,Be=0;Be<U;Be++){for(var Ue=x[Be],nt=Ue.units,it=nt.length,$e=0,tt=0;tt<it;tt++)$e+=nt[tt].data.length;Fe+=$e,Ne+=it,Ue.length=$e,Ue.dts=Math.max(Ue.dts,Y),Ue.pts=Math.max(Ue.pts,Ue.dts,0),oe=Math.min(Ue.pts,oe),he=Math.max(Ue.pts,he)}ee=x[U-1].dts;var ct=Fe+4*Ne+8,et;try{et=new Uint8Array(ct)}catch(wt){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ct,reason:"fail allocating video mdat "+ct});return}var ot=new DataView(et.buffer);ot.setUint32(0,ct),et.set(M.default.types.mdat,4);for(var Oe=0;Oe<U;Oe++){for(var ht=x[Oe],st=ht.units,je=0,Ye=0,Ee=st.length;Ye<Ee;Ye++){var ge=st[Ye],be=ge.data,ne=ge.data.byteLength;ot.setUint32(_,ne),_+=4,et.set(be,_),_+=ne,je+=4+ne}if(Oe<U-1)I=x[Oe+1].dts-ht.dts;else{var ie=this.config,se=ht.dts-x[Oe>0?Oe-1:Oe].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(ie.maxBufferHole*b),ke=(E?oe+E*b:this.nextAudioPts)-ht.pts;ke>ue?(I=ke-se,I<0&&(I=se),P.logger.log("[mp4-remuxer]: It is approximately "+ke/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=se}else I=se}var Se=Math.round(ht.pts-ht.dts);N.push(new p(ht.key,I,je,Se))}if(N.length&&S&&S<70){var Ve=N[0].flags;Ve.dependsOn=2,Ve.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=V=ee+I,this.isVideoContiguous=!0;var at=M.default.moof(a.sequenceNumber++,Y,C({},a,{samples:N})),We="video",mt={data1:at,data2:et,startPTS:oe/b,endPTS:(he+I)/b,startDTS:Y/b,endDTS:V/b,type:We,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:a.dropped};return a.samples=[],a.dropped=0,console.assert(et.length,"MDAT length must not be zero"),mt},v.remuxAudio=function(a,d,o,E,b){var x=a.inputTimeScale,N=a.samplerate?a.samplerate:x,U=x/N,K=a.isAAC?R:A,V=K*U,_=this._initPTS,I=!a.isAAC&&this.typeSupported.mpeg,Y=[],ee=a.samples,oe=I?0:8,he=this.nextAudioPts||-1,Le=d*x;if(this.isAudioContiguous=o=o||ee.length&&he>0&&(E&&Math.abs(Le-he)<9e3||Math.abs(h(ee[0].pts-_,Le)-he)<20*V),ee.forEach(function(be){be.pts=h(be.pts-_,Le)}),!o||he<0){if(ee=ee.filter(function(be){return be.pts>=0}),!ee.length)return;b===0?he=0:E?he=Math.max(0,Le):he=ee[0].pts}if(a.isAAC)for(var xe=b!==void 0,Ae=this.config.maxAudioFramesDrift,Te=0,Ce=he;Te<ee.length;Te++){var pe=ee[Te],de=pe.pts,re=de-Ce,ce=Math.abs(1e3*re/x);if(re<=-Ae*V&&xe)Te===0&&(P.logger.warn("Audio frame @ "+(de/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*re/x)+" ms."),this.nextAudioPts=he=Ce=de);else if(re>=Ae*V&&ce<O&&xe){var ae=Math.round(re/V);Ce=de-ae*V,Ce<0&&(ae--,Ce+=V),Te===0&&(this.nextAudioPts=he=Ce),P.logger.warn("[mp4-remuxer]: Injecting "+ae+" audio frame @ "+(Ce/x).toFixed(3)+"s due to "+Math.round(1e3*re/x)+" ms gap.");for(var we=0;we<ae;we++){var De=Math.max(Ce,0),ye=B.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);ye||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=pe.unit.subarray()),ee.splice(Te,0,{unit:ye,pts:De}),Ce+=V,Te++}}pe.pts=Ce,Ce+=V}for(var Me=null,Pe=null,Ne,Fe=0,Be=ee.length;Be--;)Fe+=ee[Be].unit.byteLength;for(var Ue=0,nt=ee.length;Ue<nt;Ue++){var it=ee[Ue],$e=it.unit,tt=it.pts;if(Pe!==null){var ct=Y[Ue-1];ct.duration=Math.round((tt-Pe)/U)}else if(o&&a.isAAC&&(tt=he),Me=tt,Fe>0){Fe+=oe;try{Ne=new Uint8Array(Fe)}catch(be){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Fe,reason:"fail allocating audio mdat "+Fe});return}if(!I){var et=new DataView(Ne.buffer);et.setUint32(0,Fe),Ne.set(M.default.types.mdat,4)}}else return;Ne.set($e,oe);var ot=$e.byteLength;oe+=ot,Y.push(new p(!0,K,ot,0)),Pe=tt}var Oe=Y.length;if(!Oe)return;var ht=Y[Y.length-1];this.nextAudioPts=he=Pe+U*ht.duration;var st=I?new Uint8Array(0):M.default.moof(a.sequenceNumber++,Me/U,C({},a,{samples:Y}));a.samples=[];var je=Me/x,Ye=he/x,Ee="audio",ge={data1:st,data2:Ne,startPTS:je,endPTS:Ye,startDTS:je,endDTS:Ye,type:Ee,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert(Ne.length,"MDAT length must not be zero"),ge},v.remuxEmptyAudio=function(a,d,o,E){var b=a.inputTimeScale,x=a.samplerate?a.samplerate:b,N=b/x,U=this.nextAudioPts,K=(U!==null?U:E.startDTS*b)+this._initDTS,V=E.endDTS*b+this._initDTS,_=N*R,I=Math.ceil((V-K)/_),Y=B.default.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],oe=0;oe<I;oe++){var he=K+oe*_;ee.push({unit:Y,pts:he,dts:he})}return a.samples=ee,this.remuxAudio(a,d,o,!1)},v.remuxID3=function(a,d){var o=a.samples.length;if(!o)return;for(var E=a.inputTimeScale,b=this._initPTS,x=this._initDTS,N=0;N<o;N++){var U=a.samples[N];U.pts=h(U.pts-b,d*E)/E,U.dts=h(U.dts-x,d*E)/E}var K=a.samples;return a.samples=[],{samples:K}},v.remuxText=function(a,d){var o=a.samples.length;if(!o)return;for(var E=a.inputTimeScale,b=this._initPTS,x=0;x<o;x++){var N=a.samples[x];N.pts=h(N.pts-b,d*E)/E}a.samples.sort(function(K,V){return K.pts-V.pts});var U=a.samples;return a.samples=[],{samples:U}},D}();function h(D,v){var m;if(v===null)return D;for(v<D?m=-8589934592:m=8589934592;Math.abs(D-v)>4294967296;)D+=m;return D}function T(D){for(var v=0;v<D.length;v++)if(D[v].key)return v;return-1}var p=function(v,m,a,d){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=a,this.cts=d,this.flags=new f(v)},f=function(v){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=v?2:1,this.isNonSync=v?0:1}},"./src/remux/passthrough-remuxer.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/polyfills/number.ts"),B=L("./src/utils/mp4-tools.ts"),M=L("./src/loader/fragment.ts"),G=L("./src/utils/logger.ts"),F=function(){function y(){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 C=y.prototype;return C.destroy=function(){},C.resetTimeStamp=function(R){this.initPTS=R,this.lastEndDTS=null},C.resetNextTimestamp=function(){this.lastEndDTS=null},C.resetInitSegment=function(R,A,S){this.audioCodec=A,this.videoCodec=S,this.generateInitSegment(R),this.emitInitSegment=!0},C.generateInitSegment=function(R){var A=this.audioCodec,S=this.videoCodec;if(!R||!R.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(B.parseInitSegment)(R);A||(A=k(c.audio,M.ElementaryStreamTypes.AUDIO)),S||(S=k(c.video,M.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:A+","+S,initSegment:R,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:A,initSegment:R,id:"audio"}:c.video?s.video={container:"video/mp4",codec:S,initSegment:R,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},C.remux=function(R,A,S,c,s){var u=this.initPTS,h=this.lastEndDTS,T={audio:void 0,video:void 0,text:c,id3:S,initSegment:void 0};Object(J.isFiniteNumber)(h)||(h=this.lastEndDTS=s||0);var p=A.samples;if(!p||!p.length)return T;var f={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(p),D=this.initData),!D||!D.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),T;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(J.isFiniteNumber)(u)||(this.initPTS=f.initPTS=u=P(D,p,h));var v=Object(B.getDuration)(p,D),m=h,a=v+m;Object(B.offsetStartDTS)(D,p,u),v>0?this.lastEndDTS=a:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!D.audio,o=!!D.video,E="";d&&(E+="audio"),o&&(E+="video");var b={data1:p,startPTS:m,startDTS:m,endPTS:a,endDTS:a,type:E,hasAudio:d,hasVideo:o,nb:1,dropped:0};return T.audio=b.type==="audio"?b:void 0,T.video=b.type!=="audio"?b:void 0,T.text=c,T.id3=S,T.initSegment=f,T},y}(),P=function(C,O,R){return Object(B.getStartDTS)(C,O)-R};function k(y,C){var O=y==null?void 0:y.codec;return O&&O.length>4?O:O==="hvc1"?"hvc1.1.c.L120.90":O==="av01"?"av01.0.04M.08":O==="avc1"||C===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}q.default=F},"./src/task-loop.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return J});var J=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=B.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},B}()},"./src/types/cmcd.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"CMCDVersion",function(){return J}),L.d(q,"CMCDObjectType",function(){return B}),L.d(q,"CMCDStreamingFormat",function(){return M}),L.d(q,"CMCDStreamType",function(){return G});var J=1,B;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(B||(B={}));var M;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(M||(M={}));var G;(function(F){F.VOD="v",F.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"HlsSkip",function(){return M}),L.d(q,"getSkipValue",function(){return G}),L.d(q,"HlsUrlParameters",function(){return F}),L.d(q,"Level",function(){return P});function J(k,y){for(var C=0;C<y.length;C++){var O=y[C];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(k,O.key,O)}}function B(k,y,C){return y&&J(k.prototype,y),C&&J(k,C),k}var M;(function(k){k.No="",k.Yes="YES",k.v2="v2"})(M||(M={}));function G(k,y){var C=k.canSkipUntil,O=k.canSkipDateRanges,R=k.endSN,A=y!==void 0?y-R:0;return C&&A<C?O?M.v2:M.Yes:M.No}var F=function(){function k(C,O,R){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=C,this.part=O,this.skip=R}var y=k.prototype;return y.addDirectives=function(O){var R=new self.URL(O);return this.msn!==void 0&&R.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&R.searchParams.set("_HLS_part",this.part.toString()),this.skip&&R.searchParams.set("_HLS_skip",this.skip),R.toString()},k}(),P=function(){function k(y){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=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(C){return C}).join(",").replace(/\.[^.,]+/g,"")}return B(k,[{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(C){var O=C%this.url.length;this._urlId!==O&&(this.details=void 0,this._urlId=O)}}]),k}()},"./src/types/loader.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"PlaylistContextType",function(){return J}),L.d(q,"PlaylistLevelType",function(){return B});var J;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(J||(J={}));var B;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"ChunkMetadata",function(){return J});var J=function(G,F,P,k,y,C){k===void 0&&(k=0),y===void 0&&(y=-1),C===void 0&&(C=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=G,this.sn=F,this.id=P,this.size=k,this.part=y,this.partial=C};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"AttrList",function(){return M});var J=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function G(P){typeof P=="string"&&(P=G.parseAttrList(P));for(var k in P)P.hasOwnProperty(k)&&(this[k]=P[k])}var F=G.prototype;return F.decimalInteger=function(k){var y=parseInt(this[k],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},F.hexadecimalInteger=function(k){if(this[k]){var y=(this[k]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var C=new Uint8Array(y.length/2),O=0;O<y.length/2;O++)C[O]=parseInt(y.slice(O*2,O*2+2),16);return C}else return null},F.hexadecimalIntegerAsNumber=function(k){var y=parseInt(this[k],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},F.decimalFloatingPoint=function(k){return parseFloat(this[k])},F.optionalFloat=function(k,y){var C=this[k];return C?parseFloat(C):y},F.enumeratedString=function(k){return this[k]},F.bool=function(k){return this[k]==="YES"},F.decimalResolution=function(k){var y=J.exec(this[k]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},G.parseAttrList=function(k){var y,C={},O='"';for(B.lastIndex=0;(y=B.exec(k))!==null;){var R=y[2];R.indexOf(O)===0&&R.lastIndexOf(O)===R.length-1&&(R=R.slice(1,-1)),C[y[1]]=R}return C},G}()},"./src/utils/binary-search.ts":function(le,q,L){"use strict";L.r(q);var J={search:function(M,G){for(var F=0,P=M.length-1,k=null,y=null;F<=P;){k=(F+P)/2|0,y=M[k];var C=G(y);if(C>0)F=k+1;else if(C<0)P=k-1;else return y}return null}};q.default=J},"./src/utils/buffer-helper.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"BufferHelper",function(){return M});var J=L("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function G(){}return G.isBuffered=function(P,k){try{if(P){for(var y=G.getBuffered(P),C=0;C<y.length;C++)if(k>=y.start(C)&&k<=y.end(C))return!0}}catch(O){}return!1},G.bufferInfo=function(P,k,y){try{if(P){var C=G.getBuffered(P),O=[],R;for(R=0;R<C.length;R++)O.push({start:C.start(R),end:C.end(R)});return this.bufferedInfo(O,k,y)}}catch(A){}return{len:0,start:k,end:k,nextStart:void 0}},G.bufferedInfo=function(P,k,y){k=Math.max(0,k),P.sort(function(f,D){var v=f.start-D.start;return v||D.end-f.end});var C=[];if(y)for(var O=0;O<P.length;O++){var R=C.length;if(R){var A=C[R-1].end;P[O].start-A<y?P[O].end>A&&(C[R-1].end=P[O].end):C.push(P[O])}else C.push(P[O])}else C=P;for(var S=0,c,s=k,u=k,h=0;h<C.length;h++){var T=C[h].start,p=C[h].end;if(k+y>=T&&k<p)s=T,u=p,S=u-k;else if(k+y<T){c=T;break}}return{len:S,start:s||0,end:u||0,nextStart:c}},G.getBuffered=function(P){try{return P.buffered}catch(k){return J.logger.log("failed to get media.buffered",k),B}},G}()},"./src/utils/cea-608-parser.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"Row",function(){return u}),L.d(q,"CaptionScreen",function(){return h});var J=L("./src/utils/logger.ts"),B={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(a){var d=a;return B.hasOwnProperty(a)&&(d=B[a]),String.fromCharCode(d)},G=15,F=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},k={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},C={25:2,26:4,29:6,30:8,31:10,27:13,28:15},O=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],R;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(R||(R={}));var A=function(){function m(){this.time=null,this.verboseLevel=R.ERROR}var a=m.prototype;return a.log=function(o,E){this.verboseLevel>=o&&J.logger.log(this.time+" ["+o+"] "+E)},m}(),S=function(a){for(var d=[],o=0;o<a.length;o++)d.push(a[o].toString(16));return d},c=function(){function m(d,o,E,b,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=d||"white",this.underline=o||!1,this.italics=E||!1,this.background=b||"black",this.flash=x||!1}var a=m.prototype;return a.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},a.setStyles=function(o){for(var E=["foreground","underline","italics","background","flash"],b=0;b<E.length;b++){var x=E[b];o.hasOwnProperty(x)&&(this[x]=o[x])}},a.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},a.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},a.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},a.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),s=function(){function m(d,o,E,b,x,N){this.uchar=void 0,this.penState=void 0,this.uchar=d||" ",this.penState=new c(o,E,b,x,N)}var a=m.prototype;return a.reset=function(){this.uchar=" ",this.penState.reset()},a.setChar=function(o,E){this.uchar=o,this.penState.copy(E)},a.setPenState=function(o){this.penState.copy(o)},a.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},a.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},a.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),u=function(){function m(d){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<F;o++)this.chars.push(new s);this.logger=d,this.pos=0,this.currPenState=new c}var a=m.prototype;return a.equals=function(o){for(var E=!0,b=0;b<F;b++)if(!this.chars[b].equals(o.chars[b])){E=!1;break}return E},a.copy=function(o){for(var E=0;E<F;E++)this.chars[E].copy(o.chars[E])},a.isEmpty=function(){for(var o=!0,E=0;E<F;E++)if(!this.chars[E].isEmpty()){o=!1;break}return o},a.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(R.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(R.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},a.moveCursor=function(o){var E=this.pos+o;if(o>1)for(var b=this.pos+1;b<E+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(E)},a.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},a.insertChar=function(o){o>=144&&this.backSpace();var E=M(o);if(this.pos>=F){this.logger.log(R.ERROR,"Cannot insert "+o.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},a.clearFromPos=function(o){var E;for(E=o;E<F;E++)this.chars[E].reset()},a.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},a.clearToEndOfRow=function(){this.clearFromPos(this.pos)},a.getTextString=function(){for(var o=[],E=!0,b=0;b<F;b++){var x=this.chars[b].uchar;x!==" "&&(E=!1),o.push(x)}return E?"":o.join("")},a.setPenStyles=function(o){this.currPenState.setStyles(o);var E=this.chars[this.pos];E.setPenState(this.currPenState)},m}(),h=function(){function m(d){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<G;o++)this.rows.push(new u(d));this.logger=d,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var a=m.prototype;return a.reset=function(){for(var o=0;o<G;o++)this.rows[o].clear();this.currRow=G-1},a.equals=function(o){for(var E=!0,b=0;b<G;b++)if(!this.rows[b].equals(o.rows[b])){E=!1;break}return E},a.copy=function(o){for(var E=0;E<G;E++)this.rows[E].copy(o.rows[E])},a.isEmpty=function(){for(var o=!0,E=0;E<G;E++)if(!this.rows[E].isEmpty()){o=!1;break}return o},a.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},a.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},a.insertChar=function(o){var E=this.rows[this.currRow];E.insertChar(o)},a.setPen=function(o){var E=this.rows[this.currRow];E.setPenStyles(o)},a.moveCursor=function(o){var E=this.rows[this.currRow];E.moveCursor(o)},a.setCursor=function(o){this.logger.log(R.INFO,"setCursor: "+o);var E=this.rows[this.currRow];E.setCursor(o)},a.setPAC=function(o){this.logger.log(R.INFO,"pacData = "+JSON.stringify(o));var E=o.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var b=0;b<G;b++)this.rows[b].clear();var x=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var U=N.rows[x].cueStartTime,K=this.logger.time;if(U&&K!==null&&U<K)for(var V=0;V<this.nrRollUpRows;V++)this.rows[E-this.nrRollUpRows+V+1].copy(N.rows[x+V])}}this.currRow=E;var _=this.rows[this.currRow];if(o.indent!==null){var I=o.indent,Y=Math.max(I-1,0);_.setCursor(o.indent),o.color=_.chars[Y].penState.foreground}var ee={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(ee)},a.setBkgData=function(o){this.logger.log(R.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},a.setRollUpRows=function(o){this.nrRollUpRows=o},a.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(R.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(R.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(o,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(R.INFO,"Rolling up")},a.getDisplayText=function(o){o=o||!1;for(var E=[],b="",x=-1,N=0;N<G;N++){var U=this.rows[N].getTextString();U&&(x=N+1,o?E.push("Row "+x+": '"+U+"'"):E.push(U.trim()))}return E.length>0&&(o?b="["+E.join(" | ")+"]":b=E.join(`
|
|
`)),b},a.getTextAndFormat=function(){return this.rows},m}(),T=function(){function m(d,o,E){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=d,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new h(E),this.nonDisplayedMemory=new h(E),this.lastOutputScreen=new h(E),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var a=m.prototype;return a.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},a.getHandler=function(){return this.outputFilter},a.setHandler=function(o){this.outputFilter=o},a.setPAC=function(o){this.writeScreen.setPAC(o)},a.setBkgData=function(o){this.writeScreen.setBkgData(o)},a.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(R.INFO,"MODE="+o),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=o},a.insertChars=function(o){for(var E=0;E<o.length;E++)this.writeScreen.insertChar(o[E]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(R.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(R.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},a.ccRCL=function(){this.logger.log(R.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},a.ccBS=function(){if(this.logger.log(R.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},a.ccAOF=function(){},a.ccAON=function(){},a.ccDER=function(){this.logger.log(R.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},a.ccRU=function(o){this.logger.log(R.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},a.ccFON=function(){this.logger.log(R.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},a.ccRDC=function(){this.logger.log(R.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},a.ccTR=function(){this.logger.log(R.INFO,"TR"),this.setMode("MODE_TEXT")},a.ccRTD=function(){this.logger.log(R.INFO,"RTD"),this.setMode("MODE_TEXT")},a.ccEDM=function(){this.logger.log(R.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},a.ccCR=function(){this.logger.log(R.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},a.ccENM=function(){this.logger.log(R.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},a.ccEOC=function(){if(this.logger.log(R.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(R.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},a.ccTO=function(o){this.logger.log(R.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},a.ccMIDROW=function(o){var E={flash:!1};if(E.underline=o%2===1,E.italics=o>=46,E.italics)E.foreground="white";else{var b=Math.floor(o/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=x[b]}this.logger.log(R.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},a.outputDataUpdate=function(o){o===void 0&&(o=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},a.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},m}(),p=function(){function m(d,o,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new A;this.channels=[null,new T(d,o,b),new T(d+1,E,b)],this.cmdHistory=v(),this.logger=b}var a=m.prototype;return a.getHandler=function(o){return this.channels[o].getHandler()},a.setHandler=function(o,E){this.channels[o].setHandler(E)},a.addData=function(o,E){var b,x,N,U=!1;this.logger.time=o;for(var K=0;K<E.length;K+=2){if(x=E[K]&127,N=E[K+1]&127,x===0&&N===0)continue;if(this.logger.log(R.DATA,"["+S([E[K],E[K+1]])+"] -> ("+S([x,N])+")"),b=this.parseCmd(x,N),b||(b=this.parseMidrow(x,N)),b||(b=this.parsePAC(x,N)),b||(b=this.parseBackgroundAttributes(x,N)),!b&&(U=this.parseChars(x,N),U)){var V=this.currentChannel;if(V&&V>0){var _=this.channels[V];_.insertChars(U)}else this.logger.log(R.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!U&&this.logger.log(R.WARNING,"Couldn't parse cleaned data "+S([x,N])+" orig: "+S([E[K],E[K+1]]))}},a.parseCmd=function(o,E){var b=this.cmdHistory,x=(o===20||o===28||o===21||o===29)&&E>=32&&E<=47,N=(o===23||o===31)&&E>=33&&E<=35;if(!(x||N))return!1;if(D(o,E,b))return f(null,null,b),this.logger.log(R.DEBUG,"Repeated command ("+S([o,E])+") is dropped"),!0;var U=o===20||o===21||o===23?1:2,K=this.channels[U];return o===20||o===21||o===28||o===29?E===32?K.ccRCL():E===33?K.ccBS():E===34?K.ccAOF():E===35?K.ccAON():E===36?K.ccDER():E===37?K.ccRU(2):E===38?K.ccRU(3):E===39?K.ccRU(4):E===40?K.ccFON():E===41?K.ccRDC():E===42?K.ccTR():E===43?K.ccRTD():E===44?K.ccEDM():E===45?K.ccCR():E===46?K.ccENM():E===47&&K.ccEOC():K.ccTO(E-32),f(o,E,b),this.currentChannel=U,!0},a.parseMidrow=function(o,E){var b=0;if((o===17||o===25)&&E>=32&&E<=47){if(o===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(R.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[b];return x?(x.ccMIDROW(E),this.logger.log(R.DEBUG,"MIDROW ("+S([o,E])+")"),!0):!1}return!1},a.parsePAC=function(o,E){var b,x=this.cmdHistory,N=(o>=17&&o<=23||o>=25&&o<=31)&&E>=64&&E<=127,U=(o===16||o===24)&&E>=64&&E<=95;if(!(N||U))return!1;if(D(o,E,x))return f(null,null,x),!0;var K=o<=23?1:2;E>=64&&E<=95?b=K===1?P[o]:y[o]:b=K===1?k[o]:C[o];var V=this.channels[K];return V?(V.setPAC(this.interpretPAC(b,E)),f(o,E,x),this.currentChannel=K,!0):!1},a.interpretPAC=function(o,E){var b,x={color:null,italics:!1,indent:null,underline:!1,row:o};return E>95?b=E-96:b=E-64,x.underline=(b&1)===1,b<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((b-16)/2)*4,x},a.parseChars=function(o,E){var b,x=null,N=null;if(o>=25?(b=2,N=o-8):(b=1,N=o),N>=17&&N<=19){var U;N===17?U=E+80:N===18?U=E+112:U=E+144,this.logger.log(R.INFO,"Special char '"+M(U)+"' in channel "+b),x=[U]}else o>=32&&o<=127&&(x=E===0?[o]:[o,E]);if(x){var K=S(x);this.logger.log(R.DEBUG,"Char codes = "+K.join(",")),f(o,E,this.cmdHistory)}return x},a.parseBackgroundAttributes=function(o,E){var b=(o===16||o===24)&&E>=32&&E<=47,x=(o===23||o===31)&&E>=45&&E<=47;if(!(b||x))return!1;var N,U={};o===16||o===24?(N=Math.floor((E-32)/2),U.background=O[N],E%2===1&&(U.background=U.background+"_semi")):E===45?U.background="transparent":(U.foreground="black",E===47&&(U.underline=!0));var K=o<=23?1:2,V=this.channels[K];return V.setBkgData(U),f(o,E,this.cmdHistory),!0},a.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var E=this.channels[o];E&&E.reset()}this.cmdHistory=v()},a.cueSplitAtTime=function(o){for(var E=0;E<this.channels.length;E++){var b=this.channels[E];b&&b.cueSplitAtTime(o)}},m}();function f(m,a,d){d.a=m,d.b=a}function D(m,a,d){return d.a===m&&d.b===a}function v(){return{a:null,b:null}}q.default=p},"./src/utils/codecs.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"isCodecType",function(){return B}),L.d(q,"isCodecSupportedInMp4",function(){return M});var J={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function B(G,F){var P=J[F];return!!P&&P[G.slice(0,4)]===!0}function M(G,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/utils/vttparser.ts"),B=L("./src/utils/webvtt-parser.ts"),M=L("./src/utils/texttrack-utils.ts"),G=/\s/,F={newCue:function(k,y,C,O){for(var R=[],A,S,c,s,u,h=self.VTTCue||self.TextTrackCue,T=0;T<O.rows.length;T++)if(A=O.rows[T],c=!0,s=0,u="",!A.isEmpty()){for(var p=0;p<A.chars.length;p++)G.test(A.chars[p].uchar)&&c?s++:(u+=A.chars[p].uchar,c=!1);A.cueStartTime=y,y===C&&(C+=1e-4),s>=16?s--:s++;var f=Object(J.fixLineBreaks)(u.trim()),D=Object(B.generateCueId)(y,C,f);(!k||!k.cues||!k.cues.getCueById(D))&&(S=new h(y,C,f),S.id=D,S.line=T+1,S.align="left",S.position=10+Math.min(80,Math.floor(s*8/32)*10),R.push(S))}return k&&R.length&&(R.sort(function(v,m){return v.line==="auto"||m.line==="auto"?0:v.line>8&&m.line>8?m.line-v.line:v.line-m.line}),R.forEach(function(v){return Object(M.addCueToTrack)(k,v)})),R}};q.default=F},"./src/utils/discontinuities.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"findFirstFragWithCC",function(){return G}),L.d(q,"shouldAlignOnDiscontinuities",function(){return F}),L.d(q,"findDiscontinuousReferenceFrag",function(){return P}),L.d(q,"adjustSlidingStart",function(){return y}),L.d(q,"alignStream",function(){return C}),L.d(q,"alignPDT",function(){return R}),L.d(q,"alignFragmentByPDTDelta",function(){return A}),L.d(q,"alignMediaPlaylistByPDT",function(){return S});var J=L("./src/polyfills/number.ts"),B=L("./src/utils/logger.ts"),M=L("./src/controller/level-helper.ts");function G(c,s){for(var u=null,h=0,T=c.length;h<T;h++){var p=c[h];if(p&&p.cc===s){u=p;break}}return u}function F(c,s,u){return!!(s.details&&(u.endCC>u.startCC||c&&c.cc<u.startCC))}function P(c,s){var u=c.fragments,h=s.fragments;if(!h.length||!u.length){B.logger.log("No fragments to align");return}var T=G(u,h[0].cc);if(!T||T&&!T.startPTS){B.logger.log("No frag in previous level to align on");return}return T}function k(c,s){if(c){var u=c.start+s;c.start=c.startPTS=u,c.endPTS=u+c.duration}}function y(c,s){for(var u=s.fragments,h=0,T=u.length;h<T;h++)k(u[h],c);s.fragmentHint&&k(s.fragmentHint,c),s.alignedSliding=!0}function C(c,s,u){if(!s)return;O(c,u,s),!u.alignedSliding&&s.details&&R(u,s.details),!u.alignedSliding&&s.details&&!u.skippedSegments&&Object(M.adjustSliding)(s.details,u)}function O(c,s,u){if(F(c,u,s)){var h=P(u.details,s);h&&Object(J.isFiniteNumber)(h.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),y(h.start,s))}}function R(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,h=c.fragments[0].programDateTime,T=(h-u)/1e3+s.fragments[0].start;T&&Object(J.isFiniteNumber)(T)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(h-u)+"ms, sliding:"+T.toFixed(3)+" "+c.url+" "),y(T,c))}function A(c,s){var u=c.programDateTime;if(!u)return;var h=(u-s)/1e3;c.start=c.startPTS=h,c.endPTS=h+c.duration}function S(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,h=s.fragments[0].start,T=u-h*1e3;c.fragments.forEach(function(p){A(p,T)}),c.fragmentHint&&A(c.fragmentHint,T),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/utils/ewma.ts"),B=function(){function M(F,P,k){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=k,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new J.default(F),this.fast_=new J.default(P)}var G=M.prototype;return G.update=function(P,k){var y=this.slow_,C=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new J.default(P,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==k&&(this.fast_=new J.default(k,C.getEstimate(),C.getTotalWeight()))},G.sample=function(P,k){P=Math.max(P,this.minDelayMs_);var y=8*k,C=P/1e3,O=y/C;this.fast_.sample(C,O),this.slow_.sample(C,O)},G.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},M}();q.default=B},"./src/utils/ewma.ts":function(le,q,L){"use strict";L.r(q);var J=function(){function B(G,F,P){F===void 0&&(F=0),P===void 0&&(P=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=F,this.totalWeight_=P}var M=B.prototype;return M.sample=function(F,P){var k=Math.pow(this.alpha_,F);this.estimate_=P*(1-k)+k*this.estimate_,this.totalWeight_+=F},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},B}();q.default=J},"./src/utils/fetch-loader.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"fetchSupported",function(){return A});var J=L("./src/polyfills/number.ts"),B=L("./src/loader/load-stats.ts"),M=L("./src/demux/chunk-cache.ts");function G(h,T){h.prototype=Object.create(T.prototype),h.prototype.constructor=h,C(h,T)}function F(h){var T=typeof Map=="function"?new Map:void 0;return F=function(f){if(f===null||!y(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof T!="undefined"){if(T.has(f))return T.get(f);T.set(f,D)}function D(){return P(f,arguments,O(this).constructor)}return D.prototype=Object.create(f.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),C(D,f)},F(h)}function P(h,T,p){return k()?P=Reflect.construct:P=function(D,v,m){var a=[null];a.push.apply(a,v);var d=Function.bind.apply(D,a),o=new d;return m&&C(o,m.prototype),o},P.apply(null,arguments)}function k(){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(h){return!1}}function y(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function C(h,T){return C=Object.setPrototypeOf||function(f,D){return f.__proto__=D,f},C(h,T)}function O(h){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},O(h)}function R(){return R=Object.assign||function(h){for(var T=1;T<arguments.length;T++){var p=arguments[T];for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&(h[f]=p[f])}return h},R.apply(this,arguments)}function A(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var S=function(){function h(p){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=p.fetchSetup||s,this.controller=new self.AbortController,this.stats=new B.LoadStats}var T=h.prototype;return T.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},T.abortInternal=function(){var f=this.response;(!f||!f.ok)&&(this.stats.aborted=!0,this.controller.abort())},T.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},T.load=function(f,D,v){var m=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var d=c(f,this.controller.signal),o=v.onProgress,E=f.responseType==="arraybuffer",b=E?"byteLength":"length";this.context=f,this.config=D,this.callbacks=v,this.request=this.fetchSetup(f,d),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),v.onTimeout(a,f,m.response)},D.timeout),self.fetch(this.request).then(function(x){if(m.response=m.loader=x,!x.ok){var N=x.status,U=x.statusText;throw new u(U||"fetch, bad network response",N,x)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(x.headers.get("Content-Length")||"0"),o&&Object(J.isFiniteNumber)(D.highWaterMark)?m.loadProgressively(x,a,f,D.highWaterMark,o):E?x.arrayBuffer():x.text()}).then(function(x){var N=m.response;self.clearTimeout(m.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first),a.loaded=a.total=x[b];var U={url:N.url,data:x};o&&!Object(J.isFiniteNumber)(D.highWaterMark)&&o(a,f,x,N),v.onSuccess(U,a,f,N)}).catch(function(x){if(self.clearTimeout(m.requestTimeout),a.aborted)return;var N=x.code||0;v.onError({code:N,text:x.message},f,x.details)})},T.getCacheAge=function(){var f=null;if(this.response){var D=this.response.headers.get("age");f=D?parseFloat(D):null}return f},T.loadProgressively=function(f,D,v,m,a){m===void 0&&(m=0);var d=new M.default,o=f.body.getReader(),E=function b(){return o.read().then(function(x){if(x.done)return d.dataLength&&a(D,v,d.flush(),f),Promise.resolve(new ArrayBuffer(0));var N=x.value,U=N.length;return D.loaded+=U,U<m||d.dataLength?(d.push(N),d.dataLength>=m&&a(D,v,d.flush(),f)):a(D,v,N,f),b()}).catch(function(){return Promise.reject()})};return E()},h}();function c(h,T){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:T,headers:new self.Headers(R({},h.headers))};return h.rangeEnd&&p.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),p}function s(h,T){return new self.Request(h.url,T)}var u=function(h){G(T,h);function T(p,f,D){var v;return v=h.call(this,p)||this,v.code=void 0,v.details=void 0,v.code=f,v.details=D,v}return T}(F(Error));q.default=S},"./src/utils/imsc1-ttml-parser.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"IMSC1_CODEC",function(){return y}),L.d(q,"parseIMSC1",function(){return A});var J=L("./src/utils/mp4-tools.ts"),B=L("./src/utils/vttparser.ts"),M=L("./src/utils/vttcue.ts"),G=L("./src/demux/id3.ts"),F=L("./src/utils/timescale-conversion.ts"),P=L("./src/utils/webvtt-parser.ts");function k(){return k=Object.assign||function(m){for(var a=1;a<arguments.length;a++){var d=arguments[a];for(var o in d)Object.prototype.hasOwnProperty.call(d,o)&&(m[o]=d[o])}return m},k.apply(this,arguments)}var y="stpp.ttml.im1t",C=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,O=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,R={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(m,a,d,o,E){var b=Object(J.findBox)(new Uint8Array(m),["mdat"]);if(b.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var x=b[0],N=Object(G.utf8ArrayToStr)(new Uint8Array(m,x.start,x.end-x.start)),U=Object(F.toTimescaleFromScale)(a,1,d);try{o(S(N,U))}catch(K){E(K)}}function S(m,a){var d=new DOMParser,o=d.parseFromString(m,"text/xml"),E=o.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(b).reduce(function(_,I){return _[I]=E.getAttribute("ttp:"+I)||b[I],_},{}),N=E.getAttribute("xml:space")!=="preserve",U=s(c(E,"styling","style")),K=s(c(E,"layout","region")),V=c(E,"body","[begin]");return[].map.call(V,function(_){var I=u(_,N);if(!I||!_.hasAttribute("begin"))return null;var Y=f(_.getAttribute("begin"),x),ee=f(_.getAttribute("dur"),x),oe=f(_.getAttribute("end"),x);if(Y===null)throw p(_);if(oe===null){if(ee===null)throw p(_);oe=Y+ee}var he=new M.default(Y-a,oe-a,I);he.id=Object(P.generateCueId)(he.startTime,he.endTime,he.text);var Le=K[_.getAttribute("region")],xe=U[_.getAttribute("style")];he.position=10,he.size=80;var Ae=h(Le,xe),Te=Ae.textAlign;if(Te){var Ce=R[Te];Ce&&(he.lineAlign=Ce),he.align=Te}return k(he,Ae),he}).filter(function(_){return _!==null})}function c(m,a,d){var o=m.getElementsByTagName(a)[0];return o?[].slice.call(o.querySelectorAll(d)):[]}function s(m){return m.reduce(function(a,d){var o=d.getAttribute("xml:id");return o&&(a[o]=d),a},{})}function u(m,a){return[].slice.call(m.childNodes).reduce(function(d,o,E){var b;return o.nodeName==="br"&&E?d+`
|
|
`:(b=o.childNodes)!==null&&b!==void 0&&b.length?u(o,a):a?d+o.textContent.trim().replace(/\s+/g," "):d+o.textContent},"")}function h(m,a){var d="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(E,b){var x=T(a,d,b)||T(m,d,b);return x&&(E[b]=x),E},{})}function T(m,a,d){return m.hasAttributeNS(a,d)?m.getAttributeNS(a,d):null}function p(m){return new Error("Could not parse ttml timestamp "+m)}function f(m,a){if(!m)return null;var d=Object(B.parseTimeStamp)(m);return d===null&&(C.test(m)?d=D(m,a):O.test(m)&&(d=v(m,a))),d}function D(m,a){var d=C.exec(m),o=(d[4]|0)+(d[5]|0)/a.subFrameRate;return(d[1]|0)*3600+(d[2]|0)*60+(d[3]|0)+o/a.frameRate}function v(m,a){var d=O.exec(m),o=Number(d[1]),E=d[2];switch(E){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/a.frameRate;case"t":return o/a.tickRate}return o}},"./src/utils/logger.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"enableLogs",function(){return P}),L.d(q,"logger",function(){return k});var J=function(){},B={trace:J,debug:J,log:J,warn:J,info:J,error:J},M=B;function G(y){var C=self.console[y];return C?C.bind(self.console,"["+y+"] >"):J}function F(y){for(var C=arguments.length,O=new Array(C>1?C-1:0),R=1;R<C;R++)O[R-1]=arguments[R];O.forEach(function(A){M[A]=y[A]?y[A].bind(y):G(A)})}function P(y){if(self.console&&y===!0||typeof y=="object"){F(y,"debug","log","info","warn","error");try{M.log()}catch(C){M=B}}else M=B}var k=M},"./src/utils/mediakeys-helper.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"KeySystems",function(){return J}),L.d(q,"requestMediaKeySystemAccess",function(){return B});var J;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(J||(J={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"getMediaSource",function(){return J});function J(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"bin2str",function(){return F}),L.d(q,"readUint16",function(){return P}),L.d(q,"readUint32",function(){return k}),L.d(q,"writeUint32",function(){return y}),L.d(q,"findBox",function(){return C}),L.d(q,"parseSegmentIndex",function(){return O}),L.d(q,"parseInitSegment",function(){return R}),L.d(q,"getStartDTS",function(){return A}),L.d(q,"getDuration",function(){return S}),L.d(q,"computeRawDurationFromSamples",function(){return c}),L.d(q,"offsetStartDTS",function(){return s}),L.d(q,"segmentValidRange",function(){return u}),L.d(q,"appendUint8Array",function(){return h});var J=L("./src/utils/typed-array.ts"),B=L("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,G=[].push;function F(T){return String.fromCharCode.apply(null,T)}function P(T,p){"data"in T&&(p+=T.start,T=T.data);var f=T[p]<<8|T[p+1];return f<0?65536+f:f}function k(T,p){"data"in T&&(p+=T.start,T=T.data);var f=T[p]<<24|T[p+1]<<16|T[p+2]<<8|T[p+3];return f<0?4294967296+f:f}function y(T,p,f){"data"in T&&(p+=T.start,T=T.data),T[p]=f>>24,T[p+1]=f>>16&255,T[p+2]=f>>8&255,T[p+3]=f&255}function C(T,p){var f=[];if(!p.length)return f;var D,v,m;"data"in T?(D=T.data,v=T.start,m=T.end):(D=T,v=0,m=D.byteLength);for(var a=v;a<m;){var d=k(D,a),o=F(D.subarray(a+4,a+8)),E=d>1?a+d:m;if(o===p[0])if(p.length===1)f.push({data:D,start:a+8,end:E});else{var b=C({data:D,start:a+8,end:E},p.slice(1));b.length&&G.apply(f,b)}a=E}return f}function O(T){var p=C(T,["moov"]),f=p[0],D=f?f.end:null,v=C(T,["sidx"]);if(!v||!v[0])return null;var m=[],a=v[0],d=a.data[0],o=d===0?8:16,E=k(a,o);o+=4;var b=0,x=0;d===0?o+=8:o+=16,o+=2;var N=a.end+x,U=P(a,o);o+=2;for(var K=0;K<U;K++){var V=o,_=k(a,V);V+=4;var I=_&2147483647,Y=(_&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=k(a,V);V+=4,m.push({referenceSize:I,subsegmentDuration:ee,info:{duration:ee/E,start:N,end:N+I-1}}),N+=I,V+=4,o=V}return{earliestPresentationTime:b,timescale:E,version:d,referencesCount:U,references:m,moovEndOffset:D}}function R(T){for(var p=[],f=C(T,["moov","trak"]),D=0;D<f.length;D++){var v=f[D],m=C(v,["tkhd"])[0];if(m){var a=m.data[m.start],d=a===0?12:20,o=k(m,d),E=C(v,["mdia","mdhd"])[0];if(E){a=E.data[E.start],d=a===0?12:20;var b=k(E,d),x=C(v,["mdia","hdlr"])[0];if(x){var N=F(x.data.subarray(x.start+8,x.start+12)),U={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[N];if(U){var K=C(v,["mdia","minf","stbl","stsd"])[0],V=void 0;K&&(V=F(K.data.subarray(K.start+12,K.start+16))),p[o]={timescale:b,type:U},p[U]={timescale:b,id:o,codec:V}}}}}}var _=C(T,["moov","mvex","trex"]);return _.forEach(function(I){var Y=k(I,4),ee=p[Y];ee&&(ee.default={duration:k(I,12),flags:k(I,20)})}),p}function A(T,p){return C(p,["moof","traf"]).reduce(function(f,D){var v=C(D,["tfdt"])[0],m=v.data[v.start],a=C(D,["tfhd"]).reduce(function(d,o){var E=k(o,4),b=T[E];if(b){var x=k(v,4);m===1&&(x*=Math.pow(2,32),x+=k(v,8));var N=b.timescale||9e4,U=x/N;if(isFinite(U)&&(d===null||U<d))return U}return d},null);return a!==null&&isFinite(a)&&(f===null||a<f)?a:f},null)||0}function S(T,p){for(var f=0,D=0,v=0,m=C(T,["moof","traf"]),a=0;a<m.length;a++){var d=m[a],o=C(d,["tfhd"])[0],E=k(o,4),b=p[E];if(!b)continue;var x=b.default,N=k(o,0)|(x==null?void 0:x.flags),U=x==null?void 0:x.duration;N&8&&(N&2?U=k(o,12):U=k(o,8));for(var K=b.timescale||9e4,V=C(d,["trun"]),_=0;_<V.length;_++){if(U){var I=k(V[_],4);f=U*I}else f=c(V[_]);b.type===B.ElementaryStreamTypes.VIDEO?D+=f/K:b.type===B.ElementaryStreamTypes.AUDIO&&(v+=f/K)}}if(D===0&&v===0){var Y=O(T);if(Y!=null&&Y.references)return Y.references.reduce(function(ee,oe){return ee+oe.info.duration||0},0)}return D||v}function c(T){var p=k(T,0),f=8;p&1&&(f+=4),p&4&&(f+=4);for(var D=0,v=k(T,4),m=0;m<v;m++){if(p&256){var a=k(T,f);D+=a,f+=4}p&512&&(f+=4),p&1024&&(f+=4),p&2048&&(f+=4)}return D}function s(T,p,f){C(p,["moof","traf"]).forEach(function(D){C(D,["tfhd"]).forEach(function(v){var m=k(v,4),a=T[m];if(!a)return;var d=a.timescale||9e4;C(D,["tfdt"]).forEach(function(o){var E=o.data[o.start],b=k(o,4);if(E===0)y(o,4,b-f*d);else{b*=Math.pow(2,32),b+=k(o,8),b-=f*d,b=Math.max(b,0);var x=Math.floor(b/(M+1)),N=Math.floor(b%(M+1));y(o,4,x),y(o,8,N)}})})})}function u(T){var p={valid:null,remainder:null},f=C(T,["moof"]);if(f){if(f.length<2)return p.remainder=T,p}else return p;var D=f[f.length-1];return p.valid=Object(J.sliceUint8)(T,0,D.start-8),p.remainder=Object(J.sliceUint8)(T,D.start-8),p}function h(T,p){var f=new Uint8Array(T.length+p.length);return f.set(T),f.set(p,T.length),f}},"./src/utils/output-filter.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"default",function(){return J});var J=function(){function B(G,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=F}var M=B.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(F,P,k){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=P,this.screen=k,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"sendAddTrackEvent",function(){return B}),L.d(q,"addCueToTrack",function(){return M}),L.d(q,"clearCurrentCues",function(){return G}),L.d(q,"removeCuesInRange",function(){return F}),L.d(q,"getCuesInRange",function(){return k});var J=L("./src/utils/logger.ts");function B(y,C){var O;try{O=new Event("addtrack")}catch(R){O=document.createEvent("Event"),O.initEvent("addtrack",!1,!1)}O.track=y,C.dispatchEvent(O)}function M(y,C){var O=y.mode;if(O==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(C.id))try{if(y.addCue(C),!y.cues.getCueById(C.id))throw new Error("addCue is failed for: "+C)}catch(A){J.logger.debug("[texttrack-utils]: "+A);var R=new self.TextTrackCue(C.startTime,C.endTime,C.text);R.id=C.id,y.addCue(R)}O==="disabled"&&(y.mode=O)}function G(y){var C=y.mode;if(C==="disabled"&&(y.mode="hidden"),y.cues)for(var O=y.cues.length;O--;)y.removeCue(y.cues[O]);C==="disabled"&&(y.mode=C)}function F(y,C,O){var R=y.mode;if(R==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var A=k(y.cues,C,O),S=0;S<A.length;S++)y.removeCue(A[S]);R==="disabled"&&(y.mode=R)}function P(y,C){if(C<y[0].startTime)return 0;var O=y.length-1;if(C>y[O].endTime)return-1;for(var R=0,A=O;R<=A;){var S=Math.floor((A+R)/2);if(C<y[S].startTime)A=S-1;else if(C>y[S].startTime&&R<O)R=S+1;else return S}return y[R].startTime-C<C-y[A].startTime?R:A}function k(y,C,O){var R=[],A=P(y,C);if(A>-1)for(var S=A,c=y.length;S<c;S++){var s=y[S];if(s.startTime>=C&&s.endTime<=O)R.push(s);else if(s.startTime>O)return R}return R}},"./src/utils/time-ranges.ts":function(le,q,L){"use strict";L.r(q);var J={toString:function(M){for(var G="",F=M.length,P=0;P<F;P++)G+="["+M.start(P).toFixed(3)+","+M.end(P).toFixed(3)+"]";return G}};q.default=J},"./src/utils/timescale-conversion.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"toTimescaleFromBase",function(){return B}),L.d(q,"toTimescaleFromScale",function(){return M}),L.d(q,"toMsFromMpegTsClock",function(){return G}),L.d(q,"toMpegTsClockFromTimescale",function(){return F});var J=9e4;function B(P,k,y,C){y===void 0&&(y=1),C===void 0&&(C=!1);var O=P*k*y;return C?Math.round(O):O}function M(P,k,y,C){return y===void 0&&(y=1),C===void 0&&(C=!1),B(P,k,1/y,C)}function G(P,k){return k===void 0&&(k=!1),B(P,1e3,1/J,k)}function F(P,k){return k===void 0&&(k=1),B(P,J,1/k)}},"./src/utils/typed-array.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"sliceUint8",function(){return J});function J(B,M,G){return Uint8Array.prototype.slice?B.slice(M,G):new Uint8Array(Array.prototype.slice.call(B,M,G))}},"./src/utils/vttcue.ts":function(le,q,L){"use strict";L.r(q),q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var J=["","lr","rl"],B=["start","middle","end","left","right"];function M(y,C){if(typeof C!="string")return!1;if(!Array.isArray(y))return!1;var O=C.toLowerCase();return~y.indexOf(O)?O:!1}function G(y){return M(J,y)}function F(y){return M(B,y)}function P(y){for(var C=arguments.length,O=new Array(C>1?C-1:0),R=1;R<C;R++)O[R-1]=arguments[R];for(var A=1;A<arguments.length;A++){var S=arguments[A];for(var c in S)y[c]=S[c]}return y}function k(y,C,O){var R=this,A={enumerable:!0};R.hasBeenReset=!1;var S="",c=!1,s=y,u=C,h=O,T=null,p="",f=!0,D="auto",v="start",m=50,a="middle",d=50,o="middle";Object.defineProperty(R,"id",P({},A,{get:function(){return S},set:function(b){S=""+b}})),Object.defineProperty(R,"pauseOnExit",P({},A,{get:function(){return c},set:function(b){c=!!b}})),Object.defineProperty(R,"startTime",P({},A,{get:function(){return s},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(R,"endTime",P({},A,{get:function(){return u},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(R,"text",P({},A,{get:function(){return h},set:function(b){h=""+b,this.hasBeenReset=!0}})),Object.defineProperty(R,"region",P({},A,{get:function(){return T},set:function(b){T=b,this.hasBeenReset=!0}})),Object.defineProperty(R,"vertical",P({},A,{get:function(){return p},set:function(b){var x=G(b);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");p=x,this.hasBeenReset=!0}})),Object.defineProperty(R,"snapToLines",P({},A,{get:function(){return f},set:function(b){f=!!b,this.hasBeenReset=!0}})),Object.defineProperty(R,"line",P({},A,{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(R,"lineAlign",P({},A,{get:function(){return v},set:function(b){var x=F(b);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");v=x,this.hasBeenReset=!0}})),Object.defineProperty(R,"position",P({},A,{get:function(){return m},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(R,"positionAlign",P({},A,{get:function(){return a},set:function(b){var x=F(b);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");a=x,this.hasBeenReset=!0}})),Object.defineProperty(R,"size",P({},A,{get:function(){return d},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");d=b,this.hasBeenReset=!0}})),Object.defineProperty(R,"align",P({},A,{get:function(){return o},set:function(b){var x=F(b);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");o=x,this.hasBeenReset=!0}})),R.displayState=void 0}return k.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},k}()},"./src/utils/vttparser.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"parseTimeStamp",function(){return M}),L.d(q,"fixLineBreaks",function(){return C}),L.d(q,"VTTParser",function(){return O});var J=L("./src/utils/vttcue.ts"),B=function(){function R(){}var A=R.prototype;return A.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},R}();function M(R){function A(c,s,u,h){return(c|0)*3600+(s|0)*60+(u|0)+parseFloat(h||0)}var S=R.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return S?parseFloat(S[2])>59?A(S[2],S[3],0,S[4]):A(S[1],S[2],S[3],S[4]):null}var G=function(){function R(){this.values=Object.create(null)}var A=R.prototype;return A.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},A.get=function(c,s,u){return u?this.has(c)?this.values[c]:s[u]:this.has(c)?this.values[c]:s},A.has=function(c){return c in this.values},A.alt=function(c,s,u){for(var h=0;h<u.length;++h)if(s===u[h]){this.set(c,s);break}},A.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},A.percent=function(c,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var u=parseFloat(s);if(u>=0&&u<=100)return this.set(c,u),!0}return!1},R}();function F(R,A,S,c){var s=c?R.split(c):[R];for(var u in s){if(typeof s[u]!="string")continue;var h=s[u].split(S);if(h.length!==2)continue;var T=h[0],p=h[1];A(T,p)}}var P=new J.default(0,0,""),k=P.align==="middle"?"middle":"center";function y(R,A,S){var c=R;function s(){var T=M(R);if(T===null)throw new Error("Malformed timestamp: "+c);return R=R.replace(/^[^\sa-zA-Z-]+/,""),T}function u(T,p){var f=new G;F(T,function(m,a){var d;switch(m){case"region":for(var o=S.length-1;o>=0;o--)if(S[o].id===a){f.set(m,S[o].region);break}break;case"vertical":f.alt(m,a,["rl","lr"]);break;case"line":d=a.split(","),f.integer(m,d[0]),f.percent(m,d[0])&&f.set("snapToLines",!1),f.alt(m,d[0],["auto"]),d.length===2&&f.alt("lineAlign",d[1],["start",k,"end"]);break;case"position":d=a.split(","),f.percent(m,d[0]),d.length===2&&f.alt("positionAlign",d[1],["start",k,"end","line-left","line-right","auto"]);break;case"size":f.percent(m,a);break;case"align":f.alt(m,a,["start",k,"end","left","right"]);break}},/:/,/\s/),p.region=f.get("region",null),p.vertical=f.get("vertical","");var D=f.get("line","auto");D==="auto"&&P.line===-1&&(D=-1),p.line=D,p.lineAlign=f.get("lineAlign","start"),p.snapToLines=f.get("snapToLines",!0),p.size=f.get("size",100),p.align=f.get("align",k);var v=f.get("position","auto");v==="auto"&&P.position===50&&(v=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=v}function h(){R=R.replace(/^\s+/,"")}if(h(),A.startTime=s(),h(),R.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);R=R.substr(3),h(),A.endTime=s(),h(),u(R,A)}function C(R){return R.replace(/<br(?: \/)?>/gi,`
|
|
`)}var O=function(){function R(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var A=R.prototype;return A.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function u(){var v=s.buffer,m=0;for(v=C(v);m<v.length&&v[m]!=="\r"&&v[m]!==`
|
|
`;)++m;var a=v.substr(0,m);return v[m]==="\r"&&++m,v[m]===`
|
|
`&&++m,s.buffer=v.substr(m),a}function h(v){F(v,function(m,a){},/:/)}try{var T="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;T=u();var p=T.match(/^()?WEBVTT([ \t].*)?$/);if(!p||!p[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var f=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;f?f=!1:T=u();switch(s.state){case"HEADER":/:/.test(T)?h(T):T||(s.state="ID");continue;case"NOTE":T||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(T)){s.state="NOTE";break}if(!T)continue;if(s.cue=new J.default(0,0,""),s.state="CUE",T.indexOf("-->")===-1){s.cue.id=T;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{y(T,s.cue,s.regionList)}catch(v){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var D=T.indexOf("-->")!==-1;if(!T||D&&(f=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
|
|
`),s.cue.text+=T}continue;case"BADCUE":T||(s.state="ID")}}}catch(v){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},A.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
|
|
|
|
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){c.onparsingerror&&c.onparsingerror(s)}return c.onflush&&c.onflush(),this},R}()},"./src/utils/webvtt-parser.ts":function(le,q,L){"use strict";L.r(q),L.d(q,"generateCueId",function(){return O}),L.d(q,"parseWebVTT",function(){return A});var J=L("./src/polyfills/number.ts"),B=L("./src/utils/vttparser.ts"),M=L("./src/demux/id3.ts"),G=L("./src/utils/timescale-conversion.ts"),F=L("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,k=function(c,s,u){return u===void 0&&(u=0),c.substr(u,s.length)===s},y=function(c){var s=parseInt(c.substr(-3)),u=parseInt(c.substr(-6,2)),h=parseInt(c.substr(-9,2)),T=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(J.isFiniteNumber)(s)||!Object(J.isFiniteNumber)(u)||!Object(J.isFiniteNumber)(h)||!Object(J.isFiniteNumber)(T))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return s+=1e3*u,s+=60*1e3*h,s+=60*60*1e3*T,s},C=function(c){for(var s=5381,u=c.length;u;)s=s*33^c.charCodeAt(--u);return(s>>>0).toString()};function O(S,c,s){return C(S.toString())+C(c.toString())+C(s)}var R=function(c,s,u){var h=c[s],T=c[h.prevCC];if(!T||!T.new&&h.new){c.ccOffset=c.presentationOffset=h.start,h.new=!1;return}for(;(p=T)!==null&&p!==void 0&&p.new;){var p;c.ccOffset+=h.start-T.start,h.new=!1,h=T,T=c[h.prevCC]}c.presentationOffset=u};function A(S,c,s,u,h,T,p,f){var D=new B.VTTParser,v=Object(M.utf8ArrayToStr)(new Uint8Array(S)).trim().replace(P,`
|
|
`).split(`
|
|
`),m=[],a=Object(G.toMpegTsClockFromTimescale)(c,s),d="00:00.000",o=0,E=0,b,x=!0,N=!1;D.oncue=function(U){var K=u[h],V=u.ccOffset,_=(o-a)/9e4;if(K!=null&&K.new&&(E!==void 0?V=u.ccOffset=K.start:R(u,h,_)),_&&(V=_-u.presentationOffset),N){var I=U.endTime-U.startTime,Y=Object(F.normalizePts)((U.startTime+V-E)*9e4,T*9e4)/9e4;U.startTime=Y,U.endTime=Y+I}var ee=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(ee)),U.id||(U.id=O(U.startTime,U.endTime,ee)),U.endTime>0&&m.push(U)},D.onparsingerror=function(U){b=U},D.onflush=function(){if(b){f(b);return}p(m)},v.forEach(function(U){if(x)if(k(U,"X-TIMESTAMP-MAP=")){x=!1,N=!0,U.substr(16).split(",").forEach(function(K){k(K,"LOCAL:")?d=K.substr(6):k(K,"MPEGTS:")&&(o=parseInt(K.substr(7)))});try{E=y(d)/1e3}catch(K){N=!1,b=K}return}else U===""&&(x=!1);D.parse(U+`
|
|
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(le,q,L){"use strict";L.r(q);var J=L("./src/utils/logger.ts"),B=L("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,G=function(){function F(k){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=k?k.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var P=F.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},P.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(y,C,O){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=C,this.callbacks=O,this.retryDelay=C.retryDelay,this.loadInternal()},P.loadInternal=function(){var y=this.config,C=this.context;if(!y)return;var O=this.loader=new self.XMLHttpRequest,R=this.stats;R.loading.first=0,R.loaded=0;var A=this.xhrSetup;try{if(A)try{A(O,C.url)}catch(s){O.open("GET",C.url,!0),A(O,C.url)}O.readyState||O.open("GET",C.url,!0);var S=this.context.headers;if(S)for(var c in S)O.setRequestHeader(c,S[c])}catch(s){this.callbacks.onError({code:O.status,text:s.message},C,O);return}C.rangeEnd&&O.setRequestHeader("Range","bytes="+C.rangeStart+"-"+(C.rangeEnd-1)),O.onreadystatechange=this.readystatechange.bind(this),O.onprogress=this.loadprogress.bind(this),O.responseType=C.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),O.send()},P.readystatechange=function(){var y=this.context,C=this.loader,O=this.stats;if(!y||!C)return;var R=C.readyState,A=this.config;if(O.aborted)return;if(R>=2)if(self.clearTimeout(this.requestTimeout),O.loading.first===0&&(O.loading.first=Math.max(self.performance.now(),O.loading.start)),R===4){C.onreadystatechange=null,C.onprogress=null;var S=C.status;if(S>=200&&S<300){O.loading.end=Math.max(self.performance.now(),O.loading.first);var c,s;if(y.responseType==="arraybuffer"?(c=C.response,s=c.byteLength):(c=C.responseText,s=c.length),O.loaded=O.total=s,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(O,y,c,C),!this.callbacks)return;var h={url:C.responseURL,data:c};this.callbacks.onSuccess(h,O,y,C)}else O.retry>=A.maxRetry||S>=400&&S<499?(J.logger.error(S+" while loading "+y.url),this.callbacks.onError({code:S,text:C.statusText},y,C)):(J.logger.warn(S+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,A.maxRetryDelay),O.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout)},P.loadtimeout=function(){J.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(y){var C=this.stats;C.loaded=y.loaded,y.lengthComputable&&(C.total=y.total)},P.getCacheAge=function(){var y=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var C=this.loader.getResponseHeader("age");y=C?parseFloat(C):null}return y},F}();q.default=G}}).default})},vHTk:function(Ke,Ie,Z){Ke.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(Ke,Ie,Z){"use strict";Z.d(Ie,"c",function(){return B}),Z.d(Ie,"b",function(){return M}),Z.d(Ie,"d",function(){return G}),Z.d(Ie,"a",function(){return P}),Z.d(Ie,"e",function(){return k});var le=Z("9og8"),q=Z("WmNS"),L=Z.n(q),J=Z("ErOA");function B(y){return Object(J.c)("libraries/".concat(y,".json"))}function M(){return Object(J.c)("library_tags.json")}function G(y){return F.apply(this,arguments)}function F(){return F=Object(le.a)(L.a.mark(function y(C){var O;return L.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Object(J.b)("attachments/".concat(C,".json"));case 2:return O=A.sent,A.abrupt("return",O.status===0);case 4:case"end":return A.stop()}},y)})),F.apply(this,arguments)}function P(y){return Object(J.f)("libraries.json",y)}function k(y,C){return Object(J.g)("libraries/".concat(y,".json"),C)}},y5JW:function(Ke,Ie,Z){"use strict";Z.d(Ie,"c",function(){return S}),Z.d(Ie,"a",function(){return c});var le=Z("DZo9"),q=Z("8z0m"),L=Z("+L6B"),J=Z("2/Rp"),B=Z("9og8"),M=Z("k1fw"),G=Z("oBTY"),F=Z("miYZ"),P=Z("tsqr"),k=Z("WmNS"),y=Z.n(k),C=Z("q1tI"),O=Z.n(C),R=Z("m3rI"),A=Z("wzkS"),S="\u3000\u3000";function c(s){var u=["Bytes","KB","MB","GB","TB"];if(s==0)return"0 Byte";var h=parseInt(""+Math.floor(Math.log(s)/Math.log(1024)),10);return(s/Math.pow(1024,h)).toFixed(1)+" "+u[h]}Ie.b=function(s){var u=s.value,h=u===void 0?[]:u,T=s.action,p=s.onChange,f=s.className,D=s.maxSize,v=D===void 0?150:D,m=s.title,a=m===void 0?"\u6587\u4EF6\u4E0A\u4F20":m,d=s.accept,o=d===void 0?null:d,E={multiple:!1,fileList:h,accept:o,withCredentials:!0,beforeUpload:function(N){var U=N.size/1024/1024;return U<v?!0:(P.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(v,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),Promise.reject())},action:"".concat(R.a.API_SERVER,"/api/attachments.json"),onChange:function(N){var U=Object(G.a)(N.fileList);U=U.map(function(K){return K.name.indexOf(S)===-1&&(K.name="".concat(K.name).concat(S).concat(c(K.size))),Object(M.a)({},K)}),p(U)},onRemove:function(){var x=Object(B.a)(y.a.mark(function U(K){var V,_,I;return y.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:if(V=K.size/1024/1024,!(K.status==="uploading")){ee.next=3;break}return ee.abrupt("return",!0);case 3:if(V<v){ee.next=7;break}return ee.abrupt("return",!0);case 7:if(_=K.response?K.response.id:K.uid,!_){ee.next=15;break}return ee.next=11,Object(A.d)(K.response?K.response.id:K.id);case 11:return I=ee.sent,ee.abrupt("return",I);case 15:return ee.abrupt("return",!0);case 16:case"end":return ee.stop()}},U)}));function N(U){return x.apply(this,arguments)}return N}()};function b(x){x.preventDefault(),x.stopPropagation()}return O.a.createElement("div",{className:"single-upload ".concat(f||"")},O.a.createElement(q.a,E,O.a.createElement(J.a,{type:"primary",title:h.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:h.length>0,ghost:!0},a),O.a.createElement("span",{onClick:b,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",v,"M) 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