(window.webpackJsonp=window.webpackJsonp||[]).push([[223,7,9],{"+NIl":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Y,R){"use strict";function Q(D,T){D.cmdState.push(T)}function B(D){return D.cmdState.length>0?D.cmdState[D.cmdState.length-1]:null}function _(D){var T=D.cmdState.pop();T&&T.closeBracket()}function H(D){for(var T=D.cmdState,E=T.length-1;E>=0;E--){var h=T[E];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function U(D,T,E){return function(){this.name=D,this.bracketNo=0,this.style=T,this.styles=E,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=U("importmodule","tag",["string","builtin"]),O.documentclass=U("documentclass","tag",["","atom"]),O.usepackage=U("usepackage","tag",["atom"]),O.begin=U("begin","tag",["atom"]),O.end=U("end","tag",["atom"]),O.label=U("label","tag",["atom"]),O.ref=U("ref","tag",["atom"]),O.eqref=U("eqref","tag",["atom"]),O.cite=U("cite","tag",["atom"]),O.bibitem=U("bibitem","tag",["atom"]),O.Bibitem=U("Bibitem","tag",["atom"]),O.RBibitem=U("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(D,T){D.f=T}function b(D,T){var E;if(D.match(/^\\[a-zA-Z@]+/)){var h=D.current().slice(1);return E=O.hasOwnProperty(h)?O[h]:O.DEFAULT,E=new E,Q(T,E),M(T,k),E.style}if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/\\]/))return"tag";if(D.match("\\["))return M(T,function(u,d){return w(u,d,"\\]")}),"keyword";if(D.match("\\("))return M(T,function(u,d){return w(u,d,"\\)")}),"keyword";if(D.match("$$"))return M(T,function(u,d){return w(u,d,"$$")}),"keyword";if(D.match("$"))return M(T,function(u,d){return w(u,d,"$")}),"keyword";var o=D.next();if(o=="%")return D.skipToEnd(),"comment";if(o=="}"||o=="]"){if(E=B(T),E)E.closeBracket(o),M(T,k);else return"error";return"bracket"}else return o=="{"||o=="["?(E=O.DEFAULT,E=new E,Q(T,E),"bracket"):/\d/.test(o)?(D.eatWhile(/[\w.%]/),"atom"):(D.eatWhile(/[\w\-_]/),E=H(T),E.name=="begin"&&(E.argument=D.current()),E.styleIdentifier())}function w(D,T,E){if(D.eatSpace())return null;if(E&&D.match(E))return M(T,b),"keyword";if(D.match(/^\\[a-zA-Z@]+/))return"tag";if(D.match(/^[a-zA-Z]+/))return"variable-2";if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/]/))return"tag";if(D.match(/^[\^_&]/))return"tag";if(D.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(D.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=D.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(D.skipToEnd(),"comment"):"error"}function k(D,T){var E=D.peek(),h;return E=="{"||E=="["?(h=B(T),h.openBracket(E),D.eat(E),M(T,b),"bracket"):/[ \t\r]/.test(E)?(D.eat(E),null):(M(T,b),_(T),b(D,T))}return{startState:function(){var D=R.inMathMode?function(T,E){return w(T,E)}:b;return{cmdState:[],f:D}},copyState:function(D){return{cmdState:D.cmdState.slice(),f:D.f}},token:function(D,T){return T.f(D,T)},blankLine:function(D){D.f=b,D.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"/GNS":function(Pe,Le,Z){Pe.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(U,O,M){var b=M&&M!=ie.Init;if(O&&!b)U.on("blur",B),U.on("change",_),U.on("swapDoc",_),ie.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){Q(U)}),_(U);else if(!O&&b){U.off("blur",B),U.off("change",_),U.off("swapDoc",_),ie.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),Y(U);var w=U.getWrapperElement();w.className=w.className.replace(" CodeMirror-empty","")}O&&!U.hasFocus()&&B(U)});function Y(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function R(U){Y(U);var O=U.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=U.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var M=U.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),U.display.lineSpace.insertBefore(O,U.display.lineSpace.firstChild)}function Q(U){setTimeout(function(){var O=!1,M=U.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:U.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?R(U):Y(U)},20)}function B(U){H(U)&&R(U)}function _(U){var O=U.getWrapperElement(),M=H(U);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?R(U):Y(U)}function H(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var Y={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Q,B){var _=Q.indentUnit,H={},U=B.htmlMode?Y:R;for(var O in U)H[O]=U[O];for(var O in B)H[O]=B[O];var M,b;function w(a,y){function v(G){return y.tokenize=G,G(a,y)}var C=a.next();if(C=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?v(T("atom","]]>")):null:a.match("--")?v(T("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),v(E(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),y.tokenize=T("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",y.tokenize=k,"tag bracket");if(C=="&"){var P;return a.eat("#")?a.eat("x")?P=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):P=a.eatWhile(/[\d]/)&&a.eat(";"):P=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),P?"atom":"error"}else return a.eatWhile(/[^&<]/),null}w.isInText=!0;function k(a,y){var v=a.next();if(v==">"||v=="/"&&a.eat(">"))return y.tokenize=w,M=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return M="equals",null;if(v=="<"){y.tokenize=w,y.state=d,y.tagName=y.tagStart=null;var C=y.tokenize(a,y);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(v)?(y.tokenize=D(v),y.stringStartCol=a.column(),y.tokenize(a,y)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(a){var y=function(v,C){for(;!v.eol();)if(v.next()==a){C.tokenize=k;break}return"string"};return y.isInAttribute=!0,y}function T(a,y){return function(v,C){for(;!v.eol();){if(v.match(y)){C.tokenize=w;break}v.next()}return a}}function E(a){return function(y,v){for(var C;(C=y.next())!=null;){if(C=="<")return v.tokenize=E(a+1),v.tokenize(y,v);if(C==">")if(a==1){v.tokenize=w;break}else return v.tokenize=E(a-1),v.tokenize(y,v)}return"meta"}}function h(a,y,v){this.prev=a.context,this.tagName=y,this.indent=a.indented,this.startOfLine=v,(H.doNotIndent.hasOwnProperty(y)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function u(a,y){for(var v;;){if(!a.context)return;if(v=a.context.tagName,!H.contextGrabbers.hasOwnProperty(v)||!H.contextGrabbers[v].hasOwnProperty(y))return;o(a)}}function d(a,y,v){return a=="openTag"?(v.tagStart=y.column(),A):a=="closeTag"?g:d}function A(a,y,v){return a=="word"?(v.tagName=y.current(),b="tag",x):H.allowMissingTagName&&a=="endTag"?(b="tag bracket",x(a,y,v)):(b="error",A)}function g(a,y,v){if(a=="word"){var C=y.current();return v.context&&v.context.tagName!=C&&H.implicitlyClosed.hasOwnProperty(v.context.tagName)&&o(v),v.context&&v.context.tagName==C||H.matchClosing===!1?(b="tag",m):(b="tag error",L)}else return H.allowMissingTagName&&a=="endTag"?(b="tag bracket",m(a,y,v)):(b="error",L)}function m(a,y,v){return a!="endTag"?(b="error",m):(o(v),d)}function L(a,y,v){return b="error",m(a,y,v)}function x(a,y,v){if(a=="word")return b="attribute",p;if(a=="endTag"||a=="selfcloseTag"){var C=v.tagName,P=v.tagStart;return v.tagName=v.tagStart=null,a=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(C)?u(v,C):(u(v,C),v.context=new h(v,C,P==v.indented)),d}return b="error",x}function p(a,y,v){return a=="equals"?c:(H.allowMissing||(b="error"),x(a,y,v))}function c(a,y,v){return a=="string"?s:a=="word"&&H.allowUnquoted?(b="string",x):(b="error",x(a,y,v))}function s(a,y,v){return a=="string"?s:x(a,y,v)}return{startState:function(a){var y={tokenize:w,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(y.baseIndent=a),y},token:function(a,y){if(!y.tagName&&a.sol()&&(y.indented=a.indentation()),a.eatSpace())return null;M=null;var v=y.tokenize(a,y);return(v||M)&&v!="comment"&&(b=null,y.state=y.state(M||v,a,y),b&&(v=b=="error"?v+" error":b)),v},indent:function(a,y,v){var C=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(C&&C.noIndent)return ie.Pass;if(a.tokenize!=k&&a.tokenize!=w)return v?v.match(/^(\s*)/)[0].length:0;if(a.tagName)return H.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=x)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var y=[],v=a.context;v;v=v.prev)v.tagName&&y.push(v.tagName);return y.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(Pe,Le,Z){"use strict";var ie=Z("Awhp"),Y=Z("KrTs"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("5NDa"),_=Z("5rEg"),H=Z("0Owb"),U=Z("oBTY"),O=Z("tJVT"),M=Z("PpiC"),b=Z("q1tI"),w=Z.n(b),k=function(T){var E=T.InputRight,h=T.value,o=h===void 0?[]:h,u=T.onChange,d=u===void 0?function(){}:u,A=Object(M.a)(T,["InputRight","value","onChange"]),g=Object(b.useState)(),m=Object(O.a)(g,2),L=m[0],x=m[1],p=function(a){var y=o.filter(function(v,C){return C!==a});d(y)},c=function(a){if(a.preventDefault(),!L)return;d([].concat(Object(U.a)(o),[L])),x(null)};return w.a.createElement("div",null,w.a.createElement(_.a,Object(H.a)({},A,{value:L,onChange:function(a){return x(a.target.value)},onPressEnter:c,onBlur:c})),E,w.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(s,a){return w.a.createElement(Y.a,{className:"ml10 mr10",count:"x",onClick:function(){return p(a)}},w.a.createElement(Q.a,{type:"primary",ghost:!0},s))})))};Le.a=k},"4qgm":function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1P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vmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return u});var ie=Z("Ty5D"),Y=Z("dI71"),R=Z("q1tI"),Q=Z.n(R),B=Z("YS25"),_=Z("17x9"),H=Z.n(_),U=Z("wx14"),O=Z("zLVn"),M=Z("9R94"),b=function(c){Object(Y.a)(s,c);function s(){for(var y,v=arguments.length,C=new Array(v),P=0;P1&&arguments[1]!==void 0?arguments[1]:0,T=(H[k[D+0]]+H[k[D+1]]+H[k[D+2]]+H[k[D+3]]+"-"+H[k[D+4]]+H[k[D+5]]+"-"+H[k[D+6]]+H[k[D+7]]+"-"+H[k[D+8]]+H[k[D+9]]+"-"+H[k[D+10]]+H[k[D+11]]+H[k[D+12]]+H[k[D+13]]+H[k[D+14]]+H[k[D+15]]).toLowerCase();if(!_(T))throw TypeError("Stringified UUID is invalid");return T}var M=O;function b(k,D,T){k=k||{};var E=k.random||(k.rng||R)();if(E[6]=E[6]&15|64,E[8]=E[8]&63|128,D){T=T||0;for(var h=0;h<16;++h)D[T+h]=E[h];return D}return M(E)}var w=Le.a=b},"7ZXX":function(Pe,Le,Z){Pe.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return A});var ie=Z("k1fw"),Y=Z("0Owb"),R=Z("+L6B"),Q=Z("2/Rp"),B=Z("y8nQ"),_=Z("Vl3Y"),H=Z("tJVT"),U=Z("OaEy"),O=Z("2fM7"),M=Z("q1tI"),b=Z.n(M),w=Z("VrN/"),k=Z.n(w),D=Z("p77/"),T=Z.n(D),E=Z("c5Ni"),h=Z.n(E),o=O.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};Le.b=function(g){var m=g.callback,L=g.onCancel,x=Object(M.useState)("python"),p=Object(H.a)(x,2),c=p[0],s=p[1];function a(v){s(d[v][1])}function y(v){m(v)}return b.a.createElement(_.a,Object(Y.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),b.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(O.a,{onChange:a},Object.keys(d).map(function(v){return b.a.createElement(o,{key:v,value:v},d[v][0])}))),b.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(A,{mode:c})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(Q.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function A(g){var m=g.value,L=g.onChange,x=g.mode,p=g.options,c=p===void 0?{}:p,s=Object(M.useRef)(),a=Object(M.useState)(),y=Object(H.a)(a,2),v=y[0],C=y[1];return Object(M.useEffect)(function(){if(v){function P(G){var V=G.getValue();L&&L(V)}return v.on("change",P),function(){v.off("change",P)}}},[v,L]),Object(M.useEffect)(function(){v&&v.setOption("mode",x)},[v,x]),Object(M.useEffect)(function(){v&&((m!==v.getValue()||m==="")&&setTimeout(function(){v.setValue(m||" ")},300))},[v,m]),Object(M.useEffect)(function(){if(s.current&&!v){var P=k.a.fromTextArea(s.current,Object(ie.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));C(P)}},[s.current,v]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:s}))}},"7ixt":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie={adjustX:1,adjustY:1},Y=[0,0],R={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:Y}},Q=R},"7v3h":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Y=0;Y-1&&Q.substring(H+1,Q.length);if(U)return ie.findModeByExtension(U)},ie.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=I.length?J.slice(I.length):J}).join(` `)}var h=[],o=["
    "],u=new D.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){h.length=0,o=["
      "]}var g={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(W,l,f,I){if(l>=W.length||W[l].level<=f)return l;var J=W[l];I.push("
    • "+J.text+""),l++;var F=[];return l=m(W,l,J.level,F),F.length>0&&(I.push("
        "),F.forEach(function(he){I.push(he)}),I.push("
      ")),I.push("
    • "),l=m(W,l,f,I),l}function L(){return m(h,0,0,o),o.push("
    "),o.join("")}var x={heading:function(l){var f=d.exec(l);if(f)return{type:"heading",raw:f[0],depth:f[1].length,text:f[2]}},fences:function(l){var f=this.rules.block.fences.exec(l);if(f){var I=f[0],J=E(I,f[3]||""),F=f[2]?f[2].trim():f[2];if(["latex","katex","math"].indexOf(F)>=0){var he=s(),_e=J;J=he,a[he]={type:"block",expression:_e}}return{type:"code",raw:I,lang:F,text:J}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,s=function(){return"__special_katext_id_".concat(c++,"__")},a={};function y(){return a}function v(){c=0,a={}}function C(W){return W=W.replace(p,function(l,f){var I=s();return a[I]={type:"inline",expression:f},I}),W}var P=u.listitem;u.listitem=function(W){return P(C(W))};var G=u.paragraph;u.paragraph=function(W){return G(C(W))};var V=u.tablecell;u.tablecell=function(W,l){return V(C(W),l)},u.code=function(W,l,f){var I=(l||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"

    ".concat(W,"

    "):'
    ').concat(f?W:Object(T.escape)(W,!0),`
    `):'
    '+(f?W:Object(T.escape)(W,!0))+"
    "},u.heading=function(W,l,f){var I=this.options.headerPrefix+f.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:I,level:l,text:W}),"'+W+""},D.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:x,renderer:u});var $=D.a,z=Z("SJMd"),j=Z("ulZh"),ee=Z.n(j),ne=Z("m3rI"),ce=Z("Oy/b"),ve=Z("p5ED"),Ie=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(W,l){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,I){f.__proto__=I}||function(f,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(f[J]=I[J])})(W,l)};function Ee(W,l){function f(){this.constructor=W}xe(W,l),W.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)}function Te(W,l,f,I){return new(f||(f=Promise))(function(J,F){function he(gt){try{Ze(I.next(gt))}catch(Ue){F(Ue)}}function _e(gt){try{Ze(I.throw(gt))}catch(Ue){F(Ue)}}function Ze(gt){var Ue;gt.done?J(gt.value):(Ue=gt.value,Ue instanceof f?Ue:new f(function(Ct){Ct(Ue)})).then(he,_e)}Ze((I=I.apply(W,l||[])).next())})}function Se(W,l){var f,I,J,F,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function _e(Ze){return function(gt){return function(Ue){if(f)throw new TypeError("Generator is already executing.");for(;he;)try{if(f=1,I&&(J=2&Ue[0]?I.return:Ue[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,Ue[1])).done)return J;switch(I=0,J&&(Ue=[2&Ue[0],J.value]),Ue[0]){case 0:case 1:J=Ue;break;case 4:return he.label++,{value:Ue[1],done:!1};case 5:he.label++,I=Ue[1],Ue=[0];continue;case 7:Ue=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||Ue[0]!==6&&Ue[0]!==2)){he=0;continue}if(Ue[0]===3&&(!J||Ue[1]>J[0]&&Ue[1]',"select"),this.addActionButton(I,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(I,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(I,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(I,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(I,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(I,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(I,'',"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(F){var he=document.createElement("div");he.className=""+f.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",F.typeName),he.innerHTML=F.icon,he.addEventListener("click",function(){f.markerToolbarButtonClicked(he,F)}),f.buttons.push(he),f.markerButtons.push(he)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},W.prototype.addButtonClickListener=function(l){this.buttonClickListeners.push(l)},W.prototype.removeButtonClickListener=function(l){this.buttonClickListeners.indexOf(l)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(l),1)},W.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},W.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 f=0;f0&&this.buttonClickListeners.forEach(function(I){return I("marker",f)}),this.markerButtonOverflowBlock.style.display="none"},W.prototype.actionToolbarButtonClicked=function(l,f){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",f)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},W.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)},W.prototype.setActiveMarkerButton=function(l){var f=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===l});f&&this.setActiveButton(f)},W.prototype.setCurrentMarker=function(l){var f=this;this.currentMarker=l,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){f.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},W}(),Be=function(){function W(l,f,I,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=l,this.displayMode=f,this.uiStyleSettings=I,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return W.prototype.addStyles=function(){var l;this.toolboxStyleClass=this.styles.addClass(new De("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 De("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var f=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new De("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new De("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new De("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 De("toolbox-panel-row_colors",` background-color: `+((l=this.uiStyleSettings.toolboxBackgroundColor)!==null&&l!==void 0?l:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new De("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*f)+`px; padding: `+f+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new De("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new De("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new qe("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new qe("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},W.prototype.show=function(l){var f;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolboxStyleClass.name+" "+((f=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},W.prototype.setPanelButtons=function(l){var f,I,J=this;this.panels=l,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((f=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&f!==void 0?f:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(F){var he;F.uiStyleSettings=J.uiStyleSettings;var _e=document.createElement("div");_e.className=J.toolboxButtonStyleClass.name+" "+((he=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:J.toolboxButtonStyleColorsClass.name),_e.innerHTML=F.icon,_e.title=F.title,_e.addEventListener("click",function(){J.panelButtonClick(F)}),J.panelButtons.push(_e),J.buttonRow.appendChild(_e)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},W.prototype.panelButtonClick=function(l){var f=this,I=-1;if(l!==this.activePanel){I=this.panels.indexOf(l),this.panelRow.innerHTML="";var J=l.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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(){f.displayMode==="inline"?f.panelRow.style.display="none":f.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(F,he){var _e,Ze;F.className=f.toolboxButtonStyleClass.name+" "+(he===I?""+((_e=f.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_e!==void 0?_e:f.toolboxActiveButtonStyleColorsClass.name):""+((Ze=f.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:f.toolboxButtonStyleColorsClass.name))})},W}(),$e=function(W,l){this.title=W,this.icon=l},Qe=function(W){function l(f,I,J,F){var he=W.call(this,f,F||'')||this;return he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=I,he.currentColor=J,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(J){var F=f.getColorBox(J);I.appendChild(F),f.colorBoxes.push(F)}),I},l.prototype.getColorBox=function(f){var I=this,J=this.uiStyleSettings.toolbarHeight/4,F=this.uiStyleSettings.toolbarHeight-J,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=F-2+"px",he.style.height=F-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(F+2)/2+"px",he.style.borderColor=f===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){I.setCurrentColor(f,he)});var _e=document.createElement("div");return _e.style.display="inline-block",_e.style.width=F-2+"px",_e.style.height=F-2+"px",_e.style.backgroundColor=f,_e.style.borderRadius=F/2+"px",f==="transparent"&&(_e.style.fill=this.uiStyleSettings.toolboxAccentColor,_e.innerHTML=` `),he.appendChild(_e),he},l.prototype.setCurrentColor=function(f,I){var J=this;this.currentColor=f,this.colorBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(f)},l}($e),Me=function(){function W(l,f,I){this._state="new",this._isSelected=!1,this._container=l,this._overlayContainer=f,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(W.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),W.prototype.ownsTarget=function(l){return!1},Object.defineProperty(W.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),W.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},W.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},W.prototype.pointerDown=function(l,f){},W.prototype.dblClick=function(l,f){},W.prototype.manipulate=function(l){},W.prototype.pointerUp=function(l){this.stateChanged()},W.prototype.dispose=function(){},W.prototype.addMarkerVisualToContainer=function(l){this.container.childNodes.length>0?this.container.insertBefore(l,this.container.childNodes[0]):this.container.appendChild(l)},W.prototype.getState=function(){return{typeName:W.typeName,state:this.state,notes:this.notes}},W.prototype.restoreState=function(l){this._state=l.state,this.notes=l.notes},W.prototype.scale=function(l,f){},W.prototype.colorChanged=function(l){this.onColorChanged&&this.onColorChanged(l),this.stateChanged()},W.prototype.fillColorChanged=function(l){this.onFillColorChanged&&this.onFillColorChanged(l),this.stateChanged()},W.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)}},W.typeName="MarkerBase",W}(),He=function(){function W(){this.findGripByVisual=this.findGripByVisual.bind(this)}return W.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},W}(),rt=function(){function W(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},W}(),st=function(){function W(){}return W.toITransformMatrix=function(l){return{a:l.a,b:l.b,c:l.c,d:l.d,e:l.e,f:l.f}},W.toSVGMatrix=function(l,f){return l.a=f.a,l.b=f.b,l.c=f.c,l.d=f.d,l.e=f.e,l.f=f.f,l},W}(),Xe=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.left=0,F.top=0,F.width=0,F.height=0,F.defaultSize={x:50,y:20},F.offsetX=0,F.offsetY=0,F.rotationAngle=0,F.CB_DISTANCE=10,F._suppressMarkerCreateEvent=!1,F.container.transform.baseVal.appendItem(se.createTransform()),F.setupControlBox(),F}return Ee(l,W),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(f){this._visual=f;var I=se.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(f){return!!W.prototype.ownsTarget.call(this,f)||!!(this.controlGrips.findGripByVisual(f)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(f))},l.prototype.pointerDown=function(f,I){W.prototype.pointerDown.call(this,f,I),this.state==="new"&&(this.left=f.x,this.top=f.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(f);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var F=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=F.x-this.width/2,this.top=F.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},l.prototype.pointerUp=function(f){var I=this.state;W.prototype.pointerUp.call(this,f),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(f),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},l.prototype.moveVisual=function(f){this.visual.style.transform="translate("+f.x+"px, "+f.y+"px)"},l.prototype.manipulate=function(f){var I=this.unrotatePoint(f);this.state==="creating"?this.resize(f):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(f)},l.prototype.resize=function(f){var I=this.manipulationStartLeft,J=this.manipulationStartWidth,F=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+f.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+f.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:F=this.manipulationStartTop+f.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-F;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+f.y-this.manipulationStartY}J>=0?(this.left=I,this.width=J):(this.left=I+J,this.width=-J),he>=0?(this.top=F,this.height=he):(this.top=F+he,this.height=-he),this.setSize()},l.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},l.prototype.rotate=function(f){if(Math.abs(f.x-this.centerX)>.1){var I=Math.sign(f.x-this.centerX);this.rotationAngle=180*Math.atan((f.y-this.centerY)/(f.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},l.prototype.applyRotation=function(){var f=this.container.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(f,0)},l.prototype.rotatePoint=function(f){if(this.rotationAngle===0)return f;var I=this.container.getCTM(),J=se.createPoint(f.x,f.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},l.prototype.unrotatePoint=function(f){if(this.rotationAngle===0)return f;var I=this.container.getCTM();I=I.inverse();var J=se.createPoint(f.x,f.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},l.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var f=se.createTransform();f.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(f),this.container.appendChild(this.controlBox),this.controlRect=se.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=se.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 He,this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){var f=this.controlBox.transform.baseVal.getItem(0);f.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(f,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 f=new rt;return f.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(f.visual),f},l.prototype.positionGrips=function(){var f=this.controlGrips.topLeft.GRIP_SIZE,I=-f/2,J=I,F=(this.width+this.CB_DISTANCE)/2-f/2,he=(this.height+this.CB_DISTANCE)/2-f/2,_e=this.height+this.CB_DISTANCE-f/2,Ze=this.width+this.CB_DISTANCE-f/2;this.positionGrip(this.controlGrips.topLeft.visual,I,J),this.positionGrip(this.controlGrips.topCenter.visual,F,J),this.positionGrip(this.controlGrips.topRight.visual,Ze,J),this.positionGrip(this.controlGrips.centerLeft.visual,I,he),this.positionGrip(this.controlGrips.centerRight.visual,Ze,he),this.positionGrip(this.controlGrips.bottomLeft.visual,I,_e),this.positionGrip(this.controlGrips.bottomCenter.visual,F,_e),this.positionGrip(this.controlGrips.bottomRight.visual,Ze,_e),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,F,J-3*this.CB_DISTANCE)},l.prototype.positionGrip=function(f,I,J){var F=f.transform.baseVal.getItem(0);F.setTranslate(I,J),f.transform.baseVal.replaceItem(F,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:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},W.prototype.getState.call(this))},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var I=f;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},l.prototype.scale=function(f,I){W.prototype.scale.call(this,f,I);var J=this.rotatePoint({x:this.left,y:this.top}),F=this.unrotatePoint({x:J.x*f,y:J.y*I});this.left=F.x,this.top=F.y,this.width=this.width*f,this.height=this.height*I,this.adjustControlBox()},l}(Me),Ye=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.createVisual=F.createVisual.bind(F),F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual)},l.prototype.createVisual=function(){this.visual=se.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(f,I){W.prototype.pointerDown.call(this,f,I),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},l.prototype.manipulate=function(f){W.prototype.manipulate.call(this,f)},l.prototype.resize=function(f){W.prototype.resize.call(this,f),this.setSize()},l.prototype.setSize=function(){W.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(f){W.prototype.pointerUp.call(this,f),this.setSize()},l.prototype.setStrokeColor=function(f){this.strokeColor=f,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(f),this.stateChanged()},l.prototype.setFillColor=function(f){this.fillColor=f,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},l.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.visual&&se.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},W.prototype.getState.call(this))},l.prototype.restoreState=function(f){var I=f;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),W.prototype.restoreState.call(this,f),this.setSize()},l.prototype.scale=function(f,I){W.prototype.scale.call(this,f,I),this.setSize()},l.title="Rectangle marker",l}(Xe),ct=function(W){function l(f,I,J,F){var he=W.call(this,f,F||'')||this;return he.widths=[],he.widthBoxes=[],he.widths=I,he.currentWidth=J,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.flexGrow="2",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===f.currentWidth?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentWidth(J,F)}),I.appendChild(F);var he=document.createElement("div");he.innerText=J.toString(),he.style.marginRight="5px",F.appendChild(he);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.display="flex",_e.style.alignItems="center";var Ze=document.createElement("hr");Ze.style.minWidth="20px",Ze.style.border="0px",Ze.style.borderTop=J+"px solid "+f.uiStyleSettings.toolboxColor,Ze.style.flexGrow="2",_e.appendChild(Ze),F.appendChild(_e),f.widthBoxes.push(F)}),I},l.prototype.setCurrentWidth=function(f,I){var J=this;this.currentWidth=f,this.widthBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},l}($e),nt=function(W){function l(f,I,J,F){var he=W.call(this,f,F||'')||this;return he.styles=[],he.styleBoxes=[],he.styles=I,he.currentStyle=J,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/f.styles.length-5+"%",F.style.borderColor=J===f.currentStyle?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentStyle(J,F)}),I.appendChild(F);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var _e=` `;he.innerHTML=_e,F.appendChild(he),f.styleBoxes.push(F)}),I},l.prototype.setCurrentStyle=function(f,I){var J=this;this.currentStyle=f,this.styleBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},l}($e),it=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new nt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ee(l,W),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=l.typeName,f},l.typeName="FrameMarker",l.title="Frame marker",l.icon='',l}(Ye),Ae=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},dt=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.x1=0,F.y1=0,F.x2=0,F.y2=0,F.defaultLength=50,F.manipulationStartX=0,F.manipulationStartY=0,F.manipulationStartX1=0,F.manipulationStartY1=0,F.manipulationStartX2=0,F.manipulationStartY2=0,F.setupControlBox(),F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!!W.prototype.ownsTarget.call(this,f)||!(!this.grip1.ownsTarget(f)&&!this.grip2.ownsTarget(f))},l.prototype.pointerDown=function(f,I){W.prototype.pointerDown.call(this,f,I),this.manipulationStartX=f.x,this.manipulationStartY=f.y,this.state==="new"&&(this.x1=f.x,this.y1=f.y,this.x2=f.x,this.y2=f.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(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},l.prototype.pointerUp=function(f){var I=this.state;W.prototype.pointerUp.call(this,f),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(f),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},l.prototype.adjustVisual=function(){},l.prototype.manipulate=function(f){this.state==="creating"?this.resize(f):this.state==="move"?(this.x1=this.manipulationStartX1+f.x-this.manipulationStartX,this.y1=this.manipulationStartY1+f.y-this.manipulationStartY,this.x2=this.manipulationStartX2+f.x-this.manipulationStartX,this.y2=this.manipulationStartY2+f.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(f)},l.prototype.resize=function(f){switch(this.activeGrip){case this.grip1:this.x1=f.x,this.y1=f.y;break;case this.grip2:case void 0:this.x2=f.x,this.y2=f.y}this.adjustVisual(),this.adjustControlBox()},l.prototype.select=function(){W.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){W.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=se.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 f=new rt;return f.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(f.visual),f},l.prototype.positionGrips=function(){var f=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-f/2,this.y1-f/2),this.positionGrip(this.grip2.visual,this.x2-f/2,this.y2-f/2)},l.prototype.positionGrip=function(f,I,J){var F=f.transform.baseVal.getItem(0);F.setTranslate(I,J),f.transform.baseVal.replaceItem(F,0)},l.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},W.prototype.getState.call(this))},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var I=f;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},l.prototype.scale=function(f,I){W.prototype.scale.call(this,f,I),this.x1=this.x1*f,this.y1=this.y1*I,this.x2=this.x2*f,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},l}(Me),at=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new nt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorLine&&f!==this.visibleLine)},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.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(f,I){W.prototype.pointerDown.call(this,f,I),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()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setStrokeColor=function(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},l.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},l.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,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 f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},W.prototype.getState.call(this));return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var I=f;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},l.typeName="LineMarker",l.title="Line marker",l.icon='',l}(dt),we=function(W){function l(f,I,J,F){var he=W.call(this,f,F||'')||this;return he.fonts=[],he.fontBoxes=[],he.fonts=I,he.currentFont=J,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(J){var F=document.createElement("div");F.style.display="inline-block",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/f.fonts.length-5+"%",F.style.borderColor=J===f.currentFont?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentFont(J,F)}),I.appendChild(F);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=J,he.style.overflow="hidden";var _e=document.createElement("div");_e.style.whiteSpace="nowrap",_e.style.overflow="hidden",_e.style.textOverflow="ellipsis",_e.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(_e),F.appendChild(he),f.fontBoxes.push(F)}),I},l.prototype.setCurrentFont=function(f,I){var J=this;this.currentFont=f,this.fontBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},l}($e),Ne=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.color="transparent",F.padding=5,F.DEFAULT_TEXT="your text here",F.text=F.DEFAULT_TEXT,F.isMoved=!1,F.color=J.defaultColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setColor=F.setColor.bind(F),F.setFont=F.setFont.bind(F),F.renderText=F.renderText.bind(F),F.sizeText=F.sizeText.bind(F),F.textEditDivClicked=F.textEditDivClicked.bind(F),F.showTextEditor=F.showTextEditor.bind(F),F.setSize=F.setSize.bind(F),F.positionTextEditor=F.positionTextEditor.bind(F),F.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F}return Ee(l,W),l.prototype.ownsTarget=function(f){if(W.prototype.ownsTarget.call(this,f)||f===this.visual||f===this.textElement||f===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(J){J===f&&(I=!0)}),I},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},l.prototype.pointerDown=function(f,I){W.prototype.pointerDown.call(this,f,I),this.isMoved=!1,this.pointerDownPoint=f,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(f),this._state="creating")},l.prototype.renderText=function(){var f=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(I){f.textElement.appendChild(se.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},l.prototype.getTextScale=function(){var f=this.textElement.getBBox(),I=1;if(f.width>0&&f.height>0){var J=(1*this.width-this.width*this.padding*2/100)/f.width,F=(1*this.height-this.height*this.padding*2/100)/f.height;I=Math.min(J,F)}return I},l.prototype.getTextPosition=function(f){var I=this.textElement.getBBox(),J=0,F=0;return I.width>0&&I.height>0&&(J=(this.width-I.width*f)/2,F=this.height/2-I.height*f/2),{x:J,y:F}},l.prototype.sizeText=function(){var f=this.textElement.getBBox(),I=this.getTextScale(),J=this.getTextPosition(I);J.y-=f.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},l.prototype.manipulate=function(f){W.prototype.manipulate.call(this,f),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(f.x-this.pointerDownPoint.x)>5||Math.abs(f.y-this.pointerDownPoint.y)>5)},l.prototype.resize=function(f){W.prototype.resize.call(this,f),this.isMoved=!0,this.setSize(),this.sizeText()},l.prototype.setSize=function(){W.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},l.prototype.pointerUp=function(f){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),W.prototype.pointerUp.call(this,f),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},l.prototype.showTextEditor=function(){var f=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(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(f.textEditor.style.fontSize);f.textEditor.clientWidth>=Number.parseInt(f.textEditor.style.maxWidth)&&I>.9;)I-=.1,f.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var J=I.clipboardData.getData("text"),F=window.getSelection();if(!F.rangeCount)return!1;F.deleteFromDocument(),F.getRangeAt(0).insertNode(document.createTextNode(J)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){f.textEditDivClicked(f.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 f=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),F={x:J.width*f,y:J.height*f};I.x-=F.x/2,I.y-=F.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*f,12)+"px",this.textElement.style.display="none"}},l.prototype.textEditDivClicked=function(f){this.text=f.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},l.prototype.select=function(){W.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},l.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),W.prototype.deselect.call(this)},l.prototype.dblClick=function(f,I){W.prototype.dblClick.call(this,f,I),this.showTextEditor()},l.prototype.setColor=function(f){this.textElement&&se.setAttributes(this.textElement,[["fill",f]]),this.color=f,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(f)},l.prototype.setFont=function(f){this.textElement&&se.setAttributes(this.textElement,[["font-family",f]]),this.fontFamily=f,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 f=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},W.prototype.getState.call(this));return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){var I=f;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),W.prototype.restoreState.call(this,f),this.setSize()},l.prototype.scale=function(f,I){W.prototype.scale.call(this,f,I),this.setSize(),this.sizeText(),this.positionTextEditor()},l.typeName="TextMarker",l.title="Text marker",l.icon='',l}(Xe),ge=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.color="transparent",F.lineWidth=3,F.drawing=!1,F.pixelRatio=1,F.color=J.defaultColor,F.lineWidth=J.defaultStrokeWidth,F.pixelRatio=J.freehandPixelRatio,F.setColor=F.setColor.bind(F),F.addCanvas=F.addCanvas.bind(F),F.finishCreation=F.finishCreation.bind(F),F.setLineWidth=F.setLineWidth.bind(F),F.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.lineWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.lineWidthPanel.onWidthChanged=F.setLineWidth,F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.drawingImage)},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var f=se.createTransform();this.visual.transform.baseVal.appendItem(f),this.addMarkerVisualToContainer(this.visual)},l.prototype.pointerDown=function(f,I){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(f.x,f.y),this.drawing=!0):W.prototype.pointerDown.call(this,f,I)},l.prototype.manipulate=function(f){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(f.x,f.y),this.canvasContext.stroke()):W.prototype.manipulate.call(this,f)},l.prototype.resize=function(f){W.prototype.resize.call(this,f),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(f){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):W.prototype.pointerUp.call(this,f)},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(),W.prototype.select.call(this)},l.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),W.prototype.deselect.call(this)},l.prototype.finishCreation=function(){for(var f=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=I[0],F=I[1],he=I[2],_e=I[3],Ze=!1,gt=0;gt0&&(Ze=!0,gt_e&&(_e=gt),Ue>he&&(he=Ue));if(Ze){this.left=J/this.pixelRatio,this.top=F/this.pixelRatio,this.width=(he-J)/this.pixelRatio,this.height=(_e-F)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=he-J,Ct.height=_e-F,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(J,F,he-J,_e-F),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},l.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},l.prototype.setColor=function(f){this.color=f,this.colorChanged(f)},l.prototype.setLineWidth=function(f){this.lineWidth=f},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 f=Object.assign({drawingImgUrl:this.drawingImgUrl},W.prototype.getState.call(this));return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){this.createVisual(),W.prototype.restoreState.call(this,f),this.drawingImgUrl=f.drawingImgUrl,this.setDrawingImage()},l.prototype.scale=function(f,I){W.prototype.scale.call(this,f,I),this.setDrawingImage()},l.typeName="FreehandMarker",l.title="Freehand marker",l.icon='',l}(Xe),de=function(W){function l(f,I,J){var F=W.call(this,f,J||'')||this;return F.typeBoxes=[],F.currentType=I,F.setCurrentType=F.setCurrentType.bind(F),F}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var J=function(_e){var Ze="both";switch(_e){case 0:Ze="both";break;case 1:Ze="start";break;case 2:Ze="end";break;case 3:Ze="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=Ze===F.currentType?F.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){f.setCurrentType(Ze,gt)}),I.appendChild(gt),Ze==="both"||Ze==="start"){var Ue=document.createElement("div");Ue.style.display="flex",Ue.style.alignItems="center",Ue.style.minHeight="20px",Ue.innerHTML=` `,Ue.style.marginLeft="5px",gt.appendChild(Ue)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Ct.appendChild(Gt),gt.appendChild(Ct),Ze==="both"||Ze==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.innerHTML=` `,er.style.marginRight="5px",gt.appendChild(er)}F.typeBoxes.push(gt)},F=this,he=0;he<4;he++)J(he);return I},l.prototype.setCurrentType=function(f,I){var J=this;this.currentType=f,this.typeBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},l}($e),fe=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.arrowType="end",F.arrowBaseHeight=10,F.arrowBaseWidth=10,F.getArrowPoints=F.getArrowPoints.bind(F),F.setArrowType=F.setArrowType.bind(F),F.arrowTypePanel=new de("Arrow type","end"),F.arrowTypePanel.onArrowTypeChanged=F.setArrowType,F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.arrow1&&f!==this.arrow2)},l.prototype.getArrowPoints=function(f,I){var J=this.arrowBaseWidth+2*this.strokeWidth,F=this.arrowBaseHeight+2*this.strokeWidth;return f-J/2+","+(I+F/2)+" "+f+","+(I-F/2)+" "+(f+J/2)+","+(I+F/2)},l.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},l.prototype.pointerDown=function(f,I){W.prototype.pointerDown.call(this,f,I),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(W.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",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(f,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(f+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},l.prototype.setArrowType=function(f){this.arrowType=f,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 f=Object.assign({arrowType:this.arrowType},W.prototype.getState.call(this));return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var I=f;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},l.typeName="ArrowMarker",l.title="Arrow marker",l.icon='',l}(at),te=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.fillColor=J.defaultFillColor,F.strokeWidth=0,F.fillPanel=new Qe("Color",J.defaultColorSet,J.defaultFillColor),F.fillPanel.onColorChanged=F.setFillColor,F}return Ee(l,W),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=l.typeName,f},l.typeName="CoverMarker",l.title="Cover marker",l.icon='',l}(Ye),re=function(W){function l(f,I,J,F){var he=W.call(this,f,F||'')||this;return he.opacities=[],he.opacityBoxes=[],he.opacities=I,he.currentOpacity=J,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Ee(l,W),l.prototype.getUi=function(){var f=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="center",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===f.currentOpacity?f.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){f.setCurrentOpacity(J,F)}),I.appendChild(F);var he=document.createElement("div");he.innerText=100*J+"%",F.appendChild(he),f.opacityBoxes.push(F)}),I},l.prototype.setCurrentOpacity=function(f,I){var J=this;this.currentOpacity=f,this.opacityBoxes.forEach(function(F){F.style.borderColor=F===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},l}($e),ae=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.setOpacity=F.setOpacity.bind(F),F.fillColor=J.defaultHighlightColor,F.strokeWidth=0,F.opacity=J.defaultHighlightOpacity,F.fillPanel=new Qe("Color",J.defaultColorSet,F.fillColor),F.fillPanel.onColorChanged=F.setFillColor,F.opacityPanel=new re("Opacity",J.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return Ee(l,W),l.prototype.setOpacity=function(f){this.opacity=f,this.visual&&se.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 f=W.prototype.getState.call(this);return f.typeName=l.typeName,f},l.typeName="HighlightMarker",l.title="Highlight marker",l.icon='',l}(te),le='',pe=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.bgColor="transparent",F.tipPosition={x:0,y:0},F.tipBase1Position={x:0,y:0},F.tipBase2Position={x:0,y:0},F.tipMoving=!1,F.color=J.defaultStrokeColor,F.bgColor=J.defaultFillColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setBgColor=F.setBgColor.bind(F),F.getTipPoints=F.getTipPoints.bind(F),F.positionTip=F.positionTip.bind(F),F.setTipPoints=F.setTipPoints.bind(F),F.colorPanel=new Qe("Text color",J.defaultColorSet,F.color,''),F.colorPanel.onColorChanged=F.setColor,F.bgColorPanel=new Qe("Fill color",J.defaultColorSet,F.bgColor,le),F.bgColorPanel.onColorChanged=F.setBgColor,F.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F.tipGrip=new rt,F.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),F.controlBox.appendChild(F.tipGrip.visual),F}return Ee(l,W),l.prototype.ownsTarget=function(f){return W.prototype.ownsTarget.call(this,f)||this.tipGrip.ownsTarget(f)||this.tip===f},l.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},l.prototype.pointerDown=function(f,I){this.state==="new"&&W.prototype.pointerDown.call(this,f,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):W.prototype.pointerDown.call(this,f,I)},l.prototype.pointerUp=function(f){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,W.prototype.pointerUp.call(this,f);else{var I=this.state==="creating";W.prototype.pointerUp.call(this,f),this.setTipPoints(I),this.positionTip()}},l.prototype.manipulate=function(f){if(this.tipMoving){var I=this.unrotatePoint(f);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else W.prototype.manipulate.call(this,f)},l.prototype.setBgColor=function(f){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",f]]),se.setAttributes(this.tip,[["fill",f]])),this.bgColor=f,this.fillColorChanged(f)},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(f){f===void 0&&(f=!1);var I=Math.min(this.height/2,15),J=this.height/5;f&&(this.tipPosition={x:I+J/2,y:this.height+20});var F=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?F.1)){var f=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(f,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(f+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f),this.createTips(),this.adjustVisual()},l.typeName="MeasurementMarker",l.title="Measurement marker",l.icon='',l}(at),ot=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.strokePanel.colors=J.defaultColorSet,F.fillColor="transparent",F}return Ee(l,W),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var f=W.prototype.getState.call(this);return f.typeName=l.typeName,f},l.typeName="EllipseFrameMarker",l.title="Ellipse frame marker",l.icon='',l}(Ce),mt=function(){function W(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),W.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))},W.prototype.replaceLastUndoStep=function(l){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=l)},W.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},W.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}},W.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},W}(),ht=function(W){function l(f,I,J){var F=W.call(this,f,I,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.curveX=0,F.curveY=0,F.manipulationStartCurveX=0,F.manipulationStartCurveY=0,F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.positionGrips=F.positionGrips.bind(F),F.addControlGrips=F.addControlGrips.bind(F),F.adjustVisual=F.adjustVisual.bind(F),F.setupControlBox=F.setupControlBox.bind(F),F.resize=F.resize.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new nt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return Ee(l,W),l.prototype.ownsTarget=function(f){return!(!W.prototype.ownsTarget.call(this,f)&&f!==this.visual&&f!==this.selectorCurve&&f!==this.visibleCurve&&!this.curveGrip.ownsTarget(f))},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=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.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(f,I){W.prototype.pointerDown.call(this,f,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=f.x,this.curveY=f.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(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()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setupControlBox=function(){W.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.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,W.prototype.addControlGrips.call(this)},l.prototype.positionGrips=function(){W.prototype.positionGrips.call(this);var f=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-f/2,this.curveY-f/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(f){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+f.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+f.y-this.manipulationStartY),W.prototype.manipulate.call(this,f)},l.prototype.resize=function(f){this.activeGrip===this.curveGrip&&(this.curveX=f.x,this.curveY=f.y),W.prototype.resize.call(this,f),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(f){this.strokeColor=f,this.adjustVisual(),this.colorChanged(f)},l.prototype.setStrokeWidth=function(f){this.strokeWidth=f,this.adjustVisual()},l.prototype.setStrokeDasharray=function(f){this.strokeDasharray=f,this.adjustVisual()},l.prototype.scale=function(f,I){this.curveX=this.curveX*f,this.curveY=this.curveY*I,W.prototype.scale.call(this,f,I)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var f=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},W.prototype.getState.call(this));return f.typeName=l.typeName,f},l.prototype.restoreState=function(f){W.prototype.restoreState.call(this,f);var I=f;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},l.typeName="CurveMarker",l.title="Curve marker",l.icon='',l}(dt),Lt=function(){function W(l,f){f===void 0&&(f=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=l,this.cancelable=f}return Object.defineProperty(W.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),W.prototype.preventDefault=function(){this._defaultPrevented=!0},W}(),At=function(W){function l(f,I,J){var F=W.call(this,f,!1)||this;return F.dataUrl=I,F.state=J,F}return Ee(l,W),l}(Lt),ft=function(W){function l(f,I,J){J===void 0&&(J=!1);var F=W.call(this,f,J)||this;return F.marker=I,F}return Ee(l,W),l}(Lt),Ft=function(){function W(){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 W.prototype.addEventListener=function(l,f){this[l].push(f)},W.prototype.removeEventListener=function(l,f){var I=this[l].indexOf(f);I>-1&&this[l].splice(I,1)},W}(),kt=function(){function W(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 Ae,this._isOpen=!1,this.undoRedoManager=new mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=W.instanceCounter++,this.styles=new Je(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(W.prototype,"ALL_MARKER_TYPES",{get:function(){return[it,ge,fe,Ne,ot,Ce,ae,pe,Oe,te,at,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,ge,fe,Ne,Ce,ae,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,ge,fe,Ne,ae]},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(l){var f=this;this._availableMarkerTypes.splice(0),l.forEach(function(I){if(typeof I=="string"){var J=f.ALL_MARKER_TYPES.find(function(F){return F.typeName===I});J!==void 0&&f._availableMarkerTypes.push(J)}else f._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(W.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(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),W.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},W.prototype.show=function(){var l=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(f){return f(new Lt(l))})},W.prototype.render=function(){return Te(this,void 0,void 0,function(){var l;return Se(this,function(f){switch(f.label){case 0:return this.setCurrentMarker(),(l=new Ve).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 f.sent(),[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,f.sent()]}})})},W.prototype.close=function(l){var f=this;if(l===void 0&&(l=!1),this.isOpen){var I=!1;l||this.eventListeners.beforeclose.forEach(function(J){var F=new Lt(f,!0);J(F),F.defaultPrevented&&(I=!0)}),I||(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(J){return J(new Lt(f))}),this.detachEvents(),this._isOpen=!1)}},W.prototype.addMarkersToToolbar=function(){for(var l,f=[],I=0;Ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*l:this.editorCanvas.clientWidth,I=f',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()},W.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")},W.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"},W.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},W.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 Fe(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-1&&this.markers.splice(this.markers.indexOf(l),1),l.dispose()},W.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())},W.prototype.toolbarButtonClicked=function(l,f){if(l==="marker"&&f!==void 0)this.createNewMarker(f);else if(l==="action")switch(f){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()}},W.prototype.deleteSelectedMarker=function(){var l=this;if(this._currentMarker!==void 0){var f=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var F=new ft(l,l._currentMarker,!0);J(F),F.defaultPrevented&&(f=!0)}),!f){var I=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(J){return J(new ft(l,I))})}}},W.prototype.clear=function(){var l=this,f=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var _e=new ft(l,void 0,!0);he(_e),_e.defaultPrevented&&(f=!0)}),!f)){this.setCurrentMarker();for(var I=function(he){var _e=J.markers[he];J.setCurrentMarker(J.markers[he]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(Ze){return Ze(new ft(l,_e))})},J=this,F=this.markers.length-1;F>=0;F--)I(F);this.addUndoStep()}},Object.defineProperty(W.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),W.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))},W.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)},W.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},W.prototype.addUndoStep=function(){var l=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var f=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===f.width&&I.height===f.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(f),J1&&this.panTo({x:l.clientX,y:l.clientY}))},W.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()},W.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},W.prototype.onKeyUp=function(l){this._currentMarker===void 0||this.notesArea!==void 0||l.key!=="Delete"&&l.key!=="Backspace"||this.deleteSelectedMarker()},W.prototype.clientToLocalCoordinates=function(l,f){var I=this.markerImage.getBoundingClientRect();return{x:(l-I.left)/this.zoomLevel,y:(f-I.top)/this.zoomLevel}},W.prototype.onWindowResize=function(){this.positionUI()},W.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()},W.prototype.addLicenseKey=function(l){ke.addKey(l)},W.prototype.addEventListener=function(l,f){this.eventListeners.addEventListener(l,f)},W.prototype.removeEventListener=function(l,f){this.eventListeners.removeEventListener(l,f)},W.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(W.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),W.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(f){return f(new Lt(l))}))},W.prototype.blur=function(){var l=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(f){return f(new Lt(l))}))},W.instanceCounter=0,W}();/* ********************************** 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 Ht=function(W,l){return(Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,I){f.__proto__=I}||function(f,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(f[J]=I[J])})(W,l)};function It(W,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function f(){this.constructor=W}Ht(W,l),W.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)}function xt(W,l,f,I){return new(f||(f=Promise))(function(J,F){function he(gt){try{Ze(I.next(gt))}catch(Ue){F(Ue)}}function _e(gt){try{Ze(I.throw(gt))}catch(Ue){F(Ue)}}function Ze(gt){var Ue;gt.done?J(gt.value):(Ue=gt.value,Ue instanceof f?Ue:new f(function(Ct){Ct(Ue)})).then(he,_e)}Ze((I=I.apply(W,l||[])).next())})}function Mt(W,l){var f,I,J,F,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function _e(Ze){return function(gt){return function(Ue){if(f)throw new TypeError("Generator is already executing.");for(;he;)try{if(f=1,I&&(J=2&Ue[0]?I.return:Ue[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,Ue[1])).done)return J;switch(I=0,J&&(Ue=[2&Ue[0],J.value]),Ue[0]){case 0:case 1:J=Ue;break;case 4:return he.label++,{value:Ue[1],done:!1};case 5:he.label++,I=Ue[1],Ue=[0];continue;case 7:Ue=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||Ue[0]!==6&&Ue[0]!==2)){he=0;continue}if(Ue[0]===3&&(!J||Ue[1]>J[0]&&Ue[1]0&&f>0){var I=new Kt(l,f),J=I.ratio>=1?20:I.getHorizontalLength(20),F=I.ratio<1?20:I.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var _e=lt.createDefs();he.appendChild(_e);var Ze=lt.createElement("clipPath",[["id","text-bg-clip"]]);_e.appendChild(Ze);var gt=lt.createPath(lt.getHollowRectanglePath((24-J)/2,(24-F)/2,J,F,(24-J)/2+2,(24-F)/2+2,J-4,F-4));he.appendChild(gt);var Ue=lt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ue.appendChild(lt.createTSpan(l+":"+f)),he.appendChild(Ue);var Ct=Ue.getBBox();lt.setAttributes(Ue,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var Gt=lt.createPath(lt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return Ze.appendChild(Gt),lt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.outerHTML}return''},W}(),tr=function(W){function l(f,I,J){var F=W.call(this,f,I)||this;return F.isDropdownOpen=!1,F.onClick=F.dropdownButtonClicked,F.dropdownButtons=J,F}return It(l,W),l.prototype.setupDropdown=function(){var f=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=f.className,I.colorsClassName=f.colorsClassName,f.dropdownBlock.appendChild(I.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}(yt),Ot=function(){function W(l,f){this.GRIP_SIZE=10,this.color=l,this.fillColor=f,this.visual=lt.createGroup(),this.visual.appendChild(lt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(lt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return W.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},W.prototype.setCenter=function(l,f){this.visual.childNodes.forEach(function(I){return lt.setAttributes(I,[["cx",l.toString()],["cy",f.toString()]])})},W}(),ur=function(){function W(l,f,I,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=l,this.canvasHeight=f,this.margin=I,this.container=J,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(W.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(W.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.gridContainer&<.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(l){this._zoomFactor=l,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),W.prototype.open=function(){var l=this;this.cropShadeElement=lt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=lt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var f=0;fthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-f.height/2),lt.setAttributes(this.cropRectElement,[["x",f.x.toString()],["y",f.y.toString()],["width",f.width.toString()],["height",f.height.toString()]]);var I=f.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(F,he){var _e=f.y+I*(he+1);lt.setAttributes(F,[["x1",""+f.x],["y1",""+_e],["x2",""+(f.x+f.width)],["y2",""+_e]])});var J=f.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(F,he){var _e=f.x+J*(he+1);lt.setAttributes(F,[["x1",""+_e],["y1",""+f.y],["x2",""+_e],["y2",""+(f.y+f.height)]])}),lt.setAttributes(this.cropShadeElement,[["d",lt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,f.x,f.y,f.width,f.height)]]),this.topLeftGrip.setCenter(f.x,f.y),this.topRightGrip.setCenter(f.x+f.width,f.y),this.bottomLeftGrip.setCenter(f.x,f.y+f.height),this.bottomRightGrip.setCenter(f.x+f.width,f.y+f.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},W.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)},W.prototype.clientToLocalCoordinates=function(l,f){var I=this.container.getBoundingClientRect();return{x:l-I.left+this.margin,y:f-I.top+this.margin}},W.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)},W.prototype.onPointerMove=function(l){if(this.isMoving)this.move(this.clientToLocalCoordinates(l.clientX,l.clientY));else if(this.activeGrip){var f=this.clientToLocalCoordinates(l.clientX,l.clientY);this.resize(f)}l.preventDefault()},W.prototype.onPointerUp=function(l){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(l.pointerId)},W.prototype.move=function(l){var f=l.x-this.previousPoint.x,I=l.y-this.previousPoint.y;this.zoomFactor!==1&&(f=-f/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+f),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=l},W.prototype.resize=function(l){var f=Object.assign({},this.cropRect),I=l.x-this.previousPoint.x,J=l.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:f.x+Ithis.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-f.width),f.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(f.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),f.height=this.aspectRatio.getVerticalLength(f.width)):(f.y+=J,f.height=this.cropRect.y+this.cropRect.height-f.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?f.height=this.aspectRatio.getVerticalLength(f.width):f.height+=J}f.width<10&&(f.x=this.cropRect.x,f.width=10),f.height<10&&(f.y=this.cropRect.y,f.height=10),this.previousPoint=l,f.x>=this.margin&&f.y>=this.margin&&f.x-this.margin+f.width<=this.canvasWidth&&f.y-this.margin+f.height<=this.canvasHeight&&(this.cropRect=f,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},W.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,f=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);I/this.canvasWidththis.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=f-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)}},W.prototype.getRescaledRect=function(l,f,I,J,F,he){var _e=I/l,Ze=J/f;return{x:(F.x-he)*_e+he,y:(F.y-he)*Ze+he,width:F.width*_e,height:F.height*Ze}},W.prototype.scaleCanvas=function(l,f){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,l,f,this.cropRect,this.margin);this.canvasWidth=l,this.canvasHeight=f,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},W}(),bt=function(){function W(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(W.prototype,"angle",{get:function(){return this._angle},set:function(l){this._angle=l,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),W.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},W.prototype.onPointerDown=function(l){this.controlContainer.setPointerCapture(l.pointerId),this.isDragging=!0,this.previousPoint={x:l.clientX,y:l.clientY}},W.prototype.onPointerMove=function(l){this.isDragging&&(this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.previousPoint.x=l.clientX)},W.prototype.onPointerUp=function(l){this.isDragging&&this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(l.pointerId)},W.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var l=this.angleLabelText.getBBox();lt.setAttributes(this.angleLabelElement,[["x",((this.width-l.width)/2).toString()],["y",(this.height/2).toString()]])}},W.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)}},W.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 f="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var J=I%5==0?this.height/3:this.height/6;f+="h4v"+-J+"h1v"+J}f+="v1H0Z",this.scaleShape=lt.createPath(f);var F=lt.createTransform();this.scaleShape.transform.baseVal.appendItem(F),l.appendChild(this.scaleShape),this.angleLabelElement=lt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=lt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=lt.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),l.appendChild(this.angleLabelElement),document.body.removeChild(l),l},W}(),ri=function(){function W(){this.naturalSize=!1,this.imageType="image/png"}return W.prototype.rasterize=function(l,f,I,J,F,he,_e){var Ze=this;return new Promise(function(gt){var Ue=document.createElement("canvas");Ue.width=l.width.baseVal.value-2*J,Ue.height=l.height.baseVal.value-2*J;var Ct=1,Gt=1;Ze.naturalSize===!0?(Ct=f.naturalWidth/(l.width.baseVal.value-2*J)/he,Gt=f.naturalHeight/(l.height.baseVal.value-2*J)/_e,Ue.width=f.naturalWidth/he,Ue.height=f.naturalHeight/_e):Ze.width!==void 0&&Ze.height!==void 0&&(Ct=Ze.width/I.width,Gt=Ze.height/I.height,Ue.width*=Ct,Ue.height*=Gt);var er=Ue.getContext("2d");er.translate(Ue.width/2,Ue.height/2),er.rotate(F*Math.PI/180),er.scale(he,_e),er.translate(-Ue.width/2,-Ue.height/2),er.drawImage(f,0,0,Ue.width,Ue.height);var jr=document.createElement("canvas");jr.width=I.width*Ct,jr.height=I.height*Gt,jr.getContext("2d").putImageData(er.getImageData((I.x-J)*Ct,(I.y-J)*Gt,I.width*Ct,I.height*Gt),0,0),gt(jr.toDataURL(Ze.imageType,Ze.imageQuality))})},W}(),Ge=function(){function W(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=W.instanceCounter++,this.styles=new $t(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(W.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(l){this._zoomToCropEnabled=l,l?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(W.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(W.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(W.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(W.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(W.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}),W.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},W.prototype.show=function(){this.showUI(),this.open()},W.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(f){return f()}),this._isOpen=!1)},W.prototype.addRenderEventListener=function(l){this.renderEventListeners.push(l)},W.prototype.removeRenderEventListener=function(l){this.renderEventListeners.indexOf(l)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(l),1)},W.prototype.addCloseEventListener=function(l){this.closeEventListeners.push(l)},W.prototype.removeCloseEventListener=function(l){this.closeEventListeners.indexOf(l)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(l),1)},W.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))},W.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var l=1*this.target.clientWidth/this.target.clientHeight,f=this.contentDiv.clientWidth/l>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*l:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=f+2*this.CANVAS_MARGINl+this.CANVAS_MARGIN?this.target.offsetTop-(l+this.CANVAS_MARGIN):0;this.coverDiv.style.top=f+"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},W.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},W.prototype.addTopToolbar=function(){var l=this;this.topToolbar=new Mr,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 f=new Xt;f.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(f);var I=[];this.aspectRatios.forEach(function(Gt){var er=new yt(wt.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);er.onClick=function(){return l.ratioButtonClicked(Gt)},I.push(er)}),this.aspectRatioButton=new tr(wt.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,f.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new yt('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){l.isGridVisible=!l.isGridVisible,J.isActive=l.isGridVisible},f.addButton(J);var F=new yt('',"Zoom to selection");if(F.isActive=this.zoomToCropEnabled,F.onClick=function(){l.zoomToCropEnabled=!l.zoomToCropEnabled,F.isActive=l.zoomToCropEnabled},f.addButton(F),!jt.isLicensed){var he=new ze;this.topToolbar.addElementBlock(he);var _e=document.createElement("div");_e.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ze=document.createElement("a");Ze.style.color="currentColor",Ze.href="https://markerjs.com/products/cropro",Ze.target="_blank",Ze.innerHTML='',_e.appendChild(Ze),he.addElement(_e)}var gt=new Xt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var Ue=new yt('',"OK");Ue.onClick=this.startRenderAndClose,gt.addButton(Ue),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new yt('',"Close");Ct.onClick=this.close,gt.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},W.prototype.addBottomToolbar=function(){var l=this;this.bottomToolbar=new Mr,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 f=new Xt;f.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(f);var I=new yt('',"Rotate left");I.onClick=this.rotateLeftButtonClicked,f.addButton(I);var J=new yt('',"Rotate right");J.onClick=this.rotateRightButtonClicked,f.addButton(J);var F=new ze;F.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(F),this.straightener=new bt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(gt){l.rotateBy(gt),l.straightener.angle=l.rotationAngle},F.addElement(this.straightener.getUI());var he=new Xt;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var _e=new yt('',"Flip horizontal");_e.onClick=this.flipHorizontallyButtonClicked,he.addButton(_e);var Ze=new yt('',"Flip vertical");Ze.onClick=this.flipVerticallyButtonClicked,he.addButton(Ze)},W.prototype.ratioButtonClicked=function(l){this.aspectRatio=l,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},W.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=wt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},W.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Kt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},W.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},W.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},W.prototype.restoreState=function(l){if(l){var f=this.cropLayer.getRescaledRect(l.width,l.height,this.imageWidth,this.imageHeight,l.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(f),this.cropRectChanged(f),this.flippedHorizontally=l.flippedHorizontally,this.flippedVertically=l.flippedVertically,this.applyFlip(),this.rotationAngle=l.rotationAngle,this.applyRotation()}},W.prototype.clientToLocalCoordinates=function(l,f){var I=this.cropImage.getBoundingClientRect();return{x:l-I.left,y:f-I.top}},W.prototype.onWindowResize=function(){this.positionUI()},W.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()},W.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)},W.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)},W.prototype.rotateTo=function(l){l=(l=l>180?l-360:l)<=-180?l+360:l,this.rotationAngle=l,this.applyRotation()},W.prototype.rotateBy=function(l){this.rotateTo((this.rotationAngle+l)%360)},W.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 f=this.editingTargetRotationContainer.transform.baseVal.getItem(0);f.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(f,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=l},W.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},W.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},W.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},W.prototype.startRenderAndClose=function(){return xt(this,void 0,void 0,function(){var l,f;return Mt(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return l=I.sent(),f=this.getState(),this.renderEventListeners.forEach(function(J){return J(l,f)}),this.close(!0),[2]}})})},W.prototype.render=function(){return xt(this,void 0,void 0,function(){var l;return Mt(this,function(f){switch(f.label){case 0:return(l=new ri).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.width=this.renderWidth,l.height=this.renderHeight,this.unzoomFromCrop(),lt.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 f.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,f.sent()]}})})},W.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ir("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 ir("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new ir("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var l=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ir("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 ir("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ir("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new ar("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new ar("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new ir("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 ir("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ir("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 ir("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 ir("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},W.instanceCounter=0,W}(),Dt=Z("8hTe"),pi=Z.n(Dt),mi=/]*>/g;function gi(W){var l=document.createElement("div");return l.innerHTML=W,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var vi=Le.a=function(W){var l=W.value,f=l===void 0?"":l,I=W.edit,J=I===void 0?!1:I,F=W.className,he=W.showTextOnly,_e=W.showLines,Ze=W.replaces,gt=W.zoomImg,Ue=W.hasMask,Ct=W.style,Gt=Ct===void 0?{}:Ct,er=W.stylesPrev,jr=er===void 0?{}:er,Ar=String(f),Tr=Object(M.useRef)(),Yr=Object(M.useRef)(),Ii=Object(M.useState)(""),mr=Object(H.a)(Ii,2),zr=mr[0],li=mr[1],ui=Object(M.useState)("office"),Wr=Object(H.a)(ui,2),Mi=Wr[0],yi=Wr[1],zi=function(){var zt=new Ge(Yr.current);zt.displayMode="popup",zt.addRenderEventListener(function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tr.current.style.display="none",gr.next=3,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr}});case 3:Yt=gr.sent,Yt!=null&&Yt.id&&Ze(Yr.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 5:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show()},Ki=function(){var zt=new kt(Yr.current);zt.settings.displayMode="popup",zt.addEventListener("render",function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(Tr.current.style.display="none",!Yr.current){gr.next=6;break}return gr.next=4,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr.dataUrl}});case 4:Yt=gr.sent,Yt!=null&&Yt.id&&Ze(Yr.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 6:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show(),window.markerArea=zt},Jr=Object(M.useMemo)(function(){Tr.current&&(Tr.current.style.zIndex=-1);try{var sr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,zt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ar=Ar.replace(sr,"("+ne.a.API_SERVER+"/api/attachments/").replace(zt,'"'+ne.a.API_SERVER+"/api/attachments/").replace(xr,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(ii){}var Bt=$(Ar),dr=y();if(Ar.match(/\[TOC\]/)&&(Bt=Bt.replace("

    [TOC]

    ",L()),A()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(ii,gr){var Rr=dr[gr],Vi=Rr.type,xi=Rr.expression;return Object(ce.renderToString)(gi(xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),v(),he){var Yt=document.createElement("div");return Yt.innerHTML=Bt,Yt.innerText}return setTimeout(function(){return hn()},500),Bt},[Ar]),Qr=Object(M.useRef)();g.WebkitLineClamp=_e,_e&&(Gt=Object(B.a)(Object(B.a)({},Gt),g));function bi(sr){var zt=sr.target;if(zt.tagName.toUpperCase()==="IMG"){if(gt){var xr=zt.getAttribute("src");li(xr),yi("image")}}else if(zt.tagName.toUpperCase()==="A"){var Bt=zt.getAttribute("href");if(Bt.indexOf("office")>-1)sr.preventDefault(),li(Bt),yi("office");else if(Bt.indexOf("application/pdf")>-1)sr.preventDefault(),li(Bt),yi("pdf");else if(Bt.indexOf("text/html")>-1)sr.preventDefault(),li(Bt),yi("html");else if(Bt.startsWith("#")){sr.preventDefault();var dr=document.getElementById(Bt.replace("#",""));dr&&dr.scrollIntoView(!0)}}}var hn=function(){var zt,xr=(zt=Qr.current)===null||zt===void 0?void 0:zt.querySelectorAll("video");xr==null||xr.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var dr=new ee.a;dr.loadSource(Bt.src),dr.attachMedia(Bt)}}})};Object(M.useEffect)(function(){if(Qr.current&&Jr&&(Jr.match(mi)&&window.PR.prettyPrint()),Qr.current)return Qr.current.addEventListener("click",bi),function(){Qr.current.removeEventListener("click",bi),v(),A()}},[Jr,Qr.current,bi]);var Ei=function(zt){if(!J)return;zt.target.nodeName==="IMG"?(Tr.current.style.zIndex=1,Tr.current.style.display="flex",Tr.current.style.width=zt.target.clientWidth+"px",Tr.current.style.height=zt.target.clientHeight+"px",Tr.current.style.top=zt.target.offsetTop+"px",Tr.current.style.left=zt.target.offsetLeft+"px",Yr.current.src=zt.target.getAttribute("src")):Tr.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:Qr,style:Object(B.a)({},Gt),className:"".concat(F||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:Jr}}),b.a.createElement("div",{ref:Tr,className:pi.a.button},b.a.createElement(Y.a,null,b.a.createElement(Q.a,{onClick:function(){return zi()}},"\u88C1\u526A"),b.a.createElement(Q.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Yr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ve.a,{close:!0,data:zr,type:zr!=null&&zr.length?Mi:"",style:Object(B.a)({},jr),onClose:function(){return li("")}}))}},"9VGf":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return R});var ie=Z("q1tI"),Y=Z.n(ie);function R(Q,B){var _=Object(ie.useRef)();Object(ie.useEffect)(function(){_.current=Q}),Object(ie.useEffect)(function(){function H(){_.current()}if(B!==null){var U=setInterval(H,B);return function(){return clearInterval(U)}}},[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ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(O,M,b){if(b!=ie.Init&&b&&O.removeKeyMap("autoCloseTags"),!M)return;var w={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(w["'/'"]=function(k){return _(k)}),(typeof M!="object"||M.whenOpening!==!1)&&(w["'>'"]=function(k){return Q(k)}),O.addKeyMap(w)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 Q(O){if(O.getOption("disableInput"))return ie.Pass;for(var M=O.listSelections(),b=[],w=O.getOption("autoCloseTags"),k=0;kD.ch&&(u=u.slice(0,u.length-T.end+D.ch));var m=u.toLowerCase();if(!u||T.type=="string"&&(T.end!=D.ch||!/[\"\']/.test(T.string.charAt(T.string.length-1))||T.string.length==1)||T.type=="tag"&&o.close||T.string.indexOf("/")==D.ch-T.start-1||A&&H(A,m)>-1||U(O,E.mode.xmlCurrentContext&&E.mode.xmlCurrentContext(h)||[],u,D,!0))return ie.Pass;var L=typeof w=="object"&&w.emptyTags;if(L&&H(L,u)>-1){b[k]={text:"/>",newPos:ie.Pos(D.line,D.ch+2)};continue}var x=g&&H(g,m)>-1;b[k]={indent:x,text:">"+(x?` `:"")+"",newPos:x?ie.Pos(D.line+1,0):ie.Pos(D.line,D.ch+1)}}for(var p=typeof w=="object"&&w.dontIndentOnAutoClose,k=M.length-1;k>=0;k--){var c=b[k];O.replaceRange(c.text,M[k].head,M[k].anchor,"+insert");var s=O.listSelections().slice(0);s[k]={head:c.newPos,anchor:c.newPos},O.setSelections(s),!p&&c.indent&&(O.indentLine(c.newPos.line,null,!0),O.indentLine(c.newPos.line+1,null,!0))}}function B(O,M){for(var b=O.listSelections(),w=[],k=M?"/":""&&(A+=">"),w[E]=A}if(O.replaceSelections(w),b=O.listSelections(),!T)for(var E=0;E=0&&M[h]==b;h--)++E;w=T.to;for(var h=1;h0){for(var M=0;M1&&arguments[1]!==void 0?arguments[1]:"",M=[],b=0;b4||((d=m.detail)===null||d===void 0?void 0:d.identity)===void 0||((A=m.detail)===null||A===void 0?void 0:A.shixun_status)===2||((g=m.detail)===null||g===void 0?void 0:g.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(T.a.wrap)},O.a.createElement(Y.a,{gutter:[20,20],align:"middle"},O.a.createElement(_.a,{flex:1},O.a.createElement("span",{className:T.a.icons},O.a.createElement("img",{src:k.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),O.a.createElement(_.a,null,(s==null?void 0:s.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(v.id,"/challenges/").concat(s==null||((G=s.prev_challenge)===null||G===void 0)?void 0:G.id).concat(V);b.d.replace($)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(v.id,"/challenges/").concat(s==null||((G=s.next_challenge)===null||G===void 0)?void 0:G.id).concat(V);b.d.replace($)}},"\u4E0B\u4E00\u5173"),C&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(w.a,{to:"/shixuns/".concat(v.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),C&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(v.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(v.id,"/challenges")},"\u8FD4\u56DE")))))};Le.a=Object(b.a)(function(h){var o=h.shixunsDetail,u=h.newCourse,d=h.loading,A=h.globalSetting;return{shixunsDetail:o,newCourse:u,globalSetting:A,loading:d.effects}})(E)},DlQD:function(Pe,Le,Z){(function(ie,Y){Pe.exports=Y()})(this,function(){"use strict";function ie(ge,de){for(var fe=0;fege.length)&&(de=ge.length);for(var fe=0,te=new Array(de);fe=ge.length?{done:!0}:{done:!1,value:ge[te++]}}}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 fe=ge[Symbol.iterator](),fe.next.bind(fe)}function _(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var H=_(function(ge){function de(){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 fe(te){ge.exports.defaults=te}ge.exports={defaults:de(),getDefaults:de,changeDefaults:fe}}),U=H.defaults,O=H.getDefaults,M=H.changeDefaults,b=/[&<>"']/,w=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,T={"&":"&","<":"<",">":">",'"':""","'":"'"},E=function(de){return T[de]};function h(ge,de){if(de){if(b.test(ge))return ge.replace(w,E)}else if(k.test(ge))return ge.replace(D,E);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(ge){return ge.replace(o,function(de,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var d=/(^|[^\[])\^/g;function A(ge,de){ge=ge.source||ge,de=de||"";var fe={replace:function(re,ae){return ae=ae.source||ae,ae=ae.replace(d,"$1"),ge=ge.replace(re,ae),fe},getRegex:function(){return new RegExp(ge,de)}};return fe}var g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ge,de,fe){if(ge){var te;try{te=decodeURIComponent(u(fe)).replace(g,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!m.test(fe)&&(fe=a(de,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(re){return null}return fe}var x={},p=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){x[" "+ge]||(p.test(ge)?x[" "+ge]=ge+"/":x[" "+ge]=P(ge,"/",!0)),ge=x[" "+ge];var fe=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?fe?de:ge.replace(c,"$1")+de:de.charAt(0)==="/"?fe?de:ge.replace(s,"$1")+de:ge+de}var y={exec:function(){}};function v(ge){for(var de=1,fe,te;de=0&&pe[Oe]==="\\";)Ce=!Ce;return Ce?"|":" |"}),te=fe.split(/ \|/),re=0;if(te.length>de)te.splice(de);else for(;te.length=te.length?re.slice(te.length):re}).join(` `)}var xe=function(){function ge(fe){this.options=fe||z}var de=ge.prototype;return de.space=function(te){var re=this.rules.block.newline.exec(te);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:` `}},de.code=function(te,re){var ae=this.rules.block.code.exec(te);if(ae){var le=re[re.length-1];if(le&&le.type==="paragraph")return{raw:ae[0],text:ae[0].trimRight()};var pe=ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:ae[0],codeBlockStyle:"indented",text:this.options.pedantic?pe:j(pe,` `)}}},de.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var ae=re[0],le=Ie(ae,re[3]||"");return{type:"code",raw:ae,lang:re[2]?re[2].trim():re[2],text:le}}},de.heading=function(te){var re=this.rules.block.heading.exec(te);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},de.nptable=function(te){var re=this.rules.block.nptable.exec(te);if(re){var ae={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(` `):[],raw:re[0]};if(ae.header.length===ae.align.length){var le=ae.align.length,pe;for(pe=0;pe ?/gm,"");return{type:"blockquote",raw:re[0],text:ae}}},de.list=function(te){var re=this.rules.block.list.exec(te);if(re){for(var ae=re[0],le=re[2],pe=le.length>1,Ce=le[le.length-1]===")",Oe={type:"list",raw:ae,ordered:pe,start:pe?+le.slice(0,-1):"",loose:!1,items:[]},ot=re[0].match(this.rules.block.item),mt=!1,ht,Lt,At,ft,Ft,kt,Ht,It=ot.length,xt=0;xt1||this.options.smartLists&&At!==le)&&(ft=ot.slice(xt+1).join(` `),Oe.raw=Oe.raw.substring(0,Oe.raw.length-ft.length),xt=It-1)),Ft=mt||/\n\n(?!\s*$)/.test(ht),xt!==It-1&&(mt=ht.charAt(ht.length-1)===` `,Ft||(Ft=mt)),Ft&&(Oe.loose=!0),kt=/^\[[ xX]\] /.test(ht),Ht=void 0,kt&&(Ht=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:ae,task:kt,checked:Ht,loose:Ft,text:ht});return Oe}},de.html=function(te){var re=this.rules.block.html.exec(te);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ne(re[0]):re[0]}},de.def=function(te){var re=this.rules.block.def.exec(te);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var ae=re[1].toLowerCase().replace(/\s+/g," ");return{tag:ae,raw:re[0],href:re[2],title:re[3]}}},de.table=function(te){var re=this.rules.block.table.exec(te);if(re){var ae={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(` `):[]};if(ae.header.length===ae.align.length){ae.raw=re[0];var le=ae.align.length,pe;for(pe=0;pe/i.test(le[0])&&(re=!1),!ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?ae=!0:ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(ae=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:re,inRawBlock:ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ne(le[0]):le[0]}},de.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var ae=ce(re[2],"()");if(ae>-1){var le=re[0].indexOf("!")===0?5:4,pe=le+re[1].length+ae;re[2]=re[2].substring(0,ae),re[0]=re[0].substring(0,pe).trim(),re[3]=""}var Ce=re[2],Oe="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);ot?(Ce=ot[1],Oe=ot[3]):Oe=""}else Oe=re[3]?re[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ve(re,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},re[0]);return mt}},de.reflink=function(te,re){var ae;if((ae=this.rules.inline.reflink.exec(te))||(ae=this.rules.inline.nolink.exec(te))){var le=(ae[2]||ae[1]).replace(/\s+/g," ");if(le=re[le.toLowerCase()],!le||!le.href){var pe=ae[0].charAt(0);return{type:"text",raw:pe,text:pe}}var Ce=ve(ae,le,ae[0]);return Ce}},de.strong=function(te,re,ae){ae===void 0&&(ae="");var le=this.rules.inline.strong.start.exec(te);if(le&&(!le[1]||le[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){re=re.slice(-1*te.length);var pe=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.strong.middle.exec(re.slice(0,le.index+3)),Ce)return{type:"strong",raw:te.slice(0,Ce[0].length),text:te.slice(2,Ce[0].length-2)}}},de.em=function(te,re,ae){ae===void 0&&(ae="");var le=this.rules.inline.em.start.exec(te);if(le&&(!le[1]||le[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){re=re.slice(-1*te.length);var pe=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.em.middle.exec(re.slice(0,le.index+2)),Ce)return{type:"em",raw:te.slice(0,Ce[0].length),text:te.slice(1,Ce[0].length-1)}}},de.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var ae=re[2].replace(/\n/g," "),le=/[^ ]/.test(ae),pe=ae.startsWith(" ")&&ae.endsWith(" ");return le&&pe&&(ae=ae.substring(1,ae.length-1)),ae=ne(ae,!0),{type:"codespan",raw:re[0],text:ae}}},de.br=function(te){var re=this.rules.inline.br.exec(te);if(re)return{type:"br",raw:re[0]}},de.del=function(te){var re=this.rules.inline.del.exec(te);if(re)return{type:"del",raw:re[0],text:re[1]}},de.autolink=function(te,re){var ae=this.rules.inline.autolink.exec(te);if(ae){var le,pe;return ae[2]==="@"?(le=ne(this.options.mangle?re(ae[1]):ae[1]),pe="mailto:"+le):(le=ne(ae[1]),pe=le),{type:"link",raw:ae[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.url=function(te,re){var ae;if(ae=this.rules.inline.url.exec(te)){var le,pe;if(ae[2]==="@")le=ne(this.options.mangle?re(ae[0]):ae[0]),pe="mailto:"+le;else{var Ce;do Ce=ae[0],ae[0]=this.rules.inline._backpedal.exec(ae[0])[0];while(Ce!==ae[0]);le=ne(ae[0]),ae[1]==="www."?pe="http://"+le:pe=le}return{type:"link",raw:ae[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.inlineText=function(te,re,ae){var le=this.rules.inline.text.exec(te);if(le){var pe;return re?pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ne(le[0]):le[0]:pe=ne(this.options.smartypants?ae(le[0]):le[0]),{type:"text",raw:le[0],text:pe}}},ge}(),Ee=$.noopTest,Te=$.edit,Se=$.merge,me={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ee,table:Ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Te(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Te(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Te(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=//,me.html=Te(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Te(me._paragraph).replace("hr",me.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",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.blockquote=Te(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=Se({},me),me.gfm=Se({},me.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*|$)"}),me.gfm.nptable=Te(me.gfm.nptable).replace("hr",me.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",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.gfm.table=Te(me.gfm.table).replace("hr",me.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",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.pedantic=Se({},me.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ee,paragraph:Te(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=Te(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Te(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Te(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Te(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Te(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Te(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Te(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Te(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Te(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Te(se._blockSkip,"g").getRegex(),se.overlapSkip=Te(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Te(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Te(se.tag).replace("comment",me._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Te(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Te(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Te(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Se({},se),se.pedantic=Se({},se.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",se._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Se({},se.normal,{escape:Te(se.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]*?(?:(?=[\\.5&&(te="x"+te.toString(16)),de+="&#"+te+";";return de}var Fe=function(){function ge(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||Ve,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:We.normal,inline:Je.normal};this.options.pedantic?(te.block=We.pedantic,te.inline=Je.pedantic):this.options.gfm&&(te.block=We.gfm,this.options.breaks?te.inline=Je.breaks:te.inline=Je.gfm),this.tokenizer.rules=te}ge.lex=function(te,re){var ae=new ge(re);return ae.lex(te)};var de=ge.prototype;return de.lex=function(te){return te=te.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(te,re,ae){re===void 0&&(re=[]),ae===void 0&&(ae=!0),te=te.replace(/^ +$/gm,"");for(var le,pe,Ce,Oe;te;){if(le=this.tokenizer.space(te)){te=te.substring(le.raw.length),le.type&&re.push(le);continue}if(le=this.tokenizer.code(te,re)){te=te.substring(le.raw.length),le.type?re.push(le):(Oe=re[re.length-1],Oe.raw+=` `+le.raw,Oe.text+=` `+le.text);continue}if(le=this.tokenizer.fences(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.heading(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.nptable(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.hr(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.blockquote(te)){te=te.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],ae),re.push(le);continue}if(le=this.tokenizer.list(te)){for(te=te.substring(le.raw.length),Ce=le.items.length,pe=0;pe0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)mt.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Ce=this.tokenizer.escape(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.tag(te,ae,le)){te=te.substring(Ce.raw.length),ae=Ce.inLink,le=Ce.inRawBlock,re.push(Ce);continue}if(Ce=this.tokenizer.link(te)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.strong(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ae,le),re.push(Ce);continue}if(Ce=this.tokenizer.em(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ae,le),re.push(Ce);continue}if(Ce=this.tokenizer.codespan(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.br(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.del(te)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ae,le),re.push(Ce);continue}if(Ce=this.tokenizer.autolink(te,De)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(!ae&&(Ce=this.tokenizer.url(te,De))){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.inlineText(te,le,qe)){te=te.substring(Ce.raw.length),pe=Ce.raw.slice(-1),re.push(Ce);continue}if(te){var ht="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return re},Y(ge,null,[{key:"rules",get:function(){return{block:We,inline:Je}}}]),ge}(),Be=H.defaults,$e=$.cleanUrl,Qe=$.escape,Me=function(){function ge(fe){this.options=fe||Be}var de=ge.prototype;return de.code=function(te,re,ae){var le=(re||"").match(/\S*/)[0];if(this.options.highlight){var pe=this.options.highlight(te,le);pe!=null&&pe!==te&&(ae=!0,te=pe)}return le?'
    '+(ae?te:Qe(te,!0))+`
    `:"
    "+(ae?te:Qe(te,!0))+`
    `},de.blockquote=function(te){return`
    `+te+`
    `},de.html=function(te){return te},de.heading=function(te,re,ae,le){return this.options.headerIds?"'+te+" `:""+te+" `},de.hr=function(){return this.options.xhtml?`
    `:`
    `},de.list=function(te,re,ae){var le=re?"ol":"ul",pe=re&&ae!==1?' start="'+ae+'"':"";return"<"+le+pe+`> `+te+" `},de.listitem=function(te){return"
  • "+te+`
  • `},de.checkbox=function(te){return" "},de.paragraph=function(te){return"

    "+te+`

    `},de.table=function(te,re){return re&&(re=""+re+""),` `+te+` `+re+`
    `},de.tablerow=function(te){return` `+te+` `},de.tablecell=function(te,re){var ae=re.header?"th":"td",le=re.align?"<"+ae+' align="'+re.align+'">':"<"+ae+">";return le+te+" `},de.strong=function(te){return""+te+""},de.em=function(te){return""+te+""},de.codespan=function(te){return""+te+""},de.br=function(){return this.options.xhtml?"
    ":"
    "},de.del=function(te){return""+te+""},de.link=function(te,re,ae){if(te=$e(this.options.sanitize,this.options.baseUrl,te),te===null)return ae;var le='",le},de.image=function(te,re,ae){if(te=$e(this.options.sanitize,this.options.baseUrl,te),te===null)return ae;var le=''+ae+'":">",le},de.text=function(te){return te},ge}(),He=function(){function ge(){}var de=ge.prototype;return de.strong=function(te){return te},de.em=function(te){return te},de.codespan=function(te){return te},de.del=function(te){return te},de.html=function(te){return te},de.text=function(te){return te},de.link=function(te,re,ae){return""+ae},de.image=function(te,re,ae){return""+ae},de.br=function(){return""},ge}(),rt=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(te){var re=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var ae=re;do this.seen[ae]++,re=ae+"-"+this.seen[ae];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},ge}(),st=H.defaults,Xe=$.unescape,Ye=function(){function ge(fe){this.options=fe||st,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new rt}ge.parse=function(te,re){var ae=new ge(re);return ae.parse(te)};var de=ge.prototype;return de.parse=function(te,re){re===void 0&&(re=!0);var ae="",le,pe,Ce,Oe,ot,mt,ht,Lt,At,ft,Ft,kt,Ht,It,xt,Mt,jt,lt,$t=te.length;for(le=0;le<$t;le++){ft=te[le];switch(ft.type){case"space":continue;case"hr":{ae+=this.renderer.hr();continue}case"heading":{ae+=this.renderer.heading(this.parseInline(ft.tokens),ft.depth,Xe(this.parseInline(ft.tokens,this.textRenderer)),this.slugger);continue}case"code":{ae+=this.renderer.code(ft.text,ft.lang,ft.escaped);continue}case"table":{for(Lt="",ht="",Oe=ft.header.length,pe=0;pe0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=lt+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=lt+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:lt}):It+=lt),It+=this.parse(xt.tokens,Ht),At+=this.renderer.listitem(It,jt,Mt);ae+=this.renderer.list(At,Ft,kt);continue}case"html":{ae+=this.renderer.html(ft.text);continue}case"paragraph":{ae+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(At=ft.tokens?this.parseInline(ft.tokens):ft.text;le+1<$t&&te[le+1].type==="text";)ft=te[++le],At+=` `+(ft.tokens?this.parseInline(ft.tokens):ft.text);ae+=re?this.renderer.paragraph(At):At;continue}default:{var ar='Token with "'+ft.type+'" type was not found.';if(this.options.silent){console.error(ar);return}else throw new Error(ar)}}}return ae},de.parseInline=function(te,re){re=re||this.renderer;var ae="",le,pe,Ce=te.length;for(le=0;leAn error occurred:

    "+it(Ce.message+"",!0)+"
    ";throw Ce}}we.options=we.setOptions=function(ge){return ct(we.defaults,ge),dt(we.defaults),we},we.getDefaults=Ae,we.defaults=at,we.use=function(ge){var de=ct({},ge);if(ge.renderer&&function(){var te=we.defaults.renderer||new Me,re=function(pe){var Ce=te[pe];te[pe]=function(){for(var Oe=arguments.length,ot=new Array(Oe),mt=0;mt`,triples:"",explode:"[]{}"},R=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(T,E,h){h&&h!=ie.Init&&(T.removeKeyMap(B),T.state.closeBrackets=null),E&&(_(Q(E,"pairs")),T.state.closeBrackets=E,T.addKeyMap(B))});function Q(T,E){return E=="pairs"&&typeof T=="string"?T:typeof T=="object"&&T[E]!=null?T[E]:Y[E]}var B={Backspace:O,Enter:M};function _(T){for(var E=0;E=0;u--){var A=o[u].head;T.replaceRange("",R(A.line,A.ch-1),R(A.line,A.ch+1),"+delete")}}function M(T){var E=U(T),h=E&&Q(E,"explode");if(!h||T.getOption("disableInput"))return ie.Pass;for(var o=T.listSelections(),u=0;u0;return{anchor:new R(T.anchor.line,T.anchor.ch+(E?-1:1)),head:new R(T.head.line,T.head.ch+(E?1:-1))}}function w(T,E){var h=U(T);if(!h||T.getOption("disableInput"))return ie.Pass;var o=Q(h,"pairs"),u=o.indexOf(E);if(u==-1)return ie.Pass;for(var d=Q(h,"closeBefore"),A=Q(h,"triples"),g=o.charAt(u+1)==E,m=T.listSelections(),L=u%2==0,x,p=0;p=0&&T.getRange(s,R(s.line,s.ch+3))==E+E+E?a="skipThree":a="skip";else if(g&&s.ch>1&&A.indexOf(E)>=0&&T.getRange(R(s.line,s.ch-2),s)==E+E){if(s.ch>2&&/\bstring/.test(T.getTokenTypeAt(R(s.line,s.ch-2))))return ie.Pass;a="addFour"}else if(g){var v=s.ch==0?" ":T.getRange(R(s.line,s.ch-1),s);if(!ie.isWordChar(y)&&v!=E&&!ie.isWordChar(v))a="both";else return ie.Pass}else if(L&&(y.length===0||/\s/.test(y)||d.indexOf(y)>-1))a="both";else return ie.Pass;if(!x)x=a;else if(x!=a)return ie.Pass}var C=u%2?o.charAt(u-1):E,P=u%2?E:o.charAt(u+1);T.operation(function(){if(x=="skip")T.execCommand("goCharRight");else if(x=="skipThree")for(var G=0;G<3;G++)T.execCommand("goCharRight");else if(x=="surround"){for(var V=T.getSelections(),G=0;G1&&arguments[1]!==void 0?arguments[1]:1,fe=He.length,te=0;te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(j).map(function(ne,ce){if(!B.isValidElement(ne)||!ne.type)return null;var ve=ne.type.isSelectOptGroup,Ie=ne.key,xe=ne.props,Ee=xe.children,Te=Object(H.a)(xe,["children"]);return ee||!ve?x(ne):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Ie===null?ce:Ie,"__"),label:Ie},Te),{},{options:p(Ee)})}).filter(function(ne){return ne})}var c=Z("2Qr1"),s=Z("qNPg"),a=Z("U8pU"),y=Z("Kwbf"),v=Z("WKfj");function C(j){var ee=j.mode,ne=j.options,ce=j.children,ve=j.backfill,Ie=j.allowClear,xe=j.placeholder,Ee=j.getInputElement,Te=j.showSearch,Se=j.onSearch,me=j.defaultOpen,se=j.autoFocus,ke=j.labelInValue,Ve=j.value,We=j.inputValue,Je=j.optionLabelProp,qe=ee==="multiple"||ee==="tags",De=Te!==void 0?Te:qe||ee==="combobox",Fe=ne||p(ce);if(Object(y.a)(ee!=="tags"||Fe.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var Be=Fe.some(function(Me){return Me.options?Me.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(y.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(ee!=="combobox"||!Je,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(ee==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(y.a)(ee==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(y.b)(ee!=="combobox"||!Ee||!Ie||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!De&&ee!=="combobox"&&ee!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!me||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ve!=null){var $e=Object(v.d)(Ve);Object(y.a)(!ke||$e.every(function(Me){return Object(a.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!qe||Array.isArray(Ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Qe=null;Object(L.a)(ce).some(function(Me){if(!B.isValidElement(Me)||!Me.type)return!1;var He=Me.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var rt=Object(L.a)(Me.props.children).every(function(st){return!B.isValidElement(st)||!Me.type||st.type.isSelectOption?!0:(Qe=st.type,!1)});return!rt}return Qe=He,!0}),Qe&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(y.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=C,G=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:p,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:P,fillOptionsWithMissingValue:c.a}),V=function(j){Object(R.a)(ne,j);var ee=Object(Q.a)(ne);function ne(){var ce;return Object(ie.a)(this,ne),ce=ee.apply(this,arguments),ce.selectRef=B.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(Y.a)(ne,[{key:"render",value:function(){return B.createElement(G,Object.assign({ref:this.selectRef},this.props))}}]),ne}(B.Component);V.Option=d,V.OptGroup=g;var $=V,z=Le.c=$},M8RZ:function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return O});var ie=Z("fWQN"),Y=Z("mtLc"),R=Z("yKVA"),Q=Z("879j"),B=Z("q1tI"),_=Z.n(B),H=Z("i8i4"),U=Z.n(H),O=function(M){Object(R.a)(w,M);var b=Object(Q.a)(w);function w(k){var D;Object(ie.a)(this,w),D=b.call(this,k);var T=window.document;return D.node=T.createElement("div"),T.body.appendChild(D.node),D}return Object(Y.a)(w,[{key:"render",value:function(){var D=this.props.children;return Object(H.createPortal)(D,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),w}(_.a.Component)},Nmxd:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3w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/rOs8lXPQtzODHhY+/9LEq0aCcV0M22wX21jge5yiwdwGVW+RuPZnGUVM9FkP+NlYesaIFcJ8s+TLM9UQDwY1JYOx6Y3QPLXRpNqPzEiHpJfBOAD8KgHjoJQs3VIh+Kzlj3zDCzp63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Pe,Le,Z){"use strict";var ie=Z("U8pU"),Y=Z("VTBJ"),R=Z("Ff2n"),Q=Z("q1tI"),B=Z("uciX"),_=Z("7ixt"),H=function(k){var D=k.overlay,T=k.prefixCls,E=k.id,h=k.overlayInnerStyle;return Q.createElement("div",{className:"".concat(T,"-inner"),id:E,role:"tooltip",style:h},typeof D=="function"?D():D)},U=H,O=function(k,D){var T=k.overlayClassName,E=k.trigger,h=E===void 0?["hover"]:E,o=k.mouseEnterDelay,u=o===void 0?0:o,d=k.mouseLeaveDelay,A=d===void 0?.1:d,g=k.overlayStyle,m=k.prefixCls,L=m===void 0?"rc-tooltip":m,x=k.children,p=k.onVisibleChange,c=k.afterVisibleChange,s=k.transitionName,a=k.animation,y=k.placement,v=y===void 0?"right":y,C=k.align,P=C===void 0?{}:C,G=k.destroyTooltipOnHide,V=G===void 0?!1:G,$=k.defaultVisible,z=k.getTooltipContainer,j=k.overlayInnerStyle,ee=Object(R.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(D,function(){return ne.current});var ce=Object(Y.a)({},ee);"visible"in k&&(ce.popupVisible=k.visible);var ve=function(){var Se=k.arrowContent,me=Se===void 0?null:Se,se=k.overlay,ke=k.id;return[Q.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},me),Q.createElement(U,{key:"content",prefixCls:L,id:ke,overlay:se,overlayInnerStyle:j})]},Ie=!1,xe=!1;if(typeof V=="boolean")Ie=V;else if(V&&Object(ie.a)(V)==="object"){var Ee=V.keepParent;Ie=Ee===!0,xe=Ee===!1}return Q.createElement(B.a,Object.assign({popupClassName:T,prefixCls:L,popup:ve,action:h,builtinPlacements:_.a,popupPlacement:v,ref:ne,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:p,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:$,destroyPopupOnHide:Ie,autoDestroy:xe,mouseLeaveDelay:A,popupStyle:g,mouseEnterDelay:u},ce),x)},M=Object(Q.forwardRef)(O),b=Le.a=M},Ohmc:function(Pe,Le,Z){Pe.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Pe,Le,Z){"use strict";var ie=Z("2qtc"),Y=Z("kLXV"),R=Z("rAM+"),Q=Z("miYZ"),B=Z("tsqr"),_=Z("9og8"),H=Z("tJVT"),U=Z("jrin"),O=Z("WmNS"),M=Z.n(O),b=Z("q1tI"),w=Z.n(b),k=Z("VrN/"),D=Z.n(k),T=Z("bdgK"),E=Z("p77/"),h=Z("Bd2K"),o=Z("ELLl"),u=Z("19Vz"),d=Z("lZu9"),A=Z("+NIl"),g=Z("kSUc"),m=Z("9Bee"),L=function(pe){var Ce=pe.value,Oe=Ce===void 0?"":Ce,ot=pe.className,mt=pe.showTextOnly,ht=pe.showLines,Lt=pe.style,At=Lt===void 0?{}:Lt,ft=Object(b.useMemo)(function(){return""},[Oe]);return w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{dangerouslySetInnerHTML:{__html:ft}}))},x=Z("0Owb"),p=Z("dejd"),c=Z("C+DQ"),s=Z("1vsH"),a=Z("m3rI"),y=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function v(pe){var Ce=pe.onActionCallback,Oe=pe.title,ot=pe.icon,mt=pe.actionName,ht=pe.className,Lt=ht===void 0?"":ht,At=pe.children;function ft(){Ce(mt)}return w.a.createElement("a",{title:Oe,className:Lt,onClick:ft},w.a.createElement("i",{className:"md-iconfont ".concat(ot)}),At)}var C=function(pe){var Ce=pe.watch,Oe=pe.showNullButton,ot=pe.onActionCallback,mt=pe.fullScreen,ht=pe.insertTemp,Lt=pe.hidetoolBar,At=pe.uuid,ft=pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(At,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ft=[].concat(y,[{title:"".concat(Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return w.a.createElement("ul",{className:"markdown-toolbar-container"},!Lt&&Ft.map(function(kt,Ht){return w.a.createElement("li",{key:Ht},kt.actionName?w.a.createElement(v,Object(x.a)({},kt,{onActionCallback:ot})):w.a.createElement("span",{className:"v-line"}))}),Oe?w.a.createElement("li",null,w.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},w.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ht&&w.a.createElement("li",null,w.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ht),onActionCallback:ot},w.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),w.a.createElement("li",{className:"btn-full-screen"},w.a.createElement(v,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},P=Z("M8RZ"),G=Z("+L6B"),V=Z("2/Rp"),$=Z("y8nQ"),z=Z("Vl3Y"),j=Z("5NDa"),ee=Z("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},ce=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function ot(mt){Ce(mt)}return w.a.createElement(z.a,Object(x.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},w.a.createElement(ee.a,null)),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},w.a.createElement(ee.a,null)),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},ve=Z("7ahc"),Ie=Z("HmJG"),xe=Z("BjJ7"),Ee=z.a.useForm,Te={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},me=function(pe){var Ce=pe.callback,Oe=pe.onCancel,ot=Ee(),mt=Object(H.a)(ot,1),ht=mt[0];function Lt(Ft){Ce(Ft)}function At(Ft,kt){if(Ft.status===-1){B.b.error(Ft.message);return}ht.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:kt.type})}function ft(Ft){var kt=Ft.target.files[0];ke(kt,At)}return w.a.createElement(z.a,Object(x.a)({form:ht},Se,{className:"upload-image-panel",onFinish:Lt}),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},w.a.createElement("div",{className:"flex-container"},w.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},w.a.createElement(ee.a,{style:Te})),w.a.createElement(se,{onFileChange:ft}))),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},w.a.createElement(ee.a,{style:{width:264}})),w.a.createElement(z.a.Item,{style:{textAlign:"right"}},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function se(pe){var Ce=pe.onFileChange;return w.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",w.a.createElement("input",{type:"file",onChange:Ce}))}function ke(pe,Ce){if(!pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Oe=new FormData;Oe.append("editormd-image-file",pe),Oe.append("file_param_name","editormd-image-file"),Oe.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(mt){Ce(JSON.parse(mt.target.responseText),pe)},!1),ot.addEventListener("error",function(mt){console.error(mt)},!1),ot.open("POST","".concat(xe.a,"/api/attachments.json")),ot.send(Oe)}var Ve=Z("giR+"),We=Z("fyUT"),Je=Z("7Kak"),qe=Z("9yH6"),De=qe.a.Group,Fe={margin:"0 8px"},Be=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function ot(mt){Ce(mt)}return w.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},w.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},w.a.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),w.a.createElement("span",{style:Fe},"\u884C\u6570"),w.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},w.a.createElement(We.a,null)),w.a.createElement("span",{style:Fe},"\u5217\u6570"),w.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},w.a.createElement(We.a,null))),w.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},w.a.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),w.a.createElement(z.a.Item,{name:"align"},w.a.createElement(De,null,w.a.createElement(qe.a,{value:"default"},w.a.createElement("i",{className:"fa fa-align-justify"})),w.a.createElement(qe.a,{value:"left"},w.a.createElement("i",{className:"fa fa-align-left"})),w.a.createElement(qe.a,{value:"center"},w.a.createElement("i",{className:"fa fa-align-center"})),w.a.createElement(qe.a,{value:"right"},w.a.createElement("i",{className:"fa fa-align-right"}))))),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},$e=Z("ErOA"),Qe=Z("7Cbv"),Me="link",He="upload-image",rt="code-block",st="add-table",Xe="------------",Ye={default:Xe,left:":".concat(Xe),center:":".concat(Xe,":"),right:"".concat(Xe,":")},ct=Z("9VGf"),nt,it;function Ae(){}var dt=0,at=1e4,we="\u2581",Ne=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ge(pe){return/^\d+$/.test(pe)?"".concat(pe,"px"):pe}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=de?"Cmd":"Ctrl",te=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],re=(nt={},Object(U.a)(nt,fe+"-B","bold"),Object(U.a)(nt,fe+"-I","italic"),nt),ae=(it={},Object(U.a)(it,Me,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(it,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(it,He,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(it,st,"\u6DFB\u52A0\u8868\u683C"),it),le=Le.a=function(pe){var Ce=pe.defaultValue,Oe=Ce===void 0?"":Ce,ot=pe.onChange,mt=pe.width,ht=mt===void 0?"100%":mt,Lt=pe.height,At=Lt===void 0?400:Lt,ft=pe.miniToolbar,Ft=ft===void 0?!1:ft,kt=pe.isFocus,Ht=kt===void 0?!1:kt,It=pe.watch,xt=pe.insertTemp,Mt=pe.mode,jt=Mt===void 0?"markdown":Mt,lt=pe.id,$t=lt===void 0?"markdown-editor-id":lt,ar=pe.showResizeBar,ir=ar===void 0?!1:ar,Mr=pe.noStorage,ti=Mr===void 0?!1:Mr,Xt=pe.showNullButton,yt=Xt===void 0?!1:Xt,ze=pe.hidetoolBar,Kt=ze===void 0?!1:ze,wt=pe.fullScreen,tr=wt===void 0?!1:wt,Ot=pe.onBlur,ur=pe.onCMBeforeChange,bt=pe.onFullScreen,ri=pe.className,Ge=ri===void 0?"":ri,Dt=pe.disablePaste,pi=Dt===void 0?!1:Dt,mi=pe.placeholder,gi=mi===void 0?"":mi,vi=pe.values,W=vi===void 0?"":vi,l=Object(b.useState)(null),f=Object(H.a)(l,2),I=f[0],J=f[1],F=Object(b.useState)(Oe),he=Object(H.a)(F,2),_e=he[0],Ze=he[1],gt=Object(b.useState)(It),Ue=Object(H.a)(gt,2),Ct=Ue[0],Gt=Ue[1],er=Object(b.useState)(tr),jr=Object(H.a)(er,2),Ar=jr[0],Tr=jr[1],Yr=Object(b.useState)(""),Ii=Object(H.a)(Yr,2),mr=Ii[0],zr=Ii[1],li=Object(b.useState)(0),ui=Object(H.a)(li,2),Wr=ui[0],Mi=ui[1],yi=Object(b.useState)(At),zi=Object(H.a)(yi,2),Ki=zi[0],Jr=zi[1],Qr=Object(b.useState)(!1),bi=Object(H.a)(Qr,2),hn=bi[0],Ei=bi[1],sr=Object(b.useRef)(Object(Qe.a)()),zt=Object(b.useRef)(!1),xr=Object(b.useRef)(),Bt=Object(b.useRef)(),dr=Object(b.useRef)(),Yt=Object(b.useRef)(),ii=Object(b.useRef)(),gr=function(){var vt=Object(_.a)(M.a.mark(function Rt(){var St,_t;return M.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object($e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:sr.current}});case 2:_t=Zt.sent,_t!=null&&(St=_t.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",I,Bt),_t.attachments.map(function(Ut){Ut.content_type.indexOf("image")>-1?I.replaceSelection("![,](/api/attachments/".concat(Ut.id,"?type=").concat(Ut.content_type,")")):Ut.content_type.indexOf("video")>-1?I.replaceSelection('')):Ut.content_type.indexOf("pdf")>-1?I.replaceSelection('
    ').concat(Ut.name,"")):I.replaceSelection("[".concat(Ut.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}));case 4:case"end":return Zt.stop()}},Rt)}));return function(){return vt.apply(this,arguments)}}();Object(b.useEffect)(function(){Ze(W),I==null||I.setValue(W)},[W]),Object(b.useEffect)(function(){bt==null||bt(Ar)},[Ar]),Object(b.useEffect)(function(){if(Bt.current){var vt=D.a.fromTextArea(Bt.current,{mode:jt,lineNumbers:!Ft,lineWrapping:!0,value:Oe,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&vt.focus();function Rt(St,_t){if(pi){_t.preventDefault();return}var Wt=_t.clipboardData;if(Wt){var Zt=Wt.types.toString(),Ut=Wt.items;if(Zt==="Files"||Wt.types.indexOf("Files")>-1){if(_t.preventDefault(),jt=="stex")return;try{var fr,Or=Ut[1];((fr=Ut[0])===null||fr===void 0?void 0:fr.kind)==="file"&&(Or=Ut[0]);var Nt=Or.getAsFile(),di=Nt.name.split(".").pop();ke(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection('')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Nt.name,"")):te.includes(di)?vt.replaceSelection('').concat(Nt.name,"")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Rt),vt.on("dragleave",function(St,_t){dr.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(St,_t){dr.current.classList.add("mouse-hover-md")}),vt.on("drop",function(St,_t){dr.current.classList.add("mouse-hover-md");var Wt;if(Wt=_t.dataTransfer.files,Wt.length>0){_t.preventDefault(),_t.stopPropagation();for(var Zt=function(Or){var Nt=Wt[Or],di=Nt.name.split(".").pop();ke(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection('')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Nt.name,"")):te.includes(di)?vt.replaceSelection('').concat(Nt.name,"")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},Ut=0;Ut0||Ut.target.offsetWidth>0)&&(Rr(),I.setSize("100%","100%"),I.refresh())}}catch(fr){Wt.e(fr)}finally{Wt.f()}});return St.observe(Bt.current.parentElement),St}if(I){var Rt=vt();return function(){Rt.unobserve(Bt.current.parentElement)}}},[I,Rr]),Object(b.useEffect)(function(){if(I){for(var vt=[],Rt=function(){var Ut=_t[St];Wt=Object(H.a)(Ut,2);var fr=Wt[0],Or=Wt[1],Nt=Object(U.a)({},fr,function(){Vi(Or)});vt.push(Nt),I.addKeyMap(Nt)},St=0,_t=Object.entries(re);St<_t.length;St++){var Wt;Rt()}return xr.current=setInterval(function(){zt.current&&gr()},4e3),function(){clearInterval(xr.current);var Zt=Object(R.a)(vt),Ut;try{for(Zt.s();!(Ut=Zt.n()).done;){var fr=Ut.value;I.removeKeyMap(fr)}}catch(Or){Zt.e(Or)}finally{Zt.f()}}}},[I]),Object(b.useEffect)(function(){tr!==Ar&&Tr(tr)},[tr]),Object(ct.a)(function(){if(!ti&&Wr>0){var vt=new Date().getTime(),Rt=window.sessionStorage.getItem($t);vt>=Wr+at&&(!Rt||Rt!==_e)&&(window.sessionStorage.setItem($t,_e),Ei(!0))}},at),Object(b.useEffect)(function(){Gt(It)},[I,It]),Object(b.useEffect)(function(){I&&(Ht&&I.focus())},[I,Ht]),Object(b.useEffect)(function(){if(Ct&&I){var vt=I.getScrollerElement();function Rt(St){var _t=St.target;if(ii.current){var Wt=_t.scrollTop/_t.scrollHeight;ii.current.scrollTop=ii.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Rt),function(){vt.removeEventListener("scroll",Rt)}}},[I,Ct]),Object(b.useEffect)(function(){if(I&&ur){function vt(Rt,St){ur(Rt,St)}return I.on("beforeChange",vt),function(){I.off("beforeChange",vt)}}},[I,ur]),Object(b.useEffect)(function(){if(I&&Ot){function vt(){Ot(I.getValue())}return I.on("blur",vt),function(){I.off("blur",vt)}}},[I,Ot]),Object(b.useEffect)(function(){if(I){function vt(Rt){var St=Rt.getValue();Ze(St),Mi(new Date().getTime()),Rt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(St)}return I.on("change",vt),function(){I.off("change",vt)}}},[I,ot]),Object(b.useEffect)(function(){I&&(Oe==null?(I.setValue(""),Ze("")):Oe!==I.getValue()&&(I.setValue(Oe),Ze(Oe),I.setCursor(I.lineCount(),0)))},[I,Oe]);var Vi=Object(b.useCallback)(function(vt){var Rt=I.getCursor(),St=I.getSelection(),_t=St.split(` `);switch(vt){case"bold":return I.replaceSelection("**"+St+"**"),St===""&&I.setCursor(Rt.line,Rt.ch+2),I.focus();case"italic":return I.replaceSelection("*"+St+"*"),St===""&&I.setCursor(Rt.line,Rt.ch+1),I.focus();case"code":return I.replaceSelection("`"+St+"`"),St===""&&I.setCursor(Rt.line,Rt.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+St+"$$`"),St===""&&I.setCursor(Rt.line,Rt.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+St+"\n```"),I.setCursor(Rt.line+1,St.length+1),I.focus();case"line-break":return I.replaceSelection(`
    `),I.focus();case"list-ul":return St===""?I.replaceSelection("- "+St):I.replaceSelection(_t.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(` `)),I.focus();case"list-ol":return St===""?I.replaceSelection("1. "+St):I.replaceSelection(_t.map(function(Wt,Zt){return Wt===""?"":"".concat(Zt+1,". ").concat(Wt)}).join(` `)),I.focus();case"add-null-ch":return St===""&&I.setCursor(Rt.line,Rt.ch+1),I.replaceSelection(we),I.focus();case"inster-template-1":return St===""&&I.setCursor(Rt.line,Rt.ch),I.replaceSelection(Ne),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Gt(!Ct),I.focus();case"trigger-full-screen":return Tr(!Ar),I.focus();case Me:zr(Me);return;case rt:zr(rt);return;case He:zr(He);return;case st:zr(st);return;default:throw new Error}},[I,Ct,Ar]),xi=Object(b.useCallback)(function(vt){zr("");switch(mr){case Me:var Rt=vt.title,St=vt.link;return I.replaceSelection("[".concat(Rt,"](").concat(St,")")),I.focus();case rt:var _t=vt.language,Wt=vt.content;return I.replaceSelection(["```"+_t,Wt,"```"].join(` `)),I.focus();case He:var Zt=vt.src,Ut=vt.alt;return Ut?I.replaceSelection("![ ".concat(Ut," ]( ").concat(Zt,' "').concat(Ut,'" )')):I.replaceSelection("![,](".concat(Zt,")")),I.focus();case st:for(var fr=vt.row,Or=vt.col,Nt=vt.align,di=` `,Vt=0;Vt300&&(fr=300);var Or=At+fr+"px";Jr(Or)}}return vt.addEventListener("mousedown",_t),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",_t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Wt)}}},[I,Yt]),Object(b.useEffect)(function(){Jr(At)},[At]);var ni=ge(ht),fn=ge(Ki),Zr={width:ni,height:fn},pn=Object(b.useMemo)(function(){if(Wr){var vt=new Date(Wr),Rt=vt.getHours(),St=vt.getMinutes(),_t=vt.getSeconds();return Rt=Rt<10?"0"+Rt:Rt,St=St<10?"0"+St:St,_t=_t<10?"0"+_t:_t,"".concat(Rt,":").concat(St,":").concat(_t)}return 0},[Wr]);function jn(){window.sessionStorage.removeItem($t),Ei(!1),Mi(0)}function Oi(){Ei(!1),Mi(0),I.setValue(window.sessionStorage.getItem($t))}function ua(vt,Rt){var St=I.getValue();St=St.replace(vt,Rt),Ze(St),I==null||I.setValue(St)}return w.a.createElement(b.Fragment,null,w.a.createElement("div",{className:"markdown-editor-wrapper",ref:dr},w.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Ct?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Ar?"full-screen":""),style:Zr},w.a.createElement(C,{insertTemp:xt,watch:Ct,fullScreen:Ar,showNullButton:yt,onActionCallback:Vi,hidetoolBar:Kt,uuid:sr.current,setOpenPhones:function(){zt.current=!0}}),w.a.createElement("div",{className:"markdown-editor-body"},w.a.createElement("div",{className:"codemirror-container"},w.a.createElement("textarea",{ref:Bt,placeholder:gi})),Ct?w.a.createElement("div",{ref:ii,className:"preview-container"},jt==="stex"&&w.a.createElement(L,{value:_e}),jt!=="stex"&&w.a.createElement(m.a,{edit:!0,value:_e,replaces:ua})):null))),ir?w.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,w.a.createElement(P.a,null,ae[mr]?w.a.createElement(Y.a,{centered:!0,title:ae[mr],visible:!0,onCancel:Ci,footer:null,className:"markdown-popup-form"},cn):null))}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AgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Pe,Le){/** * @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,ie,Y,R=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,H;(function(){var U=window,O=["break,continue,do,else,for,if,return,while"],M=[O,"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"],b=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],w=[b,"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"],k=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],D=[b,"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"],T="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",E=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",o=[O,"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=[O,"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"],d=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[w,D,k,E,h,o,u,d],g=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",L="kwd",x="com",p="typ",c="lit",s="pun",a="pln",y="tag",v="dec",C="src",P="atn",G="atv",V="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(De){for(var Fe=0,Be=!1,$e=!1,Qe=0,Me=De.length;Qe122||(te<65||fe>90||dt.push([Math.max(65,fe)|32,Math.min(te,90)|32]),te<97||fe>122||dt.push([Math.max(97,fe)&~32,Math.min(te,122)&~32]))}}dt.sort(function(pe,Ce){return pe[0]-Ce[0]||Ce[1]-pe[1]});for(var re=[],ae=[],Ne=0;Nele[0]&&(le[1]+1>le[0]&&we.push("-"),we.push(Xe(le[1])))}return we.push("]"),we.join("")}function ct(it){for(var Ae=it.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")),dt=Ae.length,at=[],we=0,Ne=0;we=2&&fe==="["?Ae[we]=Ye(ge):fe!=="\\"&&(Ae[we]=ge.replace(/[a-zA-Z]/g,function(ae){var le=ae.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ae.join("")}for(var nt=[],Qe=0,Me=De.length;Qe=0;)Be[nt.charAt(it)]=ct;var Ae=ct[1],dt=""+Ae;st.hasOwnProperty(dt)||(rt.push(Ae),st[dt]=null)}rt.push(/[\0-\uffff]/),$e=z(rt)})();var Qe=Fe.length,Me=function(He){for(var rt=He.sourceCode,st=He.basePos,Xe=He.sourceNode,Ye=[st,a],ct=0,nt=rt.match($e)||[],it={},Ae=0,dt=nt.length;Ae=5&&we.substring(0,5)==="lang-",ge&&!(Ne&&typeof Ne[1]=="string")&&(ge=!1,we=C),ge||(it[at]=we)}var te=ct;if(ct+=at.length,!ge)Ye.push(st+te,we);else{var re=Ne[1],ae=at.indexOf(re),le=ae+re.length;Ne[2]&&(le=at.length-Ne[2].length,ae=le-re.length);var pe=we.substring(5);ee(Xe,st+te,at.substring(0,ae),Me,Ye),ee(Xe,st+te+ae,re,se(pe,re),Ye),ee(Xe,st+te+le,at.substring(le),Me,Ye)}}He.decorations=Ye};return Me}function Ie(De){var Fe=[],Be=[];De.tripleQuotedStrings?Fe.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):De.multiLineStrings?Fe.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),De.verbatimStrings&&Be.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $e=De.hashComments;$e&&(De.cStyleComments?($e>1?Fe.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([x,/^#[^\r\n]*/,null,"#"])),De.cStyleComments&&(Be.push([x,/^\/\/[^\r\n]*/,null]),Be.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=De.regexLiterals;if(Qe){var Me=Qe>1?"":` \r`,He=Me?".":"[\\S\\s]",rt="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+He+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+$+"("+rt+")")])}var st=De.types;st&&Be.push([p,st]);var Xe=(""+De.keywords).replace(/^ | $/g,"");Xe.length&&Be.push([L,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([a,/^\s+/,null,` \r \xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return De.regexLiterals&&(Ye+="(?!s*/)"),Be.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[p,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(Ye),null]),ve(Fe,Be)}var xe=Ie({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(De,Fe,Be){for(var $e=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Me=De.ownerDocument,He=Me.createElement("li");De.firstChild;)He.appendChild(De.firstChild);var rt=[He];function st(Ae){var dt=Ae.nodeType;if(dt==1&&!$e.test(Ae.className))if(Ae.nodeName==="br")Xe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var at=Ae.firstChild;at;at=at.nextSibling)st(at);else if((dt==3||dt==4)&&Be){var we=Ae.nodeValue,Ne=we.match(Qe);if(Ne){var ge=we.substring(0,Ne.index);Ae.nodeValue=ge;var de=we.substring(Ne.index+Ne[0].length);if(de){var fe=Ae.parentNode;fe.insertBefore(Me.createTextNode(de),Ae.nextSibling)}Xe(Ae),ge||Ae.parentNode.removeChild(Ae)}}}function Xe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function dt(Ne,ge){var de=ge?Ne.cloneNode(!1):Ne,fe=Ne.parentNode;if(fe){var te=dt(fe,1),re=Ne.nextSibling;te.appendChild(de);for(var ae=re;ae;ae=re)re=ae.nextSibling,te.appendChild(ae)}return de}for(var at=dt(Ae.nextSibling,0),we;(we=at.parentNode)&&we.nodeType===1;)at=we;rt.push(at)}for(var Ye=0;Ye=fe&&(st+=2),Me>=te&&(ct+=2)}}finally{we&&(we.style.display=Ne)}}var Se={};function me(De,Fe){for(var Be=Fe.length;--Be>=0;){var $e=Fe[Be];Se.hasOwnProperty($e)?U.console&&console.warn("cannot override language handler %s",$e):Se[$e]=De}}function se(De,Fe){return De&&Se.hasOwnProperty(De)||(De=/^\s*]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),me(ve([[a,/^[\s]+/,null,` \r `],[G,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["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"]),me(ve([],[[G,/^[\s\S]+/]]),["uq.val"]),me(Ie({keywords:w,hashComments:!0,cStyleComments:!0,types:g}),["c","cc","cpp","cxx","cyc","m"]),me(Ie({keywords:"null,true,false"}),["json"]),me(Ie({keywords:D,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:g}),["cs"]),me(Ie({keywords:k,cStyleComments:!0}),["java"]),me(Ie({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),me(Ie({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),me(Ie({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),me(Ie({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),me(Ie({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),me(Ie({keywords:T,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),me(ve([],[[m,/^[\s\S]+/]]),["regex"]);function ke(De){var Fe=De.langExtension;try{var Be=j(De.sourceNode,De.pre),$e=Be.sourceCode;De.sourceCode=$e,De.spans=Be.spans,De.basePos=0,se(Fe,$e)(De),Te(De)}catch(Qe){U.console&&console.log(Qe&&Qe.stack||Qe)}}function Ve(De,Fe,Be){var $e=Be||!1,Qe=Fe||null,Me=document.createElement("div");Me.innerHTML="
    "+De+"
    ",Me=Me.firstChild,$e&&Ee(Me,$e,!0);var He={langExtension:Qe,numberLines:$e,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ke(He),Me.innerHTML}function We(De,Fe){var Be=Fe||document.body,$e=Be.ownerDocument||document;function Qe(de){return Be.getElementsByTagName(de)}for(var Me=[Qe("pre"),Qe("code"),Qe("xmp")],He=[],rt=0;rt=15&&(w=!1,O=!0);var m=u&&(M||w&&(g==null||g<12.11)),L=R||H&&U>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var p=function(e,t){var i=e.className,r=x(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function c(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return c(e).appendChild(t)}function a(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var S=0;S=t)return N+(t-S);N+=K-S,N+=i-N%i,S=K+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(N,t-n);if(n+=S-r,n+=i-n%i,r=S+1,n>=t)return r}}var me=[""];function se(e){for(;me.length<=e;)me.push(ke(me)+" ");return me[e]}function ke(e){return e[e.length-1]}function Ve(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||De.test(e))}function Be(e,t){return t?t.source.indexOf("\\w")>-1&&Fe(e)?!0:t.test(e):Fe(e)}function $e(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Qe=/[\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 Me(e){return e.charCodeAt(0)>=768&&Qe.test(e)}function He(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,S=r<0?Math.ceil(n):Math.floor(n);if(S==t)return e(S)?t:i;e(S)?i=S:t=S+r}}function st(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,S=0;St||t==i&&N.to==t)&&(r(Math.max(N.from,t),Math.min(N.to,i),N.level==1?"rtl":"ltr",S),n=!0)}n||r(t,i,"ltr")}var Xe=null;function Ye(e,t,i){var r;Xe=null;for(var n=0;nt)return n;S.to==t&&(S.from!=S.to&&i=="before"?r=n:Xe=n),S.from==t&&(S.from!=S.to&&i!="before"?r=n:Xe=n)}return r!=null?r:Xe}var ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(q){return q<=247?e.charAt(q):1424<=q&&q<=1524?"R":1536<=q&&q<=1785?t.charAt(q-1536):1774<=q&&q<=2220?"r":8192<=q&&q<=8203?"w":q==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,S=/[LRr]/,N=/[Lb1n]/,K=/[1n]/;function X(q,oe,ue){this.level=q,this.from=oe,this.to=ue}return function(q,oe){var ue=oe=="ltr"?"L":"R";if(q.length==0||oe=="ltr"&&!r.test(q))return!1;for(var be=q.length,ye=[],Re=0;Re-1&&(r[t]=n.slice(0,S).concat(n.slice(S+1)))}}}function we(e,t){var i=dt(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function fe(e){e.prototype.on=function(t,i){Ae(this,t,i)},e.prototype.off=function(t,i){at(this,t,i)}}function te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ae(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function le(e){te(e),re(e)}function pe(e){return e.target||e.srcElement}function Ce(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 Oe=function(){if(H&&U<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),ot;function mt(e){if(ot==null){var t=a("span","\u200B");s(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ot=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&U<8))}var i=ot?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ht;function Lt(e){if(ht!=null)return ht;var t=s(e,document.createTextNode("A\u062EA")),i=v(t,0,1).getBoundingClientRect(),r=v(t,1,2).getBoundingClientRect();return c(e),!i||i.left==i.right?!1:ht=r.right-i.right<3}var At=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` `,t);n==-1&&(n=e.length);var S=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),N=S.indexOf("\r");N!=-1?(i.push(S.slice(0,N)),t+=N+1):(i.push(S),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ft=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ft=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),kt=null;function Ht(e){if(kt!=null)return kt;var t=s(e,a("span","x")),i=t.getBoundingClientRect(),r=v(t,0,1).getBoundingClientRect();return kt=Math.abs(i.left-r.left)>1}var It={},xt={};function Mt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),It[e]=t}function jt(e,t){xt[e]=t}function lt(e){if(typeof e=="string"&&xt.hasOwnProperty(e))e=xt[e];else if(e&&typeof e.name=="string"&&xt.hasOwnProperty(e.name)){var t=xt[e.name];typeof t=="string"&&(t={name:t}),e=qe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $t(e,t){t=lt(t);var i=It[t.name];if(!i)return $t(e,"text/plain");var r=i(e,t);if(ar.hasOwnProperty(t.name)){var n=ar[t.name];for(var S in n){if(!n.hasOwnProperty(S))continue;r.hasOwnProperty(S)&&(r["_"+S]=r[S]),r[S]=n[S]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var N in t.modeProps)r[N]=t.modeProps[N];return r}var ar={};function ir(e,t){var i=ar.hasOwnProperty(e)?ar[e]:ar[e]={};j(t,i)}function Mr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function ti(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Xt(e,t,i){return e.startState?e.startState(t,i):!0}var yt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};yt.prototype.eol=function(){return this.pos>=this.string.length},yt.prototype.sol=function(){return this.pos==this.lineStart},yt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yt.prototype.next=function(){if(this.post},yt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yt.prototype.skipToEnd=function(){this.pos=this.string.length},yt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},yt.prototype.backUp=function(e){this.pos-=e},yt.prototype.column=function(){return this.lastColumnPos0?null:(S&&t!==!1&&(this.pos+=S[0].length),S)}},yt.prototype.current=function(){return this.string.slice(this.start,this.pos)},yt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},yt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},yt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ze(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],S=n.chunkSize();if(t=e.first&&ti?Ge(i,ze(e,i).text.length):f(t,ze(e,t.line).text.length)}function f(e,t){var i=e.ch;return i==null||i>t?Ge(e.line,t):i<0?Ge(e.line,0):e}function I(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},F.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}},F.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},F.fromSaved=function(e,t,i){return t instanceof J?new F(e,Mr(e.mode,t.state),i,t.lookAhead):new F(e,Mr(e.mode,t),i)},F.prototype.save=function(e){var t=e!==!1?Mr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function he(e,t,i,r){var n=[e.state.modeGen],S={};Ar(e,t.text,e.doc.mode,i,function(q,oe){return n.push(q,oe)},S,r);for(var N=i.state,K=function(q){i.baseTokens=n;var oe=e.state.overlays[q],ue=1,be=0;i.state=!0,Ar(e,t.text,oe.mode,i,function(ye,Re){for(var je=ue;beye&&n.splice(ue,1,ye,n[ue+1],Ke),ue+=2,be=Math.min(ye,Ke)}if(!Re)return;if(oe.opaque)n.splice(je,ue-je,ye,"overlay "+Re),ue=je+2;else for(;jee.options.maxHighlightLength&&Mr(e.doc.mode,r.state),S=he(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=S.styles,S.classes?t.styleClasses=S.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ze(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new F(r,!0,t);var S=Tr(e,t,i),N=S>r.first&&ze(r,S-1).stateAfter,K=N?F.fromSaved(r,N,S):new F(r,Xt(r.mode),S);return r.iter(S,t,function(X){gt(e,X.text,K);var q=K.line;X.stateAfter=q==t-1||q%5==0||q>=n.viewFrom&&qt.start)return S}throw new Error("Mode "+e.name+" failed to advance stream.")}var Gt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function er(e,t,i,r){var n=e.doc,S=n.mode,N;t=l(n,t);var K=ze(n,t.line),X=Ze(e,t.line,i),q=new yt(K.text,e.options.tabSize,X),oe;for(r&&(oe=[]);(r||q.pose.options.maxHighlightLength?(K=!1,N&>(e,t,r,oe.pos),oe.pos=t.length,ue=null):ue=jr(Ct(i,oe,r.state,be),S),be){var ye=be[0].name;ye&&(ue="m-"+(ue?ye+" "+ue:ye))}if(!K||q!=ue){for(;XN;--K){if(K<=S.first)return S.first;var X=ze(S,K-1),q=X.stateAfter;if(q&&(!i||K+(q instanceof J?q.lookAhead:0)<=S.modeFrontier))return K;var oe=ee(X.text,null,e.options.tabSize);(n==null||r>oe)&&(n=K-1,r=oe)}return n}function Yr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;r--){var n=ze(e,r).stateAfter;if(n&&(!(n instanceof J)||r+n.lookAhead=t:S.to>t);(r||(r=[])).push(new ui(N,S.from,X?null:S.to))}}return r}function Ki(e,t,i){var r;if(e)for(var n=0;n=t:S.to>t);if(K||S.from==t&&N.type=="bookmark"&&(!i||S.marker.insertLeft)){var X=S.from==null||(N.inclusiveLeft?S.from<=t:S.from0&&K)for(var pt=0;pt0)continue;var oe=[X,1],ue=Dt(q.from,K.from),be=Dt(q.to,K.to);(ue<0||!N.inclusiveLeft&&!ue)&&oe.push({from:q.from,to:K.from}),(be>0||!N.inclusiveRight&&!be)&&oe.push({from:K.to,to:q.to}),n.splice.apply(n,oe),X+=oe.length-3}return n}function hn(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!r||xr(r,S.marker)<0)&&(r=S.marker)}return r}function gr(e,t,i,r,n){var S=ze(e,t),N=mr&&S.markedSpans;if(N)for(var K=0;K=0&&ue<=0||oe<=0&&ue>=0)continue;if(oe<=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?Dt(q.to,i)>=0:Dt(q.to,i)>0)||oe>=0&&(X.marker.inclusiveRight&&n.inclusiveLeft?Dt(q.from,r)<=0:Dt(q.from,r)<0))return!0}}function Rr(e){for(var t;t=dr(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Yt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function cn(e,t){var i=ze(e,t),r=Rr(i);return i==r?t:Ot(r)}function Ci(e,t){if(t>e.lastLine())return t;var i=ze(e,t),r;if(!ni(e,i))return t;for(;r=Yt(i);)i=r.find(1,!0).line;return Ot(i)+1}function ni(e,t){var i=mr&&t.markedSpans;if(i)for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Oi=function(e,t,i){this.text=e,Ei(this,t),this.height=i?i(this):1};Oi.prototype.lineNo=function(){return Ot(this)},fe(Oi);function ua(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),hn(e),Ei(e,i);var n=r?r(e):1;n!=e.height&&tr(e,n)}function vt(e){e.parent=null,hn(e)}var Rt={},St={};function _t(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?St:Rt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Wt(e,t){var i=y("span",null,null,O?"padding-right: .1px":null),r={pre:y("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var S=n?t.rest[n-1]:t.line,N=void 0;r.pos=0,r.addToken=Ut,Lt(e.display.measure)&&(N=nt(S,e.doc.direction))&&(r.addToken=Or(r.addToken,N)),r.map=[];var K=t!=e.display.externalMeasured&&Ot(S);di(S,r,_e(e,S,K)),S.styleClasses&&(S.styleClasses.bgClass&&(r.bgClass=V(S.styleClasses.bgClass,r.bgClass||"")),S.styleClasses.textClass&&(r.textClass=V(S.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mt(e.display.measure))),n==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(O){var X=r.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return we(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=V(r.pre.className,r.textClass||"")),r}function Zt(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ut(e,t,i,r,n,S,N){if(!t)return;var K=e.splitSpaces?fr(t,e.trailingSpace):t,X=e.cm.state.specialChars,q=!1,oe;if(!X.test(t))e.col+=t.length,oe=document.createTextNode(K),e.map.push(e.pos,e.pos+t.length,oe),H&&U<9&&(q=!0),e.pos+=t.length;else{oe=document.createDocumentFragment();for(var ue=0;;){X.lastIndex=ue;var be=X.exec(t),ye=be?be.index-ue:t.length-ue;if(ye){var Re=document.createTextNode(K.slice(ue,ue+ye));H&&U<9?oe.appendChild(a("span",[Re])):oe.appendChild(Re),e.map.push(e.pos,e.pos+ye,Re),e.col+=ye,e.pos+=ye}if(!be)break;ue+=ye+1;var je=void 0;if(be[0]==" "){var Ke=e.cm.options.tabSize,et=Ke-e.col%Ke;je=oe.appendChild(a("span",se(et),"cm-tab")),je.setAttribute("role","presentation"),je.setAttribute("cm-text"," "),e.col+=et}else be[0]=="\r"||be[0]==` `?(je=oe.appendChild(a("span",be[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),je.setAttribute("cm-text",be[0]),e.col+=1):(je=e.cm.options.specialCharPlaceholder(be[0]),je.setAttribute("cm-text",be[0]),H&&U<9?oe.appendChild(a("span",[je])):oe.appendChild(je),e.col+=1);e.map.push(e.pos,e.pos+1,je),e.pos++}}if(e.trailingSpace=K.charCodeAt(t.length-1)==32,i||r||n||q||S||N){var ut=i||"";r&&(ut+=r),n&&(ut+=n);var tt=a("span",[oe],ut,S);if(N)for(var pt in N)N.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&&tt.setAttribute(pt,N[pt]);return e.content.appendChild(tt)}e.content.appendChild(oe)}function fr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nq&&ue.from<=q);be++);if(ue.to>=oe)return e(i,r,n,S,N,K,X);e(i,r.slice(0,ue.to-q),n,S,null,K,X),S=null,r=r.slice(ue.to-q),q=ue.to}}}function Nt(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function di(e,t,i){var r=e.markedSpans,n=e.text,S=0;if(!r){for(var N=1;NX||Pt.collapsed&&Et.to==X&&Et.from==X)){if(Et.to!=null&&Et.to!=X&&ye>Et.to&&(ye=Et.to,je=""),Pt.className&&(Re+=" "+Pt.className),Pt.css&&(be=(be?be+";":"")+Pt.css),Pt.startStyle&&Et.from==X&&(Ke+=" "+Pt.startStyle),Pt.endStyle&&Et.to==ye&&(pt||(pt=[])).push(Pt.endStyle,Et.to),Pt.title&&((ut||(ut={})).title=Pt.title),Pt.attributes)for(var qt in Pt.attributes)(ut||(ut={}))[qt]=Pt.attributes[qt];Pt.collapsed&&(!et||xr(et.marker,Pt)<0)&&(et=Et)}else Et.from>X&&ye>Et.from&&(ye=Et.from)}if(pt)for(var br=0;br=K)break;for(var Gr=Math.min(K,ye);;){if(oe){var Nr=X+oe.length;if(!et){var hr=Nr>Gr?oe.slice(0,Gr-X):oe;t.addToken(t,hr,ue?ue+Re:Re,Ke,X+hr.length==ye?je:"",be,ut)}if(Nr>=Gr){oe=oe.slice(Gr-X),X=Gr;break}X=Nr,Ke=""}oe=n.slice(S,S=i[q++]),ue=_t(i[q++],t.cm.options)}}}function Vt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Ot(ke(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function Pr(e,t,i){for(var r=[],n,S=t;S2&&S.push((X.bottom+q.top)/2-i.top)}}S.push(i.bottom-i.top)}}function eo(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Fs(e,t){t=Rr(t);var i=Ot(t),r=e.display.externalMeasured=new Vt(e.doc,t,i);r.lineN=i;var n=r.built=Wt(e,r);return r.text=n.pre,s(e.display.lineMeasure,n.pre),r}function to(e,t,i,r){return oi(e,Qi(e,t),i,r)}function fa(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(S=X-K,n=S-1,t>=X&&(N="right")),n!=null){if(r=e[q+2],K==X&&i==(r.insertLeft?"left":"right")&&(N=i),i=="left"&&n==0)for(;q&&e[q-2]==e[q-3]&&e[q-1].insertLeft;)r=e[(q-=3)+2],N="left";if(i=="right"&&n==X-K)for(;q=0&&!((i=e[n]).left!=i.right);n--);return i}function Ws(e,t,i,r){var n=io(t.map,i,r),S=n.node,N=n.start,K=n.end,X=n.collapse,q;if(S.nodeType==3){for(var oe=0;oe<4;oe++){for(;N&&Me(t.line.text.charAt(n.coverStart+N));)--N;for(;n.coverStart+K0&&(X=r="right");var ue;e.options.lineWrapping&&(ue=S.getClientRects()).length>1?q=ue[r=="right"?ue.length-1:0]:q=S.getBoundingClientRect()}if(H&&U<9&&!N&&(!q||!q.left&&!q.right)){var be=S.parentNode.getClientRects()[0];be?q={left:be.left,right:be.left+Yi(e.display),top:be.top,bottom:be.bottom}:q=ro}for(var ye=q.top-t.rect.top,Re=q.bottom-t.rect.top,je=(ye+Re)/2,Ke=t.view.measure.heights,et=0;et=r.text.length?(X=r.text.length,q="before"):X<=0&&(X=0,q="after"),!K)return N(q=="before"?X-1:X,q=="before");function oe(Re,je,Ke){var et=K[je],ut=et.level==1;return N(Ke?Re-1:Re,ut!=Ke)}var ue=Ye(K,X,q),be=Xe,ye=oe(X,ue,q=="before");return be!=null&&(ye.other=oe(X,be,q!="before")),ye}function uo(e,t){var i=0;t=l(e.doc,t),e.options.lineWrapping||(i=Yi(e.display)*t.ch);var r=ze(e.doc,t.line),n=Zr(r)+Wn(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function ga(e,t,i,r,n){var S=Ge(e,t,i);return S.xRel=n,r&&(S.outside=r),S}function va(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ga(r.first,0,null,-1,-1);var n=ur(r,i),S=r.first+r.size-1;if(n>S)return ga(r.first+r.size-1,ze(r,S).text.length,null,1,1);t<0&&(t=0);for(var N=ze(r,n);;){var K=Gs(e,N,n,t,i),X=ii(N,K.ch+(K.xRel>0||K.outside>0?1:0));if(!X)return K;var q=X.find(1);if(q.line==n)return q;N=ze(r,n=q.line)}}function ho(e,t,i,r){r-=pa(t);var n=t.text.length,S=rt(function(N){return oi(e,i,N-1).bottom<=r},n,0);return n=rt(function(N){return oi(e,i,N).top>r},S,n),{begin:S,end:n}}function co(e,t,i,r){i||(i=Qi(e,t));var n=Hn(e,t,oi(e,i,r),"line").top;return ho(e,t,i,n)}function ya(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Gs(e,t,i,r,n){n-=Zr(t);var S=Qi(e,t),N=pa(t),K=0,X=t.text.length,q=!0,oe=nt(t,e.doc.direction);if(oe){var ue=(e.options.lineWrapping?Ks:zs)(e,t,i,S,oe,r,n);q=ue.level!=1,K=q?ue.from:ue.to-1,X=q?ue.to:ue.from-1}var be=null,ye=null,Re=rt(function(Tt){var Et=oi(e,S,Tt);return Et.top+=N,Et.bottom+=N,ya(Et,r,n,!1)?(Et.top<=n&&Et.left<=r&&(be=Tt,ye=Et),!0):!1},K,X),je,Ke,et=!1;if(ye){var ut=r-ye.left=pt.bottom?1:0}return Re=He(t.text,Re,1),ga(i,Re,Ke,et,r-je)}function zs(e,t,i,r,n,S,N){var K=rt(function(ue){var be=n[ue],ye=be.level!=1;return ya(qr(e,Ge(i,ye?be.to:be.from,ye?"before":"after"),"line",t,r),S,N,!0)},0,n.length-1),X=n[K];if(K>0){var q=X.level!=1,oe=qr(e,Ge(i,q?X.from:X.to,q?"after":"before"),"line",t,r);ya(oe,S,N,!0)&&oe.top>N&&(X=n[K-1])}return X}function Ks(e,t,i,r,n,S,N){var K=ho(e,t,r,N),X=K.begin,q=K.end;/\s/.test(t.text.charAt(q-1))&&q--;for(var oe=null,ue=null,be=0;be=q||ye.to<=X)continue;var Re=ye.level!=1,je=oi(e,r,Re?Math.min(q,ye.to)-1:Math.max(X,ye.from)).right,Ke=jeKe)&&(oe=ye,ue=Ke)}return oe||(oe=n[n.length-1]),oe.fromq&&(oe={from:oe.from,to:q,level:oe.level}),oe}var _i;function Xi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_i==null){_i=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)_i.appendChild(document.createTextNode("x")),_i.appendChild(a("br"));_i.appendChild(document.createTextNode("x"))}s(e.measure,_i);var i=_i.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),c(e.measure),i||1}function Yi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),i=a("pre",[t],"CodeMirror-line-like");s(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function ba(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,S=t.gutters.firstChild,N=0;S;S=S.nextSibling,++N){var K=e.display.gutterSpecs[N].className;i[K]=S.offsetLeft+S.clientLeft+n,r[K]=S.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function fo(e){var t=Xi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Yi(e.display)-3);return function(n){if(ni(e.doc,n))return 0;var S=0;if(n.widgets)for(var N=0;N0&&(q=ze(e.doc,X.line).text).length==X.ch){var oe=ee(q,q.length,e.options.tabSize)-q.length;X=Ge(X.line,Math.max(0,Math.round((S-$a(e.display).left)/Yi(e.display))-oe))}return X}function Ni(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)mr&&cn(e.doc,t)n.viewFrom?Ai(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ai(e);else if(t<=n.viewFrom){var S=Gn(e,i,i+r,1);S?(n.view=n.view.slice(S.index),n.viewFrom=S.lineN,n.viewTo+=r):Ai(e)}else if(i>=n.viewTo){var N=Gn(e,t,t,-1);N?(n.view=n.view.slice(0,N.index),n.viewTo=N.lineN):Ai(e)}else{var K=Gn(e,t,t,-1),X=Gn(e,i,i+r,1);K&&X?(n.view=n.view.slice(0,K.index).concat(Pr(e,K.lineN,X.lineN)).concat(n.view.slice(X.index)),n.viewTo+=r):Ai(e)}var q=n.externalMeasured;q&&(i=n.lineN&&t=r.viewTo)return;var S=r.view[Ni(e,t)];if(S.node==null)return;var N=S.changes||(S.changes=[]);ce(N,i)==-1&&N.push(i)}function Ai(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gn(e,t,i,r){var n=Ni(e,t),S,N=e.display.view;if(!mr||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var K=e.display.viewFrom,X=0;X0){if(n==N.length-1)return null;S=K+N[n].size-t,n++}else S=K-t;t+=S,i+=S}for(;cn(e.doc,i)!=i;){if(n==(r<0?0:N.length-1))return null;i+=r*N[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Vs(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Pr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Pr(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,Ni(e,i)))),r.viewTo=i}function po(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||K.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ji(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Sa(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ji(e))},100)}function Sa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(we(e,"focus",e,t),e.state.focused=!0,G(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ca(e)}function Ji(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(we(e,"blur",e,t),e.state.focused=!1,p(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Kn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r.005||oe<-.005)&&(tr(n.line,N),bo(n.line),n.rest))for(var ue=0;uee.display.sizerWidth){var be=Math.ceil(K/Yi(e.display));be>e.display.maxLineLength&&(e.display.maxLineLength=be,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}function bo(e){if(e.widgets)for(var t=0;t=N&&(S=ur(t,Zr(ze(t,X))-e.wrapper.clientHeight),N=X)}return{from:S,to:Math.max(N,S+1)}}function Xs(e,t){if(Ne(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),n=null;if(t.top+r.top<0?n=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),n!=null&&!T){var S=a("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Wn(e.display))+`px; height: `+(t.bottom-t.top+ai(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(S),S.scrollIntoView(n),e.display.lineSpace.removeChild(S)}}function Ys(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(t=t.ch?Ge(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ge(t.line,t.ch+1,"before"):t);for(var S=0;S<5;S++){var N=!1,K=qr(e,t),X=!i||i==t?K:qr(e,i);n={left:Math.min(K.left,X.left),top:Math.min(K.top,X.top)-r,right:Math.max(K.left,X.left),bottom:Math.max(K.bottom,X.bottom)+r};var q=Aa(e,n),oe=e.doc.scrollTop,ue=e.doc.scrollLeft;if(q.scrollTop!=null&&(xn(e,q.scrollTop),Math.abs(e.doc.scrollTop-oe)>1&&(N=!0)),q.scrollLeft!=null&&(Ui(e,q.scrollLeft),Math.abs(e.doc.scrollLeft-ue)>1&&(N=!0)),!N)break}return n}function Js(e,t){var i=Aa(e,t);i.scrollTop!=null&&xn(e,i.scrollTop),i.scrollLeft!=null&&Ui(e,i.scrollLeft)}function Aa(e,t){var i=e.display,r=Xi(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,S=ca(e),N={};t.bottom-t.top>S&&(t.bottom=t.top+S);var K=e.doc.height+ha(i),X=t.topK-r;if(t.topn+S){var oe=Math.min(t.top,(q?K:t.bottom)-S);oe!=n&&(N.scrollTop=oe)}var ue=e.options.fixedGutter?0:i.gutters.offsetWidth,be=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-ue,ye=Pi(e)-i.gutters.offsetWidth,Re=t.right-t.left>ye;return Re&&(t.right=t.left+ye),t.left<10?N.scrollLeft=0:t.leftye+be-3&&(N.scrollLeft=t.right+(Re?0:10)-ye),N}function Ta(e,t){if(t==null)return;Qn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Zi(e){Qn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function En(e,t,i){(t!=null||i!=null)&&Qn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Qn(e),e.curOp.scrollToPos=t}function Qn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=uo(e,t.from),r=uo(e,t.to);Eo(e,i,r,t.margin)}}function Eo(e,t,i,r){var n=Aa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});En(e,n.scrollLeft,n.scrollTop)}function xn(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||Da(e,{top:t}),xo(e,t,!0),R&&Da(e),An(e,100)}function xo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ui(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,wo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cn(e){var t=e.display,i=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?i:0,docHeight:r,scrollHeight:r+ai(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Fi=function(e,t,i){this.cm=i;var r=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),Ae(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ae(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var S=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+S)+"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:i?r:0,bottom:t?r:0}},Fi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fi.prototype.zeroWidthHack=function(){var e=u&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},Fi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),S=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);S!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Fi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sn=function(){};Sn.prototype.update=function(){return{bottom:0,right:0}},Sn.prototype.setScrollLeft=function(){},Sn.prototype.setScrollTop=function(){},Sn.prototype.clear=function(){};function qi(e,t){t||(t=Cn(e));var i=e.display.barWidth,r=e.display.barHeight;Co(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Kn(e),Co(e,Cn(e)),i=e.display.barWidth,r=e.display.barHeight}function Co(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var So={native:Fi,null:Sn};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&p(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new So[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ae(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ui(e,t):xn(e,t)},e),e.display.scrollbars.addClass&&G(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function ji(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},Xr(e.curOp)}function Wi(e){var t=e.curOp;t&&Is(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&wa(e.cm,e.update)}function rl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Kn(t),e.barMeasure=Cn(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+ai(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Pi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,r=Ze(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(S){if(r.line>=e.display.viewFrom){var N=S.styles,K=S.text.length>e.options.maxHighlightLength?Mr(t.mode,r.state):null,X=he(e,S,r,!0);K&&(r.state=K),S.styles=X.styles;var q=S.styleClasses,oe=X.classes;oe?S.styleClasses=oe:q&&(S.styleClasses=null);for(var ue=!N||N.length!=S.styles.length||q!=oe&&(!q||!oe||q.bgClass!=oe.bgClass||q.textClass!=oe.textClass),be=0;!ue&&bei)return An(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&Hr(e,function(){for(var S=0;S=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&po(e)==0)return!1;Do(e)&&(Ai(e),t.dims=ba(e));var n=r.first+r.size,S=Math.max(t.visible.from-e.options.viewportMargin,r.first),N=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFromN&&i.viewTo-N<20&&(N=Math.min(n,i.viewTo)),mr&&(S=cn(e.doc,S),N=Ci(e.doc,N));var K=S!=i.viewFrom||N!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,S,N),i.viewOffset=Zr(ze(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var X=po(e);if(!K&&X==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var q=sl(e);return X>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),X>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(q),c(i.cursorDiv),c(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,K&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,An(e,400)),i.updateLineNumbers=null,!0}function To(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ha(e.display)-ca(e),i.top)}),t.visible=Vn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,i));if(!wa(e,t))break;Kn(e);var n=Cn(e);bn(e),qi(e,n),Ra(e,n),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 i=new Xn(e,t);if(wa(e,i)){Kn(e),To(e,i);var r=Cn(e);bn(e),qi(e,r),Ra(e,r),i.finish()}}function ul(e,t,i){var r=e.display,n=e.options.lineNumbers,S=r.lineDiv,N=S.firstChild;function K(Re){var je=Re.nextSibling;return O&&u&&e.display.currentWheelTarget==Re?Re.style.display="none":Re.parentNode.removeChild(Re),je}for(var X=r.view,q=r.viewFrom,oe=0;oe-1&&(ye=!1),Xa(e,ue,q,i)),ye&&(c(ue.lineNumber),ue.lineNumber.appendChild(document.createTextNode(ri(e.options,q)))),N=ue.node.nextSibling}q+=ue.size}for(;N;)N=K(N)}function La(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ra(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ai(e)+"px"}function wo(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,S=r+"px",N=0;NN.clientWidth,X=N.scrollHeight>N.clientHeight;if(!(r&&K||n&&X))return;if(n&&u&&O){e:for(var q=t.target,oe=S.view;q!=N;q=q.parentNode)for(var ue=0;ue=0&&Dt(e,r.to())<=0)return i}return-1};var Qt=function(e,t){this.anchor=e,this.head=t};Qt.prototype.from=function(){return vi(this.anchor,this.head)},Qt.prototype.to=function(){return gi(this.anchor,this.head)},Qt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function $r(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(be,ye){return Dt(be.from(),ye.from())}),i=ce(t,n);for(var S=1;S0:X>=0){var q=vi(K.from(),N.from()),oe=gi(K.to(),N.to()),ue=K.empty()?N.from()==N.head:K.from()==K.head;S<=i&&--i,t.splice(--S,2,new Qt(ue?oe:q,ue?q:oe))}}return new Vr(t,i)}function Ti(e,t){return new Vr([new Qt(e,t||e)],0)}function wi(e){return e.text?Ge(e.from.line+e.text.length-1,ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Io(e,t){if(Dt(e,t.from)<0)return e;if(Dt(e,t.to)<=0)return wi(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),Ge(i,r)}function Ia(e,t){for(var i=[],r=0;r1&&e.remove(K.line+1,Re-1),e.insert(K.line+1,et)}Cr(e,"change",e,t)}function Di(e,t,i){function r(n,S,N){if(n.linked)for(var K=0;K1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ke(e.done)}function No(e,t,i,r){var n=e.history;n.undone.length=0;var S=+new Date,N,K;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>S-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(N=pl(n,n.lastOp==r)))K=ke(N.changes),Dt(t.from,t.to)==0&&Dt(t.from,K.to)==0?K.to=wi(t):N.changes.push(Pa(e,t));else{var X=ke(n.done);for((!X||!X.ranges)&&Zn(e.sel,n.done),N={changes:[Pa(e,t)],generation:n.generation},n.done.push(N);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=S,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,K||we(e,"historyAdded")}function ml(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var n=e.history,S=r&&r.origin;i==n.lastSelOp||S&&n.lastSelOrigin==S&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==S||ml(e,S,ke(n.done),t))?n.done[n.done.length-1]=t:Zn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=S,n.lastSelOp=i,r&&r.clearRedo!==!1&&Bo(n.undone)}function Zn(e,t){var i=ke(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Uo(e,t,i,r){var n=t["spans_"+e.id],S=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(N){N.markedSpans&&((n||(n=t["spans_"+e.id]={}))[S]=N.markedSpans),++S})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(ke(K)[ue]=q[ue],delete q[ue]))}}return r}function _a(e,t,i,r){if(r){var n=e.anchor;if(i){var S=Dt(t,n)<0;S!=Dt(i,n)<0?(n=t,t=i):S!=Dt(t,i)<0&&(t=i)}return new Qt(n,t)}else return new Qt(i||t,t)}function qn(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Dr(e,new Vr([_a(e.sel.primary(),t,i,n)],0),r)}function jo(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),S=0;S=t.ch:K.to>t.ch))){if(n&&(we(X,"beforeCursorEnter"),X.explicitlyCleared))if(S.markedSpans){--N;continue}else break;if(!X.atomic)continue;if(i){var ue=X.find(r<0?1:-1),be=void 0;if((r<0?oe:q)&&(ue=Vo(e,ue,-r,ue&&ue.line==t.line?S:null)),ue&&ue.line==t.line&&(be=Dt(ue,i))&&(r<0?be<0:be>0))return en(e,ue,t,r,n)}var ye=X.find(r<0?-1:1);return(r<0?q:oe)&&(ye=Vo(e,ye,r,ye.line==t.line?S:null)),ye?en(e,ye,t,r,n):null}}return t}function ea(e,t,i,r,n){var S=r||1,N=en(e,t,i,S,n)||!n&&en(e,t,i,S,!0)||en(e,t,i,-S,n)||!n&&en(e,t,i,-S,!0);return N||(e.cantEdit=!0,Ge(e.first,0))}function Vo(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?l(e,Ge(t.line-1)):null:i>0&&t.ch==(r||ze(e,t.line)).text.length?t.line=0;--n)Yo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Yo(e,t)}function Yo(e,t){if(t.text.length==1&&t.text[0]==""&&Dt(t.from,t.to)==0)return;var i=Ia(e,t);No(e,t,i,e.cm?e.cm.curOp.id:NaN),Dn(e,t,i,Jr(e,t));var r=[];Di(e,function(n,S){!S&&ce(r,n.history)==-1&&($o(n.history,t),r.push(n.history)),Dn(n,t,null,Jr(n,t))})}function ta(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var n=e.history,S,N=e.sel,K=t=="undo"?n.done:n.undone,X=t=="undo"?n.undone:n.done,q=0;q=0;--ye){var Re=be(ye);if(Re)return Re.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vr(Ve(e.sel.ranges,function(n){return new Qt(Ge(n.anchor.line+t,n.anchor.ch),Ge(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm){_r(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())return;if(t.from.lineS&&(t={from:t.from,to:Ge(S,ze(e,S).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Kt(e,t.from,t.to),i||(i=Ia(e,t)),e.cm?El(e.cm,t,r):Oa(e,t,r),$n(e,i,xe),e.cantEdit&&ea(e,Ge(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,n=e.display,S=t.from,N=t.to,K=!1,X=S.line;e.options.lineWrapping||(X=Ot(Rr(ze(r,S.line))),r.iter(X,N.line+1,function(ye){if(ye==n.maxLine)return K=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ge(e),Oa(r,t,i,fo(e)),e.options.lineWrapping||(r.iter(X,S.line+t.text.length,function(ye){var Re=pn(ye);Re>n.maxLineLength&&(n.maxLine=ye,n.maxLineLength=Re,n.maxLineChanged=!0,K=!1)}),K&&(e.curOp.updateMaxLine=!0)),Yr(r,S.line),An(e,400);var q=t.text.length-(N.line-S.line)-1;t.full?_r(e):S.line==N.line&&t.text.length==1&&!Oo(e.doc,t)?Si(e,S.line,"text"):_r(e,S.line,N.line+1,q);var oe=de(e,"changes"),ue=de(e,"change");if(ue||oe){var be={from:S,to:N,text:t.text,removed:t.removed,origin:t.origin};ue&&Cr(e,"change",e,be),oe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(be)}e.display.selForContextMenu=null}function rn(e,t,i,r,n){var S;r||(r=i),Dt(r,i)<0&&(S=[r,i],i=S[0],r=S[1]),typeof t=="string"&&(t=e.splitLines(t)),tn(e,{from:i,to:r,text:t,origin:n})}function Zo(e,t,i,r){i1||!(this.children[0]instanceof Rn))){var K=[];this.collapse(K),this.children=[new Rn(K)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var N=n.lines.length%25+25,K=N;K10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=q,e.display.maxLineLength=oe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&_r(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&zo(e.doc)),e&&Cr(e,"markerCleared",e,this,r,n),t&&Wi(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||N==0&&S.clearWhenEmpty!==!1)return S;if(S.replacedWith&&(S.collapsed=!0,S.widgetNode=y("span",[S.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||S.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(S.widgetNode.insertLeft=!0)),S.collapsed){if(gr(e,t.line,t,i,S)||t.line!=i.line&&gr(e,i.line,t,i,S))throw new Error("Inserting collapsed marker partially overlapping an existing one");li()}S.addToHistory&&No(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var K=t.line,X=e.cm,q;if(e.iter(K,i.line+1,function(ue){X&&S.collapsed&&!X.options.lineWrapping&&Rr(ue)==X.display.maxLine&&(q=!0),S.collapsed&&K!=t.line&&tr(ue,0),yi(ue,new ui(S,K==t.line?t.ch:null,K==i.line?i.ch:null)),++K}),S.collapsed&&e.iter(t.line,i.line+1,function(ue){ni(e,ue)&&tr(ue,0)}),S.clearOnEnter&&Ae(S,"beforeCursorEnter",function(){return S.clear()}),S.readOnly&&(zr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),S.collapsed&&(S.id=++ts,S.atomic=!0),X){if(q&&(X.curOp.updateMaxLine=!0),S.collapsed)_r(X,t.line,i.line+1);else if(S.className||S.startStyle||S.endStyle||S.css||S.attributes||S.title)for(var oe=t.line;oe<=i.line;oe++)Si(X,oe,"text");S.atomic&&zo(X.doc),Cr(X,"markerAdded",X,S)}return S}var Mn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;X--)tn(this,r[X]);K?Ho(this,K):this.cm&&Zi(this.cm)}),undo:yr(function(){ta(this,"undo")}),redo:yr(function(){ta(this,"redo")}),undoSelection:yr(function(){ta(this,"undo",!0)}),redoSelection:yr(function(){ta(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=l(this,e),t=l(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(S){var N=S.markedSpans;if(N)for(var K=0;K=X.to||X.from==null&&n!=e.line||X.from!=null&&n==t.line&&X.from>=t.ch)&&(!i||i(X.marker))&&r.push(X.marker.parent||X.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=S,++i}),l(this,Ge(i,t))},indexFromPos:function(e){e=l(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var oe=e.dataTransfer.getData("Text");if(oe){var ue;if(t.state.draggingText&&!t.state.draggingText.copy&&(ue=t.listSelections()),$n(t.doc,Ti(i,i)),ue)for(var be=0;be=0;K--)rn(e.doc,"",r[K].from,r[K].to,"+delete");Zi(e)})}function Na(e,t,i){var r=He(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ua(e,t,i){var r=Na(e,t.ch,i);return r==null?null:new Ge(t.line,r,i<0?"after":"before")}function Fa(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var S=nt(i,t.doc.direction);if(S){var N=n<0?ke(S):S[0],K=n<0==(N.level==1),X=K?"after":"before",q;if(N.level>0||t.doc.direction=="rtl"){var oe=Qi(t,i);q=n<0?i.text.length-1:0;var ue=oi(t,oe,q).top;q=rt(function(be){return oi(t,oe,be).top==ue},n<0==(N.level==1)?N.from:N.to-1,q),X=="before"&&(q=Na(i,q,1))}else q=n<0?N.to:N.from;return new Ge(r,q,X)}}return new Ge(r,n<0?i.text.length:0,n<0?"before":"after")}function Pl(e,t,i,r){var n=nt(t,e.doc.direction);if(!n)return Ua(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var S=Ye(n,i.ch,i.sticky),N=n[S];if(e.doc.direction=="ltr"&&N.level%2==0&&(r>0?N.to>i.ch:N.from=N.from&&be>=oe.begin)){var ye=ue?"before":"after";return new Ge(i.line,be,ye)}}var Re=function(et,ut,tt){for(var pt=function(qt,br){return br?new Ge(i.line,K(qt,1),"before"):new Ge(i.line,qt,"after")};et>=0&&et0==(Tt.level!=1),Pt=Et?tt.begin:K(tt.end,-1);if(Tt.from<=Pt&&Pt0?oe.end:K(oe.begin,-1);return Ke!=null&&!(r>0&&Ke==t.text.length)&&(je=Re(r>0?0:n.length-1,r,q(Ke)),je)?je:null}var _n={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return on(e,function(t){if(t.empty()){var i=ze(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new Ge(n.line,n.ch+1),e.replaceRange(S.charAt(n.ch-1)+S.charAt(n.ch-2),Ge(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var N=ze(e.doc,n.line-1).text;N&&(n=new Ge(n.line,1),e.replaceRange(S.charAt(0)+e.doc.lineSeparator()+N.charAt(N.length-1),Ge(n.line-1,N.length-1),n,"+transpose"))}}i.push(new Qt(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return Hr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&Dt(t,this.pos)==0&&i==this.button};var Nn,Un;function Wl(e,t){var i=+new Date;return Un&&Un.compare(i,e,t)?(Nn=Un=null,"triple"):Nn&&Nn.compare(i,e,t)?(Un=new Wa(i,e,t),Nn=null,"double"):(Nn=new Wa(i,e,t),Un=null,"single")}function vs(e){var t=this,i=t.display;if(Ne(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,hi(i,e)){O||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ha(t,e))return;var r=Bi(t,e),n=Ce(e),S=r?Wl(r,n):"single";if(window.focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,n,r,S,e))return;n==1?r?zl(t,r,S,e):pe(e)==i.scroller&&te(e):n==2?(r&&qn(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(L?t.display.input.onContextMenu(e):yo(t))}function Hl(e,t,i,r,n){var S="Click";return r=="double"?S="Double"+S:r=="triple"&&(S="Triple"+S),S=(t==1?"Left":t==2?"Middle":"Right")+S,Bn(e,ls(S,n),n,function(N){if(typeof N=="string"&&(N=_n[N]),!N)return!1;var K=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),K=N(e,i)!=Ie}finally{e.state.suppressEdits=!1}return K})}function Gl(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var S=d?i.shiftKey&&i.metaKey:i.altKey;n.unit=S?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=u?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(u?i.altKey:i.ctrlKey)),n}function zl(e,t,i,r){H?setTimeout(z(vo,e),0):e.curOp.focus=P();var n=Gl(e,i,r),S=e.doc.sel,N;e.options.dragDrop&&Oe&&!e.isReadOnly()&&i=="single"&&(N=S.contains(t))>-1&&(Dt((N=S.ranges[N]).from(),t)<0||t.xRel>0)&&(Dt(N.to(),t)>0||t.xRel<0)?Kl(e,r,t,n):Vl(e,r,t,n)}function Kl(e,t,i,r){var n=e.display,S=!1,N=vr(e,function(q){O&&(n.scroller.draggable=!1),e.state.draggingText=!1,at(n.wrapper.ownerDocument,"mouseup",N),at(n.wrapper.ownerDocument,"mousemove",K),at(n.scroller,"dragstart",X),at(n.scroller,"drop",N),S||(te(q),r.addNew||qn(e.doc,i,null,null,r.extend),O&&!k||H&&U==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),K=function(q){S=S||Math.abs(t.clientX-q.clientX)+Math.abs(t.clientY-q.clientY)>=10},X=function(){return S=!0};O&&(n.scroller.draggable=!0),e.state.draggingText=N,N.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),Ae(n.wrapper.ownerDocument,"mouseup",N),Ae(n.wrapper.ownerDocument,"mousemove",K),Ae(n.scroller,"dragstart",X),Ae(n.scroller,"drop",N),yo(e),setTimeout(function(){return n.input.focus()},20)}function ys(e,t,i){if(i=="char")return new Qt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Qt(Ge(t.line,0),l(e.doc,Ge(t.line+1,0)));var r=i(e,t);return new Qt(r.from,r.to)}function Vl(e,t,i,r){var n=e.display,S=e.doc;te(t);var N,K,X=S.sel,q=X.ranges;if(r.addNew&&!r.extend?(K=S.sel.contains(i),K>-1?N=q[K]:N=new Qt(i,i)):(N=S.sel.primary(),K=S.sel.primIndex),r.unit=="rectangle")r.addNew||(N=new Qt(i,i)),i=Bi(e,t,!0,!0),K=-1;else{var oe=ys(e,i,r.unit);r.extend?N=_a(N,oe.anchor,oe.head,r.extend):N=oe}r.addNew?K==-1?(K=q.length,Dr(S,$r(e,q.concat([N]),K),{scroll:!1,origin:"*mouse"})):q.length>1&&q[K].empty()&&r.unit=="char"&&!r.extend?(Dr(S,$r(e,q.slice(0,K).concat(q.slice(K+1)),0),{scroll:!1,origin:"*mouse"}),X=S.sel):Ba(S,K,N,Ee):(K=0,Dr(S,new Vr([N],0),Ee),X=S.sel);var ue=i;function be(tt){if(Dt(ue,tt)==0)return;if(ue=tt,r.unit=="rectangle"){for(var pt=[],Tt=e.options.tabSize,Et=ee(ze(S,i.line).text,i.ch,Tt),Pt=ee(ze(S,tt.line).text,tt.ch,Tt),qt=Math.min(Et,Pt),br=Math.max(Et,Pt),nr=Math.min(i.line,tt.line),Gr=Math.min(e.lastLine(),Math.max(i.line,tt.line));nr<=Gr;nr++){var Nr=ze(S,nr).text,hr=Se(Nr,qt,Tt);qt==br?pt.push(new Qt(Ge(nr,hr),Ge(nr,hr))):Nr.length>hr&&pt.push(new Qt(Ge(nr,hr),Ge(nr,Se(Nr,br,Tt))))}pt.length||pt.push(new Qt(i,i)),Dr(S,$r(e,X.ranges.slice(0,K).concat(pt),K),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tt)}else{var Ur=N,Sr=ys(e,tt,r.unit),pr=Ur.anchor,cr;Dt(Sr.anchor,pr)>0?(cr=Sr.head,pr=vi(Ur.from(),Sr.anchor)):(cr=Sr.anchor,pr=gi(Ur.to(),Sr.head));var or=X.ranges.slice(0);or[K]=Ql(e,new Qt(l(S,pr),cr)),Dr(S,$r(e,or,K),Ee)}}var ye=n.wrapper.getBoundingClientRect(),Re=0;function je(tt){var pt=++Re,Tt=Bi(e,tt,!0,r.unit=="rectangle");if(!Tt)return;if(Dt(Tt,ue)!=0){e.curOp.focus=P(),be(Tt);var Et=Vn(n,S);(Tt.line>=Et.to||Tt.lineye.bottom?20:0;Pt&&setTimeout(vr(e,function(){if(Re!=pt)return;n.scroller.scrollTop+=Pt,je(tt)}),50)}}function Ke(tt){e.state.selectingText=!1,Re=Infinity,tt&&(te(tt),n.input.focus()),at(n.wrapper.ownerDocument,"mousemove",et),at(n.wrapper.ownerDocument,"mouseup",ut),S.history.lastSelOrigin=null}var et=vr(e,function(tt){tt.buttons===0||!Ce(tt)?Ke(tt):je(tt)}),ut=vr(e,Ke);e.state.selectingText=ut,Ae(n.wrapper.ownerDocument,"mousemove",et),Ae(n.wrapper.ownerDocument,"mouseup",ut)}function Ql(e,t){var i=t.anchor,r=t.head,n=ze(e.doc,i.line);if(Dt(i,r)==0&&i.sticky==r.sticky)return t;var S=nt(n);if(!S)return t;var N=Ye(S,i.ch,i.sticky),K=S[N];if(K.from!=i.ch&&K.to!=i.ch)return t;var X=N+(K.from==i.ch==(K.level!=1)?0:1);if(X==0||X==S.length)return t;var q;if(r.line!=i.line)q=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var oe=Ye(S,r.ch,r.sticky),ue=oe-N||(r.ch-i.ch)*(K.level==1?-1:1);oe==X-1||oe==X?q=ue<0:q=ue>0}var be=S[X+(q?-1:0)],ye=q==(be.level==1),Re=ye?be.from:be.to,je=ye?"after":"before";return i.ch==Re&&i.sticky==je?t:new Qt(new Ge(i.line,Re,je),r)}function bs(e,t,i,r){var n,S;if(t.touches)n=t.touches[0].clientX,S=t.touches[0].clientY;else try{n=t.clientX,S=t.clientY}catch(be){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&te(t);var N=e.display,K=N.lineDiv.getBoundingClientRect();if(S>K.bottom||!de(e,i))return ae(t);S-=K.top-N.viewOffset;for(var X=0;X=n){var oe=ur(e.doc,S),ue=e.display.gutterSpecs[X];return we(e,i,e,oe,ue.className,t),ae(t)}}}function Ha(e,t){return bs(e,t,"gutterClick",!0)}function Es(e,t){if(hi(e.display,t)||Xl(e,t))return;if(Ne(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Xl(e,t){return de(e,"gutterContextMenu")?bs(e,t,"gutterContextMenu",!1):!1}function xs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yn(e)}var sn={toString:function(){return"CodeMirror.Init"}},Cs={},aa={};function Yl(e){var t=e.optionHandlers;function i(r,n,S,N){e.defaults[r]=n,S&&(t[r]=N?function(K,X,q){q!=sn&&S(K,X,q)}:S)}e.defineOption=i,e.Init=sn,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Ma(r)},!0),i("indentUnit",2,Ma,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){wn(r),yn(r),_r(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!n)return;var S=[],N=r.doc.first;r.doc.iter(function(X){for(var q=0;;){var oe=X.text.indexOf(n,q);if(oe==-1)break;q=oe+n.length,S.push(Ge(N,oe))}N++});for(var K=S.length-1;K>=0;K--)rn(r.doc,n,S[K],Ge(S[K].line,S[K].ch+n.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,n,S){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),S!=sn&&r.refresh()}),i("specialCharPlaceholder",Zt,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!A),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){xs(r),Tn(r)},!0),i("keyMap","default",function(r,n,S){var N=ia(n),K=S!=sn&&ia(S);K&&K.detach&&K.detach(r,N),N.attach&&N.attach(r,K||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=ka(n,r.options.lineNumbers),Tn(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?Ea(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return qi(r)},!0),i("scrollbarStyle","native",function(r){Ao(r),qi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=ka(r.options.gutters,n),Tn(r)},!0),i("firstLineNumber",1,Tn,!0),i("lineNumberFormatter",function(r){return r},Tn,!0),i("showCursorWhenSelecting",!1,bn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ji(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bn,!0),i("singleCursorHeightPerLine",!0,bn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,wn,!0),i("addModeClass",!1,wn,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,wn,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=sn;if(!t!=!r){var n=e.display.dragFunctions,S=t?Ae:at;S(e.display.scroller,"dragstart",n.start),S(e.display.scroller,"dragenter",n.enter),S(e.display.scroller,"dragover",n.over),S(e.display.scroller,"dragleave",n.leave),S(e.display.scroller,"drop",n.drop)}}function Zl(e){e.options.lineWrapping?(G(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(p(e.display.wrapper,"CodeMirror-wrap"),jn(e)),xa(e),_r(e),yn(e),setTimeout(function(){return qi(e)},100)}function rr(e,t){var i=this;if(!(this instanceof rr))return new rr(e,t);this.options=t=t?j(t):{},j(Cs,t,!1);var r=t.value;typeof r=="string"?r=new Br(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new rr.inputStyles[t.inputStyle](this),S=this.display=new dl(e,r,n,t);S.wrapper.CodeMirror=this,xs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(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 ne,keySeq:null,specialChars:null},t.autofocus&&!o&&S.input.focus(),H&&U<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),ji(this),this.curOp.forceUpdate=!0,Po(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Sa(i)},20):Ji(this);for(var N in aa)aa.hasOwnProperty(N)&&aa[N](this,t[N],sn);Do(this),t.finishInit&&t.finishInit(this);for(var K=0;K20*20}Ae(t.scroller,"touchstart",function(X){if(!Ne(e,X)&&!S(X)&&!Ha(e,X)){t.input.ensurePolled(),clearTimeout(i);var q=+new Date;t.activeTouch={start:q,moved:!1,prev:q-r.end<=300?r:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),Ae(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ae(t.scroller,"touchend",function(X){var q=t.activeTouch;if(q&&!hi(t,X)&&q.left!=null&&!q.moved&&new Date-q.start<300){var oe=e.coordsChar(t.activeTouch,"page"),ue;!q.prev||N(q,q.prev)?ue=new Qt(oe,oe):!q.prev.prev||N(q,q.prev.prev)?ue=e.findWordAt(oe):ue=new Qt(Ge(oe.line,0),l(e.doc,Ge(oe.line+1,0))),e.setSelection(ue.anchor,ue.head),e.focus(),te(X)}n()}),Ae(t.scroller,"touchcancel",n),Ae(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xn(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),we(e,"scroll",e))}),Ae(t.scroller,"mousewheel",function(X){return ko(e,X)}),Ae(t.scroller,"DOMMouseScroll",function(X){return ko(e,X)}),Ae(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Ne(e,X)||le(X)},over:function(X){Ne(e,X)||(Ll(e,X),le(X))},start:function(X){return Dl(e,X)},drop:vr(e,wl),leave:function(X){Ne(e,X)||ns(e)}};var K=t.input.getField();Ae(K,"keyup",function(X){return ms.call(e,X)}),Ae(K,"keydown",vr(e,ps)),Ae(K,"keypress",vr(e,gs)),Ae(K,"focus",function(X){return Sa(e,X)}),Ae(K,"blur",function(X){return Ji(e,X)})}var Ga=[];rr.defineInitHook=function(e){return Ga.push(e)};function Fn(e,t,i,r){var n=e.doc,S;i==null&&(i="add"),i=="smart"&&(n.mode.indent?S=Ze(e,t).state:i="prev");var N=e.options.tabSize,K=ze(n,t),X=ee(K.text,null,N);K.stateAfter&&(K.stateAfter=null);var q=K.text.match(/^\s*/)[0],oe;if(!r&&!/\S/.test(K.text))oe=0,i="not";else if(i=="smart"&&(oe=n.mode.indent(S,K.text.slice(q.length),K.text),oe==Ie||oe>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?oe=ee(ze(n,t-1).text,null,N):oe=0:i=="add"?oe=X+e.options.indentUnit:i=="subtract"?oe=X-e.options.indentUnit:typeof i=="number"&&(oe=X+i),oe=Math.max(0,oe);var ue="",be=0;if(e.options.indentWithTabs)for(var ye=Math.floor(oe/N);ye;--ye)be+=N,ue+=" ";if(beN,X=At(t),q=null;if(K&&r.ranges.length>1)if(ei&&ei.text.join(` `)==t){if(r.ranges.length%ei.text.length==0){q=[];for(var oe=0;oe=0;be--){var ye=r.ranges[be],Re=ye.from(),je=ye.to();ye.empty()&&(i&&i>0?Re=Ge(Re.line,Re.ch-i):e.state.overwrite&&!K?je=Ge(je.line,Math.min(ze(S,je.line).text.length,je.ch+ke(X).length)):K&&ei&&ei.lineWise&&ei.text.join(` `)==X.join(` `)&&(Re=je=Ge(Re.line,0)));var Ke={from:Re,to:je,text:q?q[be%q.length]:X,origin:n||(K?"paste":e.state.cutIncoming>N?"cut":"+input")};tn(e.doc,Ke),Cr(e,"inputRead",e,Ke)}t&&!K&&As(e,t),Zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ue),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Hr(t,function(){return za(t,i,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)continue;var S=e.getModeAt(n.head),N=!1;if(S.electricChars){for(var K=0;K-1){N=Fn(e,n.head.line,"smart");break}}else S.electricInput&&(S.electricInput.test(ze(e.doc,n.head.line).text.slice(0,n.head.ch))&&(N=Fn(e,n.head.line,"smart")));N&&Cr(e,"electricInput",e,n.head.line)}}function Ts(e){for(var t=[],i=[],r=0;rS&&(Fn(this,K.head.line,r,!0),S=K.head.line,N==this.doc.sel.primIndex&&Zi(this));else{var X=K.from(),q=K.to(),oe=Math.max(S,X.line);S=Math.min(this.lastLine(),q.line-(q.ch?0:1))+1;for(var ue=oe;ue0&&Ba(this.doc,N,new Qt(X,be[N].to()),xe)}}}),getTokenAt:function(r,n){return er(this,r,n)},getLineTokens:function(r,n){return er(this,Ge(r),n,!0)},getTokenTypeAt:function(r){r=l(this.doc,r);var n=_e(this,ze(this.doc,r.line)),S=0,N=(n.length-1)/2,K=r.ch,X;if(K==0)X=n[2];else for(;;){var q=S+N>>1;if((q?n[q*2-1]:0)>=K)N=q;else if(n[q*2+1]X&&(r=X,N=!0),K=ze(this.doc,r)}else K=r;return Hn(this,K,{top:0,left:0},n||"page",S||N).top+(N?this.doc.height-Zr(K):0)},defaultTextHeight:function(){return Xi(this.display)},defaultCharWidth:function(){return Yi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,S,N,K){var X=this.display;r=qr(this,l(this.doc,r));var q=r.bottom,oe=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),X.sizer.appendChild(n),N=="over")q=r.top;else if(N=="above"||N=="near"){var ue=Math.max(X.wrapper.clientHeight,this.doc.height),be=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(N=="above"||r.bottom+n.offsetHeight>ue)&&r.top>n.offsetHeight?q=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=ue&&(q=r.bottom),oe+n.offsetWidth>be&&(oe=be-n.offsetWidth)}n.style.top=q+"px",n.style.left=n.style.right="",K=="right"?(oe=X.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(K=="left"?oe=0:K=="middle"&&(oe=(X.sizer.clientWidth-n.offsetWidth)/2),n.style.left=oe+"px"),S&&Js(this,{left:oe,top:q,right:oe+n.offsetWidth,bottom:q+n.offsetHeight})},triggerOnKeyDown:kr(ps),triggerOnKeyPress:kr(gs),triggerOnKeyUp:ms,triggerOnMouseDown:kr(vs),execCommand:function(r){if(_n.hasOwnProperty(r))return _n[r].call(null,this)},triggerElectric:kr(function(r){As(this,r)}),findPosH:function(r,n,S,N){var K=1;n<0&&(K=-1,n=-n);for(var X=l(this.doc,r),q=0;q0&&oe(S.charAt(N-1));)--N;for(;K.5||this.options.lineWrapping)&&xa(this),we(this,"refresh",this)}),swapDoc:kr(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,r),yn(this),this.display.input.reset(),En(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Cr(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[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}},fe(e),e.registerHelper=function(r,n,S){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=S},e.registerGlobalHelper=function(r,n,S,N){e.registerHelper(r,n,N),i[r]._global.push({pred:S,val:N})}}function Ka(e,t,i,r,n){var S=t,N=i,K=ze(e,t.line),X=n&&e.direction=="rtl"?-i:i;function q(){var ut=t.line+X;return ut=e.first+e.size?!1:(t=new Ge(ut,t.ch,t.sticky),K=ze(e,ut))}function oe(ut){var tt;if(r=="codepoint"){var pt=K.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(pt)?tt=null:tt=new Ge(t.line,Math.max(0,Math.min(K.text.length,t.ch+i*(pt>=55296&&pt<56320?2:1))),-i)}else n?tt=Pl(e.cm,K,t,i):tt=Ua(K,t,i);if(tt==null)if(!ut&&q())t=Fa(n,e.cm,K,t.line,X);else return!1;else t=tt;return!0}if(r=="char"||r=="codepoint")oe();else if(r=="column")oe(!0);else if(r=="word"||r=="group")for(var ue=null,be=r=="group",ye=e.cm&&e.cm.getHelper(t,"wordChars"),Re=!0;!(i<0&&!oe(!Re));Re=!1){var je=K.text.charAt(t.ch)||` `,Ke=Be(je,ye)?"w":be&&je==` `?"n":!be||/\s/.test(je)?null:"p";if(be&&!Re&&!Ke&&(Ke="s"),ue&&ue!=Ke){i<0&&(i=1,oe(),t.sticky="after");break}if(Ke&&(ue=Ke),i>0&&!oe(!Re))break}var et=ea(e,t,S,N,!0);return pi(S,et)&&(et.hitSide=!0),et}function Ls(e,t,i,r){var n=e.doc,S=t.left,N;if(r=="page"){var K=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(K-.5*Xi(e.display),3);N=(i>0?t.bottom:t.top)+i*X}else r=="line"&&(N=i>0?t.bottom+3:t.top-3);for(var q;!(q=va(e,S,N),!q.outside);){if(i<0?N<=0:N>=n.height){q.hitSide=!0;break}N+=i*5}return q}var Jt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Jt.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;ws(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function S(K){for(var X=K.target;X;X=X.parentNode){if(X==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}Ae(n,"paste",function(K){if(!S(K)||Ne(r,K)||Ss(K,r))return;U<=11&&setTimeout(vr(r,function(){return t.updateFromDOM()}),20)}),Ae(n,"compositionstart",function(K){t.composing={data:K.data,done:!1}}),Ae(n,"compositionupdate",function(K){t.composing||(t.composing={data:K.data,done:!1})}),Ae(n,"compositionend",function(K){t.composing&&(K.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ae(n,"touchstart",function(){return i.forceCompositionEnd()}),Ae(n,"input",function(){t.composing||t.readFromDOMSoon()});function N(K){if(!S(K)||Ne(r,K))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()}),K.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var X=Ts(r);oa({lineWise:!0,text:X.text}),K.type=="cut"&&r.operation(function(){r.setSelections(X.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(K.clipboardData){K.clipboardData.clearData();var q=ei.text.join(` `);if(K.clipboardData.setData("Text",q),K.clipboardData.getData("Text")==q){K.preventDefault();return}}var oe=Ds(),ue=oe.firstChild;r.display.lineSpace.insertBefore(oe,r.display.lineSpace.firstChild),ue.value=ei.text.join(` `);var be=document.activeElement;$(ue),setTimeout(function(){r.display.lineSpace.removeChild(oe),be.focus(),be==n&&i.showPrimarySelection()},50)}Ae(n,"copy",N),Ae(n,"cut",N)},Jt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Jt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Jt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Jt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&Rs(t,r)||{node:K[0].measure.map[2],offset:0},q=n.linee.firstLine()&&(r=Ge(r.line-1,ze(e.doc,r.line-1).length)),n.ch==ze(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var S,N,K;r.line==t.viewFrom||(S=Ni(e,r.line))==0?(N=Ot(t.view[0].line),K=t.view[0].node):(N=Ot(t.view[S].line),K=t.view[S-1].node.nextSibling);var X=Ni(e,n.line),q,oe;if(X==t.view.length-1?(q=t.viewTo-1,oe=t.lineDiv.lastChild):(q=Ot(t.view[X+1].line)-1,oe=t.view[X+1].node.previousSibling),!K)return!1;for(var ue=e.doc.splitLines(tu(e,K,oe,N,q)),be=Kt(e.doc,Ge(N,0),Ge(q,ze(e.doc,q).text.length));ue.length>1&&be.length>1;)if(ke(ue)==ke(be))ue.pop(),be.pop(),q--;else if(ue[0]==be[0])ue.shift(),be.shift(),N++;else break;for(var ye=0,Re=0,je=ue[0],Ke=be[0],et=Math.min(je.length,Ke.length);yer.ch&&ut.charCodeAt(ut.length-Re-1)==tt.charCodeAt(tt.length-Re-1);)ye--,Re++;ue[ue.length-1]=ut.slice(0,ut.length-Re).replace(/^\u200b+/,""),ue[0]=ue[0].slice(ye).replace(/\u200b+$/,"");var Tt=Ge(N,ye),Et=Ge(q,be.length?ke(be).length-Re:0);if(ue.length>1||ue[0]||Dt(Tt,Et))return rn(e.doc,ue,Tt,Et,"+input"),!0},Jt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Jt.prototype.reset=function(){this.forceCompositionEnd()},Jt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Jt.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)},Jt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hr(this.cm,function(){return _r(e.cm)})},Jt.prototype.setUneditable=function(e){e.contentEditable="false"},Jt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vr(this.cm,za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Jt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Jt.prototype.onContextMenu=function(){},Jt.prototype.resetPosition=function(){},Jt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=fa(e,t.line);if(!i||i.hidden)return null;var r=ze(e.doc,t.line),n=eo(i,r,t.line),S=nt(r,e.doc.direction),N="left";if(S){var K=Ye(S,t.ch);N=K%2?"right":"left"}var X=io(n.map,t.ch,N);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ln(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,n){var S="",N=!1,K=e.doc.lineSeparator(),X=!1;function q(ye){return function(Re){return Re.id==ye}}function oe(){N&&(S+=K,X&&(S+=K),N=X=!1)}function ue(ye){ye&&(oe(),S+=ye)}function be(ye){if(ye.nodeType==1){var Re=ye.getAttribute("cm-text");if(Re){ue(Re);return}var je=ye.getAttribute("cm-marker"),Ke;if(je){var et=e.findMarks(Ge(r,0),Ge(n+1,0),q(+je));et.length&&(Ke=et[0].find(0))&&ue(Kt(e.doc,Ke.from,Ke.to).join(K));return}if(ye.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(ye.nodeName);if(!/^br$/i.test(ye.nodeName)&&ye.textContent.length==0)return;ut&&oe();for(var tt=0;tt=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ae(n,"paste",function(N){if(Ne(r,N)||Ss(N,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function S(N){if(Ne(r,N))return;if(r.somethingSelected())oa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var K=Ts(r);oa({lineWise:!0,text:K.text}),N.type=="cut"?r.setSelections(K.ranges,null,xe):(i.prevInput="",n.value=K.text.join(` `),$(n))}else return;N.type=="cut"&&(r.state.cutIncoming=+new Date)}Ae(n,"cut",S),Ae(n,"copy",S),Ae(e.scroller,"paste",function(N){if(hi(e,N)||Ne(r,N))return;if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var K=new Event("paste");K.clipboardData=N.clipboardData,n.dispatchEvent(K)}),Ae(e.lineSpace,"selectstart",function(N){hi(e,N)||te(N)}),Ae(n,"compositionstart",function(){var N=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:N,range:r.markText(N,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ae(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},lr.prototype.createField=function(e){this.wrapper=Ds(),this.textarea=this.wrapper.firstChild},lr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},lr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=mo(e);if(e.options.moveInputWithCursor){var n=qr(e,i.sel.primary().head,"div"),S=t.wrapper.getBoundingClientRect(),N=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+N.top-S.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+N.left-S.left))}return r},lr.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},lr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&$(this.textarea),H&&U>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",H&&U>=9&&(this.hasSelection=null))},lr.prototype.getField=function(){return this.textarea},lr.prototype.supportsTouch=function(){return!1},lr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},lr.prototype.blur=function(){this.textarea.blur()},lr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},lr.prototype.receivedFocus=function(){this.slowPoll()},lr.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()})},lr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},lr.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ft(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(H&&U>=9&&this.hasSelection===n||u&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var S=n.charCodeAt(0);if(S==8203&&!r&&(r="\u200B"),S==8666)return this.reset(),this.cm.execCommand("undo")}for(var N=0,K=Math.min(r.length,n.length);N1e3||n.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},lr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},lr.prototype.onKeyPress=function(){H&&U>=9&&(this.hasSelection=null),this.fastPoll()},lr.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var S=Bi(i,e),N=r.scroller.scrollTop;if(!S||w)return;var K=i.options.resetSelectionOnContextMenu;K&&i.doc.sel.contains(S)==-1&&vr(i,Dr)(i.doc,Ti(S),xe);var X=n.style.cssText,q=t.wrapper.style.cssText,oe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-oe.top-5)+"px; left: "+(e.clientX-oe.left-5)+`px; z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ue;O&&(ue=window.scrollY),r.input.focus(),O&&window.scrollTo(null,ue),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=ye,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function be(){if(n.selectionStart!=null){var je=i.somethingSelected(),Ke="\u200B"+(je?n.value:"");n.value="\u21DA",n.value=Ke,t.prevInput=je?"":"\u200B",n.selectionStart=1,n.selectionEnd=Ke.length,r.selForContextMenu=i.doc.sel}}function ye(){if(t.contextMenuPending!=ye)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=q,n.style.cssText=X,H&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=N),n.selectionStart!=null){(!H||H&&U<9)&&be();var je=0,Ke=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?vr(i,Qo)(i):je++<10?r.detectingSelectAll=setTimeout(Ke,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Ke,200)}}if(H&&U>=9&&be(),L){le(e);var Re=function(){at(window,"mouseup",Re),setTimeout(ye,20)};Ae(window,"mouseup",Re)}else setTimeout(ye,50)},lr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},lr.prototype.setUneditable=function(){},lr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?j(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=P();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=K.getValue()}var n;if(e.form&&(Ae(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var S=e.form;n=S.submit;try{var N=S.submit=function(){r(),S.submit=n,S.submit(),S.submit=N}}catch(X){}}t.finishInit=function(X){X.save=r,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,r(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(at(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var K=rr(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return K}function nu(e){e.off=at,e.on=Ae,e.wheelEventPixels=hl,e.Doc=Br,e.splitLines=At,e.countColumn=ee,e.findColumn=Se,e.isWordChar=Fe,e.Pass=Ie,e.signal=we,e.Line=Oi,e.changeEnd=wi,e.scrollbarModel=So,e.Pos=Ge,e.cmpPos=Dt,e.modes=It,e.mimeModes=xt,e.resolveMode=lt,e.getMode=$t,e.modeExtensions=ar,e.extendMode=ir,e.copyState=Mr,e.startState=Xt,e.innerMode=ti,e.commands=_n,e.keyMap=ci,e.keyName=us,e.isModifierKey=ss,e.lookupKey=an,e.normalizeKeyMap=Ol,e.StringStream=yt,e.SharedTextMarker=Mn,e.TextMarker=Li,e.LineWidget=In,e.e_preventDefault=te,e.e_stopPropagation=re,e.e_stop=le,e.addClass=G,e.contains=C,e.rmClass=p,e.keyNames=Ri}Yl(rr),$l(rr);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Br.prototype)Br.prototype.hasOwnProperty(la)&&ce(au,la)<0&&(rr.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Br.prototype[la]));return fe(Br),rr.inputStyles={textarea:lr,contenteditable:Jt},rr.defineMode=function(e){!rr.defaults.mode&&e!="null"&&(rr.defaults.mode=e),Mt.apply(this,arguments)},rr.defineMIME=jt,rr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),rr.defineMIME("text/plain","null"),rr.defineExtension=function(e,t){rr.prototype[e]=t},rr.defineDocExtension=function(e,t){Br.prototype[e]=t},rr.fromTextArea=iu,nu(rr),rr.version="5.58.2",rr})},W6BS:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOHPfJbrhRX5/CM/NDwJZlXiqBKlc7AEjg1aI2iVDXZpoeS9AFXlkmV1W8z+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6AYKLdtbMtGINpiKKUM07bc96dk9BUBykIFoNYVC/JewMkCD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lN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},Xsq0:function(Pe,Le,Z){Pe.exports=Z.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Pe,Le,Z){"use strict";Z.r(Le),Z.d(Le,"ResizableTextArea",function(){return ce});var ie=Z("wx14"),Y=Z("1OyB"),R=Z("vuIU"),Q=Z("Ji7U"),B=Z("LK+K"),_=Z("q1tI"),H=Z("VTBJ"),U=Z("rePB"),O=Z("Zm9Q"),M=Z("Kwbf"),b=Z("c+Xe"),w=Z("m+aA"),k=Z("bdgK"),D=new Map;function T(xe){xe.forEach(function(Ee){var Te,Se=Ee.target;(Te=D.get(Se))===null||Te===void 0||Te.forEach(function(me){return me(Se)})})}var E=new k.default(T),h=null,o=null;function u(xe,Ee){D.has(xe)||(D.set(xe,new Set),E.observe(xe)),D.get(xe).add(Ee)}function d(xe,Ee){D.has(xe)&&(D.get(xe).delete(Ee),D.get(xe).size||(E.unobserve(xe),D.delete(xe)))}var A=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(){return Object(Y.a)(this,Te),Ee.apply(this,arguments)}return Object(R.a)(Te,[{key:"render",value:function(){return this.props.children}}]),Te}(_.Component),g=_.createContext(null);function m(xe){var Ee=xe.children,Te=xe.onBatchResize,Se=_.useRef(0),me=_.useRef([]),se=_.useContext(g),ke=_.useCallback(function(Ve,We,Je){Se.current+=1;var qe=Se.current;me.current.push({size:Ve,element:We,data:Je}),Promise.resolve().then(function(){qe===Se.current&&(Te==null||Te(me.current),me.current=[])}),se==null||se(Ve,We,Je)},[Te,se]);return _.createElement(g.Provider,{value:ke},Ee)}function L(xe){var Ee=xe.children,Te=xe.disabled,Se=_.useRef(null),me=_.useRef(null),se=_.useContext(g),ke=_.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ve=_.isValidElement(Ee)&&Object(b.c)(Ee),We=Ve?Ee.ref:null,Je=_.useMemo(function(){return Object(b.a)(We,Se)},[We,Se]),qe=_.useRef(xe);qe.current=xe;var De=_.useCallback(function(Fe){var Be=qe.current,$e=Be.onResize,Qe=Be.data,Me=Fe.getBoundingClientRect(),He=Me.width,rt=Me.height,st=Fe.offsetWidth,Xe=Fe.offsetHeight,Ye=Math.floor(He),ct=Math.floor(rt);if(ke.current.width!==Ye||ke.current.height!==ct||ke.current.offsetWidth!==st||ke.current.offsetHeight!==Xe){var nt={width:Ye,height:ct,offsetWidth:st,offsetHeight:Xe};ke.current=nt;var it=st===Math.round(He)?He:st,Ae=Xe===Math.round(rt)?rt:Xe,dt=Object(H.a)(Object(H.a)({},nt),{},{offsetWidth:it,offsetHeight:Ae});se==null||se(dt,Fe,Qe),$e&&Promise.resolve().then(function(){$e(dt,Fe)})}},[]);return _.useEffect(function(){var Fe=Object(w.a)(Se.current)||Object(w.a)(me.current);return Fe&&!Te&&u(Fe,De),function(){return d(Fe,De)}},[Se.current,Te]),_.createElement(A,{ref:me},Ve?_.cloneElement(Ee,{ref:Je}):Ee)}var x="rc-observer-key";function p(xe){var Ee=xe.children,Te=Object(O.a)(Ee);return Te.map(function(Se,me){var se=(Se==null?void 0:Se.key)||"".concat(x,"-").concat(me);return _.createElement(L,Object(ie.a)({},xe,{key:se}),Se)})}p.Collection=m;var c=p,s=Z("bT9E"),a=Z("TSYQ"),y=Z.n(a),v=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important `,C=["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"],P={},G;function V(xe){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ee&&P[Te])return P[Te];var Se=window.getComputedStyle(xe),me=Se.getPropertyValue("box-sizing")||Se.getPropertyValue("-moz-box-sizing")||Se.getPropertyValue("-webkit-box-sizing"),se=parseFloat(Se.getPropertyValue("padding-bottom"))+parseFloat(Se.getPropertyValue("padding-top")),ke=parseFloat(Se.getPropertyValue("border-bottom-width"))+parseFloat(Se.getPropertyValue("border-top-width")),Ve=C.map(function(Je){return"".concat(Je,":").concat(Se.getPropertyValue(Je))}).join(";"),We={sizingStyle:Ve,paddingSize:se,borderSize:ke,boxSizing:me};return Ee&&Te&&(P[Te]=We),We}function $(xe){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;G||(G=document.createElement("textarea"),G.setAttribute("tab-index","-1"),G.setAttribute("aria-hidden","true"),document.body.appendChild(G)),xe.getAttribute("wrap")?G.setAttribute("wrap",xe.getAttribute("wrap")):G.removeAttribute("wrap");var me=V(xe,Ee),se=me.paddingSize,ke=me.borderSize,Ve=me.boxSizing,We=me.sizingStyle;G.setAttribute("style","".concat(We,";").concat(v)),G.value=xe.value||xe.placeholder||"";var Je=Number.MIN_SAFE_INTEGER,qe=Number.MAX_SAFE_INTEGER,De=G.scrollHeight,Fe;if(Ve==="border-box"?De+=ke:Ve==="content-box"&&(De-=se),Te!==null||Se!==null){G.value=" ";var Be=G.scrollHeight-se;Te!==null&&(Je=Be*Te,Ve==="border-box"&&(Je=Je+se+ke),De=Math.max(Je,De)),Se!==null&&(qe=Be*Se,Ve==="border-box"&&(qe=qe+se+ke),Fe=De>qe?"":"hidden",De=Math.min(qe,De))}return{height:De,minHeight:Je,maxHeight:qe,overflowY:Fe,resize:"none"}}var z=Z("Gytx"),j=Z.n(z),ee;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(ee||(ee={}));var ne=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(Se){var me;return Object(Y.a)(this,Te),me=Ee.call(this,Se),me.nextFrameActionId=void 0,me.resizeFrameId=void 0,me.textArea=void 0,me.saveTextArea=function(se){me.textArea=se},me.handleResize=function(se){var ke=me.state.resizeStatus,Ve=me.props,We=Ve.autoSize,Je=Ve.onResize;if(ke!==ee.NONE)return;typeof Je=="function"&&Je(se),We&&me.resizeOnNextFrame()},me.resizeOnNextFrame=function(){cancelAnimationFrame(me.nextFrameActionId),me.nextFrameActionId=requestAnimationFrame(me.resizeTextarea)},me.resizeTextarea=function(){var se=me.props.autoSize;if(!se||!me.textArea)return;var ke=se.minRows,Ve=se.maxRows,We=$(me.textArea,!1,ke,Ve);me.setState({textareaStyles:We,resizeStatus:ee.RESIZING},function(){cancelAnimationFrame(me.resizeFrameId),me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:ee.RESIZED},function(){me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:ee.NONE}),me.fixFirefoxAutoScroll()})})})})},me.renderTextArea=function(){var se=me.props,ke=se.prefixCls,Ve=ke===void 0?"rc-textarea":ke,We=se.autoSize,Je=se.onResize,qe=se.className,De=se.disabled,Fe=me.state,Be=Fe.textareaStyles,$e=Fe.resizeStatus,Qe=Object(s.a)(me.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=y()(Ve,qe,Object(U.a)({},"".concat(Ve,"-disabled"),De));"value"in Qe&&(Qe.value=Qe.value||"");var He=Object(H.a)(Object(H.a)(Object(H.a)({},me.props.style),Be),$e===ee.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(c,{onResize:me.handleResize,disabled:!(We||Je)},_.createElement("textarea",Object(ie.a)({},Qe,{className:Me,style:He,ref:me.saveTextArea})))},me.state={textareaStyles:{},resizeStatus:ee.NONE},me}return Object(R.a)(Te,[{key:"componentDidUpdate",value:function(me){(me.value!==this.props.value||!j()(me.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 me=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(me,se)}}catch(ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Te}(_.Component),ce=ne,ve=function(xe){Object(Q.a)(Te,xe);var Ee=Object(B.a)(Te);function Te(Se){var me;Object(Y.a)(this,Te),me=Ee.call(this,Se),me.resizableTextArea=void 0,me.focus=function(){me.resizableTextArea.textArea.focus()},me.saveTextArea=function(ke){me.resizableTextArea=ke},me.handleChange=function(ke){var Ve=me.props.onChange;me.setValue(ke.target.value,function(){me.resizableTextArea.resizeTextarea()}),Ve&&Ve(ke)},me.handleKeyDown=function(ke){var Ve=me.props,We=Ve.onPressEnter,Je=Ve.onKeyDown;ke.keyCode===13&&We&&We(ke),Je&&Je(ke)};var se=typeof Se.value=="undefined"||Se.value===null?Se.defaultValue:Se.value;return me.state={value:se},me}return Object(R.a)(Te,[{key:"setValue",value:function(me,se){"value"in this.props||this.setState({value:me},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(ce,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(me){return"value"in me?{value:me.value}:null}}]),Te}(_.Component),Ie=Le.default=ve},ZpRC:function(Pe,Le,Z){"use strict";function ie(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Y(b,w){return(!w||b!=="hidden")&&b!=="visible"&&b!=="clip"}function R(b,w){if(b.clientHeightw||E>b&&h=w&&o>=k?E-b-D:h>w&&ok?h-w+T:0}var B=function(b,w){var k=window,D=w.scrollMode,T=w.block,E=w.inline,h=w.boundary,o=w.skipOverflowHiddenElements,u=typeof h=="function"?h:function(Be){return Be!==h};if(!ie(b))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,A=[],g=b;ie(g)&&u(g);){if((g=g.parentElement)===d){A.push(g);break}g!=null&&g===document.body&&R(g)&&!R(document.documentElement)||g!=null&&R(g,o)&&A.push(g)}for(var m=k.visualViewport?k.visualViewport.width:innerWidth,L=k.visualViewport?k.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,p=window.scrollY||pageYOffset,c=b.getBoundingClientRect(),s=c.height,a=c.width,y=c.top,v=c.right,C=c.bottom,P=c.left,G=T==="start"||T==="nearest"?y:T==="end"?C:y+s/2,V=E==="center"?P+a/2:E==="end"?v:P,$=[],z=0;z=0&&P>=0&&C<=L&&v<=m&&y>=ve&&C<=xe&&P>=Ee&&v<=Ie)return $;var Te=getComputedStyle(j),Se=parseInt(Te.borderLeftWidth,10),me=parseInt(Te.borderTopWidth,10),se=parseInt(Te.borderRightWidth,10),ke=parseInt(Te.borderBottomWidth,10),Ve=0,We=0,Je="offsetWidth"in j?j.offsetWidth-j.clientWidth-Se-se:0,qe="offsetHeight"in j?j.offsetHeight-j.clientHeight-me-ke:0;if(d===j)Ve=T==="start"?G:T==="end"?G-L:T==="nearest"?Q(p,p+L,L,me,ke,p+G,p+G+s,s):G-L/2,We=E==="start"?V:E==="center"?V-m/2:E==="end"?V-m:Q(x,x+m,m,Se,se,x+V,x+V+a,a),Ve=Math.max(0,Ve+p),We=Math.max(0,We+x);else{Ve=T==="start"?G-ve-me:T==="end"?G-xe+ke+qe:T==="nearest"?Q(ve,xe,ne,me,ke+qe,G,G+s,s):G-(ve+ne/2)+qe/2,We=E==="start"?V-Ee-Se:E==="center"?V-(Ee+ce/2)+Je/2:E==="end"?V-Ie+se+Je:Q(Ee,Ie,ce,Se,se+Je,V,V+a,a);var De=j.scrollLeft,Fe=j.scrollTop;G+=Fe-(Ve=Math.max(0,Math.min(Fe+Ve,j.scrollHeight-ne+qe))),V+=De-(We=Math.max(0,Math.min(De+We,j.scrollWidth-ce+Je)))}$.push({el:j,top:Ve,left:We})}return $};function _(b){return b===Object(b)&&Object.keys(b).length!==0}function H(b,w){w===void 0&&(w="auto");var k="scrollBehavior"in document.body.style;b.forEach(function(D){var T=D.el,E=D.top,h=D.left;T.scroll&&k?T.scroll({top:E,left:h,behavior:w}):(T.scrollTop=E,T.scrollLeft=h)})}function U(b){return b===!1?{block:"end",inline:"nearest"}:_(b)?b:{block:"start",inline:"nearest"}}function O(b,w){var k=!b.ownerDocument.documentElement.contains(b);if(_(w)&&typeof w.behavior=="function")return w.behavior(k?[]:B(b,w));if(k)return;var D=U(w);return H(B(b,D),D.behavior)}var M=Le.a=O},bT9E:function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return Y});var ie=Z("VTBJ");function Y(R,Q){var B=Object(ie.a)({},R);return Array.isArray(Q)&&Q.forEach(function(_){delete B[_]}),B}},c5Ni:function(Pe,Le,Z){},cRFk:function(Pe,Le,Z){Pe.exports=Z.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Pe,Le,Z){Pe.exports=Z.p+"static/choose.4ad1045f.svg"},dejd:function(Pe,Le,Z){},djh8:function(Pe,Le,Z){Pe.exports=Z.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Pe,Le,Z){"use strict";var ie=Z("Ff2n"),Y=Z("rePB"),R=Z("1OyB"),Q=Z("vuIU"),B=Z("Ji7U"),_=Z("md7G"),H=Z("foSv"),U=Z("q1tI"),O=Z.n(U),M=Z("TSYQ"),b=Z.n(M),w=Z("4IlW");function k(s,a){var y=Object.keys(s);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(s);a&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(s,C).enumerable})),y.push.apply(y,v)}return y}function D(s){for(var a=1;a1?ce-1:0),Ie=1;Ie1?z-1:0),ee=1;ee=0)return parseInt($.slice($.indexOf("e-")+2),10);var z=0;return $.indexOf(".")>=0&&(z=$.length-$.indexOf(".")-1),z},C.getInputDisplayValue=function(V){var $=V||C.state,z=$.focused,j=$.inputValue,ee=$.value,ne;z?ne=j:ne=C.toPrecisionAsStep(ee),ne==null&&(ne="");var ce=C.formatWrapper(ne);return m(C.props.decimalSeparator)&&(ce=ce.toString().replace(".",C.props.decimalSeparator)),ce},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(V){}},C.restoreByAfter=function(V){if(V===void 0)return!1;var $=C.input.value,z=$.lastIndexOf(V);if(z===-1)return!1;var j=C.cursorBefore.length;return C.lastKeyCode===w.a.DELETE&&C.cursorBefore.charAt(j-1)===V[0]?(C.fixCaret(j,j),!0):z+V.length===$.length?(C.fixCaret(z,z),!0):!1},C.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function($,z){var j=V.substring(z);return C.restoreByAfter(j)})},C.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(V,$,z){C.pressingUpOrDown=!0,C.step("down",V,$,z)},C.up=function(V,$,z){C.pressingUpOrDown=!0,C.step("up",V,$,z)},C.saveInput=function(V){C.input=V};var P=v.value;P===void 0&&(P=v.defaultValue),C.state={focused:v.autoFocus};var G=C.getValidValue(C.toNumber(P));return C.state=D(D({},C.state),{},{inputValue:C.toPrecisionAsStep(G),value:G}),C}return Object(Q.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var P=this.props,G=P.value,V=P.onChange,$=P.max,z=P.min,j=this.state.focused;if(C){if(!L(C.value,G)||!L(C.max,$)||!L(C.min,z)){var ee=j?G:this.getValidValue(G),ne;this.pressingUpOrDown?ne=ee:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(ee),this.setState({value:ee,inputValue:ne})}var ce="value"in this.props?G:this.state.value;"max"in this.props&&C.max!==$&&typeof ce=="number"&&ce>$&&V&&V($),"min"in this.props&&C.min!==z&&typeof ce=="number"&&ce1&&arguments[1]!==void 0?arguments[1]:this.props.min,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(C);return isNaN(V)?C:(VG&&(V=G),V)}},{key:"setValue",value:function(C,P){var G=this.props.precision,V=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),$=this.state.value,z=$===void 0?null:$,j=this.state.inputValue,ee=j===void 0?null:j,ne=typeof V=="number"?V.toFixed(G):"".concat(V),ce=V!==z||ne!=="".concat(ee);return"value"in this.props?(ee=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:ee},P)):this.setState({value:V,inputValue:this.toPrecisionAsStep(C)},P),ce&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(C){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.props,V=G.precision,$=G.step;if(m(V))return V;var z=this.getPrecision(P),j=this.getPrecision($),ee=this.getPrecision(C);return C?Math.max(ee,z+j):z+j}},{key:"getPrecisionFactor",value:function(C){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,G=this.getMaxPrecision(C,P);return Math.pow(10,G)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var P=Math.abs(this.getMaxPrecision(C));return isNaN(P)?C.toString():Number(C).toFixed(P)}},{key:"toNumber",value:function(C){var P=this.props.precision,G=this.state.focused,V=C&&C.length>16&&G;return this.isNotCompleteNumber(C)||V?C:m(P)?Math.round(C*Math.pow(10,P))/Math.pow(10,P):Number(C)}},{key:"upStep",value:function(C,P){var G=this.props.step,V=this.getPrecisionFactor(C,P),$=Math.abs(this.getMaxPrecision(C,P)),z=((V*C+V*G*P)/V).toFixed($);return this.toNumber(z)}},{key:"downStep",value:function(C,P){var G=this.props.step,V=this.getPrecisionFactor(C,P),$=Math.abs(this.getMaxPrecision(C,P)),z=((V*C-V*G*P)/V).toFixed($);return this.toNumber(z)}},{key:"step",value:function(C,P){var G=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var z=this.props;if(z.disabled)return;var j=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(j))return;var ee=this["".concat(C,"Step")](j,V),ne=ee>z.max||eez.max?ee=z.max:ee=ve),Ne=(ct||ct===0)&&(isNaN(ct)||Number(ct)<=Ie),ge=we||V||$,de=Ne||V||$,fe=b()("".concat(G,"-handler"),"".concat(G,"-handler-up"),Object(Y.a)({},"".concat(G,"-handler-up-disabled"),ge)),te=b()("".concat(G,"-handler"),"".concat(G,"-handler-down"),Object(Y.a)({},"".concat(G,"-handler-down-disabled"),de)),re=z?{onTouchStart:ge?h:this.up,onTouchEnd:this.stop}:{onMouseDown:ge?h:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ae=z?{onTouchStart:de?h:this.down,onTouchEnd:this.stop}:{onMouseDown:de?h:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:it,style:xe,title:Ee,onMouseEnter:Te,onMouseLeave:Se,onMouseOver:me,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(G,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":ge,className:fe}),ee||O.a.createElement("span",{unselectable:"on",className:"".concat(G,"-handler-up-inner"),onClick:o})),O.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:te}),ne||O.a.createElement("span",{unselectable:"on",className:"".concat(G,"-handler-down-inner"),onClick:o}))),O.a.createElement("div",{className:"".concat(G,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ie,"aria-valuemax":ve,"aria-valuenow":ct,required:ke,type:Je,placeholder:qe,onPaste:rt,onClick:Ve,onMouseUp:this.onMouseUp,className:"".concat(G,"-input"),tabIndex:We,autoComplete:j,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:dt?this.onKeyDown:h,onKeyUp:dt?this.onKeyUp:h,autoFocus:Me,maxLength:Qe,readOnly:$,disabled:V,max:ve,min:Ie,step:$e,name:He,title:Ee,id:De,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(at),pattern:Be,inputMode:Fe,onInput:st},Ae))))}}]),y}(O.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:g,min:-g,step:1,style:{},onChange:h,onKeyDown:h,onPressEnter:h,onFocus:h,onBlur:h,parser:u,required:!1,autoComplete:"off"};var p=x,c=Le.a=p},is8o:function(Pe,Le,Z){Pe.exports={flex_box_center:"flex_box_center___45jij",flex_space_between:"flex_space_between___2rBtS",flex_box_vertical_center:"flex_box_vertical_center___B3dEI",flex_box_center_end:"flex_box_center_end___1hlbx",flex_box_column:"flex_box_column___n3oa5",wrap:"wrap___2Ebga",modal:"modal___37ZgF",titleWrap:"titleWrap___dEwT4",required:"required___4a1a5",title:"title___1MHB3",colorGray:"colorGray___1tQ38",choiceWrap:"choiceWrap___2Ik_w",answer:"answer___3N5FQ",activeAnswer:"activeAnswer___3zdHK",deleteIcon:"deleteIcon___U7nIS",addIcon:"addIcon___2tuSF",editorWrap:"editorWrap___ZOK2K",htmlWrap:"htmlWrap___3X_dl",radio:"radio___wS7N0",color333:"color333___S1zDX",color999:"color999___VJwGv",questionType:"questionType___BHDve",questionChoices:"questionChoices___3YAfc"}},ji0R:function(Pe,Le,Z){Pe.exports=Z.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(Pe,Le,Z){Pe.exports=Z.p+"static/question.cb52bef9.gif"},kPYp:function(Pe,Le){Pe.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+CzfOVcqSiq0BMPdRpiBUNANmHNvJUQo1ZFls0lTuX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),ne=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ce=function(We,Je){var qe=We.problemset,De=We.globalSetting,Fe=We.loading,Be=We.dispatch,$e=We.onRef,Qe=$e===void 0?function(){}:$e,Me=We.editData,He=Object(L.a)(We,["problemset","globalSetting","loading","dispatch","onRef","editData"]),rt=Object(c.useState)([]),st=Object(m.a)(rt,2),Xe=st[0],Ye=st[1],ct=Object(c.useState)(),nt=Object(m.a)(ct,2),it=nt[0],Ae=nt[1],dt=Object(c.useState)([]),at=Object(m.a)(dt,2),we=at[0],Ne=at[1],ge=Object(c.useState)(""),de=Object(m.a)(ge,2),fe=de[0],te=de[1],re=Object(c.useState)(5),ae=Object(m.a)(re,2),le=ae[0],pe=ae[1],Ce=Object(c.useState)(!1),Oe=Object(m.a)(Ce,2),ot=Oe[0],mt=Oe[1],ht=Object(V.i)();Object(c.useEffect)(function(){Ye(["","","",""])},[]),Object(c.useEffect)(function(){var Ht,It;if(!(Me!=null&&Me.challenge_id)){mt(!0);return}te(Me==null?void 0:Me.subject),pe(parseInt(Me==null?void 0:Me.question_score)),Ye(Me==null||((Ht=Me.choose_contents)===null||Ht===void 0)?void 0:Ht.map(function(Mt){return Mt.option_name}));var xt=[];Me==null||((It=Me.standard_answer)===null||It===void 0)||It.split("").map(function(Mt,jt){xt.push(ne.indexOf(Mt))}),Ne(xt)},[Me]),Object(c.useImperativeHandle)(Je,function(){return{onSave:At,onReset:Lt,isEdit:ot}});var Lt=function(){Ye(["","","",""]),te(""),Ne([])},At=function(){var Ht=Object(d.a)(p.a.mark(function It(){var xt,Mt;return p.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(fe){lt.next=3;break}return o.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),lt.abrupt("return",!1);case 3:if(xt=Xe.findIndex(function($t){return!$t}),!(xt>-1)){lt.next=7;break}return o.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ne[xt]," \u9009\u9879\u7684\u5185\u5BB9")),lt.abrupt("return",!1);case 7:if(we.length){lt.next=10;break}return o.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),lt.abrupt("return",!1);case 10:if(!(we.length<1)){lt.next=13;break}return o.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),lt.abrupt("return",!1);case 13:return Mt=Xe.map(function($t,ar){return{choice_text:$t,is_answer:!!we.includes(ar)}}),lt.abrupt("return",{subject:fe,question:{cnt:Mt.map(function($t){return $t.choice_text})},choice:{answer:Mt.map(function($t){return $t.is_answer})}});case 15:case"end":return lt.stop()}},It)}));return function(){return Ht.apply(this,arguments)}}(),ft=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Ft=function(){var Ht=Object(d.a)(p.a.mark(function It(xt){return p.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:jt.t0=xt.id,jt.next=jt.t0==="del"?3:jt.t0==="up"||jt.t0==="down"?5:jt.t0==="edit"?9:11;break;case 3:return G.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(d.a)(p.a.mark(function $t(){return p.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object($.n)({id:Me.question_id});case 2:Be({type:"exercise/editExercise",payload:Object(u.a)({},ht)});case 3:case"end":return ir.stop()}},$t)}))()}}),jt.abrupt("break",11);case 5:return jt.next=7,Be({type:"exercise/exeriseMoveUpDown",payload:{id:Me.question_id,opr:xt.id}});case 7:return Be({type:"exercise/editExercise",payload:Object(u.a)({},ht)}),jt.abrupt("break",11);case 9:return mt(!0),jt.abrupt("break",11);case 11:case"end":return jt.stop()}},It)}));return function(xt){return Ht.apply(this,arguments)}}(),kt=function(){var It;return s.a.createElement("aside",null,s.a.createElement("p",{className:ee.a.titleWrap},s.a.createElement("span",{className:ee.a.required},"*"),s.a.createElement("span",{className:ee.a.title},"\u9898\u5E72\uFF1A")),s.a.createElement(y.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:fe,onChange:function(Mt){return te(Mt)}}),s.a.createElement("p",{className:ee.a.titleWrap},s.a.createElement("span",{className:ee.a.required},"*"),s.a.createElement("span",{className:ee.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",s.a.createElement("span",{className:ee.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xe.map(function(xt,Mt){return s.a.createElement("div",{className:ee.a.choiceWrap,key:Mt},s.a.createElement(Y.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},s.a.createElement("div",{className:"".concat(ee.a.answer," ").concat(we.includes(Mt)?ee.a.activeAnswer:""),onClick:function(){we.includes(Mt)?Ne(we.filter(function(lt){return lt!==Mt})):Ne([].concat(Object(C.a)(we),[Mt]))}},ne[Mt])),s.a.createElement("div",{className:ee.a.editorWrap},it===Mt?s.a.createElement(y.a,{id:"single-question-option-".concat(Mt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:xt,onChange:function(lt){Xe[Mt]=lt,Ye(Xe)}}):s.a.createElement("div",{className:ee.a.htmlWrap,onClick:function(){return Ae(Mt)}},s.a.createElement(z.a,{value:xt}))),Mt>1&&s.a.createElement(Y.a,{title:"\u5220\u9664"},s.a.createElement("i",{className:"".concat(ee.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Ye(Xe.filter(function(lt,$t){return $t!==Mt}))}})),Mt<7&&Mt===Xe.length-1&&s.a.createElement(Y.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},s.a.createElement("i",{className:"".concat(ee.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Ye([].concat(Object(C.a)(Xe),[""]))}})))}),s.a.createElement(_.a,{className:"mt10"},s.a.createElement(U.a,{flex:"1"},s.a.createElement("p",{className:"c-grey-999"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")),s.a.createElement(U.a,null,"\u6807\u51C6\u7B54\u6848\uFF1A",s.a.createElement("span",{className:"c-orange"},we==null||((It=we.sort(function(xt,Mt){return xt-Mt}))===null||It===void 0)?void 0:It.map(function(xt){return ne[xt]})))))};return s.a.createElement("section",{className:ee.a.wrap},kt())},ve=Object(a.a)(function(Ve){var We=Ve.problemset,Je=Ve.loading,qe=Ve.globalSetting;return{problemset:We,globalSetting:qe,loading:Je.effects}},null,null,{forwardRef:!0})(Object(c.forwardRef)(ce)),Ie=Z("1vsH"),xe=Z("zEei"),Ee=Z.n(xe),Te=Z("CJF0"),Se=Z("2RCv"),me={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},se=function(We){var Je,qe=We.shixunsDetail,De=We.dispatch,Fe=We.loading,Be=We.match,$e=We.location,Qe=Object(L.a)(We,["shixunsDetail","dispatch","loading","match","location"]),Me=g.a.useForm(),He=Object(m.a)(Me,1),rt=He[0],st=Object(c.useState)({}),Xe=Object(m.a)(st,2),Ye=Xe[0],ct=Xe[1],nt=Object(c.useState)(!1),it=Object(m.a)(nt,2),Ae=it[0],dt=it[1],at=Object(c.useState)(!0),we=Object(m.a)(at,2),Ne=we[0],ge=we[1],de=Object(c.useState)(),fe=Object(m.a)(de,2),te=fe[0],re=fe[1],ae=Object(c.useState)([10,20]),le=Object(m.a)(ae,2),pe=le[0],Ce=le[1],Oe=Object(c.useState)(!1),ot=Object(m.a)(Oe,2),mt=ot[0],ht=ot[1],Lt=Object(c.useState)({}),At=Object(m.a)(Lt,2),ft=At[0],Ft=At[1],kt=qe.challengesEdit,Ht=qe.editChallengesQuestion,It=Object(c.useRef)(),xt=function(){var Xt=Object(d.a)(p.a.mark(function yt(){var ze;return p.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,De({type:"shixunsDetail/getChallengesEdit",payload:Object(u.a)({},Be.params)});case 2:ze=wt.sent,rt.setFieldsValue(Object(u.a)({},ze));case 4:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),Mt=function(){var Xt=Object(d.a)(p.a.mark(function yt(){var ze;return p.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Be.params.questionId){wt.next=7;break}return wt.next=3,De({type:"shixunsDetail/getEditChallengesQuestion",payload:Object(u.a)({},Be.params)});case 3:ze=wt.sent,rt.setFieldsValue({challenge_tag:ze.tags,difficult:ze.difficult,score:ze.score,answer:ze.answer}),Ce(me[ze.difficult]),Ft(ze);case 7:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}();Object(c.useEffect)(function(){xt(),Be.params.questionId&&(re(!0),Mt(),dt(!0))},[$e.pathname]);var jt=function(){var Xt=Object(d.a)(p.a.mark(function yt(){var ze,Kt,wt,tr;return p.a.wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:return Kt="",wt=Object(u.a)({},Ye),ur.next=4,It.current.onSave();case 4:return tr=ur.sent,(ze=tr.choice)===null||ze===void 0||ze.answer.map(function(bt,ri){bt&&(Kt+=Ie.o[ri])}),ur.abrupt("return",{challenge_choose:{subject:tr.subject,answer:Ye.task_pass,standard_answer:Kt,score:Ye.score,difficult:Ye.difficult},challenge_tag:Ye.challenge_tag,question:tr.question,choice:tr.choice});case 7:case"end":return ur.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),lt=function(yt){var ze=me[yt],Kt=ze==null?void 0:ze[0];Ce(ze),rt.setFieldsValue({score:Kt}),ct(Object(u.a)(Object(u.a)({},rt.getFieldsValue()),{score:Kt}))},$t=function(yt,ze){ct(Object(u.a)({},rt.getFieldsValue())),"difficult"in yt&<(yt.difficult)},ar=function(){var Xt=Object(d.a)(p.a.mark(function yt(){var ze;return p.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.t0=v.w,wt.t1=u.a,wt.t2=u.a,wt.t3={},wt.next=6,jt();case 6:return wt.t4=wt.sent,wt.t5=(0,wt.t2)(wt.t3,wt.t4),wt.t6=Be.params,wt.t7=(0,wt.t1)(wt.t5,wt.t6),wt.next=12,(0,wt.t0)(wt.t7);case 12:ze=wt.sent,(ze==null?void 0:ze.status)===1&&o.b.success("\u5220\u9664\u6210\u529F"),Qe.history.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion"));case 15:case"end":return wt.stop()}},yt)}));return function(){return Xt.apply(this,arguments)}}(),ir=function(){var Xt=Object(d.a)(p.a.mark(function yt(ze){var Kt,wt,tr,Ot;return p.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(Kt=Object(u.a)({},Ye),ht(!0),Ne){bt.next=20;break}return bt.t0=v.c,bt.t1=u.a,bt.t2=u.a,bt.t3={},bt.next=9,jt();case 9:return bt.t4=bt.sent,bt.t5=(0,bt.t2)(bt.t3,bt.t4),bt.t6=Be.params,bt.t7=(0,bt.t1)(bt.t5,bt.t6),bt.next=15,(0,bt.t0)(bt.t7);case 15:wt=bt.sent,ht(!1),wt.challenge_choose_id&&(o.b.success("\u64CD\u4F5C\u6210\u529F"),Qe.history.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion/").concat(wt.challenge_choose_id))),bt.next=45;break;case 20:if(!Be.params.questionId){bt.next=38;break}return bt.t8=v.Nb,bt.t9=u.a,bt.t10=u.a,bt.t11={},bt.next=27,jt();case 27:return bt.t12=bt.sent,bt.t13=(0,bt.t10)(bt.t11,bt.t12),bt.t14=Be.params,bt.t15=(0,bt.t9)(bt.t13,bt.t14),bt.next=33,(0,bt.t8)(bt.t15);case 33:tr=bt.sent,ht(!1),tr.challenge_choose_id&&o.b.success("\u64CD\u4F5C\u6210\u529F"),bt.next=45;break;case 38:return Kt.identifier=Be.params.id,Kt.st=1,bt.next=42,Object(v.Mb)(Object(u.a)(Object(u.a)({},Kt),Be.params));case 42:Ot=bt.sent,ht(!1),Ot.challenge_id&&o.b.success("\u64CD\u4F5C\u6210\u529F");case 45:case"end":return bt.stop()}},yt)}));return function(ze){return Xt.apply(this,arguments)}}(),Mr=function(){var yt;return s.a.createElement("div",null,s.a.createElement("div",{className:Ee.a.fieldWrap},s.a.createElement(g.a.Item,{name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},s.a.createElement(E.a,{maxLength:60,suffix:"".concat(((yt=Ye.subject)===null||yt===void 0?void 0:yt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),s.a.createElement("div",{className:Ee.a.mdWrap},s.a.createElement(g.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(y.a,{watch:!0,defaultValue:kt.task_pass}))),s.a.createElement("div",{className:Ee.a.backgroundFa},s.a.createElement("div",{className:"pt40 mb30"},s.a.createElement(g.a.Item,null,s.a.createElement(D.a,{size:"large",type:"primary",className:"".concat(Ee.a.button," mr20"),htmlType:"submit",loading:mt},"\u63D0\u4EA4"),s.a.createElement(D.a,{size:"large",type:"primary",ghost:!0,className:Ee.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Be.params.id,"/challenges"))}},"\u53D6\u6D88")))))},ti=function(){var yt,ze;return s.a.createElement("div",null,s.a.createElement("div",{className:"bg-white"},s.a.createElement(ve,{ref:It,editData:ft})),s.a.createElement("div",{className:Ee.a.mdWrap},s.a.createElement(g.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},s.a.createElement(y.a,{watch:!0,defaultValue:Ne?Ht.answer:""})),s.a.createElement(g.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},s.a.createElement(w.a.Group,{disabled:((yt=qe.detail)===null||yt===void 0?void 0:yt.shixun_status)===2},s.a.createElement(w.a,{value:1},"\u7B80\u5355"),s.a.createElement(w.a,{value:2},"\u4E2D\u7B49"),s.a.createElement(w.a,{value:3},"\u56F0\u96BE"))),s.a.createElement(_.a,null,s.a.createElement(U.a,null,s.a.createElement(g.a.Item,{name:"score",label:"\u5956\u52B1\u7ECF\u9A8C\u503C:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},s.a.createElement(M.a,{disabled:((ze=qe.detail)===null||ze===void 0?void 0:ze.shixun_status)===2},pe.map(function(Kt){return s.a.createElement(M.a.Option,{key:Kt,value:Kt},Kt)})))),s.a.createElement(U.a,{flex:1},s.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5982\u679C\u5B66\u5458\u7B54\u9898\u9519\u8BEF\uFF0C\u5219\u4E0D\u80FD\u5F97\u5230\u76F8\u5E94\u7684\u7ECF\u9A8C\u503C",s.a.createElement("br",null),"\u5982\u679C\u5B66\u5458\u6210\u529F\u5F97\u5230\u7ECF\u9A8C\u503C\uFF0C\u90A3\u4E48\u5C06\u540C\u65F6\u83B7\u5F97\u7B49\u503C\u7684\u91D1\u5E01\u5956\u52B1\uFF0C\u5982\uFF1A+10\u7ECF\u9A8C\u503C\u3001+10\u91D1\u5E01"))),s.a.createElement(g.a.Item,{name:"challenge_tag",label:s.a.createElement("div",null,"\u6280\u80FD\u6807\u7B7E ",s.a.createElement("span",{className:"pl20 font12 c-light-black"},"\u5B66\u5458\u7B54\u9898\u6B63\u786E\u5C06\u83B7\u5F97\u6280\u80FD\uFF0C\u5426\u5219\u4E0D\u80FD\u83B7\u5F97\u6280\u80FD\uFF08\u56DE\u8F66\u6DFB\u52A0\u6807\u7B7E\uFF09")),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6280\u80FD\u6807\u7B7E"}]},s.a.createElement(Se.a,{placeholder:"\u6DFB\u52A0\u6807\u7B7E"}))),s.a.createElement("div",{className:Ee.a.backgroundFa},s.a.createElement(_.a,{className:"pt40 mb30"},s.a.createElement(U.a,{flex:1},s.a.createElement(g.a.Item,null,s.a.createElement(D.a,{size:"large",type:"primary",className:"".concat(Ee.a.button," mr20"),htmlType:"submit",loading:mt},"\u63D0\u4EA4"),s.a.createElement(D.a,{size:"large",type:"primary",ghost:!0,className:Ee.a.button,onClick:function(){return a.d.push("/shixuns/".concat(Be.params.id,"/challenges"))}},"\u53D6\u6D88"))),s.a.createElement(U.a,null,te&&s.a.createElement(D.a,{size:"large",ghost:!0,className:"".concat(Ee.a.button," ").concat(Ee.a.deleteButton),onClick:ar},"\u5220\u9664")))))};return s.a.createElement("section",{className:Ee.a.bg},s.a.createElement(Te.a,{data:kt,title:"\u9009\u62E9\u9898"}),s.a.createElement(g.a,{form:rt,className:Ee.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:$t,onFinish:ir,initialValues:{difficult:1,score:10}},s.a.createElement("aside",{className:["bg-white",Ee.a.navBar].join(" ")},s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion"))}},s.a.createElement("strong",{className:"current"},"\u672C\u5173\u4EFB\u52A1")),kt==null||((Je=kt.chooses)===null||Je===void 0)?void 0:Je.map(function(Xt,yt){return s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){a.d.replace("/shixuns/".concat(Be.params.id,"/challenges/").concat(Be.params.challengesId,"/editquestion/").concat(Xt.choose_id))}},s.a.createElement("strong",{className:"current ".concat(Be.params.questionId==Xt.choose_id&&Ne?Ee.a.actived:"")},Xt.type===1?"\u5355\u9009\u9898":"\u591A\u9009\u9898"))}),Ne&&s.a.createElement(Q.a,{title:"\u5207\u6362\u524D\u8BF7\u786E\u8BA4\u5F53\u524D\u9009\u62E9\u9898\u5DF2\u63D0\u4EA4\uFF0C\u5426\u5219\u4E0D\u4F1A\u4FDD\u5B58\u4F60\u5F53\u524D\u6240\u6709\u8F93\u5165\uFF01",onConfirm:function(){dt(!0),ge(!1),Ft({}),It.current&&It.current.onReset(),rt.resetFields()}},s.a.createElement(Y.a,{title:"\u65B0\u589E\u9009\u62E9\u9898"},s.a.createElement("span",{className:Ee.a.addButton,onClick:function(){}},"+"))),!Ne&&s.a.createElement("strong",{className:Ee.a.actived},"\u9009\u62E9\u9898")),!Ae&&Mr(),Ae&&ti()))},ke=Le.default=Object(a.a)(function(Ve){var We=Ve.shixunsDetail,Je=Ve.newCourse,qe=Ve.loading,De=Ve.globalSetting;return{shixunsDetail:We,newCourse:Je,globalSetting:De,loading:qe.effects}})(se)},l2Kq:function(Pe,Le,Z){Pe.exports=Z.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(Y,R){var Q=ie.getMode(Y,"text/html"),B=Q.name=="null";function _(z){if(ie.findModeByName){var j=ie.findModeByName(z);j&&(z=j.mime||j.mimes[0])}var ee=ie.getMode(Y,z);return ee.name=="null"?null:ee}R.highlightFormatting===void 0&&(R.highlightFormatting=!1),R.maxBlockquoteDepth===void 0&&(R.maxBlockquoteDepth=0),R.taskLists===void 0&&(R.taskLists=!1),R.strikethrough===void 0&&(R.strikethrough=!1),R.emoji===void 0&&(R.emoji=!1),R.fencedCodeBlockHighlighting===void 0&&(R.fencedCodeBlockHighlighting=!0),R.fencedCodeBlockDefaultMode===void 0&&(R.fencedCodeBlockDefaultMode="text/plain"),R.xml===void 0&&(R.xml=!0),R.tokenTypeOverrides===void 0&&(R.tokenTypeOverrides={});var H={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 U in H)H.hasOwnProperty(U)&&R.tokenTypeOverrides[U]&&(H[U]=R.tokenTypeOverrides[U]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,w=R.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,T=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,E=/^\s*\[[^\]]+?\]:.*$/,h=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,o=" ";function u(z,j,ee){return j.f=j.inline=ee,ee(z,j)}function d(z,j,ee){return j.f=j.block=ee,ee(z,j)}function A(z){return!z||!/\S/.test(z.string)}function g(z){if(z.linkTitle=!1,z.linkHref=!1,z.linkText=!1,z.em=!1,z.strong=!1,z.strikethrough=!1,z.quote=0,z.indentedCode=!1,z.f==L){var j=B;if(!j){var ee=ie.innerMode(Q,z.htmlState);j=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}j&&(z.f=s,z.block=m,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function m(z,j){var ee=z.column()===j.indentation,ne=A(j.prevLine.stream),ce=j.indentedCode,ve=j.prevLine.hr,Ie=j.list!==!1,xe=(j.listStack[j.listStack.length-1]||0)+3;j.indentedCode=!1;var Ee=j.indentation;if(j.indentationDiff===null&&(j.indentationDiff=j.indentation,Ie)){for(j.list=null;Ee=4&&(ce||j.prevLine.fencedCodeEnd||j.prevLine.header||ne))return z.skipToEnd(),j.indentedCode=!0,H.code;if(z.eatSpace())return null;if(ee&&j.indentation<=xe&&(me=z.match(w))&&me[1].length<=6)return j.quote=0,j.header=me[1].length,j.thisLine.header=!0,R.highlightFormatting&&(j.formatting="header"),j.f=j.inline,p(j);if(j.indentation<=xe&&z.eat(">"))return j.quote=ee?1:j.quote+1,R.highlightFormatting&&(j.formatting="quote"),z.eatSpace(),p(j);if(!Se&&!j.setext&&ee&&j.indentation<=xe&&(me=z.match(M))){var se=me[1]?"ol":"ul";return j.indentation=Ee+z.current().length,j.list=!0,j.quote=0,j.listStack.push(j.indentation),j.em=!1,j.strong=!1,j.code=!1,j.strikethrough=!1,R.taskLists&&z.match(b,!1)&&(j.taskList=!0),j.f=j.inline,R.highlightFormatting&&(j.formatting=["list","list-"+se]),p(j)}else{if(ee&&j.indentation<=xe&&(me=z.match(T,!0)))return j.quote=0,j.fencedEndRE=new RegExp(me[1]+"+ *$"),j.localMode=R.fencedCodeBlockHighlighting&&_(me[2]||R.fencedCodeBlockDefaultMode),j.localMode&&(j.localState=ie.startState(j.localMode)),j.f=j.block=x,R.highlightFormatting&&(j.formatting="code-block"),j.code=-1,p(j);if(j.setext||(!Te||!Ie)&&!j.quote&&j.list===!1&&!j.code&&!Se&&!E.test(z.string)&&(me=z.lookAhead(1))&&(me=me.match(k)))return j.setext?(j.header=j.setext,j.setext=0,z.skipToEnd(),R.highlightFormatting&&(j.formatting="header")):(j.header=me[0].charAt(0)=="="?1:2,j.setext=j.header),j.thisLine.header=!0,j.f=j.inline,p(j);if(Se)return z.skipToEnd(),j.hr=!0,j.thisLine.hr=!0,H.hr;if(z.peek()==="[")return u(z,j,P)}return u(z,j,j.inline)}function L(z,j){var ee=Q.token(z,j.htmlState);if(!B){var ne=ie.innerMode(Q,j.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||j.md_inside&&z.current().indexOf(">")>-1)&&(j.f=s,j.block=m,j.htmlState=null)}return ee}function x(z,j){var ee=j.listStack[j.listStack.length-1]||0,ne=j.indentation=z.quote?j.push(H.formatting+"-"+z.formatting[ee]+"-"+z.quote):j.push("error"))}if(z.taskOpen)return j.push("meta"),j.length?j.join(" "):null;if(z.taskClosed)return j.push("property"),j.length?j.join(" "):null;if(z.linkHref?j.push(H.linkHref,"url"):(z.strong&&j.push(H.strong),z.em&&j.push(H.em),z.strikethrough&&j.push(H.strikethrough),z.emoji&&j.push(H.emoji),z.linkText&&j.push(H.linkText),z.code&&j.push(H.code),z.image&&j.push(H.image),z.imageAltText&&j.push(H.imageAltText,"link"),z.imageMarker&&j.push(H.imageMarker)),z.header&&j.push(H.header,H.header+"-"+z.header),z.quote&&(j.push(H.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=z.quote?j.push(H.quote+"-"+z.quote):j.push(H.quote+"-"+R.maxBlockquoteDepth)),z.list!==!1){var ne=(z.listStack.length-1)%3;ne?ne===1?j.push(H.list2):j.push(H.list3):j.push(H.list1)}return z.trailingSpaceNewLine?j.push("trailing-space-new-line"):z.trailingSpace&&j.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),j.length?j.join(" "):null}function c(z,j){return z.match(D,!0)?p(j):void 0}function s(z,j){var ee=j.text(z,j);if(typeof ee!="undefined")return ee;if(j.list)return j.list=null,p(j);if(j.taskList){var ne=z.match(b,!0)[1]===" ";return ne?j.taskOpen=!0:j.taskClosed=!0,R.highlightFormatting&&(j.formatting="task"),j.taskList=!1,p(j)}if(j.taskOpen=!1,j.taskClosed=!1,j.header&&z.match(/^#+$/,!0))return R.highlightFormatting&&(j.formatting="header"),p(j);var ce=z.next();if(j.linkTitle){j.linkTitle=!1;var ve=ce;ce==="("&&(ve=")"),ve=(ve+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ie="^\\s*(?:[^"+ve+"\\\\]+|\\\\\\\\|\\\\.)"+ve;if(z.match(new RegExp(Ie),!0))return H.linkHref}if(ce==="`"){var xe=j.formatting;R.highlightFormatting&&(j.formatting="code"),z.eatWhile("`");var Ee=z.current().length;if(j.code==0&&(!j.quote||Ee==1))return j.code=Ee,p(j);if(Ee==j.code){var Te=p(j);return j.code=0,Te}else return j.formatting=xe,p(j)}else if(j.code)return p(j);if(ce==="\\"&&(z.next(),R.highlightFormatting)){var Se=p(j),me=H.formatting+"-escape";return Se?Se+" "+me:me}if(ce==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return j.imageMarker=!0,j.image=!0,R.highlightFormatting&&(j.formatting="image"),p(j);if(ce==="["&&j.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return j.imageMarker=!1,j.imageAltText=!0,R.highlightFormatting&&(j.formatting="image"),p(j);if(ce==="]"&&j.imageAltText){R.highlightFormatting&&(j.formatting="image");var Se=p(j);return j.imageAltText=!1,j.image=!1,j.inline=j.f=y,Se}if(ce==="["&&!j.image)return j.linkText&&z.match(/^.*?\]/)||(j.linkText=!0,R.highlightFormatting&&(j.formatting="link")),p(j);if(ce==="]"&&j.linkText){R.highlightFormatting&&(j.formatting="link");var Se=p(j);return j.linkText=!1,j.inline=j.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?y:s,Se}if(ce==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=a,R.highlightFormatting&&(j.formatting="link");var Se=p(j);return Se?Se+=" ":Se="",Se+H.linkInline}if(ce==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){j.f=j.inline=a,R.highlightFormatting&&(j.formatting="link");var Se=p(j);return Se?Se+=" ":Se="",Se+H.linkEmail}if(R.xml&&ce==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=z.string.indexOf(">",z.pos);if(se!=-1){var ke=z.string.substring(z.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ke)&&(j.md_inside=!0)}return z.backUp(1),j.htmlState=ie.startState(Q),d(z,j,L)}if(R.xml&&ce==="<"&&z.match(/^\/\w*?>/))return j.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var Ve=1,We=z.pos==1?" ":z.string.charAt(z.pos-2);Ve<3&&z.eat(ce);)Ve++;var Je=z.peek()||" ",qe=!/\s/.test(Je)&&(!h.test(Je)||/\s/.test(We)||h.test(We)),De=!/\s/.test(We)&&(!h.test(We)||/\s/.test(Je)||h.test(Je)),Fe=null,Be=null;if(Ve%2&&(!j.em&&qe&&(ce==="*"||!De||h.test(We))?Fe=!0:j.em==ce&&De&&(ce==="*"||!qe||h.test(Je))&&(Fe=!1)),Ve>1&&(!j.strong&&qe&&(ce==="*"||!De||h.test(We))?Be=!0:j.strong==ce&&De&&(ce==="*"||!qe||h.test(Je))&&(Be=!1)),Be!=null||Fe!=null){R.highlightFormatting&&(j.formatting=Fe==null?"strong":Be==null?"em":"strong em"),Fe===!0&&(j.em=ce),Be===!0&&(j.strong=ce);var Te=p(j);return Fe===!1&&(j.em=!1),Be===!1&&(j.strong=!1),Te}}else if(ce===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return p(j);z.backUp(1)}if(R.strikethrough){if(ce==="~"&&z.eatWhile(ce)){if(j.strikethrough){R.highlightFormatting&&(j.formatting="strikethrough");var Te=p(j);return j.strikethrough=!1,Te}else if(z.match(/^[^\s]/,!1))return j.strikethrough=!0,R.highlightFormatting&&(j.formatting="strikethrough"),p(j)}else if(ce===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return p(j);z.backUp(2)}}if(R.emoji&&ce===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){j.emoji=!0,R.highlightFormatting&&(j.formatting="emoji");var $e=p(j);return j.emoji=!1,$e}return ce===" "&&(z.match(/^ +$/,!1)?j.trailingSpace++:j.trailingSpace&&(j.trailingSpaceNewLine=!0)),p(j)}function a(z,j){var ee=z.next();if(ee===">"){j.f=j.inline=s,R.highlightFormatting&&(j.formatting="link");var ne=p(j);return ne?ne+=" ":ne="",ne+H.linkInline}return z.match(/^[^>]+/,!0),H.linkInline}function y(z,j){if(z.eatSpace())return null;var ee=z.next();return ee==="("||ee==="["?(j.f=j.inline=C(ee==="("?")":"]"),R.highlightFormatting&&(j.formatting="link-string"),j.linkHref=!0,p(j)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(z){return function(j,ee){var ne=j.next();if(ne===z){ee.f=ee.inline=s,R.highlightFormatting&&(ee.formatting="link-string");var ce=p(ee);return ee.linkHref=!1,ce}return j.match(v[z]),ee.linkHref=!0,p(ee)}}function P(z,j){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(j.f=G,z.next(),R.highlightFormatting&&(j.formatting="link"),j.linkText=!0,p(j)):u(z,j,s)}function G(z,j){if(z.match(/^\]:/,!0)){j.f=j.inline=V,R.highlightFormatting&&(j.formatting="link");var ee=p(j);return j.linkText=!1,ee}return z.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function V(z,j){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?j.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),j.f=j.inline=s,H.linkHref+" url")}var $={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,htmlState:null,indentation:0,inline:s,text:c,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&ie.copyState(Q,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?ie.copyState(z.localMode,z.localState):null,inline:z.inline,text:z.text,formatting:!1,linkText:z.linkText,linkTitle:z.linkTitle,linkHref:z.linkHref,code:z.code,em:z.em,strong:z.strong,strikethrough:z.strikethrough,emoji:z.emoji,header:z.header,setext:z.setext,hr:z.hr,taskList:z.taskList,list:z.list,listStack:z.listStack.slice(0),quote:z.quote,indentedCode:z.indentedCode,trailingSpace:z.trailingSpace,trailingSpaceNewLine:z.trailingSpaceNewLine,md_inside:z.md_inside,fencedEndRE:z.fencedEndRE}},token:function(z,j){if(j.formatting=!1,z!=j.thisLine.stream){if(j.header=0,j.hr=!1,z.match(/^\s*$/,!0))return g(j),null;if(j.prevLine=j.thisLine,j.thisLine={stream:z},j.taskList=!1,j.trailingSpace=0,j.trailingSpaceNewLine=!1,!j.localState&&(j.f=j.block,j.f!=L)){var ee=z.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(j.indentation=ee,j.indentationDiff=null,ee>0)return null}}return j.f(z,j)},innerMode:function(z){return z.block==L?{state:z.htmlState,mode:Q}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:$}},indent:function(z,j,ee){return z.block==L&&Q.indent?Q.indent(z.htmlState,j,ee):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,j,ee):ie.Pass},blankLine:g,getType:p,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return $},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},lzim:function(Pe,Le,Z){"use strict";var ie=Z("E7E6"),Y=Z.n(ie);Z.d(Le,"x",function(){return Y.a});var R=Z("/GNS"),Q=Z.n(R);Z.d(Le,"w",function(){return Q.a});var B=Z("FOrL"),_=Z.n(B);Z.d(Le,"q",function(){return _.a});var H=Z("HpTS"),U=Z.n(H);Z.d(Le,"y",function(){return U.a});var O=Z("tWlo"),M=Z.n(O);Z.d(Le,"a",function(){return M.a});var b=Z("7ZXX"),w=Z.n(b);Z.d(Le,"l",function(){return w.a});var k=Z("GABl"),D=Z.n(k);Z.d(Le,"e",function(){return D.a});var T=Z("onxn"),E=Z.n(T);Z.d(Le,"n",function(){return E.a});var h=Z("nKGa"),o=Z.n(h);Z.d(Le,"m",function(){return o.a});var u=Z("4qgm"),d=Z.n(u);Z.d(Le,"A",function(){return d.a});var A=Z("JeFH"),g=Z.n(A);Z.d(Le,"b",function(){return g.a});var m=Z("ji0R"),L=Z.n(m);Z.d(Le,"i",function(){return L.a});var x=Z("W6BS"),p=Z.n(x);Z.d(Le,"B",function(){return p.a});var c=Z("kPYp"),s=Z.n(c);Z.d(Le,"C",function(){return s.a});var a=Z("nukY"),y=Z.n(a),v=Z("4u4S"),C=Z.n(v),P=Z("yslc"),G=Z.n(P),V=Z("l2Kq"),$=Z.n(V),z=Z("RMFE"),j=Z.n(z);Z.d(Le,"o",function(){return j.a});var ee=Z("TGq3"),ne=Z.n(ee),ce=Z("SMhR"),ve=Z.n(ce);Z.d(Le,"z",function(){return ve.a});var Ie=Z("8/bI"),xe=Z.n(Ie);Z.d(Le,"j",function(){return xe.a});var Ee=Z("JWDV"),Te=Z.n(Ee),Se=Z("Xsq0"),me=Z.n(Se);Z.d(Le,"p",function(){return me.a});var se=Z("Ohmc"),ke=Z.n(se);Z.d(Le,"c",function(){return ke.a});var Ve=Z("csWT"),We=Z.n(Ve);Z.d(Le,"d",function(){return We.a});var Je=Z("7v3h"),qe=Z.n(Je);Z.d(Le,"k",function(){return qe.a});var De=Z("cRFk"),Fe=Z.n(De);Z.d(Le,"v",function(){return Fe.a});var Be=Z("kPWJ"),$e=Z.n(Be);Z.d(Le,"u",function(){return $e.a});var Qe=Z("qgvg"),Me=Z.n(Qe);Z.d(Le,"r",function(){return Me.a});var He=Z("FPkq"),rt=Z.n(He);Z.d(Le,"t",function(){return rt.a});var st=Z("A/g1"),Xe=Z.n(st);Z.d(Le,"f",function(){return Xe.a});var Ye=Z("Nmxd"),ct=Z.n(Ye);Z.d(Le,"g",function(){return ct.a});var nt=Z("5D2P"),it=Z.n(nt);Z.d(Le,"h",function(){return it.a});var Ae=Z("djh8"),dt=Z.n(Ae);Z.d(Le,"s",function(){return dt.a});var at=Z("Jq4h"),we=Z.n(at)},nKGa:function(Pe,Le,Z){Pe.exports=Z.p+"static/export_exercise-template.f7655c19.png"},nZ20:function(Pe,Le,Z){Pe.exports={icons:"icons___3O80F"}},nukY:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJTBVYzm24yRO4ty3kziJj9ie+tC/d9oaT2b67ume7irJsjdbVf19X/266quvjjaEEG8w8yukk7ZAii1gMHODEOK3RPRSivXUqmXcAgb07+jomDk2NvYPZn4u4/bQ6qfUAiboSEKI5cz8XyJanVJdtVoZtsAE6EXYdzPzv4hoToZtolVPoQUmgV6E/QVm/hMRNaVQX61SRi3wDOiwg5Tya0qpn2TUJlrtFFqgIujFnv27zPztFOqsVcqgBaqCzsyGlPJXzPy5DNpFq5wyC1QFHXr29fVN6+/v/zszfyBlemt1MmYBW9Bhi3w+v7hQKJwkog0Zs41WN0UWcAS96K9vI6J3mHl+inTXqmTIAq5Ahz1yudxHDcN4k5mbM2QfrWpKLO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D13lt4lpb2ZQc0qegnTeyyKOv2QE5FO3OSgzvFjjporyX6qKNwdMU/6UxpWTfmsuOFCrtZT8WKMKqyJkdbfSPpn5nql4XamMamN5GB0TvUK4KE6HbTqS5ma+eahgtO2ZY9fx2TlKtVziZp3Zl/FigUiZ3wOIYWZ/52pLR35oOU6oPtuw+dNdl6QfsAHmYlMZcEpiXsak6tnQY70bWubrUepjkNJTKTbGv8s8SSlOaD5Z0LwhL4XWmQvSa42rWrgf7+Fn7byVVV5KX6mLbTWcKueEa6etz+M+OphwqlZtmnSUME1bjJyb6vOmm8tc3PvrCeMIJZTLt5zBb1i59tUxuvDeRm+14RscbD1IB9Uo6ZnHRfp2XsX4489Ujy8eT08YTAjSg6Plf333p9HDLpzPlpnEvg4kYH83TrZrxcugy7IkU4SnrdszlW6AS5iOzndzu2FAbexmKY2RCgDR5zVsfrFm2YSrc92cqveNe2xMF9pk4HZvFMmQwflxrqMZFXKub49R1+ZtOne5hJaZpwoAG1GpXjhf/YXuxTK37pyLFPZSGErM7JleYCPVGRN7kreaXsp45OnY7aAwN3xvQcH1b1y65VabMwzMU5zQ79bMKmLHLm2GCEXC0jUkVRSLUF6hdW62c8n7WyzXHfsianBVAg16rqGCOerYt+E4tuOIbviR3suK+cBp1Zdpp0GRVRfZl4/XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var Y=ie.Pos;function R(h,o){return h.line-o.line||h.ch-o.ch}var Q="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=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+Q+"]["+B+"]*)","g");function H(h,o,u,d){this.line=o,this.ch=u,this.cm=h,this.text=h.getLine(o),this.min=d?Math.max(d.from,h.firstLine()):h.firstLine(),this.max=d?Math.min(d.to-1,h.lastLine()):h.lastLine()}function U(h,o){var u=h.cm.getTokenTypeAt(Y(h.line,o));return u&&/\btag\b/.test(u)}function O(h){return h.line>=h.max?void 0:(h.ch=0,h.text=h.cm.getLine(++h.line),!0)}function M(h){return h.line<=h.min?void 0:(h.text=h.cm.getLine(--h.line),h.ch=h.text.length,!0)}function b(h){for(;;){var o=h.text.indexOf(">",h.ch);if(o==-1){if(O(h))continue;return}if(!U(h,o+1)){h.ch=o+1;continue}var u=h.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(h.text.slice(u+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function w(h){for(;;){var o=h.ch?h.text.lastIndexOf("<",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!U(h,o+1)){h.ch=o;continue}_.lastIndex=o,h.ch=o;var u=_.exec(h.text);if(u&&u.index==o)return u}}function k(h){for(;;){_.lastIndex=h.ch;var o=_.exec(h.text);if(!o){if(O(h))continue;return}if(!U(h,o.index+1)){h.ch=o.index+1;continue}return h.ch=o.index+o[0].length,o}}function D(h){for(;;){var o=h.ch?h.text.lastIndexOf(">",h.ch-1):-1;if(o==-1){if(M(h))continue;return}if(!U(h,o+1)){h.ch=o;continue}var u=h.text.lastIndexOf("/",o),d=u>-1&&!/\S/.test(h.text.slice(u+1,o));return h.ch=o+1,d?"selfClose":"regular"}}function T(h,o){for(var u=[];;){var d=k(h),A,g=h.line,m=h.ch-(d?d[0].length:0);if(!d||!(A=b(h)))return;if(A=="selfClose")continue;if(d[1]){for(var L=u.length-1;L>=0;--L)if(u[L]==d[2]){u.length=L;break}if(L<0&&(!o||o==d[2]))return{tag:d[2],from:Y(g,m),to:Y(h.line,h.ch)}}else u.push(d[2])}}function E(h,o){for(var u=[];;){var d=D(h);if(!d)return;if(d=="selfClose"){w(h);continue}var A=h.line,g=h.ch,m=w(h);if(!m)return;if(m[1])u.push(m[2]);else{for(var L=u.length-1;L>=0;--L)if(u[L]==m[2]){u.length=L;break}if(L<0&&(!o||o==m[2]))return{tag:m[2],from:Y(h.line,h.ch),to:Y(A,g)}}}}ie.registerHelper("fold","xml",function(h,o){for(var u=new H(h,o.line,0);;){var d=k(u);if(!d||u.line!=o.line)return;var A=b(u);if(!A)return;if(!d[1]&&A!="selfClose"){var g=Y(u.line,u.ch),m=T(u,d[2]);return m&&R(m.from,g)>0?{from:g,to:m.from}:null}}}),ie.findMatchingTag=function(h,o,u){var d=new H(h,o.line,o.ch,u);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var A=b(d),g=A&&Y(d.line,d.ch),m=A&&w(d);if(!A||!m||R(d,o)>0)return;var L={from:Y(d.line,d.ch),to:g,tag:m[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:m[1]?{open:E(d,m[2]),close:L,at:"close"}:(d=new H(h,g.line,g.ch,u),{open:L,close:T(d,m[2]),at:"open"})},ie.findEnclosingTag=function(h,o,u,d){for(var A=new H(h,o.line,o.ch,u);;){var g=E(A,d);if(!g)break;var m=new H(h,o.line,o.ch,u),L=T(m,g.tag);if(L)return{open:g,close:L}}},ie.scanForClosingTag=function(h,o,u,d){var A=new H(h,o.line,o.ch,d?{from:0,to:d}:null);return T(A,u)}})},p5ED:function(Pe,Le,Z){"use strict";var ie=Z("+L6B"),Y=Z("2/Rp"),R=Z("5Dmo"),Q=Z("3S7+"),B=Z("k1fw"),_=Z("tJVT"),H=Z("q1tI"),U=Z.n(H),O=Z("vHTk"),M=Z.n(O),b=Z("yEEn"),w=Z("ZW9T"),k=Z("1vsH");Le.a=function(D){var T=D.name,E=D.data,h=D.theme,o=D.type,u=D.filename,d=D.monacoEditor,A=D.className,g=D.style,m=D.close,L=D.onClose,x=D.hasMask,p=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),c=Object(_.a)(p,2),s=c[0],a=c[1],y=Object(H.useState)(""),v=Object(_.a)(y,2),C=v[0],P=v[1],G,V=1024*1024,$=10*V,z=Object(H.useRef)();o==="office"&&(G=Object(k.T)(E).filesize,G>$&&(o="other")),u&&(d.filename=u),Object(H.useEffect)(function(){var ne,ce,ve=(ne=document.cookie)===null||ne===void 0||((ce=ne.replace(/\s/g,""))===null||ce===void 0)?void 0:ce.split(";");ve==null||ve.map(function(Ie){var xe=Ie.split("=");xe[0]==="_educoder_session"&&P(xe[1])})},[]);var j=function(){if(E.startsWith("http")||E.startsWith("/")){ee();return}Object(k.z)(u||"educoder",E,u)},ee=function(){Object(k.x)(u||T,E)};return console.log("data:",E,"fileanme:",u," name:",T),U.a.createElement("div",{style:Object(B.a)({},g||{}),className:"".concat(x&&M.a.bgBlack," ").concat(o?M.a.wrp:"hide")},m&&U.a.createElement("div",{className:M.a.close,ref:z},U.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return z.current}},U.a.createElement("span",{onClick:ee},U.a.createElement("i",{className:"icon-quxiaozhiding"}))),U.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return z.current}},U.a.createElement("span",{className:"",onClick:L},U.a.createElement("i",{className:"icon-guanbi1"})))),U.a.createElement("div",{className:"".concat(M.a[A]," ").concat(A," ").concat(M.a.monaco," ").concat(o==="txt"?"show":"hide")},o==="txt"&&U.a.createElement(w.b,d)),o==="audio"&&U.a.createElement("audio",{src:"".concat(E!=null&&E.startsWith("/")||(E==null?void 0:E.indexOf("https://"))>-1?E:"data:audio/mp3;base64,").concat(E),autoPlay:!0}),o==="video"&&U.a.createElement(U.a.Fragment,null,E!=null&&E.startsWith("/")?U.a.createElement("video",{controls:!0,src:"".concat(E),autoPlay:!0}):U.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(E),autoPlay:!0})),o==="html"&&U.a.createElement("iframe",{src:E+"&disposition=inline"}),o==="pdf"&&U.a.createElement("embed",{className:M.a.embed,src:E}),o==="image"&&U.a.createElement(U.a.Fragment,null,U.a.createElement("img",{src:"".concat(E!=null&&E.startsWith("/")||(E==null?void 0:E.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(E)})),o==="other"&&U.a.createElement("div",null,U.a.createElement(Y.a,{type:"primary",size:"large",onClick:j},U.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(o==="download"||o==="office")&&U.a.createElement(Y.a,{type:"primary",size:"large",onClick:j},U.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Pe,Le,Z){},qgvg:function(Pe,Le){Pe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVA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D0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Pe,Le){const Z=/[&<>"']/,ie=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&","<":"<",">":">",'"':""","'":"'"},B=x=>Q[x];function _(x,p){if(p){if(Z.test(x))return x.replace(ie,B)}else if(Y.test(x))return x.replace(R,B);return x}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(x){return x.replace(H,(p,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const O=/(^|[^\[])\^/g;function M(x,p){x=x.source||x,p=p||"";const c={replace:(s,a)=>(a=a.source||a,a=a.replace(O,"$1"),x=x.replace(s,a),c),getRegex:()=>new RegExp(x,p)};return c}const b=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(x,p,c){if(x){let s;try{s=decodeURIComponent(U(c)).replace(b,"").toLowerCase()}catch(a){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}p&&!w.test(c)&&(c=o(p,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(s){return null}return c}const D={},T=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(x,p){D[" "+x]||(T.test(x)?D[" "+x]=x+"/":D[" "+x]=g(x,"/",!0)),x=D[" "+x];const c=x.indexOf(":")===-1;return p.substring(0,2)==="//"?c?p:x.replace(E,"$1")+p:p.charAt(0)==="/"?c?p:x.replace(h,"$1")+p:x+p}const u={exec:function(){}};function d(x){let p=1,c,s;for(;p{let P=!1,G=v;for(;--G>=0&&C[G]==="\\";)P=!P;return P?"|":" |"}),s=c.split(/ \|/);let a=0;if(s.length>p)s.splice(p);else for(;s.length0},!1)}function b(w,k){for(var D={main:[k]},T={main:[]},E={main:{}};M(D);)for(var h=Object.keys(D),o=0;o=2*L/p||C<=G)return;var V=Number.POSITIVE_INFINITY,$;for($=h.level-1;$>s;$--){var z=c[$].maxBitrate;if(V=L*z/(8*.8*v),V=C)return;var j=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+h.sn+(o?" part "+o.index:"")+" of level "+h.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+$+` Current BW estimate: `+(Object(Q.isFiniteNumber)(j)?(j/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+C.toFixed(3)+` s Estimated load time for the next fragment: `+V.toFixed(3)+` s Time to underbuffer: `+G.toFixed(3)+" s"),u.nextLoadLevel=$,this.bwEstimator.sample(x,m.loaded),this.clearTimer(),h.loader&&(this.fragCurrent=this.partCurrent=null,h.loader.abort()),u.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:h,part:o,stats:m})},T.onFragLoaded=function(h,o){var u=o.frag,d=o.part;if(u.type===O.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(u.sn)){var A=d?d.stats:u.stats,g=d?d.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[u.level],L=(m.loaded?m.loaded.bytes:0)+A.loaded,x=(m.loaded?m.loaded.duration:0)+g;m.loaded={bytes:L,duration:x},m.realBitrate=Math.round(8*L/x)}if(u.bitrateTest){var p={stats:A,frag:u,part:d,id:u.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,p),u.bitrateTest=!1}}},T.onFragBuffered=function(h,o){var u=o.frag,d=o.part,A=d?d.stats:u.stats;if(A.aborted)return;if(u.type!==O.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var g=A.parsing.end-A.loading.start;this.bwEstimator.sample(g,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=g/1e3:this.bitrateTestDelay=0},T.onError=function(h,o){switch(o.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},T.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},T.getNextABRAutoLevel=function(){var h=this.fragCurrent,o=this.partCurrent,u=this.hls,d=u.maxAutoLevel,A=u.config,g=u.minAutoLevel,m=u.media,L=o?o.duration:h?h.duration:0,x=m?m.currentTime:0,p=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,s=(H.BufferHelper.bufferInfo(m,x,A.maxBufferHole).end-x)/p,a=this.findBestLevel(c,g,d,s,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(a>=0)return a;M.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,C=A.abrBandWidthUpFactor;if(!s){var P=this.bitrateTestDelay;if(P){var G=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;y=G-P,M.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),v=C=1}}return a=this.findBestLevel(c,g,d,s+y,v,C),Math.max(a,0)},T.findBestLevel=function(h,o,u,d,A,g){for(var m,L=this.fragCurrent,x=this.partCurrent,p=this.lastLoadedFragLevel,c=this.hls.levels,s=c[p],a=!!(s!=null&&(m=s.details)!==null&&m!==void 0&&m.live),y=s==null?void 0:s.codecSet,v=x?x.duration:L?L.duration:0,C=u;C>=o;C--){var P=c[C];if(!P||y&&P.codecSet!==y)continue;var G=P.details,V=(x?G==null?void 0:G.partTarget:G==null?void 0:G.averagetargetduration)||v,$=void 0;C<=p?$=A*h:$=g*h;var z=c[C].maxBitrate,j=z*V/$;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+C+"/"+Math.round($)+"/"+z+"/"+V+"/"+d+"/"+j),$>z&&(!j||a&&!this.bitrateTestDelay||j0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},p.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var s,a=this.levels,y=this.trackId,v=a==null||((s=a[y])===null||s===void 0)?void 0:s.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var C,P=performance.now(),G=this.retryDate;(!G||P>=G||(C=this.media)!==null&&C!==void 0&&C.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var V=this.waitingData;if(V){var $=V.frag,z=V.part,j=V.cache,ee=V.complete;if(this.initPTS[$.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var ne=j.flush(),ce={frag:$,part:z,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(ce),ee&&L.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+$.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ve=this.getLoadPosition(),Ie=H.BufferHelper.bufferInfo(this.mediaBuffer,ve,this.config.maxBufferHole),xe=Object(T.fragmentWithinToleranceTest)(Ie.end,this.config.maxFragLookUpTolerance,$);xe<0&&(o.logger.log("Waiting fragment cc ("+$.cc+") @ "+$.start+" cancelled because another fragment at "+Ie.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},p.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},p.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:s,y=a.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},p.doTickIdle=function(){var s,a,y=this.hls,v=this.levels,C=this.media,P=this.trackId,G=y.config;if(!v||!v[P])return;if(!C&&(this.startFragRequested||!G.startFragPrefetch))return;var V=v[P],$=V.details;if(!$||$.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn($)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(z===null)return;var j=z.len,ee=this.getMaxBufferLength(),ne=this.audioSwitch;if(j>=ee&&!ne)return;if(!ne&&this._streamEnded(z,$)){y.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var ce=$.fragments,ve=ce[0].start,Ie=z.end;if(ne){var xe=this.getLoadPosition();Ie=xe,$.PTSKnown&&xeve||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),C.currentTime=ve+.05))}var Ee=this.getNextFragment(Ie,$);if(!Ee){this.bufferFlushed=!0;return}((s=Ee.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((a=Ee.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Ee,$):this.loadFragment(Ee,$,Ie)},p.getMaxBufferLength=function(){var s=L.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return a===null?s:Math.max(s,a.len)},p.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},p.onAudioTracksUpdated=function(s,a){var y=a.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(v){return new O.Level(v)})},p.onAudioTrackSwitching=function(s,a){var y=!!a.url;this.trackId=a.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(g):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},p.onLevelLoaded=function(s,a){this.mainDetails=a.details},p.onAudioTrackLoaded=function(s,a){var y,v=this.levels,C=a.details,P=a.id;if(!v){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+C.startSN+","+C.endSN+"],duration:"+C.totalduration);var G=v[P],V=0;if(C.live||(y=G.details)!==null&&y!==void 0&&y.live){var $=this.mainDetails;if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed||!$)return;!G.details&&C.hasProgramDateTime&&$.hasProgramDateTime?(Object(E.alignMediaPlaylistByPDT)(C,$),V=C.fragments[0].start):V=this.alignPlaylists(C,G.details)}G.details=C,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!C.live)&&this.setStartPosition(G.details,V),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(C)&&(this.state=B.State.IDLE),this.tick()},p._handleFragmentLoadProgress=function(s){var a,y=s.frag,v=s.part,C=s.payload,P=this.config,G=this.trackId,V=this.levels;if(!V){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var $=V[G];console.assert($,"Audio track is defined on fragment load progress");var z=$.details;console.assert(z,"Audio track details are defined on fragment load progress");var j=P.defaultAudioCodec||$.audioCodec||"mp4a.40.2",ee=this.transmuxer;ee||(ee=this.transmuxer=new k.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[y.cc],ce=(a=y.initSegment)===null||a===void 0?void 0:a.data;if(ne!==void 0){var ve=!1,Ie=v?v.index:-1,xe=Ie!==-1,Ee=new D.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,C.byteLength,Ie,xe);ee.push(C,ce,j,"",y,v,z.totalduration,ve,Ee,ne)}else{o.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+G);var Te=this.waitingData=this.waitingData||{frag:y,part:v,cache:new w.default,complete:!1},Se=Te.cache;Se.push(new Uint8Array(C)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},p._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,s)},p.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},p.onBufferCreated=function(s,a){var y=a.tracks.audio;y&&(this.mediaBuffer=y.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},p.onFragBuffered=function(s,a){var y=a.frag,v=a.part;if(y.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(v?" p: "+v.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,v)},p.onError=function(s,a){switch(a.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,a);break;case h.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case h.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=a.fatal?B.State.ERROR:B.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var y=!0,v=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);v&&v.len>.5&&(y=!this.reduceMaxBufferLength(v.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},p.onBufferFlushed=function(s,a){var y=a.type;y===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},p._handleTransmuxComplete=function(s){var a,y="audio",v=this.hls,C=s.remuxResult,P=s.chunkMeta,G=this.getCurrentContext(P);if(!G){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var V=G.frag,$=G.part,z=C.audio,j=C.text,ee=C.id3,ne=C.initSegment;if(this.fragContextChanged(V))return;if(this.state=B.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,V,P),v.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:y,tracks:ne.tracks})),z){var ce=z.startPTS,ve=z.endPTS,Ie=z.startDTS,xe=z.endDTS;$&&($.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:ve,startDTS:Ie,endDTS:xe}),V.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ce,ve,Ie,xe),this.bufferFragmentData(z,V,$,P)}if(ee!=null&&(a=ee.samples)!==null&&a!==void 0&&a.length){var Ee=u({frag:V,id:y},ee);v.trigger(_.Events.FRAG_PARSING_METADATA,Ee)}if(j){var Te=u({frag:V,id:y},j);v.trigger(_.Events.FRAG_PARSING_USERDATA,Te)}},p._bufferInitSegment=function(s,a,y){if(this.state!==B.State.PARSING)return;s.video&&delete s.video;var v=s.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,s);var C=v.initSegment;if(C!=null&&C.byteLength){var P={type:"audio",frag:a,part:null,chunkMeta:y,parent:a.type,data:C};this.hls.trigger(_.Events.BUFFER_APPENDING,P)}this.tick()},p.loadFragment=function(s,a,y){var v=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||v===U.FragmentState.NOT_LOADED||v===U.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):a.live&&!Object(Q.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,s,a,y)))},p.completeAudioSwitch=function(){var s=this.hls,a=this.media,y=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:y})},x}(B.default);Y.default=m},"./src/controller/audio-track-controller.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/controller/base-playlist-controller.ts"),H=R("./src/types/loader.ts");function U(k,D){for(var T=0;T=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=o[this.trackId];this.log("Now switching to audio-track index "+h);var d=o[h],A=d.id,g=d.groupId,m=g===void 0?"":g,L=d.name,x=d.type,p=d.url;if(this.trackId=h,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:m,name:L,type:x,url:p}),d.details&&!d.details.live)return;var c=this.switchParams(d.url,u==null?void 0:u.details);this.loadPlaylist(c)},T.selectInitialTrack=function(){var h=this.tracksInGroup;console.assert(h.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,u=this.findTrackId(o)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},T.findTrackId=function(h){for(var o=this.tracksInGroup,u=0;uD.partTarget&&(d+=1)}if(Object(Q.isFiniteNumber)(u))return new B.HlsUrlParameters(u,Object(Q.isFiniteNumber)(d)?d:void 0,B.HlsSkip.No)}}},b.loadPlaylist=function(k){},b.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},b.playlistLoaded=function(k,D,T){var E=this,h=D.details,o=D.stats,u=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(h.advancedDateTime=Date.now()-u,h.live||T!=null&&T.live){if(h.reloaded(T),T&&this.log("live playlist "+k+" "+(h.advanced?"REFRESHED "+h.lastPartSn+"-"+h.lastPartIndex:"MISSED")),T&&h.fragments.length>0&&Object(_.mergeDetails)(T,h),!this.canLoad||!h.live)return;var d,A=void 0,g=void 0;if(h.canBlockReload&&h.endSN&&h.advanced){var m=this.hls.config.lowLatencyMode,L=h.lastPartSn,x=h.endSN,p=h.lastPartIndex,c=p!==-1,s=L===x,a=m?0:p;c?(A=s?x+1:L,g=s?a:p+1):A=x+1;var y=h.age,v=y+h.ageHeader,C=Math.min(v-h.partTarget,h.targetduration*1.5);if(C>0){if(T&&C>T.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+T.tuneInGoal+" to: "+C+" with playlist age: "+h.age),C=0;else{var P=Math.floor(C/h.targetduration);if(A+=P,g!==void 0){var G=Math.round(C%h.targetduration/h.partTarget);g+=G}this.log("CDN Tune-in age: "+h.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+C+" skip sn "+P+" to part "+g)}h.tuneInGoal=C}if(d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,g),m||!s){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(h,D.deliveryDirectives,A,g);var V=Object(_.computeReloadInterval)(h,o);A!==void 0&&h.canBlockReload&&(V-=h.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return E.loadPlaylist(d)},V)}else this.clearTimer()},b.getDeliveryDirectives=function(k,D,T,E){var h=Object(B.getSkipValue)(k,T);return D!=null&&D.skip&&k.deltaUpdateFailed&&(T=D.msn,E=D.part,h=B.HlsSkip.No),new B.HlsUrlParameters(T,E,h)},b.retryLoadingOrFail=function(k){var D=this,T=this.hls.config,E=this.retryCount-1&&(h=k.context)!==null&&h!==void 0&&h.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*T.levelLoadingRetryDelay,T.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return D.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return E},M}()},"./src/controller/base-stream-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"State",function(){return x}),R.d(Y,"default",function(){return p});var Q=R("./src/polyfills/number.ts"),B=R("./src/task-loop.ts"),_=R("./src/controller/fragment-tracker.ts"),H=R("./src/utils/buffer-helper.ts"),U=R("./src/utils/logger.ts"),O=R("./src/events.ts"),M=R("./src/errors.ts"),b=R("./src/types/transmuxer.ts"),w=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/discontinuities.ts"),D=R("./src/controller/fragment-finders.ts"),T=R("./src/controller/level-helper.ts"),E=R("./src/loader/fragment-loader.ts"),h=R("./src/crypt/decrypter.ts"),o=R("./src/utils/time-ranges.ts"),u=R("./src/types/loader.ts");function d(c,s){for(var a=0;ane;($0&&$&&$.key&&$.iv&&$.method==="AES-128"){var z=self.performance.now();return C.decrypter.webCryptoDecrypt(new Uint8Array(V),$.key.buffer,$.iv.buffer).then(function(j){var ee=self.performance.now();return G.trigger(O.Events.FRAG_DECRYPTED,{frag:v,payload:j,stats:{tstart:z,tdecrypt:ee}}),P.payload=j,P})}return P}).then(function(P){var G=C.fragCurrent,V=C.hls,$=C.levels;if(!$)throw new Error("init load aborted, missing levels");var z=$[v.level].details;console.assert(z,"Level details are defined when init segment is loaded");var j=v.stats;C.state=x.IDLE,C.fragLoadError=0,v.data=new Uint8Array(P.payload),j.parsing.start=j.buffering.start=self.performance.now(),j.parsing.end=j.buffering.end=self.performance.now(),P.frag===G&&V.trigger(O.Events.FRAG_BUFFERED,{stats:j,frag:G,part:null,id:v.type}),C.tick()}).catch(function(P){C.warn(P),C.resetFragmentLoading(v)})},a.fragContextChanged=function(v){var C=this.fragCurrent;return!v||!C||v.level!==C.level||v.sn!==C.sn||v.urlId!==C.urlId},a.fragBufferedComplete=function(v,C){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(C?" part: "+C.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+o.default.toString(H.BufferHelper.getBuffered(P))),this.state=x.IDLE,this.tick()},a._handleFragmentLoadComplete=function(v){var C=this.transmuxer;if(!C)return;var P=v.frag,G=v.part,V=v.partsLoaded,$=!V||V.length===0||V.some(function(j){return!j}),z=new b.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,G?G.index:-1,!$);C.flush(z)},a._handleFragmentLoadProgress=function(v){},a._doFragLoad=function(v,C,P,G){var V=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(v.start,P||0),this.config.lowLatencyMode&&C){var $=C.partList;if($&&G){P>v.end&&C.fragmentHint&&(v=C.fragmentHint);var z=this.getNextPart($,v,P);if(z>-1){var j=$[z];return this.log("Loading part sn: "+v.sn+" p: "+j.index+" cc: "+v.cc+" of playlist ["+C.startSN+"-"+C.endSN+"] parts [0-"+z+"-"+($.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=j.start+j.duration,this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:v,part:$[z],targetBufferTime:P}),this.doFragPartsLoad(v,$,z,G).catch(function(ee){return V.handleFragLoadError(ee)})}else if(!v.url||this.loadedEndOfParts($,P))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(C?"of ["+C.startSN+"-"+C.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(P.toFixed(3))),Object(Q.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=x.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:v,targetBufferTime:P}),this.fragmentLoader.load(v,G).catch(function(ee){return V.handleFragLoadError(ee)})},a.doFragPartsLoad=function(v,C,P,G){var V=this;return new Promise(function($,z){var j=[],ee=function ne(ce){var ve=C[ce];V.fragmentLoader.loadPart(v,ve,G).then(function(Ie){j[ve.index]=Ie;var xe=Ie.part;V.hls.trigger(O.Events.FRAG_LOADED,Ie);var Ee=C[ce+1];if(Ee&&Ee.fragment===v)ne(ce+1);else return $({frag:v,part:xe,partsLoaded:j})}).catch(z)};ee(P)})},a.handleFragLoadError=function(v){var C=v.data;return C&&C.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(C.frag,C.part):this.hls.trigger(O.Events.ERROR,C),null},a._handleTransmuxerFlush=function(v){var C=this.getCurrentContext(v);if(!C||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var P=C.frag,G=C.part,V=C.level,$=self.performance.now();P.stats.parsing.end=$,G&&(G.stats.parsing.end=$),this.updateLevelTiming(P,G,V,v.partial)},a.getCurrentContext=function(v){var C=this.levels,P=v.level,G=v.sn,V=v.part;if(!C||!C[P])return this.warn("Levels object was unset while buffering fragment "+G+" of level "+P+". The current chunk will not be buffered."),null;var $=C[P],z=V>-1?Object(T.getPartWith)($,G,V):null,j=z?z.fragment:Object(T.getFragmentWithSN)($,G,this.fragCurrent);return j?{frag:j,part:z,level:$}:null},a.bufferFragmentData=function(v,C,P,G){if(!v||this.state!==x.PARSING)return;var V=v.data1,$=v.data2,z=V;if(V&&$&&(z=Object(w.appendUint8Array)(V,$)),!z||!z.length)return;var j={type:v.type,frag:C,part:P,chunkMeta:G,parent:C.type,data:z};this.hls.trigger(O.Events.BUFFER_APPENDING,j),v.dropped&&v.independent&&!P&&this.flushBufferGap(C)},a.flushBufferGap=function(v){var C=this.media;if(!C)return;if(!H.BufferHelper.isBuffered(C,C.currentTime)){this.flushMainBuffer(0,v.start);return}var P=C.currentTime,G=H.BufferHelper.bufferInfo(C,P,0),V=v.duration,$=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),z=Math.max(Math.min(v.start-$,G.end-$),P+$);v.start-z>$&&this.flushMainBuffer(z,v.start)},a.getFwdBufferInfo=function(v,C){var P=this.config,G=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(G))return null;var V=H.BufferHelper.bufferInfo(v,G,P.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var $=this.fragmentTracker.getBufferedFrag(G,C);if($&&V.nextStart<$.end)return H.BufferHelper.bufferInfo(v,G,Math.max(V.nextStart,P.maxBufferHole))}return V},a.getMaxBufferLength=function(v){var C=this.config,P;return v?P=Math.max(8*C.maxBufferSize/v,C.maxBufferLength):P=C.maxBufferLength,Math.min(P,C.maxMaxBufferLength)},a.reduceMaxBufferLength=function(v){var C=this.config,P=v||C.maxBufferLength;return C.maxMaxBufferLength>=P?(C.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+C.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(v,C){var P,G,V=C.fragments,$=V.length;if(!$)return null;var z=this.config,j=V[0].start,ee;if(C.live){var ne=z.initialLiveManifestSize;if($-1&&PP.start&&P.loaded},a.getInitialLiveFragment=function(v,C){var P=this.fragPrevious,G=null;if(P){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),G=Object(D.findFragmentByPDT)(C,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!G){var V=P.sn+1;if(V>=v.startSN&&V<=v.endSN){var $=C[V-v.startSN];P.cc===$.cc&&(G=$,this.log("Live playlist, switching playlist, load frag with next SN: "+G.sn))}G||(G=Object(D.findFragWithCC)(C,P.cc),G&&this.log("Live playlist, switching playlist, load frag with same CC: "+G.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(G=this.getFragmentAtPosition(z,this.bitrateTest?v.fragmentEnd:v.edge,v))}return G},a.getFragmentAtPosition=function(v,C,P){var G=this.config,V=this.fragPrevious,$=P.fragments,z=P.endSN,j=P.fragmentHint,ee=G.maxFragLookUpTolerance,ne=!!(G.lowLatencyMode&&P.partList&&j);ne&&j&&!this.bitrateTest&&($=$.concat(j),z=j.sn);var ce;if(vC-ee?0:ee;ce=Object(D.findFragmentByPTS)(V,$,v,ve)}else ce=$[$.length-1];if(ce){var Ie=ce.sn-P.startSN,xe=V&&ce.level===V.level,Ee=$[Ie+1],Te=this.fragmentTracker.getState(ce);if(Te===_.FragmentState.BACKTRACKED){ce=null;for(var Se=Ie;$[Se]&&this.fragmentTracker.getState($[Se])===_.FragmentState.BACKTRACKED;)V?ce=$[Se--]:ce=$[--Se];ce||(ce=Ee)}else V&&ce.sn===V.sn&&!ne&&(xe&&(ce.sn=$-C.maxFragLookUpTolerance&&V<=z;if(G!==null&&P.duration>G&&(V"+v.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+z),ce}return j},a.waitForCdnTuneIn=function(v){var C=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*C)},a.setStartPosition=function(v,C){var P=this.startPosition;if(P"+v))}}]),s}(B.default)},"./src/controller/buffer-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return D});var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),H=R("./src/errors.ts"),U=R("./src/utils/buffer-helper.ts"),O=R("./src/utils/mediasource-helper.ts"),M=R("./src/loader/fragment.ts"),b=R("./src/controller/buffer-operation-queue.ts"),w=Object(O.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,D=function(){function T(h){var o=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=o.hls,d=o.media,A=o.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),d&&(o.updateMediaElementDuration(),u.trigger(B.Events.MEDIA_ATTACHED,{media:d})),A&&A.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){_.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_.logger.log("[buffer-controller]: Media source ended")},this.hls=h,this._initSourceBuffer(),this.registerListeners()}var E=T.prototype;return E.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},E.destroy=function(){this.unregisterListeners(),this.details=null},E.registerListeners=function(){var o=this.hls;o.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(B.Events.BUFFER_RESET,this.onBufferReset,this),o.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(B.Events.BUFFER_EOS,this.onBufferEos,this),o.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(B.Events.FRAG_PARSED,this.onFragParsed,this),o.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},E.unregisterListeners=function(){var o=this.hls;o.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(B.Events.BUFFER_RESET,this.onBufferReset,this),o.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(B.Events.BUFFER_EOS,this.onBufferEos,this),o.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(B.Events.FRAG_PARSED,this.onFragParsed,this),o.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},E._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},E.onManifestParsed=function(o,u){var d=2;(u.audio&&!u.video||!u.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},E.onMediaAttaching=function(o,u){var d=this.media=u.media;if(d&&w){var A=this.mediaSource=new w;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(A),this._objectUrl=d.src}},E.onMediaDetaching=function(){var o=this.media,u=this.mediaSource,d=this._objectUrl;if(u){if(_.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(A){_.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(d&&self.URL.revokeObjectURL(d),o.src===d?(o.removeAttribute("src"),o.load()):_.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)},E.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(u){var d=o.sourceBuffer[u];try{d&&(o.removeBufferListeners(u),o.mediaSource&&o.mediaSource.removeSourceBuffer(d),o.sourceBuffer[u]=void 0)}catch(A){_.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",A)}}),this._initSourceBuffer()},E.onBufferCodecs=function(o,u){var d=this,A=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(g){if(A){var m=d.tracks[g];if(m&&typeof m.buffer.changeType=="function"){var L=u[g],x=L.codec,p=L.levelCodec,c=L.container,s=(m.levelCodec||m.codec).replace(k,"$1"),a=(p||x).replace(k,"$1");if(s!==a){var y=c+";codecs="+(p||x);d.appendChangeType(g,y)}}}else d.pendingTracks[g]=u[g]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},E.appendChangeType=function(o,u){var d=this,A=this.operationQueue,g={execute:function(){var L=d.sourceBuffer[o];L&&(_.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+u),L.changeType(u)),A.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(L){_.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",L)}};A.append(g,o)},E.onBufferAppending=function(o,u){var d=this,A=this.hls,g=this.operationQueue,m=this.tracks,L=u.data,x=u.type,p=u.frag,c=u.part,s=u.chunkMeta,a=s.buffering[x],y=self.performance.now();a.start=y;var v=p.stats.buffering,C=c?c.stats.buffering:null;v.start===0&&(v.start=y),C&&C.start===0&&(C.start=y);var P=m.audio,G=x==="audio"&&s.id===1&&(P==null?void 0:P.container)==="audio/mpeg",V={execute:function(){if(a.executeStart=self.performance.now(),G){var z=d.sourceBuffer[x];if(z){var j=p.start-z.timestampOffset;Math.abs(j)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+p.start+" (delta: "+j+") sn: "+p.sn+")"),z.timestampOffset=p.start)}}d.appendExecutor(L,x)},onStart:function(){},onComplete:function(){var z=self.performance.now();a.executeEnd=a.end=z,v.first===0&&(v.first=z),C&&C.first===0&&(C.first=z);var j=d.sourceBuffer,ee={};for(var ne in j)ee[ne]=U.BufferHelper.getBuffered(j[ne]);d.appendError=0,d.hls.trigger(B.Events.BUFFER_APPENDED,{type:x,frag:p,part:c,chunkMeta:s,parent:p.type,timeRanges:ee})},onError:function(z){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",z);var j={type:H.ErrorTypes.MEDIA_ERROR,parent:p.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?j.details=H.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,j.details=H.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>A.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),j.fatal=!0)),A.trigger(B.Events.ERROR,j)}};g.append(V,x)},E.onBufferFlushing=function(o,u){var d=this,A=this.operationQueue,g=function(L){return{execute:d.removeExecutor.bind(d,L,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(B.Events.BUFFER_FLUSHED,{type:L})},onError:function(p){_.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",p)}}};u.type?A.append(g(u.type),u.type):this.getSourceBufferTypes().forEach(function(m){A.append(g(m),m)})},E.onFragParsed=function(o,u){var d=this,A=u.frag,g=u.part,m=[],L=g?g.elementaryStreams:A.elementaryStreams;L[M.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(L[M.ElementaryStreamTypes.AUDIO]&&m.push("audio"),L[M.ElementaryStreamTypes.VIDEO]&&m.push("video"));var x=function(){var c=self.performance.now();A.stats.buffering.end=c,g&&(g.stats.buffering.end=c);var s=g?g.stats:A.stats;d.hls.trigger(B.Events.FRAG_BUFFERED,{frag:A,part:g,stats:s,id:A.type})};m.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(x,m)},E.onFragChanged=function(o,u){this.flushBackBuffer()},E.onBufferEos=function(o,u){var d=this,A=this.getSourceBufferTypes().reduce(function(g,m){var L=d.sourceBuffer[m];return(!u.type||u.type===m)&&(L&&!L.ended&&(L.ended=!0,_.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),g&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var g=d.mediaSource;if(!g||g.readyState!=="open")return;g.endOfStream()})},E.onLevelUpdated=function(o,u){var d=u.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},E.flushBackBuffer=function(){var o=this.hls,u=this.details,d=this.media,A=this.sourceBuffer;if(!d||u===null)return;var g=this.getSourceBufferTypes();if(!g.length)return;var m=u.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(Q.isFiniteNumber)(m)||m<0)return;var L=d.currentTime,x=u.levelTargetDuration,p=Math.max(m,x),c=Math.floor(L/x)*x-p;g.forEach(function(s){var a=A[s];if(a){var y=U.BufferHelper.getBuffered(a);y.length>0&&c>y.start(0)&&(o.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),u.live&&o.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),o.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:s}))}})},E.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,u=this.hls,d=this.media,A=this.mediaSource,g=o.fragments[0].start+o.totalduration,m=d.duration,L=Object(Q.isFiniteNumber)(A.duration)?A.duration:0;o.live&&u.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(o)):(g>L&&g>m||!Object(Q.isFiniteNumber)(m))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+g.toFixed(3)),A.duration=g)},E.updateSeekableRange=function(o){var u=this.mediaSource,d=o.fragments,A=d.length;if(A&&o.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var g=Math.max(0,d[0].start),m=Math.max(g,g+o.totalduration);u.setLiveSeekableRange(g,m)}},E.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,u=this.operationQueue,d=this.pendingTracks,A=Object.keys(d).length;if(A&&!o||A===2){this.createSourceBuffers(d),this.pendingTracks={};var g=this.getSourceBufferTypes();if(g.length===0){this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}g.forEach(function(m){u.executeNext(m)})}},E.createSourceBuffers=function(o){var u=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var g in o)if(!u[g]){var m=o[g];if(!m)throw Error("source buffer exists for track "+g+", however track does not");var L=m.levelCodec||m.codec,x=m.container+";codecs="+L;_.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var p=u[g]=d.addSourceBuffer(x),c=g;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[g]={buffer:p,codec:L,container:m.container,levelCodec:m.levelCodec,id:m.id},A++}catch(s){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:x})}}A&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},E._onSBUpdateStart=function(o){var u=this.operationQueue,d=u.current(o);d.onStart()},E._onSBUpdateEnd=function(o){var u=this.operationQueue,d=u.current(o);d.onComplete(),u.shiftAndExecuteNext(o)},E._onSBUpdateError=function(o,u){_.logger.error("[buffer-controller]: "+o+" SourceBuffer error",u),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(o);d&&d.onError(u)},E.removeExecutor=function(o,u,d){var A=this.media,g=this.mediaSource,m=this.operationQueue,L=this.sourceBuffer,x=L[o];if(!A||!g||!x){_.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(o);return}var p=Object(Q.isFiniteNumber)(A.duration)?A.duration:Infinity,c=Object(Q.isFiniteNumber)(g.duration)?g.duration:Infinity,s=Math.max(0,u),a=Math.min(d,p,c);a>s?(_.logger.log("[buffer-controller]: Removing ["+s+","+a+"] from the "+o+" SourceBuffer"),console.assert(!x.updating,o+" sourceBuffer must not be updating"),x.remove(s,a)):m.shiftAndExecuteNext(o)},E.appendExecutor=function(o,u){var d=this.operationQueue,A=this.sourceBuffer,g=A[u];if(!g){_.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(u);return}g.ended=!1,console.assert(!g.updating,u+" sourceBuffer must not be updating"),g.appendBuffer(o)},E.blockBuffers=function(o,u){var d=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var A=this.operationQueue,g=u.map(function(m){return A.appendBlocker(m)});Promise.all(g).then(function(){o(),u.forEach(function(m){var L=d.sourceBuffer[m];(!L||!L.updating)&&A.shiftAndExecuteNext(m)})})},E.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},E.addBufferListener=function(o,u,d){var A=this.sourceBuffer[o];if(!A)return;var g=d.bind(this,o);this.listeners[o].push({event:u,listener:g}),A.addEventListener(u,g)},E.removeBufferListeners=function(o){var u=this.sourceBuffer[o];if(!u)return;this.listeners[o].forEach(function(d){u.removeEventListener(d.event,d.listener)})},T}()},"./src/controller/buffer-operation-queue.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return B});var Q=R("./src/utils/logger.ts"),B=function(){function _(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var H=_.prototype;return H.append=function(O,M){var b=this.queues[M];b.push(O),b.length===1&&this.buffers[M]&&this.executeNext(M)},H.insertAbort=function(O,M){var b=this.queues[M];b.unshift(O),this.executeNext(M)},H.appendBlocker=function(O){var M,b=new Promise(function(k){M=k}),w={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(w,O),b},H.executeNext=function(O){var M=this.buffers,b=this.queues,w=M[O],k=b[O];if(k.length){var D=k[0];try{D.execute()}catch(T){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),D.onError(T),(!w||!w.updating)&&(k.shift(),this.executeNext(O))}}},H.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},H.current=function(O){return this.queues[O][0]},_}()},"./src/controller/cap-level-controller.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/events.ts");function B(U,O){for(var M=0;M0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var w=this.hls;w.autoLevelCapping=this.getMaxLevel(b.length-1),w.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=w.autoLevelCapping}}},O.getMaxLevel=function(b){var w=this,k=this.hls.levels;if(!k.length)return-1;var D=k.filter(function(T,E){return U.isLevelAllowed(E,w.restrictedLevels)&&E<=b});return this.clientRect=null,U.getMaxLevelByMediaSize(D,this.mediaWidth,this.mediaHeight)},O.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()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,w={width:0,height:0};if(b){var k=b.getBoundingClientRect();w.width=k.width,w.height=k.height,!w.width&&!w.height&&(w.width=k.right-k.left||b.width||0,w.height=k.bottom-k.top||b.height||0)}return this.clientRect=w,w},U.isLevelAllowed=function(b,w){return w===void 0&&(w=[]),w.indexOf(b)===-1},U.getMaxLevelByMediaSize=function(b,w,k){if(!b||!b.length)return-1;for(var D=function(u,d){return d?u.width!==d.width||u.height!==d.height:!0},T=b.length-1,E=0;E=w||h.height>=k)&&D(h,b[E+1])){T=E;break}}return T},_(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(w){}return b}}]),U}();Y.default=H},"./src/controller/cmcd-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return D});var Q=R("./src/events.ts"),B=R("./src/types/cmcd.ts"),_=R("./src/utils/buffer-helper.ts"),H=R("./src/utils/logger.ts");function U(T,E){for(var h=0;h=T.length?{done:!0}:{done:!1,value:T[o++]}}}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 b(T,E){if(!T)return;if(typeof T=="string")return w(T,E);var h=Object.prototype.toString.call(T).slice(8,-1);if(h==="Object"&&T.constructor&&(h=T.constructor.name),h==="Map"||h==="Set")return Array.from(T);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return w(T,E)}function w(T,E){(E==null||E>T.length)&&(E=T.length);for(var h=0,o=new Array(E);hu&&(u=m.bitrate)}return u>0?u:NaN},E.getBufferLength=function(o){var u=this.hls.media,d=o===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!u)return NaN;var A=_.BufferHelper.bufferInfo(d,u.currentTime,this.config.maxBufferHole);return A.len*1e3},E.createPlaylistLoader=function(){var o=this.config.pLoader,u=this.applyPlaylistData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var g=A.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(L,x,p){u(L),this.loader.load(L,x,p)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},E.createFragmentLoader=function(){var o=this.config.fLoader,u=this.applyFragmentData,d=o||this.config.loader;return function(){function A(m){this.loader=void 0,this.loader=new d(m)}var g=A.prototype;return g.destroy=function(){this.loader.destroy()},g.abort=function(){this.loader.abort()},g.load=function(L,x,p){u(L),this.loader.load(L,x,p)},O(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},T.uuid=function(){var o=URL.createObjectURL(new Blob),u=o.toString();return URL.revokeObjectURL(o),u.substr(u.lastIndexOf("/")+1)},T.serialize=function(o){for(var u=[],d=function(G){return!Number.isNaN(G)&&G!=null&&G!==""&&G!==!1},A=function(G){return Math.round(G)},g=function(G){return A(G/100)*100},m=function(G){return encodeURIComponent(G)},L={br:A,d:A,bl:g,dl:g,mtp:g,nor:m,rtp:g,tb:A},x=Object.keys(o||{}).sort(),p=M(x),c;!(c=p()).done;){var s=c.value,a=o[s];if(!d(a))continue;if(s==="v"&&a===1)continue;if(s=="pr"&&a===1)continue;var y=L[s];y&&(a=y(a));var v=typeof a,C=void 0;s==="ot"||s==="sf"||s==="st"?C=s+"="+a:v==="boolean"?C=s:v==="number"?C=s+"="+a:C=s+"="+JSON.stringify(a),u.push(C)}return u.join(",")},T.toHeaders=function(o){for(var u=Object.keys(o),d={},A=["Object","Request","Session","Status"],g=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},L=0,x=u;LM){this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=M-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(u,d)}break}},T._generateLicenseRequestChallenge=function(h,o){switch(h.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+h.mediaKeySystemDomain)},T._requestLicense=function(h,o){_.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(u.mediaKeySystemDomain),A=this._createLicenseXhr(d,h,o);_.logger.log("Sending license request to URL: "+d);var g=this._generateLicenseRequestChallenge(u,h);A.send(g)}catch(m){_.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},T.onMediaAttached=function(h,o){if(!this._emeEnabled)return;var u=o.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},T.onMediaDetached=function(){var h=this._media,o=this._mediaKeysList;if(!h)return;h.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return h.setMediaKeys(null)}).catch(function(){})},T.onManifestParsed=function(h,o){if(!this._emeEnabled)return;var u=o.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),d=o.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,u,d)},O(D,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),D}();Y.default=k},"./src/controller/fps-controller.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=function(){function H(O){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=O,this.registerListeners()}var U=H.prototype;return U.setStreamController=function(M){this.streamController=M},U.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(M,b){var w=this.hls.config;if(w.capLevelOnFPSDrop){var k=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),w.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(M,b,w){var k=performance.now();if(b){if(this.lastTime){var D=k-this.lastTime,T=w-this.lastDroppedFrames,E=b-this.lastDecodedFrames,h=1e3*T/D,o=this.hls;if(o.trigger(Q.Events.FPS_DROP,{currentDropped:T,currentDecoded:E,totalDroppedFrames:w}),h>0&&T>o.config.fpsDroppedMonitoringThreshold*E){var u=o.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=u)&&(u=u-1,o.trigger(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:o.currentLevel}),o.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=w,this.lastDecodedFrames=b}},U.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var b=M.getVideoPlaybackQuality();this.checkFPS(M,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},H}();Y.default=_},"./src/controller/fragment-finders.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"findFragmentByPDT",function(){return _}),R.d(Y,"findFragmentByPTS",function(){return H}),R.d(Y,"fragmentWithinToleranceTest",function(){return U}),R.d(Y,"pdtWithinToleranceTest",function(){return O}),R.d(Y,"findFragWithCC",function(){return M});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/binary-search.ts");function _(b,w,k){if(w===null||!Array.isArray(b)||!b.length||!Object(Q.isFiniteNumber)(w))return null;var D=b[0].programDateTime;if(w<(D||0))return null;var T=b[b.length-1].endProgramDateTime;if(w>=(T||0))return null;k=k||0;for(var E=0;Eb&&k.start?-1:0}function O(b,w,k){var D=Math.min(w,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,T=k.endProgramDateTime||0;return T-D>b}function M(b,w){return B.default.search(b,function(k){return k.ccw?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"FragmentState",function(){return _}),R.d(Y,"FragmentTracker",function(){return H});var Q=R("./src/events.ts"),B=R("./src/types/loader.ts"),_;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(_||(_={}));var H=function(){function M(w){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=w,this._registerListeners()}var b=M.prototype;return b._registerListeners=function(){var k=this.hls;k.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var k=this.hls;k.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(k,D){if(D===B.PlaylistLevelType.MAIN){var T=this.activeFragment,E=this.activeParts;if(!T)return null;if(E)for(var h=E.length;h--;){var o=E[h],u=o?o.end:T.appendedPTS;if(o.start<=k&&u!==void 0&&k<=u)return h>9&&(this.activeParts=E.slice(h-9)),o}else if(T.start<=k&&T.appendedPTS!==void 0&&k<=T.appendedPTS)return T}return this.getBufferedFrag(k,D)},b.getBufferedFrag=function(k,D){for(var T=this.fragments,E=Object.keys(T),h=E.length;h--;){var o=T[E[h]];if((o==null?void 0:o.body.type)===D&&o.buffered){var u=o.body;if(u.start<=k&&k<=u.end)return u}}return null},b.detectEvictedFragments=function(k,D,T){var E=this;Object.keys(this.fragments).forEach(function(h){var o=E.fragments[h];if(!o)return;if(!o.buffered){o.body.type===T&&E.removeFragment(o.body);return}var u=o.range[k];if(!u)return;u.time.some(function(d){var A=!E.isTimeBuffered(d.startPTS,d.endPTS,D);return A&&E.removeFragment(o.body),A})})},b.detectPartialFragments=function(k){var D=this,T=this.timeRanges,E=k.frag,h=k.part;if(!T||E.sn==="initSegment")return;var o=O(E),u=this.fragments[o];if(!u)return;Object.keys(T).forEach(function(d){var A=E.elementaryStreams[d];if(!A)return;var g=T[d],m=h!==null||A.partial===!0;u.range[d]=D.getBufferedTimes(E,h,m,g)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},b.fragBuffered=function(k){var D=O(k),T=this.fragments[D];T&&(T.backtrack=T.loaded=null,T.buffered=!0)},b.getBufferedTimes=function(k,D,T,E){for(var h={time:[],partial:T},o=D?D.start:k.start,u=D?D.end:k.end,d=k.minEndPTS||u,A=k.maxStartPTS||o,g=0;g=m&&d<=L){h.time.push({startPTS:Math.max(o,E.start(g)),endPTS:Math.min(u,E.end(g))});break}else if(om)h.partial=!0,h.time.push({startPTS:Math.max(o,E.start(g)),endPTS:Math.min(u,E.end(g))});else if(u<=m)break}return h},b.getPartialFragment=function(k){var D=null,T,E,h,o=0,u=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(A){var g=d[A];if(!g)return;U(g)&&(E=g.body.start-u,h=g.body.end+u,k>=E&&k<=h&&(T=Math.min(k-E,h-k),o<=T&&(D=g.body,o=T)))}),D},b.getState=function(k){var D=O(k),T=this.fragments[D];return T?T.buffered?U(T)?_.PARTIAL:_.OK:T.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},b.backtrack=function(k,D){var T=O(k),E=this.fragments[T];if(!E||E.backtrack)return null;var h=E.backtrack=D||E.loaded;return E.loaded=null,h},b.getBacktrackData=function(k){var D=O(k),T=this.fragments[D];if(T){var E,h=T.backtrack;if(h!=null&&(E=h.payload)!==null&&E!==void 0&&E.byteLength)return h;this.removeFragment(k)}return null},b.isTimeBuffered=function(k,D,T){for(var E,h,o=0;o=E&&D<=h)return!0;if(D<=E)return!1}return!1},b.onFragLoaded=function(k,D){var T=D.frag,E=D.part;if(T.sn==="initSegment"||T.bitrateTest||E)return;var h=O(T);this.fragments[h]={body:T,loaded:D,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(k,D){var T=this,E=D.frag,h=D.part,o=D.timeRanges;if(E.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=E,h){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(h)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(d){var A=o[d];if(T.detectEvictedFragments(d,A),!h)for(var g=0;gk&&E.removeFragment(u)}})},b.removeFragment=function(k){var D=O(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[D]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function U(M){var b,w;return M.buffered&&(((b=M.range.video)===null||b===void 0?void 0:b.partial)||((w=M.range.audio)===null||w===void 0?void 0:w.partial))}function O(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return U}),R.d(Y,"MAX_START_GAP_JUMP",function(){return O}),R.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),R.d(Y,"SKIP_BUFFER_RANGE_START",function(){return b}),R.d(Y,"default",function(){return w});var Q=R("./src/utils/buffer-helper.ts"),B=R("./src/errors.ts"),_=R("./src/events.ts"),H=R("./src/utils/logger.ts"),U=250,O=2,M=.1,b=.05,w=function(){function k(T,E,h,o){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=T,this.media=E,this.fragmentTracker=h,this.hls=o}var D=k.prototype;return D.destroy=function(){this.hls=this.fragmentTracker=this.media=null},D.poll=function(E){var h=this.config,o=this.media,u=this.stalled,d=o.currentTime,A=o.seeking,g=this.seeking&&!A,m=!this.seeking&&A;if(this.seeking=A,d!==E){if(this.moved=!0,u!==null){if(this.stallReported){var L=self.performance.now()-u;H.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||g)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!Q.BufferHelper.getBuffered(o).length)return;var x=Q.BufferHelper.bufferInfo(o,d,0),p=x.len>0,c=x.nextStart||0;if(!p&&!c)return;if(A){var s=x.len>O,a=!c||c-d>O&&!this.fragmentTracker.getPartialFragment(d);if(s||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,v=Math.max(c,x.start||0)-d,C=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=C==null||((y=C.details)===null||y===void 0)?void 0:y.live,G=P?C.details.targetduration*2:O;if(v>0&&v<=G){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(u===null){this.stalled=V;return}var $=V-u;!A&&$>=U&&this._reportStall(x.len);var z=Q.BufferHelper.bufferInfo(o,d,h.maxBufferHole);this._tryFixBufferStall(z,$)},D._tryFixBufferStall=function(E,h){var o=this.config,u=this.fragmentTracker,d=this.media,A=d.currentTime,g=u.getPartialFragment(A);if(g){var m=this._trySkipBufferHole(g);if(m)return}E.len>o.maxBufferHole&&h>o.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},D._reportStall=function(E){var h=this.hls,o=this.media,u=this.stallReported;u||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+E+")"),h.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:E}))},D._trySkipBufferHole=function(E){for(var h=this.config,o=this.hls,u=this.media,d=u.currentTime,A=0,g=Q.BufferHelper.getBuffered(u),m=0;m=A&&d.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,o)),L=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;k.playbackRate=Math.min(m,Math.max(1,L))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},b.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},b.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},U(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,D=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:D?k.liveMaxLatencyDurationCount*D.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var D=k.holdBack,T=k.partHoldBack,E=k.targetduration,h=this.config,o=h.liveSyncDuration,u=h.liveSyncDurationCount,d=h.lowLatencyMode,A=this.hls.userConfig,g=d&&T||D;(A.liveSyncDuration||A.liveSyncDurationCount||g===0)&&(g=o!==void 0?o:u*E);var m=E,L=1;return g+Math.min(this.stallCount*L,m)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),D=this.targetLatency,T=this.levelDetails;if(k===null||D===null||T===null)return null;var E=T.edge,h=k-D-this.edgeStalled,o=E-T.totalduration,u=E-(this.config.lowLatencyMode&&T.partTarget||T.targetduration);return Math.min(Math.max(o,h),u)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var D=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-D,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,D=this.levelDetails;if(!k||!D)return 0;var T=k.buffered.length;return T?k.buffered.end(T-1):D.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return h});var Q=R("./src/types/level.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),H=R("./src/utils/codecs.ts"),U=R("./src/controller/level-helper.ts"),O=R("./src/controller/base-playlist-controller.ts"),M=R("./src/types/loader.ts");function b(){return b=Object.assign||function(o){for(var u=1;u0){c=L[0].bitrate,L.sort(function($,z){return $.bitrate-z.bitrate}),this._levels=L;for(var P=0;Pthis.hls.config.fragLoadingMaxRetry&&(s=m.frag.level)):s=m.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(c=!1),s=L.level),p=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:s=m.level,p=!0;break}s!==void 0&&this.recoverLevel(m,s,p,c)},d.recoverLevel=function(g,m,L,x){var p=g.details,c=this._levels[m];if(c.loadError++,L){var s=this.retryLoadingOrFail(g);if(s)g.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var a=c.url.length;if(a>1&&c.loadError1){var x=(m.urlId+1)%L;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(p){p.urlId=x}),this.level=g}},d.onFragLoaded=function(g,m){var L=m.frag;if(L!==void 0&&L.type===M.PlaylistLevelType.MAIN){var x=this._levels[L.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},d.onLevelLoaded=function(g,m){var L,x=m.level,p=m.details,c=this._levels[x];if(!c){var s;this.warn("Invalid level index "+x),(s=m.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(p.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(x,m,c.details)):(L=m.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(p.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(g,m){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var x=-1,p=this.hls.audioTracks[m.id].groupId,c=0;c0){var x=L.urlId,p=L.url[x];if(g)try{p=g.addDirectives(p)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+m+(g?" at sn "+g.msn+" part "+g.part:"")+" with URL-id "+x+" "+p),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:p,level:m,id:x,deliveryDirectives:g||null})}},d.removeLevel=function(g,m){var L=function(c,s){return s!==m},x=this._levels.filter(function(p,c){return c!==g?!0:p.url.length>1&&m!==void 0?(p.url=p.url.filter(L),p.audioGroupIds&&(p.audioGroupIds=p.audioGroupIds.filter(L)),p.textGroupIds&&(p.textGroupIds=p.textGroupIds.filter(L)),p.urlId=0,!0):!1}).map(function(p,c){var s=p.details;return s!=null&&s.fragments&&s.fragments.forEach(function(a){a.level=c}),p});this._levels=x,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:x})},k(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(g){var m,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===g&&(m=L[g])!==null&&m!==void 0&&m.details)return;if(g<0||g>=L.length){var x=g<0;if(this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:g,fatal:x,reason:"invalid level idx"}),x)return;g=Math.min(g,L.length-1)}this.clearTimer();var p=this.currentLevelIndex,c=L[p],s=L[g];this.log("switching to level "+g+" from "+p),this.currentLevelIndex=g;var a=b({},s,{level:g,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete a._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,a);var y=s.details;if(!y||y.live){var v=this.switchParams(s.uri,c==null?void 0:c.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(g){this.manualLevelIndex=g,this._startLevel===void 0&&(this._startLevel=g),g!==-1&&(this.level=g)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(g){this._firstLevel=g}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var g=this.hls.config.startLevel;return g!==void 0?g:this._firstLevel}else return this._startLevel},set:function(g){this._startLevel=g}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(g){this.level=g,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=g)}}]),u}(O.default)},"./src/controller/level-helper.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"addGroupId",function(){return _}),R.d(Y,"assignTrackIdsByGroup",function(){return H}),R.d(Y,"updatePTS",function(){return U}),R.d(Y,"updateFragPTSDTS",function(){return M}),R.d(Y,"mergeDetails",function(){return b}),R.d(Y,"mapPartIntersection",function(){return w}),R.d(Y,"mapFragmentIntersection",function(){return k}),R.d(Y,"adjustSliding",function(){return D}),R.d(Y,"addSliding",function(){return T}),R.d(Y,"computeReloadInterval",function(){return E}),R.d(Y,"getFragmentWithSN",function(){return h}),R.d(Y,"getPartWith",function(){return o});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts");function _(u,d,A){switch(d){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(A);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(A);break}}function H(u){var d={};u.forEach(function(A){var g=A.groupId||"";A.id=d[g]=d[g]||0,d[g]++})}function U(u,d,A){var g=u[d],m=u[A];O(g,m)}function O(u,d){var A=d.startPTS;if(Object(Q.isFiniteNumber)(A)){var g=0,m;d.sn>u.sn?(g=A-u.start,m=u):(g=u.start-A,m=d),m.duration!==g&&(m.duration=g)}else if(d.sn>u.sn){var L=u.cc===d.cc;L&&u.minEndPTS?d.start=u.start+(u.minEndPTS-u.start):d.start=u.start+u.duration}else d.start=Math.max(u.start-d.duration,0)}function M(u,d,A,g,m,L){var x=g-A;x<=0&&(B.logger.warn("Fragment should have a positive duration",d),g=A+d.duration,L=m+d.duration);var p=A,c=g,s=d.startPTS,a=d.endPTS;if(Object(Q.isFiniteNumber)(s)){var y=Math.abs(s-A);Object(Q.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(y,d.deltaPTS):d.deltaPTS=y,p=Math.max(A,s),A=Math.min(A,s),m=Math.min(m,d.startDTS),c=Math.min(g,a),g=Math.max(g,a),L=Math.max(L,d.endDTS)}d.duration=g-A;var v=A-d.start;d.appendedPTS=g,d.start=d.startPTS=A,d.maxStartPTS=p,d.startDTS=m,d.endPTS=g,d.minEndPTS=c,d.endDTS=L;var C=d.sn;if(!u||Cu.endSN)return 0;var P,G=C-u.startSN,V=u.fragments;for(V[G]=d,P=G;P>0;P--)O(V[P],V[P-1]);for(P=G;P=0;m--){var L=g[m].initSegment;if(L){A=L;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var x=0,p;if(k(u,d,function(P,G){P.relurl&&(x=P.cc-G.cc),Object(Q.isFiniteNumber)(P.startPTS)&&Object(Q.isFiniteNumber)(P.endPTS)&&(G.start=G.startPTS=P.startPTS,G.startDTS=P.startDTS,G.appendedPTS=P.appendedPTS,G.maxStartPTS=P.maxStartPTS,G.endPTS=P.endPTS,G.endDTS=P.endDTS,G.minEndPTS=P.minEndPTS,G.duration=P.endPTS-P.startPTS,G.duration&&(p=G),d.PTSKnown=d.alignedSliding=!0),G.elementaryStreams=P.elementaryStreams,G.loader=P.loader,G.stats=P.stats,G.urlId=P.urlId,P.initSegment&&(G.initSegment=P.initSegment,A=P.initSegment)}),A){var c=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;c.forEach(function(P){var G;(!P.initSegment||P.initSegment.relurl===((G=A)===null||G===void 0?void 0:G.relurl))&&(P.initSegment=A)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(P){return!P}),d.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=d.skippedSegments;s--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var a=d.fragments;if(x){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y=g.length)return;T(d,g[A].start)}function T(u,d){if(d){for(var A=u.fragments,g=u.skippedSegments;g0&&m0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),c=s),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var c,s=this.levels,a=this.level,y=s==null||((c=s[a])===null||c===void 0)?void 0:c.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var v,C=self.performance.now(),P=this.retryDate;(!P||C>=P||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var c,s,a=this.hls,y=this.levelLastLoaded,v=this.levels,C=this.media,P=a.config,G=a.nextLoadLevel;if(y===null||!C&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[G])return;var V=v[G];this.level=a.nextLoadLevel=G;var $=V.details;if(!$||this.state===B.State.WAITING_LEVEL||$.live&&this.levelLastLoaded!==G){this.state=B.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:C,M.PlaylistLevelType.MAIN);if(z===null)return;var j=z.len,ee=this.getMaxBufferLength(V.maxBitrate);if(j>=ee)return;if(this._streamEnded(z,$)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,ne),this.state=B.State.ENDED;return}var ce=z.end,ve=this.getNextFragment(ce,$);if(this.couldBacktrack&&!this.fragPrevious&&ve&&ve.sn!=="initSegment"){var Ie=ve.sn-$.startSN;Ie>1&&(ve=$.fragments[Ie-1],this.fragmentTracker.removeFragment(ve))}if(ve&&this.fragmentTracker.getState(ve)===O.FragmentState.OK&&this.nextLoadPosition>ce){var xe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(C,xe,M.PlaylistLevelType.MAIN),ve=this.getNextFragment(this.nextLoadPosition,$)}if(!ve)return;ve.initSegment&&!ve.initSegment.data&&!this.bitrateTest&&(ve=ve.initSegment),((c=ve.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((s=ve.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(ve,$):this.loadFragment(ve,$,ce)},x.loadFragment=function(c,s,a){var y,v=this.fragmentTracker.getState(c);if(this.fragCurrent=c,v===O.FragmentState.BACKTRACKED){var C=this.fragmentTracker.getBacktrackData(c);if(C){this._handleFragmentLoadProgress(C),this._handleFragmentLoadComplete(C);return}else v=O.FragmentState.NOT_LOADED}v===O.FragmentState.NOT_LOADED||v===O.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,c,s,a)):v===O.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},x.getAppendedFrag=function(c){var s=this.fragmentTracker.getAppendedFrag(c,M.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},x.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,M.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var c=this.levels,s=this.media;if(s!=null&&s.readyState){var a,y=this.getAppendedFrag(s.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!s.paused&&c){var v=this.hls.nextLoadLevel,C=c[v],P=this.fragLastKbps;P&&this.fragCurrent?a=this.fragCurrent.duration*C.maxBitrate/(1e3*P)+1:a=0}else a=0;var G=this.getBufferedFrag(s.currentTime+a);if(G){var V=this.followingBufferedFrag(G);if(V){this.abortCurrentFrag();var $=V.maxStartPTS?V.maxStartPTS:V.start,z=V.duration,j=Math.max(G.end,$+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(j,Number.POSITIVE_INFINITY)}}}},x.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},x.flushMainBuffer=function(c,s){m.prototype.flushMainBuffer.call(this,c,s,this.altAudio?"video":null)},x.onMediaAttached=function(c,s){m.prototype.onMediaAttached.call(this,c,s);var a=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new D.default(this.config,a,this.fragmentTracker,this.hls)},x.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var c=this.media,s=c?c.currentTime:null;Object(Q.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},x.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},x.onManifestParsed=function(c,s){var a=!1,y=!1,v;s.levels.forEach(function(C){v=C.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(a=!0),v.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=a&&y&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},x.onLevelLoading=function(c,s){var a=this.levels;if(!a||this.state!==B.State.IDLE)return;var y=a[s.level];(!y.details||y.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(y.details))&&(this.state=B.State.WAITING_LEVEL)},x.onLevelLoaded=function(c,s){var a,y=this.levels,v=s.level,C=s.details,P=C.totalduration;if(!y){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+C.startSN+","+C.endSN+"], cc ["+C.startCC+", "+C.endCC+"] duration:"+P);var G=this.fragCurrent;G&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(G.level!==s.level&&G.loader&&(this.state=B.State.IDLE,G.loader.abort()));var V=y[v],$=0;if(C.live||(a=V.details)!==null&&a!==void 0&&a.live){if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed)return;$=this.alignPlaylists(C,V.details)}if(V.details=C,this.levelLastLoaded=v,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:C,level:v}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(C))return;this.state=B.State.IDLE}this.startFragRequested?C.live&&this.synchronizeToLiveEdge(C):this.setStartPosition(C,$),this.tick()},x._handleFragmentLoadProgress=function(c){var s,a=c.frag,y=c.part,v=c.payload,C=this.levels;if(!C){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var P=C[a.level],G=P.details;if(!G){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var V=P.videoCodec,$=G.PTSKnown||!G.live,z=(s=a.initSegment)===null||s===void 0?void 0:s.data,j=this._getAudioCodec(P),ee=this.transmuxer=this.transmuxer||new w.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=y?y.index:-1,ce=ne!==-1,ve=new k.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,v.byteLength,ne,ce),Ie=this.initPTS[a.cc];ee.push(v,z,j,V,a,y,G.totalduration,$,ve,Ie)},x.onAudioTrackSwitching=function(c,s){var a=this.altAudio,y=!!s.url,v=s.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var C=this.fragCurrent;C!=null&&C.loader&&(this.log("Switching to main audio track, cancel main fragment load"),C.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;a&&P.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:v})}},x.onAudioTrackSwitched=function(c,s){var a=s.id,y=!!this.hls.audioTracks[a].url;if(y){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=y,this.tick()},x.onBufferCreated=function(c,s){var a=s.tracks,y,v,C=!1;for(var P in a){var G=a[P];if(G.id==="main"){if(v=P,y=G,P==="video"){var V=a[P];V&&(this.videoBuffer=V.buffer)}}else C=!0}C&&y?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(c,s){var a=s.frag,y=s.part;if(a&&a.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(y?" p: "+y.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var v=y?y.stats:a.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,y)},x.onError=function(c,s){switch(s.details){case T.ErrorDetails.FRAG_LOAD_ERROR:case T.ErrorDetails.FRAG_LOAD_TIMEOUT:case T.ErrorDetails.KEY_LOAD_ERROR:case T.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,s);break;case T.ErrorDetails.LEVEL_LOAD_ERROR:case T.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=B.State.ERROR):!s.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case T.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var a=!0,y=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);y&&y.len>.5&&(a=!this.reduceMaxBufferLength(y.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},x.checkBuffer=function(){var c=this.media,s=this.gapController;if(!c||!s||!c.readyState)return;var a=U.BufferHelper.getBuffered(c);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(c,s){var a=s.type;if(a!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(a===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,a,M.PlaylistLevelType.MAIN)}},x.onLevelsUpdated=function(c,s){this.levels=s.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var c=this.media,s=c.currentTime,a=this.startPosition;if(a>=0&&s0&&(C1&&c.seeking===!1){var a=c.currentTime;if(U.BufferHelper.isBuffered(c,a)?s=this.getAppendedFrag(a):U.BufferHelper.isBuffered(c,a+.1)&&(s=this.getAppendedFrag(a+.1)),s){var y=this.fragPlaying,v=s.level;(!y||s.sn!==y.sn||y.level!==v||s.urlId!==y.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:s}),(!y||y.level!==v)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=s)}}},o(L,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var s=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"SubtitleStreamController",function(){return u});var Q=R("./src/events.ts"),B=R("./src/utils/logger.ts"),_=R("./src/utils/buffer-helper.ts"),H=R("./src/controller/fragment-finders.ts"),U=R("./src/utils/discontinuities.ts"),O=R("./src/controller/level-helper.ts"),M=R("./src/controller/fragment-tracker.ts"),b=R("./src/controller/base-stream-controller.ts"),w=R("./src/types/loader.ts"),k=R("./src/types/level.ts");function D(d,A){for(var g=0;g=s[v].start&&y<=s[v].end){a=s[v];break}var C=p.start+p.duration;a?a.end=C:(a={start:y,end:C},s.push(a)),this.fragmentTracker.fragBuffered(p)},g.onBufferFlushing=function(L,x){var p=x.startOffset,c=x.endOffset;if(p===0&&c!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,a=this.levels;if(!a.length||!a[s]||!a[s].details)return;var y=a[s].details,v=y.targetduration,C=c-v;if(C<=0)return;x.endOffsetSubtitles=Math.max(0,C),this.tracksBuffered.forEach(function(P){for(var G=0;G=y.length||s!==a||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(p=v.details)!==null&&p!==void 0&&p.live){var C=this.mainDetails;if(c.deltaUpdateFailed||!C)return;var P=C.fragments[0];if(!v.details)c.hasProgramDateTime&&C.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(c,C):P&&Object(O.addSliding)(c,P.start);else{var G=this.alignPlaylists(c,v.details);G===0&&P&&Object(O.addSliding)(c,P.start)}}if(v.details=c,this.levelLastLoaded=s,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var V=Object(H.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},g._handleFragmentLoadComplete=function(L){var x=L.frag,p=L.payload,c=x.decryptdata,s=this.hls;if(this.fragContextChanged(x))return;if(p&&p.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(p),c.key.buffer,c.iv.buffer).then(function(y){var v=performance.now();s.trigger(Q.Events.FRAG_DECRYPTED,{frag:x,payload:y,stats:{tstart:a,tdecrypt:v}})})}},g.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var L,x=this.currentTrackId,p=this.levels;if(!p.length||!p[x]||!p[x].details)return;var c=p[x].details,s=c.targetduration,a=this.config,y=this.media,v=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-s,a.maxBufferHole),C=v.end,P=v.len,G=this.getMaxBufferLength()+s;if(P>G)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var V=c.fragments,$=V.length,z=c.edge,j,ee=this.fragPrevious;if(C-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)},E.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},E.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 o=k(this.media.textTracks);o.forEach(function(u){Object(B.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},E.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},E.onManifestParsed=function(o,u){this.tracks=u.subtitleTracks},E.onSubtitleTrackLoaded=function(o,u){var d=u.id,A=u.details,g=this.trackId,m=this.tracksInGroup[g];if(!m){this.warn("Invalid subtitle track id "+d);return}var L=m.details;m.details=u.details,this.log("subtitle track "+d+" loaded ["+A.startSN+"-"+A.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,u,L))},E.onLevelLoading=function(o,u){this.switchLevel(u.level)},E.onLevelSwitching=function(o,u){this.switchLevel(u.level)},E.switchLevel=function(o){var u=this.hls.levels[o];if(!(u!=null&&u.textGroupIds))return;var d=u.textGroupIds[u.urlId];if(this.groupId!==d){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,g=this.tracks.filter(function(x){return!d||x.groupId===d});this.tracksInGroup=g;var m=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=d;var L={subtitleTracks:g};this.log("Updating subtitle tracks, "+g.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,L),m!==-1&&this.setSubtitleTrack(m,A)}},E.findTrackId=function(o){for(var u=this.tracksInGroup,d=0;d=A.length)return;this.clearTimer();var g=A[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,g){var m=g.id,L=g.groupId,x=L===void 0?"":L,p=g.name,c=g.type,s=g.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:x,name:p,type:c,url:s});var a=this.switchParams(g.url,u==null?void 0:u.details);this.loadPlaylist(a)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:o})},E.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,u=k(this.media.textTracks),d=0;d=0&&(c[0]=Math.min(c[0],A),c[1]=Math.max(c[1],g),x=!0,s/(g-A)>.5))return}if(x||L.push([A,g]),this.config.renderTextTracksNatively){var a=this.captionsTracks[d];this.Cues.newCue(a,A,g,m)}else{var y=this.Cues.newCue(null,A,g,m);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:y,track:d})}},o.onInitPtsFound=function(d,A){var g=this,m=A.frag,L=A.id,x=A.initPTS,p=A.timescale,c=this.unparsedVttFrags;L==="main"&&(this.initPTS[m.cc]=x,this.timescale[m.cc]=p),c.length&&(this.unparsedVttFrags=[],c.forEach(function(s){g.onFragLoaded(B.Events.FRAG_LOADED,s)}))},o.getExistingTrack=function(d){var A=this.media;if(A)for(var g=0;g>>8^p&255^99,M[m]=p,b[p]=m;var c=g[m],s=g[c],a=g[s],y=g[p]*257^p*16843008;k[m]=y<<24|y>>>8,D[m]=y<<16|y>>>16,T[m]=y<<8|y>>>24,E[m]=y,y=a*16843009^s*65537^c*257^m*16843008,o[p]=y<<24|y>>>8,u[p]=y<<16|y>>>16,d[p]=y<<8|y>>>24,A[p]=y,m?(m=c^g[g[g[a^c]]],L^=g[g[L]]):m=L=1}},U.expandKey=function(M){for(var b=this.uint8ArrayToUint32Array_(M),w=!0,k=0;k>>6)+1;var y=(d[A+2]&60)>>>2;if(y>a.length-1){u.trigger(_.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return x=(d[A+2]&1)<<2,x|=(d[A+3]&192)>>>6,Q.logger.log("manifest codec:"+g+", ADTS type:"+m+", samplingIndex:"+y),/firefox/i.test(c)?y>=6?(m=5,p=new Array(4),L=y-3):(m=2,p=new Array(2),L=y):c.indexOf("android")!==-1?(m=2,p=new Array(2),L=y):(m=5,p=new Array(4),g&&(g.indexOf("mp4a.40.29")!==-1||g.indexOf("mp4a.40.5")!==-1)||!g&&y>=6?L=y-3:((g&&g.indexOf("mp4a.40.2")!==-1&&(y>=6&&x===1||/vivaldi/i.test(c))||!g&&x===1)&&(m=2,p=new Array(2)),L=y)),p[0]=m<<3,p[0]|=(y&14)>>1,p[1]|=(y&1)<<7,p[1]|=x<<3,m===5&&(p[1]|=(L&14)>>1,p[2]=(L&1)<<7,p[2]|=2<<2,p[3]=0),{config:p,samplerate:a[y],channelCount:x,codec:"mp4a.40."+m,manifestCodec:s}}function U(u,d){return u[d]===255&&(u[d+1]&246)===240}function O(u,d){return u[d+1]&1?7:9}function M(u,d){return(u[d+3]&3)<<11|u[d+4]<<3|(u[d+5]&224)>>>5}function b(u,d){return d+5=u.length)return!1;var g=M(u,d);if(g<=A)return!1;var m=d+g;return m===u.length||w(u,m)}return!1}function T(u,d,A,g,m){if(!u.samplerate){var L=H(d,A,g,m);if(!L)return;u.config=L.config,u.samplerate=L.samplerate,u.channelCount=L.channelCount,u.codec=L.codec,u.manifestCodec=L.manifestCodec,Q.logger.log("parsed codec:"+u.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function E(u){return 1024*9e4/u}function h(u,d,A,g,m){var L=O(u,d),x=M(u,d);if(x-=L,x>0){var p=A+g*m;return{headerLength:L,frameLength:x,stamp:p}}}function o(u,d,A,g,m){var L=E(u.samplerate),x=h(d,A,g,m,L);if(x){var p=x.frameLength,c=x.headerLength,s=x.stamp,a=c+p,y=Math.max(0,A+a-d.length),v;y?(v=new Uint8Array(a-c),v.set(d.subarray(A+c,d.length),0)):v=d.subarray(A+c,A+a);var C={unit:v,pts:s};return y||u.samples.push(C),{sample:C,length:a,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"initPTSFn",function(){return M});var Q=R("./src/polyfills/number.ts"),B=R("./src/demux/id3.ts"),_=R("./src/demux/dummy-demuxed-track.ts"),H=R("./src/utils/mp4-tools.ts"),U=R("./src/utils/typed-array.ts"),O=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var w=b.prototype;return w.resetInitSegment=function(D,T,E){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},w.resetTimeStamp=function(){},w.resetContiguity=function(){},w.canParse=function(D,T){return!1},w.appendFrame=function(D,T,E){},w.demux=function(D,T){this.cachedData&&(D=Object(H.appendUint8Array)(this.cachedData,D),this.cachedData=null);var E=B.getID3Data(D,0),h=E?E.length:0,o,u,d=this._audioTrack,A=this._id3Track,g=E?B.getTimeStamp(E):void 0,m=D.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(g,T)),E&&E.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:E}),u=this.initPTS;hO?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,M=O>>3,O-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},H.readBits=function(O){var M=Math.min(this.bitsAvailable,O),b=this.word>>>32-M;return O>32&&Q.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=O-M,M>0&&this.bitsAvailable?b<>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},H.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(O){for(var M=8,b=8,w,k=0;k0?m.subarray(x,x+p):void 0},H=function(m,L){var x=0;return x=(m[L]&127)<<21,x|=(m[L+1]&127)<<14,x|=(m[L+2]&127)<<7,x|=m[L+3]&127,x},U=function(m,L){return Q(m,L)&&H(m,L+6)+10<=m.length-L},O=function(m){for(var L=w(m),x=0;x>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:C+=String.fromCharCode(a);break;case 12:case 13:y=m[P++],C+=String.fromCharCode((a&31)<<6|y&63);break;case 14:y=m[P++],v=m[P++],C+=String.fromCharCode((a&15)<<12|(y&63)<<6|(v&63)<<0);break;default:}}return C},u={decodeTextFrame:T},d;function A(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/demux/base-audio-demuxer.ts"),B=R("./src/demux/id3.ts"),_=R("./src/utils/logger.ts"),H=R("./src/demux/mpegaudio.ts");function U(b,w){b.prototype=Object.create(w.prototype),b.prototype.constructor=b,O(b,w)}function O(b,w){return O=Object.setPrototypeOf||function(D,T){return D.__proto__=T,D},O(b,w)}var M=function(b){U(w,b);function w(){return b.apply(this,arguments)||this}var k=w.prototype;return k.resetInitSegment=function(T,E,h){b.prototype.resetInitSegment.call(this,T,E,h),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:T,duration:h,inputTimeScale:9e4,dropped:0}},w.probe=function(T){if(!T)return!1;for(var E=B.getID3Data(T,0)||[],h=E.length,o=T.length;h0},U.demux=function(M){var b=M,w=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(Q.appendUint8Array)(this.remainderData,M));var k=Object(Q.segmentValidRange)(b);this.remainderData=k.remainder,w.samples=k.valid||new Uint8Array}else w.samples=b;return{audioTrack:Object(B.dummyTrack)(),avcTrack:w,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},U.flush=function(){var M=Object(B.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:M,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},U.demuxSampleAes=function(M,b,w){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},H}();_.minProbeByteLength=1024,Y.default=_},"./src/demux/mpegaudio.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"appendFrame",function(){return O}),R.d(Y,"parseHeader",function(){return M}),R.d(Y,"isHeaderPattern",function(){return b}),R.d(Y,"isHeader",function(){return w}),R.d(Y,"canParse",function(){return k}),R.d(Y,"probe",function(){return D});var Q=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],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function O(T,E,h,o,u){if(h+24>E.length)return;var d=M(E,h);if(d&&h+d.frameLength<=E.length){var A=d.samplesPerFrame*9e4/d.sampleRate,g=o+u*A,m={unit:E.subarray(h,h+d.frameLength),pts:g,dts:g};return T.config=[],T.channelCount=d.channelCount,T.samplerate=d.sampleRate,T.samples.push(m),{sample:m,length:d.frameLength,missing:0}}}function M(T,E){var h=T[E+1]>>3&3,o=T[E+1]>>1&3,u=T[E+2]>>4&15,d=T[E+2]>>2&3;if(h!==1&&u!==0&&u!==15&&d!==3){var A=T[E+2]>>1&1,g=T[E+3]>>6,m=h===3?3-o:o===3?3:4,L=B[m*14+u-1]*1e3,x=h===3?0:h===2?1:2,p=_[x*3+d],c=g===3?1:2,s=H[h][o],a=U[o],y=s*8*a,v=Math.floor(s*L/p+A)*a;if(Q===null){var C=navigator.userAgent||"",P=C.match(/Chrome\/(\d+)/i);Q=P?parseInt(P[1]):0}var G=!!Q&&Q<=87;return G&&o===2&&L>=224e3&&g===0&&(T[E+3]=T[E+3]|128),{sampleRate:p,channelCount:c,frameLength:v,samplesPerFrame:y}}}function b(T,E){return T[E]===255&&(T[E+1]&224)===224&&(T[E+1]&6)!==0}function w(T,E){return E+1=M.length){w();return}if(M[b].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(M,b,w,k),!k)return}},U.getAvcEncryptedData=function(M){for(var b=Math.floor((M.length-48)/160)*16+16,w=new Int8Array(b),k=0,D=32;D<=M.length-16;D+=160,k+=16)w.set(M.subarray(D,D+16),k);return w},U.getAvcDecryptedUnit=function(M,b){for(var w=new Uint8Array(b),k=0,D=32;D<=M.length-16;D+=160,k+=16)M.set(w.subarray(k,k+16),D);return M},U.decryptAvcSample=function(M,b,w,k,D,T){var E=Object(B.discardEPB)(D.data),h=this.getAvcEncryptedData(E),o=this;this.decryptBuffer(h.buffer,function(u){D.data=o.getAvcDecryptedUnit(E,u),T||o.decryptAvcSamples(M,b,w+1,k)})},U.decryptAvcSamples=function(M,b,w,k){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,w=0){if(b>=M.length){k();return}for(var D=M[b].units;!(w>=D.length);w++){var T=D[w];if(T.data.length<=48||T.type!==1&&T.type!==5)continue;var E=this.decrypter.isSync();if(this.decryptAvcSample(M,b,w,k,T,E),!E)return}}},H}();Y.default=_},"./src/demux/transmuxer-interface.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return D});var Q=R("./node_modules/webworkify-webpack/index.js"),B=R.n(Q),_=R("./src/events.ts"),H=R("./src/demux/transmuxer.ts"),U=R("./src/utils/logger.ts"),O=R("./src/errors.ts"),M=R("./src/utils/mediasource-helper.ts"),b=R("./node_modules/eventemitter3/index.js"),w=R.n(b),k=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},D=function(){function T(h,o,u,d){var A=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=h,this.id=o,this.onTransmuxComplete=u,this.onFlush=d;var g=h.config,m=function(s,a){a=a||{},a.frag=A.frag,a.id=A.id,h.trigger(s,a)};this.observer=new b.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,m),this.observer.on(_.Events.ERROR,m);var L={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(g.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var p;try{p=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),p.addEventListener("message",this.onwmsg),p.onerror=function(c){h.trigger(_.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},p.postMessage({cmd:"init",typeSupported:L,vendor:x,id:o,config:JSON.stringify(g)})}catch(c){U.logger.warn("Error in worker:",c),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),p&&self.URL.revokeObjectURL(p.objectURL),this.transmuxer=new H.default(this.observer,L,g,x,o),this.worker=null}}else this.transmuxer=new H.default(this.observer,L,g,x,o)}var E=T.prototype;return E.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},E.push=function(o,u,d,A,g,m,L,x,p,c){var s=this;p.transmuxing.start=self.performance.now();var a=this.transmuxer,y=this.worker,v=m?m.start:g.start,C=g.decryptdata,P=this.frag,G=!(P&&g.cc===P.cc),V=!(P&&p.level===P.level),$=P?p.sn-P.sn:-1,z=this.part?p.part-this.part.index:1,j=!V&&($===1||$===0&&z===1),ee=self.performance.now();(V||$||g.stats.parsing.start===0)&&(g.stats.parsing.start=ee),m&&(z||!j)&&(m.stats.parsing.start=ee);var ne=new H.TransmuxState(G,j,x,V,v);if(!j||G){U.logger.log("[transmuxer-interface, "+g.type+"]: Starting new transmux session for sn: "+p.sn+" p: "+p.part+" level: "+p.level+" id: "+p.id+` discontinuity: `+G+` trackSwitch: `+V+` contiguous: `+j+` accurateTimeOffset: `+x+` timeOffset: `+v);var ce=new H.TransmuxConfig(d,A,u,L,c);this.configureTransmuxer(ce)}if(this.frag=g,this.part=m,y)y.postMessage({cmd:"demux",data:o,decryptdata:C,chunkMeta:p,state:ne},o instanceof ArrayBuffer?[o]:[]);else if(a){var ve=a.push(o,C,p,ne);Object(H.isPromise)(ve)?ve.then(function(Ie){s.handleTransmuxComplete(Ie)}):this.handleTransmuxComplete(ve)}},E.flush=function(o){var u=this;o.transmuxing.start=self.performance.now();var d=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:o});else if(d){var g=d.flush(o);Object(H.isPromise)(g)?g.then(function(m){u.handleFlushResult(m,o)}):this.handleFlushResult(g,o)}},E.handleFlushResult=function(o,u){var d=this;o.forEach(function(A){d.handleTransmuxComplete(A)}),this.onFlush(u)},E.onWorkerMessage=function(o){var u=o.data,d=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,d.trigger(u.event,u.data);break}}},E.configureTransmuxer=function(o){var u=this.worker,d=this.transmuxer;u?u.postMessage({cmd:"configure",config:o}):d&&d.configure(o)},E.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},T}()},"./src/demux/transmuxer-worker.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return O});var Q=R("./src/demux/transmuxer.ts"),B=R("./src/events.ts"),_=R("./src/utils/logger.ts"),H=R("./node_modules/eventemitter3/index.js"),U=R.n(H);function O(D){var T=new H.EventEmitter,E=function(o,u){D.postMessage({event:o,data:u})};T.on(B.Events.FRAG_DECRYPTED,E),T.on(B.Events.ERROR,E),D.addEventListener("message",function(h){var o=h.data;switch(o.cmd){case"init":{var u=JSON.parse(o.config);D.transmuxer=new Q.default(T,o.typeSupported,u,o.vendor,o.id),Object(_.enableLogs)(u.debug),E("init",null);break}case"configure":{D.transmuxer.configure(o.config);break}case"demux":{var d=D.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(Q.isPromise)(d)?d.then(function(m){M(D,m)}):M(D,d);break}case"flush":{var A=o.chunkMeta,g=D.transmuxer.flush(A);Object(Q.isPromise)(g)?g.then(function(m){w(D,m,A)}):w(D,g,A);break}default:break}})}function M(D,T){if(k(T.remuxResult))return;var E=[],h=T.remuxResult,o=h.audio,u=h.video;o&&b(E,o),u&&b(E,u),D.postMessage({event:"transmuxComplete",data:T},E)}function b(D,T){T.data1&&D.push(T.data1.buffer),T.data2&&D.push(T.data2.buffer)}function w(D,T,E){T.forEach(function(h){M(D,h)}),D.postMessage({event:"flush",data:E})}function k(D){return!D.audio&&!D.video&&!D.text&&!D.id3&&!D.initSegment}},"./src/demux/transmuxer.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return u}),R.d(Y,"isPromise",function(){return g}),R.d(Y,"TransmuxConfig",function(){return m}),R.d(Y,"TransmuxState",function(){return L});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/crypt/decrypter.ts"),H=R("./src/demux/aacdemuxer.ts"),U=R("./src/demux/mp4demuxer.ts"),O=R("./src/demux/tsdemuxer.ts"),M=R("./src/demux/mp3demuxer.ts"),b=R("./src/remux/mp4-remuxer.ts"),w=R("./src/remux/passthrough-remuxer.ts"),k=R("./src/demux/chunk-cache.ts"),D=R("./src/utils/mp4-tools.ts"),T=R("./src/utils/logger.ts"),E;try{E=self.performance.now.bind(self.performance)}catch(x){T.logger.debug("Unable to use Performance API on this environment"),E=self.Date.now}var h=[{demux:O.default,remux:b.default},{demux:U.default,remux:w.default},{demux:H.default,remux:b.default},{demux:M.default,remux:b.default}],o=1024;h.forEach(function(x){var p=x.demux;o=Math.max(o,p.minProbeByteLength)});var u=function(){function x(c,s,a,y,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new k.default,this.observer=c,this.typeSupported=s,this.config=a,this.vendor=y,this.id=v}var p=x.prototype;return p.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},p.push=function(s,a,y,v){var C=this,P=y.transmuxing;P.executeStart=E();var G=new Uint8Array(s),V=this.cache,$=this.config,z=this.currentTransmuxState,j=this.transmuxConfig;v&&(this.currentTransmuxState=v);var ee=d(G,a);if(ee&&ee.method==="AES-128"){var ne=this.getDecrypter();if($.enableSoftwareAES){var ce=ne.softwareDecrypt(G,ee.key.buffer,ee.iv.buffer);if(!ce)return P.executeEnd=E(),A(y);G=new Uint8Array(ce)}else return this.decryptionPromise=ne.webCryptoDecrypt(G,ee.key.buffer,ee.iv.buffer).then(function(Fe){var Be=C.push(Fe,null,y);return C.decryptionPromise=null,Be}),this.decryptionPromise}var ve=v||z,Ie=ve.contiguous,xe=ve.discontinuity,Ee=ve.trackSwitch,Te=ve.accurateTimeOffset,Se=ve.timeOffset,me=j.audioCodec,se=j.videoCodec,ke=j.defaultInitPts,Ve=j.duration,We=j.initSegmentData;if((xe||Ee)&&this.resetInitSegment(We,me,se,Ve),xe&&this.resetInitialTimestamp(ke),Ie||this.resetContiguity(),this.needsProbing(G,xe,Ee)){if(V.dataLength){var Je=V.flush();G=Object(D.appendUint8Array)(Je,G)}this.configureTransmuxer(G,j)}var qe=this.transmux(G,ee,Se,Te,y),De=this.currentTransmuxState;return De.contiguous=!0,De.discontinuity=!1,De.trackSwitch=!1,P.executeEnd=E(),qe},p.flush=function(s){var a=this,y=s.transmuxing;y.executeStart=E();var v=this.decrypter,C=this.cache,P=this.currentTransmuxState,G=this.decryptionPromise;if(G)return G.then(function(){return a.flush(s)});var V=[],$=P.timeOffset;if(v){var z=v.flush();z&&V.push(this.push(z,null,s))}var j=C.dataLength;C.reset();var ee=this.demuxer,ne=this.remuxer;if(!ee||!ne)return j>=o&&this.observer.emit(Q.Events.ERROR,Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=E(),[A(s)];var ce=ee.flush($);return g(ce)?ce.then(function(ve){return a.flushRemux(V,ve,s),V}):(this.flushRemux(V,ce,s),V)},p.flushRemux=function(s,a,y){var v=a.audioTrack,C=a.avcTrack,P=a.id3Track,G=a.textTrack,V=this.currentTransmuxState,$=V.accurateTimeOffset,z=V.timeOffset;T.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var j=this.remuxer.remux(v,C,P,G,z,$,!0,this.id);s.push({remuxResult:j,chunkMeta:y}),y.transmuxing.executeEnd=E()},p.resetInitialTimestamp=function(s){var a=this.demuxer,y=this.remuxer;if(!a||!y)return;a.resetTimeStamp(s),y.resetTimeStamp(s)},p.resetContiguity=function(){var s=this.demuxer,a=this.remuxer;if(!s||!a)return;s.resetContiguity(),a.resetNextTimestamp()},p.resetInitSegment=function(s,a,y,v){var C=this.demuxer,P=this.remuxer;if(!C||!P)return;C.resetInitSegment(a,y,v),P.resetInitSegment(s,a,y)},p.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},p.transmux=function(s,a,y,v,C){var P;return a&&a.method==="SAMPLE-AES"?P=this.transmuxSampleAes(s,a,y,v,C):P=this.transmuxUnencrypted(s,y,v,C),P},p.transmuxUnencrypted=function(s,a,y,v){var C=this.demuxer.demux(s,a,!1,!this.config.progressive),P=C.audioTrack,G=C.avcTrack,V=C.id3Track,$=C.textTrack,z=this.remuxer.remux(P,G,V,$,a,y,!1,this.id);return{remuxResult:z,chunkMeta:v}},p.transmuxSampleAes=function(s,a,y,v,C){var P=this;return this.demuxer.demuxSampleAes(s,a,y).then(function(G){var V=P.remuxer.remux(G.audioTrack,G.avcTrack,G.id3Track,G.textTrack,y,v,!1,P.id);return{remuxResult:V,chunkMeta:C}})},p.configureTransmuxer=function(s,a){for(var y=this.config,v=this.observer,C=this.typeSupported,P=this.vendor,G=a.audioCodec,V=a.defaultInitPts,$=a.duration,z=a.initSegmentData,j=a.videoCodec,ee,ne=0,ce=h.length;ne0&&p!=null&&p.key!=null&&p.iv!==null&&p.method!=null&&(c=p),c}var A=function(p){return{remuxResult:{},chunkMeta:p}};function g(x){return"then"in x&&x.then instanceof Function}var m=function(p,c,s,a,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=p,this.videoCodec=c,this.initSegmentData=s,this.duration=a,this.defaultInitPts=y},L=function(p,c,s,a,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=p,this.contiguous=c,this.accurateTimeOffset=s,this.trackSwitch=a,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"discardEPB",function(){return A});var Q=R("./src/demux/adts.ts"),B=R("./src/demux/mpegaudio.ts"),_=R("./src/demux/exp-golomb.ts"),H=R("./src/demux/id3.ts"),U=R("./src/demux/sample-aes.ts"),O=R("./src/events.ts"),M=R("./src/utils/mp4-tools.ts"),b=R("./src/utils/logger.ts"),w=R("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},D=function(){function g(L,x,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=x,this.typeSupported=p}g.probe=function(x){var p=g.syncOffset(x);return p<0?!1:(p&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+p+", junk ahead ?"),!0)},g.syncOffset=function(x){for(var p=Math.min(1e3,x.length-3*188),c=0;c>4,me=void 0;if(Se>1){if(me=xe+5+x[xe+4],me===xe+188)continue}else me=xe+4;switch(Te){case P:Ee&&(G&&(a=o(G))&&this.parseAVCPES(a,!1),G={data:[],size:0}),G&&(G.data.push(x.subarray(me,xe+188)),G.size+=xe+188-me);break;case V:Ee&&(z&&(a=o(z))&&(v.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),z={data:[],size:0}),z&&(z.data.push(x.subarray(me,xe+188)),z.size+=xe+188-me);break;case $:Ee&&(j&&(a=o(j))&&this.parseID3PES(a),j={data:[],size:0}),j&&(j.data.push(x.subarray(me,xe+188)),j.size+=xe+188-me);break;case 0:Ee&&(me+=x[me]+1),ce=this._pmtId=E(x,me);break;case ce:{Ee&&(me+=x[me]+1);var se=h(x,me,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);P=se.avc,P>0&&(y.pid=P),V=se.audio,V>0&&(v.pid=V,v.isAAC=se.isAAC),$=se.id3,$>0&&(C.pid=$),ee&&!ne&&(b.logger.log("reparse from beginning"),ee=!1,xe=Ie-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:ee=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=G,v.pesData=z,C.pesData=j;var ke={audioTrack:v,avcTrack:y,id3Track:C,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(ke),ke},m.flush=function(){var x=this.remainderData;this.remainderData=null;var p;return x?p=this.demux(x,-1,!1,!0):p={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},m.extractRemainingSamples=function(x){var p=x.audioTrack,c=x.avcTrack,s=x.id3Track,a=c.pesData,y=p.pesData,v=s.pesData,C;a&&(C=o(a))?(this.parseAVCPES(C,!0),c.pesData=null):c.pesData=a,y&&(C=o(y))?(p.isAAC?this.parseAACPES(C):this.parseMPEGPES(C),p.pesData=null):(y!=null&&y.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=y),v&&(C=o(v))?(this.parseID3PES(C),s.pesData=null):s.pesData=v},m.demuxSampleAes=function(x,p,c){var s=this.demux(x,c,!0,!this.config.progressive),a=this.sampleAes=new U.default(this.observer,this.config,p);return this.decrypt(s,a)},m.decrypt=function(x,p){return new Promise(function(c){var s=x.audioTrack,a=x.avcTrack;s.samples&&s.isAAC?p.decryptAacSamples(s.samples,0,function(){a.samples?p.decryptAvcSamples(a.samples,0,0,function(){c(x)}):c(x)}):a.samples&&p.decryptAvcSamples(a.samples,0,0,function(){c(x)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(x,p){var c=this,s=this._avcTrack,a=this.parseAVCNALu(x.data),y=!1,v=this.avcSample,C,P=!1;x.data=null,v&&a.length&&!s.audFound&&(u(v,s),v=this.avcSample=T(!1,x.pts,x.dts,"")),a.forEach(function(G){switch(G.type){case 1:{C=!0,v||(v=c.avcSample=T(!0,x.pts,x.dts,"")),y&&(v.debug+="NDR "),v.frame=!0;var V=G.data;if(P&&V.length>4){var $=new _.default(V).readSliceType();($===2||$===4||$===7||$===9)&&(v.key=!0)}break}case 5:C=!0,v||(v=c.avcSample=T(!0,x.pts,x.dts,"")),y&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{C=!0,y&&v&&(v.debug+="SEI ");var z=new _.default(A(G.data));z.readUByte();for(var j=0,ee=0,ne=!1,ce=0;!ne&&z.bytesAvailable>1;){j=0;do ce=z.readUByte(),j+=ce;while(ce===255);ee=0;do ce=z.readUByte(),ee+=ce;while(ce===255);if(j===4&&z.bytesAvailable!==0){ne=!0;var ve=z.readUByte();if(ve===181){var Ie=z.readUShort();if(Ie===49){var xe=z.readUInt();if(xe===1195456820){var Ee=z.readUByte();if(Ee===3){for(var Te=z.readUByte(),Se=z.readUByte(),me=31&Te,se=[Te,Se],ke=0;ke16){for(var Ve=[],We=0;We<16;We++)Ve.push(z.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&Ve.push("-");for(var Je=ee-16,qe=new Uint8Array(Je),De=0;De=0){var z={data:x.subarray(V,v-s-1),type:$};y.push(z)}else{var j=this.getLastNalUnit();if(j&&(a&&v<=4-a&&(j.state&&(j.data=j.data.subarray(0,j.data.byteLength-a))),P=v-s-1,P>0)){var ee=new Uint8Array(j.data.byteLength+P);ee.set(j.data,0),ee.set(x.subarray(0,P),j.data.byteLength),j.data=ee,j.state=0}}v=0&&s>=0){var ne={data:x.subarray(V,p),type:$,state:s};y.push(ne)}if(y.length===0){var ce=this.getLastNalUnit();if(ce){var ve=new Uint8Array(ce.data.byteLength+x.byteLength);ve.set(ce.data,0),ve.set(x,ce.data.byteLength),ce.data=ve}}return c.naluState=s,y},m.parseAACPES=function(x){var p=0,c=this._audioTrack,s=this.aacOverFlow,a=x.data;if(s){this.aacOverFlow=null;var y=s.sample.unit.byteLength,v=Math.min(s.missing,y),C=y-v;s.sample.unit.set(a.subarray(0,v),C),c.samples.push(s.sample),p=s.missing}var P,G;for(P=p,G=a.length;P1;){var y=new Uint8Array(a[0].length+a[1].length);y.set(a[0]),y.set(a[1],a[0].length),a[0]=y,a.splice(1,1)}L=a[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(x=(L[4]<<8)+L[5],x&&x>g.size-6)return null;var C=L[7];C&192&&(c=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,C&64?(s=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,c-s>60*9e4&&(b.logger.warn(Math.round((c-s)/9e4)+"s delta between PTS and DTS, align them"),c=s)):s=c),p=L[8];var P=p+9;if(g.size<=P)return null;g.size-=P;for(var G=new Uint8Array(g.size),V=0,$=a.length;V<$;V++){L=a[V];var z=L.byteLength;if(P)if(P>z){P-=z;continue}else L=L.subarray(P),z-=P,P=0;G.set(L,m),m+=z}return x&&(x-=p+3),{data:G,pts:c,dts:s,len:x}}return null}function u(g,m){if(g.units.length&&g.frame){if(g.pts===void 0){var L=m.samples,x=L.length;if(x){var p=L[x-1];g.pts=p.pts,g.dts=p.dts}else{m.dropped++;return}}m.samples.push(g)}g.debug.length&&b.logger.log(g.pts+"/"+g.dts+":"+g.debug)}function d(g,m){var L=g.length;if(L>0){if(m.pts>=g[L-1].pts)g.push(m);else for(var x=L-1;x>=0;x--)if(m.ptsc)return a;return 0}},{key:"maxAutoLevel",get:function(){var p=this.levels,c=this.autoLevelCapping,s;return c===-1&&p&&p.length?s=p.length-1:s=c,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(p){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,p)}},{key:"audioTracks",get:function(){var p=this.audioTrackController;return p?p.audioTracks:[]}},{key:"audioTrack",get:function(){var p=this.audioTrackController;return p?p.audioTrack:-1},set:function(p){var c=this.audioTrackController;c&&(c.audioTrack=p)}},{key:"subtitleTracks",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTrack:-1},set:function(p){var c=this.subtitleTrackController;c&&(c.subtitleTrack=p)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var p=this.subtitleTrackController;return p?p.subtitleDisplay:!1},set:function(p){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=p)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(p){this.config.lowLatencyMode=p}},{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 o.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:T.hlsDefaultConfig},set:function(p){m.defaultConfig=p}}]),m}();g.defaultConfig=void 0},"./src/is-supported.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"isSupported",function(){return _}),R.d(Y,"changeTypeSupported",function(){return H});var Q=R("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var U=Object(Q.getMediaSource)();if(!U)return!1;var O=B(),M=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!M&&!!b}function H(){var U,O=B();return typeof(O==null||((U=O.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return D}),R.d(Y,"LoadError",function(){return E});var Q=R("./src/polyfills/number.ts"),B=R("./src/errors.ts");function _(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,b(h,o)}function H(h){var o=typeof Map=="function"?new Map:void 0;return H=function(d){if(d===null||!M(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(d))return o.get(d);o.set(d,A)}function A(){return U(d,arguments,w(this).constructor)}return A.prototype=Object.create(d.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),b(A,d)},H(h)}function U(h,o,u){return O()?U=Reflect.construct:U=function(A,g,m){var L=[null];L.push.apply(L,g);var x=Function.bind.apply(A,L),p=new x;return m&&b(p,m.prototype),p},U.apply(null,arguments)}function O(){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 M(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function b(h,o){return b=Object.setPrototypeOf||function(d,A){return d.__proto__=A,d},b(h,o)}function w(h){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},w(h)}var k=Math.pow(2,17),D=function(){function h(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var o=h.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(d,A){var g=this,m=d.url;if(!m)return Promise.reject(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var L=this.config,x=L.fLoader,p=L.loader;return new Promise(function(c,s){g.loader&&g.loader.destroy();var a=g.loader=d.loader=x?new x(L):new p(L),y=T(d),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};d.stats=a.stats,a.load(y,v,{onSuccess:function(P,G,V,$){g.resetLoader(d,a),c({frag:d,part:null,payload:P.data,networkDetails:$})},onError:function(P,G,V){g.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:P,networkDetails:V}))},onAbort:function(P,G,V){g.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:V}))},onTimeout:function(P,G,V){g.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:V}))},onProgress:function(P,G,V,$){A&&A({frag:d,part:null,payload:V,networkDetails:$})}})})},o.loadPart=function(d,A,g){var m=this;this.abort();var L=this.config,x=L.fLoader,p=L.loader;return new Promise(function(c,s){m.loader&&m.loader.destroy();var a=m.loader=d.loader=x?new x(L):new p(L),y=T(d,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:k};A.stats=a.stats,a.load(y,v,{onSuccess:function(P,G,V,$){m.resetLoader(d,a),m.updateStatsFromPart(d,A);var z={frag:d,part:A,payload:P.data,networkDetails:$};g(z),c(z)},onError:function(P,G,V){m.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:A,response:P,networkDetails:V}))},onAbort:function(P,G,V){d.stats.aborted=A.stats.aborted,m.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:A,networkDetails:V}))},onTimeout:function(P,G,V){m.resetLoader(d,a),s(new E({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:A,networkDetails:V}))}})})},o.updateStatsFromPart=function(d,A){var g=d.stats,m=A.stats,L=m.total;if(g.loaded+=m.loaded,L){var x=Math.round(d.duration/A.duration),p=Math.min(Math.round(g.loaded/L),x),c=x-p,s=c*Math.round(g.loaded/p);g.total=g.loaded+s}else g.total=Math.max(g.loaded,g.total);var a=g.loading,y=m.loading;a.start?a.first+=y.first-y.start:(a.start=y.start,a.first=y.first),a.end=y.end},o.resetLoader=function(d,A){d.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},h}();function T(h,o){o===void 0&&(o=null);var u=o||h,d={frag:h,part:o,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},A=u.byteRangeStartOffset,g=u.byteRangeEndOffset;return Object(Q.isFiniteNumber)(A)&&Object(Q.isFiniteNumber)(g)&&(d.rangeStart=A,d.rangeEnd=g),d}var E=function(h){_(o,h);function o(u){for(var d,A=arguments.length,g=new Array(A>1?A-1:0),m=1;m>8*(15-L)&255;return m},d.setDecryptDataFromLevelKey=function(g,m){var L=g;return(g==null?void 0:g.method)==="AES-128"&&g.uri&&!g.iv&&(L=U.LevelKey.fromURI(g.uri),L.method=g.method,L.iv=this.createInitializationVector(m),L.keyFormat="identity"),L},d.setElementaryStreamInfo=function(g,m,L,x,p,c){c===void 0&&(c=!1);var s=this.elementaryStreams,a=s[g];if(!a){s[g]={startPTS:m,endPTS:L,startDTS:x,endDTS:p,partial:c};return}a.startPTS=Math.min(a.startPTS,m),a.endPTS=Math.max(a.endPTS,L),a.startDTS=Math.min(a.startDTS,x),a.endDTS=Math.max(a.endDTS,p)},d.clearElementaryStreamInfo=function(){var g=this.elementaryStreams;g[D.AUDIO]=null,g[D.VIDEO]=null,g[D.AUDIOVIDEO]=null},k(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var g=this.sn;typeof g!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),g=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,g)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Q.isFiniteNumber)(this.programDateTime))return null;var g=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+g*1e3}},{key:"encrypted",get:function(){var g;return!!((g=this.decryptdata)!==null&&g!==void 0&&g.keyFormat&&this.decryptdata.uri)}}]),u}(T),h=function(o){M(u,o);function u(d,A,g,m,L){var x;x=o.call(this,g)||this,x.fragOffset=0,x.duration=0,x.gap=!1,x.independent=!1,x.relurl=void 0,x.fragment=void 0,x.index=void 0,x.stats=new O.LoadStats,x.duration=d.decimalFloatingPoint("DURATION"),x.gap=d.bool("GAP"),x.independent=d.bool("INDEPENDENT"),x.relurl=d.enumeratedString("URI"),x.fragment=A,x.index=m;var p=d.enumeratedString("BYTERANGE");return p&&x.setByteRange(p,L),L&&(x.fragOffset=L.fragOffset+L.duration),x}return k(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 A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),u}(T)},"./src/loader/key-loader.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return H});var Q=R("./src/events.ts"),B=R("./src/errors.ts"),_=R("./src/utils/logger.ts"),H=function(){function U(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var O=U.prototype;return O._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var w=this.loaders[b];w&&w.destroy()}this.loaders={}},O.onKeyLoading=function(b,w){var k=w.frag,D=k.type,T=this.loaders[D];if(!k.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var E=k.decryptdata.uri;if(E!==this.decrypturl||this.decryptkey===null){var h=this.hls.config;if(T&&(_.logger.warn("abort previous key loader for type:"+D),T.abort()),!E){_.logger.warn("key uri is falsy");return}var o=h.loader,u=k.loader=this.loaders[D]=new o(h);this.decrypturl=E,this.decryptkey=null;var d={url:E,frag:k,responseType:"arraybuffer"},A={timeout:h.fragLoadingTimeOut,maxRetry:0,retryDelay:h.fragLoadingRetryDelay,maxRetryDelay:h.fragLoadingMaxRetryTimeout,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(d,A,g)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:k}))},O.loadsuccess=function(b,w,k){var D=k.frag;if(!D.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=D.decryptdata.key=new Uint8Array(b.data),D.loader=null,delete this.loaders[D.type],this.hls.trigger(Q.Events.KEY_LOADED,{frag:D})},O.loaderror=function(b,w){var k=w.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:b})},O.loadtimeout=function(b,w){var k=w.frag,D=k.loader;D&&D.abort(),delete this.loaders[k.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},U}()},"./src/loader/level-details.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"LevelDetails",function(){return U});var Q=R("./src/polyfills/number.ts");function B(O,M){for(var b=0;bw.endSN||k>0||k===0&&D>0,this.updated||this.advanced?this.misses=Math.floor(w.misses*.6):this.misses=w.misses+1,this.availabilityDelay=w.availabilityDelay},_(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var w=this.driftEndTime-this.driftStartTime;if(w>0){var k=this.driftEnd-this.driftStart;return k*1e3/w}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var w;return(w=this.fragments)!==null&&w!==void 0&&w.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 w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"LevelKey",function(){return U});var Q=R("./node_modules/url-toolkit/src/url-toolkit.js"),B=R.n(Q);function _(O,M){for(var b=0;b2){var s=c.shift()+".";return s+=parseInt(c.shift()).toString(16),s+=("000"+parseInt(c.shift()).toString(16)).substr(-4),s}return p},L.resolve=function(p,c){return B.buildAbsoluteURL(c,p,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(p,c){var s=[],a={},y=!1;k.lastIndex=0;for(var v;(v=k.exec(p))!=null;)if(v[1]){var C=new M.AttrList(v[1]),P={attrs:C,bitrate:C.decimalInteger("AVERAGE-BANDWIDTH")||C.decimalInteger("BANDWIDTH"),name:C.NAME,url:L.resolve(v[2],c)},G=C.decimalResolution("RESOLUTION");G&&(P.width=G.width,P.height=G.height),d((C.CODECS||"").split(/[ ,]+/).filter(function($){return $}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=L.convertAVC1ToAVCOTI(P.videoCodec)),s.push(P)}else if(v[3]){var V=new M.AttrList(v[3]);V["DATA-ID"]&&(y=!0,a[V["DATA-ID"]]=V)}return{levels:s,sessionData:y?a:null}},L.parseMasterPlaylistMedia=function(p,c,s,a){a===void 0&&(a=[]);var y,v=[],C=0;for(D.lastIndex=0;(y=D.exec(p))!==null;){var P=new M.AttrList(y[1]);if(P.TYPE===s){var G={attrs:P,bitrate:0,id:C++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:s,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?L.resolve(P.URI,c):""};if(a.length){var V=L.findGroup(a,G.groupId)||a[0];A(G,V,"audioCodec"),A(G,V,"textCodec")}v.push(G)}}return v},L.parseLevelPlaylist=function(p,c,s,a,y){var v=new U.LevelDetails(c),C=v.fragments,P=null,G=0,V=0,$=0,z=0,j=null,ee=new H.Fragment(a,c),ne,ce,ve,Ie=-1,xe=!1;for(T.lastIndex=0,v.m3u8=p;(ne=T.exec(p))!==null;){xe&&(xe=!1,ee=new H.Fragment(a,c),ee.start=$,ee.sn=G,ee.cc=z,ee.level=s,P&&(ee.initSegment=P,ee.rawProgramDateTime=P.rawProgramDateTime));var Ee=ne[1];if(Ee){ee.duration=parseFloat(Ee);var Te=(" "+ne[2]).slice(1);ee.title=Te||null,ee.tagList.push(Te?["INF",Ee,Te]:["INF",Ee])}else if(ne[3])Object(Q.isFiniteNumber)(ee.duration)&&(ee.start=$,ve&&(ee.levelkey=ve),ee.sn=G,ee.level=s,ee.cc=z,ee.urlId=y,C.push(ee),ee.relurl=(" "+ne[3]).slice(1),m(ee,j),j=ee,$+=ee.duration,G++,V=0,xe=!0);else if(ne[4]){var Se=(" "+ne[4]).slice(1);j?ee.setByteRange(Se,j):ee.setByteRange(Se)}else if(ne[5])ee.rawProgramDateTime=(" "+ne[5]).slice(1),ee.tagList.push(["PROGRAM-DATE-TIME",ee.rawProgramDateTime]),Ie===-1&&(Ie=C.length);else{if(ne=ne[0].match(E),!ne){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce-1){b.logger.warn("Keyformat "+rt+" is not supported from the manifest");continue}else if(rt!=="identity")continue;Be&&(ve=O.LevelKey.fromURL(c,$e),$e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Be)>=0&&(ve.method=Be,ve.keyFormat=rt,He&&(ve.keyID=He),Me&&(ve.keyFormatVersions=Me),ve.iv=Qe));break}case"START":{var Xe=new M.AttrList(se),Ye=Xe.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(Ye)&&(v.startTimeOffset=Ye);break}case"MAP":{var ct=new M.AttrList(se);ee.relurl=ct.URI,ct.BYTERANGE&&ee.setByteRange(ct.BYTERANGE),ee.level=s,ee.sn="initSegment",ve&&(ee.levelkey=ve),ee.initSegment=null,P=ee,xe=!0;break}case"SERVER-CONTROL":{var nt=new M.AttrList(se);v.canBlockReload=nt.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=nt.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&nt.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=nt.optionalFloat("PART-HOLD-BACK",0),v.holdBack=nt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var it=new M.AttrList(se);v.partTarget=it.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ae=v.partList;Ae||(Ae=v.partList=[]);var dt=V>0?Ae[Ae.length-1]:void 0,at=V++,we=new H.Part(new M.AttrList(se),ee,c,at,dt);Ae.push(we),ee.duration+=we.duration;break}case"PRELOAD-HINT":{var Ne=new M.AttrList(se);v.preloadHint=Ne;break}case"RENDITION-REPORT":{var ge=new M.AttrList(se);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ge);break}default:b.logger.warn("line parsed but not handled: "+ne);break}}}j&&!j.relurl?(C.pop(),$-=j.duration,v.partList&&(v.fragmentHint=j)):v.partList&&(m(ee,j),ee.cc=z,v.fragmentHint=ee);var de=C.length,fe=C[0],te=C[de-1];if($+=v.skippedSegments*v.targetduration,$>0&&de&&te){v.averagetargetduration=$/de;var re=te.sn;v.endSN=re!=="initSegment"?re:0,fe&&(v.startCC=fe.cc,fe.initSegment||v.fragments.every(function(ae){return ae.relurl&&o(ae.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),ee=new H.Fragment(a,c),ee.relurl=te.relurl,ee.level=s,ee.sn="initSegment",fe.initSegment=ee,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&($+=v.fragmentHint.duration),v.totalduration=$,v.endCC=z,Ie>0&&g(C,Ie),v},L}();function d(L,x){["video","audio","text"].forEach(function(p){var c=L.filter(function(a){return Object(w.isCodecType)(a,p)});if(c.length){var s=c.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});x[p+"Codec"]=s.length>0?s[0]:c[0],L=L.filter(function(a){return c.indexOf(a)===-1})}}),x.unknownCodecs=L}function A(L,x,p){var c=x[p];c&&(L[p]=c)}function g(L,x){for(var p=L[x],c=x;c--;){var s=L[c];if(!s)return;s.programDateTime=p.programDateTime-s.duration*1e3,p=s}}function m(L,x){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):x!=null&&x.programDateTime&&(L.programDateTime=x.endProgramDateTime),Object(Q.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/polyfills/number.ts"),B=R("./src/events.ts"),_=R("./src/errors.ts"),H=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/m3u8-parser.ts"),M=R("./src/types/loader.ts"),b=R("./src/utils/attr-list.ts");function w(T){var E=T.type;switch(E){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function k(T,E){var h=T.url;return(h===void 0||h.indexOf("data:")===0)&&(h=E.url),h}var D=function(){function T(h){this.hls=void 0,this.loaders=Object.create(null),this.hls=h,this.registerListeners()}var E=T.prototype;return E.registerListeners=function(){var o=this.hls;o.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},E.unregisterListeners=function(){var o=this.hls;o.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},E.createInternalLoader=function(o){var u=this.hls.config,d=u.pLoader,A=u.loader,g=d||A,m=new g(u);return o.loader=m,this.loaders[o.type]=m,m},E.getInternalLoader=function(o){return this.loaders[o.type]},E.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},E.destroyInternalLoaders=function(){for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy(),this.resetInternalLoader(o)}},E.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},E.onManifestLoading=function(o,u){var d=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},E.onLevelLoading=function(o,u){var d=u.id,A=u.level,g=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:null,level:A,responseType:"text",type:M.PlaylistContextType.LEVEL,url:g,deliveryDirectives:m})},E.onAudioTrackLoading=function(o,u){var d=u.id,A=u.groupId,g=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:g,deliveryDirectives:m})},E.onSubtitleTrackLoading=function(o,u){var d=u.id,A=u.groupId,g=u.url,m=u.deliveryDirectives;this.load({id:d,groupId:A,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:g,deliveryDirectives:m})},E.load=function(o){var u,d=this.hls.config,A=this.getInternalLoader(o);if(A){var g=A.context;if(g&&g.url===o.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),A.abort()}var m,L,x,p;switch(o.type){case M.PlaylistContextType.MANIFEST:m=d.manifestLoadingMaxRetry,L=d.manifestLoadingTimeOut,x=d.manifestLoadingRetryDelay,p=d.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:m=0,L=d.levelLoadingTimeOut;break;default:m=d.levelLoadingMaxRetry,L=d.levelLoadingTimeOut,x=d.levelLoadingRetryDelay,p=d.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(o),(u=o.deliveryDirectives)!==null&&u!==void 0&&u.part){var c;if(o.type===M.PlaylistContextType.LEVEL&&o.level!==null?c=this.hls.levels[o.level].details:o.type===M.PlaylistContextType.AUDIO_TRACK&&o.id!==null?c=this.hls.audioTracks[o.id].details:o.type===M.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(c=this.hls.subtitleTracks[o.id].details),c){var s=c.partTarget,a=c.targetduration;s&&a&&(L=Math.min(Math.max(s*3,a*.8)*1e3,L))}}var y={timeout:L,maxRetry:m,retryDelay:x,maxRetryDelay:p,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(o,y,v)},E.loadsuccess=function(o,u,d,A){if(A===void 0&&(A=null),d.isSidxRequest){this.handleSidxRequest(o,d),this.handlePlaylistLoaded(o,u,d,A);return}this.resetInternalLoader(d.type);var g=o.data;if(g.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,d,"no EXTM3U delimiter",A);return}u.parsing.start=performance.now(),g.indexOf("#EXTINF:")>0||g.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,u,d,A):this.handleMasterPlaylist(o,u,d,A)},E.loaderror=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!1,o)},E.loadtimeout=function(o,u,d){d===void 0&&(d=null),this.handleNetworkError(u,d,!0)},E.handleMasterPlaylist=function(o,u,d,A){var g=this.hls,m=o.data,L=k(o,d),x=O.default.parseMasterPlaylist(m,L),p=x.levels,c=x.sessionData;if(!p.length){this.handleManifestParsingError(o,d,"no level found in manifest",A);return}var s=p.map(function(G){return{id:G.attrs.AUDIO,audioCodec:G.audioCodec}}),a=p.map(function(G){return{id:G.attrs.SUBTITLES,textCodec:G.textCodec}}),y=O.default.parseMasterPlaylistMedia(m,L,"AUDIO",s),v=O.default.parseMasterPlaylistMedia(m,L,"SUBTITLES",a),C=O.default.parseMasterPlaylistMedia(m,L,"CLOSED-CAPTIONS");if(y.length){var P=y.some(function(G){return!G.url});!P&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}g.trigger(B.Events.MANIFEST_LOADED,{levels:p,audioTracks:y,subtitles:v,captions:C,url:L,stats:u,networkDetails:A,sessionData:c})},E.handleTrackOrLevelPlaylist=function(o,u,d,A){var g=this.hls,m=d.id,L=d.level,x=d.type,p=k(o,d),c=Object(Q.isFiniteNumber)(m)?m:0,s=Object(Q.isFiniteNumber)(L)?L:c,a=w(d),y=O.default.parseLevelPlaylist(o.data,p,s,a,c);if(!y.fragments.length){g.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:p,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(x===M.PlaylistContextType.MANIFEST){var v={attrs:new b.AttrList({}),bitrate:0,details:y,name:"",url:p};g.trigger(B.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:p,stats:u,networkDetails:A,sessionData:null})}if(u.parsing.end=performance.now(),y.needSidxRanges){var C,P=(C=y.fragments[0].initSegment)===null||C===void 0?void 0:C.url;this.load({url:P,isSidxRequest:!0,type:x,level:L,levelDetails:y,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=y,this.handlePlaylistLoaded(o,u,d,A)},E.handleSidxRequest=function(o,u){var d=Object(U.parseSegmentIndex)(new Uint8Array(o.data));if(!d)return;var A=d.references,g=u.levelDetails;A.forEach(function(m,L){var x=m.info,p=g.fragments[L];p.byteRange.length===0&&p.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),p.initSegment&&p.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},E.handleManifestParsingError=function(o,u,d,A){this.hls.trigger(B.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===M.PlaylistContextType.MANIFEST,url:o.url,reason:d,response:o,context:u,networkDetails:A})},E.handleNetworkError=function(o,u,d,A){d===void 0&&(d=!1),H.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var g=_.ErrorDetails.UNKNOWN,m=!1,L=this.getInternalLoader(o);switch(o.type){case M.PlaylistContextType.MANIFEST:g=d?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case M.PlaylistContextType.LEVEL:g=d?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case M.PlaylistContextType.AUDIO_TRACK:g=d?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:g=d?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}L&&this.resetInternalLoader(o.type);var x={type:_.ErrorTypes.NETWORK_ERROR,details:g,fatal:m,url:o.url,loader:L,context:o,networkDetails:u};A&&(x.response=A),this.hls.trigger(B.Events.ERROR,x)},E.handlePlaylistLoaded=function(o,u,d,A){var g=d.type,m=d.level,L=d.id,x=d.groupId,p=d.loader,c=d.levelDetails,s=d.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(o,d,"invalid target duration",A);return}if(!p)return;c.live&&(p.getCacheAge&&(c.ageHeader=p.getCacheAge()||0),(!p.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(g){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:c,level:m||0,id:L||0,stats:u,networkDetails:A,deliveryDirectives:s});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:c,id:L||0,groupId:x||"",stats:u,networkDetails:A,deliveryDirectives:s});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:c,id:L||0,groupId:x||"",stats:u,networkDetails:A,deliveryDirectives:s});break}},T}();Y.default=D},"./src/polyfills/number.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"isFiniteNumber",function(){return Q}),R.d(Y,"MAX_SAFE_INTEGER",function(){return B});var Q=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=function(){function B(){}return B.getSilentFrame=function(H,U){switch(H){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===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}();Y.default=Q},"./src/remux/mp4-generator.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=Math.pow(2,32)-1,B=function(){function _(){}return _.init=function(){_.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 U;for(U in _.types)_.types.hasOwnProperty(U)&&(_.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var O=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]),M=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]);_.HDLR_TYPES={video:O,audio:M};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=w,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),D=new Uint8Array([97,118,99,49]),T=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,k,T,k,D),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,b))},_.box=function(U){for(var O=8,M=arguments.length,b=new Array(M>1?M-1:0),w=1;w>24&255,T[1]=O>>16&255,T[2]=O>>8&255,T[3]=O&255,T.set(U,4),k=0,O=8;k>24&255,U>>16&255,U>>8&255,U&255,M>>24,M>>16&255,M>>8&255,M&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},_.mdia=function(U){return _.box(_.types.mdia,_.mdhd(U.timescale,U.duration),_.hdlr(U.type),_.minf(U))},_.mfhd=function(U){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},_.minf=function(U){return U.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(U)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(U))},_.moof=function(U,O,M){return _.box(_.types.moof,_.mfhd(U),_.traf(M,O))},_.moov=function(U){for(var O=U.length,M=[];O--;)M[O]=_.trak(U[O]);return _.box.apply(null,[_.types.moov,_.mvhd(U[0].timescale,U[0].duration)].concat(M).concat(_.mvex(U)))},_.mvex=function(U){for(var O=U.length,M=[];O--;)M[O]=_.trex(U[O]);return _.box.apply(null,[_.types.mvex].concat(M))},_.mvhd=function(U,O){O*=U;var M=Math.floor(O/(Q+1)),b=Math.floor(O%(Q+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,M>>24,M>>16&255,M>>8&255,M&255,b>>24,b>>16&255,b>>8&255,b&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 _.box(_.types.mvhd,w)},_.sdtp=function(U){var O=U.samples||[],M=new Uint8Array(4+O.length),b,w;for(b=0;b>>8&255),O.push(k&255),O=O.concat(Array.prototype.slice.call(w));for(b=0;b>>8&255),M.push(k&255),M=M.concat(Array.prototype.slice.call(w));var D=_.box(_.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|U.sps.length].concat(O).concat([U.pps.length]).concat(M))),T=U.width,E=U.height,h=U.pixelRatio[0],o=U.pixelRatio[1];return _.box(_.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,T>>8&255,T&255,E>>8&255,E&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]),D,_.box(_.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),_.box(_.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,o>>24,o>>16&255,o>>8&255,o&255])))},_.esds=function(U){var O=U.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(U.config).concat([6,1,2]))},_.mp4a=function(U){var O=U.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),_.box(_.types.esds,_.esds(U)))},_.mp3=function(U){var O=U.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},_.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(U)):_.box(_.types.stsd,_.STSD,_.mp4a(U)):_.box(_.types.stsd,_.STSD,_.avc1(U))},_.tkhd=function(U){var O=U.id,M=U.duration*U.timescale,b=U.width,w=U.height,k=Math.floor(M/(Q+1)),D=Math.floor(M%(Q+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,D>>24,D>>16&255,D>>8&255,D&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,b>>8&255,b&255,0,0,w>>8&255,w&255,0,0]))},_.traf=function(U,O){var M=_.sdtp(U),b=U.id,w=Math.floor(O/(Q+1)),k=Math.floor(O%(Q+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,k>>24,k>>16&255,k>>8&255,k&255])),_.trun(U,M.length+16+20+8+16+8+8),M)},_.trak=function(U){return U.duration=U.duration||4294967295,_.box(_.types.trak,_.tkhd(U),_.mdia(U))},_.trex=function(U){var O=U.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(U,O){var M=U.samples||[],b=M.length,w=12+16*b,k=new Uint8Array(w),D,T,E,h,o,u;for(O+=8+w,k.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),D=0;D>>24&255,E>>>16&255,E>>>8&255,E&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*D);return _.box(_.types.trun,k)},_.initSegment=function(U){_.types||_.init();var O=_.moov(U),M=new Uint8Array(_.FTYP.byteLength+O.byteLength);return M.set(_.FTYP),M.set(O,_.FTYP.byteLength),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,Y.default=B},"./src/remux/mp4-remuxer.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return u}),R.d(Y,"normalizePts",function(){return d});var Q=R("./src/polyfills/number.ts"),B=R("./src/remux/aac-helper.ts"),_=R("./src/remux/mp4-generator.ts"),H=R("./src/events.ts"),U=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),M=R("./src/types/loader.ts"),b=R("./src/utils/timescale-conversion.ts");function w(){return w=Object.assign||function(L){for(var x=1;x0?y:v.pts},c[0].pts);return s&&O.logger.debug("PTS rollover detected"),a},x.remux=function(c,s,a,y,v,C,P,G){var V,$,z,j,ee,ne,ce=v,ve=v,Ie=c.pid>-1,xe=s.pid>-1,Ee=s.samples.length,Te=c.samples.length>0,Se=Ee>1,me=(!Ie||Te)&&(!xe||Se)||this.ISGenerated||P;if(me){this.ISGenerated||(z=this.generateIS(c,s,v));var se=this.isVideoContiguous,ke=-1;if(Se&&(ke=A(s.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,ke>0){O.logger.warn("[mp4-remuxer]: Dropped "+ke+" out of "+Ee+" video samples due to a missing keyframe");var Ve=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(ke),s.dropped+=ke,ve+=(s.samples[0].pts-Ve)/(s.timescale||9e4)}else ke===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ee+" video samples"),ne=!1);if(this.ISGenerated){if(Te&&Se){var We=this.getVideoStartPts(s.samples),Je=d(c.samples[0].pts,We)-We,qe=Je/s.inputTimeScale;ce+=Math.max(0,qe),ve+=Math.max(0,-qe)}if(Te){if(c.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(c,s,v)),$=this.remuxAudio(c,ce,this.isAudioContiguous,C,xe||Se||G===M.PlaylistLevelType.AUDIO?ve:void 0),Se){var De=$?$.endPTS-$.startPTS:0;s.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(c,s,v)),V=this.remuxVideo(s,ve,se,De)}}else Se&&(V=this.remuxVideo(s,ve,se,0));V&&(V.firstKeyFrame=ke,V.independent=ke!==-1)}}return this.ISGenerated&&(a.samples.length&&(ee=this.remuxID3(a,v)),y.samples.length&&(j=this.remuxText(y,v))),{audio:$,video:V,initSegment:z,independent:ne,text:j,id3:ee}},x.generateIS=function(c,s,a){var y=c.samples,v=s.samples,C=this.typeSupported,P={},G=!Object(Q.isFiniteNumber)(this._initPTS),V="audio/mp4",$,z,j;if(G&&($=z=Infinity),c.config&&y.length&&(c.timescale=c.samplerate,c.isAAC||(C.mpeg?(V="audio/mpeg",c.codec=""):C.mp3&&(c.codec="mp3")),P.audio={id:"audio",container:V,codec:c.codec,initSegment:!c.isAAC&&C.mpeg?new Uint8Array(0):_.default.initSegment([c]),metadata:{channelCount:c.channelCount}},G&&(j=c.inputTimeScale,$=z=y[0].pts-Math.round(j*a))),s.sps&&s.pps&&v.length&&(s.timescale=s.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:_.default.initSegment([s]),metadata:{width:s.width,height:s.height}},G)){j=s.inputTimeScale;var ee=this.getVideoStartPts(v),ne=Math.round(j*a);z=Math.min(z,d(v[0].dts,ee)-ne),$=Math.min($,ee-ne)}if(Object.keys(P).length)return this.ISGenerated=!0,G&&(this._initPTS=$,this._initDTS=z),{tracks:P,initPTS:$,timescale:j}},x.remuxVideo=function(c,s,a,y){var v=c.inputTimeScale,C=c.samples,P=[],G=C.length,V=this._initPTS,$=this.nextAvcDts,z=8,j,ee,ne,ce=Number.POSITIVE_INFINITY,ve=Number.NEGATIVE_INFINITY,Ie=0,xe=!1;if(!a||$===null){var Ee=s*v,Te=C[0].pts-d(C[0].dts,C[0].pts);$=Ee-Te}for(var Se=0;Seme.pts){var se=9e4*.2;Ie=Math.max(Math.min(Ie,me.pts-me.dts),-1*se)}me.dts0?Se-1:Se].dts&&(xe=!0)}xe&&C.sort(function(Lt,At){var ft=Lt.dts-At.dts,Ft=Lt.pts-At.pts;return ft||Ft}),ee=C[0].dts,ne=C[C.length-1].dts;var ke=Math.round((ne-ee)/(G-1));if(Ie<0){if(Ieke,Fe=qe<-1;if(De||Fe){De?O.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(qe,!0)+" ms ("+qe+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-qe,!0)+" ms ("+qe+"dts) overlapping between fragments detected"),ee=$;var Be=C[0].pts-qe;C[0].dts=ee,C[0].pts=Be,O.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Be,!0)+"/"+Object(b.toMsFromMpegTsClock)(ee,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(qe,!0)+" ms")}}o&&(ee=Math.max(0,ee));for(var $e=0,Qe=0,Me=0;Me0?Ae-1:Ae].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(re.maxBufferHole*v),pe=(y?ce+y*v:this.nextAudioPts)-dt.pts;pe>le?(j=pe-ae,j<0&&(j=ae),O.logger.log("[mp4-remuxer]: It is approximately "+pe/90+" ms to the next segment; using duration "+j/90+" ms for the last video frame.")):j=ae}else j=ae}var Ce=Math.round(dt.pts-dt.dts);P.push(new g(dt.key,j,we,Ce))}if(P.length&&E&&E<70){var Oe=P[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(j!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=$=ne+j,this.isVideoContiguous=!0;var ot=_.default.moof(c.sequenceNumber++,ee,w({},c,{samples:P})),mt="video",ht={data1:ot,data2:nt,startPTS:ce/v,endPTS:(ve+j)/v,startDTS:ee/v,endDTS:$/v,type:mt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(nt.length,"MDAT length must not be zero"),ht},x.remuxAudio=function(c,s,a,y,v){var C=c.inputTimeScale,P=c.samplerate?c.samplerate:C,G=C/P,V=c.isAAC?D:T,$=V*G,z=this._initPTS,j=!c.isAAC&&this.typeSupported.mpeg,ee=[],ne=c.samples,ce=j?0:8,ve=this.nextAudioPts||-1,Ie=s*C;if(this.isAudioContiguous=a=a||ne.length&&ve>0&&(y&&Math.abs(Ie-ve)<9e3||Math.abs(d(ne[0].pts-z,Ie)-ve)<20*$),ne.forEach(function(fe){fe.pts=d(fe.pts-z,Ie)}),!a||ve<0){if(ne=ne.filter(function(fe){return fe.pts>=0}),!ne.length)return;v===0?ve=0:y?ve=Math.max(0,Ie):ve=ne[0].pts}if(c.isAAC)for(var xe=v!==void 0,Ee=this.config.maxAudioFramesDrift,Te=0,Se=ve;Te=Ee*$&&Ve0){Qe+=ce;try{$e=new Uint8Array(Qe)}catch(fe){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating audio mdat "+Qe});return}if(!j){var nt=new DataView($e.buffer);nt.setUint32(0,Qe),$e.set(_.default.types.mdat,4)}}else return;$e.set(Xe,ce);var it=Xe.byteLength;ce+=it,ee.push(new g(!0,V,it,0)),Be=Ye}var Ae=ee.length;if(!Ae)return;var dt=ee[ee.length-1];this.nextAudioPts=ve=Be+G*dt.duration;var at=j?new Uint8Array(0):_.default.moof(c.sequenceNumber++,Fe/G,w({},c,{samples:ee}));c.samples=[];var we=Fe/C,Ne=ve/C,ge="audio",de={data1:at,data2:$e,startPTS:we,endPTS:Ne,startDTS:we,endDTS:Ne,type:ge,hasAudio:!0,hasVideo:!1,nb:Ae};return this.isAudioContiguous=!0,console.assert($e.length,"MDAT length must not be zero"),de},x.remuxEmptyAudio=function(c,s,a,y){var v=c.inputTimeScale,C=c.samplerate?c.samplerate:v,P=v/C,G=this.nextAudioPts,V=(G!==null?G:y.startDTS*v)+this._initDTS,$=y.endDTS*v+this._initDTS,z=P*D,j=Math.ceil(($-V)/z),ee=B.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!ee){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],ce=0;ce4294967296;)L+=p;return L}function A(L){for(var x=0;x0?this.lastEndDTS=c:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!L.audio,a=!!L.video,y="";s&&(y+="audio"),a&&(y+="video");var v={data1:g,startPTS:p,startDTS:p,endPTS:c,endDTS:c,type:y,hasAudio:s,hasVideo:a,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=h,A.id3=E,A.initSegment=m,A},b}(),O=function(w,k,D){return Object(B.getStartDTS)(w,k)-D};function M(b,w){var k=b==null?void 0:b.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||w===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=U},"./src/task-loop.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"default",function(){return Q});var Q=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=B.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},B}()},"./src/types/cmcd.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"CMCDVersion",function(){return Q}),R.d(Y,"CMCDObjectType",function(){return B}),R.d(Y,"CMCDStreamingFormat",function(){return _}),R.d(Y,"CMCDStreamType",function(){return H});var Q=1,B;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(B||(B={}));var _;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(_||(_={}));var H;(function(U){U.VOD="v",U.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"HlsSkip",function(){return _}),R.d(Y,"getSkipValue",function(){return H}),R.d(Y,"HlsUrlParameters",function(){return U}),R.d(Y,"Level",function(){return O});function Q(M,b){for(var w=0;wNumber.MAX_SAFE_INTEGER?Infinity:b},U.hexadecimalInteger=function(M){if(this[M]){var b=(this[M]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var w=new Uint8Array(b.length/2),k=0;kNumber.MAX_SAFE_INTEGER?Infinity:b},U.decimalFloatingPoint=function(M){return parseFloat(this[M])},U.optionalFloat=function(M,b){var w=this[M];return w?parseFloat(w):b},U.enumeratedString=function(M){return this[M]},U.bool=function(M){return this[M]==="YES"},U.decimalResolution=function(M){var b=Q.exec(this[M]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},H.parseAttrList=function(M){var b,w={},k='"';for(B.lastIndex=0;(b=B.exec(M))!==null;){var D=b[2];D.indexOf(k)===0&&D.lastIndexOf(k)===D.length-1&&(D=D.slice(1,-1)),w[b[1]]=D}return w},H}()},"./src/utils/binary-search.ts":function(ie,Y,R){"use strict";R.r(Y);var Q={search:function(_,H){for(var U=0,O=_.length-1,M=null,b=null;U<=O;){M=(U+O)/2|0,b=_[M];var w=H(b);if(w>0)U=M+1;else if(w<0)O=M-1;else return b}return null}};Y.default=Q},"./src/utils/buffer-helper.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"BufferHelper",function(){return _});var Q=R("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function H(){}return H.isBuffered=function(O,M){try{if(O){for(var b=H.getBuffered(O),w=0;w=b.start(w)&&M<=b.end(w))return!0}}catch(k){}return!1},H.bufferInfo=function(O,M,b){try{if(O){var w=H.getBuffered(O),k=[],D;for(D=0;DT&&(w[D-1].end=O[k].end):w.push(O[k])}else w.push(O[k])}else w=O;for(var E=0,h,o=M,u=M,d=0;d=A&&M=a&&Q.logger.log(this.time+" ["+a+"] "+y)},p}(),E=function(c){for(var s=[],a=0;aU&&(this.logger.log(D.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},c.moveCursor=function(a){var y=this.pos+a;if(a>1)for(var v=this.pos+1;v=144&&this.backSpace();var y=_(a);if(this.pos>=U){this.logger.log(D.ERROR,"Cannot insert "+a.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(a){var y;for(y=a;y0&&(a?v="["+y.join(" | ")+"]":v=y.join(` `)),v},c.getTextAndFormat=function(){return this.rows},p}(),A=function(){function p(s,a,y){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=s,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new d(y),this.nonDisplayedMemory=new d(y),this.lastOutputScreen=new d(y),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var c=p.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(a){this.outputFilter=a},c.setPAC=function(a){this.writeScreen.setPAC(a)},c.setBkgData=function(a){this.writeScreen.setBkgData(a)},c.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(D.INFO,"MODE="+a),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=a},c.insertChars=function(a){for(var y=0;y=46,y.italics)y.foreground="white";else{var v=Math.floor(a/2)-16,C=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=C[v]}this.logger.log(D.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},c.outputDataUpdate=function(a){a===void 0&&(a=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},p}(),g=function(){function p(s,a,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new T;this.channels=[null,new A(s,a,v),new A(s+1,y,v)],this.cmdHistory=x(),this.logger=v}var c=p.prototype;return c.getHandler=function(a){return this.channels[a].getHandler()},c.setHandler=function(a,y){this.channels[a].setHandler(y)},c.addData=function(a,y){var v,C,P,G=!1;this.logger.time=a;for(var V=0;V ("+E([C,P])+")"),v=this.parseCmd(C,P),v||(v=this.parseMidrow(C,P)),v||(v=this.parsePAC(C,P)),v||(v=this.parseBackgroundAttributes(C,P)),!v&&(G=this.parseChars(C,P),G)){var $=this.currentChannel;if($&&$>0){var z=this.channels[$];z.insertChars(G)}else this.logger.log(D.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!G&&this.logger.log(D.WARNING,"Couldn't parse cleaned data "+E([C,P])+" orig: "+E([y[V],y[V+1]]))}},c.parseCmd=function(a,y){var v=this.cmdHistory,C=(a===20||a===28||a===21||a===29)&&y>=32&&y<=47,P=(a===23||a===31)&&y>=33&&y<=35;if(!(C||P))return!1;if(L(a,y,v))return m(null,null,v),this.logger.log(D.DEBUG,"Repeated command ("+E([a,y])+") is dropped"),!0;var G=a===20||a===21||a===23?1:2,V=this.channels[G];return a===20||a===21||a===28||a===29?y===32?V.ccRCL():y===33?V.ccBS():y===34?V.ccAOF():y===35?V.ccAON():y===36?V.ccDER():y===37?V.ccRU(2):y===38?V.ccRU(3):y===39?V.ccRU(4):y===40?V.ccFON():y===41?V.ccRDC():y===42?V.ccTR():y===43?V.ccRTD():y===44?V.ccEDM():y===45?V.ccCR():y===46?V.ccENM():y===47&&V.ccEOC():V.ccTO(y-32),m(a,y,v),this.currentChannel=G,!0},c.parseMidrow=function(a,y){var v=0;if((a===17||a===25)&&y>=32&&y<=47){if(a===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(D.ERROR,"Mismatch channel in midrow parsing"),!1;var C=this.channels[v];return C?(C.ccMIDROW(y),this.logger.log(D.DEBUG,"MIDROW ("+E([a,y])+")"),!0):!1}return!1},c.parsePAC=function(a,y){var v,C=this.cmdHistory,P=(a>=17&&a<=23||a>=25&&a<=31)&&y>=64&&y<=127,G=(a===16||a===24)&&y>=64&&y<=95;if(!(P||G))return!1;if(L(a,y,C))return m(null,null,C),!0;var V=a<=23?1:2;y>=64&&y<=95?v=V===1?O[a]:b[a]:v=V===1?M[a]:w[a];var $=this.channels[V];return $?($.setPAC(this.interpretPAC(v,y)),m(a,y,C),this.currentChannel=V,!0):!1},c.interpretPAC=function(a,y){var v,C={color:null,italics:!1,indent:null,underline:!1,row:a};return y>95?v=y-96:v=y-64,C.underline=(v&1)===1,v<=13?C.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(C.italics=!0,C.color="white"):C.indent=Math.floor((v-16)/2)*4,C},c.parseChars=function(a,y){var v,C=null,P=null;if(a>=25?(v=2,P=a-8):(v=1,P=a),P>=17&&P<=19){var G;P===17?G=y+80:P===18?G=y+112:G=y+144,this.logger.log(D.INFO,"Special char '"+_(G)+"' in channel "+v),C=[G]}else a>=32&&a<=127&&(C=y===0?[a]:[a,y]);if(C){var V=E(C);this.logger.log(D.DEBUG,"Char codes = "+V.join(",")),m(a,y,this.cmdHistory)}return C},c.parseBackgroundAttributes=function(a,y){var v=(a===16||a===24)&&y>=32&&y<=47,C=(a===23||a===31)&&y>=45&&y<=47;if(!(v||C))return!1;var P,G={};a===16||a===24?(P=Math.floor((y-32)/2),G.background=k[P],y%2===1&&(G.background=G.background+"_semi")):y===45?G.background="transparent":(G.foreground="black",y===47&&(G.underline=!0));var V=a<=23?1:2,$=this.channels[V];return $.setBkgData(G),m(a,y,this.cmdHistory),!0},c.reset=function(){for(var a=0;a=16?o--:o++;var m=Object(Q.fixLineBreaks)(u.trim()),L=Object(B.generateCueId)(b,w,m);(!M||!M.cues||!M.cues.getCueById(L))&&(E=new d(b,w,m),E.id=L,E.line=A+1,E.align="left",E.position=10+Math.min(80,Math.floor(o*8/32)*10),D.push(E))}return M&&D.length&&(D.sort(function(x,p){return x.line==="auto"||p.line==="auto"?0:x.line>8&&p.line>8?p.line-x.line:x.line-p.line}),D.forEach(function(x){return Object(_.addCueToTrack)(M,x)})),D}};Y.default=U},"./src/utils/discontinuities.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"findFirstFragWithCC",function(){return H}),R.d(Y,"shouldAlignOnDiscontinuities",function(){return U}),R.d(Y,"findDiscontinuousReferenceFrag",function(){return O}),R.d(Y,"adjustSlidingStart",function(){return b}),R.d(Y,"alignStream",function(){return w}),R.d(Y,"alignPDT",function(){return D}),R.d(Y,"alignFragmentByPDTDelta",function(){return T}),R.d(Y,"alignMediaPlaylistByPDT",function(){return E});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/logger.ts"),_=R("./src/controller/level-helper.ts");function H(h,o){for(var u=null,d=0,A=h.length;du.startCC||h&&h.cc=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},_}();Y.default=B},"./src/utils/ewma.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=function(){function B(H,U,O){U===void 0&&(U=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=U,this.totalWeight_=O}var _=B.prototype;return _.sample=function(U,O){var M=Math.pow(this.alpha_,U);this.estimate_=O*(1-M)+M*this.estimate_,this.totalWeight_+=U},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},B}();Y.default=Q},"./src/utils/fetch-loader.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"fetchSupported",function(){return T});var Q=R("./src/polyfills/number.ts"),B=R("./src/loader/load-stats.ts"),_=R("./src/demux/chunk-cache.ts");function H(d,A){d.prototype=Object.create(A.prototype),d.prototype.constructor=d,w(d,A)}function U(d){var A=typeof Map=="function"?new Map:void 0;return U=function(m){if(m===null||!b(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(m))return A.get(m);A.set(m,L)}function L(){return O(m,arguments,k(this).constructor)}return L.prototype=Object.create(m.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),w(L,m)},U(d)}function O(d,A,g){return M()?O=Reflect.construct:O=function(L,x,p){var c=[null];c.push.apply(c,x);var s=Function.bind.apply(L,c),a=new s;return p&&w(a,p.prototype),a},O.apply(null,arguments)}function M(){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(d){return!1}}function b(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function w(d,A){return w=Object.setPrototypeOf||function(m,L){return m.__proto__=L,m},w(d,A)}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(g){return g.__proto__||Object.getPrototypeOf(g)},k(d)}function D(){return D=Object.assign||function(d){for(var A=1;A=p&&c(L,x,s.flush(),m)):c(L,x,P,m),v()}).catch(function(){return Promise.reject()})};return y()},d}();function h(d,A){var g={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(D({},d.headers))};return d.rangeEnd&&g.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),g}function o(d,A){return new self.Request(d.url,A)}var u=function(d){H(A,d);function A(g,m,L){var x;return x=d.call(this,g)||this,x.code=void 0,x.details=void 0,x.code=m,x.details=L,x}return A}(U(Error));Y.default=E},"./src/utils/imsc1-ttml-parser.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"IMSC1_CODEC",function(){return b}),R.d(Y,"parseIMSC1",function(){return T});var Q=R("./src/utils/mp4-tools.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/utils/vttcue.ts"),H=R("./src/demux/id3.ts"),U=R("./src/utils/timescale-conversion.ts"),O=R("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(p){for(var c=1;c"):Q}function U(b){for(var w=arguments.length,k=new Array(w>1?w-1:0),D=1;D>24,A[g+1]=m>>16&255,A[g+2]=m>>8&255,A[g+3]=m&255}function w(A,g){var m=[];if(!g.length)return m;var L,x,p;"data"in A?(L=A.data,x=A.start,p=A.end):(L=A,x=0,p=L.byteLength);for(var c=x;c1?c+s:p;if(a===g[0])if(g.length===1)m.push({data:L,start:c+8,end:y});else{var v=w({data:L,start:c+8,end:y},g.slice(1));v.length&&H.apply(m,v)}c=y}return m}function k(A){var g=w(A,["moov"]),m=g[0],L=m?m.end:null,x=w(A,["sidx"]);if(!x||!x[0])return null;var p=[],c=x[0],s=c.data[0],a=s===0?8:16,y=M(c,a);a+=4;var v=0,C=0;s===0?a+=8:a+=16,a+=2;var P=c.end+C,G=O(c,a);a+=2;for(var V=0;V>>31;if(ee===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=M(c,$);$+=4,p.push({referenceSize:j,subsegmentDuration:ne,info:{duration:ne/y,start:P,end:P+j-1}}),P+=j,$+=4,a=$}return{earliestPresentationTime:v,timescale:y,version:s,referencesCount:G,references:p,moovEndOffset:L}}function D(A){for(var g=[],m=w(A,["moov","trak"]),L=0;LU)&&(this.startTime=U),this.endTime=O,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"sendAddTrackEvent",function(){return B}),R.d(Y,"addCueToTrack",function(){return _}),R.d(Y,"clearCurrentCues",function(){return H}),R.d(Y,"removeCuesInRange",function(){return U}),R.d(Y,"getCuesInRange",function(){return M});var Q=R("./src/utils/logger.ts");function B(b,w){var k;try{k=new Event("addtrack")}catch(D){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=b,w.dispatchEvent(k)}function _(b,w){var k=b.mode;if(k==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(w.id))try{if(b.addCue(w),!b.cues.getCueById(w.id))throw new Error("addCue is failed for: "+w)}catch(T){Q.logger.debug("[texttrack-utils]: "+T);var D=new self.TextTrackCue(w.startTime,w.endTime,w.text);D.id=w.id,b.addCue(D)}k==="disabled"&&(b.mode=k)}function H(b){var w=b.mode;if(w==="disabled"&&(b.mode="hidden"),b.cues)for(var k=b.cues.length;k--;)b.removeCue(b.cues[k]);w==="disabled"&&(b.mode=w)}function U(b,w,k){var D=b.mode;if(D==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var T=M(b.cues,w,k),E=0;Eb[k].endTime)return-1;for(var D=0,T=k;D<=T;){var E=Math.floor((T+D)/2);if(wb[E].startTime&&D-1)for(var E=T,h=b.length;E=w&&o.endTime<=k)D.push(o);else if(o.startTime>k)return D}return D}},"./src/utils/time-ranges.ts":function(ie,Y,R){"use strict";R.r(Y);var Q={toString:function(_){for(var H="",U=_.length,O=0;O1?w-1:0),D=1;D100)throw new Error("Position must be between 0 and 100.");p=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"positionAlign",O({},T,{get:function(){return c},set:function(v){var C=U(v);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");c=C,this.hasBeenReset=!0}})),Object.defineProperty(D,"size",O({},T,{get:function(){return s},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");s=v,this.hasBeenReset=!0}})),Object.defineProperty(D,"align",O({},T,{get:function(){return a},set:function(v){var C=U(v);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");a=C,this.hasBeenReset=!0}})),D.displayState=void 0}return M.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"parseTimeStamp",function(){return _}),R.d(Y,"fixLineBreaks",function(){return w}),R.d(Y,"VTTParser",function(){return k});var Q=R("./src/utils/vttcue.ts"),B=function(){function D(){}var T=D.prototype;return T.decode=function(h,o){if(!h)return"";if(typeof h!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(h))},D}();function _(D){function T(h,o,u,d){return(h|0)*3600+(o|0)*60+(u|0)+parseFloat(d||0)}var E=D.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return E?parseFloat(E[2])>59?T(E[2],E[3],0,E[4]):T(E[1],E[2],E[3],E[4]):null}var H=function(){function D(){this.values=Object.create(null)}var T=D.prototype;return T.set=function(h,o){!this.get(h)&&o!==""&&(this.values[h]=o)},T.get=function(h,o,u){return u?this.has(h)?this.values[h]:o[u]:this.has(h)?this.values[h]:o},T.has=function(h){return h in this.values},T.alt=function(h,o,u){for(var d=0;d=0&&u<=100)return this.set(h,u),!0}return!1},D}();function U(D,T,E,h){var o=h?D.split(h):[D];for(var u in o){if(typeof o[u]!="string")continue;var d=o[u].split(E);if(d.length!==2)continue;var A=d[0],g=d[1];T(A,g)}}var O=new Q.default(0,0,""),M=O.align==="middle"?"middle":"center";function b(D,T,E){var h=D;function o(){var A=_(D);if(A===null)throw new Error("Malformed timestamp: "+h);return D=D.replace(/^[^\sa-zA-Z-]+/,""),A}function u(A,g){var m=new H;U(A,function(p,c){var s;switch(p){case"region":for(var a=E.length-1;a>=0;a--)if(E[a].id===c){m.set(p,E[a].region);break}break;case"vertical":m.alt(p,c,["rl","lr"]);break;case"line":s=c.split(","),m.integer(p,s[0]),m.percent(p,s[0])&&m.set("snapToLines",!1),m.alt(p,s[0],["auto"]),s.length===2&&m.alt("lineAlign",s[1],["start",M,"end"]);break;case"position":s=c.split(","),m.percent(p,s[0]),s.length===2&&m.alt("positionAlign",s[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":m.percent(p,c);break;case"align":m.alt(p,c,["start",M,"end","left","right"]);break}},/:/,/\s/),g.region=m.get("region",null),g.vertical=m.get("vertical","");var L=m.get("line","auto");L==="auto"&&O.line===-1&&(L=-1),g.line=L,g.lineAlign=m.get("lineAlign","start"),g.snapToLines=m.get("snapToLines",!0),g.size=m.get("size",100),g.align=m.get("align",M);var x=m.get("position","auto");x==="auto"&&O.position===50&&(x=g.align==="start"||g.align==="left"?0:g.align==="end"||g.align==="right"?100:50),g.position=x}function d(){D=D.replace(/^\s+/,"")}if(d(),T.startTime=o(),d(),D.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+h);D=D.substr(3),d(),T.endTime=o(),d(),u(D,T)}function w(D){return D.replace(//gi,` `)}var k=function(){function D(){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 T=D.prototype;return T.parse=function(h){var o=this;h&&(o.buffer+=o.decoder.decode(h,{stream:!0}));function u(){var x=o.buffer,p=0;for(x=w(x);p")===-1){o.cue.id=A;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{b(A,o.cue,o.regionList)}catch(x){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(m=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=` `),o.cue.text+=A}continue;case"BADCUE":A||(o.state="ID")}}}catch(x){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},T.flush=function(){var h=this;try{if((h.cue||h.state==="HEADER")&&(h.buffer+=` `,h.parse()),h.state==="INITIAL"||h.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){h.onparsingerror&&h.onparsingerror(o)}return h.onflush&&h.onflush(),this},D}()},"./src/utils/webvtt-parser.ts":function(ie,Y,R){"use strict";R.r(Y),R.d(Y,"generateCueId",function(){return k}),R.d(Y,"parseWebVTT",function(){return T});var Q=R("./src/polyfills/number.ts"),B=R("./src/utils/vttparser.ts"),_=R("./src/demux/id3.ts"),H=R("./src/utils/timescale-conversion.ts"),U=R("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,M=function(h,o,u){return u===void 0&&(u=0),h.substr(u,o.length)===o},b=function(h){var o=parseInt(h.substr(-3)),u=parseInt(h.substr(-6,2)),d=parseInt(h.substr(-9,2)),A=h.length>9?parseInt(h.substr(0,h.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(o)||!Object(Q.isFiniteNumber)(u)||!Object(Q.isFiniteNumber)(d)||!Object(Q.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+h);return o+=1e3*u,o+=60*1e3*d,o+=60*60*1e3*A,o},w=function(h){for(var o=5381,u=h.length;u;)o=o*33^h.charCodeAt(--u);return(o>>>0).toString()};function k(E,h,o){return w(E.toString())+w(h.toString())+w(o)}var D=function(h,o,u){var d=h[o],A=h[d.prevCC];if(!A||!A.new&&d.new){h.ccOffset=h.presentationOffset=d.start,d.new=!1;return}for(;(g=A)!==null&&g!==void 0&&g.new;){var g;h.ccOffset+=d.start-A.start,d.new=!1,d=A,A=h[d.prevCC]}h.presentationOffset=u};function T(E,h,o,u,d,A,g,m){var L=new B.VTTParser,x=Object(_.utf8ArrayToStr)(new Uint8Array(E)).trim().replace(O,` `).split(` `),p=[],c=Object(H.toMpegTsClockFromTimescale)(h,o),s="00:00.000",a=0,y=0,v,C=!0,P=!1;L.oncue=function(G){var V=u[d],$=u.ccOffset,z=(a-c)/9e4;if(V!=null&&V.new&&(y!==void 0?$=u.ccOffset=V.start:D(u,d,z)),z&&($=z-u.presentationOffset),P){var j=G.endTime-G.startTime,ee=Object(U.normalizePts)((G.startTime+$-y)*9e4,A*9e4)/9e4;G.startTime=ee,G.endTime=ee+j}var ne=G.text.trim();G.text=decodeURIComponent(encodeURIComponent(ne)),G.id||(G.id=k(G.startTime,G.endTime,ne)),G.endTime>0&&p.push(G)},L.onparsingerror=function(G){v=G},L.onflush=function(){if(v){m(v);return}g(p)},x.forEach(function(G){if(C)if(M(G,"X-TIMESTAMP-MAP=")){C=!1,P=!0,G.substr(16).split(",").forEach(function(V){M(V,"LOCAL:")?s=V.substr(6):M(V,"MPEGTS:")&&(a=parseInt(V.substr(7)))});try{y=b(s)/1e3}catch(V){P=!1,v=V}return}else G===""&&(C=!1);L.parse(G+` `)}),L.flush()}},"./src/utils/xhr-loader.ts":function(ie,Y,R){"use strict";R.r(Y);var Q=R("./src/utils/logger.ts"),B=R("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,H=function(){function U(M){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=M?M.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var O=U.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},O.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(b,w,k){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=w,this.callbacks=k,this.retryDelay=w.retryDelay,this.loadInternal()},O.loadInternal=function(){var b=this.config,w=this.context;if(!b)return;var k=this.loader=new self.XMLHttpRequest,D=this.stats;D.loading.first=0,D.loaded=0;var T=this.xhrSetup;try{if(T)try{T(k,w.url)}catch(o){k.open("GET",w.url,!0),T(k,w.url)}k.readyState||k.open("GET",w.url,!0);var E=this.context.headers;if(E)for(var h in E)k.setRequestHeader(h,E[h])}catch(o){this.callbacks.onError({code:k.status,text:o.message},w,k);return}w.rangeEnd&&k.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),k.send()},O.readystatechange=function(){var b=this.context,w=this.loader,k=this.stats;if(!b||!w)return;var D=w.readyState,T=this.config;if(k.aborted)return;if(D>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),D===4){w.onreadystatechange=null,w.onprogress=null;var E=w.status;if(E>=200&&E<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var h,o;if(b.responseType==="arraybuffer"?(h=w.response,o=h.byteLength):(h=w.responseText,o=h.length),k.loaded=k.total=o,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(k,b,h,w),!this.callbacks)return;var d={url:w.responseURL,data:h};this.callbacks.onSuccess(d,k,b,w)}else k.retry>=T.maxRetry||E>=400&&E<499?(Q.logger.error(E+" while loading "+b.url),this.callbacks.onError({code:E,text:w.statusText},b,w)):(Q.logger.warn(E+" while loading "+b.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,T.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),T.timeout)},O.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(b){var w=this.stats;w.loaded=b.loaded,b.lengthComputable&&(w.total=b.total)},O.getCacheAge=function(){var b=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");b=w?parseFloat(w):null}return b},U}();Y.default=H}}).default})},vHTk:function(Pe,Le,Z){Pe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2Y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ejujU/u5Of2lyRp1e1th85SDevLDTL3ERmdAd9ezpvDCcr9gFkJ5SjyxS2qMiLndwRlzKOjy1Ra/RxWvChdtF9pF67W3QIwR0Z7VxKjdX++0SNa2HXgAZG2O5DLai7FeUSjw18pQnqfL5/h1NW6LXLQch0h3mlgods8MYqGfAd6EbcmaC519jjDIGApkB34Sen3sfOPPm1hKgKJA7grXNvwx4L/SiWZ1gMu1jb5P2bwcx69Iw4J3QaegKk5G+uyhgI+ZKQw+zIhcGxAudEA56Hd1tscRaYIkx0AoYEC90vW4OCMlrBdhYExkDDQyIE7oQHZesDfSXcrH+ZQzYM+C50Atm3gBeiLLVrIGHWJcxBqRgwDOhH8+LQXnFPoB0lqJSZoMx0NwMuBc6yVPBULERhAxt7sax+hgDUjHgXuiG7LngMUuqCpkdxkBLMOBa6AW60TCTlS3RMFYnY0BKBpwLnUa9NZl3B/LLtqQkgtmSNwOOhX7whXjU1NKz5e4DdcubH4ZOJgw0Fbrl7c9fg5B7ZYKRwWAMOLgio89+CwTTGTeMATkxYDui63OyQPglcgLIsDAGKAPXhF6YfQvM3HeBENKZdQ1jQGoGLEIvmJ0EvnZ/c79ES2owzB5jwBkDHGhIZ/2R7QC5g9HEGJArAxzyde8D5Gm5AmS4GAO2c3TGB2OgFTLALR1KA6e5SByvUpEp7s+6tELwrMnKYcCl0DmYVOCyzOM3L2dCV44mZInUhdBrVFCPMmdt3MCmLrLsemWBcih0DlfVBMNNWVu2WdlgI7qydCE7tE2FzpVpVOqhdZkbaJSKhsSELruuVxYgG6FzOK+Bekjd+I16exaY0JWlC9mhbRA6h5PBCBpUM369w1jdTOiy63plAaoX+rEQNTewetzmEmfomdCVpQvZoeWWDi3UctrBlePXnHHpTZcdcgZIUQxErnk43vjI2ovuQP8faDGikjbF4FsAAAAASUVORK5CYII="},zEei:function(Pe,Le,Z){Pe.exports={flex_box_center:"flex_box_center___3trsE",flex_space_between:"flex_space_between___vYNfG",flex_box_vertical_center:"flex_box_vertical_center___267W4",flex_box_center_end:"flex_box_center_end___35F4i",flex_box_column:"flex_box_column___1cLWS",bg:"bg___13rUr",flexRow:"flexRow___geim6",flexJustifyCenter:"flexJustifyCenter___2SLQ2",flexAlignEnd:"flexAlignEnd___2-3OH",flexAlignCenter:"flexAlignCenter___2PK_9",flexColumn:"flexColumn___pc_D1",formWrap:"formWrap___3ozw6",titleWrap:"titleWrap___3JSLu",fieldWrap:"fieldWrap___1M8-z",mdWrap:"mdWrap___3iPl2",backgroundFa:"backgroundFa___2Wd1f",button:"button___3ie7q",icons:"icons___-WSHu",addButton:"addButton___1qx7n",navBar:"navBar___xDlWA",actived:"actived___dZNDy",deleteButton:"deleteButton___3Ethm"}}}]);