You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Question__OjProblem.71f3...

444 lines
1.4 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[214,3,5,7,8,19],{"++UQ":function(Be,we,k){},"+NIl":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(V,P){"use strict";function Y(h,s){h.cmdState.push(s)}function W(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function R(h){var s=h.cmdState.pop();s&&s.closeBracket()}function B(h){for(var s=h.cmdState,l=s.length-1;l>=0;l--){var i=s[l];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function M(h,s,l){return function(){this.name=h,this.bracketNo=0,this.style=s,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=M("importmodule","tag",["string","builtin"]),L.documentclass=M("documentclass","tag",["","atom"]),L.usepackage=M("usepackage","tag",["atom"]),L.begin=M("begin","tag",["atom"]),L.end=M("end","tag",["atom"]),L.label=M("label","tag",["atom"]),L.ref=M("ref","tag",["atom"]),L.eqref=M("eqref","tag",["atom"]),L.cite=M("cite","tag",["atom"]),L.bibitem=M("bibitem","tag",["atom"]),L.Bibitem=M("Bibitem","tag",["atom"]),L.RBibitem=M("RBibitem","tag",["atom"]),L.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(h,s){h.f=s}function p(h,s){var l;if(h.match(/^\\[a-zA-Z@]+/)){var i=h.current().slice(1);return l=L.hasOwnProperty(i)?L[i]:L.DEFAULT,l=new l,Y(s,l),I(s,u),l.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return I(s,function(n,d){return m(n,d,"\\]")}),"keyword";if(h.match("\\("))return I(s,function(n,d){return m(n,d,"\\)")}),"keyword";if(h.match("$$"))return I(s,function(n,d){return m(n,d,"$$")}),"keyword";if(h.match("$"))return I(s,function(n,d){return m(n,d,"$")}),"keyword";var r=h.next();if(r=="%")return h.skipToEnd(),"comment";if(r=="}"||r=="]"){if(l=W(s),l)l.closeBracket(r),I(s,u);else return"error";return"bracket"}else return r=="{"||r=="["?(l=L.DEFAULT,l=new l,Y(s,l),"bracket"):/\d/.test(r)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),l=B(s),l.name=="begin"&&(l.argument=h.current()),l.styleIdentifier())}function m(h,s,l){if(h.eatSpace())return null;if(l&&h.match(l))return I(s,p),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=h.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(h.skipToEnd(),"comment"):"error"}function u(h,s){var l=h.peek(),i;return l=="{"||l=="["?(i=W(s),i.openBracket(l),h.eat(l),I(s,p),"bracket"):/[ \t\r]/.test(l)?(h.eat(l),null):(I(s,p),R(s),p(h,s))}return{startState:function(){var h=P.inMathMode?function(s,l){return m(s,l)}:p;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,s){return s.f(h,s)},blankLine:function(h){h.f=p,h.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"+QRC":function(Be,we,k){"use strict";var ee=k("E9nw"),V={"text/plain":"Text","text/html":"Url",default:"Text"},P="Copy to clipboard: #{key}, Enter";function Y(R){var B=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return R.replace(/#{\s*key\s*}/g,B)}function W(R,B){var M,L,I,p,m,u,h=!1;B||(B={}),M=B.debug||!1;try{I=ee(),p=document.createRange(),m=document.getSelection(),u=document.createElement("span"),u.textContent=R,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(l){if(l.stopPropagation(),B.format)if(l.preventDefault(),typeof l.clipboardData=="undefined"){M&&console.warn("unable to use e.clipboardData"),M&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=V[B.format]||V.default;window.clipboardData.setData(i,R)}else l.clipboardData.clearData(),l.clipboardData.setData(B.format,R);B.onCopy&&(l.preventDefault(),B.onCopy(l.clipboardData))}),document.body.appendChild(u),p.selectNodeContents(u),m.addRange(p);var s=document.execCommand("copy");if(!s)throw new Error("copy command was unsuccessful");h=!0}catch(l){M&&console.error("unable to copy using execCommand: ",l),M&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(B.format||"text",R),B.onCopy&&B.onCopy(window.clipboardData),h=!0}catch(i){M&&console.error("unable to copy using clipboardData: ",i),M&&console.error("falling back to prompt"),L=Y("message"in B?B.message:P),window.prompt(L,R)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(p):m.removeAllRanges()),u&&document.body.removeChild(u),I()}return h}Be.exports=W},"+aKw":function(Be,we,k){"use strict";var ee=k("tJVT"),V=k("cDcd"),P=k.n(V),Y=function(B){return String(B).length===1?"0".concat(B):B},W=function(B){var M=B.className,L=M===void 0?"":M,I=B.onChange,p=B.defaultValue,m=p===void 0?0:p,u=Object(V.useState)(m),h=Object(ee.a)(u,2),s=h[0],l=h[1];Object(V.useEffect)(function(){var d=setTimeout(function(){l(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(d)}},[s]);var i=parseInt(s/(60*6e4))||"00",r=parseInt(s%(60*6e4)/6e4)||"00",n=parseInt(s%6e4/1e3)||"00";return P.a.createElement("div",{className:L},Y(i),":",Y(r),":",Y(n))};we.a=W},"+ua5":function(Be,we,k){},"07cG":function(Be,we,k){Be.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(Be,we){var k=arguments[3],ee=arguments[4],V=arguments[5],P=JSON.stringify;Be.exports=function(Y,W){for(var R,B=Object.keys(V),M=0,L=B.length;M<L;M++){var I=B[M],p=V[I].exports;if(p===Y||p&&p.default===Y){R=I;break}}if(!R){R=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var m={},M=0,L=B.length;M<L;M++){var I=B[M];m[I]=I}ee[R]=["function(require,module,exports){"+Y+"(self); }",m]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),h={};h[R]=R,ee[u]=["function(require,module,exports){var f = require("+P(R)+");(f.default ? f.default : f)(self);}",h];var s={};l(u);function l(T){s[T]=!0;for(var x in ee[T][1]){var O=ee[T][1][x];s[O]||l(O)}}var i="("+k+")({"+Object.keys(s).map(function(T){return P(T)+":["+ee[T][0]+","+P(ee[T][1])+"]"}).join(",")+"},{},["+P(u)+"])",r=window.URL||window.webkitURL||window.mozURL||window.msURL,n=new Blob([i],{type:"text/javascript"});if(W&&W.bare)return n;var d=r.createObjectURL(n),w=new Worker(d);return w.objectURL=d,w}},"19Vz":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(M,L,I){var p=I&&I!=ee.Init;if(L&&!p)M.on("blur",W),M.on("change",R),M.on("swapDoc",R),ee.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){Y(M)}),R(M);else if(!L&&p){M.off("blur",W),M.off("change",R),M.off("swapDoc",R),ee.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),V(M);var m=M.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}L&&!M.hasFocus()&&W(M)});function V(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function P(M){V(M);var L=M.state.placeholder=document.createElement("pre");L.style.cssText="height: 0; overflow: visible",L.style.direction=M.getOption("direction"),L.className="CodeMirror-placeholder CodeMirror-line-like";var I=M.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),L.appendChild(I),M.display.lineSpace.insertBefore(L,M.display.lineSpace.firstChild)}function Y(M){setTimeout(function(){var L=!1,I=M.getInputField();I.nodeName=="TEXTAREA"?L=!I.value:M.lineCount()==1&&(L=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),L?P(M):V(M)},20)}function W(M){B(M)&&P(M)}function R(M){var L=M.getWrapperElement(),I=B(M);L.className=L.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?P(M):V(M)}function B(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1FX+":function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ee.defineMode("xml",function(Y,W){var R=Y.indentUnit,B={},M=W.htmlMode?V:P;for(var L in M)B[L]=M[L];for(var L in W)B[L]=W[L];var I,p;function m(c,S){function y(F){return S.tokenize=F,F(c,S)}var b=c.next();if(b=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(s("atom","]]>")):null:c.match("--")?y(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(l(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),S.tokenize=s("meta","?>"),"meta"):(I=c.eat("/")?"closeTag":"openTag",S.tokenize=u,"tag bracket");if(b=="&"){var N;return c.eat("#")?c.eat("x")?N=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):N=c.eatWhile(/[\d]/)&&c.eat(";"):N=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),N?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function u(c,S){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return S.tokenize=m,I=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return I="equals",null;if(y=="<"){S.tokenize=m,S.state=d,S.tagName=S.tagStart=null;var b=S.tokenize(c,S);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(y)?(S.tokenize=h(y),S.stringStartCol=c.column(),S.tokenize(c,S)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var S=function(y,b){for(;!y.eol();)if(y.next()==c){b.tokenize=u;break}return"string"};return S.isInAttribute=!0,S}function s(c,S){return function(y,b){for(;!y.eol();){if(y.match(S)){b.tokenize=m;break}y.next()}return c}}function l(c){return function(S,y){for(var b;(b=S.next())!=null;){if(b=="<")return y.tokenize=l(c+1),y.tokenize(S,y);if(b==">")if(c==1){y.tokenize=m;break}else return y.tokenize=l(c-1),y.tokenize(S,y)}return"meta"}}function i(c,S,y){this.prev=c.context,this.tagName=S,this.indent=c.indented,this.startOfLine=y,(B.doNotIndent.hasOwnProperty(S)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function r(c){c.context&&(c.context=c.context.prev)}function n(c,S){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!B.contextGrabbers.hasOwnProperty(y)||!B.contextGrabbers[y].hasOwnProperty(S))return;r(c)}}function d(c,S,y){return c=="openTag"?(y.tagStart=S.column(),w):c=="closeTag"?T:d}function w(c,S,y){return c=="word"?(y.tagName=S.current(),p="tag",E):B.allowMissingTagName&&c=="endTag"?(p="tag bracket",E(c,S,y)):(p="error",w)}function T(c,S,y){if(c=="word"){var b=S.current();return y.context&&y.context.tagName!=b&&B.implicitlyClosed.hasOwnProperty(y.context.tagName)&&r(y),y.context&&y.context.tagName==b||B.matchClosing===!1?(p="tag",x):(p="tag error",O)}else return B.allowMissingTagName&&c=="endTag"?(p="tag bracket",x(c,S,y)):(p="error",O)}function x(c,S,y){return c!="endTag"?(p="error",x):(r(y),d)}function O(c,S,y){return p="error",x(c,S,y)}function E(c,S,y){if(c=="word")return p="attribute",v;if(c=="endTag"||c=="selfcloseTag"){var b=y.tagName,N=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||B.autoSelfClosers.hasOwnProperty(b)?n(y,b):(n(y,b),y.context=new i(y,b,N==y.indented)),d}return p="error",E}function v(c,S,y){return c=="equals"?_:(B.allowMissing||(p="error"),E(c,S,y))}function _(c,S,y){return c=="string"?f:c=="word"&&B.allowUnquoted?(p="string",E):(p="error",E(c,S,y))}function f(c,S,y){return c=="string"?f:E(c,S,y)}return{startState:function(c){var S={tokenize:m,state:d,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(S.baseIndent=c),S},token:function(c,S){if(!S.tagName&&c.sol()&&(S.indented=c.indentation()),c.eatSpace())return null;I=null;var y=S.tokenize(c,S);return(y||I)&&y!="comment"&&(p=null,S.state=S.state(I||y,c,S),p&&(y=p=="error"?y+" error":p)),y},indent:function(c,S,y){var b=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+R;if(b&&b.noIndent)return ee.Pass;if(c.tokenize!=u&&c.tokenize!=m)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return B.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+R*(B.multilineTagIndentFactor||1);if(B.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var N=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(N&&N[1])for(;b;)if(b.tagName==N[2]){b=b.prev;break}else if(B.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(N)for(;b;){var F=B.contextGrabbers[b.tagName];if(F&&F.hasOwnProperty(N[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+R:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:B.htmlMode?"html":"xml",helperType:B.htmlMode?"html":"xml",skipAttribute:function(c){c.state==_&&(c.state=E)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var S=[],y=c.context;y;y=y.prev)y.tagName&&S.push(y.tagName);return S.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Be,we,k){"use strict";k.d(we,"d",function(){return $e}),k.d(we,"b",function(){return Ce}),k.d(we,"c",function(){return st}),k.d(we,"a",function(){return Ft});var ee=k("VTBJ"),V=k("1OyB"),P=k("vuIU"),Y=k("JX7q"),W=k("Ji7U"),R=k("LK+K"),B=k("cDcd"),M=k("I8Z2"),L=k("BGR+"),I=k("wx14"),p=k("rePB"),m=k("4IlW"),u=k("2GS6"),h=k("Gytx"),s=k.n(h),l=k("TSYQ"),i=k.n(l),r=k("U8pU"),n=k("ODXe"),d=/iPhone/i,w=/iPod/i,T=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,E=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,_=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,S=/BB10/i,y=/Opera Mini/i,b=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(wt,Qe){return wt.test(Qe)}function X(wt){var Qe=wt||(typeof navigator!="undefined"?navigator.userAgent:""),it=Qe.split("[FBAN");if(typeof it[1]!="undefined"){var We=it,ce=Object(n.a)(We,1);Qe=ce[0]}if(it=Qe.split("Twitter"),typeof it[1]!="undefined"){var Se=it,ot=Object(n.a)(Se,1);Qe=ot[0]}var ze={apple:{phone:F(d,Qe)&&!F(_,Qe),ipod:F(w,Qe),tablet:!F(d,Qe)&&F(T,Qe)&&!F(_,Qe),device:(F(d,Qe)||F(w,Qe)||F(T,Qe))&&!F(_,Qe)},amazon:{phone:F(E,Qe),tablet:!F(E,Qe)&&F(v,Qe),device:F(E,Qe)||F(v,Qe)},android:{phone:!F(_,Qe)&&F(E,Qe)||!F(_,Qe)&&F(x,Qe),tablet:!F(_,Qe)&&!F(E,Qe)&&!F(x,Qe)&&(F(v,Qe)||F(O,Qe)),device:!F(_,Qe)&&(F(E,Qe)||F(v,Qe)||F(x,Qe)||F(O,Qe))||F(/\bokhttp\b/i,Qe)},windows:{phone:F(_,Qe),tablet:F(f,Qe),device:F(_,Qe)||F(f,Qe)},other:{blackberry:F(c,Qe),blackberry10:F(S,Qe),opera:F(y,Qe),firefox:F(N,Qe),chrome:F(b,Qe),device:F(c,Qe)||F(S,Qe)||F(y,Qe)||F(N,Qe)||F(b,Qe)},any:null,phone:null,tablet:null};return ze.any=ze.apple.device||ze.android.device||ze.windows.device||ze.other.device,ze.phone=ze.apple.phone||ze.android.phone||ze.windows.phone,ze.tablet=ze.apple.tablet||ze.android.tablet||ze.windows.tablet,ze}var Z=Object(ee.a)(Object(ee.a)({},X()),{},{isMobile:X}),H=Z;function A(){}function z(wt,Qe,it){var We=Qe||"";return wt.key||"".concat(We,"item_").concat(it)}function ne(wt){return"".concat(wt,"-menu-")}function ae(wt,Qe){var it=-1;B.Children.forEach(wt,function(We){it+=1,We&&We.type&&We.type.isMenuItemGroup?B.Children.forEach(We.props.children,function(ce){it+=1,Qe(ce,it)}):Qe(We,it)})}function me(wt,Qe,it){if(!wt||it.find)return;B.Children.forEach(wt,function(We){if(We){var ce=We.type;if(!ce||!(ce.isSubMenu||ce.isMenuItem||ce.isMenuItemGroup))return;Qe.indexOf(We.key)!==-1?it.find=!0:We.props.children&&me(We.props.children,Qe,it)}})}var xe=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Te=function(Qe){var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,We=Qe&&typeof Qe.getBoundingClientRect=="function"&&Qe.getBoundingClientRect().width;if(We){if(it){var ce=getComputedStyle(Qe),Se=ce.marginLeft,ot=ce.marginRight;We+=+Se.replace("px","")+ +ot.replace("px","")}We=+We.toFixed(6)}return We||0},Oe=function(Qe,it,We){Qe&&Object(r.a)(Qe.style)==="object"&&(Qe.style[it]=We)},Ue=function(){return H.any},De=k("KQm4"),be=k("Ff2n"),ge=k("faye"),He=k("bdgK"),ct=k("uciX"),vt=k("8XRh"),_t={adjustX:1,adjustY:1},yt={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},et={topLeft:{points:["bl","tl"],overflow:_t,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_t,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:_t,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:_t,offset:[4,0]}},ht=yt,xt=0,Tt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},mt=function(Qe,it,We){var ce=ne(it),Se=Qe.getState();Qe.setState({defaultActiveFirst:Object(ee.a)(Object(ee.a)({},Se.defaultActiveFirst),{},Object(p.a)({},ce,We))})},Ie=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;Object(V.a)(this,it),ce=Qe.call(this,We),ce.onDestroy=function(ke){ce.props.onDestroy(ke)},ce.onKeyDown=function(ke){var qe=ke.keyCode,Rt=ce.menuInstance,Pt=ce.props,$t=Pt.isOpen,fe=Pt.store;if(qe===m.a.ENTER)return ce.onTitleClick(ke),mt(fe,ce.props.eventKey,!0),!0;if(qe===m.a.RIGHT)return $t?Rt.onKeyDown(ke):(ce.triggerOpenChange(!0),mt(fe,ce.props.eventKey,!0)),!0;if(qe===m.a.LEFT){var se;if($t)se=Rt.onKeyDown(ke);else return;return se||(ce.triggerOpenChange(!1),se=!0),se}return $t&&(qe===m.a.UP||qe===m.a.DOWN)?Rt.onKeyDown(ke):void 0},ce.onOpenChange=function(ke){ce.props.onOpenChange(ke)},ce.onPopupVisibleChange=function(ke){ce.triggerOpenChange(ke,ke?"mouseenter":"mouseleave")},ce.onMouseEnter=function(ke){var qe=ce.props,Rt=qe.eventKey,Pt=qe.onMouseEnter,$t=qe.store;mt($t,ce.props.eventKey,!1),Pt({key:Rt,domEvent:ke})},ce.onMouseLeave=function(ke){var qe=ce.props,Rt=qe.parentMenu,Pt=qe.eventKey,$t=qe.onMouseLeave;Rt.subMenuInstance=Object(Y.a)(ce),$t({key:Pt,domEvent:ke})},ce.onTitleMouseEnter=function(ke){var qe=ce.props,Rt=qe.eventKey,Pt=qe.onItemHover,$t=qe.onTitleMouseEnter;Pt({key:Rt,hover:!0}),$t({key:Rt,domEvent:ke})},ce.onTitleMouseLeave=function(ke){var qe=ce.props,Rt=qe.parentMenu,Pt=qe.eventKey,$t=qe.onItemHover,fe=qe.onTitleMouseLeave;Rt.subMenuInstance=Object(Y.a)(ce),$t({key:Pt,hover:!1}),fe({key:Pt,domEvent:ke})},ce.onTitleClick=function(ke){var qe=Object(Y.a)(ce),Rt=qe.props;if(Rt.onTitleClick({key:Rt.eventKey,domEvent:ke}),Rt.triggerSubMenuAction==="hover")return;ce.triggerOpenChange(!Rt.isOpen,"click"),mt(Rt.store,ce.props.eventKey,!1)},ce.onSubMenuClick=function(ke){typeof ce.props.onClick=="function"&&ce.props.onClick(ce.addKeyPath(ke))},ce.onSelect=function(ke){ce.props.onSelect(ke)},ce.onDeselect=function(ke){ce.props.onDeselect(ke)},ce.getPrefixCls=function(){return"".concat(ce.props.rootPrefixCls,"-submenu")},ce.getActiveClassName=function(){return"".concat(ce.getPrefixCls(),"-active")},ce.getDisabledClassName=function(){return"".concat(ce.getPrefixCls(),"-disabled")},ce.getSelectedClassName=function(){return"".concat(ce.getPrefixCls(),"-selected")},ce.getOpenClassName=function(){return"".concat(ce.props.rootPrefixCls,"-submenu-open")},ce.saveMenuInstance=function(ke){ce.menuInstance=ke},ce.addKeyPath=function(ke){return Object(ee.a)(Object(ee.a)({},ke),{},{keyPath:(ke.keyPath||[]).concat(ce.props.eventKey)})},ce.triggerOpenChange=function(ke,qe){var Rt=ce.props.eventKey,Pt=function(){ce.onOpenChange({key:Rt,item:Object(Y.a)(ce),trigger:qe,open:ke})};qe==="mouseenter"?ce.mouseenterTimeout=setTimeout(function(){Pt()},0):Pt()},ce.isChildrenSelected=function(){var ke={find:!1};return me(ce.props.children,ce.props.selectedKeys,ke),ke.find},ce.isOpen=function(){return ce.props.openKeys.indexOf(ce.props.eventKey)!==-1},ce.adjustWidth=function(){if(!ce.subMenuTitle||!ce.menuInstance)return;var ke=ge.findDOMNode(ce.menuInstance);if(ke.offsetWidth>=ce.subMenuTitle.offsetWidth)return;ke.style.minWidth="".concat(ce.subMenuTitle.offsetWidth,"px")},ce.saveSubMenuTitle=function(ke){ce.subMenuTitle=ke},ce.getBaseProps=function(){var ke=Object(Y.a)(ce),qe=ke.props;return{mode:qe.mode==="horizontal"?"vertical":qe.mode,visible:ce.props.isOpen,level:qe.level+1,inlineIndent:qe.inlineIndent,focusable:!1,onClick:ce.onSubMenuClick,onSelect:ce.onSelect,onDeselect:ce.onDeselect,onDestroy:ce.onDestroy,selectedKeys:qe.selectedKeys,eventKey:"".concat(qe.eventKey,"-menu-"),openKeys:qe.openKeys,motion:qe.motion,onOpenChange:ce.onOpenChange,subMenuOpenDelay:qe.subMenuOpenDelay,parentMenu:Object(Y.a)(ce),subMenuCloseDelay:qe.subMenuCloseDelay,forceSubMenuRender:qe.forceSubMenuRender,triggerSubMenuAction:qe.triggerSubMenuAction,builtinPlacements:qe.builtinPlacements,defaultActiveFirst:qe.store.getState().defaultActiveFirst[ne(qe.eventKey)],multiple:qe.multiple,prefixCls:qe.rootPrefixCls,id:ce.internalMenuId,manualRef:ce.saveMenuInstance,itemIcon:qe.itemIcon,expandIcon:qe.expandIcon,direction:qe.direction}},ce.getMotion=function(ke,qe){var Rt=Object(Y.a)(ce),Pt=Rt.haveRendered,$t=ce.props,fe=$t.motion,se=$t.rootPrefixCls,U=Object(ee.a)(Object(ee.a)({},fe),{},{leavedClassName:"".concat(se,"-hidden"),removeOnLeave:!1,motionAppear:Pt||!qe||ke!=="inline"});return U};var Se=We.store,ot=We.eventKey,ze=Se.getState(),Lt=ze.defaultActiveFirst;ce.isRootMenu=!1;var Dt=!1;return Lt&&(Dt=Lt[ot]),mt(Se,ot,Dt),ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this,Se=this.props,ot=Se.mode,ze=Se.parentMenu,Lt=Se.manualRef;if(Lt&&Lt(this),ot!=="horizontal"||!ze.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ce.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ce=this.props,Se=ce.onDestroy,ot=ce.eventKey;Se&&Se(ot),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ce){var Se=this,ot=this.getBaseProps(),ze=this.getMotion(ot.mode,ot.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ot.visible||ot.forceSubMenuRender,!this.haveOpened)return B.createElement("div",null);var Lt=ot.direction;return B.createElement(vt.default,Object.assign({visible:ot.visible},ze),function(Dt){var ke=Dt.className,qe=Dt.style,Rt=i()("".concat(ot.prefixCls,"-sub"),ke,Object(p.a)({},"".concat(ot.prefixCls,"-rtl"),Lt==="rtl"));return B.createElement(Ee,Object.assign({},ot,{id:Se.internalMenuId,className:Rt,style:qe}),ce)})}},{key:"render",value:function(){var ce,Se=Object(ee.a)({},this.props),ot=Se.isOpen,ze=this.getPrefixCls(),Lt=Se.mode==="inline",Dt=i()(ze,"".concat(ze,"-").concat(Se.mode),(ce={},Object(p.a)(ce,Se.className,!!Se.className),Object(p.a)(ce,this.getOpenClassName(),ot),Object(p.a)(ce,this.getActiveClassName(),Se.active||ot&&!Lt),Object(p.a)(ce,this.getDisabledClassName(),Se.disabled),Object(p.a)(ce,this.getSelectedClassName(),this.isChildrenSelected()),ce));this.internalMenuId||(Se.eventKey?this.internalMenuId="".concat(Se.eventKey,"$Menu"):(xt+=1,this.internalMenuId="$__$".concat(xt,"$Menu")));var ke={},qe={},Rt={};Se.disabled||(ke={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},qe={onClick:this.onTitleClick},Rt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Pt={},$t=Se.direction;Lt&&($t==="rtl"?Pt.paddingRight=Se.inlineIndent*Se.level:Pt.paddingLeft=Se.inlineIndent*Se.level);var fe={};this.props.isOpen&&(fe={"aria-owns":this.internalMenuId});var se=null;Se.mode!=="horizontal"&&(se=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(se=B.createElement(this.props.expandIcon,Object(ee.a)({},this.props))));var U=B.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Pt,className:"".concat(ze,"-title"),role:"button"},Rt,qe,{"aria-expanded":ot},fe,{"aria-haspopup":"true",title:typeof Se.title=="string"?Se.title:void 0}),Se.title,se||B.createElement("i",{className:"".concat(ze,"-arrow")})),G=this.renderChildren(Se.children),Q=Se.parentMenu.isRootMenu?Se.parentMenu.props.getPopupContainer:function(pn){return pn.parentNode},te=Tt[Se.mode],he=Se.popupOffset?{offset:Se.popupOffset}:{},Le=Se.mode==="inline"?"":Se.popupClassName;Le+=$t==="rtl"?" ".concat(ze,"-rtl"):"";var Ge=Se.disabled,Ot=Se.triggerSubMenuAction,Nt=Se.subMenuOpenDelay,Xe=Se.forceSubMenuRender,It=Se.subMenuCloseDelay,an=Se.builtinPlacements;xe.forEach(function(pn){return delete Se[pn]}),delete Se.onClick;var Ct=$t==="rtl"?Object.assign({},et,an):Object.assign({},yt,an);return delete Se.direction,B.createElement("li",Object.assign({},Se,ke,{className:Dt,role:"menuitem"}),Lt&&U,Lt&&G,!Lt&&B.createElement(ct.a,{prefixCls:ze,popupClassName:i()("".concat(ze,"-popup"),Le),getPopupContainer:Q,builtinPlacements:Ct,popupPlacement:te,popupVisible:ot,popupAlign:he,popup:G,action:Ge?[]:[Ot],mouseEnterDelay:Nt,mouseLeaveDelay:It,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Xe},U))}}]),it}(B.Component);Ie.defaultProps={onMouseEnter:A,onMouseLeave:A,onTitleMouseEnter:A,onTitleMouseLeave:A,onTitleClick:A,manualRef:A,mode:"vertical",title:""};var je=Object(M.b)(function(wt,Qe){var it=wt.openKeys,We=wt.activeKey,ce=wt.selectedKeys,Se=Qe.eventKey,ot=Qe.subMenuKey;return{isOpen:it.indexOf(Se)>-1,active:We[ot]===Se,selectedKeys:ce}})(Ie);je.isSubMenu=!0;var $e=je,at="menuitem-overflowed",lt=.5,bt=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.resizeObserver=null,We.mutationObserver=null,We.originalTotalWidth=0,We.overflowedItems=[],We.menuItemSizes=[],We.cancelFrameId=null,We.state={lastVisibleIndex:void 0},We.getMenuItemNodes=function(){var ce=We.props.prefixCls,Se=ge.findDOMNode(Object(Y.a)(We));return Se?[].slice.call(Se.children).filter(function(ot){return ot.className.split(" ").indexOf("".concat(ce,"-overflowed-submenu"))<0}):[]},We.getOverflowedSubMenuItem=function(ce,Se,ot){var ze=We.props,Lt=ze.overflowedIndicator,Dt=ze.level,ke=ze.mode,qe=ze.prefixCls,Rt=ze.theme;if(Dt!==1||ke!=="horizontal")return null;var Pt=We.props.children[0],$t=Pt.props,fe=$t.children,se=$t.title,U=$t.style,G=Object(be.a)($t,["children","title","style"]),Q=Object(ee.a)({},U),te="".concat(ce,"-overflowed-indicator"),he="".concat(ce,"-overflowed-indicator");Se.length===0&&ot!==!0?Q=Object(ee.a)(Object(ee.a)({},Q),{},{display:"none"}):ot&&(Q=Object(ee.a)(Object(ee.a)({},Q),{},{visibility:"hidden",position:"absolute"}),te="".concat(te,"-placeholder"),he="".concat(he,"-placeholder"));var Le=Rt?"".concat(qe,"-").concat(Rt):"",Ge={};return xe.forEach(function(Ot){G[Ot]!==void 0&&(Ge[Ot]=G[Ot])}),B.createElement($e,Object.assign({title:Lt,className:"".concat(qe,"-overflowed-submenu"),popupClassName:Le},Ge,{key:te,eventKey:he,disabled:!1,style:Q}),Se)},We.setChildrenWidthAndResize=function(){if(We.props.mode!=="horizontal")return;var ce=ge.findDOMNode(Object(Y.a)(We));if(!ce)return;var Se=ce.children;if(!Se||Se.length===0)return;var ot=ce.children[Se.length-1];Oe(ot,"display","inline-block");var ze=We.getMenuItemNodes(),Lt=ze.filter(function(Dt){return Dt.className.split(" ").indexOf(at)>=0});Lt.forEach(function(Dt){Oe(Dt,"display","inline-block")}),We.menuItemSizes=ze.map(function(Dt){return Te(Dt,!0)}),Lt.forEach(function(Dt){Oe(Dt,"display","none")}),We.overflowedIndicatorWidth=Te(ce.children[ce.children.length-1],!0),We.originalTotalWidth=We.menuItemSizes.reduce(function(Dt,ke){return Dt+ke},0),We.handleResize(),Oe(ot,"display","none")},We.handleResize=function(){if(We.props.mode!=="horizontal")return;var ce=ge.findDOMNode(Object(Y.a)(We));if(!ce)return;var Se=Te(ce);We.overflowedItems=[];var ot=0,ze;We.originalTotalWidth>Se+lt&&(ze=-1,We.menuItemSizes.forEach(function(Lt){ot+=Lt,ot+We.overflowedIndicatorWidth<=Se&&(ze+=1)})),We.setState({lastVisibleIndex:ze})},We}return Object(P.a)(it,[{key:"componentDidMount",value:function(){var ce=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Se=ge.findDOMNode(this);if(!Se)return;this.resizeObserver=new He.default(function(ot){ot.forEach(function(){var ze=ce.cancelFrameId;cancelAnimationFrame(ze),ce.cancelFrameId=requestAnimationFrame(ce.setChildrenWidthAndResize)})}),[].slice.call(Se.children).concat(Se).forEach(function(ot){ce.resizeObserver.observe(ot)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ce.resizeObserver.disconnect(),[].slice.call(Se.children).concat(Se).forEach(function(ot){ce.resizeObserver.observe(ot)}),ce.setChildrenWidthAndResize()}),this.mutationObserver.observe(Se,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ce){var Se=this,ot=this.state.lastVisibleIndex;return(ce||[]).reduce(function(ze,Lt,Dt){var ke=Lt;if(Se.props.mode==="horizontal"){var qe=Se.getOverflowedSubMenuItem(Lt.props.eventKey,[]);ot!==void 0&&Se.props.className.indexOf("".concat(Se.props.prefixCls,"-root"))!==-1&&(Dt>ot&&(ke=B.cloneElement(Lt,{style:{display:"none"},eventKey:"".concat(Lt.props.eventKey,"-hidden"),className:"".concat(at)})),Dt===ot+1&&(Se.overflowedItems=ce.slice(ot+1).map(function(Pt){return B.cloneElement(Pt,{key:Pt.props.eventKey,mode:"vertical-left"})}),qe=Se.getOverflowedSubMenuItem(Lt.props.eventKey,Se.overflowedItems)));var Rt=[].concat(Object(De.a)(ze),[qe,ke]);return Dt===ce.length-1&&Rt.push(Se.getOverflowedSubMenuItem(Lt.props.eventKey,[],!0)),Rt}return[].concat(Object(De.a)(ze),[ke])},[])}},{key:"render",value:function(){var ce=this.props,Se=ce.visible,ot=ce.prefixCls,ze=ce.overflowedIndicator,Lt=ce.mode,Dt=ce.level,ke=ce.tag,qe=ce.children,Rt=ce.theme,Pt=Object(be.a)(ce,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),$t=ke;return B.createElement($t,Object.assign({},Pt),this.renderChildren(qe))}}]),it}(B.Component);bt.defaultProps={tag:"div",className:""};var Mt=bt;function jt(wt){return wt.length?wt.every(function(Qe){return!!Qe.props.disabled}):!0}function Me(wt,Qe,it){var We=wt.getState();wt.setState({activeKey:Object(ee.a)(Object(ee.a)({},We.activeKey),{},Object(p.a)({},Qe,it))})}function Pe(wt){return wt.eventKey||"0-menu-"}function tt(wt,Qe){var it=Qe,We=wt.children,ce=wt.eventKey;if(it){var Se;if(ae(We,function(ot,ze){ot&&ot.props&&!ot.props.disabled&&it===z(ot,ce,ze)&&(Se=!0)}),Se)return it}return it=null,wt.defaultActiveFirst&&ae(We,function(ot,ze){!it&&ot&&!ot.props.disabled&&(it=z(ot,ce,ze))}),it}function rt(wt){if(wt){var Qe=this.instanceArray.indexOf(wt);Qe!==-1?this.instanceArray[Qe]=wt:this.instanceArray.push(wt)}}var Fe=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;return Object(V.a)(this,it),ce=Qe.call(this,We),ce.onKeyDown=function(Se,ot){var ze=Se.keyCode,Lt;if(ce.getFlatInstanceArray().forEach(function(ke){ke&&ke.props.active&&ke.onKeyDown&&(Lt=ke.onKeyDown(Se))}),Lt)return 1;var Dt=null;return(ze===m.a.UP||ze===m.a.DOWN)&&(Dt=ce.step(ze===m.a.UP?-1:1)),Dt?(Se.preventDefault(),Me(ce.props.store,Pe(ce.props),Dt.props.eventKey),typeof ot=="function"&&ot(Dt),1):void 0},ce.onItemHover=function(Se){var ot=Se.key,ze=Se.hover;Me(ce.props.store,Pe(ce.props),ze?ot:null)},ce.onDeselect=function(Se){ce.props.onDeselect(Se)},ce.onSelect=function(Se){ce.props.onSelect(Se)},ce.onClick=function(Se){ce.props.onClick(Se)},ce.onOpenChange=function(Se){ce.props.onOpenChange(Se)},ce.onDestroy=function(Se){ce.props.onDestroy(Se)},ce.getFlatInstanceArray=function(){return ce.instanceArray},ce.step=function(Se){var ot=ce.getFlatInstanceArray(),ze=ce.props.store.getState().activeKey[Pe(ce.props)],Lt=ot.length;if(!Lt)return null;Se<0&&(ot=ot.concat().reverse());var Dt=-1;if(ot.every(function(Pt,$t){return Pt&&Pt.props.eventKey===ze?(Dt=$t,!1):!0}),!ce.props.defaultActiveFirst&&Dt!==-1&&jt(ot.slice(Dt,Lt-1)))return;var ke=(Dt+1)%Lt,qe=ke;do{var Rt=ot[qe];if(!Rt||Rt.props.disabled)qe=(qe+1)%Lt;else return Rt}while(qe!==ke);return null},ce.renderCommonMenuItem=function(Se,ot,ze){var Lt=ce.props.store.getState(),Dt=Object(Y.a)(ce),ke=Dt.props,qe=z(Se,ke.eventKey,ot),Rt=Se.props;if(!Rt||typeof Se.type=="string")return Se;var Pt=qe===Lt.activeKey,$t=Object(ee.a)(Object(ee.a)({mode:Rt.mode||ke.mode,level:ke.level,inlineIndent:ke.inlineIndent,renderMenuItem:ce.renderMenuItem,rootPrefixCls:ke.prefixCls,index:ot,parentMenu:ke.parentMenu,manualRef:Rt.disabled?void 0:Object(u.a)(Se.ref,rt.bind(Object(Y.a)(ce))),eventKey:qe,active:!Rt.disabled&&Pt,multiple:ke.multiple,onClick:function(se){(Rt.onClick||A)(se),ce.onClick(se)},onItemHover:ce.onItemHover,motion:ke.motion,subMenuOpenDelay:ke.subMenuOpenDelay,subMenuCloseDelay:ke.subMenuCloseDelay,forceSubMenuRender:ke.forceSubMenuRender,onOpenChange:ce.onOpenChange,onDeselect:ce.onDeselect,onSelect:ce.onSelect,builtinPlacements:ke.builtinPlacements,itemIcon:Rt.itemIcon||ce.props.itemIcon,expandIcon:Rt.expandIcon||ce.props.expandIcon},ze),{},{direction:ke.direction});return(ke.mode==="inline"||Ue())&&($t.triggerSubMenuAction="click"),B.cloneElement(Se,$t)},ce.renderMenuItem=function(Se,ot,ze){if(!Se)return null;var Lt=ce.props.store.getState(),Dt={openKeys:Lt.openKeys,selectedKeys:Lt.selectedKeys,triggerSubMenuAction:ce.props.triggerSubMenuAction,subMenuKey:ze};return ce.renderCommonMenuItem(Se,ot,Dt)},We.store.setState({activeKey:Object(ee.a)(Object(ee.a)({},We.store.getState().activeKey),{},Object(p.a)({},We.eventKey,tt(We,We.activeKey)))}),ce.instanceArray=[],ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ce){return this.props.visible||ce.visible||this.props.className!==ce.className||!s()(this.props.style,ce.style)}},{key:"componentDidUpdate",value:function(ce){var Se=this.props,ot="activeKey"in Se?Se.activeKey:Se.store.getState().activeKey[Pe(Se)],ze=tt(Se,ot);if(ze!==ot)Me(Se.store,Pe(Se),ze);else if("activeKey"in ce){var Lt=tt(ce,ce.activeKey);ze!==Lt&&Me(Se.store,Pe(Se),ze)}}},{key:"render",value:function(){var ce=this,Se=Object(I.a)({},this.props);this.instanceArray=[];var ot=i()(Se.prefixCls,Se.className,"".concat(Se.prefixCls,"-").concat(Se.mode)),ze={className:ot,role:Se.role||"menu"};Se.id&&(ze.id=Se.id),Se.focusable&&(ze.tabIndex=0,ze.onKeyDown=this.onKeyDown);var Lt=Se.prefixCls,Dt=Se.eventKey,ke=Se.visible,qe=Se.level,Rt=Se.mode,Pt=Se.overflowedIndicator,$t=Se.theme;return xe.forEach(function(fe){return delete Se[fe]}),delete Se.onClick,B.createElement(Mt,Object.assign({},Se,{prefixCls:Lt,mode:Rt,tag:"ul",level:qe,theme:$t,visible:ke,overflowedIndicator:Pt},ze),B.Children.map(Se.children,function(fe,se){return ce.renderMenuItem(fe,se,Dt||"0-menu-")}))}}]),it}(B.Component);Fe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:A};var Je=Object(M.b)()(Fe),Ee=Je,ye=k("Kwbf");function _e(wt,Qe,it){var We=wt.prefixCls,ce=wt.motion,Se=wt.defaultMotions,ot=Se===void 0?{}:Se,ze=wt.openAnimation,Lt=wt.openTransitionName,Dt=Qe.switchingModeFromInline;if(ce)return ce;if(Object(r.a)(ze)==="object"&&ze)Object(ye.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ze=="string")return{motionName:"".concat(We,"-open-").concat(ze)};if(Lt)return{motionName:Lt};var ke=ot[it];return ke||(Dt?null:ot.other)}var le=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(We){var ce;Object(V.a)(this,it),ce=Qe.call(this,We),ce.inlineOpenKeys=[],ce.onSelect=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props;if(Dt.selectable){var ke=ce.store.getState(),qe=ke.selectedKeys,Rt=ze.key;Dt.multiple?qe=qe.concat([Rt]):qe=[Rt],"selectedKeys"in Dt||ce.store.setState({selectedKeys:qe}),Dt.onSelect(Object(ee.a)(Object(ee.a)({},ze),{},{selectedKeys:qe}))}},ce.onClick=function(ze){var Lt=ce.getRealMenuMode(),Dt=Object(Y.a)(ce),ke=Dt.store,qe=Dt.props.onOpenChange;Lt!=="inline"&&!("openKeys"in ce.props)&&(ke.setState({openKeys:[]}),qe([])),ce.props.onClick(ze)},ce.onKeyDown=function(ze,Lt){ce.innerMenu.getWrappedInstance().onKeyDown(ze,Lt)},ce.onOpenChange=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props,ke=ce.store.getState().openKeys.concat(),qe=!1,Rt=function($t){var fe=!1;if($t.open)fe=ke.indexOf($t.key)===-1,fe&&ke.push($t.key);else{var se=ke.indexOf($t.key);fe=se!==-1,fe&&ke.splice(se,1)}qe=qe||fe};Array.isArray(ze)?ze.forEach(Rt):Rt(ze),qe&&("openKeys"in ce.props||ce.store.setState({openKeys:ke}),Dt.onOpenChange(ke))},ce.onDeselect=function(ze){var Lt=Object(Y.a)(ce),Dt=Lt.props;if(Dt.selectable){var ke=ce.store.getState().selectedKeys.concat(),qe=ze.key,Rt=ke.indexOf(qe);Rt!==-1&&ke.splice(Rt,1),"selectedKeys"in Dt||ce.store.setState({selectedKeys:ke}),Dt.onDeselect(Object(ee.a)(Object(ee.a)({},ze),{},{selectedKeys:ke}))}},ce.onMouseEnter=function(ze){ce.restoreModeVerticalFromInline();var Lt=ce.props.onMouseEnter;Lt&&Lt(ze)},ce.onTransitionEnd=function(ze){var Lt=ze.propertyName==="width"&&ze.target===ze.currentTarget,Dt=ze.target.className,ke=Object.prototype.toString.call(Dt)==="[object SVGAnimatedString]"?Dt.animVal:Dt,qe=ze.propertyName==="font-size"&&ke.indexOf("anticon")>=0;(Lt||qe)&&ce.restoreModeVerticalFromInline()},ce.setInnerMenu=function(ze){ce.innerMenu=ze},ce.isRootMenu=!0;var Se=We.defaultSelectedKeys,ot=We.defaultOpenKeys;return"selectedKeys"in We&&(Se=We.selectedKeys||[]),"openKeys"in We&&(ot=We.openKeys||[]),ce.store=Object(M.c)({selectedKeys:Se,openKeys:ot,activeKey:{"0-menu-":tt(We,We.activeKey)}}),ce.state={switchingModeFromInline:!1},ce}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ce){this.updateOpentKeysWhenSwitchMode(ce),this.updateMiniStore();var Se=this.props,ot=Se.siderCollapsed,ze=Se.inlineCollapsed,Lt=Se.onOpenChange;(!ce.inlineCollapsed&&ze||!ce.siderCollapsed&&ot)&&Lt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ce){var Se=this.props,ot=this.store,ze=this.inlineOpenKeys,Lt=ot.getState(),Dt={};ce.mode==="inline"&&Se.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Se||((Se.inlineCollapsed&&!ce.inlineCollapsed||Se.siderCollapsed&&!ce.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Lt.openKeys.concat(),Dt.openKeys=[]),(!Se.inlineCollapsed&&ce.inlineCollapsed||!Se.siderCollapsed&&ce.siderCollapsed)&&(Dt.openKeys=ze,this.inlineOpenKeys=[])),Object.keys(Dt).length&&ot.setState(Dt)}},{key:"updateMenuDisplay",value:function(){var ce=this.props.collapsedWidth,Se=this.store,ot=this.prevOpenKeys,ze=this.getInlineCollapsed()&&(ce===0||ce==="0"||ce==="0px");ze?(this.prevOpenKeys=Se.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ot&&(this.store.setState({openKeys:ot}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ce=this.props.mode,Se=this.state.switchingModeFromInline,ot=this.getInlineCollapsed();return Se&&ot?"inline":ot?"vertical":ce}},{key:"getInlineCollapsed",value:function(){var ce=this.props,Se=ce.inlineCollapsed,ot=ce.siderCollapsed;return ot!==void 0?ot:Se}},{key:"restoreModeVerticalFromInline",value:function(){var ce=this.state.switchingModeFromInline;ce&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ce=Object(ee.a)({},Object(L.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Se=this.getRealMenuMode();return ce.className+=" ".concat(ce.prefixCls,"-root"),ce.direction==="rtl"&&(ce.className+=" ".concat(ce.prefixCls,"-rtl")),ce=Object(ee.a)(Object(ee.a)({},ce),{},{mode:Se,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:_e(this.props,this.state,Se)}),delete ce.openAnimation,delete ce.openTransitionName,B.createElement(M.a,{store:this.store},B.createElement(Ee,Object.assign({},ce,{ref:this.setInnerMenu}),this.props.children))}}]),it}(B.Component);le.defaultProps={selectable:!0,onClick:A,onSelect:A,onOpenChange:A,onDeselect:A,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:B.createElement("span",null,"\xB7\xB7\xB7")};var de=le,ve=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.onKeyDown=function(ce){var Se=ce.keyCode;return Se===m.a.ENTER?(We.onClick(ce),!0):void 0},We.onMouseLeave=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.onItemHover,Lt=Se.onMouseLeave;ze({key:ot,hover:!1}),Lt({key:ot,domEvent:ce})},We.onMouseEnter=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.onItemHover,Lt=Se.onMouseEnter;ze({key:ot,hover:!0}),Lt({key:ot,domEvent:ce})},We.onClick=function(ce){var Se=We.props,ot=Se.eventKey,ze=Se.multiple,Lt=Se.onClick,Dt=Se.onSelect,ke=Se.onDeselect,qe=Se.isSelected,Rt={key:ot,keyPath:[ot],item:Object(Y.a)(We),domEvent:ce};Lt(Rt),ze?qe?ke(Rt):Dt(Rt):qe||Dt(Rt)},We.saveNode=function(ce){We.node=ce},We}return Object(P.a)(it,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ce=this.props;ce.onDestroy&&ce.onDestroy(ce.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ce,Se=Object(ee.a)({},this.props),ot=i()(this.getPrefixCls(),Se.className,(ce={},Object(p.a)(ce,this.getActiveClassName(),!Se.disabled&&Se.active),Object(p.a)(ce,this.getSelectedClassName(),Se.isSelected),Object(p.a)(ce,this.getDisabledClassName(),Se.disabled),ce)),ze=Object(ee.a)(Object(ee.a)({},Se.attribute),{},{title:typeof Se.title=="string"?Se.title:void 0,className:ot,role:Se.role||"menuitem","aria-disabled":Se.disabled});Se.role==="option"?ze=Object(ee.a)(Object(ee.a)({},ze),{},{role:"option","aria-selected":Se.isSelected}):(Se.role===null||Se.role==="none")&&(ze.role="none");var Lt={onClick:Se.disabled?null:this.onClick,onMouseLeave:Se.disabled?null:this.onMouseLeave,onMouseEnter:Se.disabled?null:this.onMouseEnter},Dt=Object(ee.a)({},Se.style);Se.mode==="inline"&&(Se.direction==="rtl"?Dt.paddingRight=Se.inlineIndent*Se.level:Dt.paddingLeft=Se.inlineIndent*Se.level),xe.forEach(function(qe){return delete Se[qe]}),delete Se.direction;var ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ke=B.createElement(this.props.itemIcon,this.props)),B.createElement("li",Object.assign({},Object(L.default)(Se,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ze,Lt,{style:Dt,ref:this.saveNode}),Se.children,ke)}}]),it}(B.Component);ve.isMenuItem=!0,ve.defaultProps={onSelect:A,onMouseEnter:A,onMouseLeave:A,manualRef:A};var pe=Object(M.b)(function(wt,Qe){var it=wt.activeKey,We=wt.selectedKeys,ce=Qe.eventKey,Se=Qe.subMenuKey;return{active:it[Se]===ce,isSelected:We.indexOf(ce)!==-1}})(ve),Ce=pe,Ke=function(wt){Object(W.a)(it,wt);var Qe=Object(R.a)(it);function it(){var We;return Object(V.a)(this,it),We=Qe.apply(this,arguments),We.renderInnerMenuItem=function(ce){var Se=We.props,ot=Se.renderMenuItem,ze=Se.index;return ot(ce,ze,We.props.subMenuKey)},We}return Object(P.a)(it,[{key:"render",value:function(){var ce=Object(I.a)({},this.props),Se=ce.className,ot=Se===void 0?"":Se,ze=ce.rootPrefixCls,Lt="".concat(ze,"-item-group-title"),Dt="".concat(ze,"-item-group-list"),ke=ce.title,qe=ce.children;return xe.forEach(function(Rt){return delete ce[Rt]}),delete ce.onClick,delete ce.direction,B.createElement("li",Object.assign({},ce,{className:"".concat(ot," ").concat(ze,"-item-group")}),B.createElement("div",{className:Lt,title:typeof ke=="string"?ke:void 0},ke),B.createElement("ul",{className:Dt},B.Children.map(qe,this.renderInnerMenuItem)))}}]),it}(B.Component);Ke.isMenuItemGroup=!0,Ke.defaultProps={disabled:!0};var st=Ke,At=function(Qe){var it=Qe.className,We=Qe.rootPrefixCls,ce=Qe.style;return B.createElement("li",{className:"".concat(it," ").concat(We,"-item-divider"),style:ce})};At.defaultProps={disabled:!0,className:"",style:{}};var Ft=At,kt=we.e=de},"3tLw":function(Be,we,k){Be.exports=k.p+"static/a.39070d50.svg"},"4xil":function(Be,we,k){Be.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(Be,we,k){"use strict";k.d(we,"a",function(){return n});var ee=k("Ty5D"),V=k("dI71"),P=k("cDcd"),Y=k.n(P),W=k("YS25"),R=k("17x9"),B=k.n(R),M=k("wx14"),L=k("zLVn"),I=k("9R94"),p=function(_){Object(V.a)(f,_);function f(){for(var S,y=arguments.length,b=new Array(y),N=0;N<y;N++)b[N]=arguments[N];return S=_.call.apply(_,[this].concat(b))||this,S.history=Object(W.a)(S.props),S}var c=f.prototype;return c.render=function(){return Y.a.createElement(ee.c,{history:this.history,children:this.props.children})},f}(Y.a.Component),m=function(_){Object(V.a)(f,_);function f(){for(var S,y=arguments.length,b=new Array(y),N=0;N<y;N++)b[N]=arguments[N];return S=_.call.apply(_,[this].concat(b))||this,S.history=Object(W.b)(S.props),S}var c=f.prototype;return c.render=function(){return Y.a.createElement(ee.c,{history:this.history,children:this.props.children})},f}(Y.a.Component),u=function(f,c){return typeof f=="function"?f(c):f},h=function(f,c){return typeof f=="string"?Object(W.c)(f,null,null,c):f},s=function(f){return f},l=Y.a.forwardRef;typeof l=="undefined"&&(l=s);function i(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var r=l(function(_,f){var c=_.innerRef,S=_.navigate,y=_.onClick,b=Object(L.a)(_,["innerRef","navigate","onClick"]),N=b.target,F=Object(M.a)({},b,{onClick:function(Z){try{y&&y(Z)}catch(H){throw Z.preventDefault(),H}!Z.defaultPrevented&&Z.button===0&&(!N||N==="_self")&&!i(Z)&&(Z.preventDefault(),S())}});return s!==l?F.ref=f||c:F.ref=c,Y.a.createElement("a",F)}),n=l(function(_,f){var c=_.component,S=c===void 0?r:c,y=_.replace,b=_.to,N=_.innerRef,F=Object(L.a)(_,["component","replace","to","innerRef"]);return Y.a.createElement(ee.e.Consumer,null,function(X){X||Object(I.a)(!1);var Z=X.history,H=h(u(b,X.location),X.location),A=H?Z.createHref(H):"",z=Object(M.a)({},F,{href:A,navigate:function(){var ae=u(b,X.location),me=y?Z.replace:Z.push;me(ae)}});return s!==l?z.ref=f||N:z.innerRef=N,Y.a.createElement(S,z)})});if(!1)var d,w;var T=function(f){return f},x=Y.a.forwardRef;typeof x=="undefined"&&(x=T);function O(){for(var _=arguments.length,f=new Array(_),c=0;c<_;c++)f[c]=arguments[c];return f.filter(function(S){return S}).join(" ")}var E=x(function(_,f){var c=_["aria-current"],S=c===void 0?"page":c,y=_.activeClassName,b=y===void 0?"active":y,N=_.activeStyle,F=_.className,X=_.exact,Z=_.isActive,H=_.location,A=_.sensitive,z=_.strict,ne=_.style,ae=_.to,me=_.innerRef,xe=Object(L.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Y.a.createElement(ee.e.Consumer,null,function(Te){Te||Object(I.a)(!1);var Oe=H||Te.location,Ue=h(u(ae,Oe),Oe),De=Ue.pathname,be=De&&De.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ge=be?Object(ee.f)(Oe.pathname,{path:be,exact:X,sensitive:A,strict:z}):null,He=!!(Z?Z(ge,Oe):ge),ct=He?O(F,b):F,vt=He?Object(M.a)({},ne,{},N):ne,_t=Object(M.a)({"aria-current":He&&S||null,className:ct,style:vt,to:Ue},xe);return T!==x?_t.ref=f||me:_t.innerRef=me,Y.a.createElement(n,_t)})});if(!1)var v},"5VLF":function(Be,we,k){"use strict";var ee,V;function P(Y,W,R){var B=function(M,L){return Y.js_beautify(M,L)};return B.js=Y.js_beautify,B.css=W.css_beautify,B.html=R.html_beautify,B.js_beautify=Y.js_beautify,B.css_beautify=W.css_beautify,B.html_beautify=R.html_beautify,B}!(ee=[k("6UM0"),k("TXwP"),k("psGv")],V=function(Y,W,R){return P(Y,W,R)}.apply(we,ee),V!==void 0&&(Be.exports=V))},"5nXd":function(Be,we,k){var ee=k("MFOe"),V=ee.slice,P=ee.pluck,Y=ee.each,W=ee.bind,R=ee.create,B=ee.isList,M=ee.isFunction,L=ee.isObject;Be.exports={createStore:m};var I={version:"2.0.12",enabled:!1,get:function(u,h){var s=this.storage.read(this._namespacePrefix+u);return this._deserialize(s,h)},set:function(u,h){return h===void 0?this.remove(u):(this.storage.write(this._namespacePrefix+u,this._serialize(h)),h)},remove:function(u){this.storage.remove(this._namespacePrefix+u)},each:function(u){var h=this;this.storage.each(function(s,l){u.call(h,h._deserialize(s),(l||"").replace(h._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(u){return this._namespacePrefix=="__storejs_"+u+"_"},createStore:function(){return m.apply(this,arguments)},addPlugin:function(u){this._addPlugin(u)},namespace:function(u){return m(this.storage,this.plugins,u)}};function p(){var u=typeof console=="undefined"?null:console;if(!u)return;var h=u.warn?u.warn:u.log;h.apply(u,arguments)}function m(u,h,s){s||(s=""),u&&!B(u)&&(u=[u]),h&&!B(h)&&(h=[h]);var l=s?"__storejs_"+s+"_":"",i=s?new RegExp("^"+l):null,r=/^[a-zA-Z0-9_\-]*$/;if(!r.test(s))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var n={_namespacePrefix:l,_namespaceRegexp:i,_testStorage:function(w){try{var T="__storejs__test__";w.write(T,T);var x=w.read(T)===T;return w.remove(T),x}catch(O){return!1}},_assignPluginFnProp:function(w,T){var x=this[T];this[T]=function(){var E=V(arguments,0),v=this;function _(){return x?(Y(arguments,function(c,S){E[S]=c}),x.apply(v,E)):void 0}var f=[_].concat(E);return w.apply(v,f)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,T){if(!w)return T;var x="";try{x=JSON.parse(w)}catch(O){x=w}return x!==void 0?x:T},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var T=this;if(B(w)){Y(w,function(E){T._addPlugin(E)});return}var x=P(this.plugins,function(E){return w===E});if(x)return;if(this.plugins.push(w),!M(w))throw new Error("Plugins must be function values that return objects");var O=w.call(this);if(!L(O))throw new Error("Plugins must return an object of function properties");Y(O,function(E,v){if(!M(E))throw new Error("Bad plugin property: "+v+" from plugin "+w.name+". Plugins should only return functions.");T._assignPluginFnProp(E,v)})},addStorage:function(w){p("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},d=R(n,I,{plugins:[]});return d.raw={},Y(d,function(w,T){M(w)&&(d.raw[T]=W(d,w))}),Y(u,function(w){d._addStorage(w)}),Y(h,function(w){d._addPlugin(w)}),d}},"6+eU":function(Be,we,k){"use strict";k.d(we,"a",function(){return x});var ee=k("wx14"),V=k("rePB"),P=k("VTBJ"),Y=k("1OyB"),W=k("vuIU"),R=k("Ji7U"),B=k("LK+K"),M=k("cDcd"),L=k.n(M),I=k("TSYQ"),p=k.n(I),m=function(E){var v,_="".concat(E.rootPrefixCls,"-item"),f=p()(_,"".concat(_,"-").concat(E.page),(v={},Object(V.a)(v,"".concat(_,"-active"),E.active),Object(V.a)(v,E.className,!!E.className),Object(V.a)(v,"".concat(_,"-disabled"),!E.page),v)),c=function(){E.onClick(E.page)},S=function(b){E.onKeyPress(b,E.onClick,E.page)};return L.a.createElement("li",{title:E.showTitle?E.page:null,className:f,onClick:c,onKeyPress:S,tabIndex:"0"},E.itemRender(E.page,"page",L.a.createElement("a",{rel:"nofollow"},E.page)))},u=m,h={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(O){Object(R.a)(v,O);var E=Object(B.a)(v);function v(){var _;Object(Y.a)(this,v);for(var f=arguments.length,c=new Array(f),S=0;S<f;S++)c[S]=arguments[S];return _=E.call.apply(E,[this].concat(c)),_.state={goInputText:""},_.buildOptionText=function(y){return"".concat(y," ").concat(_.props.locale.items_per_page)},_.changeSize=function(y){_.props.changeSize(Number(y))},_.handleChange=function(y){_.setState({goInputText:y.target.value})},_.handleBlur=function(y){var b=_.props,N=b.goButton,F=b.quickGo,X=b.rootPrefixCls,Z=_.state.goInputText;if(N||Z==="")return;if(y.relatedTarget&&(y.relatedTarget.className.indexOf("".concat(X,"-prev"))>=0||y.relatedTarget.className.indexOf("".concat(X,"-next"))>=0))return;_.setState({goInputText:""}),F(_.getValidValue())},_.go=function(y){var b=_.state.goInputText;if(b==="")return;(y.keyCode===h.ENTER||y.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(W.a)(v,[{key:"getValidValue",value:function(){var f=this.state,c=f.goInputText,S=f.current;return!c||isNaN(c)?S:Number(c)}},{key:"getPageSizeOptions",value:function(){var f=this.props,c=f.pageSize,S=f.pageSizeOptions;return S.some(function(y){return y.toString()===c.toString()})?S:S.concat([c.toString()]).sort(function(y,b){var N=isNaN(Number(y))?0:Number(y),F=isNaN(Number(b))?0:Number(b);return N-F})}},{key:"render",value:function(){var f=this,c=this.props,S=c.pageSize,y=c.locale,b=c.rootPrefixCls,N=c.changeSize,F=c.quickGo,X=c.goButton,Z=c.selectComponentClass,H=c.buildOptionText,A=c.selectPrefixCls,z=c.disabled,ne=this.state.goInputText,ae="".concat(b,"-options"),me=Z,xe=null,Te=null,Oe=null;if(!N&&!F)return null;var Ue=this.getPageSizeOptions();if(N&&me){var De=Ue.map(function(be,ge){return L.a.createElement(me.Option,{key:ge,value:be.toString()},(H||f.buildOptionText)(be))});xe=L.a.createElement(me,{disabled:z,prefixCls:A,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(S||Ue[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ge){return ge.parentNode}},De)}return F&&(X&&(Oe=typeof X=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(ae,"-quick-jumper-button")},y.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},X)),Te=L.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},y.jump_to,L.a.createElement("input",{disabled:z,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,Oe)),L.a.createElement("li",{className:"".concat(ae)},xe,Te)}}]),v}(L.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=s,i=k("N2Kk");function r(){}function n(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function d(O,E,v){return v}function w(O,E,v){var _=typeof O=="undefined"?E.pageSize:O;return Math.floor((v.total-1)/_)+1}var T=function(O){Object(R.a)(v,O);var E=Object(B.a)(v);function v(_){var f;Object(Y.a)(this,v),f=E.call(this,_),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(w(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(N,F){var X=f.props.prefixCls,Z=N||L.a.createElement("button",{type:"button","aria-label":F,className:"".concat(X,"-item-link")});return typeof N=="function"&&(Z=L.a.createElement(N,Object(P.a)({},f.props))),Z},f.savePaginationNode=function(N){f.paginationNode=N},f.isValid=function(N){return n(N)&&N!==f.state.current},f.shouldDisplayQuickJumper=function(){var N=f.props,F=N.showQuickJumper,X=N.pageSize,Z=N.total;return Z<=X?!1:F},f.handleKeyDown=function(N){(N.keyCode===h.ARROW_UP||N.keyCode===h.ARROW_DOWN)&&N.preventDefault()},f.handleKeyUp=function(N){var F=f.getValidValue(N),X=f.state.currentInputValue;F!==X&&f.setState({currentInputValue:F}),N.keyCode===h.ENTER?f.handleChange(F):N.keyCode===h.ARROW_UP?f.handleChange(F-1):N.keyCode===h.ARROW_DOWN&&f.handleChange(F+1)},f.changePageSize=function(N){var F=f.state.current,X=w(N,f.state,f.props);F=F>X?X:F,X===0&&(F=f.state.current),typeof N=="number"&&("pageSize"in f.props||f.setState({pageSize:N}),"current"in f.props||f.setState({current:F,currentInputValue:F})),f.props.onShowSizeChange(F,N),"onChange"in f.props&&f.props.onChange&&f.props.onChange(F,N)},f.handleChange=function(N){var F=f.props.disabled,X=N;if(f.isValid(X)&&!F){var Z=w(void 0,f.state,f.props);X>Z?X=Z:X<1&&(X=1),"current"in f.props||f.setState({current:X,currentInputValue:X});var H=f.state.pageSize;return f.props.onChange(X,H),X}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<w(void 0,f.state,f.props)},f.runIfEnter=function(N,F){if(N.key==="Enter"||N.charCode===13){for(var X=arguments.length,Z=new Array(X>2?X-2:0),H=2;H<X;H++)Z[H-2]=arguments[H];F.apply(void 0,Z)}},f.runIfEnterPrev=function(N){f.runIfEnter(N,f.prev)},f.runIfEnterNext=function(N){f.runIfEnter(N,f.next)},f.runIfEnterJumpPrev=function(N){f.runIfEnter(N,f.jumpPrev)},f.runIfEnterJumpNext=function(N){f.runIfEnter(N,f.jumpNext)},f.handleGoTO=function(N){(N.keyCode===h.ENTER||N.type==="click")&&f.handleChange(f.state.currentInputValue)};var c=_.onChange!==r,S="current"in _;S&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var y=_.defaultCurrent;"current"in _&&(y=_.current);var b=_.defaultPageSize;return"pageSize"in _&&(b=_.pageSize),y=Math.min(y,w(b,void 0,_)),f.state={current:y,currentInputValue:y,pageSize:b},f}return Object(W.a)(v,[{key:"componentDidUpdate",value:function(f,c){var S=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var y=this.paginationNode.querySelector(".".concat(S,"-item-").concat(c.current));y&&document.activeElement===y&&y.blur()}}},{key:"getValidValue",value:function(f){var c=f.target.value,S=w(void 0,this.state,this.props),y=this.state.currentInputValue,b;return c===""?b=c:isNaN(Number(c))?b=y:c>=S?b=S:b=Number(c),b}},{key:"getShowSizeChanger",value:function(){var f=this.props,c=f.showSizeChanger,S=f.total,y=f.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:S>y}},{key:"renderPrev",value:function(f){var c=this.props,S=c.prevIcon,y=c.itemRender,b=y(f,"prev",this.getItemIcon(S,"prev page")),N=!this.hasPrev();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"renderNext",value:function(f){var c=this.props,S=c.nextIcon,y=c.itemRender,b=y(f,"next",this.getItemIcon(S,"next page")),N=!this.hasNext();return Object(M.isValidElement)(b)?Object(M.cloneElement)(b,{disabled:N}):b}},{key:"render",value:function(){var f=this,c=this.props,S=c.prefixCls,y=c.className,b=c.style,N=c.disabled,F=c.hideOnSinglePage,X=c.total,Z=c.locale,H=c.showQuickJumper,A=c.showLessItems,z=c.showTitle,ne=c.showTotal,ae=c.simple,me=c.itemRender,xe=c.showPrevNextJumpers,Te=c.jumpPrevIcon,Oe=c.jumpNextIcon,Ue=c.selectComponentClass,De=c.selectPrefixCls,be=c.pageSizeOptions,ge=this.state,He=ge.current,ct=ge.pageSize,vt=ge.currentInputValue;if(F===!0&&X<=ct)return null;var _t=w(void 0,this.state,this.props),yt=[],et=null,ht=null,xt=null,Tt=null,mt=null,Ie=H&&H.goButton,je=A?1:2,$e=He-1>0?He-1:0,at=He+1<_t?He+1:_t,lt=Object.keys(this.props).reduce(function(le,de){return(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(le[de]=f.props[de]),le},{});if(ae)return Ie&&(typeof Ie=="boolean"?mt=L.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Z.jump_to_confirm):mt=L.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ie),mt=L.a.createElement("li",{title:z?"".concat(Z.jump_to).concat(He,"/").concat(_t):null,className:"".concat(S,"-simple-pager")},mt)),L.a.createElement("ul",Object(ee.a)({className:p()(S,"".concat(S,"-simple"),Object(V.a)({},"".concat(S,"-disabled"),N),y),style:b,ref:this.savePaginationNode},lt),L.a.createElement("li",{title:z?Z.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev($e)),L.a.createElement("li",{title:z?"".concat(He,"/").concat(_t):null,className:"".concat(S,"-simple-pager")},L.a.createElement("input",{type:"text",value:vt,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),L.a.createElement("span",{className:"".concat(S,"-slash")},"/"),_t),L.a.createElement("li",{title:z?Z.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(at)),mt);if(_t<=3+je*2){var bt={locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:me};_t||yt.push(L.a.createElement(u,Object(ee.a)({},bt,{key:"noPager",page:_t,className:"".concat(S,"-disabled")})));for(var Mt=1;Mt<=_t;Mt+=1){var jt=He===Mt;yt.push(L.a.createElement(u,Object(ee.a)({},bt,{key:Mt,page:Mt,active:jt})))}}else{var Me=A?Z.prev_3:Z.prev_5,Pe=A?Z.next_3:Z.next_5;xe&&(et=L.a.createElement("li",{title:z?Me:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(S,"-jump-prev"),Object(V.a)({},"".concat(S,"-jump-prev-custom-icon"),!!Te))},me(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),ht=L.a.createElement("li",{title:z?Pe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(S,"-jump-next"),Object(V.a)({},"".concat(S,"-jump-next-custom-icon"),!!Oe))},me(this.getJumpNextPage(),"jump-next",this.getItemIcon(Oe,"next page")))),Tt=L.a.createElement(u,{locale:Z,last:!0,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:_t,page:_t,active:!1,showTitle:z,itemRender:me}),xt=L.a.createElement(u,{locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:me});var tt=Math.max(1,He-je),rt=Math.min(He+je,_t);He-1<=je&&(rt=1+je*2),_t-He<=je&&(tt=_t-je*2);for(var Fe=tt;Fe<=rt;Fe+=1){var Je=He===Fe;yt.push(L.a.createElement(u,{locale:Z,rootPrefixCls:S,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Fe,page:Fe,active:Je,showTitle:z,itemRender:me}))}He-1>=je*2&&He!==1+2&&(yt[0]=Object(M.cloneElement)(yt[0],{className:"".concat(S,"-item-after-jump-prev")}),yt.unshift(et)),_t-He>=je*2&&He!==_t-2&&(yt[yt.length-1]=Object(M.cloneElement)(yt[yt.length-1],{className:"".concat(S,"-item-before-jump-next")}),yt.push(ht)),tt!==1&&yt.unshift(xt),rt!==_t&&yt.push(Tt)}var Ee=null;ne&&(Ee=L.a.createElement("li",{className:"".concat(S,"-total-text")},ne(X,[X===0?0:(He-1)*ct+1,He*ct>X?X:He*ct])));var ye=!this.hasPrev()||!_t,_e=!this.hasNext()||!_t;return L.a.createElement("ul",Object(ee.a)({className:p()(S,y,Object(V.a)({},"".concat(S,"-disabled"),N)),style:b,unselectable:"unselectable",ref:this.savePaginationNode},lt),Ee,L.a.createElement("li",{title:z?Z.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(S,"-prev"),Object(V.a)({},"".concat(S,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev($e)),yt,L.a.createElement("li",{title:z?Z.next_page:null,onClick:this.next,tabIndex:_e?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(S,"-next"),Object(V.a)({},"".concat(S,"-disabled"),_e)),"aria-disabled":_e},this.renderNext(at)),L.a.createElement(l,{disabled:N,locale:Z,rootPrefixCls:S,selectComponentClass:Ue,selectPrefixCls:De,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:He,pageSize:ct,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ie}))}}],[{key:"getDerivedStateFromProps",value:function(f,c){var S={};if("current"in f&&(S.current=f.current,f.current!==c.current&&(S.currentInputValue=S.current)),"pageSize"in f&&f.pageSize!==c.pageSize){var y=c.current,b=w(f.pageSize,c,f);y=y>b?b:y,"current"in f||(S.current=y,S.currentInputValue=y),S.pageSize=f.pageSize}return S}}]),v}(L.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:i.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var x=T},"6RRn":function(Be,we,k){"use strict";var ee=k("wCXF"),V=k("n6Qo");k.d(we,"b",function(){return V.a});var P=k("IBYe"),Y=k("6eGT"),W=k("hW8S");k.d(we,"a",function(){return W.a}),we.c=ee.b},"6UM0":function(Be,we,k){var ee,V;(function(){var P;(function(){"use strict";var W=[function(L,I,p){var m=p(1).Beautifier,u=p(5).Options;function h(s,l){var i=new m(s,l);return i.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new u}},function(L,I,p){var m=p(2).Output,u=p(3).Token,h=p(4),s=p(5).Options,l=p(7).Tokenizer,i=p(7).line_starters,r=p(7).positionable_operators,n=p(7).TOKEN;function d(A,z){return z.indexOf(A)!==-1}function w(A){return A.replace(/^\s+/g,"")}function T(A){for(var z={},ne=0;ne<A.length;ne++)z[A[ne].replace(/-/g,"_")]=A[ne];return z}function x(A,z){return A&&A.type===n.RESERVED&&A.text===z}function O(A,z){return A&&A.type===n.RESERVED&&d(A.text,z)}var E=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],_=T(v),f=[_.before_newline,_.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function S(A,z){if(z.multiline_frame||z.mode===c.ForInitializer||z.mode===c.Conditional)return;A.remove_indent(z.start_line_index)}function y(A){A=A.replace(h.allLineBreaks,`
`);for(var z=[],ne=A.indexOf(`
`);ne!==-1;)z.push(A.substring(0,ne)),A=A.substring(ne+1),ne=A.indexOf(`
`);return A.length&&z.push(A),z}function b(A){return A===c.ArrayLiteral}function N(A){return d(A,[c.Expression,c.ForInitializer,c.Conditional])}function F(A,z){for(var ne=0;ne<A.length;ne++){var ae=A[ne].trim();if(ae.charAt(0)!==z)return!1}return!0}function X(A,z){for(var ne=0,ae=A.length,me;ne<ae;ne++)if(me=A[ne],me&&me.indexOf(z)!==0)return!1;return!0}function Z(A,z){z=z||{},this._source_text=A||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new s(z)}Z.prototype.create_flags=function(A,z){var ne=0;A&&(ne=A.indentation_level,!this._output.just_added_newline()&&A.line_indent_level>ne&&(ne=A.line_indent_level));var ae={mode:z,parent:A,last_token:A?A.last_token:new u(n.START_BLOCK,""),last_word:A?A.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ne,alignment:0,line_indent_level:A?A.line_indent_level:ne,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},Z.prototype._reset=function(A){var z=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var ne=new l(A,this._options);return this._tokens=ne.tokenize(),A},Z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,z=this._reset(this._source_text),ne=this._options.eol;this._options.eol==="auto"&&(ne=`
`,z&&h.lineBreak.test(z||"")&&(ne=z.match(h.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return A=this._output.get_code(ne),A},Z.prototype.handle_token=function(A,z){A.type===n.START_EXPR?this.handle_start_expr(A):A.type===n.END_EXPR?this.handle_end_expr(A):A.type===n.START_BLOCK?this.handle_start_block(A):A.type===n.END_BLOCK?this.handle_end_block(A):A.type===n.WORD?this.handle_word(A):A.type===n.RESERVED?this.handle_word(A):A.type===n.SEMICOLON?this.handle_semicolon(A):A.type===n.STRING?this.handle_string(A):A.type===n.EQUALS?this.handle_equals(A):A.type===n.OPERATOR?this.handle_operator(A):A.type===n.COMMA?this.handle_comma(A):A.type===n.BLOCK_COMMENT?this.handle_block_comment(A,z):A.type===n.COMMENT?this.handle_comment(A,z):A.type===n.DOT?this.handle_dot(A):A.type===n.EOF?this.handle_eof(A):A.type===n.UNKNOWN?this.handle_unknown(A,z):this.handle_unknown(A,z)},Z.prototype.handle_whitespace_and_comments=function(A,z){var ne=A.newlines,ae=this._options.keep_array_indentation&&b(this._flags.mode);if(A.comments_before)for(var me=A.comments_before.next();me;)this.handle_whitespace_and_comments(me,z),this.handle_token(me,z),me=A.comments_before.next();if(ae)for(var xe=0;xe<ne;xe+=1)this.print_newline(xe>0,z);else if(this._options.max_preserve_newlines&&ne>this._options.max_preserve_newlines&&(ne=this._options.max_preserve_newlines),this._options.preserve_newlines&&ne>1){this.print_newline(!1,z);for(var Te=1;Te<ne;Te+=1)this.print_newline(!0,z)}};var H=["async","break","continue","return","throw","yield"];Z.prototype.allow_wrap_or_preserved_newline=function(A,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var ne=this._options.preserve_newlines&&A.newlines||z,ae=d(this._flags.last_token.text,r)||d(A.text,r);if(ae){var me=d(this._flags.last_token.text,r)&&d(this._options.operator_position,f)||d(A.text,r);ne=ne&&me}if(ne)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,H))return;this._output.set_wrap_point()}},Z.prototype.print_newline=function(A,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ne=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(A)&&(this._flags.multiline_frame=!0)},Z.prototype.print_token_line_indentation=function(A){this._output.just_added_newline()&&(this._options.keep_array_indentation&&A.newlines&&(A.text==="["||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(A.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Z.prototype.print_token=function(A){if(this._output.raw){this._output.add_raw_token(A);return}if(this._options.comma_first&&A.previous&&A.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(A),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(A),this._output.non_breaking_space=!0,this._output.add_token(A.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Z.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&S(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Z.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},Z.prototype.start_of_statement=function(A){var z=!1;return z=z||O(this._flags.last_token,["var","let","const"])&&A.type===n.WORD,z=z||x(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,H)&&!A.newlines,z=z||x(this._flags.last_token,"else")&&!(x(A,"if")&&!A.comments_before),z=z||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),z=z||this._flags.last_token.type===n.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==n.WORD&&A.type!==n.RESERVED,z=z||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),z?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,O(A,["do","for","if","while"])),!0):!1},Z.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var z=c.Expression;if(A.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=c.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=c.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=c.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var ne=this._tokens.peek(-3);if(this._options.space_after_named_function&&ne){var ae=this._tokens.peek(-4);O(ne,["async","function"])||ne.text==="*"&&O(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(ne.text==="{"||ne.text===","||ne.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(A);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Z.prototype.handle_end_expr=function(A){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),S(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Z.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var z=this._tokens.peek(),ne=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):ne&&(d(ne.text,[":",","])&&d(z.type,[n.STRING,n.WORD,n.RESERVED])||d(z.text,["get","set","..."])&&d(ne.type,[n.WORD,n.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(ne.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):d(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!z.comments_before&&z.text==="}",me=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var xe=0,Te=null;this._flags.inline_frame=!0;do if(xe+=1,Te=this._tokens.peek(xe-1),Te.newlines){this._flags.inline_frame=!1;break}while(Te.type!==n.EOF&&!(Te.type===n.END_BLOCK&&Te.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(me||this._flags.last_token.type===n.EQUALS||O(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Z.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===c.Statement;)this.restore_mode();var z=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(A)},Z.prototype.handle_word=function(A){if(A.type===n.RESERVED){if(d(A.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)A.type=n.WORD;else if(A.text==="import"&&d(this._tokens.peek().text,["(","."]))A.type=n.WORD;else if(d(A.text,["as","from"])&&!this._flags.import_block)A.type=n.WORD;else if(this._flags.mode===c.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(A.type=n.WORD)}}if(this.start_of_statement(A)?O(this._flags.last_token,["var","let","const"])&&A.type===n.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(x(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(A,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),x(A,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,H)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var ne="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?ne="SPACE":O(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?ne="NEWLINE":(ne="SPACE",this._output.space_before_token=!0):ne="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===c.BlockStatement?ne="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&N(this._flags.mode)?ne="SPACE":this._flags.last_token.type===n.STRING?ne="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&d(this._last_last_text,["{",","]))?ne="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?ne="SPACE":ne="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,ne="NEWLINE"),O(A,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ne="SPACE":ne="NEWLINE"),O(A,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ne==="NEWLINE"?O(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!O(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(A,"if")&&x(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(A,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ne==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===n.WORD||A.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===n.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(A,"from")&&(this._flags.import_block=!1))},Z.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var z=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},Z.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},Z.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},Z.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},Z.prototype.handle_operator=function(A){var z=A.text==="*"&&(O(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),ne=d(A.text,["-","+"])&&(d(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||d(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var ae=!z;this.handle_whitespace_and_comments(A,ae)}if(A.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===n.OPERATOR&&d(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,xe=!0,Te=!1;if(A.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,Te=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!ne&&!z&&this._options.preserve_newlines&&d(A.text,r)){var Oe=A.text===":",Ue=Oe&&Te,De=Oe&&!Te;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!De,this.print_token(A),(!Oe||Ue)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Oe||Ue?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case _.preserve_newline:De||this.allow_wrap_or_preserved_newline(A),me=!(this._output.just_added_newline()||De),this._output.space_before_token=me,this.print_token(A),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(A),me=!1;var be=this._tokens.peek();xe=be&&d(be.type,[n.WORD,n.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),me=this._flags.last_token.type===n.START_BLOCK,xe=!1;else if(d(A.text,["--","++","!","~"])||ne){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),me=!1,xe=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var ge=O(this._flags.last_token,E)&&A.newlines;ge&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ge,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(me=!0),this._flags.last_token.type===n.RESERVED?me=!0:this._flags.last_token.type===n.END_EXPR?me=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===n.OPERATOR&&(me=d(A.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(A.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(xe=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(A),this._output.space_before_token=xe},Z.prototype.handle_block_comment=function(A,z){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,z),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,z)},Z.prototype.print_block_commment=function(A,z){var ne=y(A.text),ae,me=!1,xe=!1,Te=A.whitespace_before,Oe=Te.length;if(this.print_newline(!1,z),this.print_token_line_indentation(A),this._output.add_token(ne[0]),this.print_newline(!1,z),ne.length>1){for(ne=ne.slice(1),me=F(ne,"*"),xe=X(ne,Te),me&&(this._flags.alignment=1),ae=0;ae<ne.length;ae++)me?(this.print_token_line_indentation(A),this._output.add_token(w(ne[ae]))):xe&&ne[ae]?(this.print_token_line_indentation(A),this._output.add_token(ne[ae].substring(Oe))):(this._output.current_line.set_indent(-1),this._output.add_token(ne[ae])),this.print_newline(!1,z);this._flags.alignment=0}},Z.prototype.handle_comment=function(A,z){A.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(A),this.print_newline(!1,z)},Z.prototype.handle_dot=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(A,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(A)},Z.prototype.handle_unknown=function(A,z){this.print_token(A),A.text[A.text.length-1]===`
`&&this.print_newline(!1,z)},Z.prototype.handle_eof=function(A){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A)},L.exports.Beautifier=Z},function(L){function I(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var u=new I(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},I.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},I.prototype.has_match=function(u){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(u))return!0;return!1},I.prototype.set_indent=function(u,h){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(u){this.__items.push(u);var h=u.lastIndexOf(`
`);h!==-1?this.__character_count=u.length-h:this.__character_count+=u.length},I.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,h){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),h=h||"",u.indent_level>0&&(h=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}p.prototype.get_indent_size=function(u,h){var s=this.__base_string_length;return h=h||0,u<0&&(s=0),s+=u*this.__indent_size,s+=h,s},p.prototype.get_indent_string=function(u,h){var s=this.__base_string;return h=h||0,u<0&&(u=0,s=""),h+=u*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,h=0,s="";this.__indent_size&&u>=this.__indent_size&&(h=Math.floor(u/this.__indent_size),u-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function m(u,h){this.__indent_cache=new p(u,h),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,h){return this.__indent_cache.get_indent_string(u,h)},m.prototype.get_indent_size=function(u,h){return this.__indent_cache.get_indent_size(u,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return u!==`
`&&(s=s.replace(/[\n]/g,u)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,h){return u=u||0,h=h||0,this.next_line.set_indent(u,h),this.__lines.length>1?(this.current_line.set_indent(u,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var h=0;h<u.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(u){for(var h=this.__lines.length;u<h;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,h){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==h){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},L.exports.Output=m},function(L){function I(p,m,u,h){this.type=p,this.text=m,this.comments_before=null,this.newlines=u||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=I},function(L,I){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+p+u+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+m+u+h+"])*";I.identifier=new RegExp(s+l,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+u+h+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(L,I,p){var m=p(6).Options,u=["before-newline","after-newline","preserve-newline"];function h(s){m.call(this,s,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<i.length;r++)i[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[r];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new m,L.exports.Options=h},function(L){function I(u,h){this.raw_options=p(u,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(u,h){var s=this.raw_options[u],l=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(u,h){var s=this.raw_options[u],l=s===void 0?!!h:!!s;return l},I.prototype._get_characters=function(u,h){var s=this.raw_options[u],l=h||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(u,h){var s=this.raw_options[u];h=parseInt(h,10),isNaN(h)&&(h=0);var l=parseInt(s,10);return isNaN(l)&&(l=h),l},I.prototype._get_selection=function(u,h,s){var l=this._get_selection_list(u,h,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[u]+"'");return l[0]},I.prototype._get_selection_list=function(u,h,s){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[h[0]],!this._is_valid_selection(s,h))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,h))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[u]+"'");return l},I.prototype._is_valid_selection=function(u,h){return u.length&&h.length&&!u.some(function(s){return h.indexOf(s)===-1})};function p(u,h){var s={};u=m(u);var l;for(l in u)l!==h&&(s[l]=u[l]);if(h&&u[h])for(l in u[h])s[l]=u[h][l];return s}function m(u){var h={},s;for(s in u){var l=s.replace(/-/g,"_");h[l]=u[s]}return h}L.exports.Options=I,L.exports.normalizeOpts=m,L.exports.mergeOpts=p},function(L,I,p){var m=p(8).InputScanner,u=p(9).Tokenizer,h=p(9).TOKEN,s=p(13).Directives,l=p(4),i=p(12).Pattern,r=p(14).TemplatablePattern;function n(F,X){return X.indexOf(F)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},w=new s(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,O=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var _=new RegExp(v),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),S=new RegExp("^(?:"+c.join("|")+")$"),y,b=function(F,X){u.call(this,F,X),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Z=new i(this._input),H=new r(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(l.identifier).matching(l.identifierMatch),number:Z.matching(T),punct:Z.matching(_),comment:Z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Z.matching(/<!--/),html_comment_end:Z.matching(/-->/),include:Z.starting_with(/#include/).until_after(l.lineBreak),shebang:Z.starting_with(/#!/).until_after(l.lineBreak),xml:Z.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};b.prototype=new u,b.prototype._is_comment=function(F){return F.type===d.COMMENT||F.type===d.BLOCK_COMMENT||F.type===d.UNKNOWN},b.prototype._is_opening=function(F){return F.type===d.START_BLOCK||F.type===d.START_EXPR},b.prototype._is_closing=function(F,X){return(F.type===d.END_BLOCK||F.type===d.END_EXPR)&&X&&(F.text==="]"&&X.text==="["||F.text===")"&&X.text==="("||F.text==="}"&&X.text==="{")},b.prototype._reset=function(){y=!1},b.prototype._get_next_token=function(F,X){var Z=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(d.EOF,""):(Z=Z||this._read_non_javascript(H),Z=Z||this._read_string(H),Z=Z||this._read_word(F),Z=Z||this._read_singles(H),Z=Z||this._read_comment(H),Z=Z||this._read_regexp(H,F),Z=Z||this._read_xml(H,F),Z=Z||this._read_punctuation(),Z=Z||this._create_token(d.UNKNOWN,this._input.next()),Z)},b.prototype._read_word=function(F){var X;if(X=this.__patterns.identifier.read(),X!=="")return X=X.replace(l.allLineBreaks,`
`),!(F.type===d.DOT||F.type===d.RESERVED&&(F.text==="set"||F.text==="get"))&&S.test(X)?(X==="in"||X==="of")&&(F.type===d.WORD||F.type===d.STRING)?this._create_token(d.OPERATOR,X):this._create_token(d.RESERVED,X):this._create_token(d.WORD,X);if(X=this.__patterns.number.read(),X!=="")return this._create_token(d.WORD,X)},b.prototype._read_singles=function(F){var X=null;return F==="("||F==="["?X=this._create_token(d.START_EXPR,F):F===")"||F==="]"?X=this._create_token(d.END_EXPR,F):F==="{"?X=this._create_token(d.START_BLOCK,F):F==="}"?X=this._create_token(d.END_BLOCK,F):F===";"?X=this._create_token(d.SEMICOLON,F):F==="."&&O.test(this._input.peek(1))?X=this._create_token(d.DOT,F):F===","&&(X=this._create_token(d.COMMA,F)),X&&this._input.next(),X},b.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(d.EQUALS,F):F==="?."?this._create_token(d.DOT,F):this._create_token(d.OPERATOR,F)},b.prototype._read_non_javascript=function(F){var X="";if(F==="#"){if(this._is_first_token()&&(X=this.__patterns.shebang.read(),X))return this._create_token(d.UNKNOWN,X.trim()+`
`);if(X=this.__patterns.include.read(),X)return this._create_token(d.UNKNOWN,X.trim()+`
`);F=this._input.next();var Z="#";if(this._input.hasNext()&&this._input.testChar(x)){do F=this._input.next(),Z+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Z+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,Z)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(X=this.__patterns.html_comment_start.read(),X){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)X+=this._input.next();return y=!0,this._create_token(d.COMMENT,X)}}else if(y&&F==="-"&&(X=this.__patterns.html_comment_end.read(),X))return y=!1,this._create_token(d.COMMENT,X);return null},b.prototype._read_comment=function(F){var X=null;if(F==="/"){var Z="";if(this._input.peek(1)==="*"){Z=this.__patterns.block_comment.read();var H=w.get_directives(Z);H&&H.ignore==="start"&&(Z+=w.readIgnored(this._input)),Z=Z.replace(l.allLineBreaks,`
`),X=this._create_token(d.BLOCK_COMMENT,Z),X.directives=H}else this._input.peek(1)==="/"&&(Z=this.__patterns.comment.read(),X=this._create_token(d.COMMENT,Z))}return X},b.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var X=this._input.next();return this.has_char_escapes=!1,F==="`"?X+=this._read_string_recursive("`",!0,"${"):X+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(X=N(X)),this._input.peek()===F&&(X+=this._input.next()),X=X.replace(l.allLineBreaks,`
`),this._create_token(d.STRING,X)}return null},b.prototype._allow_regexp_or_xml=function(F){return F.type===d.RESERVED&&n(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===d.END_EXPR&&F.text===")"&&F.opened.previous.type===d.RESERVED&&n(F.opened.previous.text,["if","while","for"])||n(F.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},b.prototype._read_regexp=function(F,X){if(F==="/"&&this._allow_regexp_or_xml(X)){for(var Z=this._input.next(),H=!1,A=!1;this._input.hasNext()&&(H||A||this._input.peek()!==F)&&!this._input.testChar(l.newline);)Z+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===F&&(Z+=this._input.next(),Z+=this._input.read(l.identifier)),this._create_token(d.STRING,Z)}return null},b.prototype._read_xml=function(F,X){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(X)){var Z="",H=this.__patterns.xml.read_match();if(H){for(var A=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=A.indexOf("{")===0,ne=0;H;){var ae=!!H[1],me=H[2],xe=!!H[H.length-1]||me.slice(0,8)==="![CDATA[";if(!xe&&(me===A||z&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--ne:++ne),Z+=H[0],ne<=0)break;H=this.__patterns.xml.read_match()}return H||(Z+=this._input.match(/[\s\S]*/g)[0]),Z=Z.replace(l.allLineBreaks,`
`),this._create_token(d.STRING,Z)}}return null};function N(F){for(var X="",Z=0,H=new m(F),A=null;H.hasNext();)if(A=H.match(/([\s]|[^\\]|\\\\)+/g),A&&(X+=A[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")A=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")A=H.match(/u([0-9A-Fa-f]{4})/g);else{X+="\\",H.hasNext()&&(X+=H.next());continue}if(!A)return F;if(Z=parseInt(A[1],16),Z>126&&Z<=255&&A[0].indexOf("x")===0)return F;if(Z>=0&&Z<32){X+="\\"+A[0];continue}else Z===34||Z===39||Z===92?X+="\\"+String.fromCharCode(Z):X+=String.fromCharCode(Z)}return X}b.prototype._read_string_recursive=function(F,X,Z){var H,A;F==="'"?A=this.__patterns.single_quote:F==='"'?A=this.__patterns.double_quote:F==="`"?A=this.__patterns.template_text:F==="}"&&(A=this.__patterns.template_expression);for(var z=A.read(),ne="";this._input.hasNext();){if(ne=this._input.next(),ne===F||!X&&l.newline.test(ne)){this._input.back();break}else ne==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\r"&&this._input.peek(1)===`
`&&this._input.next(),ne+=this._input.next()):Z&&(Z==="${"&&ne==="$"&&this._input.peek()==="{"&&(ne+=this._input.next()),Z===ne&&(F==="`"?ne+=this._read_string_recursive("}",X,"`"):ne+=this._read_string_recursive("`",X,"${"),this._input.hasNext()&&(ne+=this._input.next())));ne+=A.read(),z+=ne}return z},L.exports.Tokenizer=b,L.exports.TOKEN=d,L.exports.positionable_operators=E.slice(),L.exports.line_starters=f.slice()},function(L){var I=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(u=this.__input.charAt(m)),u},p.prototype.__match=function(m,u){m.lastIndex=u;var h=m.exec(this.__input);return h&&!(I&&m.sticky)&&(h.index!==u&&(h=null)),h},p.prototype.test=function(m,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(m,u):!1},p.prototype.testChar=function(m,u){var h=this.peek(u);return m.lastIndex=0,h!==null&&m.test(h)},p.prototype.match=function(m){var u=this.__match(m,this.__position);return u?this.__position+=u[0].length:u=null,u},p.prototype.read=function(m,u,h){var s="",l;return m&&(l=this.match(m),l&&(s+=l[0])),u&&(l||!m)&&(s+=this.readUntil(u,h)),s},p.prototype.readUntil=function(m,u){var h="",s=this.__position;m.lastIndex=this.__position;var l=m.exec(this.__input);return l?(s=l.index,u&&(s+=l[0].length)):s=this.__input_length,h=this.__input.substring(this.__position,s),this.__position=s,h},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,u){var h=null,s="g";return u&&I&&(s="y"),typeof m=="string"&&m!==""?h=new RegExp(m,s):m&&(h=new RegExp(m.source,s)),h},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var u=this.__position,h=this.readUntilAfter(m);return this.__position=u,h},p.prototype.lookBack=function(m){var u=this.__position-1;return u>=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},L.exports.InputScanner=p},function(L,I,p){var m=p(8).InputScanner,u=p(3).Token,h=p(10).TokenStream,s=p(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(r,n){this._input=new m(r),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var r,n=new u(l.START,""),d=null,w=[],T=new h;n.type!==l.EOF;){for(r=this._get_next_token(n,d);this._is_comment(r);)T.add(r),r=this._get_next_token(n,d);T.isEmpty()||(r.comments_before=T,T=new h),r.parent=d,this._is_opening(r)?(w.push(d),d=r):d&&this._is_closing(r,d)&&(r.opened=d,d.closed=r,d=w.pop(),r.parent=d),r.previous=n,n.next=r,this.__tokens.add(r),n=r}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(r,n){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(l.RAW,d):this._create_token(l.EOF,"")},i.prototype._is_comment=function(r){return!1},i.prototype._is_opening=function(r){return!1},i.prototype._is_closing=function(r,n){return!1},i.prototype._create_token=function(r,n){var d=new u(r,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=i,L.exports.TOKEN=l},function(L){function I(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},I.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(m=this.__tokens[p]),m},I.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},L.exports.TokenStream=I},function(L,I,p){var m=p(12).Pattern;function u(h,s){m.call(this,h,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new m,u.prototype.__set_whitespace_patterns=function(h,s){h+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var s=this.__split(this._newline_regexp,h);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return h},u.prototype.matching=function(h,s){var l=this._create();return l.__set_whitespace_patterns(h,s),l._update(),l},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(h,s){h.lastIndex=0;for(var l=0,i=[],r=h.exec(s);r;)i.push(s.substring(l,r.index)),l=r.index+r[0].length,r=h.exec(s);return l<s.length?i.push(s.substring(l,s.length)):i.push(""),i},L.exports.WhitespacePattern=u},function(L){function I(p,m){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}I.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(p){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(p),m._update(),m},I.prototype.until=function(p){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(p),m._update(),m},I.prototype.starting_with=function(p){var m=this._create();return m._starting_pattern=this._input.get_regexp(p,!0),m._update(),m},I.prototype.matching=function(p){var m=this._create();return m._match_pattern=this._input.get_regexp(p,!0),m._update(),m},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},L.exports.Pattern=I},function(L){function I(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)m[u[1]]=u[2],u=this.__directive_pattern.exec(p);return m},I.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=I},function(L,I,p){var m=p(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(s,l){m.call(this,s,l),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var i=new m(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new m,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},h.prototype.read_options=function(s){var l=this._create();for(var i in u)l._disabled[i]=s.templating.indexOf(i)===-1;return l._update(),l},h.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},h.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},h.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},h.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},L.exports.TemplatablePattern=h}],R={};function B(L){var I=R[L];if(I!==void 0)return I.exports;var p=R[L]={exports:{}};return W[L](p,p.exports,B),p.exports}var M=B(0);P=M})();var Y=P;!(ee=[],V=function(){return{js_beautify:Y}}.apply(we,ee),V!==void 0&&(Be.exports=V))})()},"6eGT":function(Be,we,k){"use strict";function ee(V){return null}we.a=ee},"7+5b":function(Be,we,k){Be.exports=k.p+"static/v.e7f297d6.svg"},"7Cbv":function(Be,we,k){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function P(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(V)}var Y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function W(u){return typeof u=="string"&&Y.test(u)}for(var R=W,B=[],M=0;M<256;++M)B.push((M+256).toString(16).substr(1));function L(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(B[u[h+0]]+B[u[h+1]]+B[u[h+2]]+B[u[h+3]]+"-"+B[u[h+4]]+B[u[h+5]]+"-"+B[u[h+6]]+B[u[h+7]]+"-"+B[u[h+8]]+B[u[h+9]]+"-"+B[u[h+10]]+B[u[h+11]]+B[u[h+12]]+B[u[h+13]]+B[u[h+14]]+B[u[h+15]]).toLowerCase();if(!R(s))throw TypeError("Stringified UUID is invalid");return s}var I=L;function p(u,h,s){u=u||{};var l=u.random||(u.rng||P)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,h){s=s||0;for(var i=0;i<16;++i)h[s+i]=l[i];return h}return I(l)}var m=we.a=p},"7ahc":function(Be,we,k){"use strict";k.d(we,"a",function(){return w});var ee=k("k1fw"),V=k("0Owb"),P=k("+L6B"),Y=k("2/Rp"),W=k("y8nQ"),R=k("Vl3Y"),B=k("tJVT"),M=k("OaEy"),L=k("2fM7"),I=k("cDcd"),p=k.n(I),m=k("VrN/"),u=k.n(m),h=k("p77/"),s=k.n(h),l=k("c5Ni"),i=k.n(l),r=L.a.Option,n={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"]};we.b=function(T){var x=T.callback,O=T.onCancel,E=Object(I.useState)("python"),v=Object(B.a)(E,2),_=v[0],f=v[1];function c(y){f(d[y][1])}function S(y){x(y)}return p.a.createElement(R.a,Object(V.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),p.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(L.a,{onChange:c},Object.keys(d).map(function(y){return p.a.createElement(r,{key:y,value:y},d[y][0])}))),p.a.createElement(R.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(w,{mode:_})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(Y.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function w(T){var x=T.value,O=T.onChange,E=T.mode,v=T.options,_=v===void 0?{}:v,f=Object(I.useRef)(),c=Object(I.useState)(),S=Object(B.a)(c,2),y=S[0],b=S[1];return Object(I.useEffect)(function(){if(y){function N(F){var X=F.getValue();O&&O(X)}return y.on("change",N),function(){y.off("change",N)}}},[y,O]),Object(I.useEffect)(function(){y&&y.setOption("mode",E)},[y,E]),Object(I.useEffect)(function(){y&&((x!==y.getValue()||x==="")&&setTimeout(function(){y.setValue(x||" ")},300))},[y,x]),Object(I.useEffect)(function(){if(f.current&&!y){var N=u.a.fromTextArea(f.current,Object(ee.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));b(N)}},[f.current,y]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:f}))}},"7ixt":function(Be,we,k){"use strict";k.d(we,"a",function(){return P});var ee={adjustX:1,adjustY:1},V=[0,0],P={left:{points:["cr","cl"],overflow:ee,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:ee,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:ee,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:ee,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:ee,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:ee,offset:[-4,0],targetOffset:V}},Y=P},"7qur":function(Be,we,k){"use strict";k.d(we,"m",function(){return V}),k.d(we,"s",function(){return P}),k.d(we,"h",function(){return Y}),k.d(we,"o",function(){return W}),k.d(we,"n",function(){return R}),k.d(we,"l",function(){return B}),k.d(we,"b",function(){return M}),k.d(we,"q",function(){return L}),k.d(we,"t",function(){return I}),k.d(we,"v",function(){return p}),k.d(we,"w",function(){return m}),k.d(we,"u",function(){return u}),k.d(we,"p",function(){return h}),k.d(we,"f",function(){return s}),k.d(we,"a",function(){return l}),k.d(we,"j",function(){return i}),k.d(we,"k",function(){return r}),k.d(we,"d",function(){return n}),k.d(we,"g",function(){return d}),k.d(we,"c",function(){return w}),k.d(we,"e",function(){return T}),k.d(we,"i",function(){return x}),k.d(we,"r",function(){return O});var ee=k("ErOA");function V(E){return Object(ee.c)("mypractices/".concat(E,".json"),{hidePopLogin:!0})}function P(E,v){return Object(ee.f)("mypractices/".concat(E,"/code_submit.json"),v)}function Y(E,v){return Object(ee.c)("mypractices/".concat(E,"/code_debug.json"),v)}function W(E,v){return Object(ee.c)("mypractices/".concat(E,"/submit_records.json"),v)}function R(E){return Object(ee.c)("mypractices/record_detail.json",{id:E})}function B(E,v){return Object(ee.c)("mypractices/".concat(E,"/result.json"),{mode:v})}function M(E,v){return Object(ee.f)("mypractices/".concat(E,"/add_notes.json"),v)}function L(E,v){return Object(ee.f)("mypractices/".concat(E,"/restore_initial_code.json"),v)}function I(E,v){return Object(ee.f)("mypractices/".concat(E,"/sync_code.json"),v)}function p(E,v){return Object(ee.f)("mypractices/".concat(E,"/update_code.json"),v)}function m(E){return Object(ee.f)("mypractices/".concat(E,"/initial_codes.json"))}function u(E,v){return Object(ee.f)("discusses/".concat(E,"/plus.json"),v)}function h(E){return Object(ee.c)("practices/practices_list.json",E)}function s(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles"),v)}function l(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles"),v)}function i(E,v){return Object(ee.g)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function r(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function n(E,v){return Object(ee.c)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function d(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/set_authority_or_excellent"),v)}function w(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function T(E,v){return Object(ee.f)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function x(E,v){return Object(ee.b)("practices/".concat(E,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function O(E,v){return Object(ee.f)("mypractices/".concat(E,"/update_practice_time_sum"),v)}},"815F":function(Be,we,k){"use strict";k.d(we,"e",function(){return B}),k.d(we,"c",function(){return L}),k.d(we,"d",function(){return I}),k.d(we,"a",function(){return m}),k.d(we,"f",function(){return u}),k.d(we,"b",function(){return h});var ee=k("KQm4"),V=k("VTBJ"),P=k("Ff2n"),Y=k("Zm9Q"),W=k("Kwbf"),R=k("OZM5");function B(s,l){return s!=null?s:l}function M(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function i(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(d){var w=d.key,T=d.children;Object(W.a)(w!=null,"Tree node must have a certain key: [".concat(n).concat(w,"]"));var x=String(w);Object(W.a)(!l.has(x)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(x)),l.set(x,!0),i(T,"".concat(n).concat(x," > "))})}i(s)}function L(s){function l(i){var r=Object(Y.a)(i);return r.map(function(n){if(!Object(R.i)(n))return Object(W.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var d=n.key,w=n.props,T=w.children,x=Object(P.a)(w,["children"]),O=Object(V.a)({key:d},x),E=l(T);return E.length&&(O.children=E),O}).filter(function(n){return n})}return l(s)}function I(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(l===!0?[]:l),r=[];function n(d){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(T,x){var O=Object(R.h)(w?w.pos:"0",x),E=B(T.key,O),v=Object(V.a)(Object(V.a)({},T),{},{parent:w,pos:O,children:null,data:T,isStart:[].concat(Object(ee.a)(w?w.isStart:[]),[x===0]),isEnd:[].concat(Object(ee.a)(w?w.isEnd:[]),[x===d.length-1])});return r.push(v),l===!0||i.has(E)?v.children=n(T.children||[],v):v.children=[],v})}return n(s),r}function p(s,l,i){var r;i?typeof i=="string"?r=function(w){return w[i]}:typeof i=="function"&&(r=function(w){return i(w)}):r=function(w,T){return B(w.key,T)};function n(d,w,T){var x=d?d.children:s,O=d?Object(R.h)(T.pos,w):"0";if(d){var E=r(d,O),v={node:d,index:w,pos:O,key:E,parentPos:T.node?T.pos:null,level:T.level+1};l(v)}x&&x.forEach(function(_,f){n(_,f,{node:d,pos:O,level:T?T.level+1:-1})})}n(null)}function m(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=l.initWrapper,r=l.processEntity,n=l.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,w={},T={},x={posEntities:w,keyEntities:T};return i&&(x=i(x)||x),p(s,function(O){var E=O.node,v=O.index,_=O.pos,f=O.key,c=O.parentPos,S=O.level,y={node:E,index:v,key:f,pos:_,level:S},b=B(f,_);w[_]=y,T[b]=y,y.parent=w[c],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),r&&r(y,x)},d),n&&n(x),x}function u(s,l){var i=l.expandedKeys,r=l.selectedKeys,n=l.loadedKeys,d=l.loadingKeys,w=l.checkedKeys,T=l.halfCheckedKeys,x=l.dragOverNodeKey,O=l.dropPosition,E=l.keyEntities,v=E[s],_={eventKey:s,expanded:i.indexOf(s)!==-1,selected:r.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:d.indexOf(s)!==-1,checked:w.indexOf(s)!==-1,halfChecked:T.indexOf(s)!==-1,pos:String(v?v.pos:""),dragOver:x===s&&O===0,dragOverGapTop:x===s&&O===-1,dragOverGapBottom:x===s&&O===1};return _}function h(s){var l=s.data,i=s.expanded,r=s.selected,n=s.checked,d=s.loaded,w=s.loading,T=s.halfChecked,x=s.dragOver,O=s.dragOverGapTop,E=s.dragOverGapBottom,v=s.pos,_=s.active,f=Object(V.a)(Object(V.a)({},l),{},{expanded:i,selected:r,checked:n,loaded:d,loading:w,halfChecked:T,dragOver:x,dragOverGapTop:O,dragOverGapBottom:E,pos:v,active:_});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),f}},"8EBN":function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";ee.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 V=0;V<ee.modeInfo.length;V++){var P=ee.modeInfo[V];P.mimes&&(P.mime=P.mimes[0])}ee.findModeByMIME=function(Y){Y=Y.toLowerCase();for(var W=0;W<ee.modeInfo.length;W++){var R=ee.modeInfo[W];if(R.mime==Y)return R;if(R.mimes){for(var B=0;B<R.mimes.length;B++)if(R.mimes[B]==Y)return R}}if(/\+xml$/.test(Y))return ee.findModeByMIME("application/xml");if(/\+json$/.test(Y))return ee.findModeByMIME("application/json")},ee.findModeByExtension=function(Y){Y=Y.toLowerCase();for(var W=0;W<ee.modeInfo.length;W++){var R=ee.modeInfo[W];if(R.ext){for(var B=0;B<R.ext.length;B++)if(R.ext[B]==Y)return R}}},ee.findModeByFileName=function(Y){for(var W=0;W<ee.modeInfo.length;W++){var R=ee.modeInfo[W];if(R.file&&R.file.test(Y))return R}var B=Y.lastIndexOf("."),M=B>-1&&Y.substring(B+1,Y.length);if(M)return ee.findModeByExtension(M)},ee.findModeByName=function(Y){Y=Y.toLowerCase();for(var W=0;W<ee.modeInfo.length;W++){var R=ee.modeInfo[W];if(R.name.toLowerCase()==Y)return R;if(R.alias){for(var B=0;B<R.alias.length;B++)if(R.alias[B].toLowerCase()==Y)return R}}}})},"8hTe":function(Be,we,k){Be.exports={button:"button___1wy9m"}},"9+Du":function(Be,we,k){"use strict";var ee=k("k1fw"),V=k("9og8"),P=k("tJVT"),Y=k("WmNS"),W=k.n(Y),R=k("cDcd"),B=k.n(R),M=k("ErOA"),L=k("7Cbv"),I=k("TSYQ"),p=k.n(I),m=k("vef1"),u=k.n(m),h=function(l,i){var r=l.chunkSize,n=r===void 0?1024*1024*2:r,d=l.options,w=d===void 0?{}:d,T=l.onCancel,x=l.onComplete,O=l.onError,E=l.onProgress,v=l.onBefore,_=l.onBeginInitFile,f=l.children,c=l.accept,S=l.className,y=l.style,b=y===void 0?{}:y,N=l.concurrency,F=N===void 0?4:N,X=Object(R.useState)("ready"),Z=Object(P.a)(X,2),H=Z[0],A=Z[1],z=Object(R.useState)(0),ne=Object(P.a)(z,2),ae=ne[0],me=ne[1],xe=Object(R.useState)(""),Te=Object(P.a)(xe,2),Oe=Te[0],Ue=Te[1],De=Object(R.useState)(null),be=Object(P.a)(De,2),ge=be[0],He=be[1],ct=Object(R.useRef)(null),vt=Object(R.useRef)(Object(L.a)()),_t=Object(R.useRef)(!1);Object(R.useImperativeHandle)(i,function(){return{cancel:ht,file:ge,uploadStatus:H}});var yt=function(){var mt=document.getElementById(vt.current);mt&&(mt.value="")},et=function(){var Tt=Object(V.a)(W.a.mark(function mt(Ie){var je,$e;return W.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(H==="uploading")){lt.next=2;break}return lt.abrupt("return");case 2:return _&&_(Ie),je=Ie.size,$e=Math.ceil(je/n),_t.current=!1,A("uploading"),me(0),Ue(""),lt.prev=9,lt.delegateYield(W.a.mark(function bt(){var Mt,jt,Me,Pe,tt,rt,Fe,Je,Ee,ye,_e,le;return W.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return ve.next=2,Object(M.a)("/api/attachments/multipart_upload_start",{method:"POST",body:Object(ee.a)({fileName:Ie.name,chunkCount:$e},w)});case 2:if(Mt=ve.sent,!(_t.current||(Mt==null?void 0:Mt.status)!==0)){ve.next=5;break}throw new Error;case 5:for(jt=Mt.upload_id,ct.current=new AbortController,Me=[],Pe=0,tt=function(Ce){var Ke=Ce*n,st=Math.min(Ke+n,je),At=Ie.slice(Ke,st),Ft=new FormData;Ft.append("chunk",At),Ft.append("fileName",Ie.name),Ft.append("chunkIndex",(Ce+1).toString()),Ft.append("uploadId",jt);for(var kt in w)Object.prototype.hasOwnProperty.call(w,kt)&&Ft.append(kt,w[kt]);Me.push(function(){return Object(M.a)("/api/attachments/multipart_upload",{method:"POST",body:Ft,signal:ct.current.signal},!0).then(function(wt){Pe++;var Qe=Math.round(Pe/$e*100);me(Qe),E&&E(Object(ee.a)(Object(ee.a)({},wt),{},{file:Ie,percent:Qe}))})})},rt=0;rt<$e;rt++)tt(rt);Fe=0,Je=F;case 13:if(!(Fe<Me.length)){ve.next=22;break}if(ye=(Ee=Me.slice(Fe,Fe+Je))===null||Ee===void 0?void 0:Ee.map(function(pe){return pe()}),!(ye.length>0)){ve.next=20;break}return ve.next=18,Promise.all(ye);case 18:_e=ve.sent,Fe+=Je;case 20:ve.next=13;break;case 22:return ve.next=24,Object(M.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(ee.a)({fileName:Ie.name,chunkCount:$e,uploadId:jt},w)});case 24:le=ve.sent,le.object?(A("success"),yt(),x&&x(Object(ee.a)(Object(ee.a)({},le),{},{file:Ie,percent:100}))):(A("error"),Ue("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),yt(),O&&O(Ie.name));case 26:case"end":return ve.stop()}},bt)})(),"t0",11);case 11:lt.next=19;break;case 13:lt.prev=13,lt.t1=lt.catch(9),A("error"),Ue("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),yt(),O&&O(Ie.name);case 19:case"end":return lt.stop()}},mt,null,[[9,13]])}));return function(Ie){return Tt.apply(this,arguments)}}(),ht=Object(R.useCallback)(function(){_t.current=!0,ct.current&&(ct.current.abort(),T&&T())},[T]),xt=function(mt){var Ie,je,$e=mt==null||((Ie=mt.target)===null||Ie===void 0||((je=Ie.files)===null||je===void 0))?void 0:je[0];if(He($e),H="ready",!$e)return;if(v){var at=v($e);at||et($e),yt();return}et($e)};return B.a.createElement(R.Fragment,null,B.a.createElement("input",{type:"file",id:vt.current,style:{display:"none"},onChange:xt,accept:c}),B.a.createElement("label",{className:p()(u.a.upload,S),htmlFor:vt.current,style:b},f))};we.a=Object(R.forwardRef)(h)},"9Bee":function(Be,we,k){"use strict";var ee=k("DYRE"),V=k("zeV3"),P=k("+L6B"),Y=k("2/Rp"),W=k("k1fw"),R=k("9og8"),B=k("tJVT"),M=k("WmNS"),L=k.n(M),I=k("cDcd"),p=k.n(I),m=k("vg9a"),u=k("DlQD"),h=k.n(u),s=k("rUJ1");function l($,C){var D=$.match(/^(\s+)(?:```)/);if(D===null)return C;var K=D[1];return C.split(`
`).map(function(re){var J=re.match(/^\s+/);if(J===null)return re;var Re=Object(B.a)(J,1),ut=Re[0];return ut.length>=K.length?re.slice(K.length):re}).join(`
`)}var i=[],r=["<ul>"],n=new h.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){i.length=0,r=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x($,C,D,K){if(C>=$.length||$[C].level<=D)return C;var re=$[C];K.push("<li><a href='#"+re.anchor+"'>"+re.text+"</a>"),C++;var J=[];return C=x($,C,re.level,J),J.length>0&&(K.push("<ul>"),J.forEach(function(Re){K.push(Re)}),K.push("</ul>")),K.push("</li>"),C=x($,C,D,K),C}function O(){return x(i,0,0,r),r.push("</ul>"),r.join("")}var E={heading:function(C){var D=d.exec(C);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},fences:function(C){var D=this.rules.block.fences.exec(C);if(D){var K=D[0],re=l(K,D[3]||""),J=D[2]?D[2].trim():D[2];if(["latex","katex","math"].indexOf(J)>=0){var Re=f(),ut=re;re=Re,c[Re]={type:"block",expression:ut}}return{type:"code",raw:K,lang:J,text:re}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,f=function(){return"__special_katext_id_".concat(_++,"__")},c={};function S(){return c}function y(){_=0,c={}}function b($){return $=$.replace(v,function(C,D){var K=f();return c[K]={type:"inline",expression:D},K}),$}var N=n.listitem;n.listitem=function($){return N(b($))};var F=n.paragraph;n.paragraph=function($){return F(b($))};var X=n.tablecell;n.tablecell=function($,C){return X(b($),C)},n.code=function($,C,D){var K=(C||"").match(/\S*/)[0];return K?["latex","katex","math"].indexOf(K)>=0?"<p class='editormd-tex'>".concat($,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(C,'">').concat(D?$:Object(s.escape)($,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(D?$:Object(s.escape)($,!0))+"</code></pre>"},n.heading=function($,C,D){var K=this.options.headerPrefix+D.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:K,level:C,text:$}),"<h"+C+' id="'+K+'">'+$+"</h"+C+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:E,renderer:n});var Z=h.a,H=k("SJMd"),A=k("ulZh"),z=k.n(A),ne=k("m3rI"),ae=k("Oy/b"),me=k("p5ED"),xe=k("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 Te=function($,C){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,K){D.__proto__=K}||function(D,K){for(var re in K)Object.prototype.hasOwnProperty.call(K,re)&&(D[re]=K[re])})($,C)};function Oe($,C){function D(){this.constructor=$}Te($,C),$.prototype=C===null?Object.create(C):(D.prototype=C.prototype,new D)}function Ue($,C,D,K){return new(D||(D=Promise))(function(re,J){function Re(Yt){try{St(K.next(Yt))}catch(dt){J(dt)}}function ut(Yt){try{St(K.throw(Yt))}catch(dt){J(dt)}}function St(Yt){var dt;Yt.done?re(Yt.value):(dt=Yt.value,dt instanceof D?dt:new D(function(Gt){Gt(dt)})).then(Re,ut)}St((K=K.apply($,C||[])).next())})}function De($,C){var D,K,re,J,Re={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return J={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function ut(St){return function(Yt){return function(dt){if(D)throw new TypeError("Generator is already executing.");for(;Re;)try{if(D=1,K&&(re=2&dt[0]?K.return:dt[0]?K.throw||((re=K.return)&&re.call(K),0):K.next)&&!(re=re.call(K,dt[1])).done)return re;switch(K=0,re&&(dt=[2&dt[0],re.value]),dt[0]){case 0:case 1:re=dt;break;case 4:return Re.label++,{value:dt[1],done:!1};case 5:Re.label++,K=dt[1],dt=[0];continue;case 7:dt=Re.ops.pop(),Re.trys.pop();continue;default:if(!(re=Re.trys,(re=re.length>0&&re[re.length-1])||dt[0]!==6&&dt[0]!==2)){Re=0;continue}if(dt[0]===3&&(!re||dt[1]>re[0]&&dt[1]<re[3])){Re.label=dt[1];break}if(dt[0]===6&&Re.label<re[1]){Re.label=re[1],re=dt;break}if(re&&Re.label<re[2]){Re.label=re[2],Re.ops.push(dt);break}re[2]&&Re.ops.pop(),Re.trys.pop();continue}dt=C.call($,Re)}catch(Gt){dt=[6,Gt],K=0}finally{D=re=0}if(5&dt[0])throw dt[1];return{value:dt[0]?dt[1]:void 0,done:!0}}([St,Yt])}}}function be(){for(var $=0,C=0,D=arguments.length;C<D;C++)$+=arguments[C].length;var K=Array($),re=0;for(C=0;C<D;C++)for(var J=arguments[C],Re=0,ut=J.length;Re<ut;Re++,re++)K[re]=J[Re];return K}var ge=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(C,D){for(var K=0,re=D;K<re.length;K++){var J=re[K],Re=J[0],ut=J[1];C.setAttribute(Re,ut)}},$.createRect=function(C,D,K){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",C.toString()),re.setAttribute("height",D.toString()),K&&$.setAttributes(re,K),re},$.createLine=function(C,D,K,re,J){var Re=document.createElementNS("http://www.w3.org/2000/svg","line");return Re.setAttribute("x1",C.toString()),Re.setAttribute("y1",D.toString()),Re.setAttribute("x2",K.toString()),Re.setAttribute("y2",re.toString()),J&&$.setAttributes(Re,J),Re},$.createPolygon=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",C),D&&$.setAttributes(K,D),K},$.createCircle=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(C/2).toString()),K.setAttribute("cy",(C/2).toString()),K.setAttribute("r",C.toString()),D&&$.setAttributes(K,D),K},$.createEllipse=function(C,D,K){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(C/2).toString()),re.setAttribute("cy",(D/2).toString()),re.setAttribute("rx",(C/2).toString()),re.setAttribute("ry",(D/2).toString()),K&&$.setAttributes(re,K),re},$.createGroup=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&$.setAttributes(D,C),D},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(C,D,K,re,J,Re,ut){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(St,[["id",C],["orient",D],["markerWidth",K.toString()],["markerHeight",re.toString()],["refX",J.toString()],["refY",Re.toString()]]),St.appendChild(ut),St},$.createText=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),C&&$.setAttributes(D,C),D},$.createTSpan=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=C,D&&$.setAttributes(K,D),K},$.createImage=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&$.setAttributes(D,C),D},$.createPoint=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=C,K.y=D,K},$.createPath=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",C),D&&$.setAttributes(K,D),K},$}(),He=function(){function $(){}return $.addKey=function(C){$.key=C},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),ct=function(){function $(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return $.prototype.rasterize=function(C,D,K){var re=this;return new Promise(function(J){var Re=K!==void 0?K:document.createElement("canvas");C===null&&(re.markersOnly=!0,re.naturalSize=!1);var ut=document.createElementNS("http://www.w3.org/2000/svg","svg");ut.setAttribute("xmlns","http://www.w3.org/2000/svg"),ut.setAttribute("width",D.width.baseVal.valueAsString),ut.setAttribute("height",D.height.baseVal.valueAsString),ut.setAttribute("viewBox","0 0 "+D.viewBox.baseVal.width.toString()+" "+D.viewBox.baseVal.height.toString()),ut.innerHTML=D.innerHTML,re.naturalSize===!0?(ut.width.baseVal.value=C.naturalWidth,ut.height.baseVal.value=C.naturalHeight):re.width!==void 0&&re.height!==void 0&&(ut.width.baseVal.value=re.width,ut.height.baseVal.value=re.height),Re.width=ut.width.baseVal.value,Re.height=ut.height.baseVal.value;var St=ut.outerHTML,Yt=Re.getContext("2d");re.markersOnly!==!0&&Yt.drawImage(C,0,0,Re.width,Re.height);var dt=window.URL,Gt=new Image(Re.width,Re.height);Gt.setAttribute("crossOrigin","anonymous");var sn=new Blob([St],{type:"image/svg+xml"}),Wn=dt.createObjectURL(sn);Gt.onload=function(){Yt.drawImage(Gt,0,0),dt.revokeObjectURL(Wn);var Si=Re.toDataURL(re.imageType,re.imageQuality);J(Si)},Gt.src=Wn})},$}(),vt=function(){},_t=function(){function $(C){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},$.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new yt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new yt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new yt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new et("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new et("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),yt=function($,C){this.selector=$,this.style=C},et=function($,C){this.localName=$,this.style=C},ht=function(){function $(C,D,K,re,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=C,this.displayMode=D,this.markerItems=K,this.uiStyleSettings=re,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return $.prototype.show=function(C){var D=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(J){var Re=document.createElement("div");Re.className=""+D.toolbarButtonStyleClass.name,Re.setAttribute("data-type-name",J.typeName),Re.innerHTML=J.icon,Re.addEventListener("click",function(){D.markerToolbarButtonClicked(Re,J)}),D.buttons.push(Re),D.markerButtons.push(Re)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(C){this.buttonClickListeners.push(C)},$.prototype.removeButtonClickListener=function(C){this.buttonClickListeners.indexOf(C)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(C),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var C=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var D=0;D<this.markerButtons.length;D++)D<C||D===C&&this.markerButtons.length-1===C?this.markerButtonBlock.appendChild(this.markerButtons[D]):(D===C&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[D]))}},$.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},$.prototype.resetButtonStyles=function(){var C=this;this.buttons.forEach(function(D){D.className=D.className.replace(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name,"").trim(),D.className=D.className.replace(C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:C.toolbarActiveButtonStyleColorsClass.name,"").trim(),D.className+=" "+(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name)})},$.prototype.addActionButton=function(C,D,K){var re=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=D,J.setAttribute("data-action",K),J.addEventListener("click",function(){re.actionToolbarButtonClicked(J,K)}),K){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}C.appendChild(J),this.buttons.push(J)},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new et("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new et("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new et("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new et("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new et("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new et("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new et("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new et("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new yt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new yt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},$.prototype.markerToolbarButtonClicked=function(C,D){this.setActiveButton(C),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(C,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(C){this.resetButtonStyles(),C.className=C.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),C.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(C){var D=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===C});D&&this.setActiveButton(D)},$.prototype.setCurrentMarker=function(C){var D=this;this.currentMarker=C,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){D.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},$}(),xt=function(){function $(C,D,K,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=C,this.displayMode=D,this.uiStyleSettings=K,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var C;this.toolboxStyleClass=this.styles.addClass(new et("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 et("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new et("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new et("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new et("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 et("toolbox-panel-row_colors",`
background-color: `+((C=this.uiStyleSettings.toolboxBackgroundColor)!==null&&C!==void 0?C:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new et("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
padding: `+D+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new et("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new et("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new yt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new yt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},$.prototype.show=function(C){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(C){var D,K,re=this;this.panels=C,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var Re;J.uiStyleSettings=re.uiStyleSettings;var ut=document.createElement("div");ut.className=re.toolboxButtonStyleClass.name+" "+((Re=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Re!==void 0?Re:re.toolboxButtonStyleColorsClass.name),ut.innerHTML=J.icon,ut.title=J.title,ut.addEventListener("click",function(){re.panelButtonClick(J)}),re.panelButtons.push(ut),re.buttonRow.appendChild(ut)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(C){var D=this,K=-1;if(C!==this.activePanel){K=this.panels.indexOf(C),this.panelRow.innerHTML="";var re=C.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),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=C}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,Re){var ut,St;J.className=D.toolboxButtonStyleClass.name+" "+(Re===K?""+((ut=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ut!==void 0?ut:D.toolboxActiveButtonStyleColorsClass.name):""+((St=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:D.toolboxButtonStyleColorsClass.name))})},$}(),Tt=function($,C){this.title=$,this.icon=C},mt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Re.colors=[],Re.addTransparent=!1,Re.colorBoxes=[],Re.colors=K,Re.currentColor=re,Re.setCurrentColor=Re.setCurrentColor.bind(Re),Re.getColorBox=Re.getColorBox.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(re){var J=D.getColorBox(re);K.appendChild(J),D.colorBoxes.push(J)}),K},C.prototype.getColorBox=function(D){var K=this,re=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-re,Re=document.createElement("div");Re.style.display="inline-block",Re.style.boxSizing="content-box",Re.style.width=J-2+"px",Re.style.height=J-2+"px",Re.style.padding="1px",Re.style.marginRight="2px",Re.style.marginBottom="2px",Re.style.borderWidth="2px",Re.style.borderStyle="solid",Re.style.borderRadius=(J+2)/2+"px",Re.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Re.addEventListener("click",function(){K.setCurrentColor(D,Re)});var ut=document.createElement("div");return ut.style.display="inline-block",ut.style.width=J-2+"px",ut.style.height=J-2+"px",ut.style.backgroundColor=D,ut.style.borderRadius=J/2+"px",D==="transparent"&&(ut.style.fill=this.uiStyleSettings.toolboxAccentColor,ut.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Re.appendChild(ut),Re},C.prototype.setCurrentColor=function(D,K){var re=this;this.currentColor=D,this.colorBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},C}(Tt),Ie=function(){function $(C,D,K){this._state="new",this._isSelected=!1,this._container=C,this._overlayContainer=D,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(C){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(C,D){},$.prototype.dblClick=function(C,D){},$.prototype.manipulate=function(C){},$.prototype.pointerUp=function(C){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(C){this.container.childNodes.length>0?this.container.insertBefore(C,this.container.childNodes[0]):this.container.appendChild(C)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(C){this._state=C.state,this.notes=C.notes},$.prototype.scale=function(C,D){},$.prototype.colorChanged=function(C){this.onColorChanged&&this.onColorChanged(C),this.stateChanged()},$.prototype.fillColorChanged=function(C){this.onFillColorChanged&&this.onFillColorChanged(C),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var C=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),C.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(C)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),je=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(C){return this.topLeft.ownsTarget(C)?this.topLeft:this.topCenter.ownsTarget(C)?this.topCenter:this.topRight.ownsTarget(C)?this.topRight:this.centerLeft.ownsTarget(C)?this.centerLeft:this.centerRight.ownsTarget(C)?this.centerRight:this.bottomLeft.ownsTarget(C)?this.bottomLeft:this.bottomCenter.ownsTarget(C)?this.bottomCenter:this.bottomRight.ownsTarget(C)?this.bottomRight:void 0},$}(),$e=function(){function $(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},$}(),at=function(){function $(){}return $.toITransformMatrix=function(C){return{a:C.a,b:C.b,c:C.c,d:C.d,e:C.e,f:C.f}},$.toSVGMatrix=function(C,D){return C.a=D.a,C.b=D.b,C.c=D.c,C.d=D.d,C.e=D.e,C.f=D.f,C},$}(),lt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(ge.createTransform()),J.setupControlBox(),J}return Oe(C,$),Object.defineProperty(C.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"visual",{get:function(){return this._visual},set:function(D){this._visual=D;var K=ge.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(D);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Re=this.container.transform.baseVal.getItem(0);Re.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Re,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},C.prototype.pointerUp=function(D){var K=this.state;$.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},C.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},C.prototype.manipulate=function(D){var K=this.unrotatePoint(D);this.state==="creating"?this.resize(D):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(D)},C.prototype.resize=function(D){var K=this.manipulationStartLeft,re=this.manipulationStartWidth,J=this.manipulationStartTop,Re=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+D.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+D.y-this.manipulationStartY,Re=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Re=this.manipulationStartHeight+D.y-this.manipulationStartY}re>=0?(this.left=K,this.width=re):(this.left=K+re,this.width=-re),Re>=0?(this.top=J,this.height=Re):(this.top=J+Re,this.height=-Re),this.setSize()},C.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},C.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var K=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},C.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},C.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var K=this.container.getCTM(),re=ge.createPoint(D.x,D.y);return{x:(re=re.matrixTransform(K)).x,y:re.y}},C.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var K=this.container.getCTM();K=K.inverse();var re=ge.createPoint(D.x,D.y);return{x:(re=re.matrixTransform(K)).x,y:re.y}},C.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var D=ge.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=ge.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=ge.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 je,this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,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()},C.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()},C.prototype.createGrip=function(){var D=new $e;return D.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(D.visual),D},C.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,K=-D/2,re=K,J=(this.width+this.CB_DISTANCE)/2-D/2,Re=(this.height+this.CB_DISTANCE)/2-D/2,ut=this.height+this.CB_DISTANCE-D/2,St=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,K,re),this.positionGrip(this.controlGrips.topCenter.visual,J,re),this.positionGrip(this.controlGrips.topRight.visual,St,re),this.positionGrip(this.controlGrips.centerLeft.visual,K,Re),this.positionGrip(this.controlGrips.centerRight.visual,St,Re),this.positionGrip(this.controlGrips.bottomLeft.visual,K,ut),this.positionGrip(this.controlGrips.bottomCenter.visual,J,ut),this.positionGrip(this.controlGrips.bottomRight.visual,St,ut),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,re-3*this.CB_DISTANCE)},C.prototype.positionGrip=function(D,K,re){var J=D.transform.baseVal.getItem(0);J.setTranslate(K,re),D.transform.baseVal.replaceItem(J,0)},C.prototype.hideControlBox=function(){this.controlBox.style.display="none"},C.prototype.showControlBox=function(){this.controlBox.style.display=""},C.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K);var re=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:re.x*D,y:re.y*K});this.left=J.x,this.top=J.y,this.width=this.width*D,this.height=this.height*K,this.adjustControlBox()},C}(Ie),bt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},C.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},C.prototype.setSize=function(){$.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},C.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){var K=D;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setSize()},C.title="Rectangle marker",C}(lt),Mt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Re.widths=[],Re.widthBoxes=[],Re.widths=K,Re.currentWidth=re,Re.setCurrentWidth=Re.setCurrentWidth.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=re===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentWidth(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.innerText=re.toString(),Re.style.marginRight="5px",J.appendChild(Re);var ut=document.createElement("div");ut.style.minHeight="20px",ut.style.flexGrow="2",ut.style.display="flex",ut.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=re+"px solid "+D.uiStyleSettings.toolboxColor,St.style.flexGrow="2",ut.appendChild(St),J.appendChild(ut),D.widthBoxes.push(J)}),K},C.prototype.setCurrentWidth=function(D,K){var re=this;this.currentWidth=D,this.widthBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},C}(Tt),jt=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Re.styles=[],Re.styleBoxes=[],Re.styles=K,Re.currentStyle=re,Re.setCurrentStyle=Re.setCurrentStyle.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/D.styles.length-5+"%",J.style.borderColor=re===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentStyle(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.overflow="hidden";var ut=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+D.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(re!==""?'stroke-dasharray="'+re+'"':"")+` />
</svg>`;Re.innerHTML=ut,J.appendChild(Re),D.styleBoxes.push(J)}),K},C.prototype.setCurrentStyle=function(D,K){var re=this;this.currentStyle=D,this.styleBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},C}(Tt),Me=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="FrameMarker",C.title="Frame marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',C}(bt),Pe=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},tt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.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(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},C.prototype.pointerUp=function(D){var K=this.state;$.prototype.pointerUp.call(this,D),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(D),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},C.prototype.adjustVisual=function(){},C.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},C.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},C.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){this.positionGrips()},C.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},C.prototype.createGrip=function(){var D=new $e;return D.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(D.visual),D},C.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},C.prototype.positionGrip=function(D,K,re){var J=D.transform.baseVal.getItem(0);J.setTranslate(K,re),D.transform.baseVal.replaceItem(J,0)},C.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.x1=this.x1*D,this.y1=this.y1*K,this.x2=this.x2*D,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},C}(Ie),rt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},C.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()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},C.typeName="LineMarker",C.title="Line marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',C}(tt),Fe=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Re.fonts=[],Re.fontBoxes=[],Re.fonts=K,Re.currentFont=re,Re.setCurrentFont=Re.setCurrentFont.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(re){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/D.fonts.length-5+"%",J.style.borderColor=re===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentFont(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.style.display="flex",Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.fontFamily=re,Re.style.overflow="hidden";var ut=document.createElement("div");ut.style.whiteSpace="nowrap",ut.style.overflow="hidden",ut.style.textOverflow="ellipsis",ut.innerHTML="The quick brown fox jumps over the lazy dog",Re.appendChild(ut),J.appendChild(Re),D.fontBoxes.push(J)}),K},C.prototype.setCurrentFont=function(D,K){var re=this;this.currentFont=D,this.fontBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},C}(Tt),Je=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=re.defaultColor,J.fontFamily=re.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new mt("Color",re.defaultColorSet,re.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new Fe("Font",re.defaultFontFamilies,re.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return Oe(C,$),C.prototype.ownsTarget=function(D){if($.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(re){re===D&&(K=!0)}),K},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},C.prototype.renderText=function(){var D=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(K){D.textElement.appendChild(ge.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},C.prototype.getTextScale=function(){var D=this.textElement.getBBox(),K=1;if(D.width>0&&D.height>0){var re=(1*this.width-this.width*this.padding*2/100)/D.width,J=(1*this.height-this.height*this.padding*2/100)/D.height;K=Math.min(re,J)}return K},C.prototype.getTextPosition=function(D){var K=this.textElement.getBBox(),re=0,J=0;return K.width>0&&K.height>0&&(re=(this.width-K.width*D)/2,J=this.height/2-K.height*D/2),{x:re,y:J}},C.prototype.sizeText=function(){var D=this.textElement.getBBox(),K=this.getTextScale(),re=this.getTextPosition(K);re.y-=D.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},C.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},C.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},C.prototype.pointerUp=function(D){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,D),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},C.prototype.showTextEditor=function(){var D=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(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&K>.9;)K-=.1,D.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var re=K.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(re)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},C.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),J={x:re.width*D,y:re.height*D};K.x-=J.x/2,K.y-=J.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*D,12)+"px",this.textElement.style.display="none"}},C.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},C.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},C.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},C.prototype.dblClick=function(D,K){$.prototype.dblClick.call(this,D,K),this.showTextEditor()},C.prototype.setColor=function(D){this.textElement&&ge.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},C.prototype.setFont=function(D){this.textElement&&ge.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},C.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},C.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){var K=D;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setSize(),this.sizeText(),this.positionTextEditor()},C.typeName="TextMarker",C.title="Text marker",C.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',C}(lt),Ee=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=re.defaultColor,J.lineWidth=re.defaultStrokeWidth,J.pixelRatio=re.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new mt("Color",re.defaultColorSet,re.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var D=ge.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(D,K){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(D.x,D.y),this.drawing=!0):$.prototype.pointerDown.call(this,D,K)},C.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,D)},C.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)},C.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},C.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},C.prototype.finishCreation=function(){for(var D=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=K[0],J=K[1],Re=K[2],ut=K[3],St=!1,Yt=0;Yt<this.canvasElement.height;Yt++)for(var dt=0;dt<this.canvasElement.width;dt++)D.data[Yt*this.canvasElement.width*4+4*dt+3]>0&&(St=!0,Yt<J&&(J=Yt),dt<re&&(re=dt),Yt>ut&&(ut=Yt),dt>Re&&(Re=dt));if(St){this.left=re/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(Re-re)/this.pixelRatio,this.height=(ut-J)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=Re-re,Gt.height=ut-J,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(re,J,Re-re,ut-J),0,0),this.drawingImgUrl=Gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},C.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},C.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},C.prototype.setLineWidth=function(D){this.lineWidth=D},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){this.createVisual(),$.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setDrawingImage()},C.typeName="FreehandMarker",C.title="Freehand marker",C.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',C}(lt),ye=function($){function C(D,K,re){var J=$.call(this,D,re||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=K,J.setCurrentType=J.setCurrentType.bind(J),J}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var re=function(ut){var St="both";switch(ut){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Yt=document.createElement("div");if(Yt.style.display="flex",Yt.style.flexGrow="2",Yt.style.alignItems="center",Yt.style.justifyContent="space-between",Yt.style.padding="5px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderColor=St===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){D.setCurrentType(St,Yt)}),K.appendChild(Yt),St==="both"||St==="start"){var dt=document.createElement("div");dt.style.display="flex",dt.style.alignItems="center",dt.style.minHeight="20px",dt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,dt.style.marginLeft="5px",Yt.appendChild(dt)}var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.style.flexGrow="2";var sn=document.createElement("hr");if(sn.style.minWidth="20px",sn.style.border="0px",sn.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),sn.style.flexGrow="2",Gt.appendChild(sn),Yt.appendChild(Gt),St==="both"||St==="end"){var Wn=document.createElement("div");Wn.style.display="flex",Wn.style.alignItems="center",Wn.style.minHeight="20px",Wn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Wn.style.marginRight="5px",Yt.appendChild(Wn)}J.typeBoxes.push(Yt)},J=this,Re=0;Re<4;Re++)re(Re);return K},C.prototype.setCurrentType=function(D,K){var re=this;this.currentType=D,this.typeBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},C}(Tt),_e=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ye("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},C.prototype.getArrowPoints=function(D,K){var re=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return D-re/2+","+(K+J/2)+" "+D+","+(K-J/2)+" "+(D+re/2)+","+(K+J/2)},C.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if($.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",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},C.prototype.setArrowType=function(D){this.arrowType=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},C.typeName="ArrowMarker",C.title="Arrow marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',C}(rt),le=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.fillColor=re.defaultFillColor,J.strokeWidth=0,J.fillPanel=new mt("Color",re.defaultColorSet,re.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="CoverMarker",C.title="Cover marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',C}(bt),de=function($){function C(D,K,re,J){var Re=$.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Re.opacities=[],Re.opacityBoxes=[],Re.opacities=K,Re.currentOpacity=re,Re.setCurrentOpacity=Re.setCurrentOpacity.bind(Re),Re}return Oe(C,$),C.prototype.getUi=function(){var D=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(re){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=re===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){D.setCurrentOpacity(re,J)}),K.appendChild(J);var Re=document.createElement("div");Re.innerText=100*re+"%",J.appendChild(Re),D.opacityBoxes.push(J)}),K},C.prototype.setCurrentOpacity=function(D,K){var re=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===K?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},C}(Tt),ve=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=re.defaultHighlightColor,J.strokeWidth=0,J.opacity=re.defaultHighlightOpacity,J.fillPanel=new mt("Color",re.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new de("Opacity",re.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Oe(C,$),C.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="HighlightMarker",C.title="Highlight marker",C.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',C}(le),pe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ce=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=re.defaultStrokeColor,J.bgColor=re.defaultFillColor,J.fontFamily=re.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new mt("Text color",re.defaultColorSet,J.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new mt("Fill color",re.defaultColorSet,J.bgColor,pe),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new Fe("Font",re.defaultFontFamilies,re.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new $e,J.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return Oe(C,$),C.prototype.ownsTarget=function(D){return $.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},C.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},C.prototype.pointerDown=function(D,K){this.state==="new"&&$.prototype.pointerDown.call(this,D,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,D,K)},C.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,D);else{var K=this.state==="creating";$.prototype.pointerUp.call(this,D),this.setTipPoints(K),this.positionTip()}},C.prototype.manipulate=function(D){if(this.tipMoving){var K=this.unrotatePoint(D);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,D)},C.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",D]]),ge.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},C.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},C.prototype.setTipPoints=function(D){D===void 0&&(D=!1);var K=Math.min(this.height/2,15),re=this.height/5;D&&(this.tipPosition={x:K+re/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(re=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+re,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(re=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-re,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(re=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-re,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-re},this.tipBase2Position={x:this.width,y:this.height-K}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(re=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+re,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-re})},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.positionTip()},C.prototype.positionTip=function(){ge.setAttributes(this.tip,[["points",this.getTipPoints()]]);var D=this.tipGrip.visual.transform.baseVal.getItem(0);D.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(D,0)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.select=function(){this.positionTip(),$.prototype.select.call(this)},C.prototype.getState=function(){var D=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){var K=D;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,$.prototype.restoreState.call(this,D),this.createTip(),this.setTipPoints()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.tipPosition={x:this.tipPosition.x*D,y:this.tipPosition.y*K},this.positionTip()},C.typeName="CalloutMarker",C.title="Callout marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',C}(Je),Ke=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.fillColor=re.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new mt("Line color",be(re.defaultColorSet,["transparent"]),re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new mt("Fill color",be(re.defaultColorSet,["transparent"]),J.fillColor,pe),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new de("Opacity",re.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},C.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},C.prototype.setSize=function(){$.prototype.setSize.call(this),ge.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},C.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},C.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(D),this.stateChanged()},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){var K=D;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},C.prototype.scale=function(D,K){$.prototype.scale.call(this,D,K),this.setSize()},C.typeName="EllipseMarker",C.title="Ellipse marker",C.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',C}(lt),st=function($){function C(D,K,re){return $.call(this,D,K,re)||this}return Oe(C,$),Object.defineProperty(C.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.tip1&&D!==this.tip2)},C.prototype.createTips=function(){this.tip1=ge.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.tip2)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if($.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ge.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(D+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D),this.createTips(),this.adjustVisual()},C.typeName="MeasurementMarker",C.title="Measurement marker",C.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',C}(rt),At=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokePanel.colors=re.defaultColorSet,J.fillColor="transparent",J}return Oe(C,$),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=C.typeName,D},C.typeName="EllipseFrameMarker",C.title="Ellipse frame marker",C.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',C}(Ke),Ft=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(C){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(C)||(this.undoStack.push(C),JSON.stringify(this.lastRedoStep)!==JSON.stringify(C)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(C){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=C)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var C=this.undoStack.pop();return C!==void 0&&this.redoStack.push(C),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),kt=function($){function C(D,K,re){var J=$.call(this,D,K,re)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=re.defaultColor,J.strokeWidth=re.defaultStrokeWidth,J.strokeDasharray=re.defaultStrokeDasharray,J.strokePanel=new mt("Line color",re.defaultColorSet,re.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new Mt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new jt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Oe(C,$),C.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},C.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.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)},C.prototype.pointerDown=function(D,K){$.prototype.pointerDown.call(this,D,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},C.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.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)},C.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},C.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/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()))},C.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),$.prototype.manipulate.call(this,D)},C.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),$.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},C.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},C.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},C.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},C.prototype.scale=function(D,K){this.curveX=this.curveX*D,this.curveY=this.curveY*K,$.prototype.scale.call(this,D,K)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return D.typeName=C.typeName,D},C.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var K=D;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},C.typeName="CurveMarker",C.title="Curve marker",C.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',C}(tt),wt=function(){function $(C,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=C,this.cancelable=D}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),Qe=function($){function C(D,K,re){var J=$.call(this,D,!1)||this;return J.dataUrl=K,J.state=re,J}return Oe(C,$),C}(wt),it=function($){function C(D,K,re){re===void 0&&(re=!1);var J=$.call(this,D,re)||this;return J.marker=K,J}return Oe(C,$),C}(wt),We=function(){function $(){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 $.prototype.addEventListener=function(C,D){this[C].push(D)},$.prototype.removeEventListener=function(C,D){var K=this[C].indexOf(D);K>-1&&this[C].splice(K,1)},$}(),ce=function(){function $(C){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Pe,this._isOpen=!1,this.undoRedoManager=new Ft,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 We,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new _t(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=C,this.targetRoot=document.body,this.width=C.clientWidth,this.height=C.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($.prototype,"ALL_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,At,Ke,ve,Ce,st,le,rt,kt]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,Ke,ve,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Me,Ee,_e,Je,ve]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(C){var D=this;this._availableMarkerTypes.splice(0),C.forEach(function(K){if(typeof K=="string"){var re=D.ALL_MARKER_TYPES.find(function(J){return J.typeName===K});re!==void 0&&D._availableMarkerTypes.push(re)}else D._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(C){this._zoomLevel=C,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($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),He.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var C=this;this.styles.styleSheetRoot===void 0&&vt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=vt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new wt(C))})},$.prototype.render=function(){return Ue(this,void 0,void 0,function(){var C;return De(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(C=new ct).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.markersOnly=this.renderMarkersOnly,C.width=this.renderWidth,C.height=this.renderHeight,[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return D.sent(),[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},$.prototype.close=function(C){var D=this;if(C===void 0&&(C=!1),this.isOpen){var K=!1;C||this.eventListeners.beforeclose.forEach(function(re){var J=new wt(D,!0);re(J),J.defaultPrevented&&(K=!0)}),K||(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(re){return re(new wt(D))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var C,D=[],K=0;K<arguments.length;K++)D[K]=arguments[K];(C=this._availableMarkerTypes).push.apply(C,D)},$.prototype.addRenderEventListener=function(C){this.addEventListener("render",function(D){C(D.dataUrl,D.state)})},$.prototype.removeRenderEventListener=function(C){},$.prototype.addCloseEventListener=function(C){this.addEventListener("close",function(){C()})},$.prototype.removeCloseEventListener=function(C){},$.prototype.setupResizeObserver=function(){var C=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return C.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupTargetResize=function(){var C=1*this.target.clientWidth/this.target.clientHeight,D=this.editorCanvas.clientWidth/C>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*C:this.editorCanvas.clientWidth,K=D<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/C;this.resize(D,K)},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.resize=function(C,D){this._isResizing=!0;var K=C/this.imageWidth,re=D/this.imageHeight;this.imageWidth=Math.round(C),this.imageHeight=Math.round(D),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(K,re),this._isResizing=!1},$.prototype.scaleMarkers=function(C,D){var K,re=this;this._currentMarker&&this._currentMarker instanceof Je?this._currentMarker.scale(C,D):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==re._currentMarker&&J.scale(C,D)}),K!==void 0&&this.setCurrentMarker(K)},$.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},$.prototype.setTopLeft=function(){var C=this.editingTarget.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=C.left-D.left,this.top=C.top-D.top},$.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},$.prototype.addDefs=function(){for(var C,D=[],K=0;K<arguments.length;K++)D[K]=arguments[K];this.defs=ge.createDefs(),this.addDefsToImage(),(C=this.defs).append.apply(C,D)},$.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},$.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},$.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},$.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},$.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},$.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},$.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},$.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var C=document.createElement("a");C.href="https://markerjs.com/",C.target="_blank",C.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',C.title="Powered by marker.js",C.style.display="grid",C.style.alignItems="center",C.style.justifyItems="center",C.style.padding="3px",C.style.width="20px",C.style.height="20px",this.logoUI.appendChild(C),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.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")},$.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"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.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 C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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 ht(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new xt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},$.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.removeMarker=function(C){this.markerImage.removeChild(C.container),this.markers.indexOf(C)>-1&&this.markers.splice(this.markers.indexOf(C),1),C.dispose()},$.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())},$.prototype.toolbarButtonClicked=function(C,D){if(C==="marker"&&D!==void 0)this.createNewMarker(D);else if(C==="action")switch(D){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()}},$.prototype.deleteSelectedMarker=function(){var C=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var J=new it(C,C._currentMarker,!0);re(J),J.defaultPrevented&&(D=!0)}),!D){var K=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(re){return re(new it(C,K))})}}},$.prototype.clear=function(){var C=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Re){var ut=new it(C,void 0,!0);Re(ut),ut.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var K=function(Re){var ut=re.markers[Re];re.setCurrentMarker(re.markers[Re]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(St){return St(new it(C,ut))})},re=this,J=this.markers.length-1;J>=0;J--)K(J);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var C;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=(C=this._currentMarker.notes)!==null&&C!==void 0?C:"",this.overlayContainer.appendChild(this.notesArea))},$.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)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var C=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===D.width&&K.height===D.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),re<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new wt(C))})}else this.undoRedoManager.replaceLastUndoStep(D),this.eventListeners.statechange.forEach(function(J){return J(new wt(C))})}},$.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},$.prototype.undoStep=function(){var C=this,D=this.undoRedoManager.undo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new wt(C))}))},$.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},$.prototype.redoStep=function(){var C=this,D=this.undoRedoManager.redo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new wt(C))}))},$.prototype.stepZoom=function(){var C=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=C<this.zoomSteps.length-1?this.zoomSteps[C+1]:this.zoomSteps[0]},$.prototype.panTo=function(C){this.contentDiv.scrollBy({left:this.prevPanPoint.x-C.x,top:this.prevPanPoint.y-C.y}),this.prevPanPoint=C},$.prototype.startRenderAndClose=function(){return Ue(this,void 0,void 0,function(){var C,D,K=this;return De(this,function(re){switch(re.label){case 0:return[4,this.render()];case 1:return C=re.sent(),D=this.getState(),this.eventListeners.render.forEach(function(J){return J(new Qe(K,C,D))}),this.close(!0),[2]}})})},$.prototype.getState=function(C){C===!0&&this.setCurrentMarker();var D={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return D.markers.push(K.getState())}),D},$.prototype.restoreState=function(C){var D=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);C.markers.forEach(function(K){var re=D._availableMarkerTypes.find(function(Re){return Re.typeName===K.typeName});if(re!==void 0){var J=D.addNewMarker(re);J.restoreState(K),D.markers.push(J)}}),C.width&&C.height&&(C.width!==this.imageWidth||C.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/C.width,this.imageHeight/C.height),this.eventListeners.restorestate.forEach(function(K){return K(new wt(D))})},$.prototype.addNewMarker=function(C){var D=ge.createGroup();return this.markerImage.appendChild(D),new C(D,this.overlayContainer,this.settings)},$.prototype.createNewMarker=function(C){var D,K=this;(D=typeof C=="string"?this._availableMarkerTypes.find(function(re){return re.typeName===C}):C)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(D),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(D.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(re){return re(new it(K,K._currentMarker))}))},$.prototype.markerCreated=function(C){var D=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(C),this.setCurrentMarker(C),C instanceof Ee&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ee):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new it(D,D._currentMarker))})},$.prototype.colorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=C,this.settings.defaultStrokeColor=C)},$.prototype.fillColorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=C)},$.prototype.markerStateChanged=function(C){var D=this;this.eventListeners.markerchange.forEach(function(K){return K(new it(D,C))})},$.prototype.setCurrentMarker=function(C){var D=this;this._currentMarker!==C&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new it(D,D._currentMarker))})),this._currentMarker=C,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(K){return K(new it(D,D._currentMarker))}))},$.prototype.onPointerDown=function(C){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||C.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var D=this.markers.find(function(K){return K.ownsTarget(C.target)});D!==void 0?(this.setCurrentMarker(D),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:C.clientX,y:C.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY))},$.prototype.onDblClick=function(C){if(this._isFocused||this.focus(),this.mode==="select"){var D=this.markers.find(function(K){return K.ownsTarget(C.target)});D!==void 0&&D!==this._currentMarker&&this.setCurrentMarker(D),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target):this.setCurrentMarker()}},$.prototype.onPointerMove=function(C){this.touchPoints!==1&&C.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||C.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(C.clientX,C.clientY)):this.zoomLevel>1&&this.panTo({x:C.clientX,y:C.clientY}))},$.prototype.onPointerUp=function(C){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(C.clientX,C.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(C){this._currentMarker===void 0||this.notesArea!==void 0||C.key!=="Delete"&&C.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.markerImage.getBoundingClientRect();return{x:(C-K.left)/this.zoomLevel,y:(D-K.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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()},$.prototype.addLicenseKey=function(C){He.addKey(C)},$.prototype.addEventListener=function(C,D){this.eventListeners.addEventListener(C,D)},$.prototype.removeEventListener=function(C,D){this.eventListeners.removeEventListener(C,D)},$.prototype.renderState=function(C){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(C),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var C=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(D){return D(new wt(C))}))},$.prototype.blur=function(){var C=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new wt(C))}))},$.instanceCounter=0,$}();/* **********************************
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 Se=function($,C){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,K){D.__proto__=K}||function(D,K){for(var re in K)Object.prototype.hasOwnProperty.call(K,re)&&(D[re]=K[re])})($,C)};function ot($,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function D(){this.constructor=$}Se($,C),$.prototype=C===null?Object.create(C):(D.prototype=C.prototype,new D)}function ze($,C,D,K){return new(D||(D=Promise))(function(re,J){function Re(Yt){try{St(K.next(Yt))}catch(dt){J(dt)}}function ut(Yt){try{St(K.throw(Yt))}catch(dt){J(dt)}}function St(Yt){var dt;Yt.done?re(Yt.value):(dt=Yt.value,dt instanceof D?dt:new D(function(Gt){Gt(dt)})).then(Re,ut)}St((K=K.apply($,C||[])).next())})}function Lt($,C){var D,K,re,J,Re={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return J={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function ut(St){return function(Yt){return function(dt){if(D)throw new TypeError("Generator is already executing.");for(;Re;)try{if(D=1,K&&(re=2&dt[0]?K.return:dt[0]?K.throw||((re=K.return)&&re.call(K),0):K.next)&&!(re=re.call(K,dt[1])).done)return re;switch(K=0,re&&(dt=[2&dt[0],re.value]),dt[0]){case 0:case 1:re=dt;break;case 4:return Re.label++,{value:dt[1],done:!1};case 5:Re.label++,K=dt[1],dt=[0];continue;case 7:dt=Re.ops.pop(),Re.trys.pop();continue;default:if(!(re=Re.trys,(re=re.length>0&&re[re.length-1])||dt[0]!==6&&dt[0]!==2)){Re=0;continue}if(dt[0]===3&&(!re||dt[1]>re[0]&&dt[1]<re[3])){Re.label=dt[1];break}if(dt[0]===6&&Re.label<re[1]){Re.label=re[1],re=dt;break}if(re&&Re.label<re[2]){Re.label=re[2],Re.ops.push(dt);break}re[2]&&Re.ops.pop(),Re.trys.pop();continue}dt=C.call($,Re)}catch(Gt){dt=[6,Gt],K=0}finally{D=re=0}if(5&dt[0])throw dt[1];return{value:dt[0]?dt[1]:void 0,done:!0}}([St,Yt])}}}var Dt=function(){function $(){}return $.addKey=function(C){$.key=C},Object.defineProperty($,"isLicensed",{get:function(){return!!$.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test($.key)},enumerable:!1,configurable:!0}),$}(),ke=function(){function $(){}return $.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},$.setAttributes=function(C,D){for(var K=0,re=D;K<re.length;K++){var J=re[K],Re=J[0],ut=J[1];C.setAttribute(Re,ut)}},$.createRect=function(C,D,K){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",C.toString()),re.setAttribute("height",D.toString()),K&&$.setAttributes(re,K),re},$.createLine=function(C,D,K,re,J){var Re=document.createElementNS("http://www.w3.org/2000/svg","line");return Re.setAttribute("x1",C.toString()),Re.setAttribute("y1",D.toString()),Re.setAttribute("x2",K.toString()),Re.setAttribute("y2",re.toString()),J&&$.setAttributes(Re,J),Re},$.createPolygon=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",C),D&&$.setAttributes(K,D),K},$.createCircle=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(C/2).toString()),K.setAttribute("cy",(C/2).toString()),K.setAttribute("r",C.toString()),D&&$.setAttributes(K,D),K},$.createEllipse=function(C,D,K){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(C/2).toString()),re.setAttribute("cy",(D/2).toString()),re.setAttribute("rx",(C/2).toString()),re.setAttribute("ry",(D/2).toString()),K&&$.setAttributes(re,K),re},$.createGroup=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&$.setAttributes(D,C),D},$.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},$.createMarker=function(C,D,K,re,J,Re,ut){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return $.setAttributes(St,[["id",C],["orient",D],["markerWidth",K.toString()],["markerHeight",re.toString()],["refX",J.toString()],["refY",Re.toString()]]),St.appendChild(ut),St},$.createText=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),C&&$.setAttributes(D,C),D},$.createTSpan=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=C,D&&$.setAttributes(K,D),K},$.createImage=function(C){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&$.setAttributes(D,C),D},$.createPoint=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=C,K.y=D,K},$.createPath=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",C),D&&$.setAttributes(K,D),K},$.createElement=function(C,D){var K=document.createElementNS("http://www.w3.org/2000/svg",C);return D&&$.setAttributes(K,D),K},$.getHollowRectanglePath=function(C,D,K,re,J,Re,ut,St){return"M"+C+","+D+"V"+(D+re)+"H"+(C+K)+"V"+D+"H"+J+"V"+Re+"H"+(J+ut)+"V"+(Re+St)+"H"+J+"V"+D+"Z"},$}(),qe=function(){function $(C){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty($.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),$.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},$.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},$.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new Rt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Pt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Pt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},$.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},$}(),Rt=function($,C){this.selector=$,this.style=C},Pt=function($,C){this.localName=$,this.style=C},$t=function(){function $(){this.blocks=[],this.display=""}return $.prototype.addButtonBlock=function(C){C.className=this.blockClassName,C.buttonClassName=this.buttonClassName,C.buttonColorsClassName=this.buttonColorsClassName,C.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(C)},$.prototype.addElementBlock=function(C){C.className===void 0&&(C.className=this.blockClassName),this.blocks.push(C)},$.prototype.getUI=function(){var C=document.createElement("div");return C.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,C.style.display=this.display,this.blocks.forEach(function(D){return C.appendChild(D.getUI())}),C},$}(),fe=function(){function $(){}return $.prototype.getUI=function(){var C=document.createElement("div");if(C.className=this.className,this.minWidth!==void 0&&(C.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":C.style.justifyContent="flex-start";break;case"center":C.style.justifyContent="center";break;case"end":C.style.justifyContent="flex-end"}return C.style.whiteSpace="nowrap",C},$}(),se=function($){function C(){var D=$!==null&&$.apply(this,arguments)||this;return D.buttons=[],D}return ot(C,$),C.prototype.addButton=function(D){D.className=this.buttonClassName,D.colorsClassName=this.buttonColorsClassName,D.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(D)},C.prototype.getUI=function(){var D=$.prototype.getUI.call(this);return this.buttons.forEach(function(K){return D.appendChild(K.getUI())}),D},C}(fe),U=function(){function $(C,D){this._isActive=!1,this._isHidden=!1,this._icon=C,this.title=D,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty($.prototype,"icon",{get:function(){return this._icon},set:function(C){this._icon=C,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isActive",{get:function(){return this._isActive},set:function(C){this._isActive=C,this.adjustClassName()},enumerable:!1,configurable:!0}),$.prototype.getUI=function(){var C=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return C.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},$.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},$.prototype.hide=function(){this._isHidden=!0},$}(),G=function($){function C(){var D=$!==null&&$.apply(this,arguments)||this;return D.elements=[],D}return ot(C,$),C.prototype.addElement=function(D){this.elements.push(D)},C.prototype.getUI=function(){var D=$.prototype.getUI.call(this);return this.elements.forEach(function(K){return D.appendChild(K)}),D},C}(fe),Q=function(){function $(C,D){this.horizontal=C,this.vertical=D}return Object.defineProperty($.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),$.prototype.getVerticalLength=function(C){return C/this.ratio},$.prototype.getHorizontalLength=function(C){return C*this.ratio},$}(),te=function(){function $(){}return $.getIcon=function(C,D){if(C>0&&D>0){var K=new Q(C,D),re=K.ratio>=1?20:K.getHorizontalLength(20),J=K.ratio<1?20:K.getVerticalLength(20),Re=document.createElementNS("http://www.w3.org/2000/svg","svg");Re.setAttribute("xmlns","http://www.w3.org/2000/svg"),Re.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Re);var ut=ke.createDefs();Re.appendChild(ut);var St=ke.createElement("clipPath",[["id","text-bg-clip"]]);ut.appendChild(St);var Yt=ke.createPath(ke.getHollowRectanglePath((24-re)/2,(24-J)/2,re,J,(24-re)/2+2,(24-J)/2+2,re-4,J-4));Re.appendChild(Yt);var dt=ke.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);dt.appendChild(ke.createTSpan(C+":"+D)),Re.appendChild(dt);var Gt=dt.getBBox();ke.setAttributes(dt,[["x",((24-Gt.width)/2).toString()],["y",((24-Gt.height)/2-Gt.y).toString()]]);var sn=ke.createPath(ke.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Gt.width))/2,(24-Math.ceil(Gt.height))/2,Math.ceil(Gt.width),Math.ceil(Gt.height)));return St.appendChild(sn),ke.setAttributes(Yt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Re),Re.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},$}(),he=function($){function C(D,K,re){var J=$.call(this,D,K)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=re,J}return ot(C,$),C.prototype.setupDropdown=function(){var D=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(K){K.className=D.className,K.colorsClassName=D.colorsClassName,D.dropdownBlock.appendChild(K.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},C.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},C.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},C.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},C.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},C.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},C}(U),Le=function(){function $(C,D){this.GRIP_SIZE=10,this.color=C,this.fillColor=D,this.visual=ke.createGroup(),this.visual.appendChild(ke.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ke.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},$.prototype.setCenter=function(C,D){this.visual.childNodes.forEach(function(K){return ke.setAttributes(K,[["cx",C.toString()],["cy",D.toString()]])})},$}(),Ge=function(){function $(C,D,K,re){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=C,this.canvasHeight=D,this.margin=K,this.container=re,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($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(C){this._aspectRatio=C,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.gridContainer&&ke.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(C){this._zoomFactor=C,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var C=this;this.cropShadeElement=ke.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ke.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var D=0;D<this.numberOfGridLines;D++)this.horizontalGridLines.push(ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(K){return C.gridContainer.appendChild(K)}),this.verticalGridLines.forEach(function(K){return C.gridContainer.appendChild(K)}),this.cropRectElement=ke.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Le(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Le(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Le(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Le(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},$.prototype.setCropRectangle=function(C){this.cropRect=C;var D=Object.assign({},this.cropRect);this.zoomFactor!==1&&(D.width=this.cropRect.width*this.zoomFactor,D.height=this.cropRect.height*this.zoomFactor,D.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-D.width/2,D.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-D.height/2),ke.setAttributes(this.cropRectElement,[["x",D.x.toString()],["y",D.y.toString()],["width",D.width.toString()],["height",D.height.toString()]]);var K=D.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,Re){var ut=D.y+K*(Re+1);ke.setAttributes(J,[["x1",""+D.x],["y1",""+ut],["x2",""+(D.x+D.width)],["y2",""+ut]])});var re=D.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,Re){var ut=D.x+re*(Re+1);ke.setAttributes(J,[["x1",""+ut],["y1",""+D.y],["x2",""+ut],["y2",""+(D.y+D.height)]])}),ke.setAttributes(this.cropShadeElement,[["d",ke.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,D.x,D.y,D.width,D.height)]]),this.topLeftGrip.setCenter(D.x,D.y),this.topRightGrip.setCenter(D.x+D.width,D.y),this.bottomLeftGrip.setCenter(D.x,D.y+D.height),this.bottomRightGrip.setCenter(D.x+D.width,D.y+D.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.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)},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.container.getBoundingClientRect();return{x:C-K.left+this.margin,y:D-K.top+this.margin}},$.prototype.onPointerDown=function(C){this.container.setPointerCapture(C.pointerId),this.previousPoint=this.clientToLocalCoordinates(C.clientX,C.clientY),this.cropRectElement===C.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(C.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(C.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(C.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(C.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(C){if(this.isMoving)this.move(this.clientToLocalCoordinates(C.clientX,C.clientY));else if(this.activeGrip){var D=this.clientToLocalCoordinates(C.clientX,C.clientY);this.resize(D)}C.preventDefault()},$.prototype.onPointerUp=function(C){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(C.pointerId)},$.prototype.move=function(C){var D=C.x-this.previousPoint.x,K=C.y-this.previousPoint.y;this.zoomFactor!==1&&(D=-D/this.zoomFactor,K=-K/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+D),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+K),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=C},$.prototype.resize=function(C){var D=Object.assign({},this.cropRect),K=C.x-this.previousPoint.x,re=C.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:D.x+K<this.margin&&(K=this.margin-D.x),D.x+=K,D.width=this.cropRect.x+this.cropRect.width-D.x;break;case this.bottomRightGrip:case this.topRightGrip:D.width+K>this.canvasWidth*this.zoomFactor&&(K=this.canvasWidth*this.zoomFactor-D.width),D.width+=K}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(D.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(K),D.height=this.aspectRatio.getVerticalLength(D.width)):(D.y+=re,D.height=this.cropRect.y+this.cropRect.height-D.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?D.height=this.aspectRatio.getVerticalLength(D.width):D.height+=re}D.width<10&&(D.x=this.cropRect.x,D.width=10),D.height<10&&(D.y=this.cropRect.y,D.height=10),this.previousPoint=C,D.x>=this.margin&&D.y>=this.margin&&D.x-this.margin+D.width<=this.canvasWidth&&D.y-this.margin+D.height<=this.canvasHeight&&(this.cropRect=D,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var C=this.cropRect.x+this.cropRect.width/2,D=this.cropRect.y+this.cropRect.height/2,K=this.aspectRatio.getHorizontalLength(this.cropRect.height),re=this.aspectRatio.getVerticalLength(this.cropRect.width);K/this.canvasWidth<re/this.canvasHeight?this.cropRect.width=K:this.cropRect.height=re,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=C-this.cropRect.width/2,this.cropRect.y=D-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)}},$.prototype.getRescaledRect=function(C,D,K,re,J,Re){var ut=K/C,St=re/D;return{x:(J.x-Re)*ut+Re,y:(J.y-Re)*St+Re,width:J.width*ut,height:J.height*St}},$.prototype.scaleCanvas=function(C,D){var K=this.getRescaledRect(this.canvasWidth,this.canvasHeight,C,D,this.cropRect,this.margin);this.canvasWidth=C,this.canvasHeight=D,this.onCropChange&&this.onCropChange(K),this.setCropRectangle(K)},$}(),Ot=function(){function $(C){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=C,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($.prototype,"angle",{get:function(){return this._angle},set:function(C){this._angle=C,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.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},$.prototype.onPointerDown=function(C){this.controlContainer.setPointerCapture(C.pointerId),this.isDragging=!0,this.previousPoint={x:C.clientX,y:C.clientY}},$.prototype.onPointerMove=function(C){this.isDragging&&(this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.previousPoint.x=C.clientX)},$.prototype.onPointerUp=function(C){this.isDragging&&this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(C.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var C=this.angleLabelText.getBBox();ke.setAttributes(this.angleLabelElement,[["x",((this.width-C.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var C=this.scaleShape.transform.baseVal.getItem(0);C.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(C,0)}},$.prototype.getVisual=function(){var C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("xmlns","http://www.w3.org/2000/svg"),C.setAttribute("width",this.width+"px"),C.setAttribute("height",this.height+"px"),C.setAttribute("viewBox","0 0 "+this.width+" "+this.height),C.style.flexShrink="0",document.body.appendChild(C);for(var D="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,K=1;K<=this.width/5+10;K++){var re=K%5==0?this.height/3:this.height/6;D+="h4v"+-re+"h1v"+re}D+="v1H0Z",this.scaleShape=ke.createPath(D);var J=ke.createTransform();this.scaleShape.transform.baseVal.appendItem(J),C.appendChild(this.scaleShape),this.angleLabelElement=ke.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ke.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Re=ke.createTSpan("");return Re.innerHTML="&deg;",this.angleLabelElement.appendChild(Re),C.appendChild(this.angleLabelElement),document.body.removeChild(C),C},$}(),Nt=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(C,D,K,re,J,Re,ut){var St=this;return new Promise(function(Yt){var dt=document.createElement("canvas");dt.width=C.width.baseVal.value-2*re,dt.height=C.height.baseVal.value-2*re;var Gt=1,sn=1;St.naturalSize===!0?(Gt=D.naturalWidth/(C.width.baseVal.value-2*re)/Re,sn=D.naturalHeight/(C.height.baseVal.value-2*re)/ut,dt.width=D.naturalWidth/Re,dt.height=D.naturalHeight/ut):St.width!==void 0&&St.height!==void 0&&(Gt=St.width/K.width,sn=St.height/K.height,dt.width*=Gt,dt.height*=sn);var Wn=dt.getContext("2d");Wn.translate(dt.width/2,dt.height/2),Wn.rotate(J*Math.PI/180),Wn.scale(Re,ut),Wn.translate(-dt.width/2,-dt.height/2),Wn.drawImage(D,0,0,dt.width,dt.height);var Si=document.createElement("canvas");Si.width=K.width*Gt,Si.height=K.height*sn,Si.getContext("2d").putImageData(Wn.getImageData((K.x-re)*Gt,(K.y-re)*sn,K.width*Gt,K.height*sn),0,0),Yt(Si.toDataURL(St.imageType,St.imageQuality))})},$}(),Xe=function(){function $(C){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=$.instanceCounter++,this.styles=new qe(this.instanceNo),this.target=C,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($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(C){this._zoomToCropEnabled=C,C?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(C){this._gridLines=C,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(C){this._rotationAngle=C,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var C;return(C=this._aspectRatio)!==null&&C!==void 0?C:this.aspectRatios[0]},set:function(C){this._aspectRatio=C},enumerable:!1,configurable:!0}),$.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},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(C){C===void 0&&(C=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),C||this.closeEventListeners.forEach(function(D){return D()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(C){this.renderEventListeners.push(C)},$.prototype.removeRenderEventListener=function(C){this.renderEventListeners.indexOf(C)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(C),1)},$.prototype.addCloseEventListener=function(C){this.closeEventListeners.push(C)},$.prototype.removeCloseEventListener=function(C){this.closeEventListeners.indexOf(C)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(C),1)},$.prototype.setupResizeObserver=function(){var C=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.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))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var C=1*this.target.clientWidth/this.target.clientHeight,D=this.contentDiv.clientWidth/C>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*C:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,K=D+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/C;this.resize(D,K)}},$.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},$.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",ke.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},$.prototype.resize=function(C,D){this.imageWidth=Math.round(C),this.imageHeight=Math.round(D),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},$.prototype.setEditingTarget=function(){var C=document.createElement("canvas");C.width=this.target.naturalWidth,C.height=this.target.naturalHeight,C.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var D=C.toDataURL();ke.setAttributes(this.editingTarget,[["href",D]]),this.setEditingTargetSize()},$.prototype.setTopLeft=function(){var C=this.target.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=C.left-D.left-this.CANVAS_MARGIN,this.top=C.top-D.top-this.CANVAS_MARGIN},$.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=ke.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ke.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ke.createGroup(),this.editingTargetRotationScaleContainer=ke.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var C=ke.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(C);var D=ke.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(D),this.editingTargetContainer=ke.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},$.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},$.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ke.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ge(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},$.prototype.zoomToCrop=function(){if(this.cropRect){var C=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,D=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=C+"px "+D+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-C+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-D+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},$.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},$.prototype.cropRectChanged=function(C){this.cropRect=C,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},$.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},$.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"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var C=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,D=this.target.offsetTop>C+this.CANVAS_MARGIN?this.target.offsetTop-(C+this.CANVAS_MARGIN):0;this.coverDiv.style.top=D+"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},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var C=this;this.topToolbar=new $t,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 D=new se;D.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(D);var K=[];this.aspectRatios.forEach(function(sn){var Wn=new U(te.getIcon(sn.horizontal,sn.vertical),sn.horizontal===0&&sn.vertical===0?"FREE":sn.horizontal+":"+sn.vertical);Wn.onClick=function(){return C.ratioButtonClicked(sn)},K.push(Wn)}),this.aspectRatioButton=new he(te.getIcon(0,0),"Aspect ratio",K),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,D.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var re=new U('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");re.isActive=this.isGridVisible,re.onClick=function(){C.isGridVisible=!C.isGridVisible,re.isActive=C.isGridVisible},D.addButton(re);var J=new U('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(J.isActive=this.zoomToCropEnabled,J.onClick=function(){C.zoomToCropEnabled=!C.zoomToCropEnabled,J.isActive=C.zoomToCropEnabled},D.addButton(J),!Dt.isLicensed){var Re=new G;this.topToolbar.addElementBlock(Re);var ut=document.createElement("div");ut.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ut.appendChild(St),Re.addElement(ut)}var Yt=new se;Yt.minWidth=3*this.toolbarHeight+"px",Yt.contentAlign="end",this.topToolbar.addButtonBlock(Yt);var dt=new U('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");dt.onClick=this.startRenderAndClose,Yt.addButton(dt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(dt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gt=new U('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Gt.onClick=this.close,Yt.addButton(Gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var C=this;this.bottomToolbar=new $t,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 D=new se;D.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(D);var K=new U('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");K.onClick=this.rotateLeftButtonClicked,D.addButton(K);var re=new U('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");re.onClick=this.rotateRightButtonClicked,D.addButton(re);var J=new G;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new Ot("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(Yt){C.rotateBy(Yt),C.straightener.angle=C.rotationAngle},J.addElement(this.straightener.getUI());var Re=new se;Re.minWidth=2*this.toolbarHeight+"px",Re.contentAlign="end",this.bottomToolbar.addButtonBlock(Re);var ut=new U('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ut.onClick=this.flipHorizontallyButtonClicked,Re.addButton(ut);var St=new U('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");St.onClick=this.flipVerticallyButtonClicked,Re.addButton(St)},$.prototype.ratioButtonClicked=function(C){this.aspectRatio=C,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=te.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Q(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(C){if(C){var D=this.cropLayer.getRescaledRect(C.width,C.height,this.imageWidth,this.imageHeight,C.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(D),this.cropRectChanged(D),this.flippedHorizontally=C.flippedHorizontally,this.flippedVertically=C.flippedVertically,this.applyFlip(),this.rotationAngle=C.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(C,D){var K=this.cropImage.getBoundingClientRect();return{x:C-K.left,y:D-K.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var C=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=C+"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()},$.prototype.rotateLeftButtonClicked=function(){var C=this.rotationAngle-90;this.rotationAngle%90!=0&&(C+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(C)},$.prototype.rotateRightButtonClicked=function(){var C=this.rotationAngle+90;this.rotationAngle%90!=0&&(C-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(C)},$.prototype.rotateTo=function(C){C=(C=C>180?C-360:C)<=-180?C+360:C,this.rotationAngle=C,this.applyRotation()},$.prototype.rotateBy=function(C){this.rotateTo((this.rotationAngle+C)%360)},$.prototype.applyRotation=function(){var C=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var D=this.editingTargetRotationContainer.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(D,0);var K=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/K.width,this.imageHeight/K.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=C},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return ze(this,void 0,void 0,function(){var C,D;return Lt(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return C=K.sent(),D=this.getState(),this.renderEventListeners.forEach(function(re){return re(C,D)}),this.close(!0),[2]}})})},$.prototype.render=function(){return ze(this,void 0,void 0,function(){var C;return Lt(this,function(D){switch(D.label){case 0:return(C=new Nt).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.width=this.renderWidth,C.height=this.renderHeight,this.unzoomFromCrop(),ke.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,C.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 D.sent(),[4,C.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,D.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Pt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var C=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Pt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*C)+`px;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Pt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Pt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Pt("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 Pt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Pt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},$.instanceCounter=0,$}(),It=k("8hTe"),an=k.n(It),Ct=/<pre[^>]*>/g;function pn($){var C=document.createElement("div");return C.innerHTML=$,C.childNodes.length===0?"":C.childNodes[0].nodeValue}var nn=we.a=function($){var C=$.value,D=C===void 0?"":C,K=$.edit,re=K===void 0?!1:K,J=$.className,Re=$.showTextOnly,ut=$.showLines,St=$.replaces,Yt=$.zoomImg,dt=$.hasMask,Gt=$.style,sn=Gt===void 0?{}:Gt,Wn=$.stylesPrev,Si=Wn===void 0?{}:Wn,hi=String(D),Fn=Object(I.useRef)(),di=Object(I.useRef)(),Zi=Object(I.useState)(""),_i=Object(B.a)(Zi,2),ri=_i[0],wi=_i[1],Di=Object(I.useState)("office"),Oi=Object(B.a)(Di,2),Ri=Oi[0],Vi=Oi[1],cr=function(){var Cn=new Xe(di.current);Cn.displayMode="popup",Cn.addRenderEventListener(function(){var yi=Object(R.a)(L.a.mark(function Nn(Ti){var ii;return L.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:return Fn.current.style.display="none",Ni.next=3,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti}});case 3:ii=Ni.sent,ii!=null&&ii.id&&St(di.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 5:case"end":return Ni.stop()}},Nn)}));return function(Nn){return yi.apply(this,arguments)}}()),Cn.show()},rr=function(){var Cn=new ce(di.current);Cn.settings.displayMode="popup",Cn.addEventListener("render",function(){var yi=Object(R.a)(L.a.mark(function Nn(Ti){var ii;return L.a.wrap(function(Ni){for(;;)switch(Ni.prev=Ni.next){case 0:if(Fn.current.style.display="none",!di.current){Ni.next=6;break}return Ni.next=4,Object(xe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ti.dataUrl}});case 4:ii=Ni.sent,ii!=null&&ii.id&&St(di.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ii==null?void 0:ii.id,"?type=").concat(ii.content_type));case 6:case"end":return Ni.stop()}},Nn)}));return function(Nn){return yi.apply(this,arguments)}}()),Cn.show(),window.markerArea=Cn},ji=Object(I.useMemo)(function(){Fn.current&&(Fn.current.style.zIndex=-1);try{var Hn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Cn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;hi=hi.replace(Hn,"("+ne.a.API_SERVER+"/api/attachments/").replace(Cn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(yi,'"'+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(Cr){}var Nn=Z(hi),Ti=S();if(hi.match(/\[TOC\]/)&&(Nn=Nn.replace("<p>[TOC]</p>",O()),w()),Nn=Nn.replace(/(__special_katext_id_\d+__)/g,function(Cr,Ni){var Xi=Ti[Ni],lr=Xi.type,gr=Xi.expression;return Object(ae.renderToString)(pn(gr)||"",{displayMode:lr==="block",throwOnError:!1,output:"html"})}),Nn=Nn.replace(/▁/g,"\u2581\u2581\u2581"),y(),Re){var ii=document.createElement("div");return ii.innerHTML=Nn,ii.innerText}return setTimeout(function(){return Tr()},500),Nn},[hi]),Wi=Object(I.useRef)();T.WebkitLineClamp=ut,ut&&(sn=Object(W.a)(Object(W.a)({},sn),T));function hr(Hn){var Cn=Hn.target;if(Cn.tagName.toUpperCase()==="IMG"){if(Yt){var yi=Cn.getAttribute("src");wi(yi),Vi("image")}}else if(Cn.tagName.toUpperCase()==="A"){var Nn=Cn.getAttribute("href");if(Nn.indexOf("office")>-1)Hn.preventDefault(),wi(Nn),Vi("office");else if(Nn.indexOf("application/pdf")>-1)Hn.preventDefault(),wi(Nn),Vi("pdf");else if(Nn.indexOf("text/html")>-1)Hn.preventDefault(),wi(Nn),Vi("html");else if(Nn.startsWith("#")){Hn.preventDefault();var Ti=document.getElementById(Nn.replace("#",""));Ti&&Ti.scrollIntoView(!0)}}}var Tr=function(){var Cn,yi=(Cn=Wi.current)===null||Cn===void 0?void 0:Cn.querySelectorAll("video");yi==null||yi.forEach(function(Nn){if(Nn.oncontextmenu=function(){return!1},Nn.src.indexOf(".m3u8")>-1&&!Nn.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var Ti=new z.a;Ti.loadSource(Nn.src),Ti.attachMedia(Nn)}}})};Object(I.useEffect)(function(){if(Wi.current&&ji&&(ji.match(Ct)&&window.PR.prettyPrint()),Wi.current)return Wi.current.addEventListener("click",hr),function(){Wi.current.removeEventListener("click",hr),y(),w()}},[ji,Wi.current,hr]);var ar=function(Cn){if(!re)return;Cn.target.nodeName==="IMG"?(Fn.current.style.zIndex=1,Fn.current.style.display="flex",Fn.current.style.width=Cn.target.clientWidth+"px",Fn.current.style.height=Cn.target.clientHeight+"px",Fn.current.style.top=Cn.target.offsetTop+"px",Fn.current.style.left=Cn.target.offsetLeft+"px",di.current.src=Cn.target.getAttribute("src")):Fn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Wi,style:Object(W.a)({},sn),className:"".concat(J||""," markdown-body ").concat(an.a.mdBody),onMouseOver:ar,dangerouslySetInnerHTML:{__html:ji}}),p.a.createElement("div",{ref:Fn,className:an.a.button},p.a.createElement(V.a,null,p.a.createElement(Y.a,{onClick:function(){return cr()}},"\u88C1\u526A"),p.a.createElement(Y.a,{onClick:function(){return rr()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:di,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(me.a,{close:!0,data:ri,type:ri!=null&&ri.length?Ri:"",style:Object(W.a)({},Si),onClose:function(){return wi("")}}))}},"9VGf":function(Be,we,k){"use strict";k.d(we,"a",function(){return P});var ee=k("cDcd"),V=k.n(ee);function P(Y,W){var R=Object(ee.useRef)();Object(ee.useEffect)(function(){R.current=Y}),Object(ee.useEffect)(function(){function B(){R.current()}if(W!==null){var M=setInterval(B,W);return function(){return clearInterval(M)}}},[W])}},AMnG:function(Be,we,k){"use strict";var ee=k("miYZ"),V=k("tsqr"),P=k("tJVT"),Y=k("cDcd"),W=k.n(Y),R=k("nWbc"),B=k.n(R),M=k("Ot1p");we.a=function(L){var I=L.id,p=L.activeDiscussIndex,m=L.onReplyDiscuss,u=Object(Y.useState)(""),h=Object(P.a)(u,2),s=h[0],l=h[1];function i(n){l(n)}function r(){if(!s){V.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}m(I,s),l("")}return W.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:p===I?"block":"none",width:"100%"}},W.a.createElement(M.a,{miniToolbar:!0,startInit:p===I,defaultValue:s,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:i}),W.a.createElement("a",{onClick:r,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Be,we,k){"use strict";k.d(we,"a",function(){return R});var ee=k("MNnm"),V="rc-util-key";function P(B){if(B.attachTo)return B.attachTo;var M=document.querySelector("head");return M||document.body}function Y(B){var M,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var I=document.createElement("style");if((M=L.csp)===null||M===void 0?void 0:M.nonce){var p;I.nonce=(p=L.csp)===null||p===void 0?void 0:p.nonce}I.innerHTML=B;var m=P(L),u=m.firstChild;return L.prepend&&m.prepend?m.prepend(I):L.prepend&&u?m.insertBefore(I,u):m.appendChild(I),I}var W=new Map;function R(B,M){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=P(L);if(!W.has(I)){var p=Y("",L),m=p.parentNode;W.set(I,m),m.removeChild(p)}var u=Array.from(W.get(I).children).find(function(r){return r.tagName==="STYLE"&&r[V]===M});if(u){var h,s;if(((h=L.csp)===null||h===void 0?void 0:h.nonce)&&u.nonce!==((s=L.csp)===null||s===void 0?void 0:s.nonce)){var l;u.nonce=(l=L.csp)===null||l===void 0?void 0:l.nonce}return u.innerHTML!==B&&(u.innerHTML=B),u}var i=Y(B,L);return i[V]=M,i}},Bd2K:function(Be,we,k){(function(ee){ee(k("VrN/"),k("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(L,I,p){if(p!=ee.Init&&p&&L.removeKeyMap("autoCloseTags"),!I)return;var m={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(m["'/'"]=function(u){return R(u)}),(typeof I!="object"||I.whenOpening!==!1)&&(m["'>'"]=function(u){return Y(u)}),L.addKeyMap(m)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Y(L){if(L.getOption("disableInput"))return ee.Pass;for(var I=L.listSelections(),p=[],m=L.getOption("autoCloseTags"),u=0;u<I.length;u++){if(!I[u].empty())return ee.Pass;var h=I[u].head,s=L.getTokenAt(h),l=ee.innerMode(L.getMode(),s.state),i=l.state,r=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(i),n=r&&r.name;if(!n)return ee.Pass;var d=l.mode.configuration=="html",w=typeof m=="object"&&m.dontCloseTags||d&&V,T=typeof m=="object"&&m.indentTags||d&&P;s.end>h.ch&&(n=n.slice(0,n.length-s.end+h.ch));var x=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=h.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&r.close||s.string.indexOf("/")==h.ch-s.start-1||w&&B(w,x)>-1||M(L,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(i)||[],n,h,!0))return ee.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&B(O,n)>-1){p[u]={text:"/>",newPos:ee.Pos(h.line,h.ch+2)};continue}var E=T&&B(T,x)>-1;p[u]={indent:E,text:">"+(E?`
`:"")+"</"+n+">",newPos:E?ee.Pos(h.line+1,0):ee.Pos(h.line,h.ch+1)}}for(var v=typeof m=="object"&&m.dontIndentOnAutoClose,u=I.length-1;u>=0;u--){var _=p[u];L.replaceRange(_.text,I[u].head,I[u].anchor,"+insert");var f=L.listSelections().slice(0);f[u]={head:_.newPos,anchor:_.newPos},L.setSelections(f),!v&&_.indent&&(L.indentLine(_.newPos.line,null,!0),L.indentLine(_.newPos.line+1,null,!0))}}function W(L,I){for(var p=L.listSelections(),m=[],u=I?"/":"</",h=L.getOption("autoCloseTags"),s=typeof h=="object"&&h.dontIndentOnSlash,l=0;l<p.length;l++){if(!p[l].empty())return ee.Pass;var i=p[l].head,r=L.getTokenAt(i),n=ee.innerMode(L.getMode(),r.state),d=n.state;if(I&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=i.ch-1))return ee.Pass;var w,T=n.mode.name!="xml"&&L.getMode().name=="htmlmixed";if(T&&n.mode.name=="javascript")w=u+"script";else if(T&&n.mode.name=="css")w=u+"style";else{var x=n.mode.xmlCurrentContext&&n.mode.xmlCurrentContext(d);if(!x||x.length&&M(L,x,x[x.length-1],i))return ee.Pass;w=u+x[x.length-1]}L.getLine(i.line).charAt(r.end)!=">"&&(w+=">"),m[l]=w}if(L.replaceSelections(m),p=L.listSelections(),!s)for(var l=0;l<p.length;l++)(l==p.length-1||p[l].head.line<p[l+1].head.line)&&L.indentLine(p[l].head.line)}function R(L){return L.getOption("disableInput")?ee.Pass:W(L,!0)}ee.commands.closeTag=function(L){return W(L)};function B(L,I){if(L.indexOf)return L.indexOf(I);for(var p=0,m=L.length;p<m;++p)if(L[p]==I)return p;return-1}function M(L,I,p,m,u){if(!ee.scanForClosingTag)return!1;var h=Math.min(L.lastLine()+1,m.line+500),s=ee.scanForClosingTag(L,m,null,h);if(!s||s.tag!=p)return!1;for(var l=u?1:0,i=I.length-1;i>=0&&I[i]==p;i--)++l;m=s.to;for(var i=1;i<l;i++){var r=ee.scanForClosingTag(L,m,null,h);if(!r||r.tag!=p)return!1;m=r.to}return!0}})},BdwD:function(Be,we,k){"use strict";var ee=k("+L6B"),V=k("2/Rp"),P=k("0Owb"),Y=k("k1fw"),W=k("cDcd"),R=k.n(W),B=k("FOrL"),M=k.n(B),L=function(p){var m=p.buttonProps,u=m===void 0?{}:m,h=p.styles,s=h===void 0?{}:h,l=p.customText,i=p.ButtonText,r=p.ButtonClick,n=p.Buttonclass,d=p.ButtonTwo;return R.a.createElement("section",{className:"tc animated fadeIn",style:Object(Y.a)(Object(Y.a)({},{color:"#999",margin:"200px auto"}),s)},R.a.createElement("img",{src:M.a}),R.a.createElement("p",{className:"mt20 font14"},l||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&R.a.createElement(V.a,Object(P.a)({className:n,onClick:r},u),i),d&&d)};we.a=L},BjJ7:function(Be,we,k){"use strict";k.d(we,"d",function(){return V}),k.d(we,"c",function(){return P}),k.d(we,"e",function(){return Y}),k.d(we,"b",function(){return W}),k.d(we,"a",function(){return B});var ee=k("m3rI");function V(M){var L=!0;if(M.length>0){for(var I=0;I<M.length;I++)if(M[I].compile_success==0||!M[I].compile_success){L=!1;break}}else L=!1;return L}function P(M){for(var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],p=0;p<M.length;p++){var m=M[p],u=L?"".concat(L,"/").concat(m.name):"".concat(m.name);I.push({title:m.name,isLeaf:!(m.type==="tree"),key:u})}return I}function Y(M,L,I){for(var p=0;p<M.length;p++){var m=M[p];if(m.key===L){m.children=I;break}m.children&&Y(m.children,L,I)}return M}function W(M,L,I){var p;return function(){var m=this,u=arguments,h=function(){p=null,I||M.apply(m,u)},s=I&&!p;clearTimeout(p),p=setTimeout(h,L),s&&M.apply(m,u)}}var R=!0,B=ee.a.API_SERVER},"C+DQ":function(Be,we,k){},CNDd:function(Be,we,k){Be.exports=k.p+"static/c1.7850f139.svg"},CaVn:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},CrYA:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"sessionStorage",read:Y,write:W,each:R,remove:B,clearAll:M};function P(){return V.sessionStorage}function Y(L){return P().getItem(L)}function W(L,I){return P().setItem(L,I)}function R(L){for(var I=P().length-1;I>=0;I--){var p=P().key(I);L(Y(p),p)}}function B(L){return P().removeItem(L)}function M(){return P().clear()}},DlQD:function(Be,we,k){(function(ee,V){Be.exports=V()})(this,function(){"use strict";function ee(Ee,ye){for(var _e=0;_e<ye.length;_e++){var le=ye[_e];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(Ee,le.key,le)}}function V(Ee,ye,_e){return ye&&ee(Ee.prototype,ye),_e&&ee(Ee,_e),Ee}function P(Ee,ye){if(!Ee)return;if(typeof Ee=="string")return Y(Ee,ye);var _e=Object.prototype.toString.call(Ee).slice(8,-1);if(_e==="Object"&&Ee.constructor&&(_e=Ee.constructor.name),_e==="Map"||_e==="Set")return Array.from(Ee);if(_e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(_e))return Y(Ee,ye)}function Y(Ee,ye){(ye==null||ye>Ee.length)&&(ye=Ee.length);for(var _e=0,le=new Array(ye);_e<ye;_e++)le[_e]=Ee[_e];return le}function W(Ee,ye){var _e;if(typeof Symbol=="undefined"||Ee[Symbol.iterator]==null){if(Array.isArray(Ee)||(_e=P(Ee))||ye&&Ee&&typeof Ee.length=="number"){_e&&(Ee=_e);var le=0;return function(){return le>=Ee.length?{done:!0}:{done:!1,value:Ee[le++]}}}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 _e=Ee[Symbol.iterator](),_e.next.bind(_e)}function R(Ee,ye){return ye={exports:{}},Ee(ye,ye.exports),ye.exports}var B=R(function(Ee){function ye(){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 _e(le){Ee.exports.defaults=le}Ee.exports={defaults:ye(),getDefaults:ye,changeDefaults:_e}}),M=B.defaults,L=B.getDefaults,I=B.changeDefaults,p=/[&<>"']/,m=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(ye){return s[ye]};function i(Ee,ye){if(ye){if(p.test(Ee))return Ee.replace(m,l)}else if(u.test(Ee))return Ee.replace(h,l);return Ee}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(Ee){return Ee.replace(r,function(ye,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var d=/(^|[^\[])\^/g;function w(Ee,ye){Ee=Ee.source||Ee,ye=ye||"";var _e={replace:function(de,ve){return ve=ve.source||ve,ve=ve.replace(d,"$1"),Ee=Ee.replace(de,ve),_e},getRegex:function(){return new RegExp(Ee,ye)}};return _e}var T=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Ee,ye,_e){if(Ee){var le;try{le=decodeURIComponent(n(_e)).replace(T,"").toLowerCase()}catch(de){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}ye&&!x.test(_e)&&(_e=c(ye,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(de){return null}return _e}var E={},v=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ee,ye){E[" "+Ee]||(v.test(Ee)?E[" "+Ee]=Ee+"/":E[" "+Ee]=N(Ee,"/",!0)),Ee=E[" "+Ee];var _e=Ee.indexOf(":")===-1;return ye.substring(0,2)==="//"?_e?ye:Ee.replace(_,"$1")+ye:ye.charAt(0)==="/"?_e?ye:Ee.replace(f,"$1")+ye:Ee+ye}var S={exec:function(){}};function y(Ee){for(var ye=1,_e,le;ye<arguments.length;ye++){_e=arguments[ye];for(le in _e)Object.prototype.hasOwnProperty.call(_e,le)&&(Ee[le]=_e[le])}return Ee}function b(Ee,ye){var _e=Ee.replace(/\|/g,function(ve,pe,Ce){for(var Ke=!1,st=pe;--st>=0&&Ce[st]==="\\";)Ke=!Ke;return Ke?"|":" |"}),le=_e.split(/ \|/),de=0;if(le.length>ye)le.splice(ye);else for(;le.length<ye;)le.push("");for(;de<le.length;de++)le[de]=le[de].trim().replace(/\\\|/g,"|");return le}function N(Ee,ye,_e){var le=Ee.length;if(le===0)return"";for(var de=0;de<le;){var ve=Ee.charAt(le-de-1);if(ve===ye&&!_e)de++;else if(ve!==ye&&_e)de++;else break}return Ee.substr(0,le-de)}function F(Ee,ye){if(Ee.indexOf(ye[1])===-1)return-1;for(var _e=Ee.length,le=0,de=0;de<_e;de++)if(Ee[de]==="\\")de++;else if(Ee[de]===ye[0])le++;else if(Ee[de]===ye[1]&&(le--,le<0))return de;return-1}function X(Ee){Ee&&Ee.sanitize&&!Ee.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Z={escape:i,unescape:n,edit:w,cleanUrl:O,resolveUrl:c,noopTest:S,merge:y,splitCells:b,rtrim:N,findClosingBracket:F,checkSanitizeDeprecation:X},H=B.defaults,A=Z.rtrim,z=Z.splitCells,ne=Z.escape,ae=Z.findClosingBracket;function me(Ee,ye,_e){var le=ye.href,de=ye.title?ne(ye.title):null,ve=Ee[1].replace(/\\([\[\]])/g,"$1");return Ee[0].charAt(0)!=="!"?{type:"link",raw:_e,href:le,title:de,text:ve}:{type:"image",raw:_e,href:le,title:de,text:ne(ve)}}function xe(Ee,ye){var _e=Ee.match(/^(\s+)(?:```)/);if(_e===null)return ye;var le=_e[1];return ye.split(`
`).map(function(de){var ve=de.match(/^\s+/);if(ve===null)return de;var pe=ve[0];return pe.length>=le.length?de.slice(le.length):de}).join(`
`)}var Te=function(){function Ee(_e){this.options=_e||H}var ye=Ee.prototype;return ye.space=function(le){var de=this.rules.block.newline.exec(le);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
`}},ye.code=function(le,de){var ve=this.rules.block.code.exec(le);if(ve){var pe=de[de.length-1];if(pe&&pe.type==="paragraph")return{raw:ve[0],text:ve[0].trimRight()};var Ce=ve[0].replace(/^ {4}/gm,"");return{type:"code",raw:ve[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:A(Ce,`
`)}}},ye.fences=function(le){var de=this.rules.block.fences.exec(le);if(de){var ve=de[0],pe=xe(ve,de[3]||"");return{type:"code",raw:ve,lang:de[2]?de[2].trim():de[2],text:pe}}},ye.heading=function(le){var de=this.rules.block.heading.exec(le);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},ye.nptable=function(le){var de=this.rules.block.nptable.exec(le);if(de){var ve={type:"table",header:z(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[],raw:de[0]};if(ve.header.length===ve.align.length){var pe=ve.align.length,Ce;for(Ce=0;Ce<pe;Ce++)/^ *-+: *$/.test(ve.align[Ce])?ve.align[Ce]="right":/^ *:-+: *$/.test(ve.align[Ce])?ve.align[Ce]="center":/^ *:-+ *$/.test(ve.align[Ce])?ve.align[Ce]="left":ve.align[Ce]=null;for(pe=ve.cells.length,Ce=0;Ce<pe;Ce++)ve.cells[Ce]=z(ve.cells[Ce],ve.header.length);return ve}}},ye.hr=function(le){var de=this.rules.block.hr.exec(le);if(de)return{type:"hr",raw:de[0]}},ye.blockquote=function(le){var de=this.rules.block.blockquote.exec(le);if(de){var ve=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:ve}}},ye.list=function(le){var de=this.rules.block.list.exec(le);if(de){for(var ve=de[0],pe=de[2],Ce=pe.length>1,Ke=pe[pe.length-1]===")",st={type:"list",raw:ve,ordered:Ce,start:Ce?+pe.slice(0,-1):"",loose:!1,items:[]},At=de[0].match(this.rules.block.item),Ft=!1,kt,wt,Qe,it,We,ce,Se,ot=At.length,ze=0;ze<ot;ze++)kt=At[ze],ve=kt,wt=kt.length,kt=kt.replace(/^ *([*+-]|\d+[.)]) */,""),~kt.indexOf(`
`)&&(wt-=kt.length,kt=this.options.pedantic?kt.replace(/^ {1,4}/gm,""):kt.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),ze!==ot-1&&(Qe=this.rules.block.bullet.exec(At[ze+1])[0],(Ce?Qe.length===1||!Ke&&Qe[Qe.length-1]===")":Qe.length>1||this.options.smartLists&&Qe!==pe)&&(it=At.slice(ze+1).join(`
`),st.raw=st.raw.substring(0,st.raw.length-it.length),ze=ot-1)),We=Ft||/\n\n(?!\s*$)/.test(kt),ze!==ot-1&&(Ft=kt.charAt(kt.length-1)===`
`,We||(We=Ft)),We&&(st.loose=!0),ce=/^\[[ xX]\] /.test(kt),Se=void 0,ce&&(Se=kt[1]!==" ",kt=kt.replace(/^\[[ xX]\] +/,"")),st.items.push({type:"list_item",raw:ve,task:ce,checked:Se,loose:We,text:kt});return st}},ye.html=function(le){var de=this.rules.block.html.exec(le);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ne(de[0]):de[0]}},ye.def=function(le){var de=this.rules.block.def.exec(le);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var ve=de[1].toLowerCase().replace(/\s+/g," ");return{tag:ve,raw:de[0],href:de[2],title:de[3]}}},ye.table=function(le){var de=this.rules.block.table.exec(le);if(de){var ve={type:"table",header:z(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[]};if(ve.header.length===ve.align.length){ve.raw=de[0];var pe=ve.align.length,Ce;for(Ce=0;Ce<pe;Ce++)/^ *-+: *$/.test(ve.align[Ce])?ve.align[Ce]="right":/^ *:-+: *$/.test(ve.align[Ce])?ve.align[Ce]="center":/^ *:-+ *$/.test(ve.align[Ce])?ve.align[Ce]="left":ve.align[Ce]=null;for(pe=ve.cells.length,Ce=0;Ce<pe;Ce++)ve.cells[Ce]=z(ve.cells[Ce].replace(/^ *\| *| *\| *$/g,""),ve.header.length);return ve}}},ye.lheading=function(le){var de=this.rules.block.lheading.exec(le);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},ye.paragraph=function(le){var de=this.rules.block.paragraph.exec(le);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
`?de[1].slice(0,-1):de[1]}},ye.text=function(le,de){var ve=this.rules.block.text.exec(le);if(ve){var pe=de[de.length-1];return pe&&pe.type==="text"?{raw:ve[0],text:ve[0]}:{type:"text",raw:ve[0],text:ve[0]}}},ye.escape=function(le){var de=this.rules.inline.escape.exec(le);if(de)return{type:"escape",raw:de[0],text:ne(de[1])}},ye.tag=function(le,de,ve){var pe=this.rules.inline.tag.exec(le);if(pe)return!de&&/^<a /i.test(pe[0])?de=!0:de&&/^<\/a>/i.test(pe[0])&&(de=!1),!ve&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?ve=!0:ve&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(ve=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:de,inRawBlock:ve,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]}},ye.link=function(le){var de=this.rules.inline.link.exec(le);if(de){var ve=ae(de[2],"()");if(ve>-1){var pe=de[0].indexOf("!")===0?5:4,Ce=pe+de[1].length+ve;de[2]=de[2].substring(0,ve),de[0]=de[0].substring(0,Ce).trim(),de[3]=""}var Ke=de[2],st="";if(this.options.pedantic){var At=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ke);At?(Ke=At[1],st=At[3]):st=""}else st=de[3]?de[3].slice(1,-1):"";Ke=Ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Ft=me(de,{href:Ke&&Ke.replace(this.rules.inline._escapes,"$1"),title:st&&st.replace(this.rules.inline._escapes,"$1")},de[0]);return Ft}},ye.reflink=function(le,de){var ve;if((ve=this.rules.inline.reflink.exec(le))||(ve=this.rules.inline.nolink.exec(le))){var pe=(ve[2]||ve[1]).replace(/\s+/g," ");if(pe=de[pe.toLowerCase()],!pe||!pe.href){var Ce=ve[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Ke=me(ve,pe,ve[0]);return Ke}},ye.strong=function(le,de,ve){ve===void 0&&(ve="");var pe=this.rules.inline.strong.start.exec(le);if(pe&&(!pe[1]||pe[1]&&(ve===""||this.rules.inline.punctuation.exec(ve)))){de=de.slice(-1*le.length);var Ce=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Ke;(pe=Ce.exec(de))!=null;)if(Ke=this.rules.inline.strong.middle.exec(de.slice(0,pe.index+3)),Ke)return{type:"strong",raw:le.slice(0,Ke[0].length),text:le.slice(2,Ke[0].length-2)}}},ye.em=function(le,de,ve){ve===void 0&&(ve="");var pe=this.rules.inline.em.start.exec(le);if(pe&&(!pe[1]||pe[1]&&(ve===""||this.rules.inline.punctuation.exec(ve)))){de=de.slice(-1*le.length);var Ce=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Ke;(pe=Ce.exec(de))!=null;)if(Ke=this.rules.inline.em.middle.exec(de.slice(0,pe.index+2)),Ke)return{type:"em",raw:le.slice(0,Ke[0].length),text:le.slice(1,Ke[0].length-1)}}},ye.codespan=function(le){var de=this.rules.inline.code.exec(le);if(de){var ve=de[2].replace(/\n/g," "),pe=/[^ ]/.test(ve),Ce=ve.startsWith(" ")&&ve.endsWith(" ");return pe&&Ce&&(ve=ve.substring(1,ve.length-1)),ve=ne(ve,!0),{type:"codespan",raw:de[0],text:ve}}},ye.br=function(le){var de=this.rules.inline.br.exec(le);if(de)return{type:"br",raw:de[0]}},ye.del=function(le){var de=this.rules.inline.del.exec(le);if(de)return{type:"del",raw:de[0],text:de[1]}},ye.autolink=function(le,de){var ve=this.rules.inline.autolink.exec(le);if(ve){var pe,Ce;return ve[2]==="@"?(pe=ne(this.options.mangle?de(ve[1]):ve[1]),Ce="mailto:"+pe):(pe=ne(ve[1]),Ce=pe),{type:"link",raw:ve[0],text:pe,href:Ce,tokens:[{type:"text",raw:pe,text:pe}]}}},ye.url=function(le,de){var ve;if(ve=this.rules.inline.url.exec(le)){var pe,Ce;if(ve[2]==="@")pe=ne(this.options.mangle?de(ve[0]):ve[0]),Ce="mailto:"+pe;else{var Ke;do Ke=ve[0],ve[0]=this.rules.inline._backpedal.exec(ve[0])[0];while(Ke!==ve[0]);pe=ne(ve[0]),ve[1]==="www."?Ce="http://"+pe:Ce=pe}return{type:"link",raw:ve[0],text:pe,href:Ce,tokens:[{type:"text",raw:pe,text:pe}]}}},ye.inlineText=function(le,de,ve){var pe=this.rules.inline.text.exec(le);if(pe){var Ce;return de?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]:Ce=ne(this.options.smartypants?ve(pe[0]):pe[0]),{type:"text",raw:pe[0],text:Ce}}},Ee}(),Oe=Z.noopTest,Ue=Z.edit,De=Z.merge,be={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Ue(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Ue(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Ue(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Ue(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Ue(be._paragraph).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Ue(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=De({},be),be.gfm=De({},be.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*|$)"}),be.gfm.nptable=Ue(be.gfm.nptable).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Ue(be.gfm.table).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=De({},be.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Ue(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ge._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ge.punctuation=Ue(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=Ue(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=Ue(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=Ue(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=Ue(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=Ue(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=Ue(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=Ue(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=Ue(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=Ue(ge._blockSkip,"g").getRegex(),ge.overlapSkip=Ue(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._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])?)+(?![-_])/,ge.autolink=Ue(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=Ue(ge.tag).replace("comment",be._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=Ue(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=Ue(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=Ue(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=De({},ge),ge.pedantic=De({},ge.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:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=De({},ge.normal,{escape:Ue(ge.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ge.gfm.url=Ue(ge.gfm.url,"i").replace("email",ge.gfm._extended_email).getRegex(),ge.breaks=De({},ge.gfm,{br:Ue(ge.br).replace("{2,}","*").getRegex(),text:Ue(ge.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var He={block:be,inline:ge},ct=B.defaults,vt=He.block,_t=He.inline;function yt(Ee){return Ee.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function et(Ee){var ye="",_e,le,de=Ee.length;for(_e=0;_e<de;_e++)le=Ee.charCodeAt(_e),Math.random()>.5&&(le="x"+le.toString(16)),ye+="&#"+le+";";return ye}var ht=function(){function Ee(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||ct,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:vt.normal,inline:_t.normal};this.options.pedantic?(le.block=vt.pedantic,le.inline=_t.pedantic):this.options.gfm&&(le.block=vt.gfm,this.options.breaks?le.inline=_t.breaks:le.inline=_t.gfm),this.tokenizer.rules=le}Ee.lex=function(le,de){var ve=new Ee(de);return ve.lex(le)};var ye=Ee.prototype;return ye.lex=function(le){return le=le.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(le,de,ve){de===void 0&&(de=[]),ve===void 0&&(ve=!0),le=le.replace(/^ +$/gm,"");for(var pe,Ce,Ke,st;le;){if(pe=this.tokenizer.space(le)){le=le.substring(pe.raw.length),pe.type&&de.push(pe);continue}if(pe=this.tokenizer.code(le,de)){le=le.substring(pe.raw.length),pe.type?de.push(pe):(st=de[de.length-1],st.raw+=`
`+pe.raw,st.text+=`
`+pe.text);continue}if(pe=this.tokenizer.fences(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.heading(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.nptable(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.hr(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.blockquote(le)){le=le.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],ve),de.push(pe);continue}if(pe=this.tokenizer.list(le)){for(le=le.substring(pe.raw.length),Ke=pe.items.length,Ce=0;Ce<Ke;Ce++)pe.items[Ce].tokens=this.blockTokens(pe.items[Ce].text,[],!1);de.push(pe);continue}if(pe=this.tokenizer.html(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(ve&&(pe=this.tokenizer.def(le))){le=le.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.lheading(le)){le=le.substring(pe.raw.length),de.push(pe);continue}if(ve&&(pe=this.tokenizer.paragraph(le))){le=le.substring(pe.raw.length),de.push(pe);continue}if(pe=this.tokenizer.text(le,de)){le=le.substring(pe.raw.length),pe.type?de.push(pe):(st=de[de.length-1],st.raw+=`
`+pe.raw,st.text+=`
`+pe.text);continue}if(le){var At="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(At);break}else throw new Error(At)}}return de},ye.inline=function(le){var de,ve,pe,Ce,Ke,st,At=le.length;for(de=0;de<At;de++){st=le[de];switch(st.type){case"paragraph":case"text":case"heading":{st.tokens=[],this.inlineTokens(st.text,st.tokens);break}case"table":{for(st.tokens={header:[],cells:[]},Ce=st.header.length,ve=0;ve<Ce;ve++)st.tokens.header[ve]=[],this.inlineTokens(st.header[ve],st.tokens.header[ve]);for(Ce=st.cells.length,ve=0;ve<Ce;ve++)for(Ke=st.cells[ve],st.tokens.cells[ve]=[],pe=0;pe<Ke.length;pe++)st.tokens.cells[ve][pe]=[],this.inlineTokens(Ke[pe],st.tokens.cells[ve][pe]);break}case"blockquote":{this.inline(st.tokens);break}case"list":{for(Ce=st.items.length,ve=0;ve<Ce;ve++)this.inline(st.items[ve].tokens);break}}}return le},ye.inlineTokens=function(le,de,ve,pe,Ce){de===void 0&&(de=[]),ve===void 0&&(ve=!1),pe===void 0&&(pe=!1),Ce===void 0&&(Ce="");var Ke,st=le,At;if(this.tokens.links){var Ft=Object.keys(this.tokens.links);if(Ft.length>0)for(;(At=this.tokenizer.rules.inline.reflinkSearch.exec(st))!=null;)Ft.includes(At[0].slice(At[0].lastIndexOf("[")+1,-1))&&(st=st.slice(0,At.index)+"["+"a".repeat(At[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(At=this.tokenizer.rules.inline.blockSkip.exec(st))!=null;)st=st.slice(0,At.index)+"["+"a".repeat(At[0].length-2)+"]"+st.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if(Ke=this.tokenizer.escape(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.tag(le,ve,pe)){le=le.substring(Ke.raw.length),ve=Ke.inLink,pe=Ke.inRawBlock,de.push(Ke);continue}if(Ke=this.tokenizer.link(le)){le=le.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,pe)),de.push(Ke);continue}if(Ke=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,pe)),de.push(Ke);continue}if(Ke=this.tokenizer.strong(le,st,Ce)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.em(le,st,Ce)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.codespan(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.br(le)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.del(le)){le=le.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],ve,pe),de.push(Ke);continue}if(Ke=this.tokenizer.autolink(le,et)){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(!ve&&(Ke=this.tokenizer.url(le,et))){le=le.substring(Ke.raw.length),de.push(Ke);continue}if(Ke=this.tokenizer.inlineText(le,pe,yt)){le=le.substring(Ke.raw.length),Ce=Ke.raw.slice(-1),de.push(Ke);continue}if(le){var kt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return de},V(Ee,null,[{key:"rules",get:function(){return{block:vt,inline:_t}}}]),Ee}(),xt=B.defaults,Tt=Z.cleanUrl,mt=Z.escape,Ie=function(){function Ee(_e){this.options=_e||xt}var ye=Ee.prototype;return ye.code=function(le,de,ve){var pe=(de||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(le,pe);Ce!=null&&Ce!==le&&(ve=!0,le=Ce)}return pe?'<pre><code class="'+this.options.langPrefix+mt(pe,!0)+'">'+(ve?le:mt(le,!0))+`</code></pre>
`:"<pre><code>"+(ve?le:mt(le,!0))+`</code></pre>
`},ye.blockquote=function(le){return`<blockquote>
`+le+`</blockquote>
`},ye.html=function(le){return le},ye.heading=function(le,de,ve,pe){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+pe.slug(ve)+'">'+le+"</h"+de+`>
`:"<h"+de+">"+le+"</h"+de+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(le,de,ve){var pe=de?"ol":"ul",Ce=de&&ve!==1?' start="'+ve+'"':"";return"<"+pe+Ce+`>
`+le+"</"+pe+`>
`},ye.listitem=function(le){return"<li>"+le+`</li>
`},ye.checkbox=function(le){return"<input "+(le?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(le){return"<p>"+le+`</p>
`},ye.table=function(le,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
<thead>
`+le+`</thead>
`+de+`</table>
`},ye.tablerow=function(le){return`<tr>
`+le+`</tr>
`},ye.tablecell=function(le,de){var ve=de.header?"th":"td",pe=de.align?"<"+ve+' align="'+de.align+'">':"<"+ve+">";return pe+le+"</"+ve+`>
`},ye.strong=function(le){return"<strong>"+le+"</strong>"},ye.em=function(le){return"<em>"+le+"</em>"},ye.codespan=function(le){return"<code>"+le+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(le){return"<del>"+le+"</del>"},ye.link=function(le,de,ve){if(le=Tt(this.options.sanitize,this.options.baseUrl,le),le===null)return ve;var pe='<a href="'+mt(le)+'"';return de&&(pe+=' title="'+de+'"'),pe+=">"+ve+"</a>",pe},ye.image=function(le,de,ve){if(le=Tt(this.options.sanitize,this.options.baseUrl,le),le===null)return ve;var pe='<img src="'+le+'" alt="'+ve+'"';return de&&(pe+=' title="'+de+'"'),pe+=this.options.xhtml?"/>":">",pe},ye.text=function(le){return le},Ee}(),je=function(){function Ee(){}var ye=Ee.prototype;return ye.strong=function(le){return le},ye.em=function(le){return le},ye.codespan=function(le){return le},ye.del=function(le){return le},ye.html=function(le){return le},ye.text=function(le){return le},ye.link=function(le,de,ve){return""+ve},ye.image=function(le,de,ve){return""+ve},ye.br=function(){return""},Ee}(),$e=function(){function Ee(){this.seen={}}var ye=Ee.prototype;return ye.slug=function(le){var de=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var ve=de;do this.seen[ve]++,de=ve+"-"+this.seen[ve];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},Ee}(),at=B.defaults,lt=Z.unescape,bt=function(){function Ee(_e){this.options=_e||at,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new je,this.slugger=new $e}Ee.parse=function(le,de){var ve=new Ee(de);return ve.parse(le)};var ye=Ee.prototype;return ye.parse=function(le,de){de===void 0&&(de=!0);var ve="",pe,Ce,Ke,st,At,Ft,kt,wt,Qe,it,We,ce,Se,ot,ze,Lt,Dt,ke,qe=le.length;for(pe=0;pe<qe;pe++){it=le[pe];switch(it.type){case"space":continue;case"hr":{ve+=this.renderer.hr();continue}case"heading":{ve+=this.renderer.heading(this.parseInline(it.tokens),it.depth,lt(this.parseInline(it.tokens,this.textRenderer)),this.slugger);continue}case"code":{ve+=this.renderer.code(it.text,it.lang,it.escaped);continue}case"table":{for(wt="",kt="",st=it.header.length,Ce=0;Ce<st;Ce++)kt+=this.renderer.tablecell(this.parseInline(it.tokens.header[Ce]),{header:!0,align:it.align[Ce]});for(wt+=this.renderer.tablerow(kt),Qe="",st=it.cells.length,Ce=0;Ce<st;Ce++){for(Ft=it.tokens.cells[Ce],kt="",At=Ft.length,Ke=0;Ke<At;Ke++)kt+=this.renderer.tablecell(this.parseInline(Ft[Ke]),{header:!1,align:it.align[Ke]});Qe+=this.renderer.tablerow(kt)}ve+=this.renderer.table(wt,Qe);continue}case"blockquote":{Qe=this.parse(it.tokens),ve+=this.renderer.blockquote(Qe);continue}case"list":{for(We=it.ordered,ce=it.start,Se=it.loose,st=it.items.length,Qe="",Ce=0;Ce<st;Ce++)ze=it.items[Ce],Lt=ze.checked,Dt=ze.task,ot="",ze.task&&(ke=this.renderer.checkbox(Lt),Se?ze.tokens.length>0&&ze.tokens[0].type==="text"?(ze.tokens[0].text=ke+" "+ze.tokens[0].text,ze.tokens[0].tokens&&ze.tokens[0].tokens.length>0&&ze.tokens[0].tokens[0].type==="text"&&(ze.tokens[0].tokens[0].text=ke+" "+ze.tokens[0].tokens[0].text)):ze.tokens.unshift({type:"text",text:ke}):ot+=ke),ot+=this.parse(ze.tokens,Se),Qe+=this.renderer.listitem(ot,Dt,Lt);ve+=this.renderer.list(Qe,We,ce);continue}case"html":{ve+=this.renderer.html(it.text);continue}case"paragraph":{ve+=this.renderer.paragraph(this.parseInline(it.tokens));continue}case"text":{for(Qe=it.tokens?this.parseInline(it.tokens):it.text;pe+1<qe&&le[pe+1].type==="text";)it=le[++pe],Qe+=`
`+(it.tokens?this.parseInline(it.tokens):it.text);ve+=de?this.renderer.paragraph(Qe):Qe;continue}default:{var Rt='Token with "'+it.type+'" type was not found.';if(this.options.silent){console.error(Rt);return}else throw new Error(Rt)}}}return ve},ye.parseInline=function(le,de){de=de||this.renderer;var ve="",pe,Ce,Ke=le.length;for(pe=0;pe<Ke;pe++){Ce=le[pe];switch(Ce.type){case"escape":{ve+=de.text(Ce.text);break}case"html":{ve+=de.html(Ce.text);break}case"link":{ve+=de.link(Ce.href,Ce.title,this.parseInline(Ce.tokens,de));break}case"image":{ve+=de.image(Ce.href,Ce.title,Ce.text);break}case"strong":{ve+=de.strong(this.parseInline(Ce.tokens,de));break}case"em":{ve+=de.em(this.parseInline(Ce.tokens,de));break}case"codespan":{ve+=de.codespan(Ce.text);break}case"br":{ve+=de.br();break}case"del":{ve+=de.del(this.parseInline(Ce.tokens,de));break}case"text":{ve+=de.text(Ce.text);break}default:{var st='Token with "'+Ce.type+'" type was not found.';if(this.options.silent){console.error(st);return}else throw new Error(st)}}}return ve},Ee}(),Mt=Z.merge,jt=Z.checkSanitizeDeprecation,Me=Z.escape,Pe=B.getDefaults,tt=B.changeDefaults,rt=B.defaults;function Fe(Ee,ye,_e){if(typeof Ee=="undefined"||Ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ee)+", string expected");if(typeof ye=="function"&&(_e=ye,ye=null),ye=Mt({},Fe.defaults,ye||{}),jt(ye),_e){var le=ye.highlight,de;try{de=ht.lex(Ee,ye)}catch(Ke){return _e(Ke)}var ve=function(st){var At;if(!st)try{At=bt.parse(de,ye)}catch(Ft){st=Ft}return ye.highlight=le,st?_e(st):_e(null,At)};if(!le||le.length<3)return ve();if(delete ye.highlight,!de.length)return ve();var pe=0;Fe.walkTokens(de,function(Ke){Ke.type==="code"&&(pe++,setTimeout(function(){le(Ke.text,Ke.lang,function(st,At){if(st)return ve(st);At!=null&&At!==Ke.text&&(Ke.text=At,Ke.escaped=!0),pe--,pe===0&&ve()})},0))}),pe===0&&ve();return}try{var Ce=ht.lex(Ee,ye);return ye.walkTokens&&Fe.walkTokens(Ce,ye.walkTokens),bt.parse(Ce,ye)}catch(Ke){if(Ke.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+Me(Ke.message+"",!0)+"</pre>";throw Ke}}Fe.options=Fe.setOptions=function(Ee){return Mt(Fe.defaults,Ee),tt(Fe.defaults),Fe},Fe.getDefaults=Pe,Fe.defaults=rt,Fe.use=function(Ee){var ye=Mt({},Ee);if(Ee.renderer&&function(){var le=Fe.defaults.renderer||new Ie,de=function(Ce){var Ke=le[Ce];le[Ce]=function(){for(var st=arguments.length,At=new Array(st),Ft=0;Ft<st;Ft++)At[Ft]=arguments[Ft];var kt=Ee.renderer[Ce].apply(le,At);return kt===!1&&(kt=Ke.apply(le,At)),kt}};for(var ve in Ee.renderer)de(ve);ye.renderer=le}(),Ee.tokenizer&&function(){var le=Fe.defaults.tokenizer||new Te,de=function(Ce){var Ke=le[Ce];le[Ce]=function(){for(var st=arguments.length,At=new Array(st),Ft=0;Ft<st;Ft++)At[Ft]=arguments[Ft];var kt=Ee.tokenizer[Ce].apply(le,At);return kt===!1&&(kt=Ke.apply(le,At)),kt}};for(var ve in Ee.tokenizer)de(ve);ye.tokenizer=le}(),Ee.walkTokens){var _e=Fe.defaults.walkTokens;ye.walkTokens=function(le){Ee.walkTokens(le),_e&&_e(le)}}Fe.setOptions(ye)},Fe.walkTokens=function(Ee,ye){for(var _e=W(Ee),le;!(le=_e()).done;){var de=le.value;ye(de);switch(de.type){case"table":{for(var ve=W(de.tokens.header),pe;!(pe=ve()).done;){var Ce=pe.value;Fe.walkTokens(Ce,ye)}for(var Ke=W(de.tokens.cells),st;!(st=Ke()).done;)for(var At=st.value,Ft=W(At),kt;!(kt=Ft()).done;){var wt=kt.value;Fe.walkTokens(wt,ye)}break}case"list":{Fe.walkTokens(de.items,ye);break}default:de.tokens&&Fe.walkTokens(de.tokens,ye)}}},Fe.Parser=bt,Fe.parser=bt.parse,Fe.Renderer=Ie,Fe.TextRenderer=je,Fe.Lexer=ht,Fe.lexer=ht.lex,Fe.Tokenizer=Te,Fe.Slugger=$e,Fe.parse=Fe;var Je=Fe;return Je})},"DlR+":function(Be,we,k){var ee=k("MFOe"),V=ee.Global,P=ee.trim;Be.exports={name:"cookieStorage",read:W,write:B,each:R,remove:M,clearAll:L};var Y=V.document;function W(p){if(!p||!I(p))return null;var m="(?:^|.*;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(Y.cookie.replace(new RegExp(m),"$1"))}function R(p){for(var m=Y.cookie.split(/; ?/g),u=m.length-1;u>=0;u--){if(!P(m[u]))continue;var h=m[u].split("="),s=unescape(h[0]),l=unescape(h[1]);p(l,s)}}function B(p,m){if(!p)return;Y.cookie=escape(p)+"="+escape(m)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function M(p){if(!p||!I(p))return;Y.cookie=escape(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function L(){R(function(p,m){M(m)})}function I(p){return new RegExp("(?:^|;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Y.cookie)}},E2g8:function(Be,we,k){(function(ee,V){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(P,Y){Be.exports=Y()})(this,function(){"use strict";function P(Ie){var je=typeof Ie;return Ie!==null&&(je==="object"||je==="function")}function Y(Ie){return typeof Ie=="function"}var W=void 0;Array.isArray?W=Array.isArray:W=function(Ie){return Object.prototype.toString.call(Ie)==="[object Array]"};var R=W,B=0,M=void 0,L=void 0,I=function(je,$e){x[B]=je,x[B+1]=$e,B+=2,B===2&&(L?L(O):v())};function p(Ie){L=Ie}function m(Ie){I=Ie}var u=typeof window!="undefined"?window:void 0,h=u||{},s=h.MutationObserver||h.WebKitMutationObserver,l=typeof self=="undefined"&&typeof ee!="undefined"&&{}.toString.call(ee)==="[object process]",i=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function r(){return function(){return ee.nextTick(O)}}function n(){return typeof M!="undefined"?function(){M(O)}:T()}function d(){var Ie=0,je=new s(O),$e=document.createTextNode("");return je.observe($e,{characterData:!0}),function(){$e.data=Ie=++Ie%2}}function w(){var Ie=new MessageChannel;return Ie.port1.onmessage=O,function(){return Ie.port2.postMessage(0)}}function T(){var Ie=setTimeout;return function(){return Ie(O,1)}}var x=new Array(1e3);function O(){for(var Ie=0;Ie<B;Ie+=2){var je=x[Ie],$e=x[Ie+1];je($e),x[Ie]=void 0,x[Ie+1]=void 0}B=0}function E(){try{var Ie=Function("return this")().require("vertx");return M=Ie.runOnLoop||Ie.runOnContext,n()}catch(je){return T()}}var v=void 0;l?v=r():s?v=d():i?v=w():u===void 0&&!0?v=E():v=T();function _(Ie,je){var $e=this,at=new this.constructor(S);at[c]===void 0&&He(at);var lt=$e._state;if(lt){var bt=arguments[lt-1];I(function(){return Ue(lt,at,bt,$e._result)})}else Te($e,at,Ie,je);return at}function f(Ie){var je=this;if(Ie&&typeof Ie=="object"&&Ie.constructor===je)return Ie;var $e=new je(S);return ne($e,Ie),$e}var c=Math.random().toString(36).substring(2);function S(){}var y=void 0,b=1,N=2;function F(){return new TypeError("You cannot resolve a promise with itself")}function X(){return new TypeError("A promises callback cannot return that same promise.")}function Z(Ie,je,$e,at){try{Ie.call(je,$e,at)}catch(lt){return lt}}function H(Ie,je,$e){I(function(at){var lt=!1,bt=Z($e,je,function(Mt){if(lt)return;lt=!0,je!==Mt?ne(at,Mt):me(at,Mt)},function(Mt){if(lt)return;lt=!0,xe(at,Mt)},"Settle: "+(at._label||" unknown promise"));!lt&&bt&&(lt=!0,xe(at,bt))},Ie)}function A(Ie,je){je._state===b?me(Ie,je._result):je._state===N?xe(Ie,je._result):Te(je,void 0,function($e){return ne(Ie,$e)},function($e){return xe(Ie,$e)})}function z(Ie,je,$e){je.constructor===Ie.constructor&&$e===_&&je.constructor.resolve===f?A(Ie,je):$e===void 0?me(Ie,je):Y($e)?H(Ie,je,$e):me(Ie,je)}function ne(Ie,je){if(Ie===je)xe(Ie,F());else if(P(je)){var $e=void 0;try{$e=je.then}catch(at){xe(Ie,at);return}z(Ie,je,$e)}else me(Ie,je)}function ae(Ie){Ie._onerror&&Ie._onerror(Ie._result),Oe(Ie)}function me(Ie,je){if(Ie._state!==y)return;Ie._result=je,Ie._state=b,Ie._subscribers.length!==0&&I(Oe,Ie)}function xe(Ie,je){if(Ie._state!==y)return;Ie._state=N,Ie._result=je,I(ae,Ie)}function Te(Ie,je,$e,at){var lt=Ie._subscribers,bt=lt.length;Ie._onerror=null,lt[bt]=je,lt[bt+b]=$e,lt[bt+N]=at,bt===0&&Ie._state&&I(Oe,Ie)}function Oe(Ie){var je=Ie._subscribers,$e=Ie._state;if(je.length===0)return;for(var at=void 0,lt=void 0,bt=Ie._result,Mt=0;Mt<je.length;Mt+=3)at=je[Mt],lt=je[Mt+$e],at?Ue($e,at,lt,bt):lt(bt);Ie._subscribers.length=0}function Ue(Ie,je,$e,at){var lt=Y($e),bt=void 0,Mt=void 0,jt=!0;if(lt){try{bt=$e(at)}catch(Me){jt=!1,Mt=Me}if(je===bt){xe(je,X());return}}else bt=at;je._state!==y||(lt&&jt?ne(je,bt):jt===!1?xe(je,Mt):Ie===b?me(je,bt):Ie===N&&xe(je,bt))}function De(Ie,je){try{je(function(at){ne(Ie,at)},function(at){xe(Ie,at)})}catch($e){xe(Ie,$e)}}var be=0;function ge(){return be++}function He(Ie){Ie[c]=be++,Ie._state=void 0,Ie._result=void 0,Ie._subscribers=[]}function ct(){return new Error("Array Methods must be provided an Array")}var vt=function(){function Ie(je,$e){this._instanceConstructor=je,this.promise=new je(S),this.promise[c]||He(this.promise),R($e)?(this.length=$e.length,this._remaining=$e.length,this._result=new Array(this.length),this.length===0?me(this.promise,this._result):(this.length=this.length||0,this._enumerate($e),this._remaining===0&&me(this.promise,this._result))):xe(this.promise,ct())}return Ie.prototype._enumerate=function($e){for(var at=0;this._state===y&&at<$e.length;at++)this._eachEntry($e[at],at)},Ie.prototype._eachEntry=function($e,at){var lt=this._instanceConstructor,bt=lt.resolve;if(bt===f){var Mt=void 0,jt=void 0,Me=!1;try{Mt=$e.then}catch(tt){Me=!0,jt=tt}if(Mt===_&&$e._state!==y)this._settledAt($e._state,at,$e._result);else if(typeof Mt!="function")this._remaining--,this._result[at]=$e;else if(lt===Tt){var Pe=new lt(S);Me?xe(Pe,jt):z(Pe,$e,Mt),this._willSettleAt(Pe,at)}else this._willSettleAt(new lt(function(tt){return tt($e)}),at)}else this._willSettleAt(bt($e),at)},Ie.prototype._settledAt=function($e,at,lt){var bt=this.promise;bt._state===y&&(this._remaining--,$e===N?xe(bt,lt):this._result[at]=lt),this._remaining===0&&me(bt,this._result)},Ie.prototype._willSettleAt=function($e,at){var lt=this;Te($e,void 0,function(bt){return lt._settledAt(b,at,bt)},function(bt){return lt._settledAt(N,at,bt)})},Ie}();function _t(Ie){return new vt(this,Ie).promise}function yt(Ie){var je=this;return R(Ie)?new je(function($e,at){for(var lt=Ie.length,bt=0;bt<lt;bt++)je.resolve(Ie[bt]).then($e,at)}):new je(function($e,at){return at(new TypeError("You must pass an array to race."))})}function et(Ie){var je=this,$e=new je(S);return xe($e,Ie),$e}function ht(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function xt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var Tt=function(){function Ie(je){this[c]=ge(),this._result=this._state=void 0,this._subscribers=[],S!==je&&(typeof je!="function"&&ht(),this instanceof Ie?De(this,je):xt())}return Ie.prototype.catch=function($e){return this.then(null,$e)},Ie.prototype.finally=function($e){var at=this,lt=at.constructor;return Y($e)?at.then(function(bt){return lt.resolve($e()).then(function(){return bt})},function(bt){return lt.resolve($e()).then(function(){throw bt})}):at.then($e,$e)},Ie}();Tt.prototype.then=_,Tt.all=_t,Tt.race=yt,Tt.resolve=f,Tt.reject=et,Tt._setScheduler=p,Tt._setAsap=m,Tt._asap=I;function mt(){var Ie=void 0;if(typeof V!="undefined")Ie=V;else if(typeof self!="undefined")Ie=self;else try{Ie=Function("return this")()}catch(at){throw new Error("polyfill failed because global object is unavailable in this environment")}var je=Ie.Promise;if(je){var $e=null;try{$e=Object.prototype.toString.call(je.resolve())}catch(at){}if($e==="[object Promise]"&&!je.cast)return}Ie.Promise=Tt}return Tt.polyfill=mt,Tt.Promise=Tt,Tt})}).call(this,k("Q2Ig"),k("IyRk"))},E9nw:function(Be,we){Be.exports=function(){var k=document.getSelection();if(!k.rangeCount)return function(){};for(var ee=document.activeElement,V=[],P=0;P<k.rangeCount;P++)V.push(k.getRangeAt(P));switch(ee.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":ee.blur();break;default:ee=null;break}return k.removeAllRanges(),function(){k.type==="Caret"&&k.removeAllRanges(),k.rangeCount||V.forEach(function(Y){k.addRange(Y)}),ee&&ee.focus()}}},EHPI:function(Be,we,k){"use strict";var ee=k("bbsP"),V=k("/wGt"),P=k("tJVT"),Y=k("k1fw"),W=k("cDcd"),R=k.n(W),B=k("ZW9T"),M=k("ZD9Y"),L=k("M8RZ"),I=k("bCnd"),p=k("fcyK"),m=k.n(p),u={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},h;(function(i){i[i.set_font_size=0]="set_font_size",i[i.set_theme=1]="set_theme",i[i.on_tab_to_space=2]="on_tab_to_space",i[i.set_show_editor_setting=3]="set_show_editor_setting"})(h||(h={}));function s(i,r){switch(r.type){case h.set_show_editor_setting:return Object(Y.a)(Object(Y.a)({},i),{},{showEditorSetting:r.payload});case h.set_theme:return Object(Y.a)(Object(Y.a)({},i),{},{theme:r.payload});case h.set_font_size:return Object(Y.a)(Object(Y.a)({},i),{},{fontSize:r.payload});case h.on_tab_to_space:return Object(Y.a)(Object(Y.a)({},i),{},{tabToSpace:r.payload});default:throw new Error}}we.a=function(i){var r=i.isLoading,n=i.value,d=i.onChange,w=i.language,T=i.ActionBarRender,x=T===void 0?function(Z){return R.a.createElement(l,{onShowCodeSetting:Z})}:T,O=Object(W.useReducer)(s,u),E=Object(P.a)(O,2),v=E[0],_=E[1],f=v.theme,c=v.fontSize,S=v.showEditorSetting,y=v.tabToSpace,b={onFontSizeChange:function(H){_({type:h.set_font_size,payload:H}),Object(I.b)("cmFontSize",H)},tabToSpace:y,cmFontSize:c,className:"oj",cmCodeMode:f,onTabToSpace:function(H){_({type:h.on_tab_to_space,payload:H}),Object(I.b)("cmTabToSpace",H)},onCodeModeChange:function(H){_({type:h.set_theme,payload:H}),Object(I.b)("cmCodeMode",H)}};function N(){_({type:h.set_show_editor_setting,payload:!1})}function F(){_({type:h.set_show_editor_setting,payload:!0})}var X={value:n,language:w,onChange:d,theme:f,height:"calc(100% - 56px)",options:{fontSize:c,insertSpaces:y}};return R.a.createElement(W.Fragment,null,R.a.createElement("div",{className:"code-panel-container"},x(F),!r&&R.a.createElement(B.b,X)),R.a.createElement(L.a,null,R.a.createElement(V.a,{className:"oj",title:null,placement:"right",closable:!1,visible:S,onClose:N},R.a.createElement(M.a,b))))};function l(i){var r=i.onShowCodeSetting;return R.a.createElement("div",{className:"action-bar"},R.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),R.a.createElement("a",{onClick:r},R.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(s,l,i){i&&i!=ee.Init&&(s.removeKeyMap(W),s.state.closeBrackets=null),l&&(R(Y(l,"pairs")),s.state.closeBrackets=l,s.addKeyMap(W))});function Y(s,l){return l=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[l]!=null?s[l]:V[l]}var W={Backspace:L,Enter:I};function R(s){for(var l=0;l<s.length;l++){var i=s.charAt(l),r="'"+i+"'";W[r]||(W[r]=B(i))}}R(V.pairs+"`");function B(s){return function(l){return m(l,s)}}function M(s){var l=s.state.closeBrackets;if(!l||l.override)return l;var i=s.getModeAt(s.getCursor());return i.closeBrackets||l}function L(s){var l=M(s);if(!l||s.getOption("disableInput"))return ee.Pass;for(var i=Y(l,"pairs"),r=s.listSelections(),n=0;n<r.length;n++){if(!r[n].empty())return ee.Pass;var d=u(s,r[n].head);if(!d||i.indexOf(d)%2!=0)return ee.Pass}for(var n=r.length-1;n>=0;n--){var w=r[n].head;s.replaceRange("",P(w.line,w.ch-1),P(w.line,w.ch+1),"+delete")}}function I(s){var l=M(s),i=l&&Y(l,"explode");if(!i||s.getOption("disableInput"))return ee.Pass;for(var r=s.listSelections(),n=0;n<r.length;n++){if(!r[n].empty())return ee.Pass;var d=u(s,r[n].head);if(!d||i.indexOf(d)%2!=0)return ee.Pass}s.operation(function(){var w=s.lineSeparator()||`
`;s.replaceSelection(w+w,null),s.execCommand("goCharLeft"),r=s.listSelections();for(var T=0;T<r.length;T++){var x=r[T].head.line;s.indentLine(x,null,!0),s.indentLine(x+1,null,!0)}})}function p(s){var l=ee.cmpPos(s.anchor,s.head)>0;return{anchor:new P(s.anchor.line,s.anchor.ch+(l?-1:1)),head:new P(s.head.line,s.head.ch+(l?1:-1))}}function m(s,l){var i=M(s);if(!i||s.getOption("disableInput"))return ee.Pass;var r=Y(i,"pairs"),n=r.indexOf(l);if(n==-1)return ee.Pass;for(var d=Y(i,"closeBefore"),w=Y(i,"triples"),T=r.charAt(n+1)==l,x=s.listSelections(),O=n%2==0,E,v=0;v<x.length;v++){var _=x[v],f=_.head,c,S=s.getRange(f,P(f.line,f.ch+1));if(O&&!_.empty())c="surround";else if((T||!O)&&S==l)T&&h(s,f)?c="both":w.indexOf(l)>=0&&s.getRange(f,P(f.line,f.ch+3))==l+l+l?c="skipThree":c="skip";else if(T&&f.ch>1&&w.indexOf(l)>=0&&s.getRange(P(f.line,f.ch-2),f)==l+l){if(f.ch>2&&/\bstring/.test(s.getTokenTypeAt(P(f.line,f.ch-2))))return ee.Pass;c="addFour"}else if(T){var y=f.ch==0?" ":s.getRange(P(f.line,f.ch-1),f);if(!ee.isWordChar(S)&&y!=l&&!ee.isWordChar(y))c="both";else return ee.Pass}else if(O&&(S.length===0||/\s/.test(S)||d.indexOf(S)>-1))c="both";else return ee.Pass;if(!E)E=c;else if(E!=c)return ee.Pass}var b=n%2?r.charAt(n-1):l,N=n%2?l:r.charAt(n+1);s.operation(function(){if(E=="skip")s.execCommand("goCharRight");else if(E=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(E=="surround"){for(var X=s.getSelections(),F=0;F<X.length;F++)X[F]=b+X[F]+N;s.replaceSelections(X,"around"),X=s.listSelections().slice();for(var F=0;F<X.length;F++)X[F]=p(X[F]);s.setSelections(X)}else E=="both"?(s.replaceSelection(b+N,null),s.triggerElectric(b+N),s.execCommand("goCharLeft")):E=="addFour"&&(s.replaceSelection(b+b+b+b,"before"),s.execCommand("goCharRight"))})}function u(s,l){var i=s.getRange(P(l.line,l.ch-1),P(l.line,l.ch+1));return i.length==2?i:null}function h(s,l){var i=s.getTokenAt(P(l.line,l.ch+1));return/\bstring/.test(i.type)&&i.start==l.ch&&(l.ch==0||!/\bstring/.test(s.getTokenTypeAt(l)))}})},FOrL:function(Be,we,k){Be.exports=k.p+"static/nodata.a6b3f948.png"},GUcZ:function(Be,we,k){"use strict";var ee=k("fWQN"),V=k("mtLc"),P=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(U,G){return U.__proto__=G,U},Object.assign=Object.assign||function(U){if(U==null)throw new TypeError("Cannot convert undefined or null to object");for(var G=Object(U),Q=1;Q<arguments.length;Q++){var te=arguments[Q];if(te!=null)for(var he in te)te.hasOwnProperty(he)&&(G[he]=te[he])}return G},typeof self.Promise!="function"&&k("E2g8").polyfill()}}]),fe}();P.install();var Y=P,W=k("+qE3"),R=k.n(W),B=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"e",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","error",Q),!fe.ENABLE_ERROR)return;console.error?console.error(Q):console.warn?console.warn(Q):console.log(Q)}},{key:"i",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","info",Q),!fe.ENABLE_INFO)return;console.info?console.info(Q):console.log(Q)}},{key:"w",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","warn",Q),!fe.ENABLE_WARN)return;console.warn?console.warn(Q):console.log(Q)}},{key:"d",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","debug",Q),!fe.ENABLE_DEBUG)return;console.debug?console.debug(Q):console.log(Q)}},{key:"v",value:function(U,G){(!U||fe.FORCE_GLOBAL_TAG)&&(U=fe.GLOBAL_TAG);var Q="[".concat(U,"] > ").concat(G);if(fe.ENABLE_CALLBACK&&fe.emitter.emit("log","verbose",Q),!fe.ENABLE_VERBOSE)return;console.log(Q)}}]),fe}();B.GLOBAL_TAG="flv.js",B.FORCE_GLOBAL_TAG=!1,B.ENABLE_ERROR=!0,B.ENABLE_INFO=!0,B.ENABLE_WARN=!0,B.ENABLE_DEBUG=!0,B.ENABLE_VERBOSE=!0,B.ENABLE_CALLBACK=!1,B.emitter=new R.a;var M=B,L=function(){function fe(){Object(ee.a)(this,fe),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(V.a)(fe,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(U){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=U,this._totalBytes+=U):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=U,this._totalBytes+=U):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=U,this._totalBytes+=U,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var U=(this._now()-this._lastCheckpoint)/1e3;return U==0&&(U=1),this._intervalBytes/U/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var U=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/U/1024}}]),fe}(),I=L,p=k("yKVA"),m=k("879j"),u=function(){function fe(se){Object(ee.a)(this,fe),this._message=se}return Object(V.a)(fe,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),fe}(),h=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"IllegalStateException"}}]),U}(u),s=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"InvalidArgumentException"}}]),U}(u),l=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G){return Object(ee.a)(this,U),se.call(this,G)}return Object(V.a)(U,[{key:"name",get:function(){return"NotImplementedException"}}]),U}(u),i={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},r={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},n=function(){function fe(se){Object(ee.a)(this,fe),this._type=se||"undefined",this._status=i.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(V.a)(fe,[{key:"destroy",value:function(){this._status=i.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===i.kConnecting||this._status===i.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(U){this._onContentLengthKnown=U}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(U){this._onURLRedirect=U}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(U){this._onDataArrival=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onComplete",get:function(){return this._onComplete},set:function(U){this._onComplete=U}},{key:"open",value:function(U,G){throw new l("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new l("Unimplemented abstract function!")}}]),fe}(),d=k("oZsa");function w(fe,se){for(;!Object.prototype.hasOwnProperty.call(fe,se)&&!(fe=Object(d.a)(fe),fe===null););return fe}function T(fe,se,U){return typeof Reflect!="undefined"&&Reflect.get?T=Reflect.get:T=function(Q,te,he){var Le=w(Q,te);if(!Le)return;var Ge=Object.getOwnPropertyDescriptor(Le,te);return Ge.get?Ge.get.call(he):Ge.value},T(fe,se,U||fe)}var x={};function O(){var fe=self.navigator.userAgent.toLowerCase(),se=/(edge)\/([\w.]+)/.exec(fe)||/(opr)[\/]([\w.]+)/.exec(fe)||/(chrome)[ \/]([\w.]+)/.exec(fe)||/(iemobile)[\/]([\w.]+)/.exec(fe)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(fe)||/(webkit)[ \/]([\w.]+)/.exec(fe)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(fe)||/(msie) ([\w.]+)/.exec(fe)||fe.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(fe)||fe.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(fe)||[],U=/(ipad)/.exec(fe)||/(ipod)/.exec(fe)||/(windows phone)/.exec(fe)||/(iphone)/.exec(fe)||/(kindle)/.exec(fe)||/(android)/.exec(fe)||/(windows)/.exec(fe)||/(mac)/.exec(fe)||/(linux)/.exec(fe)||/(cros)/.exec(fe)||[],G={browser:se[5]||se[3]||se[1]||"",version:se[2]||se[4]||"0",majorVersion:se[4]||se[2]||"0",platform:U[0]||""},Q={};if(G.browser){Q[G.browser]=!0;var te=G.majorVersion.split(".");Q.version={major:parseInt(G.majorVersion,10),string:G.version},te.length>1&&(Q.version.minor=parseInt(te[1],10)),te.length>2&&(Q.version.build=parseInt(te[2],10))}if(G.platform&&(Q[G.platform]=!0),(Q.chrome||Q.opr||Q.safari)&&(Q.webkit=!0),Q.rv||Q.iemobile){Q.rv&&delete Q.rv;var he="msie";G.browser=he,Q[he]=!0}if(Q.edge){delete Q.edge;var Le="msedge";G.browser=Le,Q[Le]=!0}if(Q.opr){var Ge="opera";G.browser=Ge,Q[Ge]=!0}if(Q.safari&&Q.android){var Ot="android";G.browser=Ot,Q[Ot]=!0}Q.name=G.browser,Q.platform=G.platform;for(var Nt in x)x.hasOwnProperty(Nt)&&delete x[Nt];Object.assign(x,Q)}O();var E=x,v=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"fetch-stream-loader"),te.TAG="FetchStreamLoader",te._seekHandler=G,te._config=Q,te._needStash=!0,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(V.a)(U,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q,te){var he=this;this._dataSource=Q,this._range=te;var Le=Q.url;this._config.reuseRedirectedURL&&Q.redirectedURL!=null&&(Le=Q.redirectedURL);var Ge=this._seekHandler.getConfig(Le,te),Ot=new self.Headers;if(typeof Ge.headers=="object"){var Nt=Ge.headers;for(var Xe in Nt)Nt.hasOwnProperty(Xe)&&Ot.append(Xe,Nt[Xe])}var It={method:"GET",headers:Ot,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var an in this._config.headers)Ot.append(an,this._config.headers[an]);Q.cors===!1&&(It.mode="same-origin"),Q.withCredentials&&(It.credentials="include"),Q.referrerPolicy&&(It.referrerPolicy=Q.referrerPolicy),this._status=i.kConnecting,self.fetch(Ge.url,It).then(function(Ct){if(he._requestAbort){he._requestAbort=!1,he._status=i.kIdle;return}if(Ct.ok&&Ct.status>=200&&Ct.status<=299){if(Ct.url!==Ge.url&&he._onURLRedirect){var pn=he._seekHandler.removeURLParameters(Ct.url);he._onURLRedirect(pn)}var nn=Ct.headers.get("Content-Length");return nn!=null&&(he._contentLength=parseInt(nn),he._contentLength!==0&&(he._onContentLengthKnown&&he._onContentLengthKnown(he._contentLength))),he._pump.call(he,Ct.body.getReader())}else if(he._status=i.kError,he._onError)he._onError(r.HTTP_STATUS_CODE_INVALID,{code:Ct.status,msg:Ct.statusText});else throw new u("FetchStreamLoader: Http code invalid, "+Ct.status+" "+Ct.statusText)}).catch(function(Ct){if(he._status=i.kError,he._onError)he._onError(r.EXCEPTION,{code:-1,msg:Ct.message});else throw Ct})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(Q){var te=this;return Q.read().then(function(he){if(he.done)if(te._contentLength!==null&&te._receivedLength<te._contentLength){te._status=i.kError;var Le=r.EARLY_EOF,Ge={code:-1,msg:"Fetch stream meet Early-EOF"};if(te._onError)te._onError(Le,Ge);else throw new u(Ge.msg)}else te._status=i.kComplete,te._onComplete&&te._onComplete(te._range.from,te._range.from+te._receivedLength-1);else{if(te._requestAbort===!0)return te._requestAbort=!1,te._status=i.kComplete,Q.cancel();te._status=i.kBuffering;var Ot=he.value.buffer,Nt=te._range.from+te._receivedLength;te._receivedLength+=Ot.byteLength,te._onDataArrival&&te._onDataArrival(Ot,Nt,te._receivedLength),te._pump(Q)}}).catch(function(he){if(he.code===11&&E.msedge)return;te._status=i.kError;var Le=0,Ge=null;if((he.code===19||he.message==="network error")&&(te._contentLength===null||te._contentLength!==null&&te._receivedLength<te._contentLength)?(Le=r.EARLY_EOF,Ge={code:he.code,msg:"Fetch stream meet Early-EOF"}):(Le=r.EXCEPTION,Ge={code:he.code,msg:he.message}),te._onError)te._onError(Le,Ge);else throw new u(Ge.msg)})}}],[{key:"isSupported",value:function(){try{var Q=E.msedge&&E.version.minor>=15048,te=E.msedge?Q:!0;return self.fetch&&self.ReadableStream&&te}catch(he){return!1}}}]),U}(n),_=v,f=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"xhr-moz-chunked-loader"),te.TAG="MozChunkedLoader",te._seekHandler=G,te._config=Q,te._needStash=!0,te._xhr=null,te._requestAbort=!1,te._contentLength=null,te._receivedLength=0,te}return Object(V.a)(U,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q,te){this._dataSource=Q,this._range=te;var he=Q.url;this._config.reuseRedirectedURL&&Q.redirectedURL!=null&&(he=Q.redirectedURL);var Le=this._seekHandler.getConfig(he,te);this._requestURL=Le.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Le.url,!0),Ge.responseType="moz-chunked-arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onloadend=this._onLoadEnd.bind(this),Ge.onerror=this._onXhrError.bind(this),Q.withCredentials&&(Ge.withCredentials=!0),typeof Le.headers=="object"){var Ot=Le.headers;for(var Nt in Ot)Ot.hasOwnProperty(Nt)&&Ge.setRequestHeader(Nt,Ot[Nt])}if(typeof this._config.headers=="object"){var Xe=this._config.headers;for(var It in Xe)Xe.hasOwnProperty(It)&&Ge.setRequestHeader(It,Xe[It])}this._status=i.kConnecting,Ge.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=i.kComplete}},{key:"_onReadyStateChange",value:function(Q){var te=Q.target;if(te.readyState===2){if(te.responseURL!=null&&te.responseURL!==this._requestURL&&this._onURLRedirect){var he=this._seekHandler.removeURLParameters(te.responseURL);this._onURLRedirect(he)}if(te.status!==0&&(te.status<200||te.status>299))if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("MozChunkedLoader: Http code invalid, "+te.status+" "+te.statusText);else this._status=i.kBuffering}}},{key:"_onProgress",value:function(Q){if(this._status===i.kError)return;this._contentLength===null&&(Q.total!==null&&Q.total!==0&&(this._contentLength=Q.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var te=Q.target.response,he=this._range.from+this._receivedLength;this._receivedLength+=te.byteLength,this._onDataArrival&&this._onDataArrival(te,he,this._receivedLength)}},{key:"_onLoadEnd",value:function(Q){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===i.kError)return;this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(Q){this._status=i.kError;var te=0,he=null;if(this._contentLength&&Q.loaded<this._contentLength?(te=r.EARLY_EOF,he={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(te=r.EXCEPTION,he={code:-1,msg:Q.constructor.name+" "+Q.type}),this._onError)this._onError(te,he);else throw new u(he.msg)}}],[{key:"isSupported",value:function(){try{var Q=new XMLHttpRequest;return Q.open("GET","https://example.com",!0),Q.responseType="moz-chunked-arraybuffer",Q.responseType==="moz-chunked-arraybuffer"}catch(te){return M.w("MozChunkedLoader",te.message),!1}}}]),U}(n),c=f,S=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"xhr-msstream-loader"),te.TAG="MSStreamLoader",te._seekHandler=G,te._config=Q,te._needStash=!0,te._xhr=null,te._reader=null,te._totalRange=null,te._currentRange=null,te._currentRequestURL=null,te._currentRedirectedURL=null,te._contentLength=null,te._receivedLength=0,te._bufferLimit=16*1024*1024,te._lastTimeBufferSize=0,te._isReconnecting=!1,te}return Object(V.a)(U,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._reader&&(this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr=null),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q,te){this._internalOpen(Q,te,!1)}},{key:"_internalOpen",value:function(Q,te,he){this._dataSource=Q,he?this._currentRange=te:this._totalRange=te;var Le=Q.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?Le=this._currentRedirectedURL:Q.redirectedURL!=null&&(Le=Q.redirectedURL));var Ge=this._seekHandler.getConfig(Le,te);this._currentRequestURL=Ge.url;var Ot=this._reader=new self.MSStreamReader;Ot.onprogress=this._msrOnProgress.bind(this),Ot.onload=this._msrOnLoad.bind(this),Ot.onerror=this._msrOnError.bind(this);var Nt=this._xhr=new XMLHttpRequest;if(Nt.open("GET",Ge.url,!0),Nt.responseType="ms-stream",Nt.onreadystatechange=this._xhrOnReadyStateChange.bind(this),Nt.onerror=this._xhrOnError.bind(this),Q.withCredentials&&(Nt.withCredentials=!0),typeof Ge.headers=="object"){var Xe=Ge.headers;for(var It in Xe)Xe.hasOwnProperty(It)&&Nt.setRequestHeader(It,Xe[It])}if(typeof this._config.headers=="object"){var an=this._config.headers;for(var Ct in an)an.hasOwnProperty(Ct)&&Nt.setRequestHeader(Ct,an[Ct])}this._isReconnecting?this._isReconnecting=!1:this._status=i.kConnecting,Nt.send()}},{key:"abort",value:function(){this._internalAbort(),this._status=i.kComplete}},{key:"_internalAbort",value:function(){this._reader&&(this._reader.readyState===1&&this._reader.abort(),this._reader.onprogress=null,this._reader.onload=null,this._reader.onerror=null,this._reader=null),this._xhr&&(this._xhr.abort(),this._xhr.onreadystatechange=null,this._xhr=null)}},{key:"_xhrOnReadyStateChange",value:function(Q){var te=Q.target;if(te.readyState===2)if(te.status>=200&&te.status<=299){if(this._status=i.kBuffering,te.responseURL!=null){var he=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}var Le=te.getResponseHeader("Content-Length");if(Le!=null&&this._contentLength==null){var Ge=parseInt(Le);Ge>0&&(this._contentLength=Ge,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("MSStreamLoader: Http code invalid, "+te.status+" "+te.statusText);else if(te.readyState===3&&(te.status>=200&&te.status<=299)){this._status=i.kBuffering;var Ot=te.response;this._reader.readAsArrayBuffer(Ot)}}},{key:"_xhrOnError",value:function(Q){this._status=i.kError;var te=r.EXCEPTION,he={code:-1,msg:Q.constructor.name+" "+Q.type};if(this._onError)this._onError(te,he);else throw new u(he.msg)}},{key:"_msrOnProgress",value:function(Q){var te=Q.target,he=te.result;if(he==null){this._doReconnectIfNeeded();return}var Le=he.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=he.byteLength;var Ge=this._totalRange.from+this._receivedLength;this._receivedLength+=Le.byteLength,this._onDataArrival&&this._onDataArrival(Le,Ge,this._receivedLength),he.byteLength>=this._bufferLimit&&(M.v(this.TAG,"MSStream buffer exceeded max size near ".concat(Ge+Le.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength<this._contentLength){this._isReconnecting=!0,this._lastTimeBufferSize=0,this._internalAbort();var Q={from:this._totalRange.from+this._receivedLength,to:-1};this._internalOpen(this._dataSource,Q,!0)}}},{key:"_msrOnLoad",value:function(Q){this._status=i.kComplete,this._onComplete&&this._onComplete(this._totalRange.from,this._totalRange.from+this._receivedLength-1)}},{key:"_msrOnError",value:function(Q){this._status=i.kError;var te=0,he=null;if(this._contentLength&&this._receivedLength<this._contentLength?(te=r.EARLY_EOF,he={code:-1,msg:"MSStream meet Early-Eof"}):(te=r.EARLY_EOF,he={code:-1,msg:Q.constructor.name+" "+Q.type}),this._onError)this._onError(te,he);else throw new u(he.msg)}}],[{key:"isSupported",value:function(){try{if(typeof self.MSStream=="undefined"||typeof self.MSStreamReader=="undefined")return!1;var Q=new XMLHttpRequest;return Q.open("GET","https://example.com",!0),Q.responseType="ms-stream",Q.responseType==="ms-stream"}catch(te){return M.w("MSStreamLoader",te.message),!1}}}]),U}(n),y=S,b=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(G,Q){var te;return Object(ee.a)(this,U),te=se.call(this,"xhr-range-loader"),te.TAG="RangeLoader",te._seekHandler=G,te._config=Q,te._needStash=!1,te._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],te._currentChunkSizeKB=384,te._currentSpeedNormalized=0,te._zeroSpeedChunkCount=0,te._xhr=null,te._speedSampler=new I,te._requestAbort=!1,te._waitForTotalLength=!1,te._totalLengthReceived=!1,te._currentRequestURL=null,te._currentRedirectedURL=null,te._currentRequestRange=null,te._totalLength=null,te._contentLength=null,te._receivedLength=0,te._lastTimeLoaded=0,te}return Object(V.a)(U,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(Q,te){this._dataSource=Q,this._range=te,this._status=i.kConnecting;var he=!1;this._dataSource.filesize!=null&&this._dataSource.filesize!==0&&(he=!0,this._totalLength=this._dataSource.filesize),!this._totalLengthReceived&&!he?(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1})):this._openSubRange()}},{key:"_openSubRange",value:function(){var Q=this._currentChunkSizeKB*1024,te=this._range.from+this._receivedLength,he=te+Q;this._contentLength!=null&&(he-this._range.from>=this._contentLength&&(he=this._range.from+this._contentLength-1)),this._currentRequestRange={from:te,to:he},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(Q,te){this._lastTimeLoaded=0;var he=Q.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?he=this._currentRedirectedURL:Q.redirectedURL!=null&&(he=Q.redirectedURL));var Le=this._seekHandler.getConfig(he,te);this._currentRequestURL=Le.url;var Ge=this._xhr=new XMLHttpRequest;if(Ge.open("GET",Le.url,!0),Ge.responseType="arraybuffer",Ge.onreadystatechange=this._onReadyStateChange.bind(this),Ge.onprogress=this._onProgress.bind(this),Ge.onload=this._onLoad.bind(this),Ge.onerror=this._onXhrError.bind(this),Q.withCredentials&&(Ge.withCredentials=!0),typeof Le.headers=="object"){var Ot=Le.headers;for(var Nt in Ot)Ot.hasOwnProperty(Nt)&&Ge.setRequestHeader(Nt,Ot[Nt])}if(typeof this._config.headers=="object"){var Xe=this._config.headers;for(var It in Xe)Xe.hasOwnProperty(It)&&Ge.setRequestHeader(It,Xe[It])}Ge.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=i.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(Q){var te=Q.target;if(te.readyState===2){if(te.responseURL!=null){var he=this._seekHandler.removeURLParameters(te.responseURL);te.responseURL!==this._currentRequestURL&&he!==this._currentRedirectedURL&&(this._currentRedirectedURL=he,this._onURLRedirect&&this._onURLRedirect(he))}if(te.status>=200&&te.status<=299){if(this._waitForTotalLength)return;this._status=i.kBuffering}else if(this._status=i.kError,this._onError)this._onError(r.HTTP_STATUS_CODE_INVALID,{code:te.status,msg:te.statusText});else throw new u("RangeLoader: Http code invalid, "+te.status+" "+te.statusText)}}},{key:"_onProgress",value:function(Q){if(this._status===i.kError)return;if(this._contentLength===null){var te=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,te=!0;var he=Q.total;this._internalAbort(),he!=null&he!==0&&(this._totalLength=he)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,te){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Le=Q.loaded-this._lastTimeLoaded;this._lastTimeLoaded=Q.loaded,this._speedSampler.addBytes(Le)}},{key:"_normalizeSpeed",value:function(Q){var te=this._chunkSizeKBList,he=te.length-1,Le=0,Ge=0,Ot=he;if(Q<te[0])return te[0];for(;Ge<=Ot;){if(Le=Ge+Math.floor((Ot-Ge)/2),Le===he||Q>=te[Le]&&Q<te[Le+1])return te[Le];te[Le]<Q?Ge=Le+1:Ot=Le-1}}},{key:"_onLoad",value:function(Q){if(this._status===i.kError)return;if(this._waitForTotalLength){this._waitForTotalLength=!1;return}this._lastTimeLoaded=0;var te=this._speedSampler.lastSecondKBps;if(te===0&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(te=this._speedSampler.currentKBps)),te!==0){var he=this._normalizeSpeed(te);this._currentSpeedNormalized!==he&&(this._currentSpeedNormalized=he,this._currentChunkSizeKB=he)}var Le=Q.target.response,Ge=this._range.from+this._receivedLength;this._receivedLength+=Le.byteLength;var Ot=!1;this._contentLength!=null&&this._receivedLength<this._contentLength?this._openSubRange():Ot=!0,this._onDataArrival&&this._onDataArrival(Le,Ge,this._receivedLength),Ot&&(this._status=i.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(Q){this._status=i.kError;var te=0,he=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(te=r.EARLY_EOF,he={code:-1,msg:"RangeLoader meet Early-Eof"}):(te=r.EXCEPTION,he={code:-1,msg:Q.constructor.name+" "+Q.type}),this._onError)this._onError(te,he);else throw new u(he.msg)}}],[{key:"isSupported",value:function(){try{var Q=new XMLHttpRequest;return Q.open("GET","https://example.com",!0),Q.responseType="arraybuffer",Q.responseType==="arraybuffer"}catch(te){return M.w("RangeLoader",te.message),!1}}}]),U}(n),N=b,F=function(fe){Object(p.a)(U,fe);var se=Object(m.a)(U);function U(){var G;return Object(ee.a)(this,U),G=se.call(this,"websocket-loader"),G.TAG="WebSocketLoader",G._needStash=!0,G._ws=null,G._requestAbort=!1,G._receivedLength=0,G}return Object(V.a)(U,[{key:"destroy",value:function(){this._ws&&this.abort(),T(Object(d.a)(U.prototype),"destroy",this).call(this)}},{key:"open",value:function(Q){try{var te=this._ws=new self.WebSocket(Q.url);te.binaryType="arraybuffer",te.onopen=this._onWebSocketOpen.bind(this),te.onclose=this._onWebSocketClose.bind(this),te.onmessage=this._onWebSocketMessage.bind(this),te.onerror=this._onWebSocketError.bind(this),this._status=i.kConnecting}catch(Le){this._status=i.kError;var he={code:Le.code,msg:Le.message};if(this._onError)this._onError(r.EXCEPTION,he);else throw new u(he.msg)}}},{key:"abort",value:function(){var Q=this._ws;Q&&(Q.readyState===0||Q.readyState===1)&&(this._requestAbort=!0,Q.close()),this._ws=null,this._status=i.kComplete}},{key:"_onWebSocketOpen",value:function(Q){this._status=i.kBuffering}},{key:"_onWebSocketClose",value:function(Q){if(this._requestAbort===!0){this._requestAbort=!1;return}this._status=i.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)}},{key:"_onWebSocketMessage",value:function(Q){var te=this;if(Q.data instanceof ArrayBuffer)this._dispatchArrayBuffer(Q.data);else if(Q.data instanceof Blob){var he=new FileReader;he.onload=function(){te._dispatchArrayBuffer(he.result)},he.readAsArrayBuffer(Q.data)}else{this._status=i.kError;var Le={code:-1,msg:"Unsupported WebSocket message type: "+Q.data.constructor.name};if(this._onError)this._onError(r.EXCEPTION,Le);else throw new u(Le.msg)}}},{key:"_dispatchArrayBuffer",value:function(Q){var te=Q,he=this._receivedLength;this._receivedLength+=te.byteLength,this._onDataArrival&&this._onDataArrival(te,he,this._receivedLength)}},{key:"_onWebSocketError",value:function(Q){this._status=i.kError;var te={code:Q.code,msg:Q.message};if(this._onError)this._onError(r.EXCEPTION,te);else throw new u(te.msg)}}],[{key:"isSupported",value:function(){try{return typeof self.WebSocket!="undefined"}catch(Q){return!1}}}]),U}(n),X=F,Z=function(){function fe(se){Object(ee.a)(this,fe),this._zeroStart=se||!1}return Object(V.a)(fe,[{key:"getConfig",value:function(U,G){var Q={};if(G.from!==0||G.to!==-1){var te;G.to!==-1?te="bytes=".concat(G.from.toString(),"-").concat(G.to.toString()):te="bytes=".concat(G.from.toString(),"-"),Q.Range=te}else this._zeroStart&&(Q.Range="bytes=0-");return{url:U,headers:Q}}},{key:"removeURLParameters",value:function(U){return U}}]),fe}(),H=Z,A=function(){function fe(se,U){Object(ee.a)(this,fe),this._startName=se,this._endName=U}return Object(V.a)(fe,[{key:"getConfig",value:function(U,G){var Q=U;if(G.from!==0||G.to!==-1){var te=!0;Q.indexOf("?")===-1&&(Q+="?",te=!1),te&&(Q+="&"),Q+="".concat(this._startName,"=").concat(G.from.toString()),G.to!==-1&&(Q+="&".concat(this._endName,"=").concat(G.to.toString()))}return{url:Q,headers:{}}}},{key:"removeURLParameters",value:function(U){var G=U.split("?")[0],Q=void 0,te=U.indexOf("?");te!==-1&&(Q=U.substring(te+1));var he="";if(Q!=null&&Q.length>0)for(var Le=Q.split("&"),Ge=0;Ge<Le.length;Ge++){var Ot=Le[Ge].split("="),Nt=Ge>0;Ot[0]!==this._startName&&Ot[0]!==this._endName&&(Nt&&(he+="&"),he+=Le[Ge])}return he.length===0?G:G+"?"+he}}]),fe}(),z=A,ne=function(){function fe(se,U,G){Object(ee.a)(this,fe),this.TAG="IOController",this._config=U,this._extraData=G,this._stashInitialSize=1024*384,U.stashInitialSize!=null&&U.stashInitialSize>0&&(this._stashInitialSize=U.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,U.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=se,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(se.url),this._refTotalLength=se.filesize?se.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new I,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(V.a)(fe,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(U){this._extraData=U}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(U){this._onDataArrival=U}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(U){this._onSeeked=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onComplete",get:function(){return this._onComplete},set:function(U){this._onComplete=U}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(U){this._onRedirect=U}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(U){this._onRecoveredEarlyEof=U}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===N?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var U=this._config;if(U.seekType==="range")this._seekHandler=new H(this._config.rangeLoadZeroStart);else if(U.seekType==="param"){var G=U.seekParamStart||"bstart",Q=U.seekParamEnd||"bend";this._seekHandler=new z(G,Q)}else if(U.seekType==="custom"){if(typeof U.customSeekHandler!="function")throw new s("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new U.customSeekHandler}else throw new s("Invalid seekType in config: ".concat(U.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=X;else if(_.isSupported())this._loaderClass=_;else if(c.isSupported())this._loaderClass=c;else if(N.isSupported())this._loaderClass=N;else throw new u("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(U){this._currentRange={from:0,to:-1},U&&(this._currentRange.from=U),this._speedSampler.reset(),U||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var U=this._resumeFrom;this._resumeFrom=0,this._internalSeek(U,!0)}}},{key:"seek",value:function(U){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(U,!0)}},{key:"_internalSeek",value:function(U,G){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(G),this._loader.destroy(),this._loader=null;var Q={from:U,to:-1};this._currentRange={from:Q.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,Q),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(U){if(!U||typeof U!="string"||U.length===0)throw new s("Url must be a non-empty string!");this._dataSource.url=U}},{key:"_expandBuffer",value:function(U){for(var G=this._stashSize;G+1024*1024*1<U;)G*=2;if(G+=1024*1024*1,G===this._bufferSize)return;var Q=new ArrayBuffer(G);if(this._stashUsed>0){var te=new Uint8Array(this._stashBuffer,0,this._stashUsed),he=new Uint8Array(Q,0,G);he.set(te,0)}this._stashBuffer=Q,this._bufferSize=G}},{key:"_normalizeSpeed",value:function(U){var G=this._speedNormalizeList,Q=G.length-1,te=0,he=0,Le=Q;if(U<G[0])return G[0];for(;he<=Le;){if(te=he+Math.floor((Le-he)/2),te===Q||U>=G[te]&&U<G[te+1])return G[te];G[te]<U?he=te+1:Le=te-1}}},{key:"_adjustStashSize",value:function(U){var G=0;this._config.isLive||U<512?G=U:U>=512&&U<=1024?G=Math.floor(U*1.5):G=U*2,G>8192&&(G=8192);var Q=G*1024+1024*1024*1;this._bufferSize<Q&&this._expandBuffer(Q),this._stashSize=G*1024}},{key:"_dispatchChunks",value:function(U,G){return this._currentRange.to=G+U.byteLength-1,this._onDataArrival(U,G)}},{key:"_onURLRedirect",value:function(U){this._redirectedURL=U,this._onRedirect&&this._onRedirect(U)}},{key:"_onContentLengthKnown",value:function(U){U&&this._fullRequestFlag&&(this._totalLength=U,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(U,G,Q){if(!this._onDataArrival)throw new h("IOController: No existing consumer (onDataArrival) callback!");if(this._paused)return;this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(U.byteLength);var te=this._speedSampler.lastSecondKBps;if(te!==0){var he=this._normalizeSpeed(te);this._speedNormalized!==he&&(this._speedNormalized=he,this._adjustStashSize(he))}if(this._enableStash)if(this._stashUsed===0&&this._stashByteStart===0&&(this._stashByteStart=G),this._stashUsed+U.byteLength<=this._stashSize){var an=new Uint8Array(this._stashBuffer,0,this._stashSize);an.set(new Uint8Array(U),this._stashUsed),this._stashUsed+=U.byteLength}else{var Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var pn=this._stashBuffer.slice(0,this._stashUsed),nn=this._dispatchChunks(pn,this._stashByteStart);if(nn<pn.byteLength){if(nn>0){var $=new Uint8Array(pn,nn);Ct.set($,0),this._stashUsed=$.byteLength,this._stashByteStart+=nn}}else this._stashUsed=0,this._stashByteStart+=nn;this._stashUsed+U.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+U.byteLength),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(U),this._stashUsed),this._stashUsed+=U.byteLength}else{var C=this._dispatchChunks(U,G);if(C<U.byteLength){var D=U.byteLength-C;D>this._bufferSize&&(this._expandBuffer(D),Ct=new Uint8Array(this._stashBuffer,0,this._bufferSize)),Ct.set(new Uint8Array(U,C),0),this._stashUsed+=D,this._stashByteStart=G+C}}}else if(this._stashUsed===0){var Le=this._dispatchChunks(U,G);if(Le<U.byteLength){var Ge=U.byteLength-Le;Ge>this._bufferSize&&this._expandBuffer(Ge);var Ot=new Uint8Array(this._stashBuffer,0,this._bufferSize);Ot.set(new Uint8Array(U,Le),0),this._stashUsed+=Ge,this._stashByteStart=G+Le}}else{this._stashUsed+U.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+U.byteLength);var Nt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Nt.set(new Uint8Array(U),this._stashUsed),this._stashUsed+=U.byteLength;var Xe=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Xe<this._stashUsed&&Xe>0){var It=new Uint8Array(this._stashBuffer,Xe);Nt.set(It,0)}this._stashUsed-=Xe,this._stashByteStart+=Xe}}},{key:"_flushStashBuffer",value:function(U){if(this._stashUsed>0){var G=this._stashBuffer.slice(0,this._stashUsed),Q=this._dispatchChunks(G,this._stashByteStart),te=G.byteLength-Q;if(Q<G.byteLength)if(U)M.w(this.TAG,"".concat(te," bytes unconsumed data remain when flush buffer, dropped"));else{if(Q>0){var he=new Uint8Array(this._stashBuffer,0,this._bufferSize),Le=new Uint8Array(G,Q);he.set(Le,0),this._stashUsed=Le.byteLength,this._stashByteStart+=Q}return 0}return this._stashUsed=0,this._stashByteStart=0,te}return 0}},{key:"_onLoaderComplete",value:function(U,G){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(U,G){M.e(this.TAG,"Loader error, code = ".concat(G.code,", msg = ").concat(G.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,U=r.UNRECOVERABLE_EARLY_EOF);switch(U){case r.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var Q=this._currentRange.to+1;Q<this._totalLength&&(M.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(Q,!1));return}U=r.UNRECOVERABLE_EARLY_EOF;break}case r.UNRECOVERABLE_EARLY_EOF:case r.CONNECTING_TIMEOUT:case r.HTTP_STATUS_CODE_INVALID:case r.EXCEPTION:break}if(this._onError)this._onError(U,G);else throw new u("IOException: "+G.msg)}}]),fe}(),ae=ne,me={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:3*60,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:3*60,autoCleanupMinBackwardDuration:2*60,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function xe(){return Object.assign({},me)}var Te=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var U=new ae({},xe()),G=U.loaderType;return U.destroy(),G=="fetch-stream-loader"||G=="xhr-moz-chunked-loader"}},{key:"getNetworkLoaderTypeName",value:function(){var U=new ae({},xe()),G=U.loaderType;return U.destroy(),G}},{key:"supportNativeMediaPlayback",value:function(U){fe.videoElement==null&&(fe.videoElement=window.document.createElement("video"));var G=fe.videoElement.canPlayType(U);return G==="probably"||G=="maybe"}},{key:"getFeatureList",value:function(){var U={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return U.mseFlvPlayback=fe.supportMSEH264Playback(),U.networkStreamIO=fe.supportNetworkStreamIO(),U.networkLoaderName=fe.getNetworkLoaderTypeName(),U.mseLiveFlvPlayback=U.mseFlvPlayback&&U.networkStreamIO,U.nativeMP4H264Playback=fe.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),U.nativeWebmVP8Playback=fe.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),U.nativeWebmVP9Playback=fe.supportNativeMediaPlayback('video/webm; codecs="vp9"'),U}}]),fe}(),Oe=Te,Ue={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},De=Ue,be=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"forceGlobalTag",get:function(){return M.FORCE_GLOBAL_TAG},set:function(U){M.FORCE_GLOBAL_TAG=U,fe._notifyChange()}},{key:"globalTag",get:function(){return M.GLOBAL_TAG},set:function(U){M.GLOBAL_TAG=U,fe._notifyChange()}},{key:"enableAll",get:function(){return M.ENABLE_VERBOSE&&M.ENABLE_DEBUG&&M.ENABLE_INFO&&M.ENABLE_WARN&&M.ENABLE_ERROR},set:function(U){M.ENABLE_VERBOSE=U,M.ENABLE_DEBUG=U,M.ENABLE_INFO=U,M.ENABLE_WARN=U,M.ENABLE_ERROR=U,fe._notifyChange()}},{key:"enableDebug",get:function(){return M.ENABLE_DEBUG},set:function(U){M.ENABLE_DEBUG=U,fe._notifyChange()}},{key:"enableVerbose",get:function(){return M.ENABLE_VERBOSE},set:function(U){M.ENABLE_VERBOSE=U,fe._notifyChange()}},{key:"enableInfo",get:function(){return M.ENABLE_INFO},set:function(U){M.ENABLE_INFO=U,fe._notifyChange()}},{key:"enableWarn",get:function(){return M.ENABLE_WARN},set:function(U){M.ENABLE_WARN=U,fe._notifyChange()}},{key:"enableError",get:function(){return M.ENABLE_ERROR},set:function(U){M.ENABLE_ERROR=U,fe._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:M.GLOBAL_TAG,forceGlobalTag:M.FORCE_GLOBAL_TAG,enableVerbose:M.ENABLE_VERBOSE,enableDebug:M.ENABLE_DEBUG,enableInfo:M.ENABLE_INFO,enableWarn:M.ENABLE_WARN,enableError:M.ENABLE_ERROR,enableCallback:M.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(U){M.GLOBAL_TAG=U.globalTag,M.FORCE_GLOBAL_TAG=U.forceGlobalTag,M.ENABLE_VERBOSE=U.enableVerbose,M.ENABLE_DEBUG=U.enableDebug,M.ENABLE_INFO=U.enableInfo,M.ENABLE_WARN=U.enableWarn,M.ENABLE_ERROR=U.enableError,M.ENABLE_CALLBACK=U.enableCallback}},{key:"_notifyChange",value:function(){var U=fe.emitter;if(U.listenerCount("change")>0){var G=fe.getConfig();U.emit("change",G)}}},{key:"registerListener",value:function(U){fe.emitter.addListener("change",U)}},{key:"removeListener",value:function(U){fe.emitter.removeListener("change",U)}},{key:"addLogListener",value:function(U){M.emitter.addListener("log",U),M.emitter.listenerCount("log")>0&&(M.ENABLE_CALLBACK=!0,fe._notifyChange())}},{key:"removeLogListener",value:function(U){M.emitter.removeListener("log",U),M.emitter.listenerCount("log")===0&&(M.ENABLE_CALLBACK=!1,fe._notifyChange())}}]),fe}();be.emitter=new R.a;var ge=be,He=function(){function fe(){Object(ee.a)(this,fe),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(V.a)(fe,[{key:"isComplete",value:function(){var U=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,G=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&U&&G}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(U){if(this.keyframesIndex==null)return null;var G=this.keyframesIndex,Q=this._search(G.times,U);return{index:Q,milliseconds:G.times[Q],fileposition:G.filepositions[Q]}}},{key:"_search",value:function(U,G){var Q=0,te=U.length-1,he=0,Le=0,Ge=te;for(G<U[0]&&(Q=0,Le=Ge+1);Le<=Ge;)if(he=Le+Math.floor((Ge-Le)/2),he===te||G>=U[he]&&G<U[he+1]){Q=he;break}else U[he]<G?Le=he+1:Ge=he-1;return Q}}]),fe}(),ct=He;function vt(fe,se,U){var G=fe;if(se+U<G.length){for(;U--;)if((G[++se]&192)!==128)return!1;return!0}else return!1}function _t(fe){for(var se=[],U=fe,G=0,Q=fe.length;G<Q;){if(U[G]<128){se.push(String.fromCharCode(U[G])),++G;continue}else if(!(U[G]<192)){if(U[G]<224){if(vt(U,G,1)){var te=(U[G]&31)<<6|U[G+1]&63;if(te>=128){se.push(String.fromCharCode(te&65535)),G+=2;continue}}}else if(U[G]<240){if(vt(U,G,2)){var he=(U[G]&15)<<12|(U[G+1]&63)<<6|U[G+2]&63;if(he>=2048&&(he&63488)!==55296){se.push(String.fromCharCode(he&65535)),G+=3;continue}}}else if(U[G]<248&&vt(U,G,3)){var Le=(U[G]&7)<<18|(U[G+1]&63)<<12|(U[G+2]&63)<<6|U[G+3]&63;if(Le>65536&&Le<1114112){Le-=65536,se.push(String.fromCharCode(Le>>>10|55296)),se.push(String.fromCharCode(Le&1023|56320)),G+=4;continue}}}se.push(String.fromCharCode(65533)),++G}return se.join("")}var yt=_t,et=function(){var fe=new ArrayBuffer(2);return new DataView(fe).setInt16(0,256,!0),new Int16Array(fe)[0]===256}(),ht=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"parseScriptData",value:function(U,G,Q){var te={};try{var he=fe.parseValue(U,G,Q),Le=fe.parseValue(U,G+he.size,Q-he.size);te[he.data]=Le.data}catch(Ge){M.e("AMF",Ge.toString())}return te}},{key:"parseObject",value:function(U,G,Q){if(Q<3)throw new h("Data not enough when parse ScriptDataObject");var te=fe.parseString(U,G,Q),he=fe.parseValue(U,G+te.size,Q-te.size),Le=he.objectEnd;return{data:{name:te.data,value:he.data},size:te.size+he.size,objectEnd:Le}}},{key:"parseVariable",value:function(U,G,Q){return fe.parseObject(U,G,Q)}},{key:"parseString",value:function(U,G,Q){if(Q<2)throw new h("Data not enough when parse String");var te=new DataView(U,G,Q),he=te.getUint16(0,!et),Le;return he>0?Le=yt(new Uint8Array(U,G+2,he)):Le="",{data:Le,size:2+he}}},{key:"parseLongString",value:function(U,G,Q){if(Q<4)throw new h("Data not enough when parse LongString");var te=new DataView(U,G,Q),he=te.getUint32(0,!et),Le;return he>0?Le=yt(new Uint8Array(U,G+4,he)):Le="",{data:Le,size:4+he}}},{key:"parseDate",value:function(U,G,Q){if(Q<10)throw new h("Data size invalid when parse Date");var te=new DataView(U,G,Q),he=te.getFloat64(0,!et),Le=te.getInt16(8,!et);return he+=Le*60*1e3,{data:new Date(he),size:8+2}}},{key:"parseValue",value:function(U,G,Q){if(Q<1)throw new h("Data not enough when parse Value");var te=new DataView(U,G,Q),he=1,Le=te.getUint8(0),Ge,Ot=!1;try{switch(Le){case 0:Ge=te.getFloat64(1,!et),he+=8;break;case 1:{var Nt=te.getUint8(1);Ge=!!Nt,he+=1;break}case 2:{var Xe=fe.parseString(U,G+1,Q-1);Ge=Xe.data,he+=Xe.size;break}case 3:{Ge={};var It=0;for((te.getUint32(Q-4,!et)&16777215)===9&&(It=3);he<Q-4;){var an=fe.parseObject(U,G+he,Q-he-It);if(an.objectEnd)break;Ge[an.data.name]=an.data.value,he+=an.size}if(he<=Q-3){var Ct=te.getUint32(he-1,!et)&16777215;Ct===9&&(he+=3)}break}case 8:{Ge={},he+=4;var pn=0;for((te.getUint32(Q-4,!et)&16777215)===9&&(pn=3);he<Q-8;){var nn=fe.parseVariable(U,G+he,Q-he-pn);if(nn.objectEnd)break;Ge[nn.data.name]=nn.data.value,he+=nn.size}if(he<=Q-3){var $=te.getUint32(he-1,!et)&16777215;$===9&&(he+=3)}break}case 9:Ge=void 0,he=1,Ot=!0;break;case 10:{Ge=[];var C=te.getUint32(1,!et);he+=4;for(var D=0;D<C;D++){var K=fe.parseValue(U,G+he,Q-he);Ge.push(K.data),he+=K.size}break}case 11:{var re=fe.parseDate(U,G+1,Q-1);Ge=re.data,he+=re.size;break}case 12:{var J=fe.parseString(U,G+1,Q-1);Ge=J.data,he+=J.size;break}default:he=Q,M.w("AMF","Unsupported AMF value type "+Le)}}catch(Re){M.e("AMF",Re.toString())}return{data:Ge,size:he,objectEnd:Ot}}}]),fe}(),xt=ht,Tt=function(){function fe(se){Object(ee.a)(this,fe),this.TAG="ExpGolomb",this._buffer=se,this._buffer_index=0,this._total_bytes=se.byteLength,this._total_bits=se.byteLength*8,this._current_word=0,this._current_word_bits_left=0}return Object(V.a)(fe,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var U=this._total_bytes-this._buffer_index;if(U<=0)throw new h("ExpGolomb: _fillCurrentWord() but no bytes available");var G=Math.min(4,U),Q=new Uint8Array(4);Q.set(this._buffer.subarray(this._buffer_index,this._buffer_index+G)),this._current_word=new DataView(Q.buffer).getUint32(0,!1),this._buffer_index+=G,this._current_word_bits_left=G*8}},{key:"readBits",value:function(U){if(U>32)throw new s("ExpGolomb: readBits() bits exceeded max 32bits!");if(U<=this._current_word_bits_left){var G=this._current_word>>>32-U;return this._current_word<<=U,this._current_word_bits_left-=U,G}var Q=this._current_word_bits_left?this._current_word:0;Q=Q>>>32-this._current_word_bits_left;var te=U-this._current_word_bits_left;this._fillCurrentWord();var he=Math.min(te,this._current_word_bits_left),Le=this._current_word>>>32-he;return this._current_word<<=he,this._current_word_bits_left-=he,Q=Q<<he|Le,Q}},{key:"readBool",value:function(){return this.readBits(1)===1}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var U;for(U=0;U<this._current_word_bits_left;U++)if((this._current_word&2147483648>>>U)!==0)return this._current_word<<=U,this._current_word_bits_left-=U,U;return this._fillCurrentWord(),U+this._skipLeadingZero()}},{key:"readUEG",value:function(){var U=this._skipLeadingZero();return this.readBits(U+1)-1}},{key:"readSEG",value:function(){var U=this.readUEG();return U&1?U+1>>>1:-1*(U>>>1)}}]),fe}(),mt=Tt,Ie=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"_ebsp2rbsp",value:function(U){for(var G=U,Q=G.byteLength,te=new Uint8Array(Q),he=0,Le=0;Le<Q;Le++){if(Le>=2&&(G[Le]===3&&G[Le-1]===0&&G[Le-2]===0))continue;te[he]=G[Le],he++}return new Uint8Array(te.buffer,0,he)}},{key:"parseSPS",value:function(U){var G=fe._ebsp2rbsp(U),Q=new mt(G);Q.readByte();var te=Q.readByte();Q.readByte();var he=Q.readByte();Q.readUEG();var Le=fe.getProfileString(te),Ge=fe.getLevelString(he),Ot=1,Nt=420,Xe=[0,420,422,444],It=8;if((te===100||te===110||te===122||te===244||te===44||te===83||te===86||te===118||te===128||te===138||te===144)&&(Ot=Q.readUEG(),Ot===3&&Q.readBits(1),Ot<=3&&(Nt=Xe[Ot]),It=Q.readUEG()+8,Q.readUEG(),Q.readBits(1),Q.readBool()))for(var an=Ot!==3?8:12,Ct=0;Ct<an;Ct++)Q.readBool()&&(Ct<6?fe._skipScalingList(Q,16):fe._skipScalingList(Q,64));Q.readUEG();var pn=Q.readUEG();if(pn===0)Q.readUEG();else if(pn===1){Q.readBits(1),Q.readSEG(),Q.readSEG();for(var nn=Q.readUEG(),$=0;$<nn;$++)Q.readSEG()}var C=Q.readUEG();Q.readBits(1);var D=Q.readUEG(),K=Q.readUEG(),re=Q.readBits(1);re===0&&Q.readBits(1),Q.readBits(1);var J=0,Re=0,ut=0,St=0,Yt=Q.readBool();Yt&&(J=Q.readUEG(),Re=Q.readUEG(),ut=Q.readUEG(),St=Q.readUEG());var dt=1,Gt=1,sn=0,Wn=!0,Si=0,hi=0,Fn=Q.readBool();if(Fn){if(Q.readBool()){var di=Q.readByte(),Zi=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],_i=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];di>0&&di<16?(dt=Zi[di-1],Gt=_i[di-1]):di===255&&(dt=Q.readByte()<<8|Q.readByte(),Gt=Q.readByte()<<8|Q.readByte())}if(Q.readBool()&&Q.readBool(),Q.readBool()&&(Q.readBits(4),Q.readBool()&&Q.readBits(24)),Q.readBool()&&(Q.readUEG(),Q.readUEG()),Q.readBool()){var ri=Q.readBits(32),wi=Q.readBits(32);Wn=Q.readBool(),Si=wi,hi=ri*2,sn=Si/hi}}var Di=1;(dt!==1||Gt!==1)&&(Di=dt/Gt);var Oi=0,Ri=0;if(Ot===0)Oi=1,Ri=2-re;else{var Vi=Ot===3?1:2,cr=Ot===1?2:1;Oi=Vi,Ri=cr*(2-re)}var rr=(D+1)*16,ji=(2-re)*((K+1)*16);rr-=(J+Re)*Oi,ji-=(ut+St)*Ri;var Wi=Math.ceil(rr*Di);return Q.destroy(),Q=null,{profile_string:Le,level_string:Ge,bit_depth:It,ref_frames:C,chroma_format:Nt,chroma_format_string:fe.getChromaFormatString(Nt),frame_rate:{fixed:Wn,fps:sn,fps_den:hi,fps_num:Si},sar_ratio:{width:dt,height:Gt},codec_size:{width:rr,height:ji},present_size:{width:Wi,height:ji}}}},{key:"_skipScalingList",value:function(U,G){for(var Q=8,te=8,he=0,Le=0;Le<G;Le++)te!==0&&(he=U.readSEG(),te=(Q+he+256)%256),Q=te===0?Q:te}},{key:"getProfileString",value:function(U){switch(U){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(U){return(U/10).toFixed(1)}},{key:"getChromaFormatString",value:function(U){switch(U){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),fe}(),je=Ie,$e={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},at=$e;function lt(fe){return fe>>>8&255|(fe&255)<<8}function bt(fe){return(fe&4278190080)>>>24|(fe&16711680)>>>8|(fe&65280)<<8|(fe&255)<<24}function Mt(fe,se){return fe[se]<<24|fe[se+1]<<16|fe[se+2]<<8|fe[se+3]}var jt=function(){function fe(se,U){Object(ee.a)(this,fe),this.TAG="FLVDemuxer",this._config=U,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=se.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=se.hasAudioTrack,this._hasVideo=se.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new ct,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var G=new ArrayBuffer(2);return new DataView(G).setInt16(0,256,!0),new Int16Array(G)[0]===256}()}return Object(V.a)(fe,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(U){return U.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(U){this._onTrackMetadata=U}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(U){this._onMediaInfo=U}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(U){this._onMetaDataArrived=U}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(U){this._onScriptDataArrived=U}},{key:"onError",get:function(){return this._onError},set:function(U){this._onError=U}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(U){this._onDataAvailable=U}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(U){this._timestampBase=U}},{key:"overridedDuration",get:function(){return this._duration},set:function(U){this._durationOverrided=!0,this._duration=U,this._mediaInfo.duration=U}},{key:"overridedHasAudio",set:function(U){this._hasAudioFlagOverrided=!0,this._hasAudio=U,this._mediaInfo.hasAudio=U}},{key:"overridedHasVideo",set:function(U){this._hasVideoFlagOverrided=!0,this._hasVideo=U,this._mediaInfo.hasVideo=U}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new ct}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(U,G){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new h("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var Q=0,te=this._littleEndian;if(G===0)if(U.byteLength>13){var he=fe.probe(U);Q=he.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,G+Q!==this._dataOffset&&M.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Le=new DataView(U,Q),Ge=Le.getUint32(0,!te);Ge!==0&&M.w(this.TAG,"PrevTagSize0 !== 0 !!!"),Q+=4}for(;Q<U.byteLength;){this._dispatch=!0;var Ot=new DataView(U,Q);if(Q+11+4>U.byteLength)break;var Nt=Ot.getUint8(0),Xe=Ot.getUint32(0,!te)&16777215;if(Q+11+Xe+4>U.byteLength)break;if(Nt!==8&&Nt!==9&&Nt!==18){M.w(this.TAG,"Unsupported tag type ".concat(Nt,", skipped")),Q+=11+Xe+4;continue}var It=Ot.getUint8(4),an=Ot.getUint8(5),Ct=Ot.getUint8(6),pn=Ot.getUint8(7),nn=Ct|an<<8|It<<16|pn<<24,$=Ot.getUint32(7,!te)&16777215;$!==0&&M.w(this.TAG,"Meet tag which has StreamID != 0!");var C=Q+11;switch(Nt){case 8:this._parseAudioData(U,C,Xe,nn);break;case 9:this._parseVideoData(U,C,Xe,nn,G+Q);break;case 18:this._parseScriptData(U,C,Xe);break}var D=Ot.getUint32(11+Xe,!te);D!==11+Xe&&M.w(this.TAG,"Invalid PrevTagSize ".concat(D)),Q+=11+Xe+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),Q}},{key:"_parseScriptData",value:function(U,G,Q){var te=xt.parseScriptData(U,G,Q);if(te.hasOwnProperty("onMetaData")){if(te.onMetaData==null||typeof te.onMetaData!="object"){M.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&M.w(this.TAG,"Found another onMetaData tag!"),this._metadata=te;var he=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},he)),typeof he.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=he.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof he.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=he.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof he.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=he.audiodatarate),typeof he.videodatarate=="number"&&(this._mediaInfo.videoDataRate=he.videodatarate),typeof he.width=="number"&&(this._mediaInfo.width=he.width),typeof he.height=="number"&&(this._mediaInfo.height=he.height),typeof he.duration=="number"){if(!this._durationOverrided){var Le=Math.floor(he.duration*this._timescale);this._duration=Le,this._mediaInfo.duration=Le}}else this._mediaInfo.duration=0;if(typeof he.framerate=="number"){var Ge=Math.floor(he.framerate*1e3);if(Ge>0){var Ot=Ge/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=Ot,this._referenceFrameRate.fps_num=Ge,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=Ot}}if(typeof he.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Nt=he.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Nt),he.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=he,M.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(te).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},te)))}},{key:"_parseKeyframesIndex",value:function(U){for(var G=[],Q=[],te=1;te<U.times.length;te++){var he=this._timestampBase+Math.floor(U.times[te]*1e3);G.push(he),Q.push(U.filepositions[te])}return{times:G,filepositions:Q}}},{key:"_parseAudioData",value:function(U,G,Q,te){if(Q<=1){M.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");return}if(this._hasAudioFlagOverrided===!0&&this._hasAudio===!1)return;var he=this._littleEndian,Le=new DataView(U,G,Q),Ge=Le.getUint8(0),Ot=Ge>>>4;if(Ot!==2&&Ot!==10){this._onError(at.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+Ot);return}var Nt=0,Xe=(Ge&12)>>>2;if(Xe>=0&&Xe<=4)Nt=this._flvSoundRateTable[Xe];else{this._onError(at.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Xe);return}var It=(Ge&2)>>>1,an=Ge&1,Ct=this._audioMetadata,pn=this._audioTrack;if(Ct||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),Ct=this._audioMetadata={},Ct.type="audio",Ct.id=pn.id,Ct.timescale=this._timescale,Ct.duration=this._duration,Ct.audioSampleRate=Nt,Ct.channelCount=an===0?1:2),Ot===10){var nn=this._parseAACAudioData(U,G+1,Q-1);if(nn==null)return;if(nn.packetType===0){Ct.config&&M.w(this.TAG,"Found another AudioSpecificConfig!");var $=nn.data;Ct.audioSampleRate=$.samplingRate,Ct.channelCount=$.channelCount,Ct.codec=$.codec,Ct.originalCodec=$.originalCodec,Ct.config=$.config,Ct.refSampleDuration=1024/Ct.audioSampleRate*Ct.timescale,M.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",Ct);var C=this._mediaInfo;C.audioCodec=Ct.originalCodec,C.audioSampleRate=Ct.audioSampleRate,C.audioChannelCount=Ct.channelCount,C.hasVideo?C.videoCodec!=null&&(C.mimeType='video/x-flv; codecs="'+C.videoCodec+","+C.audioCodec+'"'):C.mimeType='video/x-flv; codecs="'+C.audioCodec+'"',C.isComplete()&&this._onMediaInfo(C)}else if(nn.packetType===1){var D=this._timestampBase+te,K={unit:nn.data,length:nn.data.byteLength,dts:D,pts:D};pn.samples.push(K),pn.length+=nn.data.length}else M.e(this.TAG,"Flv: Unsupported AAC data type ".concat(nn.packetType))}else if(Ot===2){if(!Ct.codec){var re=this._parseMP3AudioData(U,G+1,Q-1,!0);if(re==null)return;Ct.audioSampleRate=re.samplingRate,Ct.channelCount=re.channelCount,Ct.codec=re.codec,Ct.originalCodec=re.originalCodec,Ct.refSampleDuration=1152/Ct.audioSampleRate*Ct.timescale,M.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",Ct);var J=this._mediaInfo;J.audioCodec=Ct.codec,J.audioSampleRate=Ct.audioSampleRate,J.audioChannelCount=Ct.channelCount,J.audioDataRate=re.bitRate,J.hasVideo?J.videoCodec!=null&&(J.mimeType='video/x-flv; codecs="'+J.videoCodec+","+J.audioCodec+'"'):J.mimeType='video/x-flv; codecs="'+J.audioCodec+'"',J.isComplete()&&this._onMediaInfo(J)}var Re=this._parseMP3AudioData(U,G+1,Q-1,!1);if(Re==null)return;var ut=this._timestampBase+te,St={unit:Re,length:Re.byteLength,dts:ut,pts:ut};pn.samples.push(St),pn.length+=Re.length}}},{key:"_parseAACAudioData",value:function(U,G,Q){if(Q<=1){M.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var te={},he=new Uint8Array(U,G,Q);return te.packetType=he[0],he[0]===0?te.data=this._parseAACAudioSpecificConfig(U,G+1,Q-1):te.data=he.subarray(1),te}},{key:"_parseAACAudioSpecificConfig",value:function(U,G,Q){var te=new Uint8Array(U,G,Q),he=null,Le=0,Ge=0,Ot=null,Nt=0,Xe=null;if(Le=Ge=te[0]>>>3,Nt=(te[0]&7)<<1|te[1]>>>7,Nt<0||Nt>=this._mpegSamplingRates.length){this._onError(at.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var It=this._mpegSamplingRates[Nt],an=(te[1]&120)>>>3;if(an<0||an>=8){this._onError(at.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Le===5&&(Xe=(te[1]&7)<<1|te[2]>>>7,Ot=(te[2]&124)>>>2);var Ct=self.navigator.userAgent.toLowerCase();return Ct.indexOf("firefox")!==-1?Nt>=6?(Le=5,he=new Array(4),Xe=Nt-3):(Le=2,he=new Array(2),Xe=Nt):Ct.indexOf("android")!==-1?(Le=2,he=new Array(2),Xe=Nt):(Le=5,Xe=Nt,he=new Array(4),Nt>=6?Xe=Nt-3:an===1&&(Le=2,he=new Array(2),Xe=Nt)),he[0]=Le<<3,he[0]|=(Nt&15)>>>1,he[1]=(Nt&15)<<7,he[1]|=(an&15)<<3,Le===5&&(he[1]|=(Xe&15)>>>1,he[2]=(Xe&1)<<7,he[2]|=2<<2,he[3]=0),{config:he,samplingRate:It,channelCount:an,codec:"mp4a.40."+Le,originalCodec:"mp4a.40."+Ge}}},{key:"_parseMP3AudioData",value:function(U,G,Q,te){if(Q<4){M.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var he=this._littleEndian,Le=new Uint8Array(U,G,Q),Ge=null;if(te){if(Le[0]!==255)return;var Ot=Le[1]>>>3&3,Nt=(Le[1]&6)>>1,Xe=(Le[2]&240)>>>4,It=(Le[2]&12)>>>2,an=Le[3]>>>6&3,Ct=an!==3?2:1,pn=0,nn=0,$=34,C="mp3";switch(Ot){case 0:pn=this._mpegAudioV25SampleRateTable[It];break;case 2:pn=this._mpegAudioV20SampleRateTable[It];break;case 3:pn=this._mpegAudioV10SampleRateTable[It];break}switch(Nt){case 1:$=34,Xe<this._mpegAudioL3BitRateTable.length&&(nn=this._mpegAudioL3BitRateTable[Xe]);break;case 2:$=33,Xe<this._mpegAudioL2BitRateTable.length&&(nn=this._mpegAudioL2BitRateTable[Xe]);break;case 3:$=32,Xe<this._mpegAudioL1BitRateTable.length&&(nn=this._mpegAudioL1BitRateTable[Xe]);break}Ge={bitRate:nn,samplingRate:pn,channelCount:Ct,codec:C,originalCodec:C}}else Ge=Le;return Ge}},{key:"_parseVideoData",value:function(U,G,Q,te,he){if(Q<=1){M.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");return}if(this._hasVideoFlagOverrided===!0&&this._hasVideo===!1)return;var Le=new Uint8Array(U,G,Q)[0],Ge=(Le&240)>>>4,Ot=Le&15;if(Ot!==7){this._onError(at.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(Ot));return}this._parseAVCVideoPacket(U,G+1,Q-1,te,he,Ge)}},{key:"_parseAVCVideoPacket",value:function(U,G,Q,te,he,Le){if(Q<4){M.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var Ge=this._littleEndian,Ot=new DataView(U,G,Q),Nt=Ot.getUint8(0),Xe=Ot.getUint32(0,!Ge)&16777215,It=Xe<<8>>8;if(Nt===0)this._parseAVCDecoderConfigurationRecord(U,G+4,Q-4);else if(Nt===1)this._parseAVCVideoData(U,G+4,Q-4,te,he,Le,It);else if(!(Nt===2)){this._onError(at.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Nt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(U,G,Q){if(Q<7){M.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var te=this._videoMetadata,he=this._videoTrack,Le=this._littleEndian,Ge=new DataView(U,G,Q);te?typeof te.avcc!="undefined"&&M.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),te=this._videoMetadata={},te.type="video",te.id=he.id,te.timescale=this._timescale,te.duration=this._duration);var Ot=Ge.getUint8(0),Nt=Ge.getUint8(1),Xe=Ge.getUint8(2),It=Ge.getUint8(3);if(Ot!==1||Nt===0){this._onError(at.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(Ge.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(at.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var an=Ge.getUint8(5)&31;if(an===0){this._onError(at.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else an>1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(an));for(var Ct=6,pn=0;pn<an;pn++){var nn=Ge.getUint16(Ct,!Le);if(Ct+=2,nn===0)continue;var $=new Uint8Array(U,G+Ct,nn);Ct+=nn;var C=je.parseSPS($);if(pn!==0)continue;te.codecWidth=C.codec_size.width,te.codecHeight=C.codec_size.height,te.presentWidth=C.present_size.width,te.presentHeight=C.present_size.height,te.profile=C.profile_string,te.level=C.level_string,te.bitDepth=C.bit_depth,te.chromaFormat=C.chroma_format,te.sarRatio=C.sar_ratio,te.frameRate=C.frame_rate,(C.frame_rate.fixed===!1||C.frame_rate.fps_num===0||C.frame_rate.fps_den===0)&&(te.frameRate=this._referenceFrameRate);var D=te.frameRate.fps_den,K=te.frameRate.fps_num;te.refSampleDuration=te.timescale*(D/K);for(var re=$.subarray(1,4),J="avc1.",Re=0;Re<3;Re++){var ut=re[Re].toString(16);ut.length<2&&(ut="0"+ut),J+=ut}te.codec=J;var St=this._mediaInfo;St.width=te.codecWidth,St.height=te.codecHeight,St.fps=te.frameRate.fps,St.profile=te.profile,St.level=te.level,St.refFrames=C.ref_frames,St.chromaFormat=C.chroma_format_string,St.sarNum=te.sarRatio.width,St.sarDen=te.sarRatio.height,St.videoCodec=J,St.hasAudio?St.audioCodec!=null&&(St.mimeType='video/x-flv; codecs="'+St.videoCodec+","+St.audioCodec+'"'):St.mimeType='video/x-flv; codecs="'+St.videoCodec+'"',St.isComplete()&&this._onMediaInfo(St)}var Yt=Ge.getUint8(Ct);if(Yt===0){this._onError(at.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS");return}else Yt>1&&M.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Yt));Ct++;for(var dt=0;dt<Yt;dt++){var Gt=Ge.getUint16(Ct,!Le);if(Ct+=2,Gt===0)continue;Ct+=Gt}te.avcc=new Uint8Array(Q),te.avcc.set(new Uint8Array(U,G,Q),0),M.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",te)}},{key:"_parseAVCVideoData",value:function(U,G,Q,te,he,Le,Ge){for(var Ot=this._littleEndian,Nt=new DataView(U,G,Q),Xe=[],It=0,an=0,Ct=this._naluLengthSize,pn=this._timestampBase+te,nn=Le===1;an<Q;){if(an+4>=Q){M.w(this.TAG,"Malformed Nalu near timestamp ".concat(pn,", offset = ").concat(an,", dataSize = ").concat(Q));break}var $=Nt.getUint32(an,!Ot);if(Ct===3&&($>>>=8),$>Q-Ct){M.w(this.TAG,"Malformed Nalus near timestamp ".concat(pn,", NaluSize > DataSize!"));return}var C=Nt.getUint8(an+Ct)&31;C===5&&(nn=!0);var D=new Uint8Array(U,G+an,Ct+$),K={type:C,data:D};Xe.push(K),It+=D.byteLength,an+=Ct+$}if(Xe.length){var re=this._videoTrack,J={units:Xe,length:It,isKeyframe:nn,dts:pn,cts:Ge,pts:pn+Ge};nn&&(J.fileposition=he),re.samples.push(J),re.length+=It}}}],[{key:"probe",value:function(U){var G=new Uint8Array(U),Q={match:!1};if(G[0]!==70||G[1]!==76||G[2]!==86||G[3]!==1)return Q;var te=(G[4]&4)>>>2!==0,he=(G[4]&1)!==0,Le=Mt(G,5);return Le<9?Q:{match:!0,consumed:Le,dataOffset:Le,hasAudioTrack:te,hasVideoTrack:he}}}]),fe}(),Me=jt,Pe=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"init",value:function(){fe.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var U in fe.types)fe.types.hasOwnProperty(U)&&(fe.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var G=fe.constants={};G.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),G.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),G.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),G.STSC=G.STCO=G.STTS,G.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),G.HDLR_VIDEO=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]),G.HDLR_AUDIO=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]),G.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),G.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),G.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(U){for(var G=8,Q=null,te=Array.prototype.slice.call(arguments,1),he=te.length,Le=0;Le<he;Le++)G+=te[Le].byteLength;Q=new Uint8Array(G),Q[0]=G>>>24&255,Q[1]=G>>>16&255,Q[2]=G>>>8&255,Q[3]=G&255,Q.set(U,4);for(var Ge=8,Ot=0;Ot<he;Ot++)Q.set(te[Ot],Ge),Ge+=te[Ot].byteLength;return Q}},{key:"generateInitSegment",value:function(U){var G=fe.box(fe.types.ftyp,fe.constants.FTYP),Q=fe.moov(U),te=new Uint8Array(G.byteLength+Q.byteLength);return te.set(G,0),te.set(Q,G.byteLength),te}},{key:"moov",value:function(U){var G=fe.mvhd(U.timescale,U.duration),Q=fe.trak(U),te=fe.mvex(U);return fe.box(fe.types.moov,G,Q,te)}},{key:"mvhd",value:function(U,G){return fe.box(fe.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,U>>>24&255,U>>>16&255,U>>>8&255,U&255,G>>>24&255,G>>>16&255,G>>>8&255,G&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(U){return fe.box(fe.types.trak,fe.tkhd(U),fe.mdia(U))}},{key:"tkhd",value:function(U){var G=U.id,Q=U.duration,te=U.presentWidth,he=U.presentHeight;return fe.box(fe.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&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,te>>>8&255,te&255,0,0,he>>>8&255,he&255,0,0]))}},{key:"mdia",value:function(U){return fe.box(fe.types.mdia,fe.mdhd(U),fe.hdlr(U),fe.minf(U))}},{key:"mdhd",value:function(U){var G=U.timescale,Q=U.duration;return fe.box(fe.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255,85,196,0,0]))}},{key:"hdlr",value:function(U){var G=null;return U.type==="audio"?G=fe.constants.HDLR_AUDIO:G=fe.constants.HDLR_VIDEO,fe.box(fe.types.hdlr,G)}},{key:"minf",value:function(U){var G=null;return U.type==="audio"?G=fe.box(fe.types.smhd,fe.constants.SMHD):G=fe.box(fe.types.vmhd,fe.constants.VMHD),fe.box(fe.types.minf,G,fe.dinf(),fe.stbl(U))}},{key:"dinf",value:function(){var U=fe.box(fe.types.dinf,fe.box(fe.types.dref,fe.constants.DREF));return U}},{key:"stbl",value:function(U){var G=fe.box(fe.types.stbl,fe.stsd(U),fe.box(fe.types.stts,fe.constants.STTS),fe.box(fe.types.stsc,fe.constants.STSC),fe.box(fe.types.stsz,fe.constants.STSZ),fe.box(fe.types.stco,fe.constants.STCO));return G}},{key:"stsd",value:function(U){return U.type==="audio"?U.codec==="mp3"?fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp3(U)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.mp4a(U)):fe.box(fe.types.stsd,fe.constants.STSD_PREFIX,fe.avc1(U))}},{key:"mp3",value:function(U){var G=U.channelCount,Q=U.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G,0,16,0,0,0,0,Q>>>8&255,Q&255,0,0]);return fe.box(fe.types[".mp3"],te)}},{key:"mp4a",value:function(U){var G=U.channelCount,Q=U.audioSampleRate,te=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G,0,16,0,0,0,0,Q>>>8&255,Q&255,0,0]);return fe.box(fe.types.mp4a,te,fe.esds(U))}},{key:"esds",value:function(U){var G=U.config||[],Q=G.length,te=new Uint8Array([0,0,0,0,3,23+Q,0,1,0,4,15+Q,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([Q]).concat(G).concat([6,1,2]));return fe.box(fe.types.esds,te)}},{key:"avc1",value:function(U){var G=U.avcc,Q=U.codecWidth,te=U.codecHeight,he=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,Q>>>8&255,Q&255,te>>>8&255,te&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return fe.box(fe.types.avc1,he,fe.box(fe.types.avcC,G))}},{key:"mvex",value:function(U){return fe.box(fe.types.mvex,fe.trex(U))}},{key:"trex",value:function(U){var G=U.id,Q=new Uint8Array([0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return fe.box(fe.types.trex,Q)}},{key:"moof",value:function(U,G){return fe.box(fe.types.moof,fe.mfhd(U.sequenceNumber),fe.traf(U,G))}},{key:"mfhd",value:function(U){var G=new Uint8Array([0,0,0,0,U>>>24&255,U>>>16&255,U>>>8&255,U&255]);return fe.box(fe.types.mfhd,G)}},{key:"traf",value:function(U,G){var Q=U.id,te=fe.box(fe.types.tfhd,new Uint8Array([0,0,0,0,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255])),he=fe.box(fe.types.tfdt,new Uint8Array([0,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255])),Le=fe.sdtp(U),Ge=fe.trun(U,Le.byteLength+16+16+8+16+8+8);return fe.box(fe.types.traf,te,he,Ge,Le)}},{key:"sdtp",value:function(U){for(var G=U.samples||[],Q=G.length,te=new Uint8Array(4+Q),he=0;he<Q;he++){var Le=G[he].flags;te[he+4]=Le.isLeading<<6|Le.dependsOn<<4|Le.isDependedOn<<2|Le.hasRedundancy}return fe.box(fe.types.sdtp,te)}},{key:"trun",value:function(U,G){var Q=U.samples||[],te=Q.length,he=12+16*te,Le=new Uint8Array(he);G+=8+he,Le.set([0,0,15,1,te>>>24&255,te>>>16&255,te>>>8&255,te&255,G>>>24&255,G>>>16&255,G>>>8&255,G&255],0);for(var Ge=0;Ge<te;Ge++){var Ot=Q[Ge].duration,Nt=Q[Ge].size,Xe=Q[Ge].flags,It=Q[Ge].cts;Le.set([Ot>>>24&255,Ot>>>16&255,Ot>>>8&255,Ot&255,Nt>>>24&255,Nt>>>16&255,Nt>>>8&255,Nt&255,Xe.isLeading<<2|Xe.dependsOn,Xe.isDependedOn<<6|Xe.hasRedundancy<<4|Xe.isNonSync,0,0,It>>>24&255,It>>>16&255,It>>>8&255,It&255],12+16*Ge)}return fe.box(fe.types.trun,Le)}},{key:"mdat",value:function(U){return fe.box(fe.types.mdat,U)}}]),fe}();Pe.init();var tt=Pe,rt=function(){function fe(){Object(ee.a)(this,fe)}return Object(V.a)(fe,null,[{key:"getSilentFrame",value:function(U,G){if(U==="mp4a.40.2"){if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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])}else{if(G===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(G===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(G===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])}return null}}]),fe}(),Fe=rt,Je=function fe(se,U,G,Q,te){Object(ee.a)(this,fe),this.dts=se,this.pts=U,this.duration=G,this.originalDts=Q,this.isSyncPoint=te,this.fileposition=null},Ee=function(){function fe(){Object(ee.a)(this,fe),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(V.a)(fe,[{key:"appendSyncPoint",value:function(U){U.isSyncPoint=!0,this.syncPoints.push(U)}}]),fe}(),ye=function(){function fe(){Object(ee.a)(this,fe),this._list=[]}return Object(V.a)(fe,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(U){var G=this._list;if(U.length===0)return;G.length>0&&U[0].originalDts<G[G.length-1].originalDts&&this.clear(),Array.prototype.push.apply(G,U)}},{key:"getLastSyncPointBeforeDts",value:function(U){if(this._list.length==0)return null;var G=this._list,Q=0,te=G.length-1,he=0,Le=0,Ge=te;for(U<G[0].dts&&(Q=0,Le=Ge+1);Le<=Ge;)if(he=Le+Math.floor((Ge-Le)/2),he===te||U>=G[he].dts&&U<G[he+1].dts){Q=he;break}else G[he].dts<U?Le=he+1:Ge=he-1;return this._list[Q]}}]),fe}(),_e=function(){function fe(se){Object(ee.a)(this,fe),this._type=se,this._list=[],this._lastAppendLocation=-1}return Object(V.a)(fe,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return this._list.length===0}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(U){var G=this._list;if(G.length===0)return-2;var Q=G.length-1,te=0,he=0,Le=Q,Ge=0;if(U<G[0].originalBeginDts)return Ge=-1,Ge;for(;he<=Le;)if(te=he+Math.floor((Le-he)/2),te===Q||U>G[te].lastSample.originalDts&&U<G[te+1].originalBeginDts){Ge=te;break}else G[te].originalBeginDts<U?he=te+1:Le=te-1;return Ge}},{key:"_searchNearestSegmentAfter",value:function(U){return this._searchNearestSegmentBefore(U)+1}},{key:"append",value:function(U){var G=this._list,Q=U,te=this._lastAppendLocation,he=0;te!==-1&&te<G.length&&Q.originalBeginDts>=G[te].lastSample.originalDts&&(te===G.length-1||te<G.length-1&&Q.originalBeginDts<G[te+1].originalBeginDts)?he=te+1:G.length>0&&(he=this._searchNearestSegmentBefore(Q.originalBeginDts)+1),this._lastAppendLocation=he,this._list.splice(he,0,Q)}},{key:"getLastSegmentBefore",value:function(U){var G=this._searchNearestSegmentBefore(U);return G>=0?this._list[G]:null}},{key:"getLastSampleBefore",value:function(U){var G=this.getLastSegmentBefore(U);return G!=null?G.lastSample:null}},{key:"getLastSyncPointBefore",value:function(U){for(var G=this._searchNearestSegmentBefore(U),Q=this._list[G].syncPoints;Q.length===0&&G>0;)G--,Q=this._list[G].syncPoints;return Q.length>0?Q[Q.length-1]:null}}]),fe}(),le=function(){function fe(se){Object(ee.a)(this,fe),this.TAG="MP4Remuxer",this._config=se,this._isLive=se.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new _e("audio"),this._videoSegmentInfoList=new _e("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(E.chrome&&(E.version.major<50||E.version.major===50&&E.version.build<2661)),this._fillSilentAfterSeek=E.msedge||E.msie,this._mp3UseMpegAudio=!E.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(V.a)(fe,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(U){return U.onDataAvailable=this.remux.bind(this),U.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(U){this._onInitSegment=U}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(U){this._onMediaSegment=U}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(U){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(U,G){if(!this._onMediaSegment)throw new h("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(U,G),this._remuxVideo(G),this._remuxAudio(U)}},{key:"_onTrackMetadataReceived",value:function(U,G){var Q=null,te="mp4",he=G.codec;if(U==="audio")this._audioMeta=G,G.codec==="mp3"&&this._mp3UseMpegAudio?(te="mpeg",he="",Q=new Uint8Array):Q=tt.generateInitSegment(G);else if(U==="video")this._videoMeta=G,Q=tt.generateInitSegment(G);else return;if(!this._onInitSegment)throw new h("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(U,{type:U,data:Q.buffer,codec:he,container:"".concat(U,"/").concat(te),mediaDuration:G.duration})}},{key:"_calculateDtsBase",value:function(U,G){if(this._dtsBaseInited)return;U.samples&&U.samples.length&&(this._audioDtsBase=U.samples[0].dts),G.samples&&G.samples.length&&(this._videoDtsBase=G.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var U=this._videoStashedLastSample,G=this._audioStashedLastSample,Q={type:"video",id:1,sequenceNumber:0,samples:[],length:0};U!=null&&(Q.samples.push(U),Q.length=U.length);var te={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};G!=null&&(te.samples.push(G),te.length=G.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(Q,!0),this._remuxAudio(te,!0)}},{key:"_remuxAudio",value:function(U,G){if(this._audioMeta==null)return;var Q=U,te=Q.samples,he=void 0,Le=-1,Ge=-1,Ot=-1,Nt=this._audioMeta.refSampleDuration,Xe=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,It=this._dtsBaseInited&&this._audioNextDts===void 0,an=!1;if(!te||te.length===0)return;if(te.length===1&&!G)return;var Ct=0,pn=null,nn=0;Xe?(Ct=0,nn=Q.length):(Ct=8,nn=8+Q.length);var $=null;if(te.length>1&&($=te.pop(),nn-=$.length),this._audioStashedLastSample!=null){var C=this._audioStashedLastSample;this._audioStashedLastSample=null,te.unshift(C),nn+=C.length}$!=null&&(this._audioStashedLastSample=$);var D=te[0].dts-this._dtsBase;if(this._audioNextDts)he=D-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())he=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(an=!0));else{var K=this._audioSegmentInfoList.getLastSampleBefore(D);if(K!=null){var re=D-(K.originalDts+K.duration);re<=3&&(re=0);var J=K.dts+K.duration+re;he=D-J}else he=0}if(an){var Re=D-he,ut=this._videoSegmentInfoList.getLastSegmentBefore(D);if(ut!=null&&ut.beginDts<Re){var St=Fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(St){var Yt=ut.beginDts,dt=Re-ut.beginDts;M.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(Yt,", duration: ").concat(dt)),te.unshift({unit:St,dts:Yt,pts:Yt}),nn+=St.byteLength}}else an=!1}for(var Gt=[],sn=0;sn<te.length;sn++){var Wn=te[sn],Si=Wn.unit,hi=Wn.dts-this._dtsBase,Fn=hi-he;Le===-1&&(Le=Fn);var di=0;if(sn!==te.length-1){var Zi=te[sn+1].dts-this._dtsBase-he;di=Zi-Fn}else if($!=null){var _i=$.dts-this._dtsBase-he;di=_i-Fn}else Gt.length>=1?di=Gt[Gt.length-1].duration:di=Math.floor(Nt);var ri=!1,wi=null;if(di>Nt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!E.safari){ri=!0;var Di=Math.abs(di-Nt),Oi=Math.ceil(Di/Nt),Ri=Fn+Nt;M.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.
`+"dts: ".concat(Fn+di," ms, expected: ").concat(Fn+Math.round(Nt)," ms, ")+"delta: ".concat(Math.round(Di)," ms, generate: ").concat(Oi," frames"));var Vi=Fe.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Vi==null&&(M.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Vi=Si),wi=[];for(var cr=0;cr<Oi;cr++){var rr=Math.round(Ri);if(wi.length>0){var ji=wi[wi.length-1];ji.duration=rr-ji.dts}var Wi={dts:rr,pts:rr,cts:0,unit:Vi,size:Vi.byteLength,duration:0,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};wi.push(Wi),nn+=Wi.size,Ri+=Nt}var hr=wi[wi.length-1];hr.duration=Fn+di-hr.dts,di=Math.round(Nt)}Gt.push({dts:Fn,pts:Fn,cts:0,unit:Wn.unit,size:Wn.unit.byteLength,duration:di,originalDts:hi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ri&&Gt.push.apply(Gt,wi)}Xe?pn=new Uint8Array(nn):(pn=new Uint8Array(nn),pn[0]=nn>>>24&255,pn[1]=nn>>>16&255,pn[2]=nn>>>8&255,pn[3]=nn&255,pn.set(tt.types.mdat,4));for(var Tr=0;Tr<Gt.length;Tr++){var ar=Gt[Tr].unit;pn.set(ar,Ct),Ct+=ar.byteLength}var Hn=Gt[Gt.length-1];Ge=Hn.dts+Hn.duration,this._audioNextDts=Ge;var Cn=new Ee;Cn.beginDts=Le,Cn.endDts=Ge,Cn.beginPts=Le,Cn.endPts=Ge,Cn.originalBeginDts=Gt[0].originalDts,Cn.originalEndDts=Hn.originalDts+Hn.duration,Cn.firstSample=new Je(Gt[0].dts,Gt[0].pts,Gt[0].duration,Gt[0].originalDts,!1),Cn.lastSample=new Je(Hn.dts,Hn.pts,Hn.duration,Hn.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(Cn),Q.samples=Gt,Q.sequenceNumber++;var yi=null;Xe?yi=new Uint8Array:yi=tt.moof(Q,Le),Q.samples=[],Q.length=0;var Nn={type:"audio",data:this._mergeBoxes(yi,pn).buffer,sampleCount:Gt.length,info:Cn};Xe&&It&&(Nn.timestampOffset=Le),this._onMediaSegment("audio",Nn)}},{key:"_remuxVideo",value:function(U,G){if(this._videoMeta==null)return;var Q=U,te=Q.samples,he=void 0,Le=-1,Ge=-1,Ot=-1,Nt=-1;if(!te||te.length===0)return;if(te.length===1&&!G)return;var Xe=8,It=null,an=8+U.length,Ct=null;if(te.length>1&&(Ct=te.pop(),an-=Ct.length),this._videoStashedLastSample!=null){var pn=this._videoStashedLastSample;this._videoStashedLastSample=null,te.unshift(pn),an+=pn.length}Ct!=null&&(this._videoStashedLastSample=Ct);var nn=te[0].dts-this._dtsBase;if(this._videoNextDts)he=nn-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())he=0;else{var $=this._videoSegmentInfoList.getLastSampleBefore(nn);if($!=null){var C=nn-($.originalDts+$.duration);C<=3&&(C=0);var D=$.dts+$.duration+C;he=nn-D}else he=0}for(var K=new Ee,re=[],J=0;J<te.length;J++){var Re=te[J],ut=Re.dts-this._dtsBase,St=Re.isKeyframe,Yt=ut-he,dt=Re.cts,Gt=Yt+dt;Le===-1&&(Le=Yt,Ot=Gt);var sn=0;if(J!==te.length-1){var Wn=te[J+1].dts-this._dtsBase-he;sn=Wn-Yt}else if(Ct!=null){var Si=Ct.dts-this._dtsBase-he;sn=Si-Yt}else re.length>=1?sn=re[re.length-1].duration:sn=Math.floor(this._videoMeta.refSampleDuration);if(St){var hi=new Je(Yt,Gt,sn,Re.dts,!0);hi.fileposition=Re.fileposition,K.appendSyncPoint(hi)}re.push({dts:Yt,pts:Gt,cts:dt,units:Re.units,size:Re.length,isKeyframe:St,duration:sn,originalDts:ut,flags:{isLeading:0,dependsOn:St?2:1,isDependedOn:St?1:0,hasRedundancy:0,isNonSync:St?0:1}})}It=new Uint8Array(an),It[0]=an>>>24&255,It[1]=an>>>16&255,It[2]=an>>>8&255,It[3]=an&255,It.set(tt.types.mdat,4);for(var Fn=0;Fn<re.length;Fn++)for(var di=re[Fn].units;di.length;){var Zi=di.shift(),_i=Zi.data;It.set(_i,Xe),Xe+=_i.byteLength}var ri=re[re.length-1];if(Ge=ri.dts+ri.duration,Nt=ri.pts+ri.duration,this._videoNextDts=Ge,K.beginDts=Le,K.endDts=Ge,K.beginPts=Ot,K.endPts=Nt,K.originalBeginDts=re[0].originalDts,K.originalEndDts=ri.originalDts+ri.duration,K.firstSample=new Je(re[0].dts,re[0].pts,re[0].duration,re[0].originalDts,re[0].isKeyframe),K.lastSample=new Je(ri.dts,ri.pts,ri.duration,ri.originalDts,ri.isKeyframe),this._isLive||this._videoSegmentInfoList.append(K),Q.samples=re,Q.sequenceNumber++,this._forceFirstIDR){var wi=re[0].flags;wi.dependsOn=2,wi.isNonSync=0}var Di=tt.moof(Q,Le);Q.samples=[],Q.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(Di,It).buffer,sampleCount:re.length,info:K})}},{key:"_mergeBoxes",value:function(U,G){var Q=new Uint8Array(U.byteLength+G.byteLength);return Q.set(U,0),Q.set(G,U.byteLength),Q}}]),fe}(),de=le,ve={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},pe=ve,Ce=function(){function fe(se,U){Object(ee.a)(this,fe),this.TAG="TransmuxingController",this._emitter=new R.a,this._config=U,se.segments||(se.segments=[{duration:se.duration,filesize:se.filesize,url:se.url}]),typeof se.cors!="boolean"&&(se.cors=!0),typeof se.withCredentials!="boolean"&&(se.withCredentials=!1),this._mediaDataSource=se,this._currentSegmentIndex=0;var G=0;this._mediaDataSource.segments.forEach(function(Q){Q.timestampBase=G,G+=Q.duration,Q.cors=se.cors,Q.withCredentials=se.withCredentials,U.referrerPolicy&&(Q.referrerPolicy=U.referrerPolicy)}),!isNaN(G)&&this._mediaDataSource.duration!==G&&(this._mediaDataSource.duration=G),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(V.a)(fe,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(U,G){this._currentSegmentIndex=U;var Q=this._mediaDataSource.segments[U],te=this._ioctl=new ae(Q,this._config,U);te.onError=this._onIOException.bind(this),te.onSeeked=this._onIOSeeked.bind(this),te.onComplete=this._onIOComplete.bind(this),te.onRedirect=this._onIORedirect.bind(this),te.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),G?this._demuxer.bindDataSource(this._ioctl):te.onDataArrival=this._onInitChunkArrival.bind(this),te.open(G)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(U){if(this._mediaInfo==null||!this._mediaInfo.isSeekable())return;var G=this._searchSegmentIndexContains(U);if(G===this._currentSegmentIndex){var Q=this._mediaInfo.segments[G];if(Q==null)this._pendingSeekTime=U;else{var te=Q.getNearestKeyframe(U);this._remuxer.seek(te.milliseconds),this._ioctl.seek(te.fileposition),this._pendingResolveSeekPoint=te.milliseconds}}else{var he=this._mediaInfo.segments[G];if(he==null)this._pendingSeekTime=U,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(G);else{var Le=he.getNearestKeyframe(U);this._internalAbort(),this._remuxer.seek(U),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[G].timestampBase,this._loadSegment(G,Le.fileposition),this._pendingResolveSeekPoint=Le.milliseconds,this._reportSegmentMediaInfo(G)}}this._enableStatisticsReporter()}},{key:"_searchSegmentIndexContains",value:function(U){for(var G=this._mediaDataSource.segments,Q=G.length-1,te=0;te<G.length;te++)if(U<G[te].timestampBase){Q=te-1;break}return Q}},{key:"_onInitChunkArrival",value:function(U,G){var Q=this,te=null,he=0;if(G>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,he=this._demuxer.parseChunks(U,G);else if((te=Me.probe(U)).match){this._demuxer=new Me(te,this._config),this._remuxer||(this._remuxer=new de(this._config));var Le=this._mediaDataSource;Le.duration!=null&&!isNaN(Le.duration)&&(this._demuxer.overridedDuration=Le.duration),typeof Le.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Le.hasAudio),typeof Le.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Le.hasVideo),this._demuxer.timestampBase=Le.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),he=this._demuxer.parseChunks(U,G)}else te=null,M.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){Q._internalAbort()}),this._emitter.emit(pe.DEMUX_ERROR,at.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),he=0;return he}},{key:"_onMediaInfo",value:function(U){var G=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},U),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,ct.prototype));var Q=Object.assign({},U);Object.setPrototypeOf(Q,ct.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=Q,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var te=G._pendingSeekTime;G._pendingSeekTime=null,G.seek(te)})}},{key:"_onMetaDataArrived",value:function(U){this._emitter.emit(pe.METADATA_ARRIVED,U)}},{key:"_onScriptDataArrived",value:function(U){this._emitter.emit(pe.SCRIPTDATA_ARRIVED,U)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(U){var G=U,Q=G+1;Q<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(Q)):(this._remuxer.flushStashedSamples(),this._emitter.emit(pe.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(U){var G=this._ioctl.extraData;this._mediaDataSource.segments[G].redirectedURL=U}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(pe.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(U,G){M.e(this.TAG,"IOException: type = ".concat(U,", code = ").concat(G.code,", msg = ").concat(G.msg)),this._emitter.emit(pe.IO_ERROR,U,G),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(U,G){M.e(this.TAG,"DemuxException: type = ".concat(U,", info = ").concat(G)),this._emitter.emit(pe.DEMUX_ERROR,U,G)}},{key:"_onRemuxerInitSegmentArrival",value:function(U,G){this._emitter.emit(pe.INIT_SEGMENT,U,G)}},{key:"_onRemuxerMediaSegmentArrival",value:function(U,G){if(this._pendingSeekTime!=null)return;if(this._emitter.emit(pe.MEDIA_SEGMENT,U,G),this._pendingResolveSeekPoint!=null&&U==="video"){var Q=G.info.syncPoints,te=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,E.safari&&Q.length>0&&Q[0].originalDts===te&&(te=Q[0].pts),this._emitter.emit(pe.RECOMMEND_SEEKPOINT,te)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(U){var G=this._mediaInfo.segments[U],Q=Object.assign({},G);Q.duration=this._mediaInfo.duration,Q.segmentCount=this._mediaInfo.segmentCount,delete Q.segments,delete Q.keyframesIndex,this._emitter.emit(pe.MEDIA_INFO,Q)}},{key:"_reportStatisticsInfo",value:function(){var U={};U.url=this._ioctl.currentURL,U.hasRedirect=this._ioctl.hasRedirect,U.hasRedirect&&(U.redirectedURL=this._ioctl.currentRedirectedURL),U.speed=this._ioctl.currentSpeed,U.loaderType=this._ioctl.loaderType,U.currentSegmentIndex=this._currentSegmentIndex,U.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(pe.STATISTICS_INFO,U)}}]),fe}(),Ke=Ce,st=function(se){var U="TransmuxingWorker",G=null,Q=nn.bind(this);Y.install(),se.addEventListener("message",function($){switch($.data.cmd){case"init":G=new Ke($.data.param[0],$.data.param[1]),G.on(pe.IO_ERROR,an.bind(this)),G.on(pe.DEMUX_ERROR,Ct.bind(this)),G.on(pe.INIT_SEGMENT,te.bind(this)),G.on(pe.MEDIA_SEGMENT,he.bind(this)),G.on(pe.LOADING_COMPLETE,Le.bind(this)),G.on(pe.RECOVERED_EARLY_EOF,Ge.bind(this)),G.on(pe.MEDIA_INFO,Ot.bind(this)),G.on(pe.METADATA_ARRIVED,Nt.bind(this)),G.on(pe.SCRIPTDATA_ARRIVED,Xe.bind(this)),G.on(pe.STATISTICS_INFO,It.bind(this)),G.on(pe.RECOMMEND_SEEKPOINT,pn.bind(this));break;case"destroy":G&&(G.destroy(),G=null),se.postMessage({msg:"destroyed"});break;case"start":G.start();break;case"stop":G.stop();break;case"seek":G.seek($.data.param);break;case"pause":G.pause();break;case"resume":G.resume();break;case"logging_config":{var C=$.data.param;ge.applyConfig(C),C.enableCallback===!0?ge.addLogListener(Q):ge.removeLogListener(Q);break}}});function te($,C){var D={msg:pe.INIT_SEGMENT,data:{type:$,data:C}};se.postMessage(D,[C.data])}function he($,C){var D={msg:pe.MEDIA_SEGMENT,data:{type:$,data:C}};se.postMessage(D,[C.data])}function Le(){var $={msg:pe.LOADING_COMPLETE};se.postMessage($)}function Ge(){var $={msg:pe.RECOVERED_EARLY_EOF};se.postMessage($)}function Ot($){var C={msg:pe.MEDIA_INFO,data:$};se.postMessage(C)}function Nt($){var C={msg:pe.METADATA_ARRIVED,data:$};se.postMessage(C)}function Xe($){var C={msg:pe.SCRIPTDATA_ARRIVED,data:$};se.postMessage(C)}function It($){var C={msg:pe.STATISTICS_INFO,data:$};se.postMessage(C)}function an($,C){se.postMessage({msg:pe.IO_ERROR,data:{type:$,info:C}})}function Ct($,C){se.postMessage({msg:pe.DEMUX_ERROR,data:{type:$,info:C}})}function pn($){se.postMessage({msg:pe.RECOMMEND_SEEKPOINT,data:$})}function nn($,C){se.postMessage({msg:"logcat_callback",data:{type:$,logcat:C}})}},At=st,Ft=function(){function fe(se,U){if(Object(ee.a)(this,fe),this.TAG="Transmuxer",this._emitter=new R.a,U.enableWorker&&typeof Worker!="undefined")try{var G=k("0r65");this._worker=G(At),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[se,U]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},ge.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:ge.getConfig()})}catch(te){M.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Ke(se,U)}else this._controller=new Ke(se,U);if(this._controller){var Q=this._controller;Q.on(pe.IO_ERROR,this._onIOError.bind(this)),Q.on(pe.DEMUX_ERROR,this._onDemuxError.bind(this)),Q.on(pe.INIT_SEGMENT,this._onInitSegment.bind(this)),Q.on(pe.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),Q.on(pe.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),Q.on(pe.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),Q.on(pe.MEDIA_INFO,this._onMediaInfo.bind(this)),Q.on(pe.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),Q.on(pe.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),Q.on(pe.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),Q.on(pe.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(V.a)(fe,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),ge.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(U){this._worker?this._worker.postMessage({cmd:"seek",param:U}):this._controller.seek(U)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.INIT_SEGMENT,U,G)})}},{key:"_onMediaSegment",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.MEDIA_SEGMENT,U,G)})}},{key:"_onLoadingComplete",value:function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(pe.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var U=this;Promise.resolve().then(function(){U._emitter.emit(pe.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.MEDIA_INFO,U)})}},{key:"_onMetaDataArrived",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.METADATA_ARRIVED,U)})}},{key:"_onScriptDataArrived",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.SCRIPTDATA_ARRIVED,U)})}},{key:"_onStatisticsInfo",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.STATISTICS_INFO,U)})}},{key:"_onIOError",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.IO_ERROR,U,G)})}},{key:"_onDemuxError",value:function(U,G){var Q=this;Promise.resolve().then(function(){Q._emitter.emit(pe.DEMUX_ERROR,U,G)})}},{key:"_onRecommendSeekpoint",value:function(U){var G=this;Promise.resolve().then(function(){G._emitter.emit(pe.RECOMMEND_SEEKPOINT,U)})}},{key:"_onLoggingConfigChanged",value:function(U){this._worker&&this._worker.postMessage({cmd:"logging_config",param:U})}},{key:"_onWorkerMessage",value:function(U){var G=U.data,Q=G.data;if(G.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch(G.msg){case pe.INIT_SEGMENT:case pe.MEDIA_SEGMENT:this._emitter.emit(G.msg,Q.type,Q.data);break;case pe.LOADING_COMPLETE:case pe.RECOVERED_EARLY_EOF:this._emitter.emit(G.msg);break;case pe.MEDIA_INFO:Object.setPrototypeOf(Q,ct.prototype),this._emitter.emit(G.msg,Q);break;case pe.METADATA_ARRIVED:case pe.SCRIPTDATA_ARRIVED:case pe.STATISTICS_INFO:this._emitter.emit(G.msg,Q);break;case pe.IO_ERROR:case pe.DEMUX_ERROR:this._emitter.emit(G.msg,Q.type,Q.info);break;case pe.RECOMMEND_SEEKPOINT:this._emitter.emit(G.msg,Q);break;case"logcat_callback":M.emitter.emit("log",Q.type,Q.logcat);break;default:break}}}]),fe}(),kt=Ft,wt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},Qe=wt,it=function(){function fe(se){Object(ee.a)(this,fe),this.TAG="MSEController",this._config=se,this._emitter=new R.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new ye}return Object(V.a)(fe,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"attachMediaElement",value:function(U){if(this._mediaSource)throw new h("MediaSource has been attached to an HTMLMediaElement!");var G=this._mediaSource=new window.MediaSource;G.addEventListener("sourceopen",this.e.onSourceOpen),G.addEventListener("sourceended",this.e.onSourceEnded),G.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=U,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),U.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var U=this._mediaSource;for(var G in this._sourceBuffers){var Q=this._pendingSegments[G];Q.splice(0,Q.length),this._pendingSegments[G]=null,this._pendingRemoveRanges[G]=null,this._lastInitSegments[G]=null;var te=this._sourceBuffers[G];if(te){if(U.readyState!=="closed"){try{U.removeSourceBuffer(te)}catch(he){M.e(this.TAG,he.message)}te.removeEventListener("error",this.e.onSourceBufferError),te.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[G]=null,this._sourceBuffers[G]=null}}if(U.readyState==="open")try{U.endOfStream()}catch(he){M.e(this.TAG,he.message)}U.removeEventListener("sourceopen",this.e.onSourceOpen),U.removeEventListener("sourceended",this.e.onSourceEnded),U.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(U,G){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(U),this._pendingSegments[U.type].push(U);return}var Q=U,te="".concat(Q.container);Q.codec&&Q.codec.length>0&&(te+=";codecs=".concat(Q.codec));var he=!1;if(M.v(this.TAG,"Received Initialization Segment, mimeType: "+te),this._lastInitSegments[Q.type]=Q,te!==this._mimeTypes[Q.type]){if(this._mimeTypes[Q.type])M.v(this.TAG,"Notice: ".concat(Q.type," mimeType changed, origin: ").concat(this._mimeTypes[Q.type],", target: ").concat(te));else{he=!0;try{var Le=this._sourceBuffers[Q.type]=this._mediaSource.addSourceBuffer(te);Le.addEventListener("error",this.e.onSourceBufferError),Le.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(Ge){M.e(this.TAG,Ge.message),this._emitter.emit(Qe.ERROR,{code:Ge.code,msg:Ge.message});return}}this._mimeTypes[Q.type]=te}G||this._pendingSegments[Q.type].push(Q),he||this._sourceBuffers[Q.type]&&!this._sourceBuffers[Q.type].updating&&this._doAppendSegments(),E.safari&&Q.container==="audio/mpeg"&&Q.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=Q.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(U){var G=U;this._pendingSegments[G.type].push(G),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var Q=this._sourceBuffers[G.type];Q&&!Q.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(U){for(var G in this._sourceBuffers){if(!this._sourceBuffers[G])continue;var Q=this._sourceBuffers[G];if(this._mediaSource.readyState==="open")try{Q.abort()}catch(Nt){M.e(this.TAG,Nt.message)}this._idrList.clear();var te=this._pendingSegments[G];if(te.splice(0,te.length),this._mediaSource.readyState==="closed")continue;for(var he=0;he<Q.buffered.length;he++){var Le=Q.buffered.start(he),Ge=Q.buffered.end(he);this._pendingRemoveRanges[G].push({start:Le,end:Ge})}if(Q.updating||this._doRemoveRanges(),E.safari){var Ot=this._lastInitSegments[G];Ot&&(this._pendingSegments[G].push(Ot),Q.updating||this._doAppendSegments())}}}},{key:"endOfStream",value:function(){var U=this._mediaSource,G=this._sourceBuffers;if(!U||U.readyState!=="open"){U&&U.readyState==="closed"&&this._hasPendingSegments()&&(this._hasPendingEos=!0);return}G.video&&G.video.updating||G.audio&&G.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,U.endOfStream())}},{key:"getNearestKeyframe",value:function(U){return this._idrList.getLastSyncPointBeforeDts(U)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var U=this._mediaElement.currentTime;for(var G in this._sourceBuffers){var Q=this._sourceBuffers[G];if(Q){var te=Q.buffered;if(te.length>=1&&U-te.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var U=this._mediaElement.currentTime;for(var G in this._sourceBuffers){var Q=this._sourceBuffers[G];if(Q){for(var te=Q.buffered,he=!1,Le=0;Le<te.length;Le++){var Ge=te.start(Le),Ot=te.end(Le);if(Ge<=U&&U<Ot+3){if(U-Ge>=this._config.autoCleanupMaxBackwardDuration){he=!0;var Nt=U-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[G].push({start:Ge,end:Nt})}}else Ot<U&&(he=!0,this._pendingRemoveRanges[G].push({start:Ge,end:Ot}))}he&&!Q.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var U=this._sourceBuffers;if(this._mediaElement.readyState===0||this._mediaSource.readyState!=="open")return;if(U.video&&U.video.updating||U.audio&&U.audio.updating)return;var G=this._mediaSource.duration,Q=this._pendingMediaDuration;Q>0&&(isNaN(G)||Q>G)&&(M.v(this.TAG,"Update MediaSource duration from ".concat(G," to ").concat(Q)),this._mediaSource.duration=Q),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var U in this._pendingRemoveRanges){if(!this._sourceBuffers[U]||this._sourceBuffers[U].updating)continue;for(var G=this._sourceBuffers[U],Q=this._pendingRemoveRanges[U];Q.length&&!G.updating;){var te=Q.shift();G.remove(te.start,te.end)}}}},{key:"_doAppendSegments",value:function(){var U=this._pendingSegments;for(var G in U){if(!this._sourceBuffers[G]||this._sourceBuffers[G].updating)continue;if(U[G].length>0){var Q=U[G].shift();if(Q.timestampOffset){var te=this._sourceBuffers[G].timestampOffset,he=Q.timestampOffset/1e3,Le=Math.abs(te-he);Le>.1&&(M.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(te," to ").concat(he)),this._sourceBuffers[G].timestampOffset=he),delete Q.timestampOffset}if(!Q.data||Q.data.byteLength===0)continue;try{this._sourceBuffers[G].appendBuffer(Q.data),this._isBufferFull=!1,G==="video"&&Q.hasOwnProperty("info")&&this._idrList.appendArray(Q.info.syncPoints)}catch(Ge){this._pendingSegments[G].unshift(Q),Ge.code===22?(this._isBufferFull||this._emitter.emit(Qe.BUFFER_FULL),this._isBufferFull=!0):(M.e(this.TAG,Ge.message),this._emitter.emit(Qe.ERROR,{code:Ge.code,msg:Ge.message}))}}}}},{key:"_onSourceOpen",value:function(){if(M.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var U=this._pendingSourceBufferInit;U.length;){var G=U.shift();this.appendInitSegment(G,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(Qe.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){M.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){M.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var U=this._pendingSegments;return U.video.length>0||U.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var U=this._pendingRemoveRanges;return U.video.length>0||U.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(Qe.UPDATE_END)}},{key:"_onSourceBufferError",value:function(U){M.e(this.TAG,"SourceBuffer Error: ".concat(U))}}]),fe}(),We=it,ce={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},Se={NETWORK_EXCEPTION:r.EXCEPTION,NETWORK_STATUS_CODE_INVALID:r.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:r.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:r.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:at.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:at.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:at.CODEC_UNSUPPORTED},ot=function(){function fe(se,U){if(Object(ee.a)(this,fe),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new R.a,this._config=xe(),typeof U=="object"&&Object.assign(this._config,U),se.type.toLowerCase()!=="flv")throw new s("FlvPlayer requires an flv MediaDataSource input!");se.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=se,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var G=E.chrome&&(E.version.major<50||E.version.major===50&&E.version.build<2661);this._alwaysSeekKeyframe=!!(G||E.msedge||E.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(V.a)(fe,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){var Q=this;U===De.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){Q._emitter.emit(De.MEDIA_INFO,Q.mediaInfo)}):U===De.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){Q._emitter.emit(De.STATISTICS_INFO,Q.statisticsInfo)})),this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"attachMediaElement",value:function(U){var G=this;if(this._mediaElement=U,U.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),U.addEventListener("seeking",this.e.onvSeeking),U.addEventListener("canplay",this.e.onvCanPlay),U.addEventListener("stalled",this.e.onvStalled),U.addEventListener("progress",this.e.onvProgress),this._msectl=new We(this._config),this._msectl.on(Qe.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(Qe.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(Qe.SOURCE_OPEN,function(){G._mseSourceOpened=!0,G._hasPendingLoad&&(G._hasPendingLoad=!1,G.load())}),this._msectl.on(Qe.ERROR,function(Q){G._emitter.emit(De.ERROR,ce.MEDIA_ERROR,Se.MEDIA_MSE_ERROR,Q)}),this._msectl.attachMediaElement(U),this._pendingSeekTime!=null)try{U.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(Q){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var U=this;if(!this._mediaElement)throw new h("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new h("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new kt(this._mediaDataSource,this._config),this._transmuxer.on(pe.INIT_SEGMENT,function(G,Q){U._msectl.appendInitSegment(Q)}),this._transmuxer.on(pe.MEDIA_SEGMENT,function(G,Q){if(U._msectl.appendMediaSegment(Q),U._config.lazyLoad&&!U._config.isLive){var te=U._mediaElement.currentTime;Q.info.endDts>=(te+U._config.lazyLoadMaxDuration)*1e3&&(U._progressChecker==null&&(M.v(U.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),U._suspendTransmuxer()))}}),this._transmuxer.on(pe.LOADING_COMPLETE,function(){U._msectl.endOfStream(),U._emitter.emit(De.LOADING_COMPLETE)}),this._transmuxer.on(pe.RECOVERED_EARLY_EOF,function(){U._emitter.emit(De.RECOVERED_EARLY_EOF)}),this._transmuxer.on(pe.IO_ERROR,function(G,Q){U._emitter.emit(De.ERROR,ce.NETWORK_ERROR,G,Q)}),this._transmuxer.on(pe.DEMUX_ERROR,function(G,Q){U._emitter.emit(De.ERROR,ce.MEDIA_ERROR,G,{code:-1,msg:Q})}),this._transmuxer.on(pe.MEDIA_INFO,function(G){U._mediaInfo=G,U._emitter.emit(De.MEDIA_INFO,Object.assign({},G))}),this._transmuxer.on(pe.METADATA_ARRIVED,function(G){U._emitter.emit(De.METADATA_ARRIVED,G)}),this._transmuxer.on(pe.SCRIPTDATA_ARRIVED,function(G){U._emitter.emit(De.SCRIPTDATA_ARRIVED,G)}),this._transmuxer.on(pe.STATISTICS_INFO,function(G){U._statisticsInfo=U._fillStatisticsInfo(G),U._emitter.emit(De.STATISTICS_INFO,Object.assign({},U._statisticsInfo))}),this._transmuxer.on(pe.RECOMMEND_SEEKPOINT,function(G){U._mediaElement&&!U._config.accurateSeek&&(U._requestSetTime=!0,U._mediaElement.currentTime=G/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(U){this._mediaElement.volume=U}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(U){this._mediaElement.muted=U}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(U){this._mediaElement?this._internalSeek(U):this._pendingSeekTime=U}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(U){if(U.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return U;var G=!0,Q=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Q=he.totalVideoFrames,te=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Q=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):G=!1;return G&&(U.decodedFrames=Q,U.droppedFrames=te),U}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var U=this._mediaElement.buffered,G=this._mediaElement.currentTime,Q=0,te=0,he=0;he<U.length;he++){var Le=U.start(he),Ge=U.end(he);if(Le<=G&&G<Ge){Q=Le,te=Ge;break}}te>=G+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(M.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){M.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var U=this._mediaElement.currentTime,G=this._mediaElement.buffered,Q=!1,te=0;te<G.length;te++){var he=G.start(te),Le=G.end(te);if(U>=he&&U<Le){U>=Le-this._config.lazyLoadRecoverDuration&&(Q=!0);break}}Q&&(window.clearInterval(this._progressChecker),this._progressChecker=null,Q&&(M.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(U){for(var G=this._mediaElement.buffered,Q=0;Q<G.length;Q++){var te=G.start(Q),he=G.end(Q);if(U>=te&&U<he)return!0}return!1}},{key:"_internalSeek",value:function(U){var G=this._isTimepointBuffered(U),Q=!1,te=0;if(U<1&&this._mediaElement.buffered.length>0){var he=this._mediaElement.buffered.start(0);(he<1&&U<he||E.safari)&&(Q=!0,te=E.safari?.1:he)}if(Q)this._requestSetTime=!0,this._mediaElement.currentTime=te;else if(G){if(!this._alwaysSeekKeyframe)this._requestSetTime=!0,this._mediaElement.currentTime=U;else{var Le=this._msectl.getNearestKeyframe(Math.floor(U*1e3));this._requestSetTime=!0,Le!=null?this._mediaElement.currentTime=Le.dts/1e3:this._mediaElement.currentTime=U}this._progressChecker!=null&&this._checkProgressAndResume()}else this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(U),this._transmuxer.seek(Math.floor(U*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=U)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var U=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(U)||(this._progressChecker!=null&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(U),this._transmuxer.seek(Math.floor(U*1e3)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=U))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(U){var G=this._mediaElement;if(U||!this._receivedCanPlay||G.readyState<2){var Q=G.buffered;Q.length>0&&G.currentTime<Q.start(0)&&(M.w(this.TAG,"Playback seems stuck at ".concat(G.currentTime,", seek to ").concat(Q.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=Q.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(U){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(U){var G=this._mediaElement.currentTime,Q=this._mediaElement.buffered;if(this._requestSetTime){this._requestSetTime=!1;return}if(G<1&&Q.length>0){var te=Q.start(0);if(te<1&&G<te||E.safari){this._requestSetTime=!0,this._mediaElement.currentTime=E.safari?.1:te;return}}if(this._isTimepointBuffered(G)){if(this._alwaysSeekKeyframe){var he=this._msectl.getNearestKeyframe(Math.floor(G*1e3));he!=null&&(this._requestSetTime=!0,this._mediaElement.currentTime=he.dts/1e3)}this._progressChecker!=null&&this._checkProgressAndResume();return}this._seekpointRecord={seekPoint:G,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_onvCanPlay",value:function(U){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(U){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(U){this._checkAndResumeStuckPlayback()}}]),fe}(),ze=ot,Lt=function(){function fe(se,U){if(Object(ee.a)(this,fe),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new R.a,this._config=xe(),typeof U=="object"&&Object.assign(this._config,U),se.type.toLowerCase()==="flv")throw new s("NativePlayer does't support flv MediaDataSource input!");if(se.hasOwnProperty("segments"))throw new s("NativePlayer(".concat(se.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=se,this._mediaElement=null}return Object(V.a)(fe,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(U,G){var Q=this;U===De.MEDIA_INFO?this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){Q._emitter.emit(De.MEDIA_INFO,Q.mediaInfo)}):U===De.STATISTICS_INFO&&(this._mediaElement!=null&&this._mediaElement.readyState!==0&&Promise.resolve().then(function(){Q._emitter.emit(De.STATISTICS_INFO,Q.statisticsInfo)})),this._emitter.addListener(U,G)}},{key:"off",value:function(U,G){this._emitter.removeListener(U,G)}},{key:"attachMediaElement",value:function(U){if(this._mediaElement=U,U.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._pendingSeekTime!=null)try{U.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(G){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new h("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(U){this._mediaElement.volume=U}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(U){this._mediaElement.muted=U}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(U){this._mediaElement?this._mediaElement.currentTime=U:this._pendingSeekTime=U}},{key:"mediaInfo",get:function(){var U=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",G={mimeType:U+this._mediaDataSource.type};return this._mediaElement&&(G.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&(G.width=this._mediaElement.videoWidth,G.height=this._mediaElement.videoHeight)),G}},{key:"statisticsInfo",get:function(){var U={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return U;var G=!0,Q=0,te=0;if(this._mediaElement.getVideoPlaybackQuality){var he=this._mediaElement.getVideoPlaybackQuality();Q=he.totalVideoFrames,te=he.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(Q=this._mediaElement.webkitDecodedFrameCount,te=this._mediaElement.webkitDroppedFrameCount):G=!1;return G&&(U.decodedFrames=Q,U.droppedFrames=te),U}},{key:"_onvLoadedMetadata",value:function(U){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(De.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(De.STATISTICS_INFO,this.statisticsInfo)}}]),fe}(),Dt=Lt;Y.install();function ke(fe,se){var U=fe;if(U==null||typeof U!="object")throw new s("MediaDataSource must be an javascript object!");if(!U.hasOwnProperty("type"))throw new s("MediaDataSource must has type field to indicate video file type!");switch(U.type){case"flv":return new ze(U,se);default:return new Dt(U,se)}}function qe(){return Oe.supportMSEH264Playback()}function Rt(){return Oe.getFeatureList()}var Pt={};Pt.createPlayer=ke,Pt.isSupported=qe,Pt.getFeatureList=Rt,Pt.BaseLoader=n,Pt.LoaderStatus=i,Pt.LoaderErrors=r,Pt.Events=De,Pt.ErrorTypes=ce,Pt.ErrorDetails=Se,Pt.FlvPlayer=ze,Pt.NativePlayer=Dt,Pt.LoggingControl=ge,Object.defineProperty(Pt,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var $t=we.a=Pt},GgEA:function(Be,we,k){},Gytx:function(Be,we){Be.exports=function(ee,V,P,Y){var W=P?P.call(Y,ee,V):void 0;if(W!==void 0)return!!W;if(ee===V)return!0;if(typeof ee!="object"||!ee||typeof V!="object"||!V)return!1;var R=Object.keys(ee),B=Object.keys(V);if(R.length!==B.length)return!1;for(var M=Object.prototype.hasOwnProperty.bind(V),L=0;L<R.length;L++){var I=R[L];if(!M(I))return!1;var p=ee[I],m=V[I];if(W=P?P.call(Y,p,m,I):void 0,W===!1||W===void 0&&p!==m)return!1}return!0}},HmJG:function(Be,we,k){},Hw79:function(Be,we,k){Be.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},I8Z2:function(Be,we,k){"use strict";k.d(we,"a",function(){return Y}),k.d(we,"b",function(){return u}),k.d(we,"c",function(){return s});var ee=k("cDcd"),V=function(){var l=function(i,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,d){n.__proto__=d}||function(n,d){for(var w in d)d.hasOwnProperty(w)&&(n[w]=d[w])},l(i,r)};return function(i,r){l(i,r);function n(){this.constructor=i}i.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),P=ee.createContext(null),Y=function(l){V(i,l);function i(){return l!==null&&l.apply(this,arguments)||this}return i.prototype.render=function(){return ee.createElement(P.Provider,{value:this.props.store},this.props.children)},i}(ee.Component),W=k("Gytx"),R=k.n(W),B=k("2mql"),M=k.n(B),L=function(){var l=function(i,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,d){n.__proto__=d}||function(n,d){for(var w in d)d.hasOwnProperty(w)&&(n[w]=d[w])},l(i,r)};return function(i,r){l(i,r);function n(){this.constructor=i}i.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=function(){return I=Object.assign||function(l){for(var i,r=1,n=arguments.length;r<n;r++){i=arguments[r];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(l[d]=i[d])}return l},I.apply(this,arguments)};function p(l){return l.displayName||l.name||"Component"}var m=function(){return{}};function u(l,i){i===void 0&&(i={});var r=!!l,n=l||m;return function(w){var T=function(O){L(E,O);function E(v,_){var f=O.call(this,v,_)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var c=n(f.store.getState(),f.props);f.setState({subscribed:c})},f.store=f.context,f.state={subscribed:n(f.store.getState(),v),store:f.store,props:v},f}return E.getDerivedStateFromProps=function(v,_){return l&&l.length===2&&v!==_.props?{subscribed:n(_.store.getState(),v),props:v}:{props:v}},E.prototype.componentDidMount=function(){this.trySubscribe()},E.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},E.prototype.shouldComponentUpdate=function(v,_){return!R()(this.props,v)||!R()(this.state.subscribed,_.subscribed)},E.prototype.trySubscribe=function(){r&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},E.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},E.prototype.render=function(){var v=I(I(I({},this.props),this.state.subscribed),{store:this.store});return ee.createElement(w,I({},v,{ref:this.props.miniStoreForwardedRef}))},E.displayName="Connect("+p(w)+")",E.contextType=P,E}(ee.Component);if(i.forwardRef){var x=ee.forwardRef(function(O,E){return ee.createElement(T,I({},O,{miniStoreForwardedRef:E}))});return M()(x,w)}return M()(T,w)}}var h=function(){return h=Object.assign||function(l){for(var i,r=1,n=arguments.length;r<n;r++){i=arguments[r];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(l[d]=i[d])}return l},h.apply(this,arguments)};function s(l){var i=l,r=[];function n(T){i=h(h({},i),T);for(var x=0;x<r.length;x++)r[x]()}function d(){return i}function w(T){return r.push(T),function(){var O=r.indexOf(T);r.splice(O,1)}}return{setState:n,getState:d,subscribe:w}}},IBYe:function(Be,we,k){"use strict";function ee(V){return null}we.a=ee},IxHN:function(Be,we,k){"use strict";var ee=k("cDcd"),V=k.n(ee),P=k("07cG"),Y=k.n(P);we.a=function(W){var R=W.message,B=W.className,M=W.children,L=W.style,I=L===void 0?{}:L;return V.a.createElement("div",{className:"".concat(Y.a.idsRingWrapper," ").concat(B)},V.a.createElement("div",{className:Y.a.ldsRing},V.a.createElement("div",null),V.a.createElement("div",null),V.a.createElement("div",null),V.a.createElement("div",null)),R?V.a.createElement("p",{style:I},R):null,M)}},J66h:function(Be,we,k){(function(ee){var V,P;(function(Y,W){Be.exports=W(Y)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ee!="undefined"?ee:this,function(Y){"use strict";Y=Y||{};var W=Y.Base64,R="2.6.4",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=function(b){for(var N={},F=0,X=b.length;F<X;F++)N[b.charAt(F)]=F;return N}(B),L=String.fromCharCode,I=function(b){if(b.length<2){var N=b.charCodeAt(0);return N<128?b:N<2048?L(192|N>>>6)+L(128|N&63):L(224|N>>>12&15)+L(128|N>>>6&63)+L(128|N&63)}else{var N=65536+(b.charCodeAt(0)-55296)*1024+(b.charCodeAt(1)-56320);return L(240|N>>>18&7)+L(128|N>>>12&63)+L(128|N>>>6&63)+L(128|N&63)}},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(b){return b.replace(p,I)},u=function(b){var N=[0,2,1][b.length%3],F=b.charCodeAt(0)<<16|(b.length>1?b.charCodeAt(1):0)<<8|(b.length>2?b.charCodeAt(2):0),X=[B.charAt(F>>>18),B.charAt(F>>>12&63),N>=2?"=":B.charAt(F>>>6&63),N>=1?"=":B.charAt(F&63)];return X.join("")},h=Y.btoa&&typeof Y.btoa=="function"?function(b){return Y.btoa(b)}:function(b){if(b.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return b.replace(/[\s\S]{1,3}/g,u)},s=function(b){return h(m(String(b)))},l=function(b){return b.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},i=function(b,N){return N?l(s(b)):s(b)},r=function(b){return i(b,!0)},n;Y.Uint8Array&&(n=function(b,N){for(var F="",X=0,Z=b.length;X<Z;X+=3){var H=b[X],A=b[X+1],z=b[X+2],ne=H<<16|A<<8|z;F+=B.charAt(ne>>>18)+B.charAt(ne>>>12&63)+(typeof A!="undefined"?B.charAt(ne>>>6&63):"=")+(typeof z!="undefined"?B.charAt(ne&63):"=")}return N?l(F):F});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(b){switch(b.length){case 4:var N=(7&b.charCodeAt(0))<<18|(63&b.charCodeAt(1))<<12|(63&b.charCodeAt(2))<<6|63&b.charCodeAt(3),F=N-65536;return L((F>>>10)+55296)+L((F&1023)+56320);case 3:return L((15&b.charCodeAt(0))<<12|(63&b.charCodeAt(1))<<6|63&b.charCodeAt(2));default:return L((31&b.charCodeAt(0))<<6|63&b.charCodeAt(1))}},T=function(b){return b.replace(d,w)},x=function(b){var N=b.length,F=N%4,X=(N>0?M[b.charAt(0)]<<18:0)|(N>1?M[b.charAt(1)]<<12:0)|(N>2?M[b.charAt(2)]<<6:0)|(N>3?M[b.charAt(3)]:0),Z=[L(X>>>16),L(X>>>8&255),L(X&255)];return Z.length-=[0,0,2,1][F],Z.join("")},O=Y.atob&&typeof Y.atob=="function"?function(b){return Y.atob(b)}:function(b){return b.replace(/\S{1,4}/g,x)},E=function(b){return O(String(b).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(b){return T(O(b))},_=function(b){return String(b).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(b){return v(_(b))},c;Y.Uint8Array&&(c=function(b){return Uint8Array.from(E(_(b)),function(N){return N.charCodeAt(0)})});var S=function(){var b=Y.Base64;return Y.Base64=W,b};if(Y.Base64={VERSION:R,atob:E,btoa:h,fromBase64:f,toBase64:i,utob:m,encode:i,encodeURI:r,btou:T,decode:f,noConflict:S,fromUint8Array:n,toUint8Array:c},typeof Object.defineProperty=="function"){var y=function(b){return{value:b,enumerable:!1,writable:!0,configurable:!0}};Y.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",y(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",y(function(b){return i(this,b)})),Object.defineProperty(String.prototype,"toBase64URI",y(function(){return i(this,!0)}))}}return Y.Meteor&&(Base64=Y.Base64),Be.exports?Be.exports.Base64=Y.Base64:!(V=[],P=function(){return Y.Base64}.apply(we,V),P!==void 0&&(Be.exports=P)),{Base64:Y.Base64}})}).call(this,k("IyRk"))},JOrW:function(Be,we,k){Be.exports=k.p+"static/gf.09d89ab3.svg"},LdHM:function(Be,we,k){"use strict";k.d(we,"b",function(){return d}),k.d(we,"a",function(){return T});var ee=k("1OyB"),V=k("vuIU"),P=k("Ji7U"),Y=k("LK+K"),W=k("cDcd"),R=k("rePB"),B=k("Ff2n"),M=k("ODXe"),L=k("4IlW"),I=k("bX4T"),p=k("YrtM"),m=k("TSYQ"),u=k.n(m),h=k("+nKL"),s=k("8OUc"),l=function(z,ne){var ae=z.prefixCls,me=z.id,xe=z.flattenOptions,Te=z.childrenAsData,Oe=z.values,Ue=z.searchValue,De=z.multiple,be=z.defaultActiveFirstOption,ge=z.height,He=z.itemHeight,ct=z.notFoundContent,vt=z.open,_t=z.menuItemSelectedIcon,yt=z.virtual,et=z.onSelect,ht=z.onToggleOpen,xt=z.onActiveValue,Tt=z.onScroll,mt=z.onMouseEnter,Ie="".concat(ae,"-item"),je=Object(p.a)(function(){return xe},[vt,xe],function(Je,Ee){return Ee[0]&&Je[1]!==Ee[1]}),$e=W.useRef(null),at=function(Ee){Ee.preventDefault()},lt=function(Ee){$e.current&&$e.current.scrollTo({index:Ee})},bt=function(Ee){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_e=je.length,le=0;le<_e;le+=1){var de=(Ee+le*ye+_e)%_e,ve=je[de],pe=ve.group,Ce=ve.data;if(!pe&&!Ce.disabled)return de}return-1},Mt=W.useState(function(){return bt(0)}),jt=Object(M.a)(Mt,2),Me=jt[0],Pe=jt[1],tt=function(Ee){Pe(Ee);var ye=je[Ee];if(!ye){xt(null,-1);return}xt(ye.data.value,Ee)};W.useEffect(function(){tt(be!==!1?bt(0):-1)},[je.length,Ue]),W.useEffect(function(){var Je=setTimeout(function(){if(!De&&vt&&Oe.size===1){var Ee=Array.from(Oe)[0],ye=je.findIndex(function(_e){var le=_e.data;return le.value===Ee});tt(ye),lt(ye)}});return function(){return clearTimeout(Je)}},[vt]);var rt=function(Ee){Ee!==void 0&&et(Ee,{selected:!Oe.has(Ee)}),De||ht(!1)};if(W.useImperativeHandle(ne,function(){return{onKeyDown:function(Ee){var ye=Ee.which;switch(ye){case L.a.UP:case L.a.DOWN:{var _e=0;if(ye===L.a.UP?_e=-1:ye===L.a.DOWN&&(_e=1),_e!==0){var le=bt(Me+_e,_e);lt(le),tt(le)}break}case L.a.ENTER:{var de=je[Me];de&&!de.data.disabled?rt(de.data.value):rt(void 0),vt&&Ee.preventDefault();break}case L.a.ESC:ht(!1)}},onKeyUp:function(){},scrollTo:function(Ee){lt(Ee)}}}),je.length===0)return W.createElement("div",{role:"listbox",id:"".concat(me,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:at},ct);function Fe(Je){var Ee=je[Je];if(!Ee)return null;var ye=Ee.data||{},_e=ye.value,le=ye.label,de=ye.children,ve=Object(I.a)(ye,!0),pe=Te?de:le;return Ee?W.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},ve,{key:Je,role:"option",id:"".concat(me,"_list_").concat(Je),"aria-selected":Oe.has(_e)}),_e):null}return W.createElement(W.Fragment,null,W.createElement("div",{role:"listbox",id:"".concat(me,"_list"),style:{height:0,width:0,overflow:"hidden"}},Fe(Me-1),Fe(Me),Fe(Me+1)),W.createElement(h.a,{itemKey:"key",ref:$e,data:je,height:ge,itemHeight:He,fullHeight:!1,onMouseDown:at,onScroll:Tt,virtual:yt,onMouseEnter:mt},function(Je,Ee){var ye,_e=Je.group,le=Je.groupOption,de=Je.data,ve=de.label,pe=de.key;if(_e)return W.createElement("div",{className:u()(Ie,"".concat(Ie,"-group"))},ve!==void 0?ve:pe);var Ce=de.disabled,Ke=de.value,st=de.title,At=de.children,Ft=de.style,kt=de.className,wt=Object(B.a)(de,["disabled","value","title","children","style","className"]),Qe=Oe.has(Ke),it="".concat(Ie,"-option"),We=u()(Ie,it,kt,(ye={},Object(R.a)(ye,"".concat(it,"-grouped"),le),Object(R.a)(ye,"".concat(it,"-active"),Me===Ee&&!Ce),Object(R.a)(ye,"".concat(it,"-disabled"),Ce),Object(R.a)(ye,"".concat(it,"-selected"),Qe),ye)),ce=Te?At:ve,Se=!_t||typeof _t=="function"||Qe;return W.createElement("div",Object.assign({},wt,{"aria-selected":Qe,className:We,title:st,onMouseMove:function(){if(Me===Ee||Ce)return;tt(Ee)},onClick:function(){Ce||rt(Ke)},style:Ft}),W.createElement("div",{className:"".concat(it,"-content")},ce||Ke),W.isValidElement(_t)||Qe,Se&&W.createElement(s.a,{className:"".concat(Ie,"-option-state"),customizeIcon:_t,customizeIconProps:{isSelected:Qe}},Qe?"\u2713":null))}))},i=W.forwardRef(l);i.displayName="OptionList";var r=i,n=function(){return null};n.isSelectOption=!0;var d=n,w=function(){return null};w.isSelectOptGroup=!0;var T=w,x=k("VTBJ"),O=k("Zm9Q");function E(A){var z=A.key,ne=A.props,ae=ne.children,me=ne.value,xe=Object(B.a)(ne,["children","value"]);return Object(x.a)({key:z,value:me!==void 0?me:z,children:ae},xe)}function v(A){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(A).map(function(ne,ae){if(!W.isValidElement(ne)||!ne.type)return null;var me=ne.type.isSelectOptGroup,xe=ne.key,Te=ne.props,Oe=Te.children,Ue=Object(B.a)(Te,["children"]);return z||!me?E(ne):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(xe===null?ae:xe,"__"),label:xe},Ue),{},{options:v(Oe)})}).filter(function(ne){return ne})}var _=k("2Qr1"),f=k("qNPg"),c=k("U8pU"),S=k("Kwbf"),y=k("WKfj");function b(A){var z=A.mode,ne=A.options,ae=A.children,me=A.backfill,xe=A.allowClear,Te=A.placeholder,Oe=A.getInputElement,Ue=A.showSearch,De=A.onSearch,be=A.defaultOpen,ge=A.autoFocus,He=A.labelInValue,ct=A.value,vt=A.inputValue,_t=A.optionLabelProp,yt=z==="multiple"||z==="tags",et=Ue!==void 0?Ue:yt||z==="combobox",ht=ne||v(ae);if(Object(S.a)(z!=="tags"||ht.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var xt=ht.some(function(Ie){return Ie.options?Ie.options.some(function(je){return typeof("value"in je?je.value:je.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(S.a)(!xt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(z!=="combobox"||!_t,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(z==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(S.a)(z==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(S.b)(z!=="combobox"||!Oe||!xe||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),De&&!et&&z!=="combobox"&&z!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!be||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ct!=null){var Tt=Object(y.d)(ct);Object(S.a)(!He||Tt.every(function(Ie){return Object(c.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!yt||Array.isArray(ct),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var mt=null;Object(O.a)(ae).some(function(Ie){if(!W.isValidElement(Ie)||!Ie.type)return!1;var je=Ie.type;if(je.isSelectOption)return!1;if(je.isSelectOptGroup){var $e=Object(O.a)(Ie.props.children).every(function(at){return!W.isValidElement(at)||!Ie.type||at.type.isSelectOption?!0:(mt=at.type,!1)});return!$e}return mt=je,!0}),mt&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(mt.displayName||mt.name||mt,"`.")),Object(S.a)(vt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=b,F=Object(f.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:v,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:N,fillOptionsWithMissingValue:_.a}),X=function(A){Object(P.a)(ne,A);var z=Object(Y.a)(ne);function ne(){var ae;return Object(ee.a)(this,ne),ae=z.apply(this,arguments),ae.selectRef=W.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(V.a)(ne,[{key:"render",value:function(){return W.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),ne}(W.Component);X.Option=d,X.OptGroup=T;var Z=X,H=we.c=Z},M8RZ:function(Be,we,k){"use strict";k.d(we,"a",function(){return L});var ee=k("fWQN"),V=k("mtLc"),P=k("yKVA"),Y=k("879j"),W=k("cDcd"),R=k.n(W),B=k("faye"),M=k.n(B),L=function(I){Object(P.a)(m,I);var p=Object(Y.a)(m);function m(u){var h;Object(ee.a)(this,m),h=p.call(this,u);var s=window.document;return h.node=s.createElement("div"),s.body.appendChild(h.node),h}return Object(V.a)(m,[{key:"render",value:function(){var h=this.props.children;return Object(B.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(R.a.Component)},MFOe:function(Be,we,k){(function(ee){var V=R(),P=B(),Y=M(),W=typeof window!="undefined"?window:ee;Be.exports={assign:V,create:P,trim:Y,bind:L,slice:I,each:p,map:m,pluck:u,isList:h,isFunction:s,isObject:l,Global:W};function R(){return Object.assign?Object.assign:function(r,n,d,w){for(var T=1;T<arguments.length;T++)p(Object(arguments[T]),function(x,O){r[O]=x});return r}}function B(){if(Object.create)return function(n,d,w,T){var x=I(arguments,1);return V.apply(this,[Object.create(n)].concat(x))};{function i(){}return function(n,d,w,T){var x=I(arguments,1);return i.prototype=n,V.apply(this,[new i].concat(x))}}}function M(){return String.prototype.trim?function(r){return String.prototype.trim.call(r)}:function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function L(i,r){return function(){return r.apply(i,Array.prototype.slice.call(arguments,0))}}function I(i,r){return Array.prototype.slice.call(i,r||0)}function p(i,r){u(i,function(n,d){return r(n,d),!1})}function m(i,r){var n=h(i)?[]:{};return u(i,function(d,w){return n[w]=r(d,w),!1}),n}function u(i,r){if(h(i)){for(var n=0;n<i.length;n++)if(r(i[n],n))return i[n]}else for(var d in i)if(i.hasOwnProperty(d)&&r(i[d],d))return i[d]}function h(i){return i!=null&&typeof i!="function"&&typeof i.length=="number"}function s(i){return i&&{}.toString.call(i)==="[object Function]"}function l(i){return i&&{}.toString.call(i)==="[object Object]"}}).call(this,k("IyRk"))},MVJL:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},NvD2:function(Be,we,k){"use strict";k.d(we,"a",function(){return R});var ee=k("Kwbf");function V(B,M){var L=new Set;return B.forEach(function(I){M.has(I)||L.add(I)}),L}function P(B){var M=B||{},L=M.disabled,I=M.disableCheckbox,p=M.checkable;return!!(L||I)||p===!1}function Y(B,M,L,I){for(var p=new Set(B),m=new Set,u=0;u<=L;u+=1){var h=M.get(u)||new Set;h.forEach(function(r){var n=r.key,d=r.node,w=r.children,T=w===void 0?[]:w;p.has(n)&&!I(d)&&T.filter(function(x){return!I(x.node)}).forEach(function(x){p.add(x.key)})})}for(var s=new Set,l=L;l>=0;l-=1){var i=M.get(l)||new Set;i.forEach(function(r){var n=r.parent,d=r.node;if(I(d)||!r.parent||s.has(r.parent.key))return;if(I(r.parent.node)){s.add(n.key);return}var w=!0,T=!1;(n.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var O=x.key,E=p.has(O);w&&!E&&(w=!1),!T&&(E||m.has(O))&&(T=!0)}),w&&p.add(n.key),T&&m.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(m,p))}}function W(B,M,L,I,p){for(var m=new Set(B),u=new Set(M),h=0;h<=I;h+=1){var s=L.get(h)||new Set;s.forEach(function(n){var d=n.key,w=n.node,T=n.children,x=T===void 0?[]:T;!m.has(d)&&!u.has(d)&&!p(w)&&x.filter(function(O){return!p(O.node)}).forEach(function(O){m.delete(O.key)})})}u=new Set;for(var l=new Set,i=I;i>=0;i-=1){var r=L.get(i)||new Set;r.forEach(function(n){var d=n.parent,w=n.node;if(p(w)||!n.parent||l.has(n.parent.key))return;if(p(n.parent.node)){l.add(d.key);return}var T=!0,x=!1;(d.children||[]).filter(function(O){return!p(O.node)}).forEach(function(O){var E=O.key,v=m.has(E);T&&!v&&(T=!1),!x&&(v||u.has(E))&&(x=!0)}),T||m.delete(d.key),x&&u.add(d.key),l.add(d.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(V(u,m))}}function R(B,M,L,I){var p=[],m;I?m=I:m=P;var u=new Set(B.filter(function(i){var r=!!L[i];return r||p.push(i),r})),h=new Map,s=0;Object.keys(L).forEach(function(i){var r=L[i],n=r.level,d=h.get(n);d||(d=new Set,h.set(n,d)),d.add(r),s=Math.max(s,n)}),Object(ee.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var l;return M===!0?l=Y(u,h,s,m):l=W(u,M.halfCheckedKeys,h,s,m),l}},OLES:function(Be,we,k){"use strict";var ee=k("U8pU"),V=k("VTBJ"),P=k("Ff2n"),Y=k("cDcd"),W=k("uciX"),R=k("7ixt"),B=function(u){var h=u.overlay,s=u.prefixCls,l=u.id,i=u.overlayInnerStyle;return Y.createElement("div",{className:"".concat(s,"-inner"),id:l,role:"tooltip",style:i},typeof h=="function"?h():h)},M=B,L=function(u,h){var s=u.overlayClassName,l=u.trigger,i=l===void 0?["hover"]:l,r=u.mouseEnterDelay,n=r===void 0?0:r,d=u.mouseLeaveDelay,w=d===void 0?.1:d,T=u.overlayStyle,x=u.prefixCls,O=x===void 0?"rc-tooltip":x,E=u.children,v=u.onVisibleChange,_=u.afterVisibleChange,f=u.transitionName,c=u.animation,S=u.placement,y=S===void 0?"right":S,b=u.align,N=b===void 0?{}:b,F=u.destroyTooltipOnHide,X=F===void 0?!1:F,Z=u.defaultVisible,H=u.getTooltipContainer,A=u.overlayInnerStyle,z=Object(P.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(Y.useRef)(null);Object(Y.useImperativeHandle)(h,function(){return ne.current});var ae=Object(V.a)({},z);"visible"in u&&(ae.popupVisible=u.visible);var me=function(){var De=u.arrowContent,be=De===void 0?null:De,ge=u.overlay,He=u.id;return[Y.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},be),Y.createElement(M,{key:"content",prefixCls:O,id:He,overlay:ge,overlayInnerStyle:A})]},xe=!1,Te=!1;if(typeof X=="boolean")xe=X;else if(X&&Object(ee.a)(X)==="object"){var Oe=X.keepParent;xe=Oe===!0,Te=Oe===!1}return Y.createElement(W.a,Object.assign({popupClassName:s,prefixCls:O,popup:me,action:i,builtinPlacements:R.a,popupPlacement:y,ref:ne,popupAlign:N,getPopupContainer:H,onPopupVisibleChange:v,afterPopupVisibleChange:_,popupTransitionName:f,popupAnimation:c,defaultPopupVisible:Z,destroyPopupOnHide:xe,autoDestroy:Te,mouseLeaveDelay:w,popupStyle:T,mouseEnterDelay:n},ae),E)},I=Object(Y.forwardRef)(L),p=we.a=I},OZM5:function(Be,we,k){"use strict";k.d(we,"b",function(){return I}),k.d(we,"a",function(){return p}),k.d(we,"k",function(){return m}),k.d(we,"h",function(){return u}),k.d(we,"i",function(){return h}),k.d(we,"g",function(){return s}),k.d(we,"c",function(){return l}),k.d(we,"d",function(){return i}),k.d(we,"j",function(){return d}),k.d(we,"e",function(){return w}),k.d(we,"f",function(){return T});var ee=k("KQm4"),V=k("U8pU"),P=k("Ff2n"),Y=k("cDcd"),W=k.n(Y),R=k("Kwbf"),B=k("WaYH"),M=.25,L=2;function I(x,O){var E=x.slice(),v=E.indexOf(O);return v>=0&&E.splice(v,1),E}function p(x,O){var E=x.slice();return E.indexOf(O)===-1&&E.push(O),E}function m(x){return x.split("-")}function u(x,O){return"".concat(x,"-").concat(O)}function h(x){return x&&x.type&&x.type.isTreeNode}function s(x,O){var E=[x],v=O[x];function _(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(c){var S=c.key,y=c.children;E.push(S),_(y)})}return _(v.children),E}function l(x,O){var E=x.clientY,v=O.selectHandle.getBoundingClientRect(),_=v.top,f=v.bottom,c=v.height,S=Math.max(c*M,L);return E<=_+S?-1:E>=f-S?1:0}function i(x,O){if(!x)return;var E=O.multiple;return E?x.slice():x.length?[x[0]]:x}var r=function(O){return O};function n(x,O){if(!x)return[];var E=O||{},v=E.processProps,_=v===void 0?r:v,f=Array.isArray(x)?x:[x];return f.map(function(c){var S=c.children,y=Object(P.a)(c,["children"]),b=n(S,O);return W.a.createElement(B.a,Object.assign({},_(y)),b)})}function d(x){if(!x)return null;var O;if(Array.isArray(x))O={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(V.a)(x)==="object")O={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function w(x,O){var E=new Set;function v(_){if(E.has(_))return;var f=O[_];if(!f)return;E.add(_);var c=f.parent,S=f.node;if(S.disabled)return;c&&v(c.key)}return(x||[]).forEach(function(_){v(_)}),Object(ee.a)(E)}function T(x){var O={};return Object.keys(x).forEach(function(E){(E.startsWith("data-")||E.startsWith("aria-"))&&(O[E]=x[E])}),O}},"OkW/":function(Be,we,k){},Ot1p:function(Be,we,k){"use strict";var ee=k("2qtc"),V=k("kLXV"),P=k("rAM+"),Y=k("miYZ"),W=k("tsqr"),R=k("9og8"),B=k("tJVT"),M=k("jrin"),L=k("WmNS"),I=k.n(L),p=k("cDcd"),m=k.n(p),u=k("VrN/"),h=k.n(u),s=k("bdgK"),l=k("p77/"),i=k("Bd2K"),r=k("ELLl"),n=k("19Vz"),d=k("lZu9"),w=k("+NIl"),T=k("kSUc"),x=k("9Bee"),O=function(Ce){var Ke=Ce.value,st=Ke===void 0?"":Ke,At=Ce.className,Ft=Ce.showTextOnly,kt=Ce.showLines,wt=Ce.style,Qe=wt===void 0?{}:wt,it=Object(p.useMemo)(function(){return""},[st]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:it}}))},E=k("0Owb"),v=k("dejd"),_=k("C+DQ"),f=k("1vsH"),c=k("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function y(Ce){var Ke=Ce.onActionCallback,st=Ce.title,At=Ce.icon,Ft=Ce.actionName,kt=Ce.className,wt=kt===void 0?"":kt,Qe=Ce.children;function it(){Ke(Ft)}return m.a.createElement("a",{title:st,className:wt,onClick:it},m.a.createElement("i",{className:"md-iconfont ".concat(At)}),Qe)}var b=function(Ce){var Ke=Ce.watch,st=Ce.showNullButton,At=Ce.onActionCallback,Ft=Ce.fullScreen,kt=Ce.insertTemp,wt=Ce.hidetoolBar,Qe=Ce.uuid,it=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.G)("_educoder_session"),"&key=").concat(Qe,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var We=[].concat(S,[{title:"".concat(Ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&We.map(function(ce,Se){return m.a.createElement("li",{key:Se},ce.actionName?m.a.createElement(y,Object(E.a)({},ce,{onActionCallback:At})):m.a.createElement("span",{className:"v-line"}))}),st?m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:At},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&m.a.createElement("li",null,m.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:At},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(y,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:At})))},N=k("M8RZ"),F=k("+L6B"),X=k("2/Rp"),Z=k("y8nQ"),H=k("Vl3Y"),A=k("5NDa"),z=k("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Ce){var Ke=Ce.callback,st=Ce.onCancel;function At(Ft){Ke(Ft)}return m.a.createElement(H.a,Object(E.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:At}),m.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(z.a,null)),m.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(z.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))},me=k("7ahc"),xe=k("HmJG"),Te=k("BjJ7"),Oe=H.a.useForm,Ue={width:280,marginRight:10},De={labelCol:{span:5},wrapperCol:{span:19}},be=function(Ce){var Ke=Ce.callback,st=Ce.onCancel,At=Oe(),Ft=Object(B.a)(At,1),kt=Ft[0];function wt(We){Ke(We)}function Qe(We,ce){if(We.status===-1){W.b.error(We.message);return}kt.setFieldsValue({src:"/api/attachments/".concat(We.id),type:ce.type})}function it(We){var ce=We.target.files[0];He(ce,Qe)}return m.a.createElement(H.a,Object(E.a)({form:kt},De,{className:"upload-image-panel",onFinish:wt}),m.a.createElement(H.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(z.a,{style:Ue})),m.a.createElement(ge,{onFileChange:it}))),m.a.createElement(H.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(z.a,{style:{width:264}})),m.a.createElement(H.a.Item,{style:{textAlign:"right"}},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))};function ge(Ce){var Ke=Ce.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Ke}))}function He(Ce,Ke){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var st=new FormData;st.append("editormd-image-file",Ce),st.append("file_param_name","editormd-image-file"),st.append("byxhr","true");var At=new window.XMLHttpRequest;At.withCredentials=!0,At.addEventListener("load",function(Ft){Ke(JSON.parse(Ft.target.responseText),Ce)},!1),At.addEventListener("error",function(Ft){console.error(Ft)},!1),At.open("POST","".concat(Te.a,"/api/attachments.json")),At.send(st)}var ct=k("giR+"),vt=k("fyUT"),_t=k("7Kak"),yt=k("9yH6"),et=yt.a.Group,ht={margin:"0 8px"},xt=function(Ce){var Ke=Ce.callback,st=Ce.onCancel;function At(Ft){Ke(Ft)}return m.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:At},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:ht},"\u884C\u6570"),m.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(vt.a,null)),m.a.createElement("span",{style:ht},"\u5217\u6570"),m.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(vt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(H.a.Item,{name:"align"},m.a.createElement(et,null,m.a.createElement(yt.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(yt.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(yt.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(yt.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(X.a,{type:"ghost",onClick:st},"\u53D6\u6D88")))},Tt=k("ErOA"),mt=k("7Cbv"),Ie="link",je="upload-image",$e="code-block",at="add-table",lt="------------",bt={default:lt,left:":".concat(lt),center:":".concat(lt,":"),right:"".concat(lt,":")},Mt=k("9VGf"),jt,Me;function Pe(){}var tt=0,rt=1e4,Fe="\u2581",Je=`
**\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 Ee(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=ye?"Cmd":"Ctrl",le=["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"],de=(jt={},Object(M.a)(jt,_e+"-B","bold"),Object(M.a)(jt,_e+"-I","italic"),jt),ve=(Me={},Object(M.a)(Me,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Me,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Me,je,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(Me,at,"\u6DFB\u52A0\u8868\u683C"),Me),pe=we.a=function(Ce){var Ke=Ce.defaultValue,st=Ke===void 0?"":Ke,At=Ce.onChange,Ft=Ce.width,kt=Ft===void 0?"100%":Ft,wt=Ce.height,Qe=wt===void 0?400:wt,it=Ce.miniToolbar,We=it===void 0?!1:it,ce=Ce.isFocus,Se=ce===void 0?!1:ce,ot=Ce.watch,ze=Ce.insertTemp,Lt=Ce.mode,Dt=Lt===void 0?"markdown":Lt,ke=Ce.id,qe=ke===void 0?"markdown-editor-id":ke,Rt=Ce.showResizeBar,Pt=Rt===void 0?!1:Rt,$t=Ce.noStorage,fe=$t===void 0?!1:$t,se=Ce.showNullButton,U=se===void 0?!1:se,G=Ce.hidetoolBar,Q=G===void 0?!1:G,te=Ce.fullScreen,he=te===void 0?!1:te,Le=Ce.onBlur,Ge=Ce.onCMBeforeChange,Ot=Ce.onFullScreen,Nt=Ce.className,Xe=Nt===void 0?"":Nt,It=Ce.disablePaste,an=It===void 0?!1:It,Ct=Ce.placeholder,pn=Ct===void 0?"":Ct,nn=Ce.values,$=nn===void 0?"":nn,C=Object(p.useState)(null),D=Object(B.a)(C,2),K=D[0],re=D[1],J=Object(p.useState)(st),Re=Object(B.a)(J,2),ut=Re[0],St=Re[1],Yt=Object(p.useState)(ot),dt=Object(B.a)(Yt,2),Gt=dt[0],sn=dt[1],Wn=Object(p.useState)(he),Si=Object(B.a)(Wn,2),hi=Si[0],Fn=Si[1],di=Object(p.useState)(""),Zi=Object(B.a)(di,2),_i=Zi[0],ri=Zi[1],wi=Object(p.useState)(0),Di=Object(B.a)(wi,2),Oi=Di[0],Ri=Di[1],Vi=Object(p.useState)(Qe),cr=Object(B.a)(Vi,2),rr=cr[0],ji=cr[1],Wi=Object(p.useState)(!1),hr=Object(B.a)(Wi,2),Tr=hr[0],ar=hr[1],Hn=Object(p.useRef)(Object(mt.a)()),Cn=Object(p.useRef)(!1),yi=Object(p.useRef)(),Nn=Object(p.useRef)(),Ti=Object(p.useRef)(),ii=Object(p.useRef)(),Cr=Object(p.useRef)(),Ni=function(){var mn=Object(R.a)(I.a.mark(function On(){var _n,jn;return I.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(Tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Hn.current}});case 2:jn=un.sent,jn!=null&&(_n=jn.attachments)!==null&&_n!==void 0&&_n.length&&(console.log("cm:",K,Nn),jn.attachments.map(function(Bn){Bn.content_type.indexOf("image")>-1?K.replaceSelection("![,](/api/attachments/".concat(Bn.id,"?type=").concat(Bn.content_type,")")):Bn.content_type.indexOf("video")>-1?K.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Bn.content_type.indexOf("pdf")>-1?K.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,'&disposition=inline" target="_blank">').concat(Bn.name,"</a>")):K.replaceSelection("[".concat(Bn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,")"))}));case 4:case"end":return un.stop()}},On)}));return function(){return mn.apply(this,arguments)}}();Object(p.useEffect)(function(){St($),K==null||K.setValue($)},[$]),Object(p.useEffect)(function(){Ot==null||Ot(hi)},[hi]),Object(p.useEffect)(function(){if(Nn.current){var mn=h.a.fromTextArea(Nn.current,{mode:Dt,lineNumbers:!We,lineWrapping:!0,value:st,autoCloseTags:!0,autoCloseBrackets:!0});Se&&mn.focus();function On(_n,jn){if(an){jn.preventDefault();return}var Jn=jn.clipboardData;if(Jn){var un=Jn.types.toString(),Bn=Jn.items;if(un==="Files"||Jn.types.indexOf("Files")>-1){if(jn.preventDefault(),Dt=="stex")return;try{var Ai,Yi=Bn[1];((Ai=Bn[0])===null||Ai===void 0?void 0:Ai.kind)==="file"&&(Yi=Bn[0]);var Xn=Yi.getAsFile(),_r=Xn.name.split(".").pop();He(Xn,function(oi){if(oi.id){var Ye,pt,Kt;(Xn==null||((Ye=Xn.type)===null||Ye===void 0)?void 0:Ye.indexOf("image"))>-1?mn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Xn==null||((pt=Xn.type)===null||pt===void 0)?void 0:pt.indexOf("video"))>-1?mn.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,'"></video>')):(Xn==null||((Kt=Xn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?mn.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(Xn.type,'&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):le.includes(_r)?mn.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,'?type=office&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):mn.replaceSelection("[".concat(Xn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})}catch(oi){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mn.on("paste",On),mn.on("dragleave",function(_n,jn){Ti.current.classList.remove("mouse-hover-md")}),mn.on("dragover",function(_n,jn){Ti.current.classList.add("mouse-hover-md")}),mn.on("drop",function(_n,jn){Ti.current.classList.add("mouse-hover-md");var Jn;if(Jn=jn.dataTransfer.files,Jn.length>0){jn.preventDefault(),jn.stopPropagation();for(var un=function(Yi){var Xn=Jn[Yi],_r=Xn.name.split(".").pop();He(Xn,function(oi){if(oi.id){var Ye,pt,Kt;(Xn==null||((Ye=Xn.type)===null||Ye===void 0)?void 0:Ye.indexOf("image"))>-1?mn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Xn==null||((pt=Xn.type)===null||pt===void 0)?void 0:pt.indexOf("video"))>-1?mn.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,'"></video>')):(Xn==null||((Kt=Xn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?mn.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(Xn.type,'&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):le.includes(_r)?mn.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,'?type=office&disposition=inline" target="_blank">').concat(Xn.name,"</a>")):mn.replaceSelection("[".concat(Xn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})},Bn=0;Bn<Jn.length;Bn++)un(Bn)}}),re(mn),function(){mn.off("paste",On)}}},[]);var Xi=Object(p.useCallback)(function(){if(Ti.current)try{}catch(mn){console.log(mn,"---- to set md editor body height")}},[rr,Ti,hi]);Object(p.useEffect)(function(){function mn(){var _n=new s.default(function(jn){var Jn=Object(P.a)(jn),un;try{for(Jn.s();!(un=Jn.n()).done;){var Bn=un.value;(Bn.target.offsetHeight>0||Bn.target.offsetWidth>0)&&(Xi(),K.setSize("100%","100%"),K.refresh())}}catch(Ai){Jn.e(Ai)}finally{Jn.f()}});return _n.observe(Nn.current.parentElement),_n}if(K){var On=mn();return function(){On.unobserve(Nn.current.parentElement)}}},[K,Xi]),Object(p.useEffect)(function(){if(K){for(var mn=[],On=function(){var Bn=jn[_n];Jn=Object(B.a)(Bn,2);var Ai=Jn[0],Yi=Jn[1],Xn=Object(M.a)({},Ai,function(){lr(Yi)});mn.push(Xn),K.addKeyMap(Xn)},_n=0,jn=Object.entries(de);_n<jn.length;_n++){var Jn;On()}return yi.current=setInterval(function(){Cn.current&&Ni()},4e3),function(){clearInterval(yi.current);var un=Object(P.a)(mn),Bn;try{for(un.s();!(Bn=un.n()).done;){var Ai=Bn.value;K.removeKeyMap(Ai)}}catch(Yi){un.e(Yi)}finally{un.f()}}}},[K]),Object(p.useEffect)(function(){he!==hi&&Fn(he)},[he]),Object(Mt.a)(function(){if(!fe&&Oi>0){var mn=new Date().getTime(),On=window.sessionStorage.getItem(qe);mn>=Oi+rt&&(!On||On!==ut)&&(window.sessionStorage.setItem(qe,ut),ar(!0))}},rt),Object(p.useEffect)(function(){sn(ot)},[K,ot]),Object(p.useEffect)(function(){K&&(Se&&K.focus())},[K,Se]),Object(p.useEffect)(function(){if(Gt&&K){var mn=K.getScrollerElement();function On(_n){var jn=_n.target;if(Cr.current){var Jn=jn.scrollTop/jn.scrollHeight;Cr.current.scrollTop=Cr.current.scrollHeight*Jn}}return mn.addEventListener("scroll",On),function(){mn.removeEventListener("scroll",On)}}},[K,Gt]),Object(p.useEffect)(function(){if(K&&Ge){function mn(On,_n){Ge(On,_n)}return K.on("beforeChange",mn),function(){K.off("beforeChange",mn)}}},[K,Ge]),Object(p.useEffect)(function(){if(K&&Le){function mn(){Le(K.getValue())}return K.on("blur",mn),function(){K.off("blur",mn)}}},[K,Le]),Object(p.useEffect)(function(){if(K){function mn(On){var _n=On.getValue();St(_n),Ri(new Date().getTime()),On.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),At&&At(_n)}return K.on("change",mn),function(){K.off("change",mn)}}},[K,At]),Object(p.useEffect)(function(){K&&(st==null?(K.setValue(""),St("")):st!==K.getValue()&&(K.setValue(st),St(st),K.setCursor(K.lineCount(),0)))},[K,st]);var lr=Object(p.useCallback)(function(mn){var On=K.getCursor(),_n=K.getSelection(),jn=_n.split(`
`);switch(mn){case"bold":return K.replaceSelection("**"+_n+"**"),_n===""&&K.setCursor(On.line,On.ch+2),K.focus();case"italic":return K.replaceSelection("*"+_n+"*"),_n===""&&K.setCursor(On.line,On.ch+1),K.focus();case"code":return K.replaceSelection("`"+_n+"`"),_n===""&&K.setCursor(On.line,On.ch+1),K.focus();case"inline-latex":return K.replaceSelection("`$$"+_n+"$$`"),_n===""&&K.setCursor(On.line,On.ch+3),K.focus();case"latex":return K.replaceSelection("```latex\n"+_n+"\n```"),K.setCursor(On.line+1,_n.length+1),K.focus();case"line-break":return K.replaceSelection(`<br/>
`),K.focus();case"list-ul":return _n===""?K.replaceSelection("- "+_n):K.replaceSelection(jn.map(function(Jn){return Jn===""?"":"- ".concat(Jn)}).join(`
`)),K.focus();case"list-ol":return _n===""?K.replaceSelection("1. "+_n):K.replaceSelection(jn.map(function(Jn,un){return Jn===""?"":"".concat(un+1,". ").concat(Jn)}).join(`
`)),K.focus();case"add-null-ch":return _n===""&&K.setCursor(On.line,On.ch+1),K.replaceSelection(Fe),K.focus();case"inster-template-1":return _n===""&&K.setCursor(On.line,On.ch),K.replaceSelection(Je),K.focus();case"eraser":return K.setValue(""),K.focus();case"trigger-watch":return sn(!Gt),K.focus();case"trigger-full-screen":return Fn(!hi),K.focus();case Ie:ri(Ie);return;case $e:ri($e);return;case je:ri(je);return;case at:ri(at);return;default:throw new Error}},[K,Gt,hi]),gr=Object(p.useCallback)(function(mn){ri("");switch(_i){case Ie:var On=mn.title,_n=mn.link;return K.replaceSelection("[".concat(On,"](").concat(_n,")")),K.focus();case $e:var jn=mn.language,Jn=mn.content;return K.replaceSelection(["```"+jn,Jn,"```"].join(`
`)),K.focus();case je:var un=mn.src,Bn=mn.alt;return Bn?K.replaceSelection("![ ".concat(Bn," ]( ").concat(un,' "').concat(Bn,'" )')):K.replaceSelection("![,](".concat(un,")")),K.focus();case at:for(var Ai=mn.row,Yi=mn.col,Xn=mn.align,_r=`
`,oi=0;oi<Ai;oi++){for(var Ye=[],pt=[],Kt=0;Kt<Yi;Kt++)oi===1&&pt.push(bt[Xn]),Ye.push(" ");oi===1&&(_r+="| ".concat(pt.join(" | "),` |
`)),_r+="| ".concat(Ye.join(Yi===1?"":" | "),` |
`)}return K.replaceSelection(_r+`
`),K.focus();default:throw new Error}},[K,_i]),Hr=Object(p.useMemo)(function(){switch(_i){case Ie:return m.a.createElement(ae,{callback:gr,onCancel:kr});case $e:return m.a.createElement(me.b,{callback:gr,onCancel:kr});case je:return m.a.createElement(be,{callback:gr,onCancel:kr});case at:return m.a.createElement(xt,{callback:gr,onCancel:kr});default:return null}},[_i]);function kr(){ri("")}Object(p.useEffect)(function(){if(ii.current){var mn=ii.current,On=!1,_n=0;function jn(Bn){On=!0,_n=Bn.pageY}function Jn(){On=!1}function un(Bn){if(On){var Ai=Bn.pageY-_n;Ai<0&&(Ai=0),Ai>300&&(Ai=300);var Yi=Qe+Ai+"px";ji(Yi)}}return mn.addEventListener("mousedown",jn),document.addEventListener("mousemove",un),document.addEventListener("mouseup",Jn),function(){mn.removeEventListener("mousedown",jn),document.removeEventListener("mousemove",un),document.removeEventListener("mouseup",Jn)}}},[K,ii]),Object(p.useEffect)(function(){ji(Qe)},[Qe]);var wr=Ee(kt),Xr=Ee(rr),vr={width:wr,height:Xr},Yr=Object(p.useMemo)(function(){if(Oi){var mn=new Date(Oi),On=mn.getHours(),_n=mn.getMinutes(),jn=mn.getSeconds();return On=On<10?"0"+On:On,_n=_n<10?"0"+_n:_n,jn=jn<10?"0"+jn:jn,"".concat(On,":").concat(_n,":").concat(jn)}return 0},[Oi]);function $r(){window.sessionStorage.removeItem(qe),ar(!1),Ri(0)}function fr(){ar(!1),Ri(0),K.setValue(window.sessionStorage.getItem(qe))}function Jr(mn,On){var _n=K.getValue();_n=_n.replace(mn,On),St(_n),K==null||K.setValue(_n)}return m.a.createElement(p.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ti},m.a.createElement("div",{className:"markdown-editor-container ".concat(Xe," ").concat(Gt?"on-preview":""," ").concat(We?"mini":""," ").concat(hi?"full-screen":""),style:vr},m.a.createElement(b,{insertTemp:ze,watch:Gt,fullScreen:hi,showNullButton:U,onActionCallback:lr,hidetoolBar:Q,uuid:Hn.current,setOpenPhones:function(){Cn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Nn,placeholder:pn})),Gt?m.a.createElement("div",{ref:Cr,className:"preview-container"},Dt==="stex"&&m.a.createElement(O,{value:ut}),Dt!=="stex"&&m.a.createElement(x.a,{edit:!0,value:ut,replaces:Jr})):null))),Pt?m.a.createElement("a",{ref:ii,className:"editor-resize"}):null,m.a.createElement(N.a,null,ve[_i]?m.a.createElement(V.a,{centered:!0,title:ve[_i],visible:!0,onCancel:kr,footer:null,className:"markdown-popup-form"},Hr):null))}},P5Jw:function(Be,we,k){"use strict";var ee=k("rHrb"),V=ee.CopyToClipboard;V.CopyToClipboard=V,Be.exports=V},PD8m:function(Be,we){Be.exports={name:"memoryStorage",read:ee,write:V,each:P,remove:Y,clearAll:W};var k={};function ee(R){return k[R]}function V(R,B){k[R]=B}function P(R){for(var B in k)k.hasOwnProperty(B)&&R(k[B],B)}function Y(R){delete k[R]}function W(R){k={}}},RELg:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"oldIE-userDataStorage",write:B,read:M,each:L,remove:I,clearAll:p};var P="storejs",Y=V.document,W=h(),R=(V.navigator?V.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function B(s,l){if(R)return;var i=u(s);W(function(r){r.setAttribute(i,l),r.save(P)})}function M(s){if(R)return;var l=u(s),i=null;return W(function(r){i=r.getAttribute(l)}),i}function L(s){W(function(l){for(var i=l.XMLDocument.documentElement.attributes,r=i.length-1;r>=0;r--){var n=i[r];s(l.getAttribute(n.name),n.name)}})}function I(s){var l=u(s);W(function(i){i.removeAttribute(l),i.save(P)})}function p(){W(function(s){var l=s.XMLDocument.documentElement.attributes;s.load(P);for(var i=l.length-1;i>=0;i--)s.removeAttribute(l[i].name);s.save(P)})}var m=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(s){return s.replace(/^\d/,"___$&").replace(m,"___")}function h(){if(!Y||!Y.documentElement||!Y.documentElement.addBehavior)return null;var s="script",l,i,r;try{i=new ActiveXObject("htmlfile"),i.open(),i.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),i.close(),l=i.w.frames[0].document,r=l.createElement("div")}catch(n){r=Y.createElement("div"),l=Y.body}return function(n){var d=[].slice.call(arguments,0);d.unshift(r),l.appendChild(r),r.addBehavior("#default#userData"),r.load(P),n.apply(this,d),l.removeChild(r);return}}},RpDr:function(Be,we,k){"use strict";k.d(we,"a",function(){return x}),k.d(we,"c",function(){return v});var ee=k("+L6B"),V=k("2/Rp"),P=k("tJVT"),Y=k("k1fw"),W=k("jrin"),R=k("5NDa"),B=k("5rEg"),M=k("cDcd"),L=k.n(M),I=k("8Skl"),p=k("y3Kf"),m=k("bdLU"),u=k("J66h"),h=k.n(u),s=k("++UQ"),l=k.n(s),i=k("IxHN"),r=k("9Bee"),n=k("1vsH"),d,w=B.a.TextArea,T={visible:!1,tabIndex:"0"},x=(d={},Object(W.a)(d,m.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(W.a)(d,m.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(W.a)(d,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(W.a)(d,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(W.a)(d,4,"\u7F16\u8BD1\u5931\u8D25"),Object(W.a)(d,5,"\u6267\u884C\u5931\u8D25"),d),O;(function(f){f[f.SET_VISIBLE=0]="SET_VISIBLE",f[f.SET_TABINDEX=1]="SET_TABINDEX"})(O||(O={}));function E(f,c){switch(c.type){case O.SET_VISIBLE:return Object(Y.a)(Object(Y.a)({},f),{},{visible:c.payload});case O.SET_TABINDEX:return Object(Y.a)(Object(Y.a)({},f),{},{tabIndex:c.payload});default:throw new Error}}function v(f){var c=f.status,S=f.error_msg,y=f.output,b=f.input,N=f.expected_output,F=f.is_file,X=f.input_file_url,Z=f.output_file_url,H=f.expected_output_file_url,A=null,z={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(c){case m.a.NOMATCH:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!F&&L.a.createElement(r.a,{value:y&&u.Base64.decode(y)||"",style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(Z,y)}},y)),L.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!F&&L.a.createElement(r.a,{value:N&&u.Base64.decode(N)||"",style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(H,N)}},N)));break;case m.a.EXECUTEFAILURE:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.COMPILEFAILURE:A=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!F&&L.a.createElement(r.a,{value:b,style:z}),F&&L.a.createElement("div",{style:z},L.a.createElement("a",{onClick:function(){return Object(n.y)(X,b)}},b)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.PODFAILURE:A=L.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:A=L.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return L.a.createElement(L.a.Fragment,null," ",A," ")}function _(f){var c=f.status,S=f.error_msg,y=f.execute_time,b=f.output,N=f.input,F=f.expected_output,X=f.is_file,Z=f.input_file_url,H=f.output_file_url,A=f.expected_output_file_url,z=null;switch(c){case m.a.OK:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",y),L.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),L.a.createElement("pre",null,u.Base64.decode(b)));break;case m.a.NOMATCH:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u8F93\u51FA\uFF1A",b&&u.Base64.decode(b)),L.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",F&&u.Base64.decode(F)));break;case m.a.EXECUTEFAILURE:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.COMPILEFAILURE:z=L.a.createElement(L.a.Fragment,null,L.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",L.a.createElement("pre",null,N)),L.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),L.a.createElement("pre",{className:"error"},u.Base64.decode(S)));break;case m.a.PODFAILURE:z=L.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:z=L.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return L.a.createElement(L.a.Fragment,null," ",z," ")}we.b=function(f){var c=f.id,S=f.input,y=f.debuging,b=f.submitting,N=f.executingMessage,F=f.debugResult,X=f.onChangeInput,Z=f.onDebugCode,H=f.onSubmitCode,A=Object(M.useReducer)(E,T),z=Object(P.a)(A,2),ne=z[0],ae=z[1],me=ne.visible,xe=ne.tabIndex;Object(M.useEffect)(function(){ae({type:O.SET_VISIBLE,payload:!1})},[c]);function Te(be){var ge=be.target.id;ae({type:O.SET_TABINDEX,payload:ge})}function Oe(){ae({type:O.SET_VISIBLE,payload:!me})}var Ue=Object(M.useMemo)(function(){if(F){var be=F.status;return L.a.createElement(L.a.Fragment,null,_(F))}return null},[F]);function De(){ae({type:O.SET_VISIBLE,payload:!0}),ae({type:O.SET_TABINDEX,payload:"1"}),Z()}return L.a.createElement("div",{className:"test-case-panel"},L.a.createElement("div",{className:"test-case-panel-body ".concat(me?"active":"")},L.a.createElement("ul",{className:"s-navs"},L.a.createElement("li",null,L.a.createElement("a",{className:xe==="0"?"active":"",id:"0",onClick:Te},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),L.a.createElement("li",null,L.a.createElement("a",{className:xe==="1"?"active":"",id:"1",onClick:Te},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),L.a.createElement("div",{className:"tab-panel-body ".concat(xe==="0"?"":"hide")},L.a.createElement(w,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:S,onChange:X})),L.a.createElement("div",{className:"tab-panel-body ".concat(xe==="1"?"":"hide")},y?L.a.createElement(i.a,{message:N}):F?L.a.createElement("section",{style:{height:200}}," ",Ue," "):L.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),L.a.createElement("a",{className:"btn-collapse ".concat(me?"up":""),onClick:Oe},me?L.a.createElement(I.a,null):L.a.createElement(p.a,null)),L.a.createElement("footer",{className:"footer"},L.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),L.a.createElement("div",{className:"flex-container"},L.a.createElement(V.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),L.a.createElement(V.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),L.a.createElement(V.a,{className:"btn-green",type:"ghost",loading:y,onClick:De},"\u8C03\u8BD5\u4EE3\u7801"),L.a.createElement(V.a,{type:"primary",loading:b,disabled:b,onClick:function(){ae({type:O.SET_VISIBLE,payload:!1}),H()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(Be,we,k){Be.exports=k.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Be,we,k){var ee=k("wTVA"),V=k("EbDI"),P=k("ZhPi"),Y=k("wkBT");function W(R){return ee(R)||V(R)||P(R)||Y()}Be.exports=W,Be.exports.__esModule=!0,Be.exports.default=Be.exports},SJMd:function(Be,we){/**
* @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 k,ee,V,P=!1,Y,W;window.PR_SHOULD_USE_CONTINUATION=!0;var R,B;(function(){var M=window,L=["break,continue,do,else,for,if,return,while"],I=[L,"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"],p=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[p,"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"],u=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[p,"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"],s="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",l=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",r=[L,"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"],n=[L,"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=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[m,h,u,l,i,r,n,d],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",E="com",v="typ",_="lit",f="pun",c="pln",S="tag",y="dec",b="src",N="atn",F="atv",X="nocode",Z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(et){for(var ht=0,xt=!1,Tt=!1,mt=0,Ie=et.length;mt<Ie;++mt){var je=et[mt];if(je.ignoreCase)Tt=!0;else if(/[a-z]/i.test(je.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){xt=!0,Tt=!1;break}}var $e={b:8,t:9,n:10,v:11,f:12,r:13};function at(Me){var Pe=Me.charCodeAt(0);if(Pe!==92)return Pe;var tt=Me.charAt(1);return Pe=$e[tt],Pe||("0"<=tt&&tt<="7"?parseInt(Me.substring(1),8):tt==="u"||tt==="x"?parseInt(Me.substring(2),16):Me.charCodeAt(1))}function lt(Me){if(Me<32)return(Me<16?"\\x0":"\\x")+Me.toString(16);var Pe=String.fromCharCode(Me);return Pe==="\\"||Pe==="-"||Pe==="]"||Pe==="^"?"\\"+Pe:Pe}function bt(Me){var Pe=Me.substring(1,Me.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),tt=[],rt=Pe[0]==="^",Fe=["["];rt&&Fe.push("^");for(var Je=rt?1:0,Ee=Pe.length;Je<Ee;++Je){var ye=Pe[Je];if(/\\[bdsw]/i.test(ye))Fe.push(ye);else{var _e=at(ye),le;Je+2<Ee&&Pe[Je+1]==="-"?(le=at(Pe[Je+2]),Je+=2):le=_e,tt.push([_e,le]),le<65||_e>122||(le<65||_e>90||tt.push([Math.max(65,_e)|32,Math.min(le,90)|32]),le<97||_e>122||tt.push([Math.max(97,_e)&~32,Math.min(le,122)&~32]))}}tt.sort(function(Ce,Ke){return Ce[0]-Ke[0]||Ke[1]-Ce[1]});for(var de=[],ve=[],Je=0;Je<tt.length;++Je){var pe=tt[Je];pe[0]<=ve[1]+1?ve[1]=Math.max(ve[1],pe[1]):de.push(ve=pe)}for(var Je=0;Je<de.length;++Je){var pe=de[Je];Fe.push(lt(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&Fe.push("-"),Fe.push(lt(pe[1])))}return Fe.push("]"),Fe.join("")}function Mt(Me){for(var Pe=Me.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")),tt=Pe.length,rt=[],Fe=0,Je=0;Fe<tt;++Fe){var Ee=Pe[Fe];if(Ee==="(")++Je;else if(Ee.charAt(0)==="\\"){var ye=+Ee.substring(1);ye&&(ye<=Je?rt[ye]=-1:Pe[Fe]=lt(ye))}}for(var Fe=1;Fe<rt.length;++Fe)rt[Fe]===-1&&(rt[Fe]=++ht);for(var Fe=0,Je=0;Fe<tt;++Fe){var Ee=Pe[Fe];if(Ee==="(")++Je,rt[Je]||(Pe[Fe]="(?:");else if(Ee.charAt(0)==="\\"){var ye=+Ee.substring(1);ye&&ye<=Je&&(Pe[Fe]="\\"+rt[ye])}}for(var Fe=0;Fe<tt;++Fe)Pe[Fe]==="^"&&Pe[Fe+1]!=="^"&&(Pe[Fe]="");if(Me.ignoreCase&&xt)for(var Fe=0;Fe<tt;++Fe){var Ee=Pe[Fe],_e=Ee.charAt(0);Ee.length>=2&&_e==="["?Pe[Fe]=bt(Ee):_e!=="\\"&&(Pe[Fe]=Ee.replace(/[a-zA-Z]/g,function(ve){var pe=ve.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Pe.join("")}for(var jt=[],mt=0,Ie=et.length;mt<Ie;++mt){var je=et[mt];if(je.global||je.multiline)throw new Error(""+je);jt.push("(?:"+Mt(je)+")")}return new RegExp(jt.join("|"),Tt?"gi":"g")}function A(et,ht){var xt=/(?:^|\s)nocode(?:\s|$)/,Tt=[],mt=0,Ie=[],je=0;function $e(at){var lt=at.nodeType;if(lt==1){if(xt.test(at.className))return;for(var bt=at.firstChild;bt;bt=bt.nextSibling)$e(bt);var Mt=at.nodeName.toLowerCase();(Mt==="br"||Mt==="li")&&(Tt[je]=`
`,Ie[je<<1]=mt++,Ie[je++<<1|1]=at)}else if(lt==3||lt==4){var jt=at.nodeValue;jt.length&&(ht?jt=jt.replace(/\r\n?/g,`
`):jt=jt.replace(/[ \t\r\n]+/g," "),Tt[je]=jt,Ie[je<<1]=mt,mt+=jt.length,Ie[je++<<1|1]=at)}}return $e(et),{sourceCode:Tt.join("").replace(/\n$/,""),spans:Ie}}function z(et,ht,xt,Tt,mt){if(!xt)return;var Ie={sourceNode:et,pre:1,langExtension:null,numberLines:null,sourceCode:xt,spans:null,basePos:ht,decorations:null};Tt(Ie),mt.push.apply(mt,Ie.decorations)}var ne=/\S/;function ae(et){for(var ht=void 0,xt=et.firstChild;xt;xt=xt.nextSibling){var Tt=xt.nodeType;ht=Tt===1?ht?et:xt:Tt===3&&ne.test(xt.nodeValue)?et:ht}return ht===et?void 0:ht}function me(et,ht){var xt={},Tt;(function(){for(var je=et.concat(ht),$e=[],at={},lt=0,bt=je.length;lt<bt;++lt){var Mt=je[lt],jt=Mt[3];if(jt)for(var Me=jt.length;--Me>=0;)xt[jt.charAt(Me)]=Mt;var Pe=Mt[1],tt=""+Pe;at.hasOwnProperty(tt)||($e.push(Pe),at[tt]=null)}$e.push(/[\0-\uffff]/),Tt=H($e)})();var mt=ht.length,Ie=function(je){for(var $e=je.sourceCode,at=je.basePos,lt=je.sourceNode,bt=[at,c],Mt=0,jt=$e.match(Tt)||[],Me={},Pe=0,tt=jt.length;Pe<tt;++Pe){var rt=jt[Pe],Fe=Me[rt],Je=void 0,Ee;if(typeof Fe=="string")Ee=!1;else{var ye=xt[rt.charAt(0)];if(ye)Je=rt.match(ye[1]),Fe=ye[0];else{for(var _e=0;_e<mt;++_e)if(ye=ht[_e],Je=rt.match(ye[1]),Je){Fe=ye[0];break}Je||(Fe=c)}Ee=Fe.length>=5&&Fe.substring(0,5)==="lang-",Ee&&!(Je&&typeof Je[1]=="string")&&(Ee=!1,Fe=b),Ee||(Me[rt]=Fe)}var le=Mt;if(Mt+=rt.length,!Ee)bt.push(at+le,Fe);else{var de=Je[1],ve=rt.indexOf(de),pe=ve+de.length;Je[2]&&(pe=rt.length-Je[2].length,ve=pe-de.length);var Ce=Fe.substring(5);z(lt,at+le,rt.substring(0,ve),Ie,bt),z(lt,at+le+ve,de,ge(Ce,de),bt),z(lt,at+le+pe,rt.substring(pe),Ie,bt)}}je.decorations=bt};return Ie}function xe(et){var ht=[],xt=[];et.tripleQuotedStrings?ht.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):et.multiLineStrings?ht.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ht.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),et.verbatimStrings&&xt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Tt=et.hashComments;Tt&&(et.cStyleComments?(Tt>1?ht.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ht.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),xt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ht.push([E,/^#[^\r\n]*/,null,"#"])),et.cStyleComments&&(xt.push([E,/^\/\/[^\r\n]*/,null]),xt.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var mt=et.regexLiterals;if(mt){var Ie=mt>1?"":`
\r`,je=Ie?".":"[\\S\\s]",$e="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+je+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+je+")*(?:\\x5D|$))+/";xt.push(["lang-regex",RegExp("^"+Z+"("+$e+")")])}var at=et.types;at&&xt.push([v,at]);var lt=(""+et.keywords).replace(/^ | $/g,"");lt.length&&xt.push([O,new RegExp("^(?:"+lt.replace(/[\s,]+/g,"|")+")\\b"),null]),ht.push([c,/^\s+/,null,` \r
\xA0`]);var bt="^.[^\\s\\w.$@'\"`/\\\\]*";return et.regexLiterals&&(bt+="(?!s*/)"),xt.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[f,new RegExp(bt),null]),me(ht,xt)}var Te=xe({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(et,ht,xt){for(var Tt=/(?:^|\s)nocode(?:\s|$)/,mt=/\r\n?|\n/,Ie=et.ownerDocument,je=Ie.createElement("li");et.firstChild;)je.appendChild(et.firstChild);var $e=[je];function at(Pe){var tt=Pe.nodeType;if(tt==1&&!Tt.test(Pe.className))if(Pe.nodeName==="br")lt(Pe),Pe.parentNode&&Pe.parentNode.removeChild(Pe);else for(var rt=Pe.firstChild;rt;rt=rt.nextSibling)at(rt);else if((tt==3||tt==4)&&xt){var Fe=Pe.nodeValue,Je=Fe.match(mt);if(Je){var Ee=Fe.substring(0,Je.index);Pe.nodeValue=Ee;var ye=Fe.substring(Je.index+Je[0].length);if(ye){var _e=Pe.parentNode;_e.insertBefore(Ie.createTextNode(ye),Pe.nextSibling)}lt(Pe),Ee||Pe.parentNode.removeChild(Pe)}}}function lt(Pe){for(;!Pe.nextSibling;)if(Pe=Pe.parentNode,!Pe)return;function tt(Je,Ee){var ye=Ee?Je.cloneNode(!1):Je,_e=Je.parentNode;if(_e){var le=tt(_e,1),de=Je.nextSibling;le.appendChild(ye);for(var ve=de;ve;ve=de)de=ve.nextSibling,le.appendChild(ve)}return ye}for(var rt=tt(Pe.nextSibling,0),Fe;(Fe=rt.parentNode)&&Fe.nodeType===1;)rt=Fe;$e.push(rt)}for(var bt=0;bt<$e.length;++bt)at($e[bt]);ht===(ht|0)&&$e[0].setAttribute("value",ht);var Mt=Ie.createElement("ol");Mt.className="linenums";for(var jt=Math.max(0,ht-1|0)||0,bt=0,Me=$e.length;bt<Me;++bt)je=$e[bt],je.className="L"+(bt+jt)%10,je.firstChild||je.appendChild(Ie.createTextNode("\xA0")),Mt.appendChild(je);et.appendChild(Mt)}function Ue(et){var ht=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ht=ht&&+ht[1]<=8;var xt=/\n/g,Tt=et.sourceCode,mt=Tt.length,Ie=0,je=et.spans,$e=je.length,at=0,lt=et.decorations,bt=lt.length,Mt=0;lt[bt]=mt;var jt,Me;for(Me=jt=0;Me<bt;)lt[Me]!==lt[Me+2]?(lt[jt++]=lt[Me++],lt[jt++]=lt[Me++]):Me+=2;for(bt=jt,Me=jt=0;Me<bt;){for(var Pe=lt[Me],tt=lt[Me+1],rt=Me+2;rt+2<=bt&&lt[rt+1]===tt;)rt+=2;lt[jt++]=Pe,lt[jt++]=tt,Me=rt}bt=lt.length=jt;var Fe=et.sourceNode,Je="";Fe&&(Je=Fe.style.display,Fe.style.display="none");try{for(var Ee=null;at<$e;){var ye=je[at],_e=je[at+2]||mt,le=lt[Mt+2]||mt,rt=Math.min(_e,le),de=je[at+1],ve;if(de.nodeType!==1&&(ve=Tt.substring(Ie,rt))){ht&&(ve=ve.replace(xt,"\r")),de.nodeValue=ve;var pe=de.ownerDocument,Ce=pe.createElement("span");Ce.className=lt[Mt+1];var Ke=de.parentNode;Ke.replaceChild(Ce,de),Ce.appendChild(de),Ie<_e&&(je[at+1]=de=pe.createTextNode(Tt.substring(rt,_e)),Ke.insertBefore(de,Ce.nextSibling))}Ie=rt,Ie>=_e&&(at+=2),Ie>=le&&(Mt+=2)}}finally{Fe&&(Fe.style.display=Je)}}var De={};function be(et,ht){for(var xt=ht.length;--xt>=0;){var Tt=ht[xt];De.hasOwnProperty(Tt)?M.console&&console.warn("cannot override language handler %s",Tt):De[Tt]=et}}function ge(et,ht){return et&&De.hasOwnProperty(et)||(et=/^\s*</.test(ht)?"default-markup":"default-code"),De[et]}be(Te,["default-code"]),be(me([],[[c,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(me([[c,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["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"]),be(me([],[[F,/^[\s\S]+/]]),["uq.val"]),be(xe({keywords:m,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),be(xe({keywords:"null,true,false"}),["json"]),be(xe({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),be(xe({keywords:u,cStyleComments:!0}),["java"]),be(xe({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(xe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(xe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(xe({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(xe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(xe({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(me([],[[x,/^[\s\S]+/]]),["regex"]);function He(et){var ht=et.langExtension;try{var xt=A(et.sourceNode,et.pre),Tt=xt.sourceCode;et.sourceCode=Tt,et.spans=xt.spans,et.basePos=0,ge(ht,Tt)(et),Ue(et)}catch(mt){M.console&&console.log(mt&&mt.stack||mt)}}function ct(et,ht,xt){var Tt=xt||!1,mt=ht||null,Ie=document.createElement("div");Ie.innerHTML="<pre>"+et+"</pre>",Ie=Ie.firstChild,Tt&&Oe(Ie,Tt,!0);var je={langExtension:mt,numberLines:Tt,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return He(je),Ie.innerHTML}function vt(et,ht){var xt=ht||document.body,Tt=xt.ownerDocument||document;function mt(ye){return xt.getElementsByTagName(ye)}for(var Ie=[mt("pre"),mt("code"),mt("xmp")],je=[],$e=0;$e<Ie.length;++$e)for(var at=0,lt=Ie[$e].length;at<lt;++at)je.push(Ie[$e][at]);Ie=null;var bt=Date;bt.now||(bt={now:function(){return+new Date}});var Mt=0,jt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Me=/\bprettyprint\b/,Pe=/\bprettyprinted\b/,tt=/pre|xmp/i,rt=/^code$/i,Fe=/^(?:pre|code|xmp)$/i,Je={};function Ee(){for(var ye=M.PR_SHOULD_USE_CONTINUATION?bt.now()+250:Infinity;Mt<je.length&&bt.now()<ye;Mt++){for(var _e=je[Mt],le=Je,de=_e;de=de.previousSibling;){var ve=de.nodeType,pe=(ve===7||ve===8)&&de.nodeValue;if(pe?!/^\??prettify\b/.test(pe):ve!==3||/\S/.test(de.nodeValue))break;if(pe){le={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ot,ze,Lt){le[ze]=Lt});break}}var Ce=_e.className;if((le!==Je||Me.test(Ce))&&!Pe.test(Ce)){for(var Ke=!1,st=_e.parentNode;st;st=st.parentNode){var At=st.tagName;if(Fe.test(At)&&st.className&&Me.test(st.className)){Ke=!0;break}}if(!Ke){_e.className+=" prettyprinted";var Ft=le.lang;if(!Ft){Ft=Ce.match(jt);var kt;!Ft&&(kt=ae(_e))&&rt.test(kt.tagName)&&(Ft=kt.className.match(jt)),Ft&&(Ft=Ft[1])}var wt;if(tt.test(_e.tagName))wt=1;else{var Qe=_e.currentStyle,it=Tt.defaultView,We=Qe?Qe.whiteSpace:it&&it.getComputedStyle?it.getComputedStyle(_e,null).getPropertyValue("white-space"):0;wt=We&&We.substring(0,3)==="pre"}var ce=le.linenums;(ce=ce==="true"||+ce)||(ce=Ce.match(/\blinenums\b(?::(\d+))?/),ce=ce?ce[1]&&ce[1].length?+ce[1]:!0:!1),ce&&Oe(_e,ce,wt);var Se={langExtension:Ft,sourceNode:_e,numberLines:ce,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};He(Se)}}}Mt<je.length?M.setTimeout(Ee,250):typeof et=="function"&&et()}Ee()}var _t=M.PR={createSimpleLexer:me,registerLangHandler:be,sourceDecorator:xe,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:F,PR_COMMENT:E,PR_DECLARATION:y,PR_KEYWORD:O,PR_LITERAL:_,PR_NOCODE:X,PR_PLAIN:c,PR_PUNCTUATION:f,PR_SOURCE:b,PR_STRING:x,PR_TAG:S,PR_TYPE:v,prettyPrintOne:P?M.prettyPrintOne=ct:R=ct,prettyPrint:B=P?M.prettyPrint=vt:B=vt},yt=M.define;typeof yt=="function"&&yt.amd&&yt("google-code-prettify",[],function(){return _t})})()},TXwP:function(Be,we,k){var ee,V;(function(){var P;(function(){"use strict";var W=[,,function(L){function I(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var u=new I(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},I.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},I.prototype.has_match=function(u){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(u))return!0;return!1},I.prototype.set_indent=function(u,h){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(u){this.__items.push(u);var h=u.lastIndexOf(`
`);h!==-1?this.__character_count=u.length-h:this.__character_count+=u.length},I.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,h){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),h=h||"",u.indent_level>0&&(h=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}p.prototype.get_indent_size=function(u,h){var s=this.__base_string_length;return h=h||0,u<0&&(s=0),s+=u*this.__indent_size,s+=h,s},p.prototype.get_indent_string=function(u,h){var s=this.__base_string;return h=h||0,u<0&&(u=0,s=""),h+=u*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,h=0,s="";this.__indent_size&&u>=this.__indent_size&&(h=Math.floor(u/this.__indent_size),u-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function m(u,h){this.__indent_cache=new p(u,h),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(u,h){return this.__indent_cache.get_indent_string(u,h)},m.prototype.get_indent_size=function(u,h){return this.__indent_cache.get_indent_size(u,h)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(u){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return u!==`
`&&(s=s.replace(/[\n]/g,u)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(u,h){return u=u||0,h=h||0,this.next_line.set_indent(u,h),this.__lines.length>1?(this.current_line.set_indent(u,h),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(u){for(var h=0;h<u.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(u){for(var h=this.__lines.length;u<h;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(u,h){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==h){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},L.exports.Output=m},,,,function(L){function I(u,h){this.raw_options=p(u,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(u,h){var s=this.raw_options[u],l=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(l=s.concat()):typeof s=="string"&&(l=s.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(u,h){var s=this.raw_options[u],l=s===void 0?!!h:!!s;return l},I.prototype._get_characters=function(u,h){var s=this.raw_options[u],l=h||"";return typeof s=="string"&&(l=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(u,h){var s=this.raw_options[u];h=parseInt(h,10),isNaN(h)&&(h=0);var l=parseInt(s,10);return isNaN(l)&&(l=h),l},I.prototype._get_selection=function(u,h,s){var l=this._get_selection_list(u,h,s);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[u]+"'");return l[0]},I.prototype._get_selection_list=function(u,h,s){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[h[0]],!this._is_valid_selection(s,h))throw new Error("Invalid Default Value!");var l=this._get_array(u,s);if(!this._is_valid_selection(l,h))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[u]+"'");return l},I.prototype._is_valid_selection=function(u,h){return u.length&&h.length&&!u.some(function(s){return h.indexOf(s)===-1})};function p(u,h){var s={};u=m(u);var l;for(l in u)l!==h&&(s[l]=u[l]);if(h&&u[h])for(l in u[h])s[l]=u[h][l];return s}function m(u){var h={},s;for(s in u){var l=s.replace(/-/g,"_");h[l]=u[s]}return h}L.exports.Options=I,L.exports.normalizeOpts=m,L.exports.mergeOpts=p},,function(L){var I=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(u=this.__input.charAt(m)),u},p.prototype.__match=function(m,u){m.lastIndex=u;var h=m.exec(this.__input);return h&&!(I&&m.sticky)&&(h.index!==u&&(h=null)),h},p.prototype.test=function(m,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(m,u):!1},p.prototype.testChar=function(m,u){var h=this.peek(u);return m.lastIndex=0,h!==null&&m.test(h)},p.prototype.match=function(m){var u=this.__match(m,this.__position);return u?this.__position+=u[0].length:u=null,u},p.prototype.read=function(m,u,h){var s="",l;return m&&(l=this.match(m),l&&(s+=l[0])),u&&(l||!m)&&(s+=this.readUntil(u,h)),s},p.prototype.readUntil=function(m,u){var h="",s=this.__position;m.lastIndex=this.__position;var l=m.exec(this.__input);return l?(s=l.index,u&&(s+=l[0].length)):s=this.__input_length,h=this.__input.substring(this.__position,s),this.__position=s,h},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,u){var h=null,s="g";return u&&I&&(s="y"),typeof m=="string"&&m!==""?h=new RegExp(m,s):m&&(h=new RegExp(m.source,s)),h},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var u=this.__position,h=this.readUntilAfter(m);return this.__position=u,h},p.prototype.lookBack=function(m){var u=this.__position-1;return u>=m.length&&this.__input.substring(u-m.length,u).toLowerCase()===m},L.exports.InputScanner=p},,,,,function(L){function I(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)m[u[1]]=u[2],u=this.__directive_pattern.exec(p);return m},I.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=I},,function(L,I,p){var m=p(16).Beautifier,u=p(17).Options;function h(s,l){var i=new m(s,l);return i.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new u}},function(L,I,p){var m=p(17).Options,u=p(2).Output,h=p(8).InputScanner,s=p(13).Directives,l=new s(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,d=/(?:\s|\n)+/g,w=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(O,E){this._source_text=O||"",this._options=new m(E),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(O){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return E},x.prototype.eatWhitespace=function(O){for(var E=n.test(this._input.peek()),v=0;n.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return E},x.prototype.foundNestedPseudoClass=function(){for(var O=0,E=1,v=this._input.peek(E);v;){if(v==="{")return!0;if(v==="(")O+=1;else if(v===")"){if(O===0)return!1;O-=1}else if(v===";"||v==="}")return!1;E++,v=this._input.peek(E)}return!1},x.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},x.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,E=this._options.eol;E==="auto"&&(E=`
`,O&&i.test(O||"")&&(E=O.match(i)[0])),O=O.replace(r,`
`);var v=O.match(/^[\t ]*/)[0];this._output=new u(this._options,v),this._input=new h(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,f=!1,c=!1,S=!1,y=!1,b=!1,N=!1,F=this._ch,X=!1,Z,H,A;Z=this._input.read(d),H=Z!=="",A=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(w),ne=l.get_directives(z);ne&&ne.ignore==="start"&&(z+=l.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?y=!0:ae==="import"&&(b=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(S=!0)):!f&&_===0&&ae.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),S?(S=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(A==="("?this._output.space_before_token=!1:A!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),A==="{"&&this._output.trim(!0),b=!1,y=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;me++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[me])){X=!0;break}(f||S)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&_===0?(this.print_string(":"),c||(c=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var xe=A==='"'||A==="'";this.preserveSingleSpace(xe||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")X=!1,_===0?(c&&(this.outdent(),c=!1),y=!1,b=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),_++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),_&&(_--,this.outdent()));else{var Te=!1;this._input.lookBack("with")&&(Te=!0),this.preserveSingleSpace(H||Te),this.print_string(this._ch),c&&A==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!c||N)&&_===0&&!b&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&_===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Oe=A==='"'||A==="'";this.preserveSingleSpace(Oe||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&X&&this._output.add_new_line()}var Ue=this._output.get_code(E);return Ue},L.exports.Beautifier=x},function(L,I,p){var m=p(6).Options;function u(h){m.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<l.length;i++)l[i]!=="expand"?this.brace_style="collapse":this.brace_style=l[i]}u.prototype=new m,L.exports.Options=u}],R={};function B(L){var I=R[L];if(I!==void 0)return I.exports;var p=R[L]={exports:{}};return W[L](p,p.exports,B),p.exports}var M=B(15);P=M})();var Y=P;!(ee=[],V=function(){return{css_beautify:Y}}.apply(we,ee),V!==void 0&&(Be.exports=V))})()},TcMa:function(Be,we,k){Be.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:function(Be,we,k){},VEzc:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},"VrN/":function(Be,we,k){(function(ee,V){Be.exports=V()})(this,function(){"use strict";var ee=navigator.userAgent,V=navigator.platform,P=/gecko\/\d/i.test(ee),Y=/MSIE \d/.test(ee),W=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee),R=/Edge\/(\d+)/.exec(ee),B=Y||W||R,M=B&&(Y?document.documentMode||6:+(R||W)[1]),L=!R&&/WebKit\//.test(ee),I=L&&/Qt\/\d+\.\d+/.test(ee),p=!R&&/Chrome\//.test(ee),m=/Opera\//.test(ee),u=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ee),s=/PhantomJS/.test(ee),l=!R&&/AppleWebKit/.test(ee)&&/Mobile\/\w+/.test(ee),i=/Android/.test(ee),r=l||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ee),n=l||/Mac/.test(V),d=/\bCrOS\b/.test(ee),w=/win/i.test(V),T=m&&ee.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(m=!1,L=!0);var x=n&&(I||m&&(T==null||T<12.11)),O=P||B&&M>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var o=e.className,a=E(t).exec(o);if(a){var g=o.slice(a.index+a[0].length);e.className=o.slice(0,a.index)+(g?a[1]+g:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return _(e).appendChild(t)}function c(e,t,o,a){var g=document.createElement(e);if(o&&(g.className=o),a&&(g.style.cssText=a),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var j=0;j<t.length;++j)g.appendChild(t[j]);return g}function S(e,t,o,a){var g=c(e,t,o,a);return g.setAttribute("role","presentation"),g}var y;document.createRange?y=function(e,t,o,a){var g=document.createRange();return g.setEnd(a||e,o),g.setStart(e,t),g}:y=function(e,t,o){var a=document.body.createTextRange();try{a.moveToElementText(e.parentNode)}catch(g){return a}return a.collapse(!0),a.moveEnd("character",o),a.moveStart("character",t),a};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function F(e,t){var o=e.className;E(t).test(o)||(e.className+=(o?" ":"")+t)}function X(e,t){for(var o=e.split(" "),a=0;a<o.length;a++)o[a]&&!E(o[a]).test(t)&&(t+=" "+o[a]);return t}var Z=function(e){e.select()};l?Z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:B&&(Z=function(e){try{e.select()}catch(t){}});function H(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function A(e,t,o){t||(t={});for(var a in e)e.hasOwnProperty(a)&&(o!==!1||!t.hasOwnProperty(a))&&(t[a]=e[a]);return t}function z(e,t,o,a,g){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var j=a||0,q=g||0;;){var ie=e.indexOf(" ",j);if(ie<0||ie>=t)return q+(t-j);q+=ie-j,q+=o-q%o,j=ie+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=H(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 o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function ae(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var me=50,xe={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},Oe={origin:"*mouse"},Ue={origin:"+move"};function De(e,t,o){for(var a=0,g=0;;){var j=e.indexOf(" ",a);j==-1&&(j=e.length);var q=j-a;if(j==e.length||g+q>=t)return a+Math.min(q,t-g);if(g+=j-a,g+=o-g%o,a=j+1,g>=t)return a}}var be=[""];function ge(e){for(;be.length<=e;)be.push(He(be)+" ");return be[e]}function He(e){return e[e.length-1]}function ct(e,t){for(var o=[],a=0;a<e.length;a++)o[a]=t(e[a],a);return o}function vt(e,t,o){for(var a=0,g=o(t);a<e.length&&o(e[a])<=g;)a++;e.splice(a,0,t)}function _t(){}function yt(e,t){var o;return Object.create?o=Object.create(e):(_t.prototype=e,o=new _t),t&&A(t,o),o}var et=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||et.test(e))}function xt(e,t){return t?t.source.indexOf("\\w")>-1&&ht(e)?!0:t.test(e):ht(e)}function Tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var mt=/[\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 Ie(e){return e.charCodeAt(0)>=768&&mt.test(e)}function je(e,t,o){for(;(o<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=o;return t}function $e(e,t,o){for(var a=t>o?-1:1;;){if(t==o)return t;var g=(t+o)/2,j=a<0?Math.ceil(g):Math.floor(g);if(j==t)return e(j)?t:o;e(j)?o=j:t=j+a}}function at(e,t,o,a){if(!e)return a(t,o,"ltr",0);for(var g=!1,j=0;j<e.length;++j){var q=e[j];(q.from<o&&q.to>t||t==o&&q.to==t)&&(a(Math.max(q.from,t),Math.min(q.to,o),q.level==1?"rtl":"ltr",j),g=!0)}g||a(t,o,"ltr")}var lt=null;function bt(e,t,o){var a;lt=null;for(var g=0;g<e.length;++g){var j=e[g];if(j.from<t&&j.to>t)return g;j.to==t&&(j.from!=j.to&&o=="before"?a=g:lt=g),j.from==t&&(j.from!=j.to&&o!="before"?a=g:lt=g)}return a!=null?a:lt}var Mt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(ue){return ue<=247?e.charAt(ue):1424<=ue&&ue<=1524?"R":1536<=ue&&ue<=1785?t.charAt(ue-1536):1774<=ue&&ue<=2220?"r":8192<=ue&&ue<=8203?"w":ue==8204?"b":"L"}var a=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,j=/[LRr]/,q=/[Lb1n]/,ie=/[1n]/;function oe(ue,Ae,Ne){this.level=ue,this.from=Ae,this.to=Ne}return function(ue,Ae){var Ne=Ae=="ltr"?"L":"R";if(ue.length==0||Ae=="ltr"&&!a.test(ue))return!1;for(var Ze=ue.length,Ve=[],Et=0;Et<Ze;++Et)Ve.push(o(ue.charCodeAt(Et)));for(var Ut=0,Ht=Ne;Ut<Ze;++Ut){var Jt=Ve[Ut];Jt=="m"?Ve[Ut]=Ht:Ht=Jt}for(var rn=0,Zt=Ne;rn<Ze;++rn){var dn=Ve[rn];dn=="1"&&Zt=="r"?Ve[rn]="n":j.test(dn)&&(Zt=dn,dn=="r"&&(Ve[rn]="R"))}for(var An=1,En=Ve[0];An<Ze-1;++An){var Qn=Ve[An];Qn=="+"&&En=="1"&&Ve[An+1]=="1"?Ve[An]="1":Qn==","&&En==Ve[An+1]&&(En=="1"||En=="n")&&(Ve[An]=En),En=Qn}for(var Ci=0;Ci<Ze;++Ci){var nr=Ve[Ci];if(nr==",")Ve[Ci]="N";else if(nr=="%"){var ki=void 0;for(ki=Ci+1;ki<Ze&&Ve[ki]=="%";++ki);for(var Mr=Ci&&Ve[Ci-1]=="!"||ki<Ze&&Ve[ki]=="1"?"1":"N",Er=Ci;Er<ki;++Er)Ve[Er]=Mr;Ci=ki-1}}for(var Gi=0,xr=Ne;Gi<Ze;++Gi){var sr=Ve[Gi];xr=="L"&&sr=="1"?Ve[Gi]="L":j.test(sr)&&(xr=sr)}for(var Ji=0;Ji<Ze;++Ji)if(g.test(Ve[Ji])){var zi=void 0;for(zi=Ji+1;zi<Ze&&g.test(Ve[zi]);++zi);for(var Fi=(Ji?Ve[Ji-1]:Ne)=="L",Sr=(zi<Ze?Ve[zi]:Ne)=="L",La=Fi==Sr?Fi?"L":"R":Ne,ua=Ji;ua<zi;++ua)Ve[ua]=La;Ji=zi-1}for(var dr=[],Qr,ir=0;ir<Ze;)if(q.test(Ve[ir])){var jo=ir;for(++ir;ir<Ze&&q.test(Ve[ir]);++ir);dr.push(new oe(0,jo,ir))}else{var ea=ir,ma=dr.length,ga=Ae=="rtl"?1:0;for(++ir;ir<Ze&&Ve[ir]!="L";++ir);for(var mr=ea;mr<ir;)if(ie.test(Ve[mr])){ea<mr&&(dr.splice(ma,0,new oe(1,ea,mr)),ma+=ga);var Ia=mr;for(++mr;mr<ir&&ie.test(Ve[mr]);++mr);dr.splice(ma,0,new oe(2,Ia,mr)),ma+=ga,ea=mr}else++mr;ea<ir&&dr.splice(ma,0,new oe(1,ea,ir))}return Ae=="ltr"&&(dr[0].level==1&&(Qr=ue.match(/^\s+/))&&(dr[0].from=Qr[0].length,dr.unshift(new oe(0,0,Qr[0].length))),He(dr).level==1&&(Qr=ue.match(/\s+$/))&&(He(dr).to-=Qr[0].length,dr.push(new oe(0,Ze-Qr[0].length,Ze)))),Ae=="rtl"?dr.reverse():dr}}();function jt(e,t){var o=e.order;return o==null&&(o=e.order=Mt(e.text,t)),o}var Me=[],Pe=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var a=e._handlers||(e._handlers={});a[t]=(a[t]||Me).concat(o)}};function tt(e,t){return e._handlers&&e._handlers[t]||Me}function rt(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var a=e._handlers,g=a&&a[t];if(g){var j=ae(g,o);j>-1&&(a[t]=g.slice(0,j).concat(g.slice(j+1)))}}}function Fe(e,t){var o=tt(e,t);if(!o.length)return;for(var a=Array.prototype.slice.call(arguments,2),g=0;g<o.length;++g)o[g].apply(null,a)}function Je(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Fe(e,o||t.type,e,t),ve(t)||t.codemirrorIgnore}function Ee(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),a=0;a<t.length;++a)ae(o,t[a])==-1&&o.push(t[a])}function ye(e,t){return tt(e,t).length>0}function _e(e){e.prototype.on=function(t,o){Pe(this,t,o)},e.prototype.off=function(t,o){rt(this,t,o)}}function le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function de(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ve(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){le(e),de(e)}function Ce(e){return e.target||e.srcElement}function Ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}var st=function(){if(B&&M<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),At;function Ft(e){if(At==null){var t=c("span","\u200B");f(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(At=t.offsetWidth<=1&&t.offsetHeight>2&&!(B&&M<8))}var o=At?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var kt;function wt(e){if(kt!=null)return kt;var t=f(e,document.createTextNode("A\u062EA")),o=y(t,0,1).getBoundingClientRect(),a=y(t,1,2).getBoundingClientRect();return _(e),!o||o.left==o.right?!1:kt=a.right-o.right<3}var Qe=`
b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],a=e.length;t<=a;){var g=e.indexOf(`
`,t);g==-1&&(g=e.length);var j=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),q=j.indexOf("\r");q!=-1?(o.push(j.slice(0,q)),t+=q+1):(o.push(j),t=g+1)}return o}:function(e){return e.split(/\r\n?|\n/)},it=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(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},We=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ce=null;function Se(e){if(ce!=null)return ce;var t=f(e,c("span","x")),o=t.getBoundingClientRect(),a=y(t,0,1).getBoundingClientRect();return ce=Math.abs(o.left-a.left)>1}var ot={},ze={};function Lt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ot[e]=t}function Dt(e,t){ze[e]=t}function ke(e){if(typeof e=="string"&&ze.hasOwnProperty(e))e=ze[e];else if(e&&typeof e.name=="string"&&ze.hasOwnProperty(e.name)){var t=ze[e.name];typeof t=="string"&&(t={name:t}),e=yt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ke("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ke("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qe(e,t){t=ke(t);var o=ot[t.name];if(!o)return qe(e,"text/plain");var a=o(e,t);if(Rt.hasOwnProperty(t.name)){var g=Rt[t.name];for(var j in g){if(!g.hasOwnProperty(j))continue;a.hasOwnProperty(j)&&(a["_"+j]=a[j]),a[j]=g[j]}}if(a.name=t.name,t.helperType&&(a.helperType=t.helperType),t.modeProps)for(var q in t.modeProps)a[q]=t.modeProps[q];return a}var Rt={};function Pt(e,t){var o=Rt.hasOwnProperty(e)?Rt[e]:Rt[e]={};A(t,o)}function $t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var a in t){var g=t[a];g instanceof Array&&(g=g.concat([])),o[a]=g}return o}function fe(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function se(e,t,o){return e.startState?e.startState(t,o):!0}var U=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};U.prototype.eol=function(){return this.pos>=this.string.length},U.prototype.sol=function(){return this.pos==this.lineStart},U.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},U.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},U.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},U.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},U.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},U.prototype.skipToEnd=function(){this.pos=this.string.length},U.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},U.prototype.backUp=function(e){this.pos-=e},U.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},U.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},U.prototype.match=function(e,t,o){if(typeof e=="string"){var a=function(q){return o?q.toLowerCase():q},g=this.string.substr(this.pos,e.length);if(a(g)==a(e))return t!==!1&&(this.pos+=e.length),!0}else{var j=this.string.slice(this.pos).match(e);return j&&j.index>0?null:(j&&t!==!1&&(this.pos+=j[0].length),j)}},U.prototype.current=function(){return this.string.slice(this.start,this.pos)},U.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},U.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},U.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(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 o=e;!o.lines;)for(var a=0;;++a){var g=o.children[a],j=g.chunkSize();if(t<j){o=g;break}t-=j}return o.lines[t]}function Q(e,t,o){var a=[],g=t.line;return e.iter(t.line,o.line+1,function(j){var q=j.text;g==o.line&&(q=q.slice(0,o.ch)),g==t.line&&(q=q.slice(t.ch)),a.push(q),++g}),a}function te(e,t,o){var a=[];return e.iter(t,o,function(g){a.push(g.text)}),a}function he(e,t){var o=t-e.height;if(o)for(var a=e;a;a=a.parent)a.height+=o}function Le(e){if(e.parent==null)return null;for(var t=e.parent,o=ae(t.lines,e),a=t.parent;a;t=a,a=a.parent)for(var g=0;!(a.children[g]==t);++g)o+=a.children[g].chunkSize();return o+t.first}function Ge(e,t){var o=e.first;e:do{for(var a=0;a<e.children.length;++a){var g=e.children[a],j=g.height;if(t<j){e=g;continue e}t-=j,o+=g.chunkSize()}return o}while(!e.lines);for(var q=0;q<e.lines.length;++q){var ie=e.lines[q],oe=ie.height;if(t<oe)break;t-=oe}return o+q}function Ot(e,t){return t>=e.first&&t<e.first+e.size}function Nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Xe(e,t,o){if(o===void 0&&(o=null),!(this instanceof Xe))return new Xe(e,t,o);this.line=e,this.ch=t,this.sticky=o}function It(e,t){return e.line-t.line||e.ch-t.ch}function an(e,t){return e.sticky==t.sticky&&It(e,t)==0}function Ct(e){return Xe(e.line,e.ch)}function pn(e,t){return It(e,t)<0?t:e}function nn(e,t){return It(e,t)<0?e:t}function $(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function C(e,t){if(t.line<e.first)return Xe(e.first,0);var o=e.first+e.size-1;return t.line>o?Xe(o,G(e,o).text.length):D(t,G(e,t.line).text.length)}function D(e,t){var o=e.ch;return o==null||o>t?Xe(e.line,t):o<0?Xe(e.line,0):e}function K(e,t){for(var o=[],a=0;a<t.length;a++)o[a]=C(e,t[a]);return o}var re=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,o,a){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=a||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.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}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,o){return t instanceof re?new J(e,$t(e.mode,t.state),o,t.lookAhead):new J(e,$t(e.mode,t),o)},J.prototype.save=function(e){var t=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new re(t,this.maxLookAhead):t};function Re(e,t,o,a){var g=[e.state.modeGen],j={};hi(e,t.text,e.doc.mode,o,function(ue,Ae){return g.push(ue,Ae)},j,a);for(var q=o.state,ie=function(ue){o.baseTokens=g;var Ae=e.state.overlays[ue],Ne=1,Ze=0;o.state=!0,hi(e,t.text,Ae.mode,o,function(Ve,Et){for(var Ut=Ne;Ze<Ve;){var Ht=g[Ne];Ht>Ve&&g.splice(Ne,1,Ve,g[Ne+1],Ht),Ne+=2,Ze=Math.min(Ve,Ht)}if(!Et)return;if(Ae.opaque)g.splice(Ut,Ne-Ut,Ve,"overlay "+Et),Ne=Ut+2;else for(;Ut<Ne;Ut+=2){var Jt=g[Ut+1];g[Ut+1]=(Jt?Jt+" ":"")+"overlay "+Et}},j),o.state=q,o.baseTokens=null,o.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ie(oe);return{styles:g,classes:j.bgClass||j.textClass?j:null}}function ut(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var a=St(e,Le(t)),g=t.text.length>e.options.maxHighlightLength&&$t(e.doc.mode,a.state),j=Re(e,t,a);g&&(a.state=g),t.stateAfter=a.save(!g),t.styles=j.styles,j.classes?t.styleClasses=j.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,o){var a=e.doc,g=e.display;if(!a.mode.startState)return new J(a,!0,t);var j=Fn(e,t,o),q=j>a.first&&G(a,j-1).stateAfter,ie=q?J.fromSaved(a,q,j):new J(a,se(a.mode),j);return a.iter(j,t,function(oe){Yt(e,oe.text,ie);var ue=ie.line;oe.stateAfter=ue==t-1||ue%5==0||ue>=g.viewFrom&&ue<g.viewTo?ie.save():null,ie.nextLine()}),o&&(a.modeFrontier=ie.line),ie}function Yt(e,t,o,a){var g=e.doc.mode,j=new U(t,e.options.tabSize,o);for(j.start=j.pos=a||0,t==""&&dt(g,o.state);!j.eol();)Gt(g,j,o.state),j.start=j.pos}function dt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var o=fe(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}function Gt(e,t,o,a){for(var g=0;g<10;g++){a&&(a[0]=fe(e,o).mode);var j=e.token(t,o);if(t.pos>t.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var sn=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Wn(e,t,o,a){var g=e.doc,j=g.mode,q;t=C(g,t);var ie=G(g,t.line),oe=St(e,t.line,o),ue=new U(ie.text,e.options.tabSize,oe),Ae;for(a&&(Ae=[]);(a||ue.pos<t.ch)&&!ue.eol();)ue.start=ue.pos,q=Gt(j,ue,oe.state),a&&Ae.push(new sn(ue,q,$t(g.mode,oe.state)));return a?Ae:new sn(ue,q,oe.state)}function Si(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var a=o[1]?"bgClass":"textClass";t[a]==null?t[a]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[a])||(t[a]+=" "+o[2])}return e}function hi(e,t,o,a,g,j,q){var ie=o.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var oe=0,ue=null,Ae=new U(t,e.options.tabSize,a),Ne,Ze=e.options.addModeClass&&[null];for(t==""&&Si(dt(o,a.state),j);!Ae.eol();){if(Ae.pos>e.options.maxHighlightLength?(ie=!1,q&&Yt(e,t,a,Ae.pos),Ae.pos=t.length,Ne=null):Ne=Si(Gt(o,Ae,a.state,Ze),j),Ze){var Ve=Ze[0].name;Ve&&(Ne="m-"+(Ne?Ve+" "+Ne:Ve))}if(!ie||ue!=Ne){for(;oe<Ae.start;)oe=Math.min(Ae.start,oe+5e3),g(oe,ue);ue=Ne}Ae.start=Ae.pos}for(;oe<Ae.pos;){var Et=Math.min(Ae.pos,oe+5e3);g(Et,ue),oe=Et}}function Fn(e,t,o){for(var a,g,j=e.doc,q=o?-1:t-(e.doc.mode.innerMode?1e3:100),ie=t;ie>q;--ie){if(ie<=j.first)return j.first;var oe=G(j,ie-1),ue=oe.stateAfter;if(ue&&(!o||ie+(ue instanceof re?ue.lookAhead:0)<=j.modeFrontier))return ie;var Ae=z(oe.text,null,e.options.tabSize);(g==null||a>Ae)&&(g=ie-1,a=Ae)}return g}function di(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var o=e.first,a=t-1;a>o;a--){var g=G(e,a).stateAfter;if(g&&(!(g instanceof re)||a+g.lookAhead<t)){o=a+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}var Zi=!1,_i=!1;function ri(){Zi=!0}function wi(){_i=!0}function Di(e,t,o){this.marker=e,this.from=t,this.to=o}function Oi(e,t){if(e)for(var o=0;o<e.length;++o){var a=e[o];if(a.marker==t)return a}}function Ri(e,t){for(var o,a=0;a<e.length;++a)e[a]!=t&&(o||(o=[])).push(e[a]);return o}function Vi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,o){var a;if(e)for(var g=0;g<e.length;++g){var j=e[g],q=j.marker,ie=j.from==null||(q.inclusiveLeft?j.from<=t:j.from<t);if(ie||j.from==t&&q.type=="bookmark"&&(!o||!j.marker.insertLeft)){var oe=j.to==null||(q.inclusiveRight?j.to>=t:j.to>t);(a||(a=[])).push(new Di(q,j.from,oe?null:j.to))}}return a}function rr(e,t,o){var a;if(e)for(var g=0;g<e.length;++g){var j=e[g],q=j.marker,ie=j.to==null||(q.inclusiveRight?j.to>=t:j.to>t);if(ie||j.from==t&&q.type=="bookmark"&&(!o||j.marker.insertLeft)){var oe=j.from==null||(q.inclusiveLeft?j.from<=t:j.from<t);(a||(a=[])).push(new Di(q,oe?null:j.from-t,j.to==null?null:j.to-t))}}return a}function ji(e,t){if(t.full)return null;var o=Ot(e,t.from.line)&&G(e,t.from.line).markedSpans,a=Ot(e,t.to.line)&&G(e,t.to.line).markedSpans;if(!o&&!a)return null;var g=t.from.ch,j=t.to.ch,q=It(t.from,t.to)==0,ie=cr(o,g,q),oe=rr(a,j,q),ue=t.text.length==1,Ae=He(t.text).length+(ue?g:0);if(ie)for(var Ne=0;Ne<ie.length;++Ne){var Ze=ie[Ne];if(Ze.to==null){var Ve=Oi(oe,Ze.marker);Ve?ue&&(Ze.to=Ve.to==null?null:Ve.to+Ae):Ze.to=g}}if(oe)for(var Et=0;Et<oe.length;++Et){var Ut=oe[Et];if(Ut.to!=null&&(Ut.to+=Ae),Ut.from==null){var Ht=Oi(ie,Ut.marker);Ht||(Ut.from=Ae,ue&&(ie||(ie=[])).push(Ut))}else Ut.from+=Ae,ue&&(ie||(ie=[])).push(Ut)}ie&&(ie=Wi(ie)),oe&&oe!=ie&&(oe=Wi(oe));var Jt=[ie];if(!ue){var rn=t.text.length-2,Zt;if(rn>0&&ie)for(var dn=0;dn<ie.length;++dn)ie[dn].to==null&&(Zt||(Zt=[])).push(new Di(ie[dn].marker,null,null));for(var An=0;An<rn;++An)Jt.push(Zt);Jt.push(oe)}return Jt}function Wi(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function hr(e,t,o){var a=null;if(e.iter(t.line,o.line+1,function(Ve){if(Ve.markedSpans)for(var Et=0;Et<Ve.markedSpans.length;++Et){var Ut=Ve.markedSpans[Et].marker;Ut.readOnly&&(!a||ae(a,Ut)==-1)&&(a||(a=[])).push(Ut)}}),!a)return null;for(var g=[{from:t,to:o}],j=0;j<a.length;++j)for(var q=a[j],ie=q.find(0),oe=0;oe<g.length;++oe){var ue=g[oe];if(It(ue.to,ie.from)<0||It(ue.from,ie.to)>0)continue;var Ae=[oe,1],Ne=It(ue.from,ie.from),Ze=It(ue.to,ie.to);(Ne<0||!q.inclusiveLeft&&!Ne)&&Ae.push({from:ue.from,to:ie.from}),(Ze>0||!q.inclusiveRight&&!Ze)&&Ae.push({from:ie.to,to:ue.to}),g.splice.apply(g,Ae),oe+=Ae.length-3}return g}function Tr(e){var t=e.markedSpans;if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}function ar(e,t){if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}function Hn(e){return e.inclusiveLeft?-1:0}function Cn(e){return e.inclusiveRight?1:0}function yi(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var a=e.find(),g=t.find(),j=It(a.from,g.from)||Hn(e)-Hn(t);if(j)return-j;var q=It(a.to,g.to)||Cn(e)-Cn(t);return q||t.id-e.id}function Nn(e,t){var o=_i&&e.markedSpans,a;if(o)for(var g=void 0,j=0;j<o.length;++j)g=o[j],g.marker.collapsed&&(t?g.from:g.to)==null&&(!a||yi(a,g.marker)<0)&&(a=g.marker);return a}function Ti(e){return Nn(e,!0)}function ii(e){return Nn(e,!1)}function Cr(e,t){var o=_i&&e.markedSpans,a;if(o)for(var g=0;g<o.length;++g){var j=o[g];j.marker.collapsed&&(j.from==null||j.from<t)&&(j.to==null||j.to>t)&&(!a||yi(a,j.marker)<0)&&(a=j.marker)}return a}function Ni(e,t,o,a,g){var j=G(e,t),q=_i&&j.markedSpans;if(q)for(var ie=0;ie<q.length;++ie){var oe=q[ie];if(!oe.marker.collapsed)continue;var ue=oe.marker.find(0),Ae=It(ue.from,o)||Hn(oe.marker)-Hn(g),Ne=It(ue.to,a)||Cn(oe.marker)-Cn(g);if(Ae>=0&&Ne<=0||Ae<=0&&Ne>=0)continue;if(Ae<=0&&(oe.marker.inclusiveRight&&g.inclusiveLeft?It(ue.to,o)>=0:It(ue.to,o)>0)||Ae>=0&&(oe.marker.inclusiveRight&&g.inclusiveLeft?It(ue.from,a)<=0:It(ue.from,a)<0))return!0}}function Xi(e){for(var t;t=Ti(e);)e=t.find(-1,!0).line;return e}function lr(e){for(var t;t=ii(e);)e=t.find(1,!0).line;return e}function gr(e){for(var t,o;t=ii(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Hr(e,t){var o=G(e,t),a=Xi(o);return o==a?t:Le(a)}function kr(e,t){if(t>e.lastLine())return t;var o=G(e,t),a;if(!wr(e,o))return t;for(;a=ii(o);)o=a.find(1,!0).line;return Le(o)+1}function wr(e,t){var o=_i&&t.markedSpans;if(o)for(var a=void 0,g=0;g<o.length;++g){if(a=o[g],!a.marker.collapsed)continue;if(a.from==null)return!0;if(a.marker.widgetNode)continue;if(a.from==0&&a.marker.inclusiveLeft&&Xr(e,t,a))return!0}}function Xr(e,t,o){if(o.to==null){var a=o.marker.find(1,!0);return Xr(e,a.line,Oi(a.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var g=void 0,j=0;j<t.markedSpans.length;++j)if(g=t.markedSpans[j],g.marker.collapsed&&!g.marker.widgetNode&&g.from==o.to&&(g.to==null||g.to!=o.from)&&(g.marker.inclusiveLeft||o.marker.inclusiveRight)&&Xr(e,t,g))return!0}function vr(e){e=Xi(e);for(var t=0,o=e.parent,a=0;a<o.lines.length;++a){var g=o.lines[a];if(g==e)break;t+=g.height}for(var j=o.parent;j;o=j,j=o.parent)for(var q=0;q<j.children.length;++q){var ie=j.children[q];if(ie==o)break;t+=ie.height}return t}function Yr(e){if(e.height==0)return 0;for(var t=e.text.length,o,a=e;o=Ti(a);){var g=o.find(0,!0);a=g.from.line,t+=g.from.ch-g.to.ch}for(a=e;o=ii(a);){var j=o.find(0,!0);t-=a.text.length-j.from.ch,a=j.to.line,t+=a.text.length-j.to.ch}return t}function $r(e){var t=e.display,o=e.doc;t.maxLine=G(o,o.first),t.maxLineLength=Yr(t.maxLine),t.maxLineChanged=!0,o.iter(function(a){var g=Yr(a);g>t.maxLineLength&&(t.maxLineLength=g,t.maxLine=a)})}var fr=function(e,t,o){this.text=e,ar(this,t),this.height=o?o(this):1};fr.prototype.lineNo=function(){return Le(this)},_e(fr);function Jr(e,t,o,a){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Tr(e),ar(e,o);var g=a?a(e):1;g!=e.height&&he(e,g)}function mn(e){e.parent=null,Tr(e)}var On={},_n={};function jn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?_n:On;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Jn(e,t){var o=S("span",null,null,L?"padding-right: .1px":null),a={pre:S("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var j=g?t.rest[g-1]:t.line,q=void 0;a.pos=0,a.addToken=Bn,wt(e.display.measure)&&(q=jt(j,e.doc.direction))&&(a.addToken=Yi(a.addToken,q)),a.map=[];var ie=t!=e.display.externalMeasured&&Le(j);_r(j,a,ut(e,j,ie)),j.styleClasses&&(j.styleClasses.bgClass&&(a.bgClass=X(j.styleClasses.bgClass,a.bgClass||"")),j.styleClasses.textClass&&(a.textClass=X(j.styleClasses.textClass,a.textClass||""))),a.map.length==0&&a.map.push(0,0,a.content.appendChild(Ft(e.display.measure))),g==0?(t.measure.map=a.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(a.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(L){var oe=a.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(a.content.className="cm-tab-wrap-hack")}return Fe(e,"renderLine",e,t.line,a.pre),a.pre.className&&(a.textClass=X(a.pre.className,a.textClass||"")),a}function un(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,o,a,g,j,q){if(!t)return;var ie=e.splitSpaces?Ai(t,e.trailingSpace):t,oe=e.cm.state.specialChars,ue=!1,Ae;if(!oe.test(t))e.col+=t.length,Ae=document.createTextNode(ie),e.map.push(e.pos,e.pos+t.length,Ae),B&&M<9&&(ue=!0),e.pos+=t.length;else{Ae=document.createDocumentFragment();for(var Ne=0;;){oe.lastIndex=Ne;var Ze=oe.exec(t),Ve=Ze?Ze.index-Ne:t.length-Ne;if(Ve){var Et=document.createTextNode(ie.slice(Ne,Ne+Ve));B&&M<9?Ae.appendChild(c("span",[Et])):Ae.appendChild(Et),e.map.push(e.pos,e.pos+Ve,Et),e.col+=Ve,e.pos+=Ve}if(!Ze)break;Ne+=Ve+1;var Ut=void 0;if(Ze[0]==" "){var Ht=e.cm.options.tabSize,Jt=Ht-e.col%Ht;Ut=Ae.appendChild(c("span",ge(Jt),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=Jt}else Ze[0]=="\r"||Ze[0]==`
`?(Ut=Ae.appendChild(c("span",Ze[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",Ze[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(Ze[0]),Ut.setAttribute("cm-text",Ze[0]),B&&M<9?Ae.appendChild(c("span",[Ut])):Ae.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=ie.charCodeAt(t.length-1)==32,o||a||g||ue||j||q){var rn=o||"";a&&(rn+=a),g&&(rn+=g);var Zt=c("span",[Ae],rn,j);if(q)for(var dn in q)q.hasOwnProperty(dn)&&dn!="style"&&dn!="class"&&Zt.setAttribute(dn,q[dn]);return e.content.appendChild(Zt)}e.content.appendChild(Ae)}function Ai(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,a="",g=0;g<e.length;g++){var j=e.charAt(g);j==" "&&o&&(g==e.length-1||e.charCodeAt(g+1)==32)&&(j="\xA0"),a+=j,o=j==" "}return a}function Yi(e,t){return function(o,a,g,j,q,ie,oe){g=g?g+" cm-force-border":"cm-force-border";for(var ue=o.pos,Ae=ue+a.length;;){for(var Ne=void 0,Ze=0;Ze<t.length&&!(Ne=t[Ze],Ne.to>ue&&Ne.from<=ue);Ze++);if(Ne.to>=Ae)return e(o,a,g,j,q,ie,oe);e(o,a.slice(0,Ne.to-ue),g,j,null,ie,oe),j=null,a=a.slice(Ne.to-ue),ue=Ne.to}}}function Xn(e,t,o,a){var g=!a&&o.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!a&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",o.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function _r(e,t,o){var a=e.markedSpans,g=e.text,j=0;if(!a){for(var q=1;q<o.length;q+=2)t.addToken(t,g.slice(j,j=o[q]),jn(o[q+1],t.cm.options));return}for(var ie=g.length,oe=0,ue=1,Ae="",Ne,Ze,Ve=0,Et,Ut,Ht,Jt,rn;;){if(Ve==oe){Et=Ut=Ht=Ze="",rn=null,Jt=null,Ve=Infinity;for(var Zt=[],dn=void 0,An=0;An<a.length;++An){var En=a[An],Qn=En.marker;if(Qn.type=="bookmark"&&En.from==oe&&Qn.widgetNode)Zt.push(Qn);else if(En.from<=oe&&(En.to==null||En.to>oe||Qn.collapsed&&En.to==oe&&En.from==oe)){if(En.to!=null&&En.to!=oe&&Ve>En.to&&(Ve=En.to,Ut=""),Qn.className&&(Et+=" "+Qn.className),Qn.css&&(Ze=(Ze?Ze+";":"")+Qn.css),Qn.startStyle&&En.from==oe&&(Ht+=" "+Qn.startStyle),Qn.endStyle&&En.to==Ve&&(dn||(dn=[])).push(Qn.endStyle,En.to),Qn.title&&((rn||(rn={})).title=Qn.title),Qn.attributes)for(var Ci in Qn.attributes)(rn||(rn={}))[Ci]=Qn.attributes[Ci];Qn.collapsed&&(!Jt||yi(Jt.marker,Qn)<0)&&(Jt=En)}else En.from>oe&&Ve>En.from&&(Ve=En.from)}if(dn)for(var nr=0;nr<dn.length;nr+=2)dn[nr+1]==Ve&&(Ut+=" "+dn[nr]);if(!Jt||Jt.from==oe)for(var ki=0;ki<Zt.length;++ki)Xn(t,0,Zt[ki]);if(Jt&&(Jt.from||0)==oe){if(Xn(t,(Jt.to==null?ie+1:Jt.to)-oe,Jt.marker,Jt.from==null),Jt.to==null)return;Jt.to==oe&&(Jt=!1)}}if(oe>=ie)break;for(var Mr=Math.min(ie,Ve);;){if(Ae){var Er=oe+Ae.length;if(!Jt){var Gi=Er>Mr?Ae.slice(0,Mr-oe):Ae;t.addToken(t,Gi,Ne?Ne+Et:Et,Ht,oe+Gi.length==Ve?Ut:"",Ze,rn)}if(Er>=Mr){Ae=Ae.slice(Mr-oe),oe=Mr;break}oe=Er,Ht=""}Ae=g.slice(j,j=o[ue++]),Ne=jn(o[ue++],t.cm.options)}}}function oi(e,t,o){this.line=t,this.rest=gr(t),this.size=this.rest?Le(He(this.rest))-o+1:1,this.node=this.text=null,this.hidden=wr(e,t)}function Ye(e,t,o){for(var a=[],g,j=t;j<o;j=g){var q=new oi(e.doc,G(e.doc,j),j);g=j+q.size,a.push(q)}return a}var pt=null;function Kt(e){pt?pt.ops.push(e):e.ownsGroup=pt={ops:[e],delayedCallbacks:[]}}function fn(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var a=0;a<e.ops.length;a++){var g=e.ops[a];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(o<t.length)}function tn(e,t){var o=e.ownsGroup;if(!o)return;try{fn(o)}finally{pt=null,t(o)}}var Xt=null;function nt(e,t){var o=tt(e,t);if(!o.length)return;var a=Array.prototype.slice.call(arguments,2),g;pt?g=pt.delayedCallbacks:Xt?g=Xt:(g=Xt=[],setTimeout(gt,0));for(var j=function(ie){g.push(function(){return o[ie].apply(null,a)})},q=0;q<o.length;++q)j(q)}function gt(){var e=Xt;Xt=null;for(var t=0;t<e.length;++t)e[t]()}function cn(e,t,o,a){for(var g=0;g<t.changes.length;g++){var j=t.changes[g];j=="text"?vn(e,t):j=="gutter"?Mn(e,t,o,a):j=="class"?Kn(e,t):j=="widget"&&Sn(e,t,a)}t.changes=null}function ft(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),B&&M<8&&(e.node.style.zIndex=2)),e.node}function hn(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var a=ft(t);t.background=a.insertBefore(c("div",null,o),a.firstChild),e.display.input.setUneditable(t.background)}}function Bt(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):Jn(e,t)}function vn(e,t){var o=t.text.className,a=Bt(e,t);t.text==t.node&&(t.node=a.pre),t.text.parentNode.replaceChild(a.pre,t.text),t.text=a.pre,a.bgClass!=t.bgClass||a.textClass!=t.textClass?(t.bgClass=a.bgClass,t.textClass=a.textClass,Kn(e,t)):o&&(t.text.className=o)}function Kn(e,t){hn(e,t),t.line.wrapClass?ft(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function Mn(e,t,o,a){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var g=ft(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px; width: "+a.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),g.insertBefore(t.gutterBackground,t.text)}var j=t.line.gutterMarkers;if(e.options.lineNumbers||j){var q=ft(t),ie=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),q.insertBefore(ie,t.text),t.line.gutterClass&&(ie.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!j||!j["CodeMirror-linenumbers"])&&(t.lineNumber=ie.appendChild(c("div",Nt(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+a.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),j)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var ue=e.display.gutterSpecs[oe].className,Ae=j.hasOwnProperty(ue)&&j[ue];Ae&&ie.appendChild(c("div",[Ae],"CodeMirror-gutter-elt","left: "+a.gutterLeft[ue]+"px; width: "+a.gutterWidth[ue]+"px"))}}}function Sn(e,t,o){t.alignable&&(t.alignable=null);for(var a=E("CodeMirror-linewidget"),g=t.node.firstChild,j=void 0;g;g=j)j=g.nextSibling,a.test(g.className)&&t.node.removeChild(g);Ln(e,t,o)}function ni(e,t,o,a){var g=Bt(e,t);return t.text=t.node=g.pre,g.bgClass&&(t.bgClass=g.bgClass),g.textClass&&(t.textClass=g.textClass),Kn(e,t),Mn(e,t,o,a),Ln(e,t,a),t.node}function Ln(e,t,o){if(Zn(e,t.line,t,o,!0),t.rest)for(var a=0;a<t.rest.length;a++)Zn(e,t.rest[a],t,o,!1)}function Zn(e,t,o,a,g){if(!t.widgets)return;for(var j=ft(o),q=0,ie=t.widgets;q<ie.length;++q){var oe=ie[q],ue=c("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||ue.setAttribute("cm-ignore-events","true"),qn(oe,ue,o,a),e.display.input.setUneditable(ue),g&&oe.above?j.insertBefore(ue,o.gutter||o.text):j.appendChild(ue),nt(oe,"redraw")}}function qn(e,t,o,a){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var g=a.wrapperWidth;t.style.left=a.fixedPos+"px",e.coverGutter||(g-=a.gutterTotalWidth,t.style.paddingLeft=a.gutterTotalWidth+"px"),t.style.width=g+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-a.gutterTotalWidth+"px"))}function bi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,c("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function Un(e,t){for(var o=Ce(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function mi(e){return e.lineSpace.offsetTop}function gi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ai(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,c("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,a={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(a.left)&&!isNaN(a.right)&&(e.cachedPaddingH=a),a}function kn(e){return me-e.display.nativeBarWidth}function ei(e){return e.display.scroller.clientWidth-kn(e)-e.display.barWidth}function Gn(e){return e.display.scroller.clientHeight-kn(e)-e.display.barHeight}function Vt(e,t,o){var a=e.options.lineWrapping,g=a&&ei(e);if(!t.measure.heights||a&&t.measure.width!=g){var j=t.measure.heights=[];if(a){t.measure.width=g;for(var q=t.text.firstChild.getClientRects(),ie=0;ie<q.length-1;ie++){var oe=q[ie],ue=q[ie+1];Math.abs(oe.bottom-ue.bottom)>2&&j.push((oe.bottom+ue.top)/2-o.top)}}j.push(o.bottom-o.top)}}function Tn(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var a=0;a<e.rest.length;a++)if(e.rest[a]==t)return{map:e.measure.maps[a],cache:e.measure.caches[a]};for(var g=0;g<e.rest.length;g++)if(Le(e.rest[g])>o)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function si(e,t){t=Xi(t);var o=Le(t),a=e.display.externalMeasured=new oi(e.doc,t,o);a.lineN=o;var g=a.built=Jn(e,a);return a.text=g.pre,f(e.display.lineMeasure,g.pre),a}function vi(e,t,o,a){return Dn(e,ti(e,t),o,a)}function ui(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Lr(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function ti(e,t){var o=Le(t),a=ui(e,o);a&&!a.text?a=null:a&&a.changes&&(cn(e,a,o,Ui(e)),e.curOp.forceUpdate=!0),a||(a=si(e,t));var g=Tn(a,t,o);return{line:t,view:a,rect:null,map:g.map,cache:g.cache,before:g.before,hasHeights:!1}}function Dn(e,t,o,a,g){t.before&&(o=-1);var j=o+(a||""),q;return t.cache.hasOwnProperty(j)?q=t.cache[j]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Vt(e,t.view,t.rect),t.hasHeights=!0),q=Qt(e,t,o,a),q.bogus||(t.cache[j]=q)),{left:q.left,right:q.right,top:g?q.rtop:q.top,bottom:g?q.rbottom:q.bottom}}var yn={left:0,right:0,top:0,bottom:0};function Rn(e,t,o){for(var a,g,j,q,ie,oe,ue=0;ue<e.length;ue+=3)if(ie=e[ue],oe=e[ue+1],t<ie?(g=0,j=1,q="left"):t<oe?(g=t-ie,j=g+1):(ue==e.length-3||t==oe&&e[ue+3]>t)&&(j=oe-ie,g=j-1,t>=oe&&(q="right")),g!=null){if(a=e[ue+2],ie==oe&&o==(a.insertLeft?"left":"right")&&(q=o),o=="left"&&g==0)for(;ue&&e[ue-2]==e[ue-3]&&e[ue-1].insertLeft;)a=e[(ue-=3)+2],q="left";if(o=="right"&&g==oe-ie)for(;ue<e.length-3&&e[ue+3]==e[ue+4]&&!e[ue+5].insertLeft;)a=e[(ue+=3)+2],q="right";break}return{node:a,start:g,end:j,collapse:q,coverStart:ie,coverEnd:oe}}function zt(e,t){var o=yn;if(t=="left")for(var a=0;a<e.length&&!((o=e[a]).left!=o.right);a++);else for(var g=e.length-1;g>=0&&!((o=e[g]).left!=o.right);g--);return o}function Qt(e,t,o,a){var g=Rn(t.map,o,a),j=g.node,q=g.start,ie=g.end,oe=g.collapse,ue;if(j.nodeType==3){for(var Ae=0;Ae<4;Ae++){for(;q&&Ie(t.line.text.charAt(g.coverStart+q));)--q;for(;g.coverStart+ie<g.coverEnd&&Ie(t.line.text.charAt(g.coverStart+ie));)++ie;if(B&&M<9&&q==0&&ie==g.coverEnd-g.coverStart?ue=j.parentNode.getBoundingClientRect():ue=zt(y(j,q,ie).getClientRects(),a),ue.left||ue.right||q==0)break;ie=q,q=q-1,oe="right"}B&&M<11&&(ue=on(e.display.measure,ue))}else{q>0&&(oe=a="right");var Ne;e.options.lineWrapping&&(Ne=j.getClientRects()).length>1?ue=Ne[a=="right"?Ne.length-1:0]:ue=j.getBoundingClientRect()}if(B&&M<9&&!q&&(!ue||!ue.left&&!ue.right)){var Ze=j.parentNode.getClientRects()[0];Ze?ue={left:Ze.left,right:Ze.left+Yn(e.display),top:Ze.top,bottom:Ze.bottom}:ue=yn}for(var Ve=ue.top-t.rect.top,Et=ue.bottom-t.rect.top,Ut=(Ve+Et)/2,Ht=t.view.measure.heights,Jt=0;Jt<Ht.length-1&&!(Ut<Ht[Jt]);Jt++);var rn=Jt?Ht[Jt-1]:0,Zt=Ht[Jt],dn={left:(oe=="right"?ue.right:ue.left)-t.rect.left,right:(oe=="left"?ue.left:ue.right)-t.rect.left,top:rn,bottom:Zt};return!ue.left&&!ue.right&&(dn.bogus=!0),e.options.singleCursorHeightPerLine||(dn.rtop=Ve,dn.rbottom=Et),dn}function on(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Se(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,a=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*a,bottom:t.bottom*a}}function ln(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Wt(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ln(e.display.view[t])}function qt(e){Wt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function gn(){return p&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ci(){return p&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Li(e){var t=0;if(e.widgets)for(var o=0;o<e.widgets.length;++o)e.widgets[o].above&&(t+=bi(e.widgets[o]));return t}function qi(e,t,o,a,g){if(!g){var j=Li(t);o.top+=j,o.bottom+=j}if(a=="line")return o;a||(a="local");var q=vr(t);if(a=="local"?q+=mi(e.display):q-=e.display.viewOffset,a=="page"||a=="window"){var ie=e.display.lineSpace.getBoundingClientRect();q+=ie.top+(a=="window"?0:ci());var oe=ie.left+(a=="window"?0:gn());o.left+=oe,o.right+=oe}return o.top+=q,o.bottom+=q,o}function Hi(e,t,o){if(o=="div")return t;var a=t.left,g=t.top;if(o=="page")a-=gn(),g-=ci();else if(o=="local"||!o){var j=e.display.sizer.getBoundingClientRect();a+=j.left,g+=j.top}var q=e.display.lineSpace.getBoundingClientRect();return{left:a-q.left,top:g-q.top}}function Or(e,t,o,a,g){return a||(a=G(e.doc,t.line)),qi(e,a,vi(e,a,t.ch,g),o)}function li(e,t,o,a,g,j){a=a||G(e.doc,t.line),g||(g=ti(e,a));function q(Et,Ut){var Ht=Dn(e,g,Et,Ut?"right":"left",j);return Ut?Ht.left=Ht.right:Ht.right=Ht.left,qi(e,a,Ht,o)}var ie=jt(a,e.doc.direction),oe=t.ch,ue=t.sticky;if(oe>=a.text.length?(oe=a.text.length,ue="before"):oe<=0&&(oe=0,ue="after"),!ie)return q(ue=="before"?oe-1:oe,ue=="before");function Ae(Et,Ut,Ht){var Jt=ie[Ut],rn=Jt.level==1;return q(Ht?Et-1:Et,rn!=Ht)}var Ne=bt(ie,oe,ue),Ze=lt,Ve=Ae(oe,Ne,ue=="before");return Ze!=null&&(Ve.other=Ae(oe,Ze,ue!="before")),Ve}function Rr(e,t){var o=0;t=C(e.doc,t),e.options.lineWrapping||(o=Yn(e.display)*t.ch);var a=G(e.doc,t.line),g=vr(a)+mi(e.display);return{left:o,right:o,top:g,bottom:g+a.height}}function Nr(e,t,o,a,g){var j=Xe(e,t,o);return j.xRel=g,a&&(j.outside=a),j}function Kr(e,t,o){var a=e.doc;if(o+=e.display.viewOffset,o<0)return Nr(a.first,0,null,-1,-1);var g=Ge(a,o),j=a.first+a.size-1;if(g>j)return Nr(a.first+a.size-1,G(a,j).text.length,null,1,1);t<0&&(t=0);for(var q=G(a,g);;){var ie=ta(e,q,g,t,o),oe=Cr(q,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!oe)return ie;var ue=oe.find(1);if(ue.line==g)return ue;q=G(a,g=ue.line)}}function Ur(e,t,o,a){a-=Li(t);var g=t.text.length,j=$e(function(q){return Dn(e,o,q-1).bottom<=a},g,0);return g=$e(function(q){return Dn(e,o,q).top>a},j,g),{begin:j,end:g}}function da(e,t,o,a){o||(o=ti(e,t));var g=qi(e,t,Dn(e,o,a),"line").top;return Ur(e,t,o,g)}function yr(e,t,o,a){return e.bottom<=o?!1:e.top>o?!0:(a?e.left:e.right)>t}function ta(e,t,o,a,g){g-=vr(t);var j=ti(e,t),q=Li(t),ie=0,oe=t.text.length,ue=!0,Ae=jt(t,e.doc.direction);if(Ae){var Ne=(e.options.lineWrapping?fi:Da)(e,t,o,j,Ae,a,g);ue=Ne.level!=1,ie=ue?Ne.from:Ne.to-1,oe=ue?Ne.to:Ne.from-1}var Ze=null,Ve=null,Et=$e(function(An){var En=Dn(e,j,An);return En.top+=q,En.bottom+=q,yr(En,a,g,!1)?(En.top<=g&&En.left<=a&&(Ze=An,Ve=En),!0):!1},ie,oe),Ut,Ht,Jt=!1;if(Ve){var rn=a-Ve.left<Ve.right-a,Zt=rn==ue;Et=Ze+(Zt?0:1),Ht=Zt?"after":"before",Ut=rn?Ve.left:Ve.right}else{!ue&&(Et==oe||Et==ie)&&Et++,Ht=Et==0?"after":Et==t.text.length?"before":Dn(e,j,Et-(ue?1:0)).bottom+q<=g==ue?"after":"before";var dn=li(e,Xe(o,Et,Ht),"line",t,j);Ut=dn.left,Jt=g<dn.top?-1:g>=dn.bottom?1:0}return Et=je(t.text,Et,1),Nr(o,Et,Ht,Jt,a-Ut)}function Da(e,t,o,a,g,j,q){var ie=$e(function(Ne){var Ze=g[Ne],Ve=Ze.level!=1;return yr(li(e,Xe(o,Ve?Ze.to:Ze.from,Ve?"before":"after"),"line",t,a),j,q,!0)},0,g.length-1),oe=g[ie];if(ie>0){var ue=oe.level!=1,Ae=li(e,Xe(o,ue?oe.from:oe.to,ue?"after":"before"),"line",t,a);yr(Ae,j,q,!0)&&Ae.top>q&&(oe=g[ie-1])}return oe}function fi(e,t,o,a,g,j,q){var ie=Ur(e,t,a,q),oe=ie.begin,ue=ie.end;/\s/.test(t.text.charAt(ue-1))&&ue--;for(var Ae=null,Ne=null,Ze=0;Ze<g.length;Ze++){var Ve=g[Ze];if(Ve.from>=ue||Ve.to<=oe)continue;var Et=Ve.level!=1,Ut=Dn(e,a,Et?Math.min(ue,Ve.to)-1:Math.max(oe,Ve.from)).right,Ht=Ut<j?j-Ut+1e9:Ut-j;(!Ae||Ne>Ht)&&(Ae=Ve,Ne=Ht)}return Ae||(Ae=g[g.length-1]),Ae.from<oe&&(Ae={from:oe,to:Ae.to,level:Ae.level}),Ae.to>ue&&(Ae={from:Ae.from,to:ue,level:Ae.level}),Ae}var xn;function zn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xn==null){xn=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xn.appendChild(document.createTextNode("x")),xn.appendChild(c("br"));xn.appendChild(document.createTextNode("x"))}f(e.measure,xn);var o=xn.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),_(e.measure),o||1}function Yn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),o=c("pre",[t],"CodeMirror-line-like");f(e.measure,o);var a=t.getBoundingClientRect(),g=(a.right-a.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function Ui(e){for(var t=e.display,o={},a={},g=t.gutters.clientLeft,j=t.gutters.firstChild,q=0;j;j=j.nextSibling,++q){var ie=e.display.gutterSpecs[q].className;o[ie]=j.offsetLeft+j.clientLeft+g,a[ie]=j.clientWidth}return{fixedPos:Vn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:a,wrapperWidth:t.wrapper.clientWidth}}function Vn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ar(e){var t=zn(e.display),o=e.options.lineWrapping,a=o&&Math.max(5,e.display.scroller.clientWidth/Yn(e.display)-3);return function(g){if(wr(e.doc,g))return 0;var j=0;if(g.widgets)for(var q=0;q<g.widgets.length;q++)g.widgets[q].height&&(j+=g.widgets[q].height);return o?j+(Math.ceil(g.text.length/a)||1)*t:j+t}}function Br(e){var t=e.doc,o=Ar(e);t.iter(function(a){var g=o(a);g!=a.height&&he(a,g)})}function $i(e,t,o,a){var g=e.display;if(!o&&Ce(t).getAttribute("cm-not-content")=="true")return null;var j,q,ie=g.lineSpace.getBoundingClientRect();try{j=t.clientX-ie.left,q=t.clientY-ie.top}catch(Ne){return null}var oe=Kr(e,j,q),ue;if(a&&oe.xRel>0&&(ue=G(e.doc,oe.line).text).length==oe.ch){var Ae=z(ue,ue.length,e.options.tabSize)-ue.length;oe=Xe(oe.line,Math.max(0,Math.round((j-ai(e.display).left)/Yn(e.display))-Ae))}return oe}function Lr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,a=0;a<o.length;a++)if(t-=o[a].size,t<0)return a}function Pi(e,t,o,a){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),a||(a=0);var g=e.display;if(a&&o<g.viewTo&&(g.updateLineNumbers==null||g.updateLineNumbers>t)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)_i&&Hr(e.doc,t)<g.viewTo&&Pn(e);else if(o<=g.viewFrom)_i&&kr(e.doc,o+a)>g.viewFrom?Pn(e):(g.viewFrom+=a,g.viewTo+=a);else if(t<=g.viewFrom&&o>=g.viewTo)Pn(e);else if(t<=g.viewFrom){var j=wn(e,o,o+a,1);j?(g.view=g.view.slice(j.index),g.viewFrom=j.lineN,g.viewTo+=a):Pn(e)}else if(o>=g.viewTo){var q=wn(e,t,t,-1);q?(g.view=g.view.slice(0,q.index),g.viewTo=q.lineN):Pn(e)}else{var ie=wn(e,t,t,-1),oe=wn(e,o,o+a,1);ie&&oe?(g.view=g.view.slice(0,ie.index).concat(Ye(e,ie.lineN,oe.lineN)).concat(g.view.slice(oe.index)),g.viewTo+=a):Pn(e)}var ue=g.externalMeasured;ue&&(o<ue.lineN?ue.lineN+=a:t<ue.lineN+ue.size&&(g.externalMeasured=null))}function or(e,t,o){e.curOp.viewChanged=!0;var a=e.display,g=e.display.externalMeasured;if(g&&t>=g.lineN&&t<g.lineN+g.size&&(a.externalMeasured=null),t<a.viewFrom||t>=a.viewTo)return;var j=a.view[Lr(e,t)];if(j.node==null)return;var q=j.changes||(j.changes=[]);ae(q,o)==-1&&q.push(o)}function Pn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function wn(e,t,o,a){var g=Lr(e,t),j,q=e.display.view;if(!_i||o==e.doc.first+e.doc.size)return{index:g,lineN:o};for(var ie=e.display.viewFrom,oe=0;oe<g;oe++)ie+=q[oe].size;if(ie!=t){if(a>0){if(g==q.length-1)return null;j=ie+q[g].size-t,g++}else j=ie-t;t+=j,o+=j}for(;Hr(e.doc,o)!=o;){if(g==(a<0?0:q.length-1))return null;o+=a*q[g-(a<0?1:0)].size,g+=a}return{index:g,lineN:o}}function $n(e,t,o){var a=e.display,g=a.view;g.length==0||t>=a.viewTo||o<=a.viewFrom?(a.view=Ye(e,t,o),a.viewFrom=t):(a.viewFrom>t?a.view=Ye(e,t,a.viewFrom).concat(a.view):a.viewFrom<t&&(a.view=a.view.slice(Lr(e,t))),a.viewFrom=t,a.viewTo<o?a.view=a.view.concat(Ye(e,a.viewTo,o)):a.viewTo>o&&(a.view=a.view.slice(0,Lr(e,o)))),a.viewTo=o}function en(e){for(var t=e.display.view,o=0,a=0;a<t.length;a++){var g=t[a];!g.hidden&&(!g.node||g.changes)&&++o}return o}function In(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ei(e,t){t===void 0&&(t=!0);for(var o=e.doc,a={},g=a.cursors=document.createDocumentFragment(),j=a.selection=document.createDocumentFragment(),q=0;q<o.sel.ranges.length;q++){if(!t&&q==o.sel.primIndex)continue;var ie=o.sel.ranges[q];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var oe=ie.empty();(oe||e.options.showCursorWhenSelecting)&&Ki(e,ie.head,g),oe||va(e,ie,j)}return a}function Ki(e,t,o){var a=li(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),g=o.appendChild(c("div","\xA0","CodeMirror-cursor"));if(g.style.left=a.left+"px",g.style.top=a.top+"px",g.style.height=Math.max(0,a.bottom-a.top)*e.options.cursorHeight+"px",a.other){var j=o.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));j.style.display="",j.style.left=a.other.left+"px",j.style.top=a.other.top+"px",j.style.height=(a.other.bottom-a.other.top)*.85+"px"}}function Mi(e,t){return e.top-t.top||e.left-t.left}function va(e,t,o){var a=e.display,g=e.doc,j=document.createDocumentFragment(),q=ai(e.display),ie=q.left,oe=Math.max(a.sizerWidth,ei(e)-a.sizer.offsetLeft)-q.right,ue=g.direction=="ltr";function Ae(Zt,dn,An,En){dn<0&&(dn=0),dn=Math.round(dn),En=Math.round(En),j.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+Zt+`px;
top: `+dn+"px; width: "+(An==null?oe-Zt:An)+`px;
height: `+(En-dn)+"px"))}function Ne(Zt,dn,An){var En=G(g,Zt),Qn=En.text.length,Ci,nr;function ki(Gi,xr){return Or(e,Xe(Zt,Gi),"div",En,xr)}function Mr(Gi,xr,sr){var Ji=da(e,En,null,Gi),zi=xr=="ltr"==(sr=="after")?"left":"right",Fi=sr=="after"?Ji.begin:Ji.end-(/\s/.test(En.text.charAt(Ji.end-1))?2:1);return ki(Fi,zi)[zi]}var Er=jt(En,g.direction);return at(Er,dn||0,An==null?Qn:An,function(Gi,xr,sr,Ji){var zi=sr=="ltr",Fi=ki(Gi,zi?"left":"right"),Sr=ki(xr-1,zi?"right":"left"),La=dn==null&&Gi==0,ua=An==null&&xr==Qn,dr=Ji==0,Qr=!Er||Ji==Er.length-1;if(Sr.top-Fi.top<=3){var ir=(ue?La:ua)&&dr,jo=(ue?ua:La)&&Qr,ea=ir?ie:(zi?Fi:Sr).left,ma=jo?oe:(zi?Sr:Fi).right;Ae(ea,Fi.top,ma-ea,Fi.bottom)}else{var ga,mr,Ia,Bo;zi?(ga=ue&&La&&dr?ie:Fi.left,mr=ue?oe:Mr(Gi,sr,"before"),Ia=ue?ie:Mr(xr,sr,"after"),Bo=ue&&ua&&Qr?oe:Sr.right):(ga=ue?Mr(Gi,sr,"before"):ie,mr=!ue&&La&&dr?oe:Fi.right,Ia=!ue&&ua&&Qr?ie:Sr.left,Bo=ue?Mr(xr,sr,"after"):oe),Ae(ga,Fi.top,mr-ga,Fi.bottom),Fi.bottom<Sr.top&&Ae(ie,Fi.bottom,null,Sr.top),Ae(Ia,Sr.top,Bo-Ia,Sr.bottom)}(!Ci||Mi(Fi,Ci)<0)&&(Ci=Fi),Mi(Sr,Ci)<0&&(Ci=Sr),(!nr||Mi(Fi,nr)<0)&&(nr=Fi),Mi(Sr,nr)<0&&(nr=Sr)}),{start:Ci,end:nr}}var Ze=t.from(),Ve=t.to();if(Ze.line==Ve.line)Ne(Ze.line,Ze.ch,Ve.ch);else{var Et=G(g,Ze.line),Ut=G(g,Ve.line),Ht=Xi(Et)==Xi(Ut),Jt=Ne(Ze.line,Ze.ch,Ht?Et.text.length+1:null).end,rn=Ne(Ve.line,Ht?0:null,Ve.ch).start;Ht&&(Jt.top<rn.top-2?(Ae(Jt.right,Jt.top,null,Jt.bottom),Ae(ie,rn.top,rn.left,rn.bottom)):Ae(Jt.right,Jt.top,rn.left-Jt.right,Jt.bottom)),Jt.bottom<rn.top&&Ae(ie,Jt.bottom,null,rn.top)}o.appendChild(j)}function bn(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function na(e){e.state.focused||(e.display.input.focus(),Wr(e))}function _a(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ir(e))},100)}function Wr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Fe(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bn(e)}function Ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Fe(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Dr(e){for(var t=e.display,o=t.lineDiv.offsetTop,a=0;a<t.view.length;a++){var g=t.view[a],j=e.options.lineWrapping,q=void 0,ie=0;if(g.hidden)continue;if(B&&M<8){var oe=g.node.offsetTop+g.node.offsetHeight;q=oe-o,o=oe}else{var ue=g.node.getBoundingClientRect();q=ue.bottom-ue.top,!j&&g.text.firstChild&&(ie=g.text.firstChild.getBoundingClientRect().right-ue.left-1)}var Ae=g.line.height-q;if((Ae>.005||Ae<-.005)&&(he(g.line,q),Zr(g.line),g.rest))for(var Ne=0;Ne<g.rest.length;Ne++)Zr(g.rest[Ne]);if(ie>e.display.sizerWidth){var Ze=Math.ceil(ie/Yn(e.display));Ze>e.display.maxLineLength&&(e.display.maxLineLength=Ze,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Zr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],a=o.node.parentNode;a&&(o.height=a.offsetHeight)}}function Gr(e,t,o){var a=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;a=Math.floor(a-mi(e));var g=o&&o.bottom!=null?o.bottom:a+e.wrapper.clientHeight,j=Ge(t,a),q=Ge(t,g);if(o&&o.ensure){var ie=o.ensure.from.line,oe=o.ensure.to.line;ie<j?(j=ie,q=Ge(t,vr(G(t,ie))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=q&&(j=Ge(t,vr(G(t,oe))-e.wrapper.clientHeight),q=oe)}return{from:j,to:Math.max(q,j+1)}}function ia(e,t){if(Je(e,"scrollCursorIntoView"))return;var o=e.display,a=o.sizer.getBoundingClientRect(),g=null;if(t.top+a.top<0?g=!0:t.bottom+a.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!s){var j=c("div","\u200B",null,`position: absolute;
top: `+(t.top-o.viewOffset-mi(e.display))+`px;
height: `+(t.bottom-t.top+kn(e)+o.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(g),e.display.lineSpace.removeChild(j)}}function go(e,t,o,a){a==null&&(a=0);var g;!e.options.lineWrapping&&t==o&&(t=t.ch?Xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?Xe(t.line,t.ch+1,"before"):t);for(var j=0;j<5;j++){var q=!1,ie=li(e,t),oe=!o||o==t?ie:li(e,o);g={left:Math.min(ie.left,oe.left),top:Math.min(ie.top,oe.top)-a,right:Math.max(ie.left,oe.left),bottom:Math.max(ie.bottom,oe.bottom)+a};var ue=vo(e,g),Ae=e.doc.scrollTop,Ne=e.doc.scrollLeft;if(ue.scrollTop!=null&&(Ma(e,ue.scrollTop),Math.abs(e.doc.scrollTop-Ae)>1&&(q=!0)),ue.scrollLeft!=null&&(ca(e,ue.scrollLeft),Math.abs(e.doc.scrollLeft-Ne)>1&&(q=!0)),!q)break}return g}function Qi(e,t){var o=vo(e,t);o.scrollTop!=null&&Ma(e,o.scrollTop),o.scrollLeft!=null&&ca(e,o.scrollLeft)}function vo(e,t){var o=e.display,a=zn(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,j=Gn(e),q={};t.bottom-t.top>j&&(t.bottom=t.top+j);var ie=e.doc.height+gi(o),oe=t.top<a,ue=t.bottom>ie-a;if(t.top<g)q.scrollTop=oe?0:t.top;else if(t.bottom>g+j){var Ae=Math.min(t.top,(ue?ie:t.bottom)-j);Ae!=g&&(q.scrollTop=Ae)}var Ne=e.options.fixedGutter?0:o.gutters.offsetWidth,Ze=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-Ne,Ve=ei(e)-o.gutters.offsetWidth,Et=t.right-t.left>Ve;return Et&&(t.right=t.left+Ve),t.left<10?q.scrollLeft=0:t.left<Ze?q.scrollLeft=Math.max(0,t.left+Ne-(Et?0:10)):t.right>Ve+Ze-3&&(q.scrollLeft=t.right+(Et?0:10)-Ve),q}function _o(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ya(e){qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pa(e,t,o){(t!=null||o!=null)&&qa(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function Js(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=Rr(e,t.from),a=Rr(e,t.to);Wo(e,o,a,t.margin)}}function Wo(e,t,o,a){var g=vo(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-a,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+a});Pa(e,g.scrollLeft,g.scrollTop)}function Ma(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||bo(e,{top:t}),Ho(e,t,!0),P&&bo(e),Ua(e,100)}function Ho(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ca(e,t,o,a){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!a)return;e.doc.scrollLeft=t,Xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ka(e){var t=e.display,o=t.gutters.offsetWidth,a=Math.round(e.doc.height+gi(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?o:0,docHeight:a,scrollHeight:a+kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var ha=function(e,t,o){this.cm=o;var a=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a.tabIndex=g.tabIndex=-1,e(a),e(g),Pe(a,"scroll",function(){a.clientHeight&&t(a.scrollTop,"vertical")}),Pe(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,B&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ha.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,a=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?a+"px":"0";var g=e.viewHeight-(t?a:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?a+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(o?a:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(a==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?a:0,bottom:t?a:0}},ha.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ha.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ha.prototype.zeroWidthHack=function(){var e=n&&!h?"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},ha.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function a(){var g=e.getBoundingClientRect(),j=o=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);j!=e?e.style.pointerEvents="none":t.set(1e3,a)}t.set(1e3,a)},ha.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Na=function(){};Na.prototype.update=function(){return{bottom:0,right:0}},Na.prototype.setScrollLeft=function(){},Na.prototype.setScrollTop=function(){},Na.prototype.clear=function(){};function ba(e,t){t||(t=ka(e));var o=e.display.barWidth,a=e.display.barHeight;Ko(e,t);for(var g=0;g<4&&o!=e.display.barWidth||a!=e.display.barHeight;g++)o!=e.display.barWidth&&e.options.lineWrapping&&Dr(e),Ko(e,ka(e)),o=e.display.barWidth,a=e.display.barHeight}function Ko(e,t){var o=e.display,a=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=a.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=a.bottom)+"px",o.heightForcer.style.borderBottom=a.bottom+"px solid transparent",a.right&&a.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=a.bottom+"px",o.scrollbarFiller.style.width=a.right+"px"):o.scrollbarFiller.style.display="",a.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=a.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var Go={native:ha,null:Na};function zo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Go[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?ca(e,t):Ma(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function fa(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:++Zs},Kt(e.curOp)}function pa(e){var t=e.curOp;t&&tn(t,function(o){for(var a=0;a<o.ops.length;a++)o.ops[a].cm.curOp=null;qs(o)})}function qs(e){for(var t=e.ops,o=0;o<t.length;o++)el(t[o]);for(var a=0;a<t.length;a++)tl(t[a]);for(var g=0;g<t.length;g++)nl(t[g]);for(var j=0;j<t.length;j++)il(t[j]);for(var q=0;q<t.length;q++)rl(t[q])}function el(e){var t=e.cm,o=t.display;ol(t),e.updateMaxLine&&$r(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new eo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&yo(e.cm,e.update)}function nl(e){var t=e.cm,o=t.display;e.updatedDisplay&&Dr(t),e.barMeasure=ka(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=vi(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-ei(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ca(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ba(t,e.barMeasure),e.updatedDisplay&&xo(t,e.barMeasure),e.selectionChanged&&bn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&na(e.cm)}function rl(e){var t=e.cm,o=t.display,a=t.doc;if(e.updatedDisplay&&Vo(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&Ho(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ca(t,e.scrollLeft,!0,!0),e.scrollToPos){var g=go(t,C(a,e.scrollToPos.from),C(a,e.scrollToPos.to),e.scrollToPos.margin);ia(t,g)}var j=e.maybeHiddenMarkers,q=e.maybeUnhiddenMarkers;if(j)for(var ie=0;ie<j.length;++ie)j[ie].lines.length||Fe(j[ie],"hide");if(q)for(var oe=0;oe<q.length;++oe)q[oe].lines.length&&Fe(q[oe],"unhide");o.wrapper.offsetHeight&&(a.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Fe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Pr(e,t){if(e.curOp)return t();fa(e);try{return t()}finally{pa(e)}}function er(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fa(e);try{return t.apply(e,arguments)}finally{pa(e)}}}function pr(e){return function(){if(this.curOp)return e.apply(this,arguments);fa(this);try{return e.apply(this,arguments)}finally{pa(this)}}}function tr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fa(t);try{return e.apply(this,arguments)}finally{pa(t)}}}function Ua(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,H(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var o=+new Date+e.options.workTime,a=St(e,t.highlightFrontier),g=[];t.iter(a.line,Math.min(t.first+t.size,e.display.viewTo+500),function(j){if(a.line>=e.display.viewFrom){var q=j.styles,ie=j.text.length>e.options.maxHighlightLength?$t(t.mode,a.state):null,oe=Re(e,j,a,!0);ie&&(a.state=ie),j.styles=oe.styles;var ue=j.styleClasses,Ae=oe.classes;Ae?j.styleClasses=Ae:ue&&(j.styleClasses=null);for(var Ne=!q||q.length!=j.styles.length||ue!=Ae&&(!ue||!Ae||ue.bgClass!=Ae.bgClass||ue.textClass!=Ae.textClass),Ze=0;!Ne&&Ze<q.length;++Ze)Ne=q[Ze]!=j.styles[Ze];Ne&&g.push(a.line),j.stateAfter=a.save(),a.nextLine()}else j.text.length<=e.options.maxHighlightLength&&Yt(e,j.text,a),j.stateAfter=a.line%5==0?a.save():null,a.nextLine();if(+new Date>o)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=a.line,t.modeFrontier=Math.max(t.modeFrontier,a.line),g.length&&Pr(e,function(){for(var j=0;j<g.length;j++)or(e,g[j],"text")})}var eo=function(e,t,o){var a=e.display;this.viewport=t,this.visible=Gr(a,e.doc,t),this.editorIsHidden=!a.wrapper.offsetWidth,this.wrapperHeight=a.wrapper.clientHeight,this.wrapperWidth=a.wrapper.clientWidth,this.oldDisplayWidth=ei(e),this.force=o,this.dims=Ui(e),this.events=[]};eo.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},eo.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Fe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=kn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=kn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=N();if(!t||!b(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var a=window.getSelection();a.anchorNode&&a.extend&&b(e.display.lineDiv,a.anchorNode)&&(o.anchorNode=a.anchorNode,o.anchorOffset=a.anchorOffset,o.focusNode=a.focusNode,o.focusOffset=a.focusOffset)}return o}function ll(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),o=document.createRange();o.setEnd(e.anchorNode,e.anchorOffset),o.collapse(!1),t.removeAllRanges(),t.addRange(o),t.extend(e.focusNode,e.focusOffset)}}function yo(e,t){var o=e.display,a=e.doc;if(t.editorIsHidden)return Pn(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&en(e)==0)return!1;Yo(e)&&(Pn(e),t.dims=Ui(e));var g=a.first+a.size,j=Math.max(t.visible.from-e.options.viewportMargin,a.first),q=Math.min(g,t.visible.to+e.options.viewportMargin);o.viewFrom<j&&j-o.viewFrom<20&&(j=Math.max(a.first,o.viewFrom)),o.viewTo>q&&o.viewTo-q<20&&(q=Math.min(g,o.viewTo)),_i&&(j=Hr(e.doc,j),q=kr(e.doc,q));var ie=j!=o.viewFrom||q!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;$n(e,j,q),o.viewOffset=vr(G(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var oe=en(e);if(!ie&&oe==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var ue=sl(e);return oe>4&&(o.lineDiv.style.display="none"),ul(e,o.updateLineNumbers,t.dims),oe>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,ll(ue),_(o.cursorDiv),_(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,ie&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Ua(e,400)),o.updateLineNumbers=null,!0}function Vo(e,t){for(var o=t.viewport,a=!0;;a=!1){if(!a||!e.options.lineWrapping||t.oldDisplayWidth==ei(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+gi(e.display)-Gn(e),o.top)}),t.visible=Gr(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else a&&(t.visible=Gr(e.display,e.doc,o));if(!yo(e,t))break;Dr(e);var g=ka(e);In(e),ba(e,g),xo(e,g),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 bo(e,t){var o=new eo(e,t);if(yo(e,o)){Dr(e),Vo(e,o);var a=ka(e);In(e),ba(e,a),xo(e,a),o.finish()}}function ul(e,t,o){var a=e.display,g=e.options.lineNumbers,j=a.lineDiv,q=j.firstChild;function ie(Et){var Ut=Et.nextSibling;return L&&n&&e.display.currentWheelTarget==Et?Et.style.display="none":Et.parentNode.removeChild(Et),Ut}for(var oe=a.view,ue=a.viewFrom,Ae=0;Ae<oe.length;Ae++){var Ne=oe[Ae];if(!Ne.hidden)if(!Ne.node||Ne.node.parentNode!=j){var Ze=ni(e,Ne,ue,o);j.insertBefore(Ze,q)}else{for(;q!=Ne.node;)q=ie(q);var Ve=g&&t!=null&&t<=ue&&Ne.lineNumber;Ne.changes&&(ae(Ne.changes,"gutter")>-1&&(Ve=!1),cn(e,Ne,ue,o)),Ve&&(_(Ne.lineNumber),Ne.lineNumber.appendChild(document.createTextNode(Nt(e.options,ue)))),q=Ne.node.nextSibling}ue+=Ne.size}for(;q;)q=ie(q)}function Eo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function xo(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+kn(e)+"px"}function Xo(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var a=Vn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,j=a+"px",q=0;q<o.length;q++)if(!o[q].hidden){e.options.fixedGutter&&(o[q].gutter&&(o[q].gutter.style.left=j),o[q].gutterBackground&&(o[q].gutterBackground.style.left=j));var ie=o[q].alignable;if(ie)for(var oe=0;oe<ie.length;oe++)ie[oe].style.left=j}e.options.fixedGutter&&(t.gutters.style.left=a+g+"px")}function Yo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=Nt(e.options,t.first+t.size-1),a=e.display;if(o.length!=a.lineNumChars){var g=a.measure.appendChild(c("div",[c("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),j=g.firstChild.offsetWidth,q=g.offsetWidth-j;return a.lineGutter.style.width="",a.lineNumInnerWidth=Math.max(j,a.lineGutter.offsetWidth-q)+1,a.lineNumWidth=a.lineNumInnerWidth+q,a.lineNumChars=a.lineNumInnerWidth?o.length:-1,a.lineGutter.style.width=a.lineNumWidth+"px",Eo(e.display),!0}return!1}function So(e,t){for(var o=[],a=!1,g=0;g<e.length;g++){var j=e[g],q=null;if(typeof j!="string"&&(q=j.style,j=j.className),j=="CodeMirror-linenumbers")if(t)a=!0;else continue;o.push({className:j,style:q})}return t&&!a&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function $o(e){var t=e.gutters,o=e.gutterSpecs;_(t),e.lineGutter=null;for(var a=0;a<o.length;++a){var g=o[a],j=g.className,q=g.style,ie=t.appendChild(c("div",null,"CodeMirror-gutter "+j));q&&(ie.style.cssText=q),j=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",Eo(e)}function Fa(e){$o(e.display),Pi(e),Xo(e)}function dl(e,t,o,a){var g=this;this.input=o,g.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),g.scrollbarFiller.setAttribute("cm-not-content","true"),g.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),g.gutterFiller.setAttribute("cm-not-content","true"),g.lineDiv=S("div",null,"CodeMirror-code"),g.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),g.cursorDiv=c("div",null,"CodeMirror-cursors"),g.measure=c("div",null,"CodeMirror-measure"),g.lineMeasure=c("div",null,"CodeMirror-measure"),g.lineSpace=S("div",[g.measure,g.lineMeasure,g.selectionDiv,g.cursorDiv,g.lineDiv],null,"position: relative; outline: none");var j=S("div",[g.lineSpace],"CodeMirror-lines");g.mover=c("div",[j],null,"position: relative"),g.sizer=c("div",[g.mover],"CodeMirror-sizer"),g.sizerWidth=null,g.heightForcer=c("div",null,null,"position: absolute; height: "+me+"px; width: 1px;"),g.gutters=c("div",null,"CodeMirror-gutters"),g.lineGutter=null,g.scroller=c("div",[g.sizer,g.heightForcer,g.gutters],"CodeMirror-scroll"),g.scroller.setAttribute("tabIndex","-1"),g.wrapper=c("div",[g.scrollbarFiller,g.gutterFiller,g.scroller],"CodeMirror"),B&&M<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!L&&!(P&&r)&&(g.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(g.wrapper):e(g.wrapper)),g.viewFrom=g.viewTo=t.first,g.reportedViewFrom=g.reportedViewTo=t.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=So(a.gutters,a.lineNumbers),$o(g),o.init(g)}var to=0,Fr=null;B?Fr=-.53:P?Fr=15:p?Fr=-.7:u&&(Fr=-1/3);function Qo(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function cl(e){var t=Qo(e);return t.x*=Fr,t.y*=Fr,t}function Jo(e,t){var o=Qo(t),a=o.x,g=o.y,j=e.display,q=j.scroller,ie=q.scrollWidth>q.clientWidth,oe=q.scrollHeight>q.clientHeight;if(!(a&&ie||g&&oe))return;if(g&&n&&L){e:for(var ue=t.target,Ae=j.view;ue!=q;ue=ue.parentNode)for(var Ne=0;Ne<Ae.length;Ne++)if(Ae[Ne].node==ue){e.display.currentWheelTarget=ue;break e}}if(a&&!P&&!m&&Fr!=null){g&&oe&&Ma(e,Math.max(0,q.scrollTop+g*Fr)),ca(e,Math.max(0,q.scrollLeft+a*Fr)),(!g||g&&oe)&&le(t),j.wheelStartX=null;return}if(g&&Fr!=null){var Ze=g*Fr,Ve=e.doc.scrollTop,Et=Ve+j.wrapper.clientHeight;Ze<0?Ve=Math.max(0,Ve+Ze-50):Et=Math.min(e.doc.height,Et+Ze+50),bo(e,{top:Ve,bottom:Et})}to<20&&(j.wheelStartX==null?(j.wheelStartX=q.scrollLeft,j.wheelStartY=q.scrollTop,j.wheelDX=a,j.wheelDY=g,setTimeout(function(){if(j.wheelStartX==null)return;var Ut=q.scrollLeft-j.wheelStartX,Ht=q.scrollTop-j.wheelStartY,Jt=Ht&&j.wheelDY&&Ht/j.wheelDY||Ut&&j.wheelDX&&Ut/j.wheelDX;if(j.wheelStartX=j.wheelStartY=null,!Jt)return;Fr=(Fr*to+Jt)/(to+1),++to},200)):(j.wheelDX+=a,j.wheelDY+=g))}var jr=function(e,t){this.ranges=e,this.primIndex=t};jr.prototype.primary=function(){return this.ranges[this.primIndex]},jr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var o=this.ranges[t],a=e.ranges[t];if(!an(o.anchor,a.anchor)||!an(o.head,a.head))return!1}return!0},jr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new pi(Ct(this.ranges[t].anchor),Ct(this.ranges[t].head));return new jr(e,this.primIndex)},jr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},jr.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var a=this.ranges[o];if(It(t,a.from())>=0&&It(e,a.to())<=0)return o}return-1};var pi=function(e,t){this.anchor=e,this.head=t};pi.prototype.from=function(){return nn(this.anchor,this.head)},pi.prototype.to=function(){return pn(this.anchor,this.head)},pi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zr(e,t,o){var a=e&&e.options.selectionsMayTouch,g=t[o];t.sort(function(Ze,Ve){return It(Ze.from(),Ve.from())}),o=ae(t,g);for(var j=1;j<t.length;j++){var q=t[j],ie=t[j-1],oe=It(ie.to(),q.from());if(a&&!q.empty()?oe>0:oe>=0){var ue=nn(ie.from(),q.from()),Ae=pn(ie.to(),q.to()),Ne=ie.empty()?q.from()==q.head:ie.from()==ie.head;j<=o&&--o,t.splice(--j,2,new pi(Ne?Ae:ue,Ne?ue:Ae))}}return new jr(t,o)}function ra(e,t){return new jr([new pi(e,t||e)],0)}function aa(e){return e.text?Xe(e.from.line+e.text.length-1,He(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zo(e,t){if(It(e,t.from)<0)return e;if(It(e,t.to)<=0)return aa(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,a=e.ch;return e.line==t.to.line&&(a+=aa(t).ch-t.to.ch),Xe(o,a)}function To(e,t){for(var o=[],a=0;a<e.sel.ranges.length;a++){var g=e.sel.ranges[a];o.push(new pi(Zo(g.anchor,t),Zo(g.head,t)))}return zr(e.cm,o,e.sel.primIndex)}function qo(e,t,o){return e.line==t.line?Xe(o.line,e.ch-t.ch+o.ch):Xe(o.line+(e.line-t.line),e.ch)}function hl(e,t,o){for(var a=[],g=Xe(e.first,0),j=g,q=0;q<t.length;q++){var ie=t[q],oe=qo(ie.from,g,j),ue=qo(aa(ie),g,j);if(g=ie.to,j=ue,o=="around"){var Ae=e.sel.ranges[q],Ne=It(Ae.head,Ae.anchor)<0;a[q]=new pi(Ne?ue:oe,Ne?oe:ue)}else a[q]=new pi(oe,oe)}return new jr(a,e.sel.primIndex)}function Co(e){e.doc.mode=qe(e.options,e.doc.modeOption),ja(e)}function ja(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ua(e,100),e.state.modeGen++,e.curOp&&Pi(e)}function es(e,t){return t.from.ch==0&&t.to.ch==0&&He(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function wo(e,t,o,a){function g(rn){return o?o[rn]:null}function j(rn,Zt,dn){Jr(rn,Zt,dn,a),nt(rn,"change",rn,t)}function q(rn,Zt){for(var dn=[],An=rn;An<Zt;++An)dn.push(new fr(ue[An],g(An),a));return dn}var ie=t.from,oe=t.to,ue=t.text,Ae=G(e,ie.line),Ne=G(e,oe.line),Ze=He(ue),Ve=g(ue.length-1),Et=oe.line-ie.line;if(t.full)e.insert(0,q(0,ue.length)),e.remove(ue.length,e.size-ue.length);else if(es(e,t)){var Ut=q(0,ue.length-1);j(Ne,Ne.text,Ve),Et&&e.remove(ie.line,Et),Ut.length&&e.insert(ie.line,Ut)}else if(Ae==Ne)if(ue.length==1)j(Ae,Ae.text.slice(0,ie.ch)+Ze+Ae.text.slice(oe.ch),Ve);else{var Ht=q(1,ue.length-1);Ht.push(new fr(Ze+Ae.text.slice(oe.ch),Ve,a)),j(Ae,Ae.text.slice(0,ie.ch)+ue[0],g(0)),e.insert(ie.line+1,Ht)}else if(ue.length==1)j(Ae,Ae.text.slice(0,ie.ch)+ue[0]+Ne.text.slice(oe.ch),g(0)),e.remove(ie.line+1,Et);else{j(Ae,Ae.text.slice(0,ie.ch)+ue[0],g(0)),j(Ne,Ze+Ne.text.slice(oe.ch),Ve);var Jt=q(1,ue.length-1);Et>1&&e.remove(ie.line+1,Et-1),e.insert(ie.line+1,Jt)}nt(e,"change",e,t)}function oa(e,t,o){function a(g,j,q){if(g.linked)for(var ie=0;ie<g.linked.length;++ie){var oe=g.linked[ie];if(oe.doc==j)continue;var ue=q&&oe.sharedHist;if(o&&!ue)continue;t(oe.doc,ue),a(oe.doc,g,ue)}}a(e,null,!0)}function ts(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Br(e),Co(e),ns(e),e.options.lineWrapping||$r(e),e.options.mode=t.modeOption,Pi(e)}function ns(e){(e.doc.direction=="rtl"?F:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Pr(e,function(){ns(e),Pi(e)})}function no(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Oo(e,t){var o={from:Ct(t.from),to:aa(t),text:Q(e,t.from,t.to)};return as(e,o,t.from.line,t.to.line+1),oa(e,function(a){return as(a,o,t.from.line,t.to.line+1)},!0),o}function is(e){for(;e.length;){var t=He(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return is(e.done),He(e.done);if(e.done.length&&!He(e.done).ranges)return He(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),He(e.done)}function rs(e,t,o,a){var g=e.history;g.undone.length=0;var j=+new Date,q,ie;if((g.lastOp==a||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(q=pl(g,g.lastOp==a)))ie=He(q.changes),It(t.from,t.to)==0&&It(t.from,ie.to)==0?ie.to=aa(t):q.changes.push(Oo(e,t));else{var oe=He(g.done);for((!oe||!oe.ranges)&&io(e.sel,g.done),q={changes:[Oo(e,t)],generation:g.generation},g.done.push(q);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(o),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=j,g.lastOp=g.lastSelOp=a,g.lastOrigin=g.lastSelOrigin=t.origin,ie||Fe(e,"historyAdded")}function ml(e,t,o,a){var g=t.charAt(0);return g=="*"||g=="+"&&o.ranges.length==a.ranges.length&&o.somethingSelected()==a.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,a){var g=e.history,j=a&&a.origin;o==g.lastSelOp||j&&g.lastSelOrigin==j&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==j||ml(e,j,He(g.done),t))?g.done[g.done.length-1]=t:io(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=j,g.lastSelOp=o,a&&a.clearRedo!==!1&&is(g.undone)}function io(e,t){var o=He(t);o&&o.ranges&&o.equals(e)||t.push(e)}function as(e,t,o,a){var g=t["spans_"+e.id],j=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,a),function(q){q.markedSpans&&((g||(g=t["spans_"+e.id]={}))[j]=q.markedSpans),++j})}function vl(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function _l(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var a=[],g=0;g<t.text.length;++g)a.push(vl(o[g]));return a}function os(e,t){var o=_l(e,t),a=ji(e,t);if(!o)return a;if(!a)return o;for(var g=0;g<o.length;++g){var j=o[g],q=a[g];if(j&&q){e:for(var ie=0;ie<q.length;++ie){for(var oe=q[ie],ue=0;ue<j.length;++ue)if(j[ue].marker==oe.marker)continue e;j.push(oe)}}else q&&(o[g]=q)}return o}function Ea(e,t,o){for(var a=[],g=0;g<e.length;++g){var j=e[g];if(j.ranges){a.push(o?jr.prototype.deepCopy.call(j):j);continue}var q=j.changes,ie=[];a.push({changes:ie});for(var oe=0;oe<q.length;++oe){var ue=q[oe],Ae=void 0;if(ie.push({from:ue.from,to:ue.to,text:ue.text}),t)for(var Ne in ue)(Ae=Ne.match(/^spans_(\d+)$/))&&(ae(t,Number(Ae[1]))>-1&&(He(ie)[Ne]=ue[Ne],delete ue[Ne]))}}return a}function Ro(e,t,o,a){if(a){var g=e.anchor;if(o){var j=It(t,g)<0;j!=It(o,g)<0?(g=t,t=o):j!=It(t,o)<0&&(t=o)}return new pi(g,t)}else return new pi(o||t,t)}function ro(e,t,o,a,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),ur(e,new jr([Ro(e.sel.primary(),t,o,g)],0),a)}function ss(e,t,o){for(var a=[],g=e.cm&&(e.cm.display.shift||e.extend),j=0;j<e.sel.ranges.length;j++)a[j]=Ro(e.sel.ranges[j],t[j],null,g);var q=zr(e.cm,a,e.sel.primIndex);ur(e,q,o)}function Ao(e,t,o,a){var g=e.sel.ranges.slice(0);g[t]=o,ur(e,zr(e.cm,g,e.sel.primIndex),a)}function ls(e,t,o,a){ur(e,ra(t,o),a)}function yl(e,t,o){var a={ranges:t.ranges,update:function(g){this.ranges=[];for(var j=0;j<g.length;j++)this.ranges[j]=new pi(C(e,g[j].anchor),C(e,g[j].head))},origin:o&&o.origin};return Fe(e,"beforeSelectionChange",e,a),e.cm&&Fe(e.cm,"beforeSelectionChange",e.cm,a),a.ranges!=t.ranges?zr(e.cm,a.ranges,a.ranges.length-1):t}function us(e,t,o){var a=e.history.done,g=He(a);g&&g.ranges?(a[a.length-1]=t,ao(e,t,o)):ur(e,t,o)}function ur(e,t,o){ao(e,t,o),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function ao(e,t,o){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,o));var a=o&&o.bias||(It(t.primary().head,e.sel.primary().head)<0?-1:1);ds(e,hs(e,t,a,!0)),!(o&&o.scroll===!1)&&e.cm&&ya(e.cm)}function ds(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ee(e.cm)),nt(e,"cursorActivity",e)}function cs(e){ds(e,hs(e,e.sel,null,!1))}function hs(e,t,o,a){for(var g,j=0;j<t.ranges.length;j++){var q=t.ranges[j],ie=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[j],oe=oo(e,q.anchor,ie&&ie.anchor,o,a),ue=oo(e,q.head,ie&&ie.head,o,a);(g||oe!=q.anchor||ue!=q.head)&&(g||(g=t.ranges.slice(0,j)),g[j]=new pi(oe,ue))}return g?zr(e.cm,g,t.primIndex):t}function xa(e,t,o,a,g){var j=G(e,t.line);if(j.markedSpans)for(var q=0;q<j.markedSpans.length;++q){var ie=j.markedSpans[q],oe=ie.marker,ue="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,Ae="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ie.from==null||(ue?ie.from<=t.ch:ie.from<t.ch))&&(ie.to==null||(Ae?ie.to>=t.ch:ie.to>t.ch))){if(g&&(Fe(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(j.markedSpans){--q;continue}else break;if(!oe.atomic)continue;if(o){var Ne=oe.find(a<0?1:-1),Ze=void 0;if((a<0?Ae:ue)&&(Ne=fs(e,Ne,-a,Ne&&Ne.line==t.line?j:null)),Ne&&Ne.line==t.line&&(Ze=It(Ne,o))&&(a<0?Ze<0:Ze>0))return xa(e,Ne,t,a,g)}var Ve=oe.find(a<0?-1:1);return(a<0?ue:Ae)&&(Ve=fs(e,Ve,a,Ve.line==t.line?j:null)),Ve?xa(e,Ve,t,a,g):null}}return t}function oo(e,t,o,a,g){var j=a||1,q=xa(e,t,o,j,g)||!g&&xa(e,t,o,j,!0)||xa(e,t,o,-j,g)||!g&&xa(e,t,o,-j,!0);return q||(e.cantEdit=!0,Xe(e.first,0))}function fs(e,t,o,a){return o<0&&t.ch==0?t.line>e.first?C(e,Xe(t.line-1)):null:o>0&&t.ch==(a||G(e,t.line)).text.length?t.line<e.first+e.size-1?Xe(t.line+1,0):null:new Xe(t.line,t.ch+o)}function ps(e){e.setSelection(Xe(e.firstLine(),0),Xe(e.lastLine()),Te)}function ms(e,t,o){var a={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return a.canceled=!0}};return o&&(a.update=function(g,j,q,ie){g&&(a.from=C(e,g)),j&&(a.to=C(e,j)),q&&(a.text=q),ie!==void 0&&(a.origin=ie)}),Fe(e,"beforeChange",e,a),e.cm&&Fe(e.cm,"beforeChange",e.cm,a),a.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:a.from,to:a.to,text:a.text,origin:a.origin}}function Sa(e,t,o){if(e.cm){if(!e.cm.curOp)return er(e.cm,Sa)(e,t,o);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=ms(e,t,!0),!t))return;var a=Zi&&!o&&hr(e,t.from,t.to);if(a)for(var g=a.length-1;g>=0;--g)gs(e,{from:a[g].from,to:a[g].to,text:g?[""]:t.text,origin:t.origin});else gs(e,t)}function gs(e,t){if(t.text.length==1&&t.text[0]==""&&It(t.from,t.to)==0)return;var o=To(e,t);rs(e,t,o,e.cm?e.cm.curOp.id:NaN),Ba(e,t,o,ji(e,t));var a=[];oa(e,function(g,j){!j&&ae(a,g.history)==-1&&(bs(g.history,t),a.push(g.history)),Ba(g,t,null,ji(g,t))})}function so(e,t,o){var a=e.cm&&e.cm.state.suppressEdits;if(a&&!o)return;for(var g=e.history,j,q=e.sel,ie=t=="undo"?g.done:g.undone,oe=t=="undo"?g.undone:g.done,ue=0;ue<ie.length&&!(j=ie[ue],o?j.ranges&&!j.equals(e.sel):!j.ranges);ue++);if(ue==ie.length)return;for(g.lastOrigin=g.lastSelOrigin=null;;)if(j=ie.pop(),j.ranges){if(io(j,oe),o&&!j.equals(e.sel)){ur(e,j,{clearRedo:!1});return}q=j}else if(a){ie.push(j);return}else break;var Ae=[];io(q,oe),oe.push({changes:Ae,generation:g.generation}),g.generation=j.generation||++g.maxGeneration;for(var Ne=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),Ze=function(Ut){var Ht=j.changes[Ut];if(Ht.origin=t,Ne&&!ms(e,Ht,!1))return ie.length=0,{};Ae.push(Oo(e,Ht));var Jt=Ut?To(e,Ht):He(ie);Ba(e,Ht,Jt,os(e,Ht)),!Ut&&e.cm&&e.cm.scrollIntoView({from:Ht.from,to:aa(Ht)});var rn=[];oa(e,function(Zt,dn){!dn&&ae(rn,Zt.history)==-1&&(bs(Zt.history,Ht),rn.push(Zt.history)),Ba(Zt,Ht,null,os(Zt,Ht))})},Ve=j.changes.length-1;Ve>=0;--Ve){var Et=Ze(Ve);if(Et)return Et.v}}function vs(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(ct(e.sel.ranges,function(g){return new pi(Xe(g.anchor.line+t,g.anchor.ch),Xe(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){Pi(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,a=o.viewFrom;a<o.viewTo;a++)or(e.cm,a,"gutter")}}function Ba(e,t,o,a){if(e.cm&&!e.cm.curOp)return er(e.cm,Ba)(e,t,o,a);if(t.to.line<e.first){vs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var g=t.text.length-1-(e.first-t.from.line);vs(e,g),t={from:Xe(e.first,0),to:Xe(t.to.line+g,t.to.ch),text:[He(t.text)],origin:t.origin}}var j=e.lastLine();t.to.line>j&&(t={from:t.from,to:Xe(j,G(e,j).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Q(e,t.from,t.to),o||(o=To(e,t)),e.cm?bl(e.cm,t,a):wo(e,t,a),ao(e,o,Te),e.cantEdit&&oo(e,Xe(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var a=e.doc,g=e.display,j=t.from,q=t.to,ie=!1,oe=j.line;e.options.lineWrapping||(oe=Le(Xi(G(a,j.line))),a.iter(oe,q.line+1,function(Ve){if(Ve==g.maxLine)return ie=!0,!0})),a.sel.contains(t.from,t.to)>-1&&Ee(e),wo(a,t,o,Ar(e)),e.options.lineWrapping||(a.iter(oe,j.line+t.text.length,function(Ve){var Et=Yr(Ve);Et>g.maxLineLength&&(g.maxLine=Ve,g.maxLineLength=Et,g.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),di(a,j.line),Ua(e,400);var ue=t.text.length-(q.line-j.line)-1;t.full?Pi(e):j.line==q.line&&t.text.length==1&&!es(e.doc,t)?or(e,j.line,"text"):Pi(e,j.line,q.line+1,ue);var Ae=ye(e,"changes"),Ne=ye(e,"change");if(Ne||Ae){var Ze={from:j,to:q,text:t.text,removed:t.removed,origin:t.origin};Ne&&nt(e,"change",e,Ze),Ae&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ze)}e.display.selForContextMenu=null}function Ta(e,t,o,a,g){var j;a||(a=o),It(a,o)<0&&(j=[a,o],o=j[0],a=j[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:o,to:a,text:t,origin:g})}function _s(e,t,o,a){o<e.line?e.line+=a:t<e.line&&(e.line=t,e.ch=0)}function ys(e,t,o,a){for(var g=0;g<e.length;++g){var j=e[g],q=!0;if(j.ranges){j.copied||(j=e[g]=j.deepCopy(),j.copied=!0);for(var ie=0;ie<j.ranges.length;ie++)_s(j.ranges[ie].anchor,t,o,a),_s(j.ranges[ie].head,t,o,a);continue}for(var oe=0;oe<j.changes.length;++oe){var ue=j.changes[oe];if(o<ue.from.line)ue.from=Xe(ue.from.line+a,ue.from.ch),ue.to=Xe(ue.to.line+a,ue.to.ch);else if(t<=ue.to.line){q=!1;break}}q||(e.splice(0,g+1),g=0)}}function bs(e,t){var o=t.from.line,a=t.to.line,g=t.text.length-(a-o)-1;ys(e.done,o,a,g),ys(e.undone,o,a,g)}function Wa(e,t,o,a){var g=t,j=t;return typeof t=="number"?j=G(e,$(e,t)):g=Le(t),g==null?null:(a(j,g)&&e.cm&&or(e.cm,g,o),j)}function Ha(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}Ha.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,a=e+t;o<a;++o){var g=this.lines[o];this.height-=g.height,mn(g),nt(g,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var a=0;a<t.length;++a)t[a].parent=this},iterN:function(e,t,o){for(var a=e+t;e<a;++e)if(o(this.lines[e]))return!0}};function Ka(e){this.children=e;for(var t=0,o=0,a=0;a<e.length;++a){var g=e[a];t+=g.chunkSize(),o+=g.height,g.parent=this}this.size=t,this.height=o,this.parent=null}Ka.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var a=this.children[o],g=a.chunkSize();if(e<g){var j=Math.min(t,g-e),q=a.height;if(a.removeInner(e,j),this.height-=q-a.height,g==j&&(this.children.splice(o--,1),a.parent=null),(t-=j)==0)break;e=0}else e-=g}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ha))){var ie=[];this.collapse(ie),this.children=[new Ha(ie)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,o){this.size+=t.length,this.height+=o;for(var a=0;a<this.children.length;++a){var g=this.children[a],j=g.chunkSize();if(e<=j){if(g.insertInner(e,t,o),g.lines&&g.lines.length>50){for(var q=g.lines.length%25+25,ie=q;ie<g.lines.length;){var oe=new Ha(g.lines.slice(ie,ie+=25));g.height-=oe.height,this.children.splice(++a,0,oe),oe.parent=this}g.lines=g.lines.slice(0,q),this.maybeSpill()}break}e-=j}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),o=new Ka(t);if(e.parent){e.size-=o.size,e.height-=o.height;var g=ae(e.parent.children,e);e.parent.children.splice(g+1,0,o)}else{var a=new Ka(e.children);a.parent=e,e.children=[a,o],e=a}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var a=0;a<this.children.length;++a){var g=this.children[a],j=g.chunkSize();if(e<j){var q=Math.min(t,j-e);if(g.iterN(e,q,o))return!0;if((t-=q)==0)break;e=0}else e-=j}}};var Ga=function(e,t,o){if(o)for(var a in o)o.hasOwnProperty(a)&&(this[a]=o[a]);this.doc=e,this.node=t};Ga.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,a=Le(o);if(a==null||!t)return;for(var g=0;g<t.length;++g)t[g]==this&&t.splice(g--,1);t.length||(o.widgets=null);var j=bi(this);he(o,Math.max(0,o.height-j)),e&&(Pr(e,function(){Es(e,o,-j),or(e,a,"widget")}),nt(e,"lineWidgetCleared",e,this,a))},Ga.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,a=this.line;this.height=null;var g=bi(this)-t;if(!g)return;wr(this.doc,a)||he(a,a.height+g),o&&Pr(o,function(){o.curOp.forceUpdate=!0,Es(o,a,g),nt(o,"lineWidgetChanged",o,e,Le(a))})},_e(Ga);function Es(e,t,o){vr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_o(e,o)}function El(e,t,o,a){var g=new Ga(e,o,a),j=e.cm;return j&&g.noHScroll&&(j.display.alignWidgets=!0),Wa(e,t,"widget",function(q){var ie=q.widgets||(q.widgets=[]);if(g.insertAt==null?ie.push(g):ie.splice(Math.min(ie.length-1,Math.max(0,g.insertAt)),0,g),g.line=q,j&&!wr(e,q)){var oe=vr(q)<e.scrollTop;he(q,q.height+bi(g)),oe&&_o(j,g.height),j.curOp.forceUpdate=!0}return!0}),j&&nt(j,"lineWidgetAdded",j,g,typeof t=="number"?t:Le(t)),g}var xs=0,sa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xs};sa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&fa(e),ye(this,"clear")){var o=this.find();o&&nt(this,"clear",o.from,o.to)}for(var a=null,g=null,j=0;j<this.lines.length;++j){var q=this.lines[j],ie=Oi(q.markedSpans,this);e&&!this.collapsed?or(e,Le(q),"text"):e&&(ie.to!=null&&(g=Le(q)),ie.from!=null&&(a=Le(q))),q.markedSpans=Ri(q.markedSpans,ie),ie.from==null&&this.collapsed&&!wr(this.doc,q)&&e&&he(q,zn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var ue=Xi(this.lines[oe]),Ae=Yr(ue);Ae>e.display.maxLineLength&&(e.display.maxLine=ue,e.display.maxLineLength=Ae,e.display.maxLineChanged=!0)}a!=null&&e&&this.collapsed&&Pi(e,a,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&cs(e.doc)),e&&nt(e,"markerCleared",e,this,a,g),t&&pa(e),this.parent&&this.parent.clear()},sa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,a,g=0;g<this.lines.length;++g){var j=this.lines[g],q=Oi(j.markedSpans,this);if(q.from!=null&&(o=Xe(t?j:Le(j),q.from),e==-1))return o;if(q.to!=null&&(a=Xe(t?j:Le(j),q.to),e==1))return a}return o&&{from:o,to:a}},sa.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,a=this.doc.cm;if(!t||!a)return;Pr(a,function(){var g=t.line,j=Le(t.line),q=ui(a,j);if(q&&(ln(q),a.curOp.selectionChanged=a.curOp.forceUpdate=!0),a.curOp.updateMaxLine=!0,!wr(o.doc,g)&&o.height!=null){var ie=o.height;o.height=null;var oe=bi(o)-ie;oe&&he(g,g.height+oe)}nt(a,"markerChanged",a,e)})},sa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},sa.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},_e(sa);function Ca(e,t,o,a,g){if(a&&a.shared)return xl(e,t,o,a,g);if(e.cm&&!e.cm.curOp)return er(e.cm,Ca)(e,t,o,a,g);var j=new sa(e,g),q=It(t,o);if(a&&A(a,j,!1),q>0||q==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=S("span",[j.replacedWith],"CodeMirror-widget"),a.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),a.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(Ni(e,t.line,t,o,j)||t.line!=o.line&&Ni(e,o.line,t,o,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");wi()}j.addToHistory&&rs(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var ie=t.line,oe=e.cm,ue;if(e.iter(ie,o.line+1,function(Ne){oe&&j.collapsed&&!oe.options.lineWrapping&&Xi(Ne)==oe.display.maxLine&&(ue=!0),j.collapsed&&ie!=t.line&&he(Ne,0),Vi(Ne,new Di(j,ie==t.line?t.ch:null,ie==o.line?o.ch:null)),++ie}),j.collapsed&&e.iter(t.line,o.line+1,function(Ne){wr(e,Ne)&&he(Ne,0)}),j.clearOnEnter&&Pe(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++xs,j.atomic=!0),oe){if(ue&&(oe.curOp.updateMaxLine=!0),j.collapsed)Pi(oe,t.line,o.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Ae=t.line;Ae<=o.line;Ae++)or(oe,Ae,"text");j.atomic&&cs(oe.doc),nt(oe,"markerAdded",oe,j)}return j}var za=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=this};za.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();nt(this,"clear")},za.prototype.find=function(e,t){return this.primary.find(e,t)},_e(za);function xl(e,t,o,a,g){a=A(a),a.shared=!1;var j=[Ca(e,t,o,a,g)],q=j[0],ie=a.widgetNode;return oa(e,function(oe){ie&&(a.widgetNode=ie.cloneNode(!0)),j.push(Ca(oe,C(oe,t),C(oe,o),a,g));for(var ue=0;ue<oe.linked.length;++ue)if(oe.linked[ue].isParent)return;q=He(j)}),new za(j,q)}function Ss(e){return e.findMarks(Xe(e.first,0),e.clipPos(Xe(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var o=0;o<t.length;o++){var a=t[o],g=a.find(),j=e.clipPos(g.from),q=e.clipPos(g.to);if(It(j,q)){var ie=Ca(e,j,q,a.primary,a.primary.type);a.markers.push(ie),ie.parent=a}}}function Tl(e){for(var t=function(a){var g=e[a],j=[g.primary.doc];oa(g.primary.doc,function(oe){return j.push(oe)});for(var q=0;q<g.markers.length;q++){var ie=g.markers[q];ae(j,ie.doc)==-1&&(ie.parent=null,g.markers.splice(q--,1))}},o=0;o<e.length;o++)t(o)}var Cl=0,br=function(e,t,o,a,g){if(!(this instanceof br))return new br(e,t,o,a,g);o==null&&(o=0),Ka.call(this,[new Ha([new fr("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var j=Xe(o,0);this.sel=ra(j),this.history=new no(null),this.id=++Cl,this.modeOption=t,this.lineSep=a,this.direction=g=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),wo(this,{from:j,to:j,text:e}),ur(this,ra(j),Te)};br.prototype=yt(Ka.prototype,{constructor:br,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,a=0;a<t.length;++a)o+=t[a].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=te(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:tr(function(e){var t=Xe(this.first,0),o=this.first+this.size-1;Sa(this,{from:t,to:Xe(o,G(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pa(this.cm,0,0),ur(this,ra(t),Te)}),replaceRange:function(e,t,o,a){t=C(this,t),o=o?C(this,o):t,Ta(this,e,t,o,a)},getRange:function(e,t,o){var a=Q(this,C(this,e),C(this,t));return o===!1?a:a.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ot(this,e))return G(this,e)},getLineNumber:function(e){return Le(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=G(this,e)),Xi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return C(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tr(function(e,t,o){ls(this,C(this,typeof e=="number"?Xe(e,t||0):e),null,o)}),setSelection:tr(function(e,t,o){ls(this,C(this,e),C(this,t||e),o)}),extendSelection:tr(function(e,t,o){ro(this,C(this,e),t&&C(this,t),o)}),extendSelections:tr(function(e,t){ss(this,K(this,e),t)}),extendSelectionsBy:tr(function(e,t){var o=ct(this.sel.ranges,e);ss(this,K(this,o),t)}),setSelections:tr(function(e,t,o){if(!e.length)return;for(var a=[],g=0;g<e.length;g++)a[g]=new pi(C(this,e[g].anchor),C(this,e[g].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ur(this,zr(this.cm,a,t),o)}),addSelection:tr(function(e,t,o){var a=this.sel.ranges.slice(0);a.push(new pi(C(this,e),C(this,t||e))),ur(this,zr(this.cm,a,a.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,a=0;a<t.length;a++){var g=Q(this,t[a].from(),t[a].to());o=o?o.concat(g):g}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,a=0;a<o.length;a++){var g=Q(this,o[a].from(),o[a].to());e!==!1&&(g=g.join(e||this.lineSeparator())),t[a]=g}return t},replaceSelection:function(e,t,o){for(var a=[],g=0;g<this.sel.ranges.length;g++)a[g]=e;this.replaceSelections(a,t,o||"+input")},replaceSelections:tr(function(e,t,o){for(var a=[],g=this.sel,j=0;j<g.ranges.length;j++){var q=g.ranges[j];a[j]={from:q.from(),to:q.to(),text:this.splitLines(e[j]),origin:o}}for(var ie=t&&t!="end"&&hl(this,a,t),oe=a.length-1;oe>=0;oe--)Sa(this,a[oe]);ie?us(this,ie):this.cm&&ya(this.cm)}),undo:tr(function(){so(this,"undo")}),redo:tr(function(){so(this,"redo")}),undoSelection:tr(function(){so(this,"undo",!0)}),redoSelection:tr(function(){so(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,a=0;a<e.done.length;a++)e.done[a].ranges||++t;for(var g=0;g<e.undone.length;g++)e.undone[g].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new no(this.history.maxGeneration),oa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ea(this.history.done),undone:Ea(this.history.undone)}},setHistory:function(e){var t=this.history=new no(this.history.maxGeneration);t.done=Ea(e.done.slice(0),null,!0),t.undone=Ea(e.undone.slice(0),null,!0)},setGutterMarker:tr(function(e,t,o){return Wa(this,e,"gutter",function(a){var g=a.gutterMarkers||(a.gutterMarkers={});return g[t]=o,!o&&Tt(g)&&(a.gutterMarkers=null),!0})}),clearGutter:tr(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&Wa(t,o,"gutter",function(){return o.gutterMarkers[e]=null,Tt(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ot(this,e))return null;if(t=e,e=G(this,e),!e)return null}else if(t=Le(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:tr(function(e,t,o){return Wa(this,e,t=="gutter"?"gutter":"class",function(a){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!a[g])a[g]=o;else{if(E(o).test(a[g]))return!1;a[g]+=" "+o}return!0})}),removeLineClass:tr(function(e,t,o){return Wa(this,e,t=="gutter"?"gutter":"class",function(a){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",j=a[g];if(j)if(o==null)a[g]=null;else{var q=j.match(E(o));if(!q)return!1;var ie=q.index+q[0].length;a[g]=j.slice(0,q.index)+(!q.index||ie==j.length?"":" ")+j.slice(ie)||null}else return!1;return!0})}),addLineWidget:tr(function(e,t,o){return El(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return Ca(this,C(this,e),C(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=C(this,e),Ca(this,e,e,o,"bookmark")},findMarksAt:function(e){e=C(this,e);var t=[],o=G(this,e.line).markedSpans;if(o)for(var a=0;a<o.length;++a){var g=o[a];(g.from==null||g.from<=e.ch)&&(g.to==null||g.to>=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,o){e=C(this,e),t=C(this,t);var a=[],g=e.line;return this.iter(e.line,t.line+1,function(j){var q=j.markedSpans;if(q)for(var ie=0;ie<q.length;ie++){var oe=q[ie];!(oe.to!=null&&g==e.line&&e.ch>=oe.to||oe.from==null&&g!=e.line||oe.from!=null&&g==t.line&&oe.from>=t.ch)&&(!o||o(oe.marker))&&a.push(oe.marker.parent||oe.marker)}++g}),a},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var a=0;a<o.length;++a)o[a].from!=null&&e.push(o[a].marker)}),e},posFromIndex:function(e){var t,o=this.first,a=this.lineSeparator().length;return this.iter(function(g){var j=g.text.length+a;if(j>e)return t=e,!0;e-=j,++o}),C(this,Xe(o,t))},indexFromPos:function(e){e=C(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(a){t+=a.text.length+o}),t},copy:function(e){var t=new br(te(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var a=new br(te(this,t,o),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(a.history=this.history),(this.linked||(this.linked=[])).push({doc:a,sharedHist:e.sharedHist}),a.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(a,Ss(this)),a},unlinkDoc:function(e){if(e instanceof Ii&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Ss(this));break}if(e.history==this.history){var a=[e.id];oa(e,function(g){return a.push(g.id)},!0),e.history=new no(null),e.history.done=Ea(this.history.done,a),e.history.undone=Ea(this.history.undone,a)}},iterLinkedDocs:function(e){oa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Qe(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:tr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),br.prototype.eachLine=br.prototype.iter;var Ts=0;function wl(e){var t=this;if(Cs(t),Je(t,e)||Un(t.display,e))return;le(e),B&&(Ts=+new Date);var o=$i(t,e,!0),a=e.dataTransfer.files;if(!o||t.isReadOnly())return;if(a&&a.length&&window.FileReader&&window.File)for(var g=a.length,j=Array(g),q=0,ie=function(){++q==g&&er(t,function(){o=C(t.doc,o);var Ve={from:o,to:o,text:t.doc.splitLines(j.filter(function(Et){return Et!=null}).join(t.doc.lineSeparator())),origin:"paste"};Sa(t.doc,Ve),us(t.doc,ra(C(t.doc,o),C(t.doc,aa(Ve))))})()},oe=function(Ve,Et){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,Ve.type)==-1){ie();return}var Ut=new FileReader;Ut.onerror=function(){return ie()},Ut.onload=function(){var Ht=Ut.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ht)){ie();return}j[Et]=Ht,ie()},Ut.readAsText(Ve)},ue=0;ue<a.length;ue++)oe(a[ue],ue);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ae=e.dataTransfer.getData("Text");if(Ae){var Ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ne=t.listSelections()),ao(t.doc,ra(o,o)),Ne)for(var Ze=0;Ze<Ne.length;++Ze)Ta(t.doc,"",Ne[Ze].anchor,Ne[Ze].head,"drag");t.replaceSelection(Ae,"around","paste"),t.display.input.focus()}}catch(Ve){}}}function Ol(e,t){if(B&&(!e.state.draggingText||+new Date-Ts<100)){pe(t);return}if(Je(e,t)||Un(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!u){var o=c("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),m&&o.parentNode.removeChild(o)}}function Rl(e,t){var o=$i(e,t);if(!o)return;var a=document.createDocumentFragment();Ki(e,o,a),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,a)}function Cs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),o=[],a=0;a<t.length;a++){var g=t[a].CodeMirror;g&&o.push(g)}o.length&&o[0].operation(function(){for(var j=0;j<o.length;j++)e(o[j])})}var Os=!1;function Al(){if(Os)return;Ll(),Os=!0}function Ll(){var e;Pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ws(Il)},100))}),Pe(window,"blur",function(){return ws(Ir)})}function Il(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var la={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Va=0;Va<10;Va++)la[Va+48]=la[Va+96]=String(Va);for(var lo=65;lo<=90;lo++)la[lo]=String.fromCharCode(lo);for(var Xa=1;Xa<=12;Xa++)la[Xa+111]=la[Xa+63235]="F"+Xa;var qr={};qr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},qr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},qr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},qr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},qr.default=n?qr.macDefault:qr.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,a,g,j,q=0;q<t.length-1;q++){var ie=t[q];if(/^(cmd|meta|m)$/i.test(ie))j=!0;else if(/^a(lt)?$/i.test(ie))o=!0;else if(/^(c|ctrl|control)$/i.test(ie))a=!0;else if(/^s(hift)?$/i.test(ie))g=!0;else throw new Error("Unrecognized modifier name: "+ie)}return o&&(e="Alt-"+e),a&&(e="Ctrl-"+e),j&&(e="Cmd-"+e),g&&(e="Shift-"+e),e}function Pl(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var a=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(a=="..."){delete e[o];continue}for(var g=ct(o.split(" "),Dl),j=0;j<g.length;j++){var q=void 0,ie=void 0;j==g.length-1?(ie=g.join(" "),q=a):(ie=g.slice(0,j+1).join(" "),q="...");var oe=t[ie];if(!oe)t[ie]=q;else if(oe!=q)throw new Error("Inconsistent bindings for "+ie)}delete e[o]}for(var ue in t)e[ue]=t[ue];return e}function wa(e,t,o,a){t=uo(t);var g=t.call?t.call(e,a):t[e];if(g===!1)return"nothing";if(g==="...")return"multi";if(g!=null&&o(g))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return wa(e,t.fallthrough,o,a);for(var j=0;j<t.fallthrough.length;j++){var q=wa(e,t.fallthrough[j],o,a);if(q)return q}}}function Rs(e){var t=typeof e=="string"?e:la[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function As(e,t,o){var a=e;return t.altKey&&a!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&a!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&a!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&a!="Shift"&&(e="Shift-"+e),e}function Ls(e,t){if(m&&e.keyCode==34&&e.char)return!1;var o=la[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),As(o,e,t))}function uo(e){return typeof e=="string"?qr[e]:e}function Oa(e,t){for(var o=e.doc.sel.ranges,a=[],g=0;g<o.length;g++){for(var j=t(o[g]);a.length&&It(j.from,He(a).to)<=0;){var q=a.pop();if(It(q.from,j.from)<0){j.from=q.from;break}}a.push(j)}Pr(e,function(){for(var ie=a.length-1;ie>=0;ie--)Ta(e.doc,"",a[ie].from,a[ie].to,"+delete");ya(e)})}function Lo(e,t,o){var a=je(e.text,t+o,o);return a<0||a>e.text.length?null:a}function Io(e,t,o){var a=Lo(e,t.ch,o);return a==null?null:new Xe(t.line,a,o<0?"after":"before")}function Do(e,t,o,a,g){if(e){t.doc.direction=="rtl"&&(g=-g);var j=jt(o,t.doc.direction);if(j){var q=g<0?He(j):j[0],ie=g<0==(q.level==1),oe=ie?"after":"before",ue;if(q.level>0||t.doc.direction=="rtl"){var Ae=ti(t,o);ue=g<0?o.text.length-1:0;var Ne=Dn(t,Ae,ue).top;ue=$e(function(Ze){return Dn(t,Ae,Ze).top==Ne},g<0==(q.level==1)?q.from:q.to-1,ue),oe=="before"&&(ue=Lo(o,ue,1))}else ue=g<0?q.to:q.from;return new Xe(a,ue,oe)}}return new Xe(a,g<0?o.text.length:0,g<0?"before":"after")}function Ml(e,t,o,a){var g=jt(t,e.doc.direction);if(!g)return Io(t,o,a);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var j=bt(g,o.ch,o.sticky),q=g[j];if(e.doc.direction=="ltr"&&q.level%2==0&&(a>0?q.to>o.ch:q.from<o.ch))return Io(t,o,a);var ie=function(Jt,rn){return Lo(t,Jt instanceof Xe?Jt.ch:Jt,rn)},oe,ue=function(Jt){return e.options.lineWrapping?(oe=oe||ti(e,t),da(e,t,oe,Jt)):{begin:0,end:t.text.length}},Ae=ue(o.sticky=="before"?ie(o,-1):o.ch);if(e.doc.direction=="rtl"||q.level==1){var Ne=q.level==1==a<0,Ze=ie(o,Ne?1:-1);if(Ze!=null&&(Ne?Ze<=q.to&&Ze<=Ae.end:Ze>=q.from&&Ze>=Ae.begin)){var Ve=Ne?"before":"after";return new Xe(o.line,Ze,Ve)}}var Et=function(Jt,rn,Zt){for(var dn=function(Ci,nr){return nr?new Xe(o.line,ie(Ci,1),"before"):new Xe(o.line,Ci,"after")};Jt>=0&&Jt<g.length;Jt+=rn){var An=g[Jt],En=rn>0==(An.level!=1),Qn=En?Zt.begin:ie(Zt.end,-1);if(An.from<=Qn&&Qn<An.to)return dn(Qn,En);if(Qn=En?An.from:ie(An.to,-1),Zt.begin<=Qn&&Qn<Zt.end)return dn(Qn,En)}},Ut=Et(j+a,a,Ae);if(Ut)return Ut;var Ht=a>0?Ae.end:ie(Ae.begin,-1);return Ht!=null&&!(a>0&&Ht==t.text.length)&&(Ut=Et(a>0?0:g.length-1,a,ue(Ht)),Ut)?Ut:null}var Ya={selectAll:ps,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return Oa(e,function(t){if(t.empty()){var o=G(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:Xe(t.head.line+1,0)}:{from:t.head,to:Xe(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Oa(e,function(t){return{from:Xe(t.from().line,0),to:C(e.doc,Xe(t.to().line+1,0))}})},delLineLeft:function(e){return Oa(e,function(t){return{from:Xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Oa(e,function(t){var o=e.charCoords(t.head,"div").top+5,a=e.coordsChar({left:0,top:o},"div");return{from:a,to:t.from()}})},delWrappedLineRight:function(e){return Oa(e,function(t){var o=e.charCoords(t.head,"div").top+5,a=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div");return{from:t.from(),to:a}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},Ue)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},Ue)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,a=e.coordsChar({left:0,top:o},"div");return a.ch<e.getLine(a.line).search(/\S/)?Ds(e,t.head):a},Ue)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],o=e.listSelections(),a=e.options.tabSize,g=0;g<o.length;g++){var j=o[g].from(),q=z(e.getLine(j.line),j.ch,a);t.push(ge(a-q%a))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pr(e,function(){for(var t=e.listSelections(),o=[],a=0;a<t.length;a++){if(!t[a].empty())continue;var g=t[a].head,j=G(e.doc,g.line).text;if(j){if(g.ch==j.length&&(g=new Xe(g.line,g.ch-1)),g.ch>0)g=new Xe(g.line,g.ch+1),e.replaceRange(j.charAt(g.ch-1)+j.charAt(g.ch-2),Xe(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var q=G(e.doc,g.line-1).text;q&&(g=new Xe(g.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+q.charAt(q.length-1),Xe(g.line-1,q.length-1),g,"+transpose"))}}o.push(new pi(g,g))}e.setSelections(o)})},newlineAndIndent:function(e){return Pr(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var a=0;a<t.length;a++)e.indentLine(t[a].from().line,null,!0);ya(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Is(e,t){var o=G(e.doc,t),a=Xi(o);return a!=o&&(t=Le(a)),Do(!0,e,a,t,1)}function kl(e,t){var o=G(e.doc,t),a=lr(o);return a!=o&&(t=Le(a)),Do(!0,e,o,t,-1)}function Ds(e,t){var o=Is(e,t.line),a=G(e.doc,o.line),g=jt(a,e.doc.direction);if(!g||g[0].level==0){var j=Math.max(o.ch,a.text.search(/\S/)),q=t.line==o.line&&t.ch<=j&&t.ch;return Xe(o.line,q?0:j,o.sticky)}return o}function co(e,t,o){if(typeof t=="string"&&(t=Ya[t],!t))return!1;e.display.input.ensurePolled();var a=e.display.shift,g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),g=t(e)!=xe}finally{e.display.shift=a,e.state.suppressEdits=!1}return g}function Nl(e,t,o){for(var a=0;a<e.state.keyMaps.length;a++){var g=wa(t,e.state.keyMaps[a],o,e);if(g)return g}return e.options.extraKeys&&wa(t,e.options.extraKeys,o,e)||wa(t,e.options.keyMap,o,e)}var Ul=new ne;function $a(e,t,o,a){var g=e.state.keySeq;if(g){if(Rs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==g&&(e.state.keySeq=null,e.display.input.reset())}),Ps(e,g+" "+t,o,a))return!0}return Ps(e,t,o,a)}function Ps(e,t,o,a){var g=Nl(e,t,a);return g=="multi"&&(e.state.keySeq=t),g=="handled"&&nt(e,"keyHandled",e,t,o),(g=="handled"||g=="multi")&&(le(o),bn(e)),!!g}function Ms(e,t){var o=Ls(t,!0);return o?t.shiftKey&&!e.state.keySeq?$a(e,"Shift-"+o,t,function(a){return co(e,a,!0)})||$a(e,o,t,function(a){if(typeof a=="string"?/^go[A-Z]/.test(a):a.motion)return co(e,a)}):$a(e,o,t,function(a){return co(e,a)}):!1}function Fl(e,t,o){return $a(e,"'"+o+"'",t,function(a){return co(e,a,!0)})}var Po=null;function ks(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Je(t,e))return;B&&M<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var a=Ms(t,e);m&&(Po=a?o:null,!a&&o==88&&!We&&(n?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!n&&!a&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&jl(t)}function jl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function o(a){(a.keyCode==18||!a.altKey)&&(v(t,"CodeMirror-crosshair"),rt(document,"keyup",o),rt(document,"mouseover",o))}Pe(document,"keyup",o),Pe(document,"mouseover",o)}function Ns(e){e.keyCode==16&&(this.doc.sel.shift=!1),Je(this,e)}function Us(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Un(t.display,e)||Je(t,e)||e.ctrlKey&&!e.altKey||n&&e.metaKey)return;var o=e.keyCode,a=e.charCode;if(m&&o==Po){Po=null,le(e);return}if(m&&(!e.which||e.which<10)&&Ms(t,e))return;var g=String.fromCharCode(a==null?o:a);if(g=="\b")return;if(Fl(t,e,g))return;t.display.input.onKeyPress(e)}var Bl=400,Mo=function(e,t,o){this.time=e,this.pos=t,this.button=o};Mo.prototype.compare=function(e,t,o){return this.time+Bl>e&&It(t,this.pos)==0&&o==this.button};var Qa,Ja;function Wl(e,t){var o=+new Date;return Ja&&Ja.compare(o,e,t)?(Qa=Ja=null,"triple"):Qa&&Qa.compare(o,e,t)?(Ja=new Mo(o,e,t),Qa=null,"double"):(Qa=new Mo(o,e,t),Ja=null,"single")}function Fs(e){var t=this,o=t.display;if(Je(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,Un(o,e)){L||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(ko(t,e))return;var a=$i(t,e),g=Ke(e),j=a?Wl(a,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),a&&Hl(t,g,a,j,e))return;g==1?a?Gl(t,a,j,e):Ce(e)==o.scroller&&le(e):g==2?(a&&ro(t.doc,a),setTimeout(function(){return o.input.focus()},20)):g==3&&(O?t.display.input.onContextMenu(e):_a(t))}function Hl(e,t,o,a,g){var j="Click";return a=="double"?j="Double"+j:a=="triple"&&(j="Triple"+j),j=(t==1?"Left":t==2?"Middle":"Right")+j,$a(e,As(j,g),g,function(q){if(typeof q=="string"&&(q=Ya[q]),!q)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=q(e,o)!=xe}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,t,o){var a=e.getOption("configureMouse"),g=a?a(e,t,o):{};if(g.unit==null){var j=d?o.shiftKey&&o.metaKey:o.altKey;g.unit=j?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||o.shiftKey),g.addNew==null&&(g.addNew=n?o.metaKey:o.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(n?o.altKey:o.ctrlKey)),g}function Gl(e,t,o,a){B?setTimeout(H(na,e),0):e.curOp.focus=N();var g=Kl(e,o,a),j=e.doc.sel,q;e.options.dragDrop&&st&&!e.isReadOnly()&&o=="single"&&(q=j.contains(t))>-1&&(It((q=j.ranges[q]).from(),t)<0||t.xRel>0)&&(It(q.to(),t)>0||t.xRel<0)?zl(e,a,t,g):Vl(e,a,t,g)}function zl(e,t,o,a){var g=e.display,j=!1,q=er(e,function(ue){L&&(g.scroller.draggable=!1),e.state.draggingText=!1,rt(g.wrapper.ownerDocument,"mouseup",q),rt(g.wrapper.ownerDocument,"mousemove",ie),rt(g.scroller,"dragstart",oe),rt(g.scroller,"drop",q),j||(le(ue),a.addNew||ro(e.doc,o,null,null,a.extend),L&&!u||B&&M==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),ie=function(ue){j=j||Math.abs(t.clientX-ue.clientX)+Math.abs(t.clientY-ue.clientY)>=10},oe=function(){return j=!0};L&&(g.scroller.draggable=!0),e.state.draggingText=q,q.copy=!a.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Pe(g.wrapper.ownerDocument,"mouseup",q),Pe(g.wrapper.ownerDocument,"mousemove",ie),Pe(g.scroller,"dragstart",oe),Pe(g.scroller,"drop",q),_a(e),setTimeout(function(){return g.input.focus()},20)}function js(e,t,o){if(o=="char")return new pi(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new pi(Xe(t.line,0),C(e.doc,Xe(t.line+1,0)));var a=o(e,t);return new pi(a.from,a.to)}function Vl(e,t,o,a){var g=e.display,j=e.doc;le(t);var q,ie,oe=j.sel,ue=oe.ranges;if(a.addNew&&!a.extend?(ie=j.sel.contains(o),ie>-1?q=ue[ie]:q=new pi(o,o)):(q=j.sel.primary(),ie=j.sel.primIndex),a.unit=="rectangle")a.addNew||(q=new pi(o,o)),o=$i(e,t,!0,!0),ie=-1;else{var Ae=js(e,o,a.unit);a.extend?q=Ro(q,Ae.anchor,Ae.head,a.extend):q=Ae}a.addNew?ie==-1?(ie=ue.length,ur(j,zr(e,ue.concat([q]),ie),{scroll:!1,origin:"*mouse"})):ue.length>1&&ue[ie].empty()&&a.unit=="char"&&!a.extend?(ur(j,zr(e,ue.slice(0,ie).concat(ue.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),oe=j.sel):Ao(j,ie,q,Oe):(ie=0,ur(j,new jr([q],0),Oe),oe=j.sel);var Ne=o;function Ze(Zt){if(It(Ne,Zt)==0)return;if(Ne=Zt,a.unit=="rectangle"){for(var dn=[],An=e.options.tabSize,En=z(G(j,o.line).text,o.ch,An),Qn=z(G(j,Zt.line).text,Zt.ch,An),Ci=Math.min(En,Qn),nr=Math.max(En,Qn),ki=Math.min(o.line,Zt.line),Mr=Math.min(e.lastLine(),Math.max(o.line,Zt.line));ki<=Mr;ki++){var Er=G(j,ki).text,Gi=De(Er,Ci,An);Ci==nr?dn.push(new pi(Xe(ki,Gi),Xe(ki,Gi))):Er.length>Gi&&dn.push(new pi(Xe(ki,Gi),Xe(ki,De(Er,nr,An))))}dn.length||dn.push(new pi(o,o)),ur(j,zr(e,oe.ranges.slice(0,ie).concat(dn),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Zt)}else{var xr=q,sr=js(e,Zt,a.unit),Ji=xr.anchor,zi;It(sr.anchor,Ji)>0?(zi=sr.head,Ji=nn(xr.from(),sr.anchor)):(zi=sr.anchor,Ji=pn(xr.to(),sr.head));var Fi=oe.ranges.slice(0);Fi[ie]=Xl(e,new pi(C(j,Ji),zi)),ur(j,zr(e,Fi,ie),Oe)}}var Ve=g.wrapper.getBoundingClientRect(),Et=0;function Ut(Zt){var dn=++Et,An=$i(e,Zt,!0,a.unit=="rectangle");if(!An)return;if(It(An,Ne)!=0){e.curOp.focus=N(),Ze(An);var En=Gr(g,j);(An.line>=En.to||An.line<En.from)&&setTimeout(er(e,function(){Et==dn&&Ut(Zt)}),150)}else{var Qn=Zt.clientY<Ve.top?-20:Zt.clientY>Ve.bottom?20:0;Qn&&setTimeout(er(e,function(){if(Et!=dn)return;g.scroller.scrollTop+=Qn,Ut(Zt)}),50)}}function Ht(Zt){e.state.selectingText=!1,Et=Infinity,Zt&&(le(Zt),g.input.focus()),rt(g.wrapper.ownerDocument,"mousemove",Jt),rt(g.wrapper.ownerDocument,"mouseup",rn),j.history.lastSelOrigin=null}var Jt=er(e,function(Zt){Zt.buttons===0||!Ke(Zt)?Ht(Zt):Ut(Zt)}),rn=er(e,Ht);e.state.selectingText=rn,Pe(g.wrapper.ownerDocument,"mousemove",Jt),Pe(g.wrapper.ownerDocument,"mouseup",rn)}function Xl(e,t){var o=t.anchor,a=t.head,g=G(e.doc,o.line);if(It(o,a)==0&&o.sticky==a.sticky)return t;var j=jt(g);if(!j)return t;var q=bt(j,o.ch,o.sticky),ie=j[q];if(ie.from!=o.ch&&ie.to!=o.ch)return t;var oe=q+(ie.from==o.ch==(ie.level!=1)?0:1);if(oe==0||oe==j.length)return t;var ue;if(a.line!=o.line)ue=(a.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ae=bt(j,a.ch,a.sticky),Ne=Ae-q||(a.ch-o.ch)*(ie.level==1?-1:1);Ae==oe-1||Ae==oe?ue=Ne<0:ue=Ne>0}var Ze=j[oe+(ue?-1:0)],Ve=ue==(Ze.level==1),Et=Ve?Ze.from:Ze.to,Ut=Ve?"after":"before";return o.ch==Et&&o.sticky==Ut?t:new pi(new Xe(o.line,Et,Ut),a)}function Bs(e,t,o,a){var g,j;if(t.touches)g=t.touches[0].clientX,j=t.touches[0].clientY;else try{g=t.clientX,j=t.clientY}catch(Ze){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;a&&le(t);var q=e.display,ie=q.lineDiv.getBoundingClientRect();if(j>ie.bottom||!ye(e,o))return ve(t);j-=ie.top-q.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var ue=q.gutters.childNodes[oe];if(ue&&ue.getBoundingClientRect().right>=g){var Ae=Ge(e.doc,j),Ne=e.display.gutterSpecs[oe];return Fe(e,o,e,Ae,Ne.className,t),ve(t)}}}function ko(e,t){return Bs(e,t,"gutterClick",!0)}function Ws(e,t){if(Un(e.display,t)||Yl(e,t))return;if(Je(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Yl(e,t){return ye(e,"gutterContextMenu")?Bs(e,t,"gutterContextMenu",!1):!1}function Hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qt(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Ks={},ho={};function $l(e){var t=e.optionHandlers;function o(a,g,j,q){e.defaults[a]=g,j&&(t[a]=q?function(ie,oe,ue){ue!=Ra&&j(ie,oe,ue)}:j)}e.defineOption=o,e.Init=Ra,o("value","",function(a,g){return a.setValue(g)},!0),o("mode",null,function(a,g){a.doc.modeOption=g,Co(a)},!0),o("indentUnit",2,Co,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(a){ja(a),qt(a),Pi(a)},!0),o("lineSeparator",null,function(a,g){if(a.doc.lineSep=g,!g)return;var j=[],q=a.doc.first;a.doc.iter(function(oe){for(var ue=0;;){var Ae=oe.text.indexOf(g,ue);if(Ae==-1)break;ue=Ae+g.length,j.push(Xe(q,Ae))}q++});for(var ie=j.length-1;ie>=0;ie--)Ta(a.doc,g,j[ie],Xe(j[ie].line,j[ie].ch+g.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(a,g,j){a.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),j!=Ra&&a.refresh()}),o("specialCharPlaceholder",un,function(a){return a.refresh()},!0),o("electricChars",!0),o("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(a,g){return a.getInputField().spellcheck=g},!0),o("autocorrect",!1,function(a,g){return a.getInputField().autocorrect=g},!0),o("autocapitalize",!1,function(a,g){return a.getInputField().autocapitalize=g},!0),o("rtlMoveVisually",!w),o("wholeLineUpdateBefore",!0),o("theme","default",function(a){Hs(a),Fa(a)},!0),o("keyMap","default",function(a,g,j){var q=uo(g),ie=j!=Ra&&uo(j);ie&&ie.detach&&ie.detach(a,q),q.attach&&q.attach(a,ie||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Jl,!0),o("gutters",[],function(a,g){a.display.gutterSpecs=So(g,a.options.lineNumbers),Fa(a)},!0),o("fixedGutter",!0,function(a,g){a.display.gutters.style.left=g?Vn(a.display)+"px":"0",a.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(a){return ba(a)},!0),o("scrollbarStyle","native",function(a){zo(a),ba(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),o("lineNumbers",!1,function(a,g){a.display.gutterSpecs=So(a.options.gutters,g),Fa(a)},!0),o("firstLineNumber",1,Fa,!0),o("lineNumberFormatter",function(a){return a},Fa,!0),o("showCursorWhenSelecting",!1,In,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(a,g){g=="nocursor"&&(Ir(a),a.display.input.blur()),a.display.input.readOnlyChanged(g)}),o("screenReaderLabel",null,function(a,g){g=g===""?null:g,a.display.input.screenReaderLabelChanged(g)}),o("disableInput",!1,function(a,g){g||a.display.input.reset()},!0),o("dragDrop",!0,Ql),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,In,!0),o("singleCursorHeightPerLine",!0,In,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,ja,!0),o("addModeClass",!1,ja,!0),o("pollInterval",100),o("undoDepth",200,function(a,g){return a.doc.history.undoDepth=g}),o("historyEventDelay",1250),o("viewportMargin",10,function(a){return a.refresh()},!0),o("maxHighlightLength",1e4,ja,!0),o("moveInputWithCursor",!0,function(a,g){g||a.display.input.resetPosition()}),o("tabindex",null,function(a,g){return a.display.input.getField().tabIndex=g||""}),o("autofocus",null),o("direction","ltr",function(a,g){return a.doc.setDirection(g)},!0),o("phrases",null)}function Ql(e,t,o){var a=o&&o!=Ra;if(!t!=!a){var g=e.display.dragFunctions,j=t?Pe:rt;j(e.display.scroller,"dragstart",g.start),j(e.display.scroller,"dragenter",g.enter),j(e.display.scroller,"dragover",g.over),j(e.display.scroller,"dragleave",g.leave),j(e.display.scroller,"drop",g.drop)}}function Jl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),$r(e)),Br(e),Pi(e),qt(e),setTimeout(function(){return ba(e)},100)}function Ii(e,t){var o=this;if(!(this instanceof Ii))return new Ii(e,t);this.options=t=t?A(t):{},A(Ks,t,!1);var a=t.value;typeof a=="string"?a=new br(a,t.mode,null,t.lineSeparator,t.direction):t.mode&&(a.modeOption=t.mode),this.doc=a;var g=new Ii.inputStyles[t.inputStyle](this),j=this.display=new dl(e,a,g,t);j.wrapper.CodeMirror=this,Hs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zo(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&&!r&&j.input.focus(),B&&M<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,ts(this,a),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&Wr(o)},20):Ir(this);for(var q in ho)ho.hasOwnProperty(q)&&ho[q](this,t[q],Ra);Yo(this),t.finishInit&&t.finishInit(this);for(var ie=0;ie<No.length;++ie)No[ie](this);pa(this),L&&t.lineWrapping&&getComputedStyle(j.lineDiv).textRendering=="optimizelegibility"&&(j.lineDiv.style.textRendering="auto")}Ii.defaults=Ks,Ii.optionHandlers=ho;function Zl(e){var t=e.display;Pe(t.scroller,"mousedown",er(e,Fs)),B&&M<11?Pe(t.scroller,"dblclick",er(e,function(oe){if(Je(e,oe))return;var ue=$i(e,oe);if(!ue||ko(e,oe)||Un(e.display,oe))return;le(oe);var Ae=e.findWordAt(ue);ro(e.doc,Ae.anchor,Ae.head)})):Pe(t.scroller,"dblclick",function(oe){return Je(e,oe)||le(oe)}),Pe(t.scroller,"contextmenu",function(oe){return Ws(e,oe)}),Pe(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||Ws(e,oe)});var o,a={end:0};function g(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),a=t.activeTouch,a.end=+new Date)}function j(oe){if(oe.touches.length!=1)return!1;var ue=oe.touches[0];return ue.radiusX<=1&&ue.radiusY<=1}function q(oe,ue){if(ue.left==null)return!0;var Ae=ue.left-oe.left,Ne=ue.top-oe.top;return Ae*Ae+Ne*Ne>20*20}Pe(t.scroller,"touchstart",function(oe){if(!Je(e,oe)&&!j(oe)&&!ko(e,oe)){t.input.ensurePolled(),clearTimeout(o);var ue=+new Date;t.activeTouch={start:ue,moved:!1,prev:ue-a.end<=300?a:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),Pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Pe(t.scroller,"touchend",function(oe){var ue=t.activeTouch;if(ue&&!Un(t,oe)&&ue.left!=null&&!ue.moved&&new Date-ue.start<300){var Ae=e.coordsChar(t.activeTouch,"page"),Ne;!ue.prev||q(ue,ue.prev)?Ne=new pi(Ae,Ae):!ue.prev.prev||q(ue,ue.prev.prev)?Ne=e.findWordAt(Ae):Ne=new pi(Xe(Ae.line,0),C(e.doc,Xe(Ae.line+1,0))),e.setSelection(Ne.anchor,Ne.head),e.focus(),le(oe)}g()}),Pe(t.scroller,"touchcancel",g),Pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ma(e,t.scroller.scrollTop),ca(e,t.scroller.scrollLeft,!0),Fe(e,"scroll",e))}),Pe(t.scroller,"mousewheel",function(oe){return Jo(e,oe)}),Pe(t.scroller,"DOMMouseScroll",function(oe){return Jo(e,oe)}),Pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){Je(e,oe)||pe(oe)},over:function(oe){Je(e,oe)||(Rl(e,oe),pe(oe))},start:function(oe){return Ol(e,oe)},drop:er(e,wl),leave:function(oe){Je(e,oe)||Cs(e)}};var ie=t.input.getField();Pe(ie,"keyup",function(oe){return Ns.call(e,oe)}),Pe(ie,"keydown",er(e,ks)),Pe(ie,"keypress",er(e,Us)),Pe(ie,"focus",function(oe){return Wr(e,oe)}),Pe(ie,"blur",function(oe){return Ir(e,oe)})}var No=[];Ii.defineInitHook=function(e){return No.push(e)};function Za(e,t,o,a){var g=e.doc,j;o==null&&(o="add"),o=="smart"&&(g.mode.indent?j=St(e,t).state:o="prev");var q=e.options.tabSize,ie=G(g,t),oe=z(ie.text,null,q);ie.stateAfter&&(ie.stateAfter=null);var ue=ie.text.match(/^\s*/)[0],Ae;if(!a&&!/\S/.test(ie.text))Ae=0,o="not";else if(o=="smart"&&(Ae=g.mode.indent(j,ie.text.slice(ue.length),ie.text),Ae==xe||Ae>150)){if(!a)return;o="prev"}o=="prev"?t>g.first?Ae=z(G(g,t-1).text,null,q):Ae=0:o=="add"?Ae=oe+e.options.indentUnit:o=="subtract"?Ae=oe-e.options.indentUnit:typeof o=="number"&&(Ae=oe+o),Ae=Math.max(0,Ae);var Ne="",Ze=0;if(e.options.indentWithTabs)for(var Ve=Math.floor(Ae/q);Ve;--Ve)Ze+=q,Ne+=" ";if(Ze<Ae&&(Ne+=ge(Ae-Ze)),Ne!=ue)return Ta(g,Ne,Xe(t,0),Xe(t,ue.length),"+input"),ie.stateAfter=null,!0;for(var Et=0;Et<g.sel.ranges.length;Et++){var Ut=g.sel.ranges[Et];if(Ut.head.line==t&&Ut.head.ch<ue.length){var Ht=Xe(t,ue.length);Ao(g,Et,new pi(Ht,Ht));break}}}var Vr=null;function fo(e){Vr=e}function Uo(e,t,o,a,g){var j=e.doc;e.display.shift=!1,a||(a=j.sel);var q=+new Date-200,ie=g=="paste"||e.state.pasteIncoming>q,oe=Qe(t),ue=null;if(ie&&a.ranges.length>1)if(Vr&&Vr.text.join(`
`)==t){if(a.ranges.length%Vr.text.length==0){ue=[];for(var Ae=0;Ae<Vr.text.length;Ae++)ue.push(j.splitLines(Vr.text[Ae]))}}else oe.length==a.ranges.length&&e.options.pasteLinesPerSelection&&(ue=ct(oe,function(Jt){return[Jt]}));for(var Ne=e.curOp.updateInput,Ze=a.ranges.length-1;Ze>=0;Ze--){var Ve=a.ranges[Ze],Et=Ve.from(),Ut=Ve.to();Ve.empty()&&(o&&o>0?Et=Xe(Et.line,Et.ch-o):e.state.overwrite&&!ie?Ut=Xe(Ut.line,Math.min(G(j,Ut.line).text.length,Ut.ch+He(oe).length)):ie&&Vr&&Vr.lineWise&&Vr.text.join(`
`)==oe.join(`
`)&&(Et=Ut=Xe(Et.line,0)));var Ht={from:Et,to:Ut,text:ue?ue[Ze%ue.length]:oe,origin:g||(ie?"paste":e.state.cutIncoming>q?"cut":"+input")};Sa(e.doc,Ht),nt(e,"inputRead",e,Ht)}t&&!ie&&zs(e,t),ya(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Pr(t,function(){return Uo(t,o,0,null,"paste")}),!0}function zs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,a=o.ranges.length-1;a>=0;a--){var g=o.ranges[a];if(g.head.ch>100||a&&o.ranges[a-1].head.line==g.head.line)continue;var j=e.getModeAt(g.head),q=!1;if(j.electricChars){for(var ie=0;ie<j.electricChars.length;ie++)if(t.indexOf(j.electricChars.charAt(ie))>-1){q=Za(e,g.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(G(e.doc,g.head.line).text.slice(0,g.head.ch))&&(q=Za(e,g.head.line,"smart")));q&&nt(e,"electricInput",e,g.head.line)}}function Vs(e){for(var t=[],o=[],a=0;a<e.doc.sel.ranges.length;a++){var g=e.doc.sel.ranges[a].head.line,j={anchor:Xe(g,0),head:Xe(g+1,0)};o.push(j),t.push(e.getRange(j.anchor,j.head))}return{text:t,ranges:o}}function Xs(e,t,o,a){e.setAttribute("autocorrect",o?"":"off"),e.setAttribute("autocapitalize",a?"":"off"),e.setAttribute("spellcheck",!!t)}function Ys(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return L?e.style.width="1000px":e.setAttribute("wrap","off"),l&&(e.style.border="1px solid black"),Xs(e),t}function ql(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,g){var j=this.options,q=j[a];if(j[a]==g&&a!="mode")return;j[a]=g,t.hasOwnProperty(a)&&er(this,t[a])(this,g,q),Fe(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,g){this.state.keyMaps[g?"push":"unshift"](uo(a))},removeKeyMap:function(a){for(var g=this.state.keyMaps,j=0;j<g.length;++j)if(g[j]==a||g[j].name==a)return g.splice(j,1),!0},addOverlay:pr(function(a,g){var j=a.token?a:e.getMode(this.options,a);if(j.startState)throw new Error("Overlays may not be stateful.");vt(this.state.overlays,{mode:j,modeSpec:a,opaque:g&&g.opaque,priority:g&&g.priority||0},function(q){return q.priority}),this.state.modeGen++,Pi(this)}),removeOverlay:pr(function(a){for(var g=this.state.overlays,j=0;j<g.length;++j){var q=g[j].modeSpec;if(q==a||typeof a=="string"&&q.name==a){g.splice(j,1),this.state.modeGen++,Pi(this);return}}}),indentLine:pr(function(a,g,j){typeof g!="string"&&typeof g!="number"&&(g==null?g=this.options.smartIndent?"smart":"prev":g=g?"add":"subtract"),Ot(this.doc,a)&&Za(this,a,g,j)}),indentSelection:pr(function(a){for(var g=this.doc.sel.ranges,j=-1,q=0;q<g.length;q++){var ie=g[q];if(ie.empty())ie.head.line>j&&(Za(this,ie.head.line,a,!0),j=ie.head.line,q==this.doc.sel.primIndex&&ya(this));else{var oe=ie.from(),ue=ie.to(),Ae=Math.max(j,oe.line);j=Math.min(this.lastLine(),ue.line-(ue.ch?0:1))+1;for(var Ne=Ae;Ne<j;++Ne)Za(this,Ne,a);var Ze=this.doc.sel.ranges;oe.ch==0&&g.length==Ze.length&&Ze[q].from().ch>0&&Ao(this.doc,q,new pi(oe,Ze[q].to()),Te)}}}),getTokenAt:function(a,g){return Wn(this,a,g)},getLineTokens:function(a,g){return Wn(this,Xe(a),g,!0)},getTokenTypeAt:function(a){a=C(this.doc,a);var g=ut(this,G(this.doc,a.line)),j=0,q=(g.length-1)/2,ie=a.ch,oe;if(ie==0)oe=g[2];else for(;;){var ue=j+q>>1;if((ue?g[ue*2-1]:0)>=ie)q=ue;else if(g[ue*2+1]<ie)j=ue+1;else{oe=g[ue*2+2];break}}var Ae=oe?oe.indexOf("overlay "):-1;return Ae<0?oe:Ae==0?null:oe.slice(0,Ae-1)},getModeAt:function(a){var g=this.doc.mode;return g.innerMode?e.innerMode(g,this.getTokenAt(a).state).mode:g},getHelper:function(a,g){return this.getHelpers(a,g)[0]},getHelpers:function(a,g){var j=[];if(!o.hasOwnProperty(g))return j;var q=o[g],ie=this.getModeAt(a);if(typeof ie[g]=="string")q[ie[g]]&&j.push(q[ie[g]]);else if(ie[g])for(var oe=0;oe<ie[g].length;oe++){var ue=q[ie[g][oe]];ue&&j.push(ue)}else ie.helperType&&q[ie.helperType]?j.push(q[ie.helperType]):q[ie.name]&&j.push(q[ie.name]);for(var Ae=0;Ae<q._global.length;Ae++){var Ne=q._global[Ae];Ne.pred(ie,this)&&ae(j,Ne.val)==-1&&j.push(Ne.val)}return j},getStateAfter:function(a,g){var j=this.doc;return a=$(j,a==null?j.first+j.size-1:a),St(this,a+1,g).state},cursorCoords:function(a,g){var j,q=this.doc.sel.primary();return a==null?j=q.head:typeof a=="object"?j=C(this.doc,a):j=a?q.from():q.to(),li(this,j,g||"page")},charCoords:function(a,g){return Or(this,C(this.doc,a),g||"page")},coordsChar:function(a,g){return a=Hi(this,a,g||"page"),Kr(this,a.left,a.top)},lineAtHeight:function(a,g){return a=Hi(this,{top:a,left:0},g||"page").top,Ge(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,g,j){var q=!1,ie;if(typeof a=="number"){var oe=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>oe&&(a=oe,q=!0),ie=G(this.doc,a)}else ie=a;return qi(this,ie,{top:0,left:0},g||"page",j||q).top+(q?this.doc.height-vr(ie):0)},defaultTextHeight:function(){return zn(this.display)},defaultCharWidth:function(){return Yn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,g,j,q,ie){var oe=this.display;a=li(this,C(this.doc,a));var ue=a.bottom,Ae=a.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),oe.sizer.appendChild(g),q=="over")ue=a.top;else if(q=="above"||q=="near"){var Ne=Math.max(oe.wrapper.clientHeight,this.doc.height),Ze=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(q=="above"||a.bottom+g.offsetHeight>Ne)&&a.top>g.offsetHeight?ue=a.top-g.offsetHeight:a.bottom+g.offsetHeight<=Ne&&(ue=a.bottom),Ae+g.offsetWidth>Ze&&(Ae=Ze-g.offsetWidth)}g.style.top=ue+"px",g.style.left=g.style.right="",ie=="right"?(Ae=oe.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(ie=="left"?Ae=0:ie=="middle"&&(Ae=(oe.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Ae+"px"),j&&Qi(this,{left:Ae,top:ue,right:Ae+g.offsetWidth,bottom:ue+g.offsetHeight})},triggerOnKeyDown:pr(ks),triggerOnKeyPress:pr(Us),triggerOnKeyUp:Ns,triggerOnMouseDown:pr(Fs),execCommand:function(a){if(Ya.hasOwnProperty(a))return Ya[a].call(null,this)},triggerElectric:pr(function(a){zs(this,a)}),findPosH:function(a,g,j,q){var ie=1;g<0&&(ie=-1,g=-g);for(var oe=C(this.doc,a),ue=0;ue<g&&!(oe=Fo(this.doc,oe,ie,j,q),oe.hitSide);++ue);return oe},moveH:pr(function(a,g){var j=this;this.extendSelectionsBy(function(q){return j.display.shift||j.doc.extend||q.empty()?Fo(j.doc,q.head,a,g,j.options.rtlMoveVisually):a<0?q.from():q.to()},Ue)}),deleteH:pr(function(a,g){var j=this.doc.sel,q=this.doc;j.somethingSelected()?q.replaceSelection("",null,"+delete"):Oa(this,function(ie){var oe=Fo(q,ie.head,a,g,!1);return a<0?{from:oe,to:ie.head}:{from:ie.head,to:oe}})}),findPosV:function(a,g,j,q){var ie=1,oe=q;g<0&&(ie=-1,g=-g);for(var ue=C(this.doc,a),Ae=0;Ae<g;++Ae){var Ne=li(this,ue,"div");if(oe==null?oe=Ne.left:Ne.left=oe,ue=$s(this,Ne,ie,j),ue.hitSide)break}return ue},moveV:pr(function(a,g){var j=this,q=this.doc,ie=[],oe=!this.display.shift&&!q.extend&&q.sel.somethingSelected();if(q.extendSelectionsBy(function(Ae){if(oe)return a<0?Ae.from():Ae.to();var Ne=li(j,Ae.head,"div");Ae.goalColumn!=null&&(Ne.left=Ae.goalColumn),ie.push(Ne.left);var Ze=$s(j,Ne,a,g);return g=="page"&&Ae==q.sel.primary()&&_o(j,Or(j,Ze,"div").top-Ne.top),Ze},Ue),ie.length)for(var ue=0;ue<q.sel.ranges.length;ue++)q.sel.ranges[ue].goalColumn=ie[ue]}),findWordAt:function(a){var g=this.doc,j=G(g,a.line).text,q=a.ch,ie=a.ch;if(j){var oe=this.getHelper(a,"wordChars");(a.sticky=="before"||ie==j.length)&&q?--q:++ie;for(var ue=j.charAt(q),Ae=xt(ue,oe)?function(Ne){return xt(Ne,oe)}:/\s/.test(ue)?function(Ne){return/\s/.test(Ne)}:function(Ne){return!/\s/.test(Ne)&&!xt(Ne)};q>0&&Ae(j.charAt(q-1));)--q;for(;ie<j.length&&Ae(j.charAt(ie));)++ie}return new pi(Xe(a.line,q),Xe(a.line,ie))},toggleOverwrite:function(a){if(a!=null&&a==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),Fe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:pr(function(a,g){Pa(this,a,g)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-kn(this)-this.display.barHeight,width:a.scrollWidth-kn(this)-this.display.barWidth,clientHeight:Gn(this),clientWidth:ei(this)}},scrollIntoView:pr(function(a,g){a==null?(a={from:this.doc.sel.primary().head,to:null},g==null&&(g=this.options.cursorScrollMargin)):typeof a=="number"?a={from:Xe(a,0),to:null}:a.from==null&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=g||0,a.from.line!=null?Js(this,a):Wo(this,a.from,a.to,a.margin)}),setSize:pr(function(a,g){var j=this,q=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};a!=null&&(this.display.wrapper.style.width=q(a)),g!=null&&(this.display.wrapper.style.height=q(g)),this.options.lineWrapping&&Wt(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(oe){if(oe.widgets){for(var ue=0;ue<oe.widgets.length;ue++)if(oe.widgets[ue].noHScroll){or(j,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,Fe(this,"refresh",this)}),operation:function(a){return Pr(this,a)},startOperation:function(){return fa(this)},endOperation:function(){return pa(this)},refresh:pr(function(){var a=this.display.cachedTextHeight;Pi(this),this.curOp.forceUpdate=!0,qt(this),Pa(this,this.doc.scrollLeft,this.doc.scrollTop),Eo(this.display),(a==null||Math.abs(a-zn(this.display))>.5||this.options.lineWrapping)&&Br(this),Fe(this,"refresh",this)}),swapDoc:pr(function(a){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),ts(this,a),qt(this),this.display.input.reset(),Pa(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,nt(this,"swapDoc",this,g),g}),phrase:function(a){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,a)?g[a]:a},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}},_e(e),e.registerHelper=function(a,g,j){o.hasOwnProperty(a)||(o[a]=e[a]={_global:[]}),o[a][g]=j},e.registerGlobalHelper=function(a,g,j,q){e.registerHelper(a,g,q),o[a]._global.push({pred:j,val:q})}}function Fo(e,t,o,a,g){var j=t,q=o,ie=G(e,t.line),oe=g&&e.direction=="rtl"?-o:o;function ue(){var rn=t.line+oe;return rn<e.first||rn>=e.first+e.size?!1:(t=new Xe(rn,t.ch,t.sticky),ie=G(e,rn))}function Ae(rn){var Zt;if(a=="codepoint"){var dn=ie.text.charCodeAt(t.ch+(a>0?0:-1));isNaN(dn)?Zt=null:Zt=new Xe(t.line,Math.max(0,Math.min(ie.text.length,t.ch+o*(dn>=55296&&dn<56320?2:1))),-o)}else g?Zt=Ml(e.cm,ie,t,o):Zt=Io(ie,t,o);if(Zt==null)if(!rn&&ue())t=Do(g,e.cm,ie,t.line,oe);else return!1;else t=Zt;return!0}if(a=="char"||a=="codepoint")Ae();else if(a=="column")Ae(!0);else if(a=="word"||a=="group")for(var Ne=null,Ze=a=="group",Ve=e.cm&&e.cm.getHelper(t,"wordChars"),Et=!0;!(o<0&&!Ae(!Et));Et=!1){var Ut=ie.text.charAt(t.ch)||`
`,Ht=xt(Ut,Ve)?"w":Ze&&Ut==`
`?"n":!Ze||/\s/.test(Ut)?null:"p";if(Ze&&!Et&&!Ht&&(Ht="s"),Ne&&Ne!=Ht){o<0&&(o=1,Ae(),t.sticky="after");break}if(Ht&&(Ne=Ht),o>0&&!Ae(!Et))break}var Jt=oo(e,t,j,q,!0);return an(j,Jt)&&(Jt.hitSide=!0),Jt}function $s(e,t,o,a){var g=e.doc,j=t.left,q;if(a=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ie-.5*zn(e.display),3);q=(o>0?t.bottom:t.top)+o*oe}else a=="line"&&(q=o>0?t.bottom+3:t.top-3);for(var ue;!(ue=Kr(e,j,q),!ue.outside);){if(o<0?q<=0:q>=g.height){ue.hitSide=!0;break}q+=o*5}return ue}var xi=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};xi.prototype.init=function(e){var t=this,o=this,a=o.cm,g=o.div=e.lineDiv;Xs(g,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize);function j(ie){for(var oe=ie.target;oe;oe=oe.parentNode){if(oe==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Pe(g,"paste",function(ie){if(!j(ie)||Je(a,ie)||Gs(ie,a))return;M<=11&&setTimeout(er(a,function(){return t.updateFromDOM()}),20)}),Pe(g,"compositionstart",function(ie){t.composing={data:ie.data,done:!1}}),Pe(g,"compositionupdate",function(ie){t.composing||(t.composing={data:ie.data,done:!1})}),Pe(g,"compositionend",function(ie){t.composing&&(ie.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Pe(g,"touchstart",function(){return o.forceCompositionEnd()}),Pe(g,"input",function(){t.composing||t.readFromDOMSoon()});function q(ie){if(!j(ie)||Je(a,ie))return;if(a.somethingSelected())fo({lineWise:!1,text:a.getSelections()}),ie.type=="cut"&&a.replaceSelection("",null,"cut");else if(a.options.lineWiseCopyCut){var oe=Vs(a);fo({lineWise:!0,text:oe.text}),ie.type=="cut"&&a.operation(function(){a.setSelections(oe.ranges,0,Te),a.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var ue=Vr.text.join(`
`);if(ie.clipboardData.setData("Text",ue),ie.clipboardData.getData("Text")==ue){ie.preventDefault();return}}var Ae=Ys(),Ne=Ae.firstChild;a.display.lineSpace.insertBefore(Ae,a.display.lineSpace.firstChild),Ne.value=Vr.text.join(`
`);var Ze=document.activeElement;Z(Ne),setTimeout(function(){a.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==g&&o.showPrimarySelection()},50)}Pe(g,"copy",q),Pe(g,"cut",q)},xi.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},xi.prototype.prepareSelection=function(){var e=Ei(this.cm,!1);return e.focus=document.activeElement==this.div,e},xi.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},xi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xi.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),a=o.from(),g=o.to();if(t.display.viewTo==t.display.viewFrom||a.line>=t.display.viewTo||g.line<t.display.viewFrom){e.removeAllRanges();return}var j=po(t,e.anchorNode,e.anchorOffset),q=po(t,e.focusNode,e.focusOffset);if(j&&!j.bad&&q&&!q.bad&&It(nn(j,q),a)==0&&It(pn(j,q),g)==0)return;var ie=t.display.view,oe=a.line>=t.display.viewFrom&&Qs(t,a)||{node:ie[0].measure.map[2],offset:0},ue=g.line<t.display.viewTo&&Qs(t,g);if(!ue){var Ae=ie[ie.length-1].measure,Ne=Ae.maps?Ae.maps[Ae.maps.length-1]:Ae.map;ue={node:Ne[Ne.length-1],offset:Ne[Ne.length-2]-Ne[Ne.length-3]}}if(!oe||!ue){e.removeAllRanges();return}var Ze=e.rangeCount&&e.getRangeAt(0),Ve;try{Ve=y(oe.node,oe.offset,ue.offset,ue.node)}catch(Et){}Ve&&(!P&&t.state.focused?(e.collapse(oe.node,oe.offset),Ve.collapsed||(e.removeAllRanges(),e.addRange(Ve))):(e.removeAllRanges(),e.addRange(Ve)),Ze&&e.anchorNode==null?e.addRange(Ze):P&&this.startGracePeriod()),this.rememberSelection()},xi.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},xi.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},xi.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},xi.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},xi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},xi.prototype.blur=function(){this.div.blur()},xi.prototype.getField=function(){return this.div},xi.prototype.supportsTouch=function(){return!0},xi.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Pr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},xi.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},xi.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(i&&p&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var o=po(t,e.anchorNode,e.anchorOffset),a=po(t,e.focusNode,e.focusOffset);o&&a&&Pr(t,function(){ur(t.doc,ra(o,a),Te),(o.bad||a.bad)&&(t.curOp.selectionChanged=!0)})},xi.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),a=o.from(),g=o.to();if(a.ch==0&&a.line>e.firstLine()&&(a=Xe(a.line-1,G(e.doc,a.line-1).length)),g.ch==G(e.doc,g.line).text.length&&g.line<e.lastLine()&&(g=Xe(g.line+1,0)),a.line<t.viewFrom||g.line>t.viewTo-1)return!1;var j,q,ie;a.line==t.viewFrom||(j=Lr(e,a.line))==0?(q=Le(t.view[0].line),ie=t.view[0].node):(q=Le(t.view[j].line),ie=t.view[j-1].node.nextSibling);var oe=Lr(e,g.line),ue,Ae;if(oe==t.view.length-1?(ue=t.viewTo-1,Ae=t.lineDiv.lastChild):(ue=Le(t.view[oe+1].line)-1,Ae=t.view[oe+1].node.previousSibling),!ie)return!1;for(var Ne=e.doc.splitLines(tu(e,ie,Ae,q,ue)),Ze=Q(e.doc,Xe(q,0),Xe(ue,G(e.doc,ue).text.length));Ne.length>1&&Ze.length>1;)if(He(Ne)==He(Ze))Ne.pop(),Ze.pop(),ue--;else if(Ne[0]==Ze[0])Ne.shift(),Ze.shift(),q++;else break;for(var Ve=0,Et=0,Ut=Ne[0],Ht=Ze[0],Jt=Math.min(Ut.length,Ht.length);Ve<Jt&&Ut.charCodeAt(Ve)==Ht.charCodeAt(Ve);)++Ve;for(var rn=He(Ne),Zt=He(Ze),dn=Math.min(rn.length-(Ne.length==1?Ve:0),Zt.length-(Ze.length==1?Ve:0));Et<dn&&rn.charCodeAt(rn.length-Et-1)==Zt.charCodeAt(Zt.length-Et-1);)++Et;if(Ne.length==1&&Ze.length==1&&q==a.line)for(;Ve&&Ve>a.ch&&rn.charCodeAt(rn.length-Et-1)==Zt.charCodeAt(Zt.length-Et-1);)Ve--,Et++;Ne[Ne.length-1]=rn.slice(0,rn.length-Et).replace(/^\u200b+/,""),Ne[0]=Ne[0].slice(Ve).replace(/\u200b+$/,"");var An=Xe(q,Ve),En=Xe(ue,Ze.length?He(Ze).length-Et:0);if(Ne.length>1||Ne[0]||It(An,En))return Ta(e.doc,Ne,An,En,"+input"),!0},xi.prototype.ensurePolled=function(){this.forceCompositionEnd()},xi.prototype.reset=function(){this.forceCompositionEnd()},xi.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},xi.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)},xi.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Pi(e.cm)})},xi.prototype.setUneditable=function(e){e.contentEditable="false"},xi.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Uo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},xi.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},xi.prototype.onContextMenu=function(){},xi.prototype.resetPosition=function(){},xi.prototype.needsContentAttribute=!0;function Qs(e,t){var o=ui(e,t.line);if(!o||o.hidden)return null;var a=G(e.doc,t.line),g=Tn(o,a,t.line),j=jt(a,e.doc.direction),q="left";if(j){var ie=bt(j,t.ch);q=ie%2?"right":"left"}var oe=Rn(g.map,t.ch,q);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,a,g){var j="",q=!1,ie=e.doc.lineSeparator(),oe=!1;function ue(Ve){return function(Et){return Et.id==Ve}}function Ae(){q&&(j+=ie,oe&&(j+=ie),q=oe=!1)}function Ne(Ve){Ve&&(Ae(),j+=Ve)}function Ze(Ve){if(Ve.nodeType==1){var Et=Ve.getAttribute("cm-text");if(Et){Ne(Et);return}var Ut=Ve.getAttribute("cm-marker"),Ht;if(Ut){var Jt=e.findMarks(Xe(a,0),Xe(g+1,0),ue(+Ut));Jt.length&&(Ht=Jt[0].find(0))&&Ne(Q(e.doc,Ht.from,Ht.to).join(ie));return}if(Ve.getAttribute("contenteditable")=="false")return;var rn=/^(pre|div|p|li|table|br)$/i.test(Ve.nodeName);if(!/^br$/i.test(Ve.nodeName)&&Ve.textContent.length==0)return;rn&&Ae();for(var Zt=0;Zt<Ve.childNodes.length;Zt++)Ze(Ve.childNodes[Zt]);/^(pre|p)$/i.test(Ve.nodeName)&&(oe=!0),rn&&(q=!0)}else Ve.nodeType==3&&Ne(Ve.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ze(t),t==o);)t=t.nextSibling,oe=!1;return j}function po(e,t,o){var a;if(t==e.display.lineDiv){if(a=e.display.lineDiv.childNodes[o],!a)return Aa(e.clipPos(Xe(e.display.viewTo-1)),!0);t=null,o=0}else for(a=t;;a=a.parentNode){if(!a||a==e.display.lineDiv)return null;if(a.parentNode&&a.parentNode==e.display.lineDiv)break}for(var g=0;g<e.display.view.length;g++){var j=e.display.view[g];if(j.node==a)return nu(j,t,o)}}function nu(e,t,o){var a=e.text.firstChild,g=!1;if(!t||!b(a,t))return Aa(Xe(Le(e.line),0),!0);if(t==a&&(g=!0,t=a.childNodes[o],o=0,!t)){var j=e.rest?He(e.rest):e.line;return Aa(Xe(Le(j),j.text.length),g)}var q=t.nodeType==3?t:null,ie=t;for(!q&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(q=t.firstChild,o&&(o=q.nodeValue.length));ie.parentNode!=a;)ie=ie.parentNode;var oe=e.measure,ue=oe.maps;function Ae(Ht,Jt,rn){for(var Zt=-1;Zt<(ue?ue.length:0);Zt++)for(var dn=Zt<0?oe.map:ue[Zt],An=0;An<dn.length;An+=3){var En=dn[An+2];if(En==Ht||En==Jt){var Qn=Le(Zt<0?e.line:e.rest[Zt]),Ci=dn[An]+rn;return(rn<0||En!=Ht)&&(Ci=dn[An+(rn?1:0)]),Xe(Qn,Ci)}}}var Ne=Ae(q,ie,o);if(Ne)return Aa(Ne,g);for(var Ze=ie.nextSibling,Ve=q?q.nodeValue.length-o:0;Ze;Ze=Ze.nextSibling){if(Ne=Ae(Ze,Ze.firstChild,0),Ne)return Aa(Xe(Ne.line,Ne.ch-Ve),g);Ve+=Ze.textContent.length}for(var Et=ie.previousSibling,Ut=o;Et;Et=Et.previousSibling){if(Ne=Ae(Et,Et.firstChild,-1),Ne)return Aa(Xe(Ne.line,Ne.ch+Ut),g);Ut+=Et.textContent.length}}var Bi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Bi.prototype.init=function(e){var t=this,o=this,a=this.cm;this.createField(e);var g=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),l&&(g.style.width="0px"),Pe(g,"input",function(){B&&M>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Pe(g,"paste",function(q){if(Je(a,q)||Gs(q,a))return;a.state.pasteIncoming=+new Date,o.fastPoll()});function j(q){if(Je(a,q))return;if(a.somethingSelected())fo({lineWise:!1,text:a.getSelections()});else if(a.options.lineWiseCopyCut){var ie=Vs(a);fo({lineWise:!0,text:ie.text}),q.type=="cut"?a.setSelections(ie.ranges,null,Te):(o.prevInput="",g.value=ie.text.join(`
`),Z(g))}else return;q.type=="cut"&&(a.state.cutIncoming=+new Date)}Pe(g,"cut",j),Pe(g,"copy",j),Pe(e.scroller,"paste",function(q){if(Un(e,q)||Je(a,q))return;if(!g.dispatchEvent){a.state.pasteIncoming=+new Date,o.focus();return}var ie=new Event("paste");ie.clipboardData=q.clipboardData,g.dispatchEvent(ie)}),Pe(e.lineSpace,"selectstart",function(q){Un(e,q)||le(q)}),Pe(g,"compositionstart",function(){var q=a.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:q,range:a.markText(q,a.getCursor("to"),{className:"CodeMirror-composing"})}}),Pe(g,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},Bi.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},Bi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Bi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,a=Ei(e);if(e.options.moveInputWithCursor){var g=li(e,o.sel.primary().head,"div"),j=t.wrapper.getBoundingClientRect(),q=t.lineDiv.getBoundingClientRect();a.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+q.top-j.top)),a.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+q.left-j.left))}return a},Bi.prototype.showSelection=function(e){var t=this.cm,o=t.display;f(o.cursorDiv,e.cursors),f(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Bi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&Z(this.textarea),B&&M>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",B&&M>=9&&(this.hasSelection=null))},Bi.prototype.getField=function(){return this.textarea},Bi.prototype.supportsTouch=function(){return!1},Bi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Bi.prototype.blur=function(){this.textarea.blur()},Bi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Bi.prototype.receivedFocus=function(){this.slowPoll()},Bi.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()})},Bi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var a=t.poll();!a&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},Bi.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,a=this.prevInput;if(this.contextMenuPending||!t.state.focused||it(o)&&!a&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=o.value;if(g==a&&!t.somethingSelected())return!1;if(B&&M>=9&&this.hasSelection===g||n&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var j=g.charCodeAt(0);if(j==8203&&!a&&(a="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var q=0,ie=Math.min(a.length,g.length);q<ie&&a.charCodeAt(q)==g.charCodeAt(q);)++q;return Pr(t,function(){Uo(t,g.slice(q),a.length-q,null,e.composing?"*compose":null),g.length>1e3||g.indexOf(`
`)>-1?o.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Bi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Bi.prototype.onKeyPress=function(){B&&M>=9&&(this.hasSelection=null),this.fastPoll()},Bi.prototype.onContextMenu=function(e){var t=this,o=t.cm,a=o.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var j=$i(o,e),q=a.scroller.scrollTop;if(!j||m)return;var ie=o.options.resetSelectionOnContextMenu;ie&&o.doc.sel.contains(j)==-1&&er(o,ur)(o.doc,ra(j),Te);var oe=g.style.cssText,ue=t.wrapper.style.cssText,Ae=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ae.top-5)+"px; left: "+(e.clientX-Ae.left-5)+`px;
z-index: 1000; background: `+(B?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ne;L&&(Ne=window.scrollY),a.input.focus(),L&&window.scrollTo(null,Ne),a.input.reset(),o.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=Ve,a.selForContextMenu=o.doc.sel,clearTimeout(a.detectingSelectAll);function Ze(){if(g.selectionStart!=null){var Ut=o.somethingSelected(),Ht="\u200B"+(Ut?g.value:"");g.value="\u21DA",g.value=Ht,t.prevInput=Ut?"":"\u200B",g.selectionStart=1,g.selectionEnd=Ht.length,a.selForContextMenu=o.doc.sel}}function Ve(){if(t.contextMenuPending!=Ve)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ue,g.style.cssText=oe,B&&M<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=q),g.selectionStart!=null){(!B||B&&M<9)&&Ze();var Ut=0,Ht=function(){a.selForContextMenu==o.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?er(o,ps)(o):Ut++<10?a.detectingSelectAll=setTimeout(Ht,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(Ht,200)}}if(B&&M>=9&&Ze(),O){pe(e);var Et=function(){rt(window,"mouseup",Et),setTimeout(Ve,20)};Pe(window,"mouseup",Et)}else setTimeout(Ve,50)},Bi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Bi.prototype.setUneditable=function(){},Bi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?A(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 o=N();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function a(){e.value=ie.getValue()}var g;if(e.form&&(Pe(e.form,"submit",a),!t.leaveSubmitMethodAlone)){var j=e.form;g=j.submit;try{var q=j.submit=function(){a(),j.submit=g,j.submit(),j.submit=q}}catch(oe){}}t.finishInit=function(oe){oe.save=a,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,a(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",a),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var ie=Ii(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ie}function ru(e){e.off=rt,e.on=Pe,e.wheelEventPixels=cl,e.Doc=br,e.splitLines=Qe,e.countColumn=z,e.findColumn=De,e.isWordChar=ht,e.Pass=xe,e.signal=Fe,e.Line=fr,e.changeEnd=aa,e.scrollbarModel=Go,e.Pos=Xe,e.cmpPos=It,e.modes=ot,e.mimeModes=ze,e.resolveMode=ke,e.getMode=qe,e.modeExtensions=Rt,e.extendMode=Pt,e.copyState=$t,e.startState=se,e.innerMode=fe,e.commands=Ya,e.keyMap=qr,e.keyName=Ls,e.isModifierKey=Rs,e.lookupKey=wa,e.normalizeKeyMap=Pl,e.StringStream=U,e.SharedTextMarker=za,e.TextMarker=sa,e.LineWidget=Ga,e.e_preventDefault=le,e.e_stopPropagation=de,e.e_stop=pe,e.addClass=F,e.contains=b,e.rmClass=v,e.keyNames=la}$l(Ii),ql(Ii);var au="iter insert remove copy getEditor constructor".split(" ");for(var mo in br.prototype)br.prototype.hasOwnProperty(mo)&&ae(au,mo)<0&&(Ii.prototype[mo]=function(e){return function(){return e.apply(this.doc,arguments)}}(br.prototype[mo]));return _e(br),Ii.inputStyles={textarea:Bi,contenteditable:xi},Ii.defineMode=function(e){!Ii.defaults.mode&&e!="null"&&(Ii.defaults.mode=e),Lt.apply(this,arguments)},Ii.defineMIME=Dt,Ii.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ii.defineMIME("text/plain","null"),Ii.defineExtension=function(e,t){Ii.prototype[e]=t},Ii.defineDocExtension=function(e,t){br.prototype[e]=t},Ii.fromTextArea=iu,ru(Ii),Ii.version="5.58.2",Ii})},W7jJ:function(Be,we,k){"use strict";k.r(we);var ee=k("0Owb"),V=k("PpiC"),P=k("OaEy"),Y=k("2fM7"),W=k("T2oS"),R=k("W9HT"),B=k("miYZ"),M=k("tsqr"),L=k("2qtc"),I=k("kLXV"),p=k("9og8"),m=k("tJVT"),u=k("k1fw"),h=k("aHsQ"),s=k("sGsY"),l=k("WmNS"),i=k.n(l),r=k("cDcd"),n=k.n(r),d=k("Fvcw"),w=k("GIiI"),T=k("Ty5D"),x=k("9kvl"),O=k("55Ip"),E=k("7qur"),v=k("cDPC"),_=k("m3rI"),f=k("RCxd"),c=k("EHPI"),S=k("J66h"),y=k("uMZB"),b=k.n(y),N=k("sNtx"),F=k("RpDr"),X=k("+L6B"),Z=k("2/Rp"),H=k("y8nQ"),A=k("Vl3Y"),z=k("5NDa"),ne=k("5rEg"),ae=ne.a.TextArea,me=5e3,xe=function(Ye){var pt=Ye.callback,Kt=Ye.onCancel,fn=Ye.notes;function tn(Xt){pt(Xt)}return n.a.createElement(A.a,{className:"note-form-panel",onFinish:tn,initialValues:{notes:fn}},n.a.createElement(A.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:me,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(me)}]},n.a.createElement(ae,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(A.a.Item,{style:{textAlign:"right"}},n.a.createElement(Z.a,{type:"ghost",onClick:Kt,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(Z.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},Te=k("ZsLC"),Oe=k.n(Te),Ue=k("DjyN"),De=k("NUBc"),be=k("g9YV"),ge=k("wCAj"),He=k("Hw79"),ct=k.n(He),vt=k("ye1Q"),_t=k("lfch"),yt=k("bdLU"),et=k("1vsH"),ht=k("wd/R"),xt=k.n(ht),Tt=ge.a.Column,mt=function(Ye){var pt=Ye.submitResult,Kt=Ye.submitting,fn=Ye.submitRecords,tn=Ye.page,Xt=Ye.onPageChange,nt=Ye.topicId,gt=pt||{},cn=gt.status,ft=gt.id,hn=gt.input,Bt=gt.output,vn=gt.expected_output,Kn=gt.is_file,Mn=gt.input_file_url,Sn=gt.output_file_url,ni=gt.expected_output_file_url,Ln=gt.error_msg,Zn=fn||{},qn=Zn.records,bi=Zn.records_count,Un=Object(T.i)();function mi(){Kn?navigator.clipboard.writeText(S.Base64.decode(Ln)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(S.Base64.decode(Bt)).then(function(){M.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(R.a,{spinning:Kt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(vt.a,{style:{fontSize:24},spin:!0})},ft?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ct.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:cn===yt.a.OK?"c-green":"c-red"},F.a[cn])),n.a.createElement("li",{className:ct.a.error},n.a.createElement("a",{onClick:mi},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(_t.a,null)," ")),n.a.createElement("li",null,n.a.createElement(O.a,{to:"/problems/".concat(nt,"/record-detail/").concat(ft,"?backId=").concat(Un==null?void 0:Un.save_identifier)},"\u663E\u793A\u8BE6\u60C5 > "))),cn!==yt.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!Kn&&hn,Kn&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(Mn,hn)}},hn)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(cn===4||cn===5)&&S.Base64.decode(Ln),cn!=4&&cn!=5&&(Kn?n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(Sn,Bt)}},Bt):S.Base64.decode(Bt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!Kn&&S.Base64.decode(vn),Kn&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(et.y)(ni,vn)}},vn))):null):null,(qn==null?void 0:qn.length)>0?n.a.createElement(ge.a,{dataSource:qn,rowKey:"id",pagination:!1},n.a.createElement(Tt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(ai,kn){return n.a.createElement("span",null," ",xt()(ai).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(Tt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(ai,kn){var ei;return n.a.createElement(O.a,{className:ai===0?"c-green":"c-red",to:"/problems/".concat(nt,"/record-detail/").concat(kn.id,"?backId=").concat(Un==null?void 0:Un.save_identifier)},(ei=F.a[ai])===null||ei===void 0?void 0:ei.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(Tt,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),n.a.createElement(Tt,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),n.a.createElement(Tt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,bi>15?n.a.createElement(De.a,{className:ct.a.pagination,current:tn,pageSize:15,total:bi,onChange:Xt}):null)},Ie=k("BdwD"),je=k("DYRE"),$e=k("zeV3"),at=k("+BJd"),lt=k("mr32"),bt=k("TcMa"),Mt=k.n(bt),jt=k("9Bee"),Me={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Pe=function(Ye){var pt=Ye.hack,Kt=Ye.onTriggerPraise,fn=Ye.toDiscuss,tn=pt.language,Xt=pt.difficulty,nt=pt.time_limit,gt=pt.username,cn=pt.user_path,ft=pt.user_praise,hn=pt.comments_count,Bt=pt.praises_count,vn=pt.description,Kn=pt.pass_count,Mn=pt.submit_count,Sn=Object(T.h)();console.log(pt.language,"language");var ni=Me[Xt];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:Mt.a.info},n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(lt.a,{color:ni.color},ni.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,nt,"\u79D2"))),n.a.createElement(jt.a,{value:vn,className:Mt.a.desc}),n.a.createElement("ul",{className:Mt.a["commit-info"]},n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,Kn))),n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,Mn))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),n.a.createElement("li",null,n.a.createElement($e.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:fn})," ",n.a.createElement("b",null,hn))," ")))},tt=k("dhSg"),rt=k("ps8w"),Fe=k.n(rt),Je=k("oBTY"),Ee=k("M8RZ"),ye=k("OkW/"),_e=k("ErOA");function le(Ye){return Object(_e.c)("comments.json",Ye)}function de(Ye){return Object(_e.f)("/discusses/".concat(Ye,"/plus.json"),{container_type:"Discuss",type:1})}function ve(Ye){return Object(_e.f)("comments/reply.json",Ye)}function pe(Ye){return Object(_e.f)("comments.json",Ye)}function Ce(Ye){return Object(_e.f)("comments/".concat(Ye==null?void 0:Ye.id,"/hidden.json"),Ye)}function Ke(Ye){return Object(_e.b)("comments/".concat(Ye==null?void 0:Ye.id,".json"))}var st=k("GgEA"),At=k("AMnG"),Ft=k("xKgJ");function kt(Ye){var pt=Ye.author;return n.a.createElement("a",{href:"/users/".concat(pt.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(_.a.IMG_SERVER,"/images/").concat(pt.image_url),width:"50"}))}function wt(Ye){var pt=Ye.data,Kt=Ye.index,fn=Ye.parentDiscussIndex,tn=Ye.user,Xt=Ye.onSetActionType,nt=pt.author,gt=pt.can_delete,cn=pt.content,ft=pt.id,hn=pt.time;function Bt(){Xt({id:ft,index:Kt,type:"delete-discuss",parentDiscussIndex:fn,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var vn=tn.admin||gt||nt.user_id===tn.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(kt,{author:nt}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(nt.login),target:"_blank"},nt.name),n.a.createElement("span",{className:"grey"},hn),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},vn?n.a.createElement("a",{onClick:Bt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(jt.a,{className:"discuss-content",value:cn})))}var Qe=function(Ye){var pt=Ye.user,Kt=Ye.data,fn=Ye.index,tn=Ye.onPlusDiscuss,Xt=Ye.onSetActionType,nt=Ye.activeDiscussIndex,gt=Ye.onReplyDiscuss,cn=Ye.onSetActiveDiscussIndex,ft=Kt.content,hn=Kt.children,Bt=Kt.hidden,vn=Kt.id,Kn=Kt.praise_count,Mn=Kt.time,Sn=Kt.user_praise,ni=Kt.can_delete,Ln=Kt.author;console.log(ni&&(!hn||hn.length==0),"children22");function Zn(){cn(vn)}function qn(){tn(vn,!Sn,fn)}function bi(){Xt({id:vn,index:fn,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Un(){Xt({id:vn,index:fn,params:{hidden:Bt?"0":"1"},type:"hidden-discuss",message:Bt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var mi=pt.admin||pt.user_id===Ln.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:vn},n.a.createElement(kt,{author:Ln}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Ln.login),target:"_blank"}," ",Ln.name," "),n.a.createElement("span",{className:"grey"},Mn)),n.a.createElement(jt.a,{className:"discuss-content",value:ft}),hn&&hn.length>0?n.a.createElement("div",{className:"reply-discuss-container"},hn.map(function(gi,ai){return n.a.createElement(wt,{key:gi.id,data:gi,index:ai,user:pt,onSetActionType:Xt,parentDiscussIndex:fn})})):null,n.a.createElement("div",{className:"btn-group"},Object(Ft.v)()?n.a.createElement("a",{onClick:Un,title:Bt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Bt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,ni&&(!hn||hn.length==0)?n.a.createElement("a",{onClick:bi,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:Zn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:qn,className:Sn?"c-orange":""},n.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,Kn||""))),n.a.createElement(At.a,{id:vn,activeDiscussIndex:nt,onReplyDiscuss:gt})))},it=k("kaH+"),We=k("Wx9E"),ce=k("Ot1p"),Se=function(Ye){var pt=Ye.user_praise,Kt=Ye.praise_count,fn=Ye.praisePlus,tn=Ye.onCreateDiscuss,Xt=Ye.discuss_count,nt=Object(r.useState)(!1),gt=Object(m.a)(nt,2),cn=gt[0],ft=gt[1],hn=Object(r.useState)(""),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1];function Mn(qn){Kn(qn)}function Sn(){ft(!0)}function ni(){ft(!1)}function Ln(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(p.a)(i.a.mark(function qn(){return i.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:tn(vn),Kn(""),ft(!1);case 3:case"end":return Un.stop()}},qn)})),Zn.apply(this,arguments)}return n.a.createElement("div",{className:"dis-input-editor-container ".concat(cn?"active":""," ")},n.a.createElement("div",{className:cn?"text-area hide":"text-area"},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),n.a.createElement("a",{style:{alignItems:"center"}}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Xt," "),n.a.createElement("a",{className:"c-light-black",onClick:fn,style:{alignItems:"center"},title:pt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(pt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Kt?n.a.createElement("span",null,Kt):"")),cn?n.a.createElement("div",{className:"input-mask",onClick:ni}):null,n.a.createElement("div",{className:cn?"md-container":"md-container hide"},n.a.createElement(ce.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:vn,height:240,onChange:Mn}),n.a.createElement("div",{className:"tip-container",onClick:ni},n.a.createElement("a",{className:"btn-send",onClick:Ln}," \u53D1\u9001 "))))},ot={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ze;(function(Ye){Ye[Ye.GET_DISCUSSES=0]="GET_DISCUSSES",Ye[Ye.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Ye[Ye.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Ye[Ye.PLUS_DISCUSS=3]="PLUS_DISCUSS",Ye[Ye.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Ye[Ye.SET_PAGE=5]="SET_PAGE",Ye[Ye.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(ze||(ze={}));function Lt(Ye,pt){switch(pt.type){case ze.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},Ye),{},{loading:!0});case ze.GET_DISCUSSES:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.TOP_OR_DOWN_DISCUSS:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.SET_ACTION_TYPE:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case ze.SET_PAGE:return Object(u.a)(Object(u.a)({},Ye),{},{page:pt.payload});case ze.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},Ye),pt.payload);default:throw new Error}}var Dt=function(Ye){var pt=Ye.user,Kt=Ye.identifier,fn=Ye.hack,tn=Ye.onTriggerPraise,Xt=Ye.setDiscussTotal,nt=Object(r.useReducer)(Lt,ot),gt=Object(m.a)(nt,2),cn=gt[0],ft=gt[1],hn=cn.loading,Bt=cn.page,vn=cn.data,Kn=cn.count,Mn=cn.actionType,Sn=cn.activeDiscussIndex,ni=Object(r.useCallback)(Object(p.a)(i.a.mark(function Tn(){var si,vi,ui;return i.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return ft({type:ze.SHOW_DISCUSSES_LOADING}),Dn.next=3,le({container_type:"Practice",container_identifier:Kt,limit:10,page:Bt});case 3:si=Dn.sent,vi=si.comments,ui=si.disscuss_count,ft({type:ze.GET_DISCUSSES,payload:{data:vi,count:ui,loading:!1}}),Xt(ui);case 7:case"end":return Dn.stop()}},Tn)})),[Bt,Kt]);Object(r.useEffect)(function(){ni()},[Kt,Bt]);function Ln(Tn){ft({type:ze.SET_PAGE,page:Tn})}function Zn(Tn){ft({type:ze.SET_ACTION_TYPE,payload:{actionType:Tn}})}function qn(Tn){Sn===Tn?ft({type:ze.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):ft({type:ze.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:Tn}})}function bi(Tn,si,vi){return Un.apply(this,arguments)}function Un(){return Un=Object(p.a)(i.a.mark(function Tn(si,vi,ui){var ti;return i.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:return yn.prev=0,yn.next=3,de(si);case 3:ti=yn.sent,vn[ui].user_praise=vi,vn[ui].praise_count=ti.praise_count,ft({type:ze.PLUS_DISCUSS,payload:{data:Object(Je.a)(vn)}}),yn.next=12;break;case 9:yn.prev=9,yn.t0=yn.catch(0),console.log(yn.t0);case 12:case"end":return yn.stop()}},Tn,null,[[0,9]])})),Un.apply(this,arguments)}function mi(){return gi.apply(this,arguments)}function gi(){return gi=Object(p.a)(i.a.mark(function Tn(){var si,vi,ui,ti,Dn;return i.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:if(si=Mn.id,vi=Mn.params,ui=Mn.type,ti=Mn.index,Dn=Mn.parentDiscussIndex,!(ui==="hidden-discuss")){Rn.next=7;break}return console.log(vi,"params"),Rn.next=5,Ce(Object(u.a)({id:si,container_type:"Practice",container_identifier:Kt},vi));case 5:Dn?vn[Dn].children[ti].hidden=vi.hidden==1:vn[ti].hidden=vi.hidden==1,ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Je.a)(vn)}});case 7:if(!(ui==="delete-discuss")){Rn.next=13;break}return Rn.next=10,Ke({id:si,container_type:"Practice",container_identifier:Kt});case 10:return ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null}}),Rn.next=13,ni();case 13:case"end":return Rn.stop()}},Tn)})),gi.apply(this,arguments)}function ai(){ft({type:ze.SET_ACTION_TYPE,payload:{actionType:null}})}function kn(Tn,si){return ei.apply(this,arguments)}function ei(){return ei=Object(p.a)(i.a.mark(function Tn(si,vi){return i.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.prev=0,ti.next=3,ve({container_type:"Practice",container_identifier:Kt,comments:{content:vi,parent_id:si}});case 3:ni(),ti.next=9;break;case 6:ti.prev=6,ti.t0=ti.catch(0),console.log(ti.t0);case 9:case"end":return ti.stop()}},Tn,null,[[0,6]])})),ei.apply(this,arguments)}function Gn(Tn){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(p.a)(i.a.mark(function Tn(si){return i.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:return ft({type:ze.SHOW_DISCUSSES_LOADING}),ui.next=3,pe({comments:{content:si},container_type:"Practice",container_identifier:Kt});case 3:ni();case 4:case"end":return ui.stop()}},Tn)})),Vt.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},vn.length===0?n.a.createElement(Ie.a,null):vn.map(function(Tn,si){return n.a.createElement(Qe,{onReplyDiscuss:kn,onPlusDiscuss:bi,onSetActiveDiscussIndex:qn,onSetActionType:Zn,data:Tn,index:si,user:pt,activeDiscussIndex:Sn})}),Kn>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(De.a,{showQuickJumper:!0,onChange:Ln,current:Bt,total:Kn})):null),n.a.createElement(Se,{user_praise:fn.user_praise,praise_count:fn.praises_count,praisePlus:tn,discuss_count:fn.comments_count,onCreateDiscuss:Gn}),n.a.createElement(Ee.a,null,n.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:!!Mn,onOk:mi,onCancel:ai},n.a.createElement("p",null,Mn?Mn.message:"")),n.a.createElement(it.a,null)))},ke=k("1FX+"),qe=k.n(ke),Rt=k("pYxM"),Pt=k.n(Rt),$t=k("sB/4"),fe=k.n($t),se=k("Wtmd"),U=k.n(se),G=k("CNDd"),Q=k.n(G),te=k("nCk5"),he=k.n(te),Le=k("kovY"),Ge=k.n(Le),Ot=function(pt){var Kt=pt.style,fn=Kt===void 0?{}:Kt,tn=pt.onClick,Xt=pt.onAssist,nt=pt.onHide,gt=pt.data,cn=pt.active,ft=pt.showLine;return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:cn===(gt==null?void 0:gt.id)?"".concat(Pt.a.list," ").concat(Pt.a.active):Pt.a.list,style:fn,onClick:function(){return tn(gt)}},(gt==null?void 0:gt.video)&&n.a.createElement("div",{className:Pt.a.left},n.a.createElement("img",{src:gt==null?void 0:gt.video_cover}),n.a.createElement("div",null,n.a.createElement("img",{src:fe.a}),n.a.createElement("span",null,gt==null?void 0:gt.video_duration)),n.a.createElement("div",{className:Pt.a.mask})),n.a.createElement("div",{className:Pt.a.right},n.a.createElement("div",{className:Pt.a.name},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(gt==null?void 0:gt.image_url),width:30,height:30}),n.a.createElement("div",{title:gt==null?void 0:gt.name,className:Pt.a.title},gt==null?void 0:gt.name),(gt==null?void 0:gt.is_authority)&&n.a.createElement("div",{className:Pt.a.b},"\u5B98\u65B9"),(gt==null?void 0:gt.is_excellent)&&n.a.createElement("div",{className:Pt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:Pt.a.des},n.a.createElement(jt.a,{showLines:2,showTextOnly:!0,value:(gt==null?void 0:gt.content)||"\u6682\u65E0\u5185\u5BB9"})),n.a.createElement("div",{className:Pt.a.tag},n.a.createElement("span",{className:"current",onClick:function(Bt){Bt.stopPropagation(),Xt(gt)}},n.a.createElement("img",{src:gt!=null&&gt.user_liker?Q.a:U.a}),n.a.createElement("span",{style:{color:gt!=null&&gt.user_liker?"#0152d9":"#656f87"}},gt==null?void 0:gt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:he.a}),n.a.createElement("span",null,gt==null?void 0:gt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Ge.a}),n.a.createElement("span",null,gt==null?void 0:gt.viewed_count)),Object(Ft.v)()&&n.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(Bt){Bt.stopPropagation(),nt(gt)}},gt!=null&&gt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),ft&&n.a.createElement("div",{className:Pt.a.line}))},Nt=Ot,Xe=k("5Dmo"),It=k("3S7+"),an=k("Z8dc"),Ct=k.n(an),pn=k("7+5b"),nn=k.n(pn),$=k("twBr"),C=k.n($),D=k("oE5q"),K=k.n(D),re=k("9+Du"),J=function(pt){var Kt,fn=pt.onClose,tn=pt.onOk,Xt=pt.identifier,nt=pt.active,gt=A.a.useForm(),cn=Object(m.a)(gt,1),ft=cn[0],hn=Object(r.useState)({}),Bt=Object(m.a)(hn,2),vn=Bt[0],Kn=Bt[1],Mn=Object(r.useState)(!1),Sn=Object(m.a)(Mn,2),ni=Sn[0],Ln=Sn[1],Zn=Object(r.useState)(!1),qn=Object(m.a)(Zn,2),bi=qn[0],Un=qn[1],mi=Object(r.useState)([]),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(Ft.x)(),Gn=Object(T.i)();Object(r.useEffect)(function(){nt&&Vt()},[nt]);var Vt=function(){var ln=Object(p.a)(i.a.mark(function Wt(){var qt,gn,ci,Li,qi,Hi,Or,li,Rr,Nr,Kr,Ur;return i.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:return yr.next=2,Object(E.k)(Xt,{active:nt});case 2:qt=yr.sent,(qt==null?void 0:qt.status)===0&&(Hi={name:qt==null||((gn=qt.data)===null||gn===void 0)?void 0:gn.name,content:qt==null||((ci=qt.data)===null||ci===void 0)?void 0:ci.content},ft.setFieldsValue(Hi),Kn(Hi),qt!=null&&(Li=qt.data)!==null&&Li!==void 0&&(qi=Li.videos)!==null&&qi!==void 0&&qi[0]&&kn([{video_id:qt==null||((Or=qt.data)===null||Or===void 0||((li=Or.videos)===null||li===void 0||((Rr=li[0])===null||Rr===void 0)))?void 0:Rr.video_id,name:qt==null||((Nr=qt.data)===null||Nr===void 0||((Kr=Nr.videos)===null||Kr===void 0||((Ur=Kr[0])===null||Ur===void 0)))?void 0:Ur.title,loaded:100}]));case 4:case"end":return yr.stop()}},Wt)}));return function(){return ln.apply(this,arguments)}}(),Tn=function(Wt,qt){Kn(Object(u.a)({},qt))},si=function(){var ln=Object(p.a)(i.a.mark(function Wt(qt){var gn,ci,Li,qi,Hi;return i.a.wrap(function(li){for(;;)switch(li.prev=li.next){case 0:if(ci={videos:ai,articles:qt},Un(!0),!nt){li.next=9;break}return ci.active=nt,li.next=6,Object(E.j)(Xt,ci);case 6:Li=li.sent,li.next=12;break;case 9:return li.next=11,Object(E.a)(Xt,ci);case 11:Li=li.sent;case 12:((gn=Li)===null||gn===void 0?void 0:gn.status)===0&&(console.log(nt||((qi=Li)===null||qi===void 0?void 0:qi.id),44),tn(nt||((Hi=Li)===null||Hi===void 0?void 0:Hi.id))),Un(!1);case 14:case"end":return li.stop()}},Wt)}));return function(qt){return ln.apply(this,arguments)}}(),vi=function(Wt){var qt=1024,gn=Wt.name.toLowerCase();return gn&&gn.indexOf(".avi")==-1&&gn.indexOf(".flv")==-1&&gn.indexOf(".f4v")==-1&&gn.indexOf(".m4v")==-1&&gn.indexOf(".mov")==-1&&gn.indexOf(".mp4")==-1&&gn.indexOf(".rmvb")==-1&&gn.indexOf(".swf")==-1&&gn.indexOf(".webm")==-1&&gn.indexOf(".wmv")==-1?(M.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Wt.size>qt*1024*1024?(M.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(qt,"M")),!0):ai!=null&&ai.find(function(ci){return ci.name===Wt.name})?(M.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),!0):!1},ui=function(Wt,qt){I.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",qt?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){kn([])}})},ti={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:vi,onBeginInitFile:function(Wt){Ln(!0),kn([{name:Wt.filename,loaded:0}])},onComplete:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent,video_id:Wt.id}]),Ln(!1)},onError:function(){kn([]),Ln(!1)},onProgress:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent}])},chunkSize:1024*1024*2,options:{user_id:ei==null?void 0:ei.user_id}},Dn=function(){return n.a.createElement(re.a,ti,n.a.createElement("div",{className:Ct.a.main},n.a.createElement("img",{src:nn.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},yn=function(Wt){return n.a.createElement("div",{className:Ct.a.mainLoading},n.a.createElement("div",{className:Ct.a.proWarp},n.a.createElement("div",{className:Ct.a.pro},n.a.createElement("div",{style:{width:Wt}})),n.a.createElement("span",null,Wt||0,"%")),n.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),n.a.createElement("div",{className:Ct.a.tip},n.a.createElement(It.a,{getPopupContainer:function(gn){return gn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:K.a,alt:""}))))},Rn=function(Wt){return n.a.createElement("div",{className:Ct.a.mainSucceed},n.a.createElement("img",{src:C.a,alt:""}),n.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),n.a.createElement("div",{className:Ct.a.tip},n.a.createElement(It.a,{getPopupContainer:function(gn){return gn.parentNode},title:n.a.createElement("div",null,n.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",n.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),n.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),n.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},n.a.createElement("img",{src:K.a,alt:""}))),n.a.createElement("div",{className:Ct.a.del,onClick:function(){return ui(Wt.name,Wt.loaded==100)}},n.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},zt=function(){return n.a.createElement(n.a.Fragment,null,ai==null?void 0:ai.map(function(Wt,qt){return n.a.createElement(n.a.Fragment,{key:qt},Wt.loaded==100?Rn(Wt):yn(Wt.loaded))}))},Qt=function(){I.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:fn})},on=ai==null?void 0:ai.length;return n.a.createElement("div",{className:Ct.a.listForm},n.a.createElement("header",null,nt?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),n.a.createElement("section",{className:Ct.a.scroll,id:"sss"},n.a.createElement("div",{className:Ct.a.formWrap}," ",n.a.createElement(A.a,{form:ft,scrollToFirstError:!0,layout:"vertical",onValuesChange:Tn,onFinish:si},n.a.createElement(A.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},n.a.createElement(ne.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Kt=vn.name)===null||Kt===void 0?void 0:Kt.length)||0,"/60")})),n.a.createElement(A.a.Item,{name:"content",label:"\u5185\u5BB9:"},n.a.createElement(ce.a,{defaultValue:vn.content||"",watch:!0})))),n.a.createElement("div",{className:Ct.a.upload},on?zt():Dn())),n.a.createElement("div",{className:Ct.a.btns},n.a.createElement(Z.a,{onClick:Qt,type:"primary",ghost:!0},"\u5173\u95ED"),n.a.createElement(Z.a,{loading:bi,disabled:ni,onClick:function(){return ft.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},Re=J,ut=k("cWXX"),St=k("/ezw"),Yt=k("CaVn"),dt=k.n(Yt),Gt=k("s8/Y"),sn=k.n(Gt),Wn=k("JOrW"),Si=k.n(Wn),hi=k("gqXR"),Fn=k.n(hi),di=k("14J3"),Zi=k("BMrR"),_i=k("jCWc"),ri=k("kPKH"),wi=k("wW8i"),Di=k.n(wi),Oi=k("MVJL"),Ri=k.n(Oi),Vi=function(pt){var Kt=pt.id,fn=pt.cb,tn=Object(r.useState)(""),Xt=Object(m.a)(tn,2),nt=Xt[0],gt=Xt[1];return n.a.createElement("aside",{className:"mt10"},n.a.createElement(ce.a,{defaultValue:nt,id:"writeForumsReviewId",onChange:function(ft){gt(ft)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Zi.a,null,n.a.createElement(ri.a,{flex:"1"}),n.a.createElement(ri.a,null,n.a.createElement(Z.a,{type:"primary",size:"large",onClick:Object(p.a)(i.a.mark(function cn(){return i.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:nt===""?M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):fn(Kt,nt);case 1:case"end":return hn.stop()}},cn)}))},"\u53D1\u9001"))))},cr=function(pt){var Kt,fn=pt.data;return n.a.createElement("div",{className:Ri.a.thirdlyLevelDiscuss},n.a.createElement("span",{className:"c-grey-333"},n.a.createElement("span",{className:"font 14 c-light-primary"},fn==null||((Kt=fn.author)===null||Kt===void 0)?void 0:Kt.name),"@",n.a.createElement("span",{className:"font 14 c-light-primary"},fn==null?void 0:fn.parent_name),":"),n.a.createElement(jt.a,{value:fn==null?void 0:fn.content}))},rr=function(pt){var Kt,fn,tn,Xt,nt=pt.data,gt=pt.onReplyDiscuss,cn=pt.thirdlyReply,ft=pt.setThirdlyReply,hn=Object(Ft.x)();return console.log(hn,"user"),n.a.createElement("div",{className:Ri.a.list},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(nt==null||((Kt=nt.author)===null||Kt===void 0)?void 0:Kt.image_url)}),n.a.createElement("div",{className:Ri.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333"},nt==null||((fn=nt.author)===null||fn===void 0)?void 0:fn.name),(hn==null?void 0:hn.login)!==(nt==null||((tn=nt.author)===null||tn===void 0)?void 0:tn.login)&&n.a.createElement("span",{onClick:function(){return ft(nt==null?void 0:nt.id)},className:"c-grey-999 current",style:{float:"right"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),n.a.createElement("span",null,"\u56DE\u590D"))),n.a.createElement(jt.a,{value:nt==null?void 0:nt.content}),nt==null||((Xt=nt.children)===null||Xt===void 0)?void 0:Xt.map(function(Bt){return n.a.createElement(cr,{key:Bt.id,data:Bt})}),cn===(nt==null?void 0:nt.id)&&n.a.createElement("div",null,n.a.createElement(Vi,{id:nt==null?void 0:nt.id,cb:gt}),n.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return ft(null)},className:"c-light-primary current"},n.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),n.a.createElement("div",{className:Ri.a.line})))},ji=function(pt){var Kt,fn,tn,Xt,nt=pt.data,gt=pt.onReplyDiscuss,cn=pt.secondReply,ft=pt.setSecondReply,hn=pt.thirdlyReply,Bt=pt.setThirdlyReply,vn=pt.onPlusDiscuss,Kn=Object(r.useState)(!1),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1];return console.log(nt,"data"),n.a.createElement("div",{className:Ri.a.discussItem},n.a.createElement("div",{className:Ri.a.list},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(nt==null||((Kt=nt.author)===null||Kt===void 0)?void 0:Kt.image_url)}),n.a.createElement("div",{className:Ri.a.wrap},n.a.createElement("div",{className:"font14",style:{marginBottom:6}},n.a.createElement("span",{className:"c-grey-333 mr30"},nt==null||((fn=nt.author)===null||fn===void 0)?void 0:fn.name),n.a.createElement("span",{className:"c-grey-999"},nt==null?void 0:nt.time)),n.a.createElement(jt.a,{value:nt==null?void 0:nt.content}),n.a.createElement("div",{className:Ri.a.btns},n.a.createElement("div",{onClick:function(){return vn(nt==null?void 0:nt.id)},className:nt!=null&&nt.user_praise?"c-light-primary":"c-grey-999"},n.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),n.a.createElement("span",null,nt==null?void 0:nt.praise_count)),n.a.createElement("div",{onClick:function(){var Zn;if((nt==null||((Zn=nt.children)===null||Zn===void 0)?void 0:Zn.length)===0)return;ft(null),ni(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),n.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":nt==null||((tn=nt.children)===null||tn===void 0)?void 0:tn.length)),n.a.createElement("div",{onClick:function(){ni(!1),ft(cn===(nt==null?void 0:nt.id)?null:nt==null?void 0:nt.id)},style:{color:cn===(nt==null?void 0:nt.id)?"#0152d9":"#999999"}},n.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),n.a.createElement("span",null,cn===(nt==null?void 0:nt.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),cn===(nt==null?void 0:nt.id)&&n.a.createElement(Vi,{id:nt==null?void 0:nt.id,cb:function(Zn,qn){gt(Zn,qn),ni(!0)}}),Sn&&n.a.createElement("div",{className:Ri.a.secondLevelDiscuss},nt==null||((Xt=nt.children)===null||Xt===void 0)?void 0:Xt.map(function(Ln){return n.a.createElement(rr,{thirdlyReply:hn,setThirdlyReply:Bt,key:Ln.id,data:Ln,onReplyDiscuss:gt})})))))},Wi=ji,hr=function(pt){var Kt=pt.identifier,fn=pt.active,tn=pt.onOk,Xt=Object(r.useState)(""),nt=Object(m.a)(Xt,2),gt=nt[0],cn=nt[1],ft=Object(r.useState)(1),hn=Object(m.a)(ft,2),Bt=hn[0],vn=hn[1],Kn=Object(r.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(r.useState)(0),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(r.useState)(null),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(r.useState)(null),ei=Object(m.a)(kn,2),Gn=ei[0],Vt=ei[1];Object(r.useEffect)(function(){Tn(1),vn(1)},[fn]);var Tn=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn){var zt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,le({container_type:"QuestionSolutionArticle",container_identifier:fn,limit:5,page:Rn});case 2:zt=on.sent,zt!=null&&zt.comments&&(ni((zt==null?void 0:zt.comments)||[]),vn(Rn),bi(zt==null?void 0:zt.disscuss_count));case 4:case"end":return on.stop()}},yn)}));return function(Rn){return Dn.apply(this,arguments)}}(),si=function(){var Dn=Object(p.a)(i.a.mark(function yn(){var Rn;return i.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(!(gt==="")){Qt.next=3;break}return M.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Qt.abrupt("return");case 3:return Qt.next=5,pe({comments:{content:gt},container_type:"QuestionSolutionArticle",container_identifier:fn});case 5:Rn=Qt.sent,Rn!=null&&Rn.discuss&&(cn(""),Tn(Bt),tn());case 7:case"end":return Qt.stop()}},yn)}));return function(){return Dn.apply(this,arguments)}}(),vi=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn,zt,Qt){var on;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,ve({container_type:"QuestionSolutionArticle",container_identifier:fn,comments:{content:zt,parent_id:Rn}});case 2:on=Wt.sent,ai(null),Vt(null),Tn(Bt);case 6:case"end":return Wt.stop()}},yn)}));return function(Rn,zt,Qt){return Dn.apply(this,arguments)}}(),ui=function(){var Dn=Object(p.a)(i.a.mark(function yn(Rn){var zt;return i.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,de(Rn);case 2:zt=on.sent,Tn(Bt);case 4:case"end":return on.stop()}},yn)}));return function(Rn){return Dn.apply(this,arguments)}}(),ti=function(yn){vn(yn),Tn(yn)};return n.a.createElement("div",{className:Di.a.discuss},n.a.createElement("aside",{className:Di.a.reply,style:{borderWidth:qn?1:0}},n.a.createElement(ce.a,{defaultValue:gt,id:"writeForumsReviewId",onChange:function(yn){cn(yn)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),n.a.createElement(Zi.a,null,n.a.createElement(ri.a,{flex:"1"}),n.a.createElement(ri.a,null,n.a.createElement(Z.a,{type:"primary",size:"large",onClick:function(){return si()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(Dn){return n.a.createElement(Wi,{secondReply:gi,setSecondReply:ai,thirdlyReply:Gn,setThirdlyReply:Vt,key:Dn.id,data:Dn,onReplyDiscuss:vi,onPlusDiscuss:ui})}),n.a.createElement(De.a,{className:Di.a.pagination,showTotal:function(yn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},yn),"\u6761\u6570\u636E")},current:Bt,onChange:ti,total:qn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Tr=hr,ar=k("hgre"),Hn=function(pt){var Kt,fn,tn,Xt,nt,gt,cn,ft,hn,Bt,vn=pt.active,Kn=pt.identifier,Mn=pt.onAssist,Sn=pt.onEdit,ni=pt.onArticlesSkip,Ln=pt.onClose,Zn=pt.onOk,qn=pt.onDelete,bi=pt.detailsIndex,Un=pt.btnShowStatus,mi=Object(r.useState)(!0),gi=Object(m.a)(mi,2),ai=gi[0],kn=gi[1],ei=Object(r.useState)({}),Gn=Object(m.a)(ei,2),Vt=Gn[0],Tn=Gn[1];Object(r.useEffect)(function(){vn&&si()},[vn,bi]);var si=function(){var yn=Object(p.a)(i.a.mark(function Rn(){var zt,Qt,on=arguments;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return zt=on.length>0&&on[0]!==void 0?on[0]:!0,zt&&kn(!0),Wt.next=4,Object(E.d)(Kn,{active:vn});case 4:Qt=Wt.sent,(Qt==null?void 0:Qt.status)===0&&Tn((Qt==null?void 0:Qt.data)||{}),kn(!1);case 7:case"end":return Wt.stop()}},Rn)}));return function(){return yn.apply(this,arguments)}}(),vi=function(){var yn=Object(p.a)(i.a.mark(function Rn(zt){var Qt;return i.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(E.g)(Kn,Object(u.a)({active:vn},zt));case 2:Qt=ln.sent,(Qt==null?void 0:Qt.status)===0&&(si(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(zt){return yn.apply(this,arguments)}}(),ui=function(){var yn=Object(p.a)(i.a.mark(function Rn(zt){var Qt;return i.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(E.c)(Kn,{active:zt==null?void 0:zt.id});case 2:Qt=ln.sent,Qt.status===0&&(si(!1),Zn());case 4:case"end":return ln.stop()}},Rn)}));return function(zt){return yn.apply(this,arguments)}}(),ti=function(Rn){I.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return qn(Rn)}})},Dn=function(){si(!1),Zn()};return n.a.createElement("div",{className:dt.a.listDetails},n.a.createElement(St.a,{className:"pt20 pl20 pr20",loading:ai,active:!0,paragraph:{rows:5}},n.a.createElement("div",{className:dt.a.head},n.a.createElement("div",{className:dt.a.name},n.a.createElement("div",{title:Vt==null?void 0:Vt.name,className:dt.a.title},Vt==null?void 0:Vt.name),(Vt==null?void 0:Vt.is_authority)&&n.a.createElement("div",{className:dt.a.b},"\u5B98\u65B9"),(Vt==null?void 0:Vt.is_excellent)&&n.a.createElement("div",{className:dt.a.a},"\u7CBE\u9009")),n.a.createElement("div",{className:dt.a.tag},n.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(Vt==null?void 0:Vt.image_url)}),n.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},Vt==null?void 0:Vt.username),n.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",xt()(Vt==null?void 0:Vt.created_at).format("YYYY-MM-DD")),n.a.createElement("span",null,n.a.createElement("img",{src:U.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),n.a.createElement("span",null,n.a.createElement("img",{src:he.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.discusses_count)),n.a.createElement("span",null,n.a.createElement("img",{src:Ge.a}),n.a.createElement("span",null,Vt==null?void 0:Vt.viewed_count)),n.a.createElement("div",{className:dt.a.btn},(Object(Ft.v)()||(Vt==null?void 0:Vt.is_self))&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Z.a,{onClick:function(){return ti(Vt)},type:"primary",ghost:!0},"\u5220\u9664"),n.a.createElement(Z.a,{onClick:function(){return Sn(Vt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Ft.v)()&&n.a.createElement(Z.a,{onClick:function(){return vi({is_authority:!(Vt!=null&&Vt.is_authority)})},type:"primary"},n.a.createElement("img",{src:Si.a}),Vt!=null&&Vt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Ft.v)()&&n.a.createElement(Z.a,{onClick:function(){return vi({is_excellent:!(Vt!=null&&Vt.is_excellent)})},type:"primary"},n.a.createElement("img",{src:sn.a}),Vt!=null&&Vt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),n.a.createElement("div",{className:dt.a.scroll},(Vt==null||((Kt=Vt.videos)===null||Kt===void 0||((fn=Kt[0])===null||fn===void 0))?void 0:fn.id)&&n.a.createElement("div",{className:dt.a.video},n.a.createElement(R.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(Vt!=null&&(tn=Vt.videos)!==null&&tn!==void 0&&(Xt=tn[0])!==null&&Xt!==void 0&&Xt.transcoded)},n.a.createElement(ar.a,{poster:Vt==null||((nt=Vt.videos)===null||nt===void 0||((gt=nt[0])===null||gt===void 0))?void 0:gt.cover_url,src:(Vt==null||((cn=Vt.videos)===null||cn===void 0||((ft=cn[0])===null||ft===void 0))?void 0:ft.play_url)||"",videoId:Vt==null||((hn=Vt.videos)===null||hn===void 0||((Bt=hn[0])===null||Bt===void 0))?void 0:Bt.id,logWatchHistory:function(){}}))),n.a.createElement(jt.a,{className:dt.a.html,value:(Vt==null?void 0:Vt.content)||""}),n.a.createElement("div",{onClick:function(){return ui(Vt)},className:dt.a.g},n.a.createElement("img",{className:"mr10",src:(Vt!=null&&Vt.user_liker,Fn.a)}),n.a.createElement("span",null,Vt==null?void 0:Vt.praises_count)),n.a.createElement(Tr,{onOk:Dn,active:vn,identifier:Kn})),n.a.createElement("div",{className:dt.a.btns},n.a.createElement(Z.a,{onClick:function(){return Ln()},type:"primary",ghost:!0},"\u5173\u95ED"),Un[0]&&n.a.createElement(Z.a,{onClick:function(Rn){return ni(Rn,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Un[1]&&n.a.createElement(Z.a,{onClick:function(Rn){return ni(Rn,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},Cn=Hn,yi=k("3tLw"),Nn=k.n(yi),Ti=k("ek7X"),ii=k("0NbB"),Cr=function(pt){var Kt=pt.identifier,fn=pt.tabStatus,tn=pt.setFilterListTotal,Xt=pt.setListStatus,nt={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},gt=Object(r.useState)(Object(u.a)({},nt)),cn=Object(m.a)(gt,2),ft=cn[0],hn=cn[1],Bt=Object(r.useState)(!1),vn=Object(m.a)(Bt,2),Kn=vn[0],Mn=vn[1],Sn=Object(r.useState)(0),ni=Object(m.a)(Sn,2),Ln=ni[0],Zn=ni[1],qn=Object(r.useState)(1),bi=Object(m.a)(qn,2),Un=bi[0],mi=bi[1],gi=Object(r.useState)(null),ai=Object(m.a)(gi,2),kn=ai[0],ei=ai[1],Gn=Object(r.useState)([]),Vt=Object(m.a)(Gn,2),Tn=Vt[0],si=Vt[1],vi=Object(r.useState)([!0,!0]),ui=Object(m.a)(vi,2),ti=ui[0],Dn=ui[1],yn=Object(r.useState)(0),Rn=Object(m.a)(yn,2),zt=Rn[0],Qt=Rn[1],on=Object(r.useRef)(null);Object(r.useEffect)(function(){li()},[fn]),Object(r.useEffect)(function(){ln()},[kn]),Object(r.useEffect)(function(){qt(Object(u.a)({},nt)),li()},[Kt]),Object(r.useEffect)(function(){return window.addEventListener("resize",Wt),Xt(zt),function(){window.removeEventListener("resize",Wt)}},[zt]);var ln=function(){var fi=Object(p.a)(i.a.mark(function xn(){var zn,Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:if(kn){Vn.next=3;break}return Dn([!0,!0]),Vn.abrupt("return");case 3:zn=[!0,!0],Yn=Tn==null?void 0:Tn.findIndex(function(Ar){return Ar.id===kn}),Yn===0&&ft.page===1&&(zn[0]=!1),(ft.page-1)*ft.limit+(Yn+1)===ft.total&&(zn[1]=!1),Dn(zn);case 8:case"end":return Vn.stop()}},xn)}));return function(){return fi.apply(this,arguments)}}(),Wt=function(){if(zt){var xn,zn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(zn)}},qt=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn,Ui,Vn,Ar;return i.a.wrap(function($i){for(;;)switch($i.prev=$i.next){case 0:return Mn(!0),$i.next=3,Object(E.f)(Kt,zn);case 3:return Yn=$i.sent,(Yn==null?void 0:Yn.status)===0&&(si((Yn==null||((Ui=Yn.data)===null||Ui===void 0)?void 0:Ui.articles)||[]),hn(Object(u.a)(Object(u.a)({},zn),{},{total:Yn==null||((Vn=Yn.data)===null||Vn===void 0)?void 0:Vn.articles_count})),tn(Yn==null||((Ar=Yn.data)===null||Ar===void 0)?void 0:Ar.articles_count)),Mn(!1),$i.abrupt("return",Yn);case 7:case"end":return $i.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),gn=function(){(ft==null?void 0:ft.sort_direction)===null?ft.sort_direction="asc":(ft==null?void 0:ft.sort_direction)==="asc"?ft.sort_direction="desc":(ft==null?void 0:ft.sort_direction)==="desc"&&(ft.sort_direction=null),ft.page=1,li(),hn(Object(u.a)({},ft)),qt(ft)},ci=function(){ft.page=1,ft.search=ft==null?void 0:ft.save_search,li(),hn(Object(u.a)({},ft)),qt(ft)},Li=function(){var xn,zn=document.getElementsByClassName("btn-resize");zn[0].style.visibility="hidden";var Yn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(Yn)},qi=function(){Li(),Qt(1)},Hi=function(xn){Li(),ei(xn==null?void 0:xn.id),Qt(3)},Or=function(xn){Li(),ei(xn==null?void 0:xn.id),Qt(2)},li=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",Zn(0),Qt(0),ei(null)},Rr=function(xn){Qt(3),ei(xn),ft.page=1,hn(Object(u.a)({},ft)),qt(ft)},Nr=function(xn){Qt(3),ei(xn),hn(Object(u.a)({},ft)),qt(ft)},Kr=function(xn){hn(Object(u.a)({},ft)),qt(ft)},Ur=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.c)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(ft),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),da=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.e)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(qt(ft),mi(Un+1));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),yr=function(){var fi=Object(p.a)(i.a.mark(function xn(zn){var Yn;return i.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:return Vn.next=2,Object(E.i)(Kt,{active:zn==null?void 0:zn.id});case 2:Yn=Vn.sent,Yn.status===0&&(li(),qt(ft));case 4:case"end":return Vn.stop()}},xn)}));return function(zn){return fi.apply(this,arguments)}}(),ta=function(xn){ft.page=xn,hn(Object(u.a)({},ft)),qt(ft)},Da=function(){var fi=Object(p.a)(i.a.mark(function xn(zn,Yn){var Ui,Vn,Ar,Br,$i,Lr,Pi,or,Pn,wn,$n;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(Ui=Tn==null?void 0:Tn.findIndex(function(Ei){return Ei.id===kn}),console.log(Ui,Yn,22),!(Yn==="prev")){In.next=21;break}if(!(Ui===void 0)){In.next=6;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 6:if(!(Ui===0)){In.next=19;break}if(!(ft.page===1)){In.next=10;break}return M.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 10:if(!(ft.page!==1)){In.next=17;break}return ft.page=ft.page-1,hn(Object(u.a)({},ft)),In.next=15,qt(ft);case 15:Vn=In.sent,(Vn==null?void 0:Vn.status)===0&&(Lr=Vn==null||((Ar=Vn.data)===null||Ar===void 0)?void 0:Ar.articles[(Vn==null||((Br=Vn.data)===null||Br===void 0||(($i=Br.articles)===null||$i===void 0))?void 0:$i.length)-1],ei(Lr==null?void 0:Lr.id),console.log(zn.target,555));case 17:In.next=21;break;case 19:Pi=Tn[Ui-1],ei(Pi==null?void 0:Pi.id);case 21:if(!(Yn==="next")){In.next=39;break}if(!(Ui===void 0)){In.next=25;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 25:if(!((ft.page-1)*ft.limit+(Ui+1)===ft.total)){In.next=28;break}return M.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),In.abrupt("return");case 28:if(!(Ui+1===ft.limit)){In.next=37;break}return ft.page=ft.page+1,hn(Object(u.a)({},ft)),In.next=33,qt(ft);case 33:or=In.sent,(or==null?void 0:or.status)===0&&(wn=or==null||((Pn=or.data)===null||Pn===void 0)?void 0:Pn.articles[0],ei(wn==null?void 0:wn.id)),In.next=39;break;case 37:$n=Tn[Ui+1],ei($n==null?void 0:$n.id);case 39:case"end":return In.stop()}},xn)}));return function(zn,Yn){return fi.apply(this,arguments)}}();return n.a.createElement("div",{className:qe.a.wrap,ref:on},n.a.createElement("div",{className:qe.a.head},n.a.createElement("div",{className:qe.a.sort,onClick:gn},n.a.createElement("span",null,"\u6700\u65B0"),n.a.createElement("aside",null,n.a.createElement(Ti.a,{style:{color:(ft==null?void 0:ft.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),n.a.createElement(ii.a,{style:{color:(ft==null?void 0:ft.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),n.a.createElement(ne.a.Search,{value:ft.save_search,className:qe.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){ft.save_search=xn.target.value,hn(Object(u.a)({},ft))},onSearch:ci}),n.a.createElement("div",{onClick:qi,className:qe.a.btn},n.a.createElement("img",{src:Nn.a}),"\u5199\u9898\u89E3")),n.a.createElement("div",{className:qe.a.listWarp},n.a.createElement(R.a,{spinning:Kn,className:"mt20"},Tn==null?void 0:Tn.map(function(fi,xn){var zn=!0;return xn+1===Tn.length&&xn!==0&&(zn=!1),n.a.createElement(Nt,{active:kn,key:fi.id,data:fi,showLine:zn,onClick:Hi,onAssist:Ur,onHide:da})}),(Tn==null?void 0:Tn.length)===0&&n.a.createElement(Ie.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),n.a.createElement(De.a,{className:qe.a.pagination,showTotal:function(xn){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:ft.total,showSizeChanger:!1,current:ft==null?void 0:ft.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),zt>0&&n.a.createElement("div",{className:qe.a.fixedRight,style:{width:Ln}},zt===1&&n.a.createElement(Re,{identifier:Kt,onClose:li,onOk:Rr}),zt===2&&n.a.createElement(Re,{active:kn,identifier:Kt,onClose:li,onOk:Nr}),zt===3&&n.a.createElement(Cn,{btnShowStatus:ti,onArticlesSkip:Da,detailsIndex:Un,active:kn,identifier:Kt,onClose:li,onOk:Kr,onEdit:Or,onAssist:Ur,onDelete:yr})))},Ni=Cr,Xi=k("VEzc"),lr=k.n(Xi),gr=function(pt){var Kt,fn=pt.visible,tn=pt.onVisible,Xt=pt.value,nt=pt.onChange,gt=pt.setIndex,cn={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},ft=Object(r.useState)(cn),hn=Object(m.a)(ft,2),Bt=hn[0],vn=hn[1],Kn=Object(r.useState)([]),Mn=Object(m.a)(Kn,2),Sn=Mn[0],ni=Mn[1],Ln=Object(r.useState)([]),Zn=Object(m.a)(Ln,2),qn=Zn[0],bi=Zn[1],Un=Object(r.useState)(!1),mi=Object(m.a)(Un,2),gi=mi[0],ai=mi[1],kn=Object(r.useRef)([]),ei=Object(r.useRef)(null),Gn=Object(T.i)();Object(r.useEffect)(function(){return Gn!=null&&Gn.id&&(ei.current=setInterval(function(){Vt(30)},3e4)),function(){clearInterval(ei.current)}},[]);var Vt=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln;return i.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return qt.next=2,Object(E.r)(Gn==null?void 0:Gn.id,{practice_time:on});case 2:ln=qt.sent;case 3:case"end":return qt.stop()}},Qt)}));return function(on){return zt.apply(this,arguments)}}();Object(r.useEffect)(function(){Dn(Bt),ui()},[]),Object(r.useEffect)(function(){return window.addEventListener("click",si),function(){window.removeEventListener("click",si)}},[Gn==null?void 0:Gn.save_identifier,fn]),Object(r.useEffect)(function(){var zt=kn.current.findIndex(function(qt){return qt.identifier===(Gn==null?void 0:Gn.save_identifier)}),Qt=kn.current[zt-1],on=kn.current[zt+1],ln=document.getElementById("oj-prev"),Wt=document.getElementById("oj-next");Qt?ln.style.display="block":ln.style.display="none",on?Wt.style.display="block":Wt.style.display="none"},[Gn==null?void 0:Gn.save_identifier,kn.current]);var Tn=function(Qt,on){if(Qt.id===on)return Qt;for(var ln=0,Wt=Qt;Wt=Wt.parentNode;ln++){if(Wt.id===on)return Wt;if(Wt==document.documentElement)return!1}},si=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln,Wt,qt;return i.a.wrap(function(ci){for(;;)switch(ci.prev=ci.next){case 0:if(!Tn(on.target,"oj-drawer")&&fn&&tn(!1),ln=kn.current.findIndex(function(Li){return Li.identifier===(Gn==null?void 0:Gn.save_identifier)}),Wt=kn.current[ln-1],qt=kn.current[ln+1],!(on.target.id==="oj-prev")){ci.next=14;break}if(!(!Wt||ln===-1)){ci.next=8;break}return M.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),ci.abrupt("return");case 8:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",ci.next=12,yn(Wt==null?void 0:Wt.identifier);case 12:gt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 14:if(!(on.target.id==="oj-next"||on.target.id==="oj-modal-next")){ci.next=24;break}if(!(!qt||ln===-1)){ci.next=18;break}return M.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),ci.abrupt("return");case 18:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",ci.next=22,yn(qt==null?void 0:qt.identifier);case 22:gt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 24:case"end":return ci.stop()}},Qt)}));return function(on){return zt.apply(this,arguments)}}();Object(r.useEffect)(function(){nt(Gn==null?void 0:Gn.save_identifier);var zt=qn.findIndex(function(Qt){return Qt.some(function(on){return on.identifier===(Gn==null?void 0:Gn.save_identifier)})});zt===-1?vn(Object(u.a)(Object(u.a)({},Bt),{},{page:1})):vn(Object(u.a)(Object(u.a)({},Bt),{},{page:zt+1}))},[Gn==null?void 0:Gn.save_identifier,qn]);var vi=function(Qt){Bt.page=1,Bt.tag_discipline_id=Qt,vn(Object(u.a)({},Bt)),Dn(Bt)},ui=function(){var zt=Object(p.a)(i.a.mark(function Qt(){var on;return i.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(_e.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:on=Wt.sent,ni(on.tag_disciplines||[]);case 4:case"end":return Wt.stop()}},Qt)}));return function(){return zt.apply(this,arguments)}}(),ti=function(Qt){Bt.page=1,Bt.difficulty=typeof Qt=="number"?Qt:null,vn(Object(u.a)({},Bt)),Dn(Bt)},Dn=function(){var zt=Object(p.a)(i.a.mark(function Qt(on){var ln,Wt,qt,gn,ci,Li;return i.a.wrap(function(Hi){for(;;)switch(Hi.prev=Hi.next){case 0:return ai(!0),Hi.next=3,Object(E.p)(on);case 3:if(ln=Hi.sent,ln!=null&&ln.practices_list){for(qt=ln==null||((Wt=ln.practices_list)===null||Wt===void 0)?void 0:Wt.length,gn=[],ci=0;ci<qt;ci+=Bt==null?void 0:Bt.per_page)gn.push(ln==null||((Li=ln.practices_list)===null||Li===void 0)?void 0:Li.slice(ci,ci+(Bt==null?void 0:Bt.per_page)));vn(Object(u.a)(Object(u.a)({},Bt),{},{total:ln==null?void 0:ln.practices_count})),kn.current=(ln==null?void 0:ln.practices_list)||[],bi(gn)}ai(!1);case 6:case"end":return Hi.stop()}},Qt)}));return function(on){return zt.apply(this,arguments)}}(),yn=function(){var zt=Object(p.a)(i.a.mark(function Qt(on,ln){var Wt;return i.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(_e.a)("/api/practices/".concat(on,"/start"),{method:"get"});case 2:Wt=gn.sent,(Wt==null?void 0:Wt.status)===0&&x.d.push("/problems/".concat(Wt==null?void 0:Wt.identifier,"/oj/").concat(on));case 4:case"end":return gn.stop()}},Qt)}));return function(on,ln){return zt.apply(this,arguments)}}(),Rn=function(Qt){Bt.page=Qt,vn(Object(u.a)({},Bt))};return n.a.createElement("div",{className:lr.a.wrap,id:"oj-drawer",style:{left:fn?0:-700}},n.a.createElement("div",{className:lr.a.head},n.a.createElement("div",{className:lr.a.title},"\u9898\u76EE\u5217\u8868"),n.a.createElement(ne.a.Search,{value:Bt==null?void 0:Bt.save_search,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(Qt){Bt.save_search=Qt.target.value,vn(Object(u.a)({},Bt))},onSearch:function(){Bt.page=1,Bt.search=Bt.save_search,vn(Object(u.a)({},Bt)),Dn(Bt)}}),n.a.createElement(Y.a,{value:Bt==null?void 0:Bt.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,showArrow:!0,getPopupContainer:function(Qt){return Qt.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:vi},Sn.map(function(zt){return n.a.createElement(Y.a.Option,{key:zt.id,value:zt.id},zt.name)})),n.a.createElement(Y.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"\u96BE\u5EA6",getPopupContainer:function(Qt){return Qt.parentNode},value:Bt==null?void 0:Bt.difficulty,onChange:ti},n.a.createElement(Y.a.Option,{value:1},"\u7B80\u5355"),n.a.createElement(Y.a.Option,{value:2},"\u9002\u4E2D"),n.a.createElement(Y.a.Option,{value:3},"\u56F0\u96BE"))),n.a.createElement("div",{className:lr.a.content},n.a.createElement(R.a,{spinning:gi},qn==null||((Kt=qn[Bt.page-1])===null||Kt===void 0)?void 0:Kt.map(function(zt){return n.a.createElement("div",{key:zt.identifier,className:lr.a.list,onClick:function(on){return yn(zt.identifier,on)}},n.a.createElement("i",{style:{visibility:Xt===zt.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),n.a.createElement("span",{style:{fontWeight:Xt===zt.identifier?"bold":400,color:Xt===zt.identifier?"#ffffff":"#bac4cd"},title:zt==null?void 0:zt.name},zt.name),(zt==null?void 0:zt.difficulty)===1&&n.a.createElement("b",{style:{color:"#2FA34F"}},"\u7B80\u5355"),(zt==null?void 0:zt.difficulty)===2&&n.a.createElement("b",{style:{color:"#0152d9"}},"\u9002\u4E2D"),(zt==null?void 0:zt.difficulty)===3&&n.a.createElement("b",{style:{color:"#FA6400"}},"\u56F0\u96BE"))}))),n.a.createElement("div",{className:lr.a.footer},n.a.createElement(De.a,{showTotal:function(Qt){return n.a.createElement("span",{style:{color:"#656F87"}},"\u5171",n.a.createElement("span",{className:"c-light-primary"},Qt),"\u6761\u6570\u636E")},total:Bt.total,pageSize:Bt==null?void 0:Bt.per_page,current:Bt==null?void 0:Bt.page,showSizeChanger:!1,onChange:Rn,showQuickJumper:!0,hideOnSinglePage:!0})))},Hr=gr,kr=function(Ye){var pt,Kt=Ye.hack,fn=Ye.onTriggerPraise,tn=Ye.topicId,Xt=Ye.page,nt=Ye.onPageChange,gt=Ye.user,cn=Ye.submitRecords,ft=Ye.submitting,hn=Ye.submitResult,Bt=Object(T.h)(),vn=Object(r.useState)((Bt==null||((pt=Bt.query)===null||pt===void 0)?void 0:pt.tab)||"0"),Kn=Object(m.a)(vn,2),Mn=Kn[0],Sn=Kn[1],ni=Object(r.useState)(0),Ln=Object(m.a)(ni,2),Zn=Ln[0],qn=Ln[1],bi=Object(r.useState)(0),Un=Object(m.a)(bi,2),mi=Un[0],gi=Un[1],ai=Object(r.useState)(0),kn=Object(m.a)(ai,2),ei=kn[0],Gn=kn[1],Vt=Object(r.useState)(),Tn=Object(m.a)(Vt,2),si=Tn[0],vi=Tn[1],ui=Object(r.useState)(!1),ti=Object(m.a)(ui,2),Dn=ti[0],yn=ti[1];function Rn(Qt){var on=Qt.target.id;if(Mn==="3"&&on!==Mn&&(mi===1||mi===2)){I.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:function(){Sn(on)}});return}Sn(on)}Object(r.useEffect)(function(){var Qt=tt.a.subscribe("to-commit-info",function(){Sn("1")});return Qt},[]);function zt(){Sn("2")}return n.a.createElement("div",{className:Oe.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Oe.a["s-navs"]," ").concat(Oe.a["bg-white"]," ").concat(Oe.a.b1)},n.a.createElement("li",{className:"mr40 current"},n.a.createElement("img",{onClick:function(){return yn(!0)},src:Fe.a})),n.a.createElement("li",{className:Oe.a["oj-mr"]},n.a.createElement("a",{className:Mn==="0"?Oe.a.active:"",id:"0",onClick:Rn},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",{className:Oe.a["oj-mr"]},n.a.createElement("a",{className:Mn==="3"?Oe.a.active:"",id:"3",onClick:Rn},"\u9898\u89E3",ei?"(".concat(ei,")"):"")),n.a.createElement("li",{className:Oe.a["oj-mr"]},n.a.createElement("a",{className:Mn==="2"?Oe.a.active:"",id:"2",onClick:Rn},"\u8BC4\u8BBA",Zn?"(".concat(Zn,")"):"")),n.a.createElement("li",null,n.a.createElement("a",{className:Mn==="1"?Oe.a.active:"",id:"1",onClick:Rn},"\u63D0\u4EA4\u8BB0\u5F55"))),n.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Mn==="0"?"":"hide"),style:{padding:"0 0 0 16px"}},n.a.createElement(Pe,{hack:Kt,onTriggerPraise:fn,toDiscuss:zt})),n.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Mn==="1"?"":"hide")},cn!=null&&cn.records_count?n.a.createElement(mt,{page:Xt,onPageChange:nt,topicId:tn,submitting:ft,submitRecords:cn,submitResult:hn}):n.a.createElement(Ie.a,null)),n.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Mn==="2"?"":"hide"),style:{padding:0}},n.a.createElement(Dt,{setDiscussTotal:qn,user:gt,identifier:Kt.identifier,hack:Kt,onTriggerPraise:fn})),n.a.createElement("div",{className:"".concat(Oe.a["tab-panel-body"]," ").concat(Mn==="3"?"":"hide"),style:{padding:0}},n.a.createElement(Ni,{setListStatus:gi,setFilterListTotal:Gn,tabStatus:Mn,identifier:Kt.identifier})),n.a.createElement(Hr,{visible:Dn,setIndex:Sn,onVisible:function(on){return yn(on)},value:si,onChange:function(on){return vi(on)}}))},wr=k("+aKw"),Xr=k("oFv4"),vr=k.n(Xr),Yr=k("S/kP"),$r=k.n(Yr),fr=k("t/PP"),Jr=k.n(fr),mn=k("LvDl"),On=k.n(mn),_n=k("P5Jw"),jn=s.a.Countdown,Jn={Java:"java",C:"c",Python:"py","C++":"c"},un;(function(Ye){Ye[Ye.SET_LOADING=0]="SET_LOADING",Ye[Ye.GET_DATA=1]="GET_DATA",Ye[Ye.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Ye[Ye.SET_DATA=3]="SET_DATA",Ye[Ye.SET_DEBUGING=4]="SET_DEBUGING",Ye[Ye.SET_SUBMITING=5]="SET_SUBMITING",Ye[Ye.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Ye[Ye.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Ye[Ye.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Ye[Ye.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Ye[Ye.SET_PAGE=10]="SET_PAGE",Ye[Ye.GET_LANGUAGE=11]="GET_LANGUAGE",Ye[Ye.GET_DRAWER=12]="GET_DRAWER"})(un||(un={}));function Bn(){return new Date().getTime()}var Ai={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function Yi(Ye,pt){switch(pt.type){case un.GET_DATA:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case un.SET_DATA:return Object(u.a)(Object(u.a)({},Ye),{},{data:pt.payload});case un.SET_LOADING:return Object(u.a)(Object(u.a)({},Ye),{},{loading:pt.payload});case un.GET_LANGUAGE:return Object(u.a)(Object(u.a)({},Ye),{},{languageList:pt.payload});case un.GET_DRAWER:return Object(u.a)(Object(u.a)({},Ye),{},{drawerData:pt.payload});case un.SET_SHOW_NOTE:return Object(u.a)(Object(u.a)({},Ye),{},{showNote:pt.payload});case un.SET_DEBUGING:return Object(u.a)(Object(u.a)({},Ye),{},{debuging:pt.payload});case un.SET_SUBMITING:return Object(u.a)(Object(u.a)({},Ye),{},{submitting:pt.payload});case un.GET_SUBMIT_RECORDS:return Object(u.a)(Object(u.a)({},Ye),{},{submitRecords:pt.payload});case un.SET_PAGE:return Object(u.a)(Object(u.a)({},Ye),{},{submitRecordPage:pt.payload});case un.SET_EXECUTE_MESSAGE:return Object(u.a)(Object(u.a)({},Ye),{},{executingMessage:pt.payload});case un.SET_EXECUTE_RESULT:return Object(u.a)(Object(u.a)({},Ye),pt.payload);case un.SET_SUBMIT_RESULT:return Object(u.a)(Object(u.a)({},Ye),pt.payload);default:throw new Error}}var Xn=we.default=function(Ye){var pt,Kt,fn=Ye.children,tn=Object(r.useReducer)(Yi,Ai),Xt=Object(m.a)(tn,2),nt=Xt[0],gt=Xt[1],cn=Object(T.i)(),ft=cn.id,hn=Object(T.g)(),Bt=Object(T.h)(),vn=nt.languageValue,Kn=nt.languageList,Mn=nt.loading,Sn=nt.data,ni=nt.debugResult,Ln=nt.submitResult,Zn=nt.submitRecords,qn=nt.submitRecordPage,bi=nt.showNote,Un=nt.debuging,mi=nt.submitting,gi=nt.executingMessage,ai=Object(r.useState)("#FFF"),kn=Object(m.a)(ai,2),ei=kn[0],Gn=kn[1],Vt=Object(r.useState)(null),Tn=Object(m.a)(Vt,2),si=Tn[0],vi=Tn[1],ui=Object(r.useState)({}),ti=Object(m.a)(ui,2),Dn=ti[0],yn=ti[1],Rn=Object(r.useState)(!1),zt=Object(m.a)(Rn,2),Qt=zt[0],on=zt[1],ln=Object(r.useRef)(null),Wt=Object(r.useRef)(null),qt=Sn==null?void 0:Sn.user,gn=Sn==null?void 0:Sn.hack;Object(r.useEffect)(function(){return Object(x.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(x.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(x.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(x.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}},[]),Object(r.useEffect)(function(){setTimeout(function(){document.title="\u5728\u7EBF\u5237\u9898"},400)}),Object(r.useEffect)(function(){if(Qt){var Pn,wn=document.getElementById("oj-next"),$n=document.getElementById("oj-modal-next");(wn==null||((Pn=wn.style)===null||Pn===void 0)?void 0:Pn.display)==="none"?$n.style.display="none":$n.style.display="block"}},[Qt]),Object(r.useEffect)(function(){function Pn(){return wn.apply(this,arguments)}function wn(){return wn=Object(p.a)(i.a.mark(function $n(){var en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(E.m)(ft);case 2:en=bn.sent,en.status===401?document.location.href="/user/login":(en.hack=en.practice,en.hack.code=S.Base64.decode(en==null||((In=en.hack)===null||In===void 0)?void 0:In.code),Mi="".concat(qt==null?void 0:qt.login,"-language"),localStorage.getItem(Mi)&&(en.hack.language=localStorage.getItem(Mi)),Wt.current=On.a.cloneDeep(en),Wt.current.language=en==null||((Ei=en.hack)===null||Ei===void 0)?void 0:Ei.language,gt({type:un.GET_DATA,payload:{loading:!1,data:en}}),gt({type:un.SET_SUBMIT_RESULT,payload:{languageValue:en==null||((Ki=en.hack)===null||Ki===void 0)?void 0:Ki.language}}));case 4:case"end":return bn.stop()}},$n)})),wn.apply(this,arguments)}ft&&Pn()},[ft]),Object(r.useEffect)(function(){gt({type:un.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),Hi(),on(!1)},[ft]),Object(r.useEffect)(function(){clearTimeout(ln.current)},[ft]),Object(r.useEffect)(function(){Li()},[ft,qn]);var ci=function(){window.parent.postMessage("backExercise","*")};function Li(){return qi.apply(this,arguments)}function qi(){return qi=Object(p.a)(i.a.mark(function Pn(){var wn;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(E.o)(ft,{limit:15,page:qn});case 3:wn=en.sent,gt({type:un.GET_SUBMIT_RECORDS,payload:wn}),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),qi.apply(this,arguments)}function Hi(){return Or.apply(this,arguments)}function Or(){return Or=Object(p.a)(i.a.mark(function Pn(){var wn;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(E.w)(ft);case 3:wn=en.sent,gt({type:un.GET_LANGUAGE,payload:wn==null?void 0:wn.data}),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),Or.apply(this,arguments)}function li(Pn){gt({type:un.SET_PAGE,payload:Pn})}function Rr(Pn){return Nr.apply(this,arguments)}function Nr(){return Nr=Object(p.a)(i.a.mark(function Pn(wn){var $n,en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return Ki=(($n=window)===null||$n===void 0||((en=$n.location)===null||en===void 0||((In=en.pathname)===null||In===void 0||((Ei=In.split("/"))===null||Ei===void 0)))?void 0:Ei[2])||ft,bn.next=3,Object(E.v)(Ki,wn||{code:S.Base64.encode(gn.code),language:vn});case 3:return Mi=bn.sent,bn.abrupt("return",Mi);case 5:case"end":return bn.stop()}},Pn)})),Nr.apply(this,arguments)}function Kr(){return Ur.apply(this,arguments)}function Ur(){return Ur=Object(p.a)(i.a.mark(function Pn(){var wn,$n,en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!mi){bn.next=2;break}return bn.abrupt("return");case 2:return gt({type:un.SET_SUBMITING,payload:!0}),bn.prev=3,tt.a.publish("to-commit-info"),bn.next=7,Rr();case 7:if(wn=bn.sent,!(wn.status===0)){bn.next=21;break}return Mi=function(){return Mi=Object(p.a)(i.a.mark(function _a(){var Wr,Ir,Dr,Zr,Gr,ia;return i.a.wrap(function(Qi){for(;;)switch(Qi.prev=Qi.next){case 0:return Qi.next=2,Object(E.l)(ft,"submit");case 2:if(Wr=Qi.sent,Ir=Wr.status,Dr=Wr.data,Zr=Bn(),Gr=Zr-Ei>(In+3)*1e3,Ir!==0&&!Gr&&setTimeout(Ki,1e3),!Gr){Qi.next=12;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_SUBMITING,payload:!1}),Qi.abrupt("return");case 12:if(!(Ir===0)){Qi.next=19;break}return Dr.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Qi.next=16,Object(E.o)(ft,{limit:15,page:qn});case 16:ia=Qi.sent,gt({type:un.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},nt),{},{submitResult:Dr,submitting:!1,submitRecords:ia})}),(Dr==null?void 0:Dr.status)===0&&on(!0);case 19:case"end":return Qi.stop()}},_a)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n={},bn.next=14,Object(E.s)(ft,$n);case 14:if(en=bn.sent,!(en.status===-1)){bn.next=18;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 18:In=gn.time_limit,Ei=Bn(),Ki();case 21:bn.next=26;break;case 23:bn.prev=23,bn.t0=bn.catch(3),gt({type:un.SET_SUBMITING,payload:!1});case 26:case"end":return bn.stop()}},Pn,null,[[3,23]])})),Ur.apply(this,arguments)}function da(){return yr.apply(this,arguments)}function yr(){return yr=Object(p.a)(i.a.mark(function Pn(){var wn,$n,en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return nt.debuging=!0,gt({type:un.SET_DEBUGING,payload:!0}),bn.prev=2,bn.next=5,Rr();case 5:if(wn=bn.sent,!(wn.status===0)){bn.next=21;break}return Mi=function(){return Mi=Object(p.a)(i.a.mark(function _a(){var Wr,Ir,Dr,Zr,Gr,ia;return i.a.wrap(function(Qi){for(;;)switch(Qi.prev=Qi.next){case 0:return Qi.next=2,Object(E.l)(ft,"debug");case 2:if(Wr=Qi.sent,Ir=Wr.status,Dr=Wr.message,Zr=Wr.data,Gr=Bn(),ia=Gr-Ei>($n+3)*1e3,Ir!==0&&!ia&&(gt({type:un.SET_EXECUTE_MESSAGE,payload:Dr}),setTimeout(Ki,1e3)),!ia){Qi.next=13;break}return I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_DEBUGING,payload:!1}),Qi.abrupt("return");case 13:Ir===0&&(gt({type:un.SET_DEBUGING,payload:!1}),Zr.status===2&&I.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),gt({type:un.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},nt),{},{debugResult:Zr,debuging:!1})}));case 14:case"end":return Qi.stop()}},_a)})),Mi.apply(this,arguments)},Ki=function(){return Mi.apply(this,arguments)},$n=gn.time_limit,en={input:encodeURIComponent(Sn.test_case.input)},bn.next=13,Object(E.h)(ft,en);case 13:if(In=bn.sent,!(In.status===-1)){bn.next=17;break}return window.parent.location.href="/classrooms/".concat(Bt.query.coursesId,"/exercise/").concat(Bt.query.exercisesId,"/detail"),bn.abrupt("return");case 17:Ei=Bn(),Ki(),bn.next=22;break;case 21:gt({type:un.SET_DEBUGING,payload:!1});case 22:bn.next=27;break;case 24:bn.prev=24,bn.t0=bn.catch(2),console.log(bn.t0);case 27:return bn.prev=27,bn.finish(27);case 29:case"end":return bn.stop()}},Pn,null,[[2,24,27,29]])})),yr.apply(this,arguments)}function ta(Pn){var wn;clearTimeout(ln.current),ln.current=setTimeout(function(){var $n;Rr({code:S.Base64.encode(Pn),language:Wt==null||(($n=Wt.current)===null||$n===void 0)?void 0:$n.language})},2e3),gt({type:un.SET_DATA,payload:Object(u.a)(Object(u.a)({},Wt==null?void 0:Wt.current),{},{hack:Object(u.a)(Object(u.a)({},Wt==null||((wn=Wt.current)===null||wn===void 0)?void 0:wn.hack),{},{code:Pn})})})}function Da(Pn){var wn=Pn.target.value;gt({type:un.SET_DATA,payload:Object(u.a)(Object(u.a)({},Sn),{},{test_case:{input:wn}})})}var fi=function(){var Pn=Object(p.a)(i.a.mark(function wn($n){var en,In,Ei,Ki,Mi;return i.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return gt({type:un.SET_LOADING,payload:!0}),bn.next=3,Rr();case 3:if(en=bn.sent,!(en.status===0)){bn.next=14;break}return gt({type:un.SET_SUBMIT_RESULT,payload:{languageValue:$n}}),Wt.current.language=$n,In="".concat(qt==null?void 0:qt.login,"-language"),localStorage.setItem(In,$n),bn.next=11,Object(E.w)(ft);case 11:Ei=bn.sent,Ei.status===0&&(Mi=Ei==null||((Ki=Ei.data)===null||Ki===void 0)?void 0:Ki.find(function(na){return na.language===$n}),ta(S.Base64.decode(Mi.code))),setTimeout(function(){gt({type:un.SET_LOADING,payload:!1})},300);case 14:case"end":return bn.stop()}},wn)}));return function($n){return Pn.apply(this,arguments)}}();function xn(){return zn.apply(this,arguments)}function zn(){return zn=Object(p.a)(i.a.mark(function Pn(){var wn;return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.prev=0,en.next=3,Object(E.q)(ft,{language:vn});case 3:wn=en.sent,wn.status===401?hn.replace("/login",{from:Bt.pathname}):(ta(S.Base64.decode(wn.code)),Hi()),en.next=10;break;case 7:en.prev=7,en.t0=en.catch(0),console.log(en.t0);case 10:case"end":return en.stop()}},Pn,null,[[0,7]])})),zn.apply(this,arguments)}function Yn(){I.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(p.a)(i.a.mark(function wn(){var $n;return i.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Object(E.t)(ft,{language:vn});case 2:$n=In.sent,$n.status===401?hn.replace("/login",{from:Bt.pathname}):ta(S.Base64.decode($n.code));case 4:case"end":return In.stop()}},wn)}))()}})}function Ui(){gt({type:un.SET_SHOW_NOTE,payload:!0})}function Vn(){gt({type:un.SET_SHOW_NOTE,payload:!1})}function Ar(Pn){return Br.apply(this,arguments)}function Br(){return Br=Object(p.a)(i.a.mark(function Pn(wn){return i.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:return en.next=2,Object(E.b)(ft,wn);case 2:gt({type:un.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},Sn),{},{hack:Object(u.a)(Object(u.a)({},gn),{},{notes:wn.notes})})}});case 3:case"end":return en.stop()}},Pn)})),Br.apply(this,arguments)}var $i={input:Sn==null||((pt=Sn.test_case)===null||pt===void 0)?void 0:pt.input,language:gn==null?void 0:gn.language,code:gn==null?void 0:gn.code,title:"main."+Jn[gn==null?void 0:gn.language],modify_code:gn==null?void 0:gn.modify_code,notes:gn==null?void 0:gn.notes,debugResult:ni,debuging:Un,submitting:mi,executingMessage:gi,id:ft,languageValue:vn,languageList:Kn,onChangeLanguage:fi,onCancelNote:Vn,onAddNote:Ar,showNote:bi,onShowNote:Ui,onSubmitCode:Kr,onChangeCode:ta,onChangeInput:Da,onDebugCode:da,onResetCode:xn,onSyncCode:Yn,onUpdateCode:Rr};function Lr(){return Pi.apply(this,arguments)}function Pi(){return Pi=Object(p.a)(i.a.mark(function Pn(){var wn,$n,en;return i.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(E.u)(gn.id,{container_type:"Hack",type:1});case 2:wn=Ei.sent,$n=wn.praise_count,en=Object(u.a)(Object(u.a)({},Sn),{},{hack:Object(u.a)(Object(u.a)({},gn),{},{praises_count:$n,user_praise:!gn.user_praise})}),gt({type:un.SET_DATA,payload:en});case 6:case"end":return Ei.stop()}},Pn)})),Pi.apply(this,arguments)}var or={topicId:ft,submitResult:Ln,submitRecords:Zn,submitting:mi,page:qn,onPageChange:li,hack:gn,user:Sn==null?void 0:Sn.user,onTriggerPraise:Lr};return console.log(Sn,Wt==null?void 0:Wt.current,"data--------"),n.a.createElement(n.a.Fragment,null,n.a.createElement(R.a,{className:"oj-custom-large-spin",size:"large",spinning:Mn},Sn?n.a.createElement("div",{className:"oj-custom-warp"},n.a.createElement("header",{className:b.a.header,style:{minWidth:1200}},n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(_.a.IMG_SERVER,"/images/").concat(qt.image_url),alt:"user",width:30}),n.a.createElement("span",null,qt.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,gn.name),n.a.createElement(wr.a,{onChange:function(wn){},className:"font12 c-grey-999"})),n.a.createElement(_n.CopyToClipboard,{text:"".concat((Kt=window.location)===null||Kt===void 0?void 0:Kt.origin,"/problems/").concat(gn.identifier,"/share"),onCopy:function(){return M.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},n.a.createElement("span",{className:b.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",n.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),gn.edit_privilege?n.a.createElement(O.a,{className:b.a.btn_back,to:"/problems/".concat(gn.identifier,"/ojedit"),style:{marginRight:10}}," ",n.a.createElement(d.a,null)," \u7F16\u8F91"):null,n.a.createElement(O.a,{className:b.a.btn_back,onClick:function(){},to:"/problems"}," ",n.a.createElement(w.a,null),"\u9000\u51FA")),n.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:n.a.createElement(kr,or),rightChild:n.a.createElement(oi,$i)})):null),n.a.createElement(I.a,{centered:!0,closable:!1,width:680,footer:null,visible:Qt,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:vr.a,alt:""}),n.a.createElement("i",{onClick:function(){return on(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Jr.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Ln==null?void 0:Ln.execute_time,"s"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:$r.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Ln==null?void 0:Ln.execute_memory,"mb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Ln==null?void 0:Ln.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function _r(Ye){var pt=Ye.languageValue,Kt=Ye.languageList,fn=Ye.onChangeLanguage,tn=Ye.title,Xt=Ye.modify_code,nt=Ye.onSyncCode,gt=Ye.onShowCodeSetting,cn=Ye.onResetCode,ft=Object(T.h)(),hn=function(){I.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(f.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:cn})};return n.a.createElement("div",{className:"action-bar"},n.a.createElement(Y.a,{className:"oj-select",value:pt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:fn},Kt==null?void 0:Kt.map(function(Bt){return n.a.createElement(Y.a.Option,{key:Bt.language,value:Bt.language},Bt.language)})),n.a.createElement("span",null),n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:hn},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:gt},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function oi(Ye){var pt=Ye.id,Kt=Ye.input,fn=Ye.showNote,tn=Ye.onShowNote,Xt=Ye.notes,nt=Ye.onCancelNote,gt=Ye.onAddNote,cn=Ye.debugResult,ft=Ye.language,hn=Ye.debuging,Bt=Ye.submitting,vn=Ye.executingMessage,Kn=Ye.code,Mn=Ye.onSubmitCode,Sn=Ye.onDebugCode,ni=Ye.onChangeCode,Ln=Ye.onChangeInput,Zn=Ye.onUpdateCode,qn=Object(V.a)(Ye,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function bi(mi){return n.a.createElement(_r,Object(ee.a)({},qn,{onShowCodeSetting:mi}))}var Un={id:pt,input:Kt,debugResult:cn,debuging:hn,submitting:Bt,executingMessage:vn,onDebugCode:Sn,onChangeCode:ni,onSubmitCode:Mn,onChangeInput:Ln};return n.a.createElement("div",{className:"right-panel"},n.a.createElement(c.a,{language:ft,value:Kn,onChange:ni,ActionBarRender:bi}),n.a.createElement("div",{className:"note-form-area ".concat(fn?"active":"")},n.a.createElement(xe,{onCancel:nt,notes:Xt,callback:gt})),n.a.createElement(F.b,Un))}},WaYH:function(Be,we,k){"use strict";var ee=k("rePB"),V=k("Ff2n"),P=k("VTBJ"),Y=k("1OyB"),W=k("vuIU"),R=k("JX7q"),B=k("Ji7U"),M=k("LK+K"),L=k("cDcd"),I=k("TSYQ"),p=k.n(I),m=k("sboe"),u=k("OZM5"),h=function(O){var E=O.prefixCls,v=O.level,_=O.isStart,f=O.isEnd;if(!v)return null;for(var c="".concat(E,"-indent-unit"),S=[],y=0;y<v;y+=1){var b;S.push(L.createElement("span",{key:y,className:p()(c,(b={},Object(ee.a)(b,"".concat(c,"-start"),_[y+1]),Object(ee.a)(b,"".concat(c,"-end"),f[y+1]),Object(ee.a)(b,"".concat(c,"-end-first-level"),!y&&f[0]),b))}))}return L.createElement("span",{"aria-hidden":"true",className:"".concat(E,"-indent")},S)},s=h,l=k("815F"),i="open",r="close",n="---",d=function(x){Object(B.a)(E,x);var O=Object(M.a)(E);function E(){var v;return Object(Y.a)(this,E),v=O.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(_){var f=v.props.context.onNodeClick;f(_,Object(l.b)(v.props)),v.isSelectable()?v.onSelect(_):v.onCheck(_)},v.onSelectorDoubleClick=function(_){var f=v.props.context.onNodeDoubleClick;f(_,Object(l.b)(v.props))},v.onSelect=function(_){if(v.isDisabled())return;var f=v.props.context.onNodeSelect;_.preventDefault(),f(_,Object(l.b)(v.props))},v.onCheck=function(_){if(v.isDisabled())return;var f=v.props,c=f.disableCheckbox,S=f.checked,y=v.props.context.onNodeCheck;if(!v.isCheckable()||c)return;_.preventDefault();var b=!S;y(_,Object(l.b)(v.props),b)},v.onMouseEnter=function(_){var f=v.props.context.onNodeMouseEnter;f(_,Object(l.b)(v.props))},v.onMouseLeave=function(_){var f=v.props.context.onNodeMouseLeave;f(_,Object(l.b)(v.props))},v.onContextMenu=function(_){var f=v.props.context.onNodeContextMenu;f(_,Object(l.b)(v.props))},v.onDragStart=function(_){var f=v.props.context.onNodeDragStart;_.stopPropagation(),v.setState({dragNodeHighlight:!0}),f(_,Object(R.a)(v));try{_.dataTransfer.setData("text/plain","")}catch(c){}},v.onDragEnter=function(_){var f=v.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),f(_,Object(R.a)(v))},v.onDragOver=function(_){var f=v.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),f(_,Object(R.a)(v))},v.onDragLeave=function(_){var f=v.props.context.onNodeDragLeave;_.stopPropagation(),f(_,Object(R.a)(v))},v.onDragEnd=function(_){var f=v.props.context.onNodeDragEnd;_.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(_,Object(R.a)(v))},v.onDrop=function(_){var f=v.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(_,Object(R.a)(v))},v.onExpand=function(_){var f=v.props.context.onNodeExpand;f(_,Object(l.b)(v.props))},v.setSelectHandle=function(_){v.selectHandle=_},v.getNodeState=function(){var _=v.props.expanded;return v.isLeaf()?null:_?i:r},v.hasChildren=function(){var _=v.props.eventKey,f=v.props.context.keyEntities,c=f[_]||{},S=c.children;return!!(S||[]).length},v.isLeaf=function(){var _=v.props,f=_.isLeaf,c=_.loaded,S=v.props.context.loadData,y=v.hasChildren();return f===!1?!1:f||!S&&!y||S&&c&&!y},v.isDisabled=function(){var _=v.props.disabled,f=v.props.context.disabled;return!!(f||_)},v.isCheckable=function(){var _=v.props.checkable,f=v.props.context.checkable;return!f||_===!1?!1:f},v.syncLoadData=function(_){var f=_.expanded,c=_.loading,S=_.loaded,y=v.props.context,b=y.loadData,N=y.onNodeLoad;if(c)return;b&&f&&!v.isLeaf()&&(!v.hasChildren()&&!S&&N(Object(l.b)(v.props)))},v.renderSwitcher=function(){var _=v.props,f=_.expanded,c=_.switcherIcon,S=v.props.context,y=S.prefixCls,b=S.switcherIcon,N=c||b;if(v.isLeaf())return L.createElement("span",{className:p()("".concat(y,"-switcher"),"".concat(y,"-switcher-noop"))},typeof N=="function"?N(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!0})):N);var F=p()("".concat(y,"-switcher"),"".concat(y,"-switcher_").concat(f?i:r));return L.createElement("span",{onClick:v.onExpand,className:F},typeof N=="function"?N(Object(P.a)(Object(P.a)({},v.props),{},{isLeaf:!1})):N)},v.renderCheckbox=function(){var _=v.props,f=_.checked,c=_.halfChecked,S=_.disableCheckbox,y=v.props.context.prefixCls,b=v.isDisabled(),N=v.isCheckable();if(!N)return null;var F=typeof N!="boolean"?N:null;return L.createElement("span",{className:p()("".concat(y,"-checkbox"),f&&"".concat(y,"-checkbox-checked"),!f&&c&&"".concat(y,"-checkbox-indeterminate"),(b||S)&&"".concat(y,"-checkbox-disabled")),onClick:v.onCheck},F)},v.renderIcon=function(){var _=v.props.loading,f=v.props.context.prefixCls;return L.createElement("span",{className:p()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(v.getNodeState()||"docu"),_&&"".concat(f,"-icon_loading"))})},v.renderSelector=function(){var _=v.state.dragNodeHighlight,f=v.props,c=f.title,S=f.selected,y=f.icon,b=f.loading,N=f.data,F=v.props.context,X=F.prefixCls,Z=F.showIcon,H=F.icon,A=F.draggable,z=F.loadData,ne=F.titleRender,ae=v.isDisabled(),me="".concat(X,"-node-content-wrapper"),xe;if(Z){var Te=y||H;xe=Te?L.createElement("span",{className:p()("".concat(X,"-iconEle"),"".concat(X,"-icon__customize"))},typeof Te=="function"?Te(v.props):Te):v.renderIcon()}else z&&b&&(xe=v.renderIcon());var Oe;typeof c=="function"?Oe=c(N):ne?Oe=ne(N):Oe=c;var Ue=L.createElement("span",{className:"".concat(X,"-title")},Oe);return L.createElement("span",{ref:v.setSelectHandle,title:typeof c=="string"?c:"",className:p()("".concat(me),"".concat(me,"-").concat(v.getNodeState()||"normal"),!ae&&(S||_)&&"".concat(X,"-node-selected"),!ae&&A&&"draggable"),draggable:!ae&&A||void 0,"aria-grabbed":!ae&&A||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:A?v.onDragStart:void 0},xe,Ue)},v}return Object(W.a)(E,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,f=this.props.context.selectable;return typeof _=="boolean"?_:f}},{key:"render",value:function(){var _,f=this.props,c=f.eventKey,S=f.className,y=f.style,b=f.dragOver,N=f.dragOverGapTop,F=f.dragOverGapBottom,X=f.isLeaf,Z=f.isStart,H=f.isEnd,A=f.expanded,z=f.selected,ne=f.checked,ae=f.halfChecked,me=f.loading,xe=f.domRef,Te=f.active,Oe=f.onMouseMove,Ue=Object(V.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),De=this.props.context,be=De.prefixCls,ge=De.filterTreeNode,He=De.draggable,ct=De.keyEntities,vt=this.isDisabled(),_t=Object(u.f)(Ue),yt=ct[c]||{},et=yt.level,ht=H[H.length-1];return L.createElement("div",Object.assign({ref:xe,className:p()(S,"".concat(be,"-treenode"),(_={},Object(ee.a)(_,"".concat(be,"-treenode-disabled"),vt),Object(ee.a)(_,"".concat(be,"-treenode-switcher-").concat(A?"open":"close"),!X),Object(ee.a)(_,"".concat(be,"-treenode-checkbox-checked"),ne),Object(ee.a)(_,"".concat(be,"-treenode-checkbox-indeterminate"),ae),Object(ee.a)(_,"".concat(be,"-treenode-selected"),z),Object(ee.a)(_,"".concat(be,"-treenode-loading"),me),Object(ee.a)(_,"".concat(be,"-treenode-active"),Te),Object(ee.a)(_,"".concat(be,"-treenode-leaf-last"),ht),Object(ee.a)(_,"drag-over",!vt&&b),Object(ee.a)(_,"drag-over-gap-top",!vt&&N),Object(ee.a)(_,"drag-over-gap-bottom",!vt&&F),Object(ee.a)(_,"filter-node",ge&&ge(Object(l.b)(this.props))),_)),style:y,onDragEnter:He?this.onDragEnter:void 0,onDragOver:He?this.onDragOver:void 0,onDragLeave:He?this.onDragLeave:void 0,onDrop:He?this.onDrop:void 0,onDragEnd:He?this.onDragEnd:void 0,onMouseMove:Oe},_t),L.createElement(s,{prefixCls:be,level:et,isStart:Z,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),E}(L.Component),w=function(O){return L.createElement(m.a.Consumer,null,function(E){return L.createElement(d,Object.assign({},O,{context:E}))})};w.displayName="TreeNode",w.defaultProps={title:n},w.isTreeNode=1;var T=we.a=w},Wtmd:function(Be,we,k){Be.exports=k.p+"static/c.03ba6fd6.svg"},Wx9E:function(Be,we,k){},XIdC:function(Be,we,k){"use strict";var ee=k("rePB"),V=k("ODXe"),P=k("Ff2n"),Y=k("cDcd"),W=k.n(Y),R=k("TSYQ"),B=k.n(R),M=k("6cGi"),L=k("4IlW"),I=Y.forwardRef(function(p,m){var u,h=p.prefixCls,s=h===void 0?"rc-switch":h,l=p.className,i=p.checked,r=p.defaultChecked,n=p.disabled,d=p.loadingIcon,w=p.checkedChildren,T=p.unCheckedChildren,x=p.onClick,O=p.onChange,E=p.onKeyDown,v=Object(P.a)(p,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),_=Object(M.a)(!1,{value:i,defaultValue:r}),f=Object(V.a)(_,2),c=f[0],S=f[1];function y(X,Z){var H=c;return n||(H=X,S(H),O==null||O(H,Z)),H}function b(X){X.which===L.a.LEFT?y(!1,X):X.which===L.a.RIGHT&&y(!0,X),E==null||E(X)}function N(X){var Z=y(!c,X);x==null||x(Z,X)}var F=B()(s,l,(u={},Object(ee.a)(u,"".concat(s,"-checked"),c),Object(ee.a)(u,"".concat(s,"-disabled"),n),u));return Y.createElement("button",Object.assign({},v,{type:"button",role:"switch","aria-checked":c,disabled:n,className:F,ref:m,onKeyDown:b,onClick:N}),d,Y.createElement("span",{className:"".concat(s,"-inner")},c?w:T))});I.displayName="Switch",we.a=I},Y1PL:function(Be,we,k){"use strict";k.r(we),k.d(we,"ResizableTextArea",function(){return ae});var ee=k("wx14"),V=k("1OyB"),P=k("vuIU"),Y=k("Ji7U"),W=k("LK+K"),R=k("cDcd"),B=k("VTBJ"),M=k("rePB"),L=k("Zm9Q"),I=k("Kwbf"),p=k("c+Xe"),m=k("m+aA"),u=k("bdgK"),h=new Map;function s(Te){Te.forEach(function(Oe){var Ue,De=Oe.target;(Ue=h.get(De))===null||Ue===void 0||Ue.forEach(function(be){return be(De)})})}var l=new u.default(s),i=null,r=null;function n(Te,Oe){h.has(Te)||(h.set(Te,new Set),l.observe(Te)),h.get(Te).add(Oe)}function d(Te,Oe){h.has(Te)&&(h.get(Te).delete(Oe),h.get(Te).size||(l.unobserve(Te),h.delete(Te)))}var w=function(Te){Object(Y.a)(Ue,Te);var Oe=Object(W.a)(Ue);function Ue(){return Object(V.a)(this,Ue),Oe.apply(this,arguments)}return Object(P.a)(Ue,[{key:"render",value:function(){return this.props.children}}]),Ue}(R.Component),T=R.createContext(null);function x(Te){var Oe=Te.children,Ue=Te.onBatchResize,De=R.useRef(0),be=R.useRef([]),ge=R.useContext(T),He=R.useCallback(function(ct,vt,_t){De.current+=1;var yt=De.current;be.current.push({size:ct,element:vt,data:_t}),Promise.resolve().then(function(){yt===De.current&&(Ue==null||Ue(be.current),be.current=[])}),ge==null||ge(ct,vt,_t)},[Ue,ge]);return R.createElement(T.Provider,{value:He},Oe)}function O(Te){var Oe=Te.children,Ue=Te.disabled,De=R.useRef(null),be=R.useRef(null),ge=R.useContext(T),He=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ct=R.isValidElement(Oe)&&Object(p.c)(Oe),vt=ct?Oe.ref:null,_t=R.useMemo(function(){return Object(p.a)(vt,De)},[vt,De]),yt=R.useRef(Te);yt.current=Te;var et=R.useCallback(function(ht){var xt=yt.current,Tt=xt.onResize,mt=xt.data,Ie=ht.getBoundingClientRect(),je=Ie.width,$e=Ie.height,at=ht.offsetWidth,lt=ht.offsetHeight,bt=Math.floor(je),Mt=Math.floor($e);if(He.current.width!==bt||He.current.height!==Mt||He.current.offsetWidth!==at||He.current.offsetHeight!==lt){var jt={width:bt,height:Mt,offsetWidth:at,offsetHeight:lt};He.current=jt;var Me=at===Math.round(je)?je:at,Pe=lt===Math.round($e)?$e:lt,tt=Object(B.a)(Object(B.a)({},jt),{},{offsetWidth:Me,offsetHeight:Pe});ge==null||ge(tt,ht,mt),Tt&&Promise.resolve().then(function(){Tt(tt,ht)})}},[]);return R.useEffect(function(){var ht=Object(m.a)(De.current)||Object(m.a)(be.current);return ht&&!Ue&&n(ht,et),function(){return d(ht,et)}},[De.current,Ue]),R.createElement(w,{ref:be},ct?R.cloneElement(Oe,{ref:_t}):Oe)}var E="rc-observer-key";function v(Te){var Oe=Te.children,Ue=Object(L.a)(Oe);return Ue.map(function(De,be){var ge=(De==null?void 0:De.key)||"".concat(E,"-").concat(be);return R.createElement(O,Object(ee.a)({},Te,{key:ge}),De)})}v.Collection=x;var _=v,f=k("bT9E"),c=k("TSYQ"),S=k.n(c),y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},F;function X(Te){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(Oe&&N[Ue])return N[Ue];var De=window.getComputedStyle(Te),be=De.getPropertyValue("box-sizing")||De.getPropertyValue("-moz-box-sizing")||De.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(De.getPropertyValue("padding-bottom"))+parseFloat(De.getPropertyValue("padding-top")),He=parseFloat(De.getPropertyValue("border-bottom-width"))+parseFloat(De.getPropertyValue("border-top-width")),ct=b.map(function(_t){return"".concat(_t,":").concat(De.getPropertyValue(_t))}).join(";"),vt={sizingStyle:ct,paddingSize:ge,borderSize:He,boxSizing:be};return Oe&&Ue&&(N[Ue]=vt),vt}function Z(Te){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Te.getAttribute("wrap")?F.setAttribute("wrap",Te.getAttribute("wrap")):F.removeAttribute("wrap");var be=X(Te,Oe),ge=be.paddingSize,He=be.borderSize,ct=be.boxSizing,vt=be.sizingStyle;F.setAttribute("style","".concat(vt,";").concat(y)),F.value=Te.value||Te.placeholder||"";var _t=Number.MIN_SAFE_INTEGER,yt=Number.MAX_SAFE_INTEGER,et=F.scrollHeight,ht;if(ct==="border-box"?et+=He:ct==="content-box"&&(et-=ge),Ue!==null||De!==null){F.value=" ";var xt=F.scrollHeight-ge;Ue!==null&&(_t=xt*Ue,ct==="border-box"&&(_t=_t+ge+He),et=Math.max(_t,et)),De!==null&&(yt=xt*De,ct==="border-box"&&(yt=yt+ge+He),ht=et>yt?"":"hidden",et=Math.min(yt,et))}return{height:et,minHeight:_t,maxHeight:yt,overflowY:ht,resize:"none"}}var H=k("Gytx"),A=k.n(H),z;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(z||(z={}));var ne=function(Te){Object(Y.a)(Ue,Te);var Oe=Object(W.a)(Ue);function Ue(De){var be;return Object(V.a)(this,Ue),be=Oe.call(this,De),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(ge){be.textArea=ge},be.handleResize=function(ge){var He=be.state.resizeStatus,ct=be.props,vt=ct.autoSize,_t=ct.onResize;if(He!==z.NONE)return;typeof _t=="function"&&_t(ge),vt&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var ge=be.props.autoSize;if(!ge||!be.textArea)return;var He=ge.minRows,ct=ge.maxRows,vt=Z(be.textArea,!1,He,ct);be.setState({textareaStyles:vt,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:z.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:z.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var ge=be.props,He=ge.prefixCls,ct=He===void 0?"rc-textarea":He,vt=ge.autoSize,_t=ge.onResize,yt=ge.className,et=ge.disabled,ht=be.state,xt=ht.textareaStyles,Tt=ht.resizeStatus,mt=Object(f.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=S()(ct,yt,Object(M.a)({},"".concat(ct,"-disabled"),et));"value"in mt&&(mt.value=mt.value||"");var je=Object(B.a)(Object(B.a)(Object(B.a)({},be.props.style),xt),Tt===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(_,{onResize:be.handleResize,disabled:!(vt||_t)},R.createElement("textarea",Object(ee.a)({},mt,{className:Ie,style:je,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:z.NONE},be}return Object(P.a)(Ue,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!A()(be.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 be=this.textArea.selectionStart,ge=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,ge)}}catch(He){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ue}(R.Component),ae=ne,me=function(Te){Object(Y.a)(Ue,Te);var Oe=Object(W.a)(Ue);function Ue(De){var be;Object(V.a)(this,Ue),be=Oe.call(this,De),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(He){be.resizableTextArea=He},be.handleChange=function(He){var ct=be.props.onChange;be.setValue(He.target.value,function(){be.resizableTextArea.resizeTextarea()}),ct&&ct(He)},be.handleKeyDown=function(He){var ct=be.props,vt=ct.onPressEnter,_t=ct.onKeyDown;He.keyCode===13&&vt&&vt(He),_t&&_t(He)};var ge=typeof De.value=="undefined"||De.value===null?De.defaultValue:De.value;return be.state={value:ge},be}return Object(P.a)(Ue,[{key:"setValue",value:function(be,ge){"value"in this.props||this.setState({value:be},ge)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(ae,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Ue}(R.Component),xe=we.default=me},Z8dc:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(Be,we,k){"use strict";var ee=k("BoS7"),V=k("Sdc0"),P=k("OaEy"),Y=k("2fM7"),W=k("cDcd"),R=k.n(W),B=k("lOMy"),M=k.n(B),L=Y.a.Option;we.a=function(I){var p=I.onFontSizeChange,m=I.cmFontSize,u=I.cmCodeMode,h=I.onCodeModeChange,s=I.onTabToSpace,l=I.className,i=l===void 0?"":l,r=I.tabToSpace,n=I.children;return R.a.createElement("div",{className:"tpi-code-setting ".concat(i)},R.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),R.a.createElement(Y.a,{bordered:!1,size:"small",value:u,onChange:h},R.a.createElement(L,{value:"vs"},"\u767D\u8272\u80CC\u666F"),R.a.createElement(L,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),R.a.createElement(Y.a,{bordered:!1,size:"small",value:m,onChange:p},R.a.createElement(L,{value:12},"12px"),R.a.createElement(L,{value:14},"14px"),R.a.createElement(L,{value:16},"16px"),R.a.createElement(L,{value:18},"18px"),R.a.createElement(L,{value:20},"20px"),R.a.createElement(L,{value:22},"22px"))),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"Tab\u8F6C\u6362"),R.a.createElement(V.a,{checked:r,onChange:s}))),R.a.createElement("h3",null,"\u5FEB\u6377\u952E"),R.a.createElement("section",null,R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),R.a.createElement("span",null,"Ctrl + S")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),R.a.createElement("span",null,"F1 / Alt + F1")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),R.a.createElement("span",null,"Ctrl + ]/[")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),R.a.createElement("span",null,"Ctrl + Shift + \\")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),R.a.createElement("span",null,"Home")),R.a.createElement("div",{className:"file-item"},R.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),R.a.createElement("span",null,"End"))),n)}},ZW9T:function(Be,we,k){"use strict";k.d(we,"a",function(){return Z});var ee=k("k1fw"),V=k("miYZ"),P=k("tsqr"),Y=k("rAM+"),W=k("tJVT"),R=k("PpiC"),B=k("cDcd"),M=k.n(B),L=k("bdgK"),I=k("oBTY"),p=k("9og8"),m=k("WmNS"),u=k.n(m),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},s={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},l={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},r=k("5VLF"),n=k.n(r),d={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},w=function(A,z){return z.map(function(ne){return{label:ne,kind:A.languages.CompletionItemKind.Keyword,insertText:ne}})},T=function(A){return Object.keys(d.tables).map(function(z){return{label:z,kind:A.languages.CompletionItemKind.Variable,insertText:z}})},x=function(A,z){var ne=d.tables[A];return ne?ne.map(function(ae){return{label:ae,kind:z.languages.CompletionItemKind.Field,insertText:ae}}):[]};function O(H,A,z,ne,ae){var me=A.getWordUntilPosition(z),xe={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:me.startColumn,endColumn:me.endColumn},Te=ne.map(function(Oe){return{label:Oe,kind:H.languages.CompletionItemKind.Keyword,insertText:Oe,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return ae.map(function(Oe){Te.push(Object(ee.a)(Object(ee.a)({},Oe),{},{range:xe}))}),Te}var E=function(H){d.languages.map(function(ae){return H.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits:function(xe,Te,Oe){return Object(p.a)(u.a.mark(function Ue(){var De;return u.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return De=n()(xe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ge.abrupt("return",[{range:xe.getFullModelRange(),text:De}]);case 2:case"end":return ge.stop()}},Ue)}))()}}),ae});var A=l.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=i.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=s.quickKey.map(function(ae){return{label:ae.label,kind:H.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:H.languages.CompletionItemInsertTextRule.InsertAsSnippet}});H.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(l.keywords),Object(I.a)(l.quickKey.map(function(ae){return ae.label}))),provideCompletionItems:function(me,xe){var Te=me.getValueInRange({startLineNumber:xe.lineNumber,startColumn:1,endLineNumber:xe.lineNumber,endColumn:xe.column}),Oe=Te.match(/cu/gim);console.log("match:",Oe,xe,Te,me);var Ue=[],De=xe.lineNumber,be=xe.column,ge=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:be}),He=ge.trim().split(/\s+/),ct=He[He.length-1];if(ct.endsWith(".")){var vt=ct.slice(0,ct.length-1);Object.keys(d.tables).includes(vt)&&(Ue=Object(I.a)(x(vt,H)))}else ct==="."?Ue=[]:Ue=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,l.keywords)),Object(I.a)(A));return{suggestions:Ue}}}),H.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(h.keywords)),provideCompletionItems:function(me,xe){var Te=me.getValueInRange({startLineNumber:xe.lineNumber,startColumn:1,endLineNumber:xe.lineNumber,endColumn:xe.column}),Oe=Te.match(/cu/gim);console.log("match:",Oe,xe,Te,me);var Ue=[],De=xe.lineNumber,be=xe.column,ge=me.getValueInRange({startLineNumber:De,startColumn:0,endLineNumber:De,endColumn:be}),He=ge.trim().split(/\s+/),ct=He[He.length-1];if(ct.endsWith(".")){var vt=ct.slice(0,ct.length-1);Object.keys(d.tables).includes(vt)&&(Ue=Object(I.a)(x(vt,H)))}else ct==="."?Ue=[]:Ue=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,h.keywords)));return{suggestions:Ue}}}),H.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(s.keywords)),provideCompletionItems:function(me,xe){var Te=[],Oe=xe.lineNumber,Ue=xe.column,De=me.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ue}),be=De.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var He=ge.slice(0,ge.length-1);Object.keys(d.tables).includes(He)&&(Te=Object(I.a)(x(He,H)))}else ge==="."?Te=[]:Te=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,s.keywords)),Object(I.a)(ne));return{suggestions:Te}}}),H.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(i.keywords)),provideCompletionItems:function(me,xe){var Te=[],Oe=xe.lineNumber,Ue=xe.column,De=me.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:Ue}),be=De.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var He=ge.slice(0,ge.length-1);Object.keys(d.tables).includes(He)&&(Te=Object(I.a)(x(He,H)))}else ge==="."?Te=[]:Te=[].concat(Object(I.a)(T(H)),Object(I.a)(w(H,i.keywords)),Object(I.a)(z));return{suggestions:Te}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=k("LvDl"),f=k("+ua5");function c(H){return/^\d+$/.test(H)?"".concat(H,"px"):H}function S(){}var y=!1,b={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function N(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=H;if(Array.isArray(H)){for(var z=0;z<H.length;z++){var ne=b[H[z]];if(ne)return ne}return A[0]}return b[A]||A}var F=null,X=we.b=function(H){var A=H.width,z=A===void 0?"100%":A,ne=H.height,ae=ne===void 0?"100%":ne,me=H.value,xe=H.language,Te=xe===void 0?"javascript":xe,Oe=H.style,Ue=Oe===void 0?{}:Oe,De=H.options,be=De===void 0?{}:De,ge=H.overrideServices,He=ge===void 0?{}:ge,ct=H.theme,vt=ct===void 0?"vs-dark":ct,_t=H.onEditBlur,yt=H.onSave,et=H.autoHeight,ht=et===void 0?!1:et,xt=H.forbidCopy,Tt=xt===void 0?!1:xt,mt=H.onChange,Ie=mt===void 0?S:mt,je=H.editorDidMount,$e=je===void 0?S:je,at=H.onFocus,lt=at===void 0?S:at,bt=H.filename,Mt=bt===void 0?"educoder.txt":bt,jt=H.errorLine,Me=H.errorContent,Pe=Me===void 0?"":Me,tt=Object(R.a)(H,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),rt=Object(B.useRef)(),Fe=Object(B.useRef)({}),Je=Object(B.useRef)(),Ee=Object(B.useRef)(!1),ye=Object(B.useRef)(),_e=Object(B.useState)(!1),le=Object(W.a)(_e,2),de=le[0],ve=le[1];function pe(){var ke;return rt.current&&(ke=new L.default(function(qe){var Rt=Object(Y.a)(qe),Pt;try{for(Rt.s();!(Pt=Rt.n()).done;){var $t=Pt.value;($t.target.offsetHeight>0||$t.target.offsetWidth>0)&&Fe.current.instance.layout()}}catch(fe){Rt.e(fe)}finally{Rt.f()}}),ke.observe(rt.current)),ke}function Ce(){P.b.warn(decodeURIComponent(v))}var Ke=function(){var qe=Fe.current.instance;if(me!=null&&qe&&de){var Rt=qe.getModel();Rt&&me!==Rt.getValue()&&(y=!0,Rt.setValue(me),qe.layout(),y=!1)}};Object(B.useEffect)(function(){Je.current&&clearTimeout(Je.current),Je.current=setTimeout(function(){Ke()},500)},[me,de,Fe.current]),Object(B.useEffect)(function(){if(jt&&Fe.current&&Fe.current.instance){var ke=Fe.current.instance;ke.changeViewZones(function(Rt){var Pt=document.createElement("div");Pt.style.padding="10px 20px",Pt.style.width="calc(100% - 20px)",Pt.className="my-error-line-wrp",Pt.innerHTML=Pe,Rt.addZone({afterLineNumber:jt||11,heightInLines:3,domNode:Pt})});var qe={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};ke.addOverlayWidget(qe),ke.revealPositionInCenter({lineNumber:20,column:1})}},[jt,Fe.current,de]);function st(){var ke=Fe.current.instance;if(ke){var qe=ke.getSelection(),Rt=Fe.current.pastePos||{},Pt=new F.Range(Rt.startLineNumber||qe.endLineNumber,Rt.startColumn||qe.endColumn,Rt.endLineNumber||qe.endLineNumber,Rt.endColumn||qe.endColumn);setTimeout(function(){ke.executeEdits("",[{range:Pt,text:""}])},300)}}function At(ke){(window.navigator.platform.match("Mac")?ke.metaKey:ke.ctrlKey)&&ke.keyCode==83&&(ke.preventDefault(),yt())}var Ft=function(){if(ht&&Fe.current.instance){var qe=Fe.current.instance.getContentHeight();Lt(qe<ae?ae:qe)}else Lt(ae)};function kt(ke){var qe=document.createEvent("MouseEvents");qe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ke.dispatchEvent(qe)}function wt(ke,qe){var Rt=window.URL||window.webkitURL||window,Pt=new Blob([qe]),$t=document.createElementNS("http://www.w3.org/1999/xhtml","a");$t.href=Rt.createObjectURL(Pt),$t.download=ke,kt($t)}Object(B.useEffect)(function(){Ft()},[Ft]),Object(B.useEffect)(function(){rt.current&&!de&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(ke){try{F=ke,Fe.current.instance=F.editor.create(rt.current,{value:me,language:N(Te),theme:vt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},He);var qe=Fe.current.instance;if($e(qe,F),setTimeout(function(){Ft(),Fe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){wt(Mt||"educoder.txt",qe.getValue())}})},500),Fe.current.subscription=qe.onDidChangeModelContent(function(Pt){Ee.current?clearTimeout(ye.current):(Ft(),Ie(qe.getValue(),Pt)),ye.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||E(F),Tt&&(qe.addCommand(F.KeyMod.CtrlCmd|F.KeyMod.Shift|F.KeyCode.KEY_V,function(){return Ce(),null}),qe.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_C,function(){return Ce(),null})),window.Monaco=F,_t&&qe.onDidBlurEditorWidget(function(){_t(qe.getValue())}),lt&&qe.onDidFocusEditorText(function(){lt(qe.getValue())}),Tt){qe.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_V,function(){return Ce(),null}),qe.onDidPaste(function(Pt){Fe.current.pastePos=Pt});try{window.addEventListener("paste",st)}catch(Pt){}}var Rt=pe();return ve(!0),function(){var Pt=Fe.current.instance;Pt.dispose();var $t=Pt.getModel();$t&&$t.dispose(),Fe.current.subscription&&Fe.current.subscription.dispose(),Tt&&window.removeEventListener("paste",st),Rt.unobserve(rt.current)}}catch(Pt){}})},[]),Object(B.useEffect)(function(){var ke=Fe.current.instance;if(ke&&de)return document.addEventListener("keydown",At,!1),function(){document.removeEventListener("keydown",At)}},[yt,de]),Object(B.useEffect)(function(){var ke=Fe.current.instance;if(ke&&de){var qe=N(Te);F.editor.setModelLanguage(ke.getModel(),qe),console.log("language:",Te,ke.getModel(),qe)}},[Te,de]),Object(B.useEffect)(function(){var ke=Fe.current.instance;ke&&de&&F.editor.setTheme(vt)},[vt,de]),Object(B.useEffect)(function(){var ke=Fe.current.instance;ke&&de&&(ke.updateOptions(Object(ee.a)({},be)),setTimeout(function(){ke.getModel().updateOptions(Object(ee.a)({},be))},200))},[JSON.stringify(be),de]),Object(B.useEffect)(function(){var ke=Fe.current.instance;ke&&de&&ke.layout()},[z,ae,de]);var Qe=Object(B.useState)(c(z)),it=Object(W.a)(Qe,2),We=it[0],ce=it[1],Se=Object(B.useState)(c(ae)),ot=Object(W.a)(Se,2),ze=ot[0],Lt=ot[1],Dt=Object(ee.a)(Object(ee.a)({},Ue),{},{width:We,height:ze});return M.a.createElement("div",{className:"my-monaco-editor",ref:rt,style:Dt})};function Z(H){var A=H.width,z=A===void 0?"100%":A,ne=H.height,ae=ne===void 0?"100%":ne,me=H.original,xe=H.modified,Te=H.language,Oe=H.options,Ue=Oe===void 0?{}:Oe,De=Object(B.useRef)(),be=Object(B.useState)(null),ge=Object(W.a)(be,2),He=ge[0],ct=ge[1];function vt(ht){var xt;return De.current&&(xt=new L.default(function(Tt){var mt=Object(Y.a)(Tt),Ie;try{for(mt.s();!(Ie=mt.n()).done;){var je=Ie.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&ht.layout()}}catch($e){mt.e($e)}finally{mt.f()}}),xt.observe(De.current)),xt}Object(B.useEffect)(function(){De.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(ht){F=ht;var xt=F.editor.createDiffEditor(De.current,Object(ee.a)(Object(ee.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ue),{},{wordWrap:!0}));ct(xt);var Tt=vt(xt);return function(){xt.dispose();var mt=xt.getModel();mt&&mt.dispose(),Tt.unobserve(De.current)}})},[]),Object(B.useEffect)(function(){He&&He.setModel({original:F.editor.createModel(me,Te),modified:F.editor.createModel(xe,Te)})},[me,xe,Te,He]);var _t=c(z),yt=c(ae),et={width:_t,height:yt};return M.a.createElement("div",{className:"my-diff-editor",ref:De,style:et})}},ZpRC:function(Be,we,k){"use strict";function ee(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function V(p,m){return(!m||p!=="hidden")&&p!=="visible"&&p!=="clip"}function P(p,m){if(p.clientHeight<p.scrollHeight||p.clientWidth<p.scrollWidth){var u=getComputedStyle(p,null);return V(u.overflowY,m)||V(u.overflowX,m)||function(h){var s=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(i){return null}}(h);return!!s&&(s.clientHeight<h.scrollHeight||s.clientWidth<h.scrollWidth)}(p)}return!1}function Y(p,m,u,h,s,l,i,r){return l<p&&i>m||l>p&&i<m?0:l<=p&&r<=u||i>=m&&r>=u?l-p-h:i>m&&r<u||l<p&&r>u?i-m+s:0}var W=function(p,m){var u=window,h=m.scrollMode,s=m.block,l=m.inline,i=m.boundary,r=m.skipOverflowHiddenElements,n=typeof i=="function"?i:function(xt){return xt!==i};if(!ee(p))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,w=[],T=p;ee(T)&&n(T);){if((T=T.parentElement)===d){w.push(T);break}T!=null&&T===document.body&&P(T)&&!P(document.documentElement)||T!=null&&P(T,r)&&w.push(T)}for(var x=u.visualViewport?u.visualViewport.width:innerWidth,O=u.visualViewport?u.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,_=p.getBoundingClientRect(),f=_.height,c=_.width,S=_.top,y=_.right,b=_.bottom,N=_.left,F=s==="start"||s==="nearest"?S:s==="end"?b:S+f/2,X=l==="center"?N+c/2:l==="end"?y:N,Z=[],H=0;H<w.length;H++){var A=w[H],z=A.getBoundingClientRect(),ne=z.height,ae=z.width,me=z.top,xe=z.right,Te=z.bottom,Oe=z.left;if(h==="if-needed"&&S>=0&&N>=0&&b<=O&&y<=x&&S>=me&&b<=Te&&N>=Oe&&y<=xe)return Z;var Ue=getComputedStyle(A),De=parseInt(Ue.borderLeftWidth,10),be=parseInt(Ue.borderTopWidth,10),ge=parseInt(Ue.borderRightWidth,10),He=parseInt(Ue.borderBottomWidth,10),ct=0,vt=0,_t="offsetWidth"in A?A.offsetWidth-A.clientWidth-De-ge:0,yt="offsetHeight"in A?A.offsetHeight-A.clientHeight-be-He:0;if(d===A)ct=s==="start"?F:s==="end"?F-O:s==="nearest"?Y(v,v+O,O,be,He,v+F,v+F+f,f):F-O/2,vt=l==="start"?X:l==="center"?X-x/2:l==="end"?X-x:Y(E,E+x,x,De,ge,E+X,E+X+c,c),ct=Math.max(0,ct+v),vt=Math.max(0,vt+E);else{ct=s==="start"?F-me-be:s==="end"?F-Te+He+yt:s==="nearest"?Y(me,Te,ne,be,He+yt,F,F+f,f):F-(me+ne/2)+yt/2,vt=l==="start"?X-Oe-De:l==="center"?X-(Oe+ae/2)+_t/2:l==="end"?X-xe+ge+_t:Y(Oe,xe,ae,De,ge+_t,X,X+c,c);var et=A.scrollLeft,ht=A.scrollTop;F+=ht-(ct=Math.max(0,Math.min(ht+ct,A.scrollHeight-ne+yt))),X+=et-(vt=Math.max(0,Math.min(et+vt,A.scrollWidth-ae+_t)))}Z.push({el:A,top:ct,left:vt})}return Z};function R(p){return p===Object(p)&&Object.keys(p).length!==0}function B(p,m){m===void 0&&(m="auto");var u="scrollBehavior"in document.body.style;p.forEach(function(h){var s=h.el,l=h.top,i=h.left;s.scroll&&u?s.scroll({top:l,left:i,behavior:m}):(s.scrollTop=l,s.scrollLeft=i)})}function M(p){return p===!1?{block:"end",inline:"nearest"}:R(p)?p:{block:"start",inline:"nearest"}}function L(p,m){var u=!p.ownerDocument.documentElement.contains(p);if(R(m)&&typeof m.behavior=="function")return m.behavior(u?[]:W(p,m));if(u)return;var h=M(m);return B(W(p,h),h.behavior)}var I=we.a=L},ZsLC:function(Be,we,k){Be.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(Be,we,k){"use strict";k.d(we,"b",function(){return Y}),k.d(we,"a",function(){return W});var ee=k("je13"),V=k.n(ee),P=!1;function Y(R,B){var M=V.a.get("__ec");M||(M={}),M[R]=B,V.a.set("__ec",M)}function W(R,B){var M=V.a.get("__ec");return M?M[R]===void 0?B:M[R]:B}},bT9E:function(Be,we,k){"use strict";k.d(we,"a",function(){return V});var ee=k("VTBJ");function V(P,Y){var W=Object(ee.a)({},P);return Array.isArray(Y)&&Y.forEach(function(R){delete W[R]}),W}},bdLU:function(Be,we,k){"use strict";k.d(we,"a",function(){return ee});var ee;(function(V){V[V.NOMATCH=-1]="NOMATCH",V[V.OK=0]="OK",V[V.TIMEOUT=2]="TIMEOUT",V[V.PODFAILURE=3]="PODFAILURE",V[V.COMPILEFAILURE=4]="COMPILEFAILURE",V[V.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(ee||(ee={}))},biw7:function(Be,we,k){"use strict";var ee=k("cDcd"),V=k.n(ee),P=ee.createContext(null);we.a=P},c5Ni:function(Be,we,k){},cDPC:function(Be,we,k){"use strict";var ee=k("tJVT"),V=k("cDcd"),P=k.n(V),Y=k("i3hx"),W=k.n(Y);we.a=function(R){var B=R.defaultX,M=B===void 0?"40%":B,L=R.leftChild,I=R.rightChild,p=R.className,m=R.hideResize,u=m===void 0?!1:m,h=Object(V.useState)(M),s=Object(ee.a)(h,2),l=s[0],i=s[1],r=Object(V.useRef)();function n(){r.current=!0}Object(V.useEffect)(function(){function T(O){r.current&&i(O.pageX)}function x(){r.current=!1}return window.addEventListener("mousemove",T),window.addEventListener("mouseup",x),function(){window.removeEventListener("mousemove",T),window.removeEventListener("mouseup",x)}},[]);var d=typeof l=="number"&&l!==.01?"".concat(l,"px"):M,w="calc(100% - ".concat(u?"0px":"4px"," - ").concat(d,")");return P.a.createElement("div",{className:"split-panel-container ".concat(p)},P.a.createElement("section",{style:{width:d,display:l===.01?"none":""}},L),P.a.createElement("section",{className:"resize-x-bar",onMouseDown:n},P.a.createElement("a",{className:"btn-resize"},P.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},P.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),P.a.createElement("section",{style:{width:w}},I))}},dejd:function(Be,we,k){},dmUQ:function(Be,we,k){"use strict";var ee=k("Ff2n"),V=k("rePB"),P=k("1OyB"),Y=k("vuIU"),W=k("Ji7U"),R=k("md7G"),B=k("foSv"),M=k("cDcd"),L=k.n(M),I=k("TSYQ"),p=k.n(I),m=k("4IlW");function u(f,c){var S=Object.keys(f);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(f);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),S.push.apply(S,y)}return S}function h(f){for(var c=1;c<arguments.length;c++){var S=arguments[c]!=null?arguments[c]:{};c%2?u(Object(S),!0).forEach(function(y){Object(V.a)(f,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(S)):u(Object(S)).forEach(function(y){Object.defineProperty(f,y,Object.getOwnPropertyDescriptor(S,y))})}return f}function s(f){var c=l();return function(){var y=Object(B.a)(f),b;if(c){var N=Object(B.a)(this).constructor;b=Reflect.construct(y,arguments,N)}else b=y.apply(this,arguments);return Object(R.a)(this,b)}}function l(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(f){return!1}}function i(){}function r(f){f.preventDefault()}var n=function(c){return c.replace(/[^\w.-]+/g,"")},d=200,w=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(c){return c!=null},O=function(c,S){return S===c||typeof S=="number"&&typeof c=="number"&&isNaN(S)&&isNaN(c)},E=function(f){Object(W.a)(S,f);var c=s(S);function S(y){var b;Object(P.a)(this,S),b=c.call(this,y),b.onKeyDown=function(X){var Z=b.props,H=Z.onKeyDown,A=Z.onPressEnter;if(X.keyCode===m.a.UP){var z=b.getRatio(X);b.up(X,z,null),b.stop()}else if(X.keyCode===m.a.DOWN){var ne=b.getRatio(X);b.down(X,ne,null),b.stop()}else X.keyCode===m.a.ENTER&&A&&A(X);if(b.recordCursorPosition(),b.lastKeyCode=X.keyCode,H){for(var ae=arguments.length,me=new Array(ae>1?ae-1:0),xe=1;xe<ae;xe++)me[xe-1]=arguments[xe];H.apply(void 0,[X].concat(me))}},b.onKeyUp=function(X){var Z=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),Z){for(var H=arguments.length,A=new Array(H>1?H-1:0),z=1;z<H;z++)A[z-1]=arguments[z];Z.apply(void 0,[X].concat(A))}},b.onChange=function(X){var Z=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(X)),b.setState({inputValue:b.rawInput}),Z(b.toNumber(b.rawInput))},b.onMouseUp=function(){var X=b.props.onMouseUp;b.recordCursorPosition(),X&&X.apply(void 0,arguments)},b.onFocus=function(){var X;b.setState({focused:!0}),(X=b.props).onFocus.apply(X,arguments)},b.onBlur=function(){var X=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var Z=b.getCurrentValidValue(b.state.inputValue),H=b.setValue(Z,i);if(X){var A=b.input.value,z=b.getInputDisplayValue({focus:!1,value:H});b.input.value=z&&Number(z),X.apply(void 0,arguments),b.input.value=A}},b.getRatio=function(X){var Z=1;return X.metaKey||X.ctrlKey?Z=.1:X.shiftKey&&(Z=10),Z},b.getFullNum=function(X){return isNaN(X)?X:/e/i.test(String(X))?Number(X).toFixed(18).replace(/\.?0+$/,""):X},b.getPrecision=function(X){if(x(b.props.precision))return b.props.precision;var Z=String(X);if(Z.indexOf("e-")>=0)return parseInt(Z.slice(Z.indexOf("e-")+2),10);var H=0;return Z.indexOf(".")>=0&&(H=Z.length-Z.indexOf(".")-1),H},b.getInputDisplayValue=function(X){var Z=X||b.state,H=Z.focused,A=Z.inputValue,z=Z.value,ne;H?ne=A:ne=b.toPrecisionAsStep(z),ne==null&&(ne="");var ae=b.formatWrapper(ne);return x(b.props.decimalSeparator)&&(ae=ae.toString().replace(".",b.props.decimalSeparator)),ae},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(X){}},b.restoreByAfter=function(X){if(X===void 0)return!1;var Z=b.input.value,H=Z.lastIndexOf(X);if(H===-1)return!1;var A=b.cursorBefore.length;return b.lastKeyCode===m.a.DELETE&&b.cursorBefore.charAt(A-1)===X[0]?(b.fixCaret(A,A),!0):H+X.length===Z.length?(b.fixCaret(H,H),!0):!1},b.partRestoreByAfter=function(X){return X===void 0?!1:Array.prototype.some.call(X,function(Z,H){var A=X.substring(H);return b.restoreByAfter(A)})},b.isNotCompleteNumber=function(X){return isNaN(X)||X===""||X===null||X&&X.toString().indexOf(".")===X.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(X,Z,H){b.pressingUpOrDown=!0,b.step("down",X,Z,H)},b.up=function(X,Z,H){b.pressingUpOrDown=!0,b.step("up",X,Z,H)},b.saveInput=function(X){b.input=X};var N=y.value;N===void 0&&(N=y.defaultValue),b.state={focused:y.autoFocus};var F=b.getValidValue(b.toNumber(N));return b.state=h(h({},b.state),{},{inputValue:b.toPrecisionAsStep(F),value:F}),b}return Object(Y.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var N=this.props,F=N.value,X=N.onChange,Z=N.max,H=N.min,A=this.state.focused;if(b){if(!O(b.value,F)||!O(b.max,Z)||!O(b.min,H)){var z=A?F:this.getValidValue(F),ne;this.pressingUpOrDown?ne=z:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:ne})}var ae="value"in this.props?F:this.state.value;"max"in this.props&&b.max!==Z&&typeof ae=="number"&&ae>Z&&X&&X(Z),"min"in this.props&&b.min!==H&&typeof ae=="number"&&ae<H&&X&&X(H)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var me=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?me=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(me=this.cursorStart):me=this.input.value.length,this.fixCaret(me,me)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(xe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var N=b;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(b){var N=b.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,X=parseFloat(b);return isNaN(X)?b:(X<N&&(X=N),X>F&&(X=F),X)}},{key:"setValue",value:function(b,N){var F=this.props.precision,X=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),Z=this.state.value,H=Z===void 0?null:Z,A=this.state.inputValue,z=A===void 0?null:A,ne=typeof X=="number"?X.toFixed(F):"".concat(X),ae=X!==H||ne!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},N)):this.setState({value:X,inputValue:this.toPrecisionAsStep(b)},N),ae&&this.props.onChange(X),X}},{key:"getMaxPrecision",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,X=F.precision,Z=F.step;if(x(X))return X;var H=this.getPrecision(N),A=this.getPrecision(Z),z=this.getPrecision(b);return b?Math.max(z,H+A):H+A}},{key:"getPrecisionFactor",value:function(b){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(b,N);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var N=Math.abs(this.getMaxPrecision(b));return isNaN(N)?b.toString():Number(b).toFixed(N)}},{key:"toNumber",value:function(b){var N=this.props.precision,F=this.state.focused,X=b&&b.length>16&&F;return this.isNotCompleteNumber(b)||X?b:x(N)?Math.round(b*Math.pow(10,N))/Math.pow(10,N):Number(b)}},{key:"upStep",value:function(b,N){var F=this.props.step,X=this.getPrecisionFactor(b,N),Z=Math.abs(this.getMaxPrecision(b,N)),H=((X*b+X*F*N)/X).toFixed(Z);return this.toNumber(H)}},{key:"downStep",value:function(b,N){var F=this.props.step,X=this.getPrecisionFactor(b,N),Z=Math.abs(this.getMaxPrecision(b,N)),H=((X*b-X*F*N)/X).toFixed(Z);return this.toNumber(H)}},{key:"step",value:function(b,N){var F=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Z=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var H=this.props;if(H.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var z=this["".concat(b,"Step")](A,X),ne=z>H.max||z<H.min;if(z>H.max?z=H.max:z<H.min&&(z=H.min),this.setValue(z,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){F[b](N,X,!0)},Z?d:w)}},{key:"fixCaret",value:function(b,N){if(b===void 0||N===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,X=this.input.selectionEnd;(b!==F||N!==X)&&this.input.setSelectionRange(b,N)}catch(Z){}}},{key:"render",value:function(){var b,N=this.props,F=N.prefixCls,X=N.disabled,Z=N.readOnly,H=N.useTouch,A=N.autoComplete,z=N.upHandler,ne=N.downHandler,ae=N.className,me=N.max,xe=N.min,Te=N.style,Oe=N.title,Ue=N.onMouseEnter,De=N.onMouseLeave,be=N.onMouseOver,ge=N.onMouseOut,He=N.required,ct=N.onClick,vt=N.tabIndex,_t=N.type,yt=N.placeholder,et=N.id,ht=N.inputMode,xt=N.pattern,Tt=N.step,mt=N.maxLength,Ie=N.autoFocus,je=N.name,$e=N.onPaste,at=N.onInput,lt=Object(ee.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),bt=this.state,Mt=bt.value,jt=bt.focused,Me=p()(F,(b={},Object(V.a)(b,ae,!!ae),Object(V.a)(b,"".concat(F,"-disabled"),X),Object(V.a)(b,"".concat(F,"-focused"),jt),b)),Pe={};Object.keys(lt).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Pe[pe]=lt[pe])});var tt=!Z&&!X,rt=this.getInputDisplayValue(null),Fe=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)>=me),Je=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)<=xe),Ee=Fe||X||Z,ye=Je||X||Z,_e=p()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(V.a)({},"".concat(F,"-handler-up-disabled"),Ee)),le=p()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(V.a)({},"".concat(F,"-handler-down-disabled"),ye)),de=H?{onTouchStart:Ee?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Ee?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ve=H?{onTouchStart:ye?i:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:Me,style:Te,title:Oe,onMouseEnter:Ue,onMouseLeave:De,onMouseOver:be,onMouseOut:ge,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(F,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Increase Value","aria-disabled":Ee,className:_e}),z||L.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:r})),L.a.createElement("span",Object.assign({unselectable:"on"},ve,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:le}),ne||L.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:r}))),L.a.createElement("div",{className:"".concat(F,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":xe,"aria-valuemax":me,"aria-valuenow":Mt,required:He,type:_t,placeholder:yt,onPaste:$e,onClick:ct,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:vt,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:tt?this.onKeyDown:i,onKeyUp:tt?this.onKeyUp:i,autoFocus:Ie,maxLength:mt,readOnly:Z,disabled:X,max:me,min:xe,step:Tt,name:je,title:Oe,id:et,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:xt,inputMode:ht,onInput:at},Pe))))}}]),S}(L.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:n,required:!1,autoComplete:"off"};var v=E,_=we.a=v},fcSX:function(Be,we,k){"use strict";var ee=k("Ff2n"),V=k("1OyB"),P=k("vuIU"),Y=k("Ji7U"),W=k("md7G"),R=k("foSv"),B=k("1W/9"),M=k("cDcd"),L=k("rePB"),I=k("JX7q"),p=k("TSYQ"),m=k.n(p),u=k("qx4F"),h=k("4IlW");function s(X){return Array.isArray(X)?X:[X]}var l={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(l).filter(function(X){if(typeof document=="undefined")return!1;var Z=document.getElementsByTagName("html")[0];return X in(Z?Z.style:{})})[0],r=l[i];function n(X,Z,H,A){X.addEventListener?X.addEventListener(Z,H,A):X.attachEvent&&X.attachEvent("on".concat(Z),H)}function d(X,Z,H,A){X.removeEventListener?X.removeEventListener(Z,H,A):X.attachEvent&&X.detachEvent("on".concat(Z),H)}function w(X,Z){var H=typeof X=="function"?X(Z):X;return Array.isArray(H)?H.length===2?H:[H[0],H[1]]:[H]}var T=function(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)},x=!(typeof window!="undefined"&&window.document&&window.document.createElement),O=function X(Z,H,A,z){if(!H||H===document||H instanceof Document)return!1;if(H===Z.parentNode)return!0;var ne=Math.max(Math.abs(A),Math.abs(z))===Math.abs(z),ae=Math.max(Math.abs(A),Math.abs(z))===Math.abs(A),me=H.scrollHeight-H.clientHeight,xe=H.scrollWidth-H.clientWidth,Te=document.defaultView.getComputedStyle(H),Oe=Te.overflowY==="auto"||Te.overflowY==="scroll",Ue=Te.overflowX==="auto"||Te.overflowX==="scroll",De=me&&Oe,be=xe&&Ue;return ne&&(!De||De&&(H.scrollTop>=me&&z<0||H.scrollTop<=0&&z>0))||ae&&(!be||be&&(H.scrollLeft>=xe&&A<0||H.scrollLeft<=0&&A>0))?X(Z,H.parentNode,A,z):!1};function E(X){var Z=v();return function(){var A=Object(R.a)(X),z;if(Z){var ne=Object(R.a)(this).constructor;z=Reflect.construct(A,arguments,ne)}else z=A.apply(this,arguments);return Object(W.a)(this,z)}}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(X){return!1}}var _={},f=function(X){Object(Y.a)(H,X);var Z=E(H);function H(A){var z;return Object(V.a)(this,H),z=Z.call(this,A),z.domFocus=function(){z.dom&&z.dom.focus()},z.removeStartHandler=function(ne){if(ne.touches.length>1)return;z.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},z.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var ae=ne.currentTarget,me=ne.changedTouches[0].clientX-z.startPos.x,xe=ne.changedTouches[0].clientY-z.startPos.y;(ae===z.maskDom||ae===z.handlerDom||ae===z.contentDom&&O(ae,ne.target,me,xe))&&ne.cancelable&&ne.preventDefault()},z.transitionEnd=function(ne){var ae=ne.target;d(ae,r,z.transitionEnd),ae.style.transition=""},z.onKeyDown=function(ne){if(ne.keyCode===h.a.ESC){var ae=z.props.onClose;ne.stopPropagation(),ae&&ae(ne)}},z.onWrapperTransitionEnd=function(ne){var ae=z.props,me=ae.open,xe=ae.afterVisibleChange;ne.target===z.contentWrapper&&ne.propertyName.match(/transform$/)&&(z.dom.style.transition="",!me&&z.getCurrentDrawerSome()&&(document.body.style.overflowX="",z.maskDom&&(z.maskDom.style.left="",z.maskDom.style.width="")),xe&&xe(!!me))},z.openLevelTransition=function(){var ne=z.props,ae=ne.open,me=ne.width,xe=ne.height,Te=z.getHorizontalBoolAndPlacementName(),Oe=Te.isHorizontal,Ue=Te.placementName,De=z.contentDom?z.contentDom.getBoundingClientRect()[Oe?"width":"height"]:0,be=(Oe?me:xe)||De;z.setLevelAndScrolling(ae,Ue,be)},z.setLevelTransform=function(ne,ae,me,xe){var Te=z.props,Oe=Te.placement,Ue=Te.levelMove,De=Te.duration,be=Te.ease,ge=Te.showMask;z.levelDom.forEach(function(He){He.style.transition="transform ".concat(De," ").concat(be),n(He,r,z.transitionEnd);var ct=ne?me:0;if(Ue){var vt=w(Ue,{target:He,open:ne});ct=ne?vt[0]:vt[1]||0}var _t=typeof ct=="number"?"".concat(ct,"px"):ct,yt=Oe==="left"||Oe==="top"?_t:"-".concat(_t);yt=ge&&Oe==="right"&&xe?"calc(".concat(yt," + ").concat(xe,"px)"):yt,He.style.transform=ct?"".concat(ae,"(").concat(yt,")"):""})},z.setLevelAndScrolling=function(ne,ae,me){var xe=z.props.onChange;if(!x){var Te=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(u.a)(!0):0;z.setLevelTransform(ne,ae,me,Te),z.toggleScrollingToDrawerAndBody(Te)}xe&&xe(ne)},z.toggleScrollingToDrawerAndBody=function(ne){var ae=z.props,me=ae.getOpenCount,xe=ae.getContainer,Te=ae.showMask,Oe=ae.open,Ue=xe&&xe(),De=me&&me();if(Ue&&Ue.parentNode===document.body&&Te){var be=["touchstart"],ge=[document.body,z.maskDom,z.handlerDom,z.contentDom];Oe&&document.body.style.overflow!=="hidden"?(ne&&z.addScrollingEffect(ne),De===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ge.forEach(function(He,ct){if(!He)return;n(He,be[ct]||"touchmove",ct?z.removeMoveHandler:z.removeStartHandler,z.passive)})):z.getCurrentDrawerSome()&&(De||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&z.remScrollingEffect(ne),ge.forEach(function(He,ct){if(!He)return;d(He,be[ct]||"touchmove",ct?z.removeMoveHandler:z.removeStartHandler,z.passive)}))}},z.addScrollingEffect=function(ne){var ae=z.props,me=ae.placement,xe=ae.duration,Te=ae.ease,Oe=ae.getOpenCount,Ue=ae.switchScrollingEffect,De=Oe&&Oe();De===1&&Ue();var be="width ".concat(xe," ").concat(Te),ge="transform ".concat(xe," ").concat(Te);z.dom.style.transition="none";switch(me){case"right":z.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":z.dom.style.width="calc(100% - ".concat(ne,"px)"),z.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(ge,",").concat(be),z.dom.style.width="",z.dom.style.transform="")})},z.remScrollingEffect=function(ne){var ae=z.props,me=ae.placement,xe=ae.duration,Te=ae.ease,Oe=ae.getOpenCount,Ue=ae.switchScrollingEffect,De=Oe&&Oe();De||Ue(!0),i&&(document.body.style.overflowX="hidden"),z.dom.style.transition="none";var be,ge="width ".concat(xe," ").concat(Te),He="transform ".concat(xe," ").concat(Te);switch(me){case"left":{z.dom.style.width="100%",ge="width 0s ".concat(Te," ").concat(xe);break}case"right":{z.dom.style.transform="translateX(".concat(ne,"px)"),z.dom.style.width="100%",ge="width 0s ".concat(Te," ").concat(xe),z.maskDom&&(z.maskDom.style.left="-".concat(ne,"px"),z.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{z.dom.style.width="calc(100% + ".concat(ne,"px)"),z.dom.style.height="100%",z.dom.style.transform="translateZ(0)",be="height 0s ".concat(Te," ").concat(xe);break}default:break}clearTimeout(z.timeout),z.timeout=setTimeout(function(){z.dom&&(z.dom.style.transition="".concat(He,",").concat(be?"".concat(be,","):"").concat(ge),z.dom.style.transform="",z.dom.style.width="",z.dom.style.height="")})},z.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(ne){return _[ne]})},z.getLevelDom=function(ne){var ae=ne.level,me=ne.getContainer;if(x)return;var xe=me&&me(),Te=xe?xe.parentNode:null;if(z.levelDom=[],ae==="all"){var Oe=Te?Array.prototype.slice.call(Te.children):[];Oe.forEach(function(Ue){Ue.nodeName!=="SCRIPT"&&Ue.nodeName!=="STYLE"&&Ue.nodeName!=="LINK"&&Ue!==xe&&z.levelDom.push(Ue)})}else ae&&s(ae).forEach(function(Ue){document.querySelectorAll(Ue).forEach(function(De){z.levelDom.push(De)})})},z.getHorizontalBoolAndPlacementName=function(){var ne=z.props.placement,ae=ne==="left"||ne==="right",me="translate".concat(ae?"X":"Y");return{isHorizontal:ae,placementName:me}},z.state={_self:Object(I.a)(z)},z}return Object(P.a)(H,[{key:"componentDidMount",value:function(){var z=this;if(!x){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(Oe){}this.passive=ne?{passive:!1}:!1}var ae=this.props,me=ae.open,xe=ae.getContainer,Te=xe&&xe();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),me&&(Te&&Te.parentNode===document.body&&(_[this.drawerId]=me),this.openLevelTransition(),this.forceUpdate(function(){z.domFocus()}))}},{key:"componentDidUpdate",value:function(z){var ne=this.props,ae=ne.open,me=ne.getContainer,xe=me&&me();ae!==z.open&&(ae&&this.domFocus(),xe&&xe.parentNode===document.body&&(_[this.drawerId]=!!ae),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var z=this.props,ne=z.getOpenCount,ae=z.open,me=z.switchScrollingEffect,xe=typeof ne=="function"&&ne();delete _[this.drawerId],ae&&(this.setLevelTransform(!1),document.body.style.touchAction=""),xe||(document.body.style.overflow="",me(!0))}},{key:"render",value:function(){var z,ne=this,ae=this.props,me=ae.className,xe=ae.children,Te=ae.style,Oe=ae.width,Ue=ae.height,De=ae.defaultOpen,be=ae.open,ge=ae.prefixCls,He=ae.placement,ct=ae.level,vt=ae.levelMove,_t=ae.ease,yt=ae.duration,et=ae.getContainer,ht=ae.handler,xt=ae.onChange,Tt=ae.afterVisibleChange,mt=ae.showMask,Ie=ae.maskClosable,je=ae.maskStyle,$e=ae.onClose,at=ae.onHandleClick,lt=ae.keyboard,bt=ae.getOpenCount,Mt=ae.switchScrollingEffect,jt=Object(ee.a)(ae,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Me=this.dom?be:!1,Pe=m()(ge,(z={},Object(L.a)(z,"".concat(ge,"-").concat(He),!0),Object(L.a)(z,"".concat(ge,"-open"),Me),Object(L.a)(z,me||"",!!me),Object(L.a)(z,"no-mask",!mt),z)),tt=this.getHorizontalBoolAndPlacementName(),rt=tt.placementName,Fe=He==="left"||He==="top"?"-100%":"100%",Je=Me?"":"".concat(rt,"(").concat(Fe,")"),Ee=ht&&M.cloneElement(ht,{onClick:function(_e){ht.props.onClick&&ht.props.onClick(),at&&at(_e)},ref:function(_e){ne.handlerDom=_e}});return M.createElement("div",Object.assign({},jt,{tabIndex:-1,className:Pe,style:Te,ref:function(_e){ne.dom=_e},onKeyDown:Me&&lt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),mt&&M.createElement("div",{className:"".concat(ge,"-mask"),onClick:Ie?$e:void 0,style:je,ref:function(_e){ne.maskDom=_e}}),M.createElement("div",{className:"".concat(ge,"-content-wrapper"),style:{transform:Je,msTransform:Je,width:T(Oe)?"".concat(Oe,"px"):Oe,height:T(Ue)?"".concat(Ue,"px"):Ue},ref:function(_e){ne.contentWrapper=_e}},M.createElement("div",{className:"".concat(ge,"-content"),ref:function(_e){ne.contentDom=_e},onTouchStart:Me&&mt?this.removeStartHandler:void 0,onTouchMove:Me&&mt?this.removeMoveHandler:void 0},xe),Ee))}}],[{key:"getDerivedStateFromProps",value:function(z,ne){var ae=ne.prevProps,me=ne._self,xe={prevProps:z};if(ae!==void 0){var Te=z.placement,Oe=z.level;Te!==ae.placement&&(me.contentDom=null),Oe!==ae.level&&me.getLevelDom(z)}return xe}}]),H}(M.Component);f.defaultProps={switchScrollingEffect:function(){}};var c=f;function S(X){var Z=y();return function(){var A=Object(R.a)(X),z;if(Z){var ne=Object(R.a)(this).constructor;z=Reflect.construct(A,arguments,ne)}else z=A.apply(this,arguments);return Object(W.a)(this,z)}}function y(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(X){return!1}}var b=function(X){Object(Y.a)(H,X);var Z=S(H);function H(A){var z;Object(V.a)(this,H),z=Z.call(this,A),z.onHandleClick=function(ae){var me=z.props,xe=me.onHandleClick,Te=me.open;if(xe&&xe(ae),typeof Te=="undefined"){var Oe=z.state.open;z.setState({open:!Oe})}},z.onClose=function(ae){var me=z.props,xe=me.onClose,Te=me.open;xe&&xe(ae),typeof Te=="undefined"&&z.setState({open:!1})};var ne=typeof A.open!="undefined"?A.open:!!A.defaultOpen;return z.state={open:ne},"onMaskClick"in A&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),z}return Object(P.a)(H,[{key:"render",value:function(){var z=this,ne=this.props,ae=ne.defaultOpen,me=ne.getContainer,xe=ne.wrapperClassName,Te=ne.forceRender,Oe=ne.handler,Ue=Object(ee.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),De=this.state.open;if(!me)return M.createElement("div",{className:xe,ref:function(He){z.dom=He}},M.createElement(c,Object.assign({},Ue,{open:De,handler:Oe,getContainer:function(){return z.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var be=!!Oe||Te;return M.createElement(B.a,{visible:De,forceRender:be,getContainer:me,wrapperClassName:xe},function(ge){var He=ge.visible,ct=ge.afterClose,vt=Object(ee.a)(ge,["visible","afterClose"]);return M.createElement(c,Object.assign({},Ue,vt,{open:He!==void 0?He:De,afterVisibleChange:ct!==void 0?ct:Ue.afterVisibleChange,handler:Oe,onClose:z.onClose,onHandleClick:z.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(z,ne){var ae=ne.prevProps,me={prevProps:z};return typeof ae!="undefined"&&z.open!==ae.open&&(me.open=z.open),me}}]),H}(M.Component);b.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:M.createElement("div",{className:"drawer-handle"},M.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=b,F=we.a=N},fcyK:function(Be,we,k){},fyJ8:function(Be,we,k){"use strict";var ee=k("rePB"),V=k("VTBJ"),P=k("Ff2n"),Y=k("U8pU"),W=k("cDcd"),R=k.n(W),B=k("TSYQ"),M=k.n(B),L=k("c+Xe"),I=k("sR1s");function p(l){return l&&Object(Y.a)(l)==="object"&&!Array.isArray(l)&&!W.isValidElement(l)}function m(l){return typeof l=="string"?!0:Object(L.c)(l)}function u(l,i){var r,n=l.prefixCls,d=l.className,w=l.record,T=l.index,x=l.dataIndex,O=l.render,E=l.children,v=l.component,_=v===void 0?"td":v,f=l.colSpan,c=l.rowSpan,S=l.fixLeft,y=l.fixRight,b=l.firstFixLeft,N=l.lastFixLeft,F=l.firstFixRight,X=l.lastFixRight,Z=l.appendNode,H=l.additionalProps,A=H===void 0?{}:H,z=l.ellipsis,ne=l.align,ae=l.rowType,me=l.isSticky,xe="".concat(n,"-cell"),Te,Oe;if(E)Oe=E;else{var Ue=Object(I.b)(w,x);if(Oe=Ue,O){var De=O(Ue,w,T);p(De)?(Oe=De.children,Te=De.props):Oe=De}}Object(Y.a)(Oe)==="object"&&!Array.isArray(Oe)&&!W.isValidElement(Oe)&&(Oe=null),z&&(N||F)&&(Oe=W.createElement("span",{className:"".concat(xe,"-content")},Oe));var be=Te||{},ge=be.colSpan,He=be.rowSpan,ct=be.style,vt=be.className,_t=Object(P.a)(be,["colSpan","rowSpan","style","className"]),yt=ge!==void 0?ge:f,et=He!==void 0?He:c;if(yt===0||et===0)return null;var ht={},xt=typeof S=="number",Tt=typeof y=="number";xt&&(ht.position="sticky",ht.left=S),Tt&&(ht.position="sticky",ht.right=y);var mt={};ne&&(mt.textAlign=ne);var Ie,je=z===!0?{showTitle:!0}:z;je&&(je.showTitle||ae==="header")&&(typeof Oe=="string"||typeof Oe=="number"?Ie=Oe.toString():W.isValidElement(Oe)&&typeof Oe.props.children=="string"&&(Ie=Oe.props.children));var $e=Object(V.a)(Object(V.a)(Object(V.a)({title:Ie},_t),A),{},{colSpan:yt&&yt!==1?yt:null,rowSpan:et&&et!==1?et:null,className:M()(xe,d,(r={},Object(ee.a)(r,"".concat(xe,"-fix-left"),xt),Object(ee.a)(r,"".concat(xe,"-fix-left-first"),b),Object(ee.a)(r,"".concat(xe,"-fix-left-last"),N),Object(ee.a)(r,"".concat(xe,"-fix-right"),Tt),Object(ee.a)(r,"".concat(xe,"-fix-right-first"),F),Object(ee.a)(r,"".concat(xe,"-fix-right-last"),X),Object(ee.a)(r,"".concat(xe,"-ellipsis"),z),Object(ee.a)(r,"".concat(xe,"-with-append"),Z),Object(ee.a)(r,"".concat(xe,"-fix-sticky"),(xt||Tt)&&me),r),A.className,vt),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},A.style),mt),ht),ct),ref:m(_)?i:null});return W.createElement(_,Object.assign({},$e),Z,Oe)}var h=W.forwardRef(u);h.displayName="Cell";var s=W.memo(h,function(l,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,l.record):!1});we.a=s},gRFJ:function(Be,we,k){Be.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Be){return Be<10?"0"+Be:Be}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Be){return rx_escapable.lastIndex=0,rx_escapable.test(Be)?'"'+Be.replace(rx_escapable,function(we){var k=meta[we];return typeof k=="string"?k:"\\u"+("0000"+we.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Be+'"'}function str(Be,we){var k,ee,V,P,Y=gap,W,R=we[Be];R&&typeof R=="object"&&typeof R.toJSON=="function"&&(R=R.toJSON(Be)),typeof rep=="function"&&(R=rep.call(we,Be,R));switch(typeof R){case"string":return quote(R);case"number":return isFinite(R)?String(R):"null";case"boolean":case"null":return String(R);case"object":if(!R)return"null";if(gap+=indent,W=[],Object.prototype.toString.apply(R)==="[object Array]"){for(P=R.length,k=0;k<P;k+=1)W[k]=str(k,R)||"null";return V=W.length===0?"[]":gap?`[
`+gap+W.join(`,
`+gap)+`
`+Y+"]":"["+W.join(",")+"]",gap=Y,V}if(rep&&typeof rep=="object")for(P=rep.length,k=0;k<P;k+=1)typeof rep[k]=="string"&&(ee=rep[k],V=str(ee,R),V&&W.push(quote(ee)+(gap?": ":":")+V));else for(ee in R)Object.prototype.hasOwnProperty.call(R,ee)&&(V=str(ee,R),V&&W.push(quote(ee)+(gap?": ":":")+V));return V=W.length===0?"{}":gap?`{
`+gap+W.join(`,
`+gap)+`
`+Y+"}":"{"+W.join(",")+"}",gap=Y,V}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Be,we,k){var ee;if(gap="",indent="",typeof k=="number")for(ee=0;ee<k;ee+=1)indent+=" ";else typeof k=="string"&&(indent=k);if(rep=we,we&&typeof we!="function"&&(typeof we!="object"||typeof we.length!="number"))throw new Error("JSON.stringify");return str("",{"":Be})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Be,we){var k,ee,V=Be[we];if(V&&typeof V=="object")for(k in V)Object.prototype.hasOwnProperty.call(V,k)&&(ee=walk(V,k),ee!==void 0?V[k]=ee:delete V[k]);return reviver.call(Be,we,V)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Be){return"\\u"+("0000"+Be.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},gqXR:function(Be,we,k){Be.exports=k.p+"static/g.a5bcde87.svg"},hW8S:function(Be,we,k){"use strict";k.d(we,"a",function(){return Y}),k.d(we,"c",function(){return W}),k.d(we,"b",function(){return R});var ee=k("VTBJ"),V=k("Ff2n"),P=k("Kwbf"),Y="RC_TABLE_INTERNAL_COL_DEFINE";function W(B){var M=B.expandable,L=Object(V.a)(B,["expandable"]);return"expandable"in B?Object(ee.a)(Object(ee.a)({},L),M):L}function R(B){return Object.keys(B).reduce(function(M,L){return(L.substr(0,5)==="data-"||L.substr(0,5)==="aria-")&&(M[L]=B[L]),M},{})}},hgre:function(Be,we,k){"use strict";var ee=k("miYZ"),V=k("tsqr"),P=k("9og8"),Y=k("WmNS"),W=k.n(Y),R=k("cDcd"),B=k.n(R),M=k("GUcZ"),L=k("ulZh"),I=k.n(L),p=k("xKgJ"),m=k("P5Jw"),u=k.n(m),h=k("bntm"),s=k("4xil"),l=k.n(s);function i(w){if(isNaN(w))return{minutes:"00",seconds:"00"};var T=new Date(w*1e3).toISOString().substr(11,8);return{hour:T.substr(0,2),minutes:T.substr(3,2),seconds:T.substr(6,2)}}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2}});function r(w,T){return w-T}function n(w){w.sort(r);for(var T=0,x=0;x<w.length-1;x++){var O=Math.abs(w[x+1]-w[x]);O<21&&(T+=O)}return T}var d=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;we.a=Object(R.forwardRef)(function(w,T){var x,O=w.src,E=w.toLog,v=w.videoId,_=w.logWatchHistory,f=w.courseId,c=f===void 0?null:f,S=w.startTime,y=w.handlePause,b=y===void 0?function(){}:y,N=w.handlePlay,F=N===void 0?function(){}:N,X=w.handlePlayEnded,Z=X===void 0?function(){}:X,H=w.videoSpeed,A=H===void 0?1:H,z=O==null||((x=O.split("."))===null||x===void 0)?void 0:x.pop(),ne=z==="flv",ae=Object(R.useRef)(),me=Object(R.useRef)(),xe=Object(R.useRef)(),Te=Object(R.useRef)(),Oe=Object(R.useRef)(),Ue=Object(R.useRef)(),De=Object(R.useRef)(),be=Object(R.useRef)(),ge=Object(R.useRef)(),He=Object(R.useRef)(),ct=Object(R.useRef)(),vt=Object(R.useRef)(),_t=Object(R.useRef)(),yt=Object(R.useRef)(),et=navigator.userAgent.toLowerCase().match(d),ht=et?et[0]:"pc",xt=Object(R.useRef)(!1),Tt=Object(p.x)(),mt=0,Ie=0,je=0,$e=null,at=!1,lt=20,bt=1,Mt=!1,jt=!1,Me=[];Object(R.useImperativeHandle)(T,function(){return{getLastUpdatedTime:function(){return ae.current.currentTime},getDuration:function(){return ae.current.duration}}});var Pe=Object(R.useCallback)(function(Ee){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e={point:ae.current.currentTime};$e?(_e.log_id=$e,_e.watch_duration=n(Me),_e.total_duration=Ie):(c?(_e.video_id=parseInt(v,10),_e.course_id=c):_e.video_id=v,_e.duration=mt,_e.device=ht),ye&&(_e.ed="1");function le(){return de.apply(this,arguments)}function de(){return de=Object(P.a)(W.a.mark(function ve(){var pe;return W.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Mt=!0,Ke.next=3,_(_e);case 3:pe=Ke.sent,$e=pe,Mt=!1,Ee&&Ee();case 7:case"end":return Ke.stop()}},ve)})),de.apply(this,arguments)}le()},[v,c]);Object(R.useEffect)(function(){V.b.destroy();var Ee=null;return M.a.isSupported&&ne&&O&&(O==null?void 0:O.indexOf(".m3u8"))<0?(Ee=M.a.createPlayer({type:"flv",volume:.8,cors:!0,url:O,muted:!1}),ae.current&&(Ee.attachMediaElement(ae.current),Ee.load())):ae.current.setAttribute("src",O),rt(),function(){Ee&&(Ee.unload(),Ee.pause(),Ee.destroy(),Ee=null)}},[ae,ne,O]);function tt(){ae.current.paused?(Te.current.style.display="none",Oe.current.style.display="block"):(Te.current.style.display="block",Oe.current.style.display="none")}function rt(){ct.current.style.display="none",_t.current.style.display="none",vt.current.style.display="none",ae.current.muted||ae.current.volume===0?ct.current.style.display="block":ae.current.volume>0&&ae.current.volume<=.5?_t.current.style.display="block":vt.current.style.display="block"}Object(R.useEffect)(function(){var Ee=document.getElementById("play"),ye=document.querySelectorAll(".playback-icons use");function _e(){F(),S&&!xt.current&&(ae.current.currentTime=S),xt.current=!0,Me.push(ae.current.currentTime),at||(at=!0,E&&Pe())}function le(){return de.apply(this,arguments)}function de(){return de=Object(P.a)(W.a.mark(function We(){return W.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:tt(),Me.push(ae.current.currentTime),E&&Pe(function(){$e=null,je=0,at=!1,Mt=!1,jt=!1,Me=[],Ie=0,bt=1},!0);case 3:case"end":return Se.stop()}},We)})),de.apply(this,arguments)}function ve(){Ue.current.value=Math.round(ae.current.currentTime),De.current.value=Math.round(ae.current.currentTime)}function pe(){var We=i(Math.round(ae.current.currentTime));ge.current.innerText="".concat(We.hour>0?We.hour+":":"").concat(We.minutes,":").concat(We.seconds),ge.current.setAttribute("datetime","".concat(We.hour>0?" "+We.hour+" ":"").concat(We.minutes,"m ").concat(We.seconds,"s"))}function Ce(){var We=Math.round(ae.current.duration);Ue.current.setAttribute("max",We),De.current.setAttribute("max",We);var ce=i(We);be.current.innerText="".concat(ce.hour>0?ce.hour+":":"").concat(ce.minutes,":").concat(ce.seconds),be.current.setAttribute("datetime","".concat(ce.hour>0?" "+ce.hour+" ":"").concat(ce.minutes,"m ").concat(ce.seconds,"s"))}function Ke(){var We=Math.round(ae.current.duration);Ue.current.setAttribute("max",We),De.current.setAttribute("max",We);var ce=i(We);be.current.innerText="".concat(ce.hour>0?ce.hour+":":"").concat(ce.minutes,":").concat(ce.seconds),be.current.setAttribute("datetime","".concat(ce.hour>0?" "+ce.hour+" ":"").concat(ce.minutes,"m ").concat(ce.seconds,"s")),ve(),pe();var Se=me.current.getBoundingClientRect(),ot=Se.width,ze=Se.height,Lt=Se.x,Dt=Se.y;if(Lt<0||Dt<0||!ot)return;if(!jt){var ke=ae.current.currentTime,qe=ke-je;Math.abs(qe)<10?(Ie+=Math.abs(qe),je=ke,Mt||Ie-bt*lt>=0&&(bt++,Me.push(je),E&&Pe())):(je=ke,E&&Pe())}}function st(){jt=!0}function At(){ae.current.playing&&Me.push(ae.current.currentTime,je),je=ae.current.currentTime,jt=!1}function Ft(){mt=ae.current.duration,mt<=20&&(lt=mt/3),ae.current.addEventListener("play",_e)}function kt(We){We.preventDefault(),Object(h.a)()?(ae.current.style.width="100%",ae.current.style.height="100%"):ae.current.style.cssText=""}function wt(){b()}function Qe(We){var ce=We.target.dataset.seek?We.target.dataset.seek:We.target.value;ae.current.currentTime=ce,De.current.value=ce,Ue.current.value=ce}function it(We){var ce=Math.round(We.offsetX/We.target.clientWidth*parseInt(We.target.getAttribute("max"),10));Ue.current.setAttribute("data-seek",ce);var Se=i(ce);He.current.textContent="".concat(Se.hour>0?Se.hour+":":"").concat(Se.minutes,":").concat(Se.seconds);var ot=ae.current.getBoundingClientRect();He.current.style.left="".concat(We.pageX-ot.left,"px")}return xe.current.addEventListener(Object(h.c)(),kt),ae.current.addEventListener("canplay",Ft),ae.current.addEventListener("ended",le),ae.current.addEventListener("seeking",st),ae.current.addEventListener("seeked",At),ae.current.addEventListener("loadedmetadata",Ce),Ue.current.addEventListener("mousemove",it),Ue.current.addEventListener("input",Qe),ae.current.addEventListener("timeupdate",Ke),ae.current.addEventListener("pause",wt),ae.current.addEventListener("volumechange",rt),function(){ae.current.removeEventListener("canplay",Ft),ae.current.removeEventListener("play",_e),ae.current.removeEventListener("ended",le),ae.current.removeEventListener("seeking",st),ae.current.removeEventListener("seeked",At),Ue.current.removeEventListener("mousemove",it),Ue.current.removeEventListener("input",Qe),ae.current.removeEventListener("timeupdate",Ke),ae.current.removeEventListener("pause",wt),ae.current.removeEventListener("loadedmetadata",Ce),ae.current.removeEventListener("volumechange",rt),ae.current.playing&&(Me.push(je,ae.current.currentTime),E&&Pe())}},[ae,O]),Object(R.useEffect)(function(){if(ae.current.onended=function(){Z(ae)},ae.current.oncontextmenu=function(){return!1},(O==null?void 0:O.indexOf(".m3u8"))>-1){if(ae.current.canPlayType("application/vnd.apple.mpegurl"))ae.current.src=O;else if(I.a.isSupported()){var Ee=new I.a;Ee.loadSource(O),Ee.attachMedia(ae.current)}}},[O]),Object(R.useEffect)(function(){ae.current.playbackRate=A},[A]);var Fe=function(){ae.current.paused||ae.current.ended?ae.current.play():ae.current.pause(),tt()};function Je(){ae.current.muted=!ae.current.muted,ae.current.muted?(yt.current.setAttribute("data-volume",volume.value),yt.current.value=0):yt.current.value=yt.current.dataset.volume}return B.a.createElement("div",{style:{position:"relative"},ref:xe},B.a.createElement("div",{ref:me,className:"".concat(l.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(l.a.animate__loop)},Tt?Tt.login:" "),B.a.createElement("div",{className:l.a.container},B.a.createElement("div",{className:l.a["video-container"],id:"video-container"},B.a.createElement("div",{className:l.a["playback-animation"],id:"playback-animation"},B.a.createElement("svg",{className:l.a["playback-icons"]},B.a.createElement("use",{className:"hidden",href:"#play-icon"}),B.a.createElement("use",{href:"#pause"}))),B.a.createElement("video",{className:l.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:ae,autoPlay:!1}),B.a.createElement("div",{className:"".concat(l.a["video-controls"]," "),id:"video-controls"},B.a.createElement("div",{className:l.a["bottom-controls"]},B.a.createElement("div",{className:l.a["left-controls"]},B.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:Fe},B.a.createElement("svg",{className:l.a["playback-icons"]},B.a.createElement("use",{ref:Oe,href:"#play-icon"}),B.a.createElement("use",{ref:Te,style:{display:"none"},href:"#pause"}))),B.a.createElement("div",{className:l.a.time},B.a.createElement("time",{id:"time-elapsed",ref:ge},"00:00"),B.a.createElement("span",null," / "),B.a.createElement("time",{id:"duration",ref:be},"00:00"))),B.a.createElement("div",{className:l.a["right-controls"]},B.a.createElement(m.CopyToClipboard,{text:O,onCopy:function(){return V.b.success("\u590D\u5236\u6210\u529F")}},B.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},B.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),B.a.createElement("div",{className:l.a["volume-controls"]},B.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:l.a["volume-button"],id:"volume-button",onClick:Je},B.a.createElement("i",{ref:ct,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:_t,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),B.a.createElement("i",{ref:vt,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),B.a.createElement("input",{className:l.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:yt,style:{display:"none"},onClick:rt})),B.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:l.a["fullscreen-button"],onClick:function(){Object(h.a)()?Object(h.b)():Object(h.d)(xe.current)}},B.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),B.a.createElement("div",{className:l.a["video-progress"]},B.a.createElement("progress",{ref:De,value:"0",min:"0"}),B.a.createElement("input",{className:l.a.seek,ref:Ue,value:"0",min:"0",type:"range",step:"1"}),B.a.createElement("div",{className:l.a["seek-tooltip"],ref:He,id:"seek-tooltip"},"00:00"))))),B.a.createElement("svg",{style:{display:"none"}},B.a.createElement("defs",null,B.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),B.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),B.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),B.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),B.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),B.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),B.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),B.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},B.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(Be,we,k){},je13:function(Be,we,k){var ee=k("5nXd"),V=k("gRFJ"),P=[k("uQRt")];Be.exports=ee.createStore(V,P)},kSUc:function(Be,we,k){},"kaH+":function(Be,we,k){"use strict";var ee=k("+L6B"),V=k("2/Rp"),P=k("tJVT"),Y=k("cDcd"),W=k.n(Y),R=k("UZu5"),B=k.n(R),M=k("dhSg"),L=k("rLCj"),I=k("dF/Y"),p=k("4i/N");we.a=function(){var m=Object(Y.useState)(""),u=Object(P.a)(m,2),h=u[0],s=u[1],l=Object(Y.useState)(0),i=Object(P.a)(l,2),r=i[0],n=i[1],d=Object(Y.useRef)("");Object(Y.useEffect)(function(){var _=M.a.subscribe("preview-image",function(f){s(f),document.body.style.overflow="hidden"});return _},[]),Object(Y.useEffect)(function(){return document.addEventListener("keydown",w),function(){document.removeEventListener("keydown",w)}},[]),Object(Y.useEffect)(function(){d.current=h},[h]);function w(_){_.keyCode==27&&d.current&&T()}function T(){document.body.style.overflow="auto",s("")}function x(){n(r+90)}var O=Object(Y.useRef)(),E=Object(Y.useRef)(),v=function(f){(f.nativeEvent.target===O.current||f.nativeEvent.target===E.current)&&T()};return W.a.createElement(Y.Fragment,null,h?W.a.createElement("div",{className:"image-preview-container",ref:O,onClick:v},W.a.createElement("div",{className:"button-group"},W.a.createElement(V.a,{onClick:x},"\u65CB\u8F6C",W.a.createElement(L.a,null)),W.a.createElement(V.a,{href:h},"\u4E0B\u8F7D",W.a.createElement(I.a,null)),W.a.createElement(V.a,{onClick:T},"\u5173\u95ED",W.a.createElement(p.a,null))),W.a.createElement("div",{className:"preview-wrp-group",ref:E},W.a.createElement("img",{className:"image-preview",src:h,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(r,"deg)")}}))):null)}},kovY:function(Be,we,k){Be.exports=k.p+"static/e.eabfa286.svg"},lOMy:function(Be,we,k){},lZu9:function(Be,we,k){(function(ee){ee(k("VrN/"),k("1eCo"),k("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function(V,P){var Y=ee.getMode(V,"text/html"),W=Y.name=="null";function R(H){if(ee.findModeByName){var A=ee.findModeByName(H);A&&(H=A.mime||A.mimes[0])}var z=ee.getMode(V,H);return z.name=="null"?null:z}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var B={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 M in B)B.hasOwnProperty(M)&&P.tokenTypeOverrides[M]&&(B[M]=P.tokenTypeOverrides[M]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,m=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,u=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,r=" ";function n(H,A,z){return A.f=A.inline=z,z(H,A)}function d(H,A,z){return A.f=A.block=z,z(H,A)}function w(H){return!H||!/\S/.test(H.string)}function T(H){if(H.linkTitle=!1,H.linkHref=!1,H.linkText=!1,H.em=!1,H.strong=!1,H.strikethrough=!1,H.quote=0,H.indentedCode=!1,H.f==O){var A=W;if(!A){var z=ee.innerMode(Y,H.htmlState);A=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}A&&(H.f=f,H.block=x,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function x(H,A){var z=H.column()===A.indentation,ne=w(A.prevLine.stream),ae=A.indentedCode,me=A.prevLine.hr,xe=A.list!==!1,Te=(A.listStack[A.listStack.length-1]||0)+3;A.indentedCode=!1;var Oe=A.indentation;if(A.indentationDiff===null&&(A.indentationDiff=A.indentation,xe)){for(A.list=null;Oe<A.listStack[A.listStack.length-1];)A.listStack.pop(),A.listStack.length?A.indentation=A.listStack[A.listStack.length-1]:A.list=!1;A.list!==!1&&(A.indentationDiff=Oe-A.listStack[A.listStack.length-1])}var Ue=!ne&&!me&&!A.prevLine.header&&(!xe||!ae)&&!A.prevLine.fencedCodeEnd,De=(A.list===!1||me||ne)&&A.indentation<=Te&&H.match(L),be=null;if(A.indentationDiff>=4&&(ae||A.prevLine.fencedCodeEnd||A.prevLine.header||ne))return H.skipToEnd(),A.indentedCode=!0,B.code;if(H.eatSpace())return null;if(z&&A.indentation<=Te&&(be=H.match(m))&&be[1].length<=6)return A.quote=0,A.header=be[1].length,A.thisLine.header=!0,P.highlightFormatting&&(A.formatting="header"),A.f=A.inline,v(A);if(A.indentation<=Te&&H.eat(">"))return A.quote=z?1:A.quote+1,P.highlightFormatting&&(A.formatting="quote"),H.eatSpace(),v(A);if(!De&&!A.setext&&z&&A.indentation<=Te&&(be=H.match(I))){var ge=be[1]?"ol":"ul";return A.indentation=Oe+H.current().length,A.list=!0,A.quote=0,A.listStack.push(A.indentation),A.em=!1,A.strong=!1,A.code=!1,A.strikethrough=!1,P.taskLists&&H.match(p,!1)&&(A.taskList=!0),A.f=A.inline,P.highlightFormatting&&(A.formatting=["list","list-"+ge]),v(A)}else{if(z&&A.indentation<=Te&&(be=H.match(s,!0)))return A.quote=0,A.fencedEndRE=new RegExp(be[1]+"+ *$"),A.localMode=P.fencedCodeBlockHighlighting&&R(be[2]||P.fencedCodeBlockDefaultMode),A.localMode&&(A.localState=ee.startState(A.localMode)),A.f=A.block=E,P.highlightFormatting&&(A.formatting="code-block"),A.code=-1,v(A);if(A.setext||(!Ue||!xe)&&!A.quote&&A.list===!1&&!A.code&&!De&&!l.test(H.string)&&(be=H.lookAhead(1))&&(be=be.match(u)))return A.setext?(A.header=A.setext,A.setext=0,H.skipToEnd(),P.highlightFormatting&&(A.formatting="header")):(A.header=be[0].charAt(0)=="="?1:2,A.setext=A.header),A.thisLine.header=!0,A.f=A.inline,v(A);if(De)return H.skipToEnd(),A.hr=!0,A.thisLine.hr=!0,B.hr;if(H.peek()==="[")return n(H,A,N)}return n(H,A,A.inline)}function O(H,A){var z=Y.token(H,A.htmlState);if(!W){var ne=ee.innerMode(Y,A.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||A.md_inside&&H.current().indexOf(">")>-1)&&(A.f=f,A.block=x,A.htmlState=null)}return z}function E(H,A){var z=A.listStack[A.listStack.length-1]||0,ne=A.indentation<z,ae=z+3;if(A.fencedEndRE&&A.indentation<=ae&&(ne||H.match(A.fencedEndRE))){P.highlightFormatting&&(A.formatting="code-block");var me;return ne||(me=v(A)),A.localMode=A.localState=null,A.block=x,A.f=f,A.fencedEndRE=null,A.code=0,A.thisLine.fencedCodeEnd=!0,ne?d(H,A,A.block):me}else return A.localMode?A.localMode.token(H,A.localState):(H.skipToEnd(),B.code)}function v(H){var A=[];if(H.formatting){A.push(B.formatting),typeof H.formatting=="string"&&(H.formatting=[H.formatting]);for(var z=0;z<H.formatting.length;z++)A.push(B.formatting+"-"+H.formatting[z]),H.formatting[z]==="header"&&A.push(B.formatting+"-"+H.formatting[z]+"-"+H.header),H.formatting[z]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=H.quote?A.push(B.formatting+"-"+H.formatting[z]+"-"+H.quote):A.push("error"))}if(H.taskOpen)return A.push("meta"),A.length?A.join(" "):null;if(H.taskClosed)return A.push("property"),A.length?A.join(" "):null;if(H.linkHref?A.push(B.linkHref,"url"):(H.strong&&A.push(B.strong),H.em&&A.push(B.em),H.strikethrough&&A.push(B.strikethrough),H.emoji&&A.push(B.emoji),H.linkText&&A.push(B.linkText),H.code&&A.push(B.code),H.image&&A.push(B.image),H.imageAltText&&A.push(B.imageAltText,"link"),H.imageMarker&&A.push(B.imageMarker)),H.header&&A.push(B.header,B.header+"-"+H.header),H.quote&&(A.push(B.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=H.quote?A.push(B.quote+"-"+H.quote):A.push(B.quote+"-"+P.maxBlockquoteDepth)),H.list!==!1){var ne=(H.listStack.length-1)%3;ne?ne===1?A.push(B.list2):A.push(B.list3):A.push(B.list1)}return H.trailingSpaceNewLine?A.push("trailing-space-new-line"):H.trailingSpace&&A.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),A.length?A.join(" "):null}function _(H,A){return H.match(h,!0)?v(A):void 0}function f(H,A){var z=A.text(H,A);if(typeof z!="undefined")return z;if(A.list)return A.list=null,v(A);if(A.taskList){var ne=H.match(p,!0)[1]===" ";return ne?A.taskOpen=!0:A.taskClosed=!0,P.highlightFormatting&&(A.formatting="task"),A.taskList=!1,v(A)}if(A.taskOpen=!1,A.taskClosed=!1,A.header&&H.match(/^#+$/,!0))return P.highlightFormatting&&(A.formatting="header"),v(A);var ae=H.next();if(A.linkTitle){A.linkTitle=!1;var me=ae;ae==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var xe="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(H.match(new RegExp(xe),!0))return B.linkHref}if(ae==="`"){var Te=A.formatting;P.highlightFormatting&&(A.formatting="code"),H.eatWhile("`");var Oe=H.current().length;if(A.code==0&&(!A.quote||Oe==1))return A.code=Oe,v(A);if(Oe==A.code){var Ue=v(A);return A.code=0,Ue}else return A.formatting=Te,v(A)}else if(A.code)return v(A);if(ae==="\\"&&(H.next(),P.highlightFormatting)){var De=v(A),be=B.formatting+"-escape";return De?De+" "+be:be}if(ae==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return A.imageMarker=!0,A.image=!0,P.highlightFormatting&&(A.formatting="image"),v(A);if(ae==="["&&A.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return A.imageMarker=!1,A.imageAltText=!0,P.highlightFormatting&&(A.formatting="image"),v(A);if(ae==="]"&&A.imageAltText){P.highlightFormatting&&(A.formatting="image");var De=v(A);return A.imageAltText=!1,A.image=!1,A.inline=A.f=S,De}if(ae==="["&&!A.image)return A.linkText&&H.match(/^.*?\]/)||(A.linkText=!0,P.highlightFormatting&&(A.formatting="link")),v(A);if(ae==="]"&&A.linkText){P.highlightFormatting&&(A.formatting="link");var De=v(A);return A.linkText=!1,A.inline=A.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?S:f,De}if(ae==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=c,P.highlightFormatting&&(A.formatting="link");var De=v(A);return De?De+=" ":De="",De+B.linkInline}if(ae==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=c,P.highlightFormatting&&(A.formatting="link");var De=v(A);return De?De+=" ":De="",De+B.linkEmail}if(P.xml&&ae==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ge=H.string.indexOf(">",H.pos);if(ge!=-1){var He=H.string.substring(H.start,ge);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(He)&&(A.md_inside=!0)}return H.backUp(1),A.htmlState=ee.startState(Y),d(H,A,O)}if(P.xml&&ae==="<"&&H.match(/^\/\w*?>/))return A.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var ct=1,vt=H.pos==1?" ":H.string.charAt(H.pos-2);ct<3&&H.eat(ae);)ct++;var _t=H.peek()||" ",yt=!/\s/.test(_t)&&(!i.test(_t)||/\s/.test(vt)||i.test(vt)),et=!/\s/.test(vt)&&(!i.test(vt)||/\s/.test(_t)||i.test(_t)),ht=null,xt=null;if(ct%2&&(!A.em&&yt&&(ae==="*"||!et||i.test(vt))?ht=!0:A.em==ae&&et&&(ae==="*"||!yt||i.test(_t))&&(ht=!1)),ct>1&&(!A.strong&&yt&&(ae==="*"||!et||i.test(vt))?xt=!0:A.strong==ae&&et&&(ae==="*"||!yt||i.test(_t))&&(xt=!1)),xt!=null||ht!=null){P.highlightFormatting&&(A.formatting=ht==null?"strong":xt==null?"em":"strong em"),ht===!0&&(A.em=ae),xt===!0&&(A.strong=ae);var Ue=v(A);return ht===!1&&(A.em=!1),xt===!1&&(A.strong=!1),Ue}}else if(ae===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return v(A);H.backUp(1)}if(P.strikethrough){if(ae==="~"&&H.eatWhile(ae)){if(A.strikethrough){P.highlightFormatting&&(A.formatting="strikethrough");var Ue=v(A);return A.strikethrough=!1,Ue}else if(H.match(/^[^\s]/,!1))return A.strikethrough=!0,P.highlightFormatting&&(A.formatting="strikethrough"),v(A)}else if(ae===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return v(A);H.backUp(2)}}if(P.emoji&&ae===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){A.emoji=!0,P.highlightFormatting&&(A.formatting="emoji");var Tt=v(A);return A.emoji=!1,Tt}return ae===" "&&(H.match(/^ +$/,!1)?A.trailingSpace++:A.trailingSpace&&(A.trailingSpaceNewLine=!0)),v(A)}function c(H,A){var z=H.next();if(z===">"){A.f=A.inline=f,P.highlightFormatting&&(A.formatting="link");var ne=v(A);return ne?ne+=" ":ne="",ne+B.linkInline}return H.match(/^[^>]+/,!0),B.linkInline}function S(H,A){if(H.eatSpace())return null;var z=H.next();return z==="("||z==="["?(A.f=A.inline=b(z==="("?")":"]"),P.highlightFormatting&&(A.formatting="link-string"),A.linkHref=!0,v(A)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(H){return function(A,z){var ne=A.next();if(ne===H){z.f=z.inline=f,P.highlightFormatting&&(z.formatting="link-string");var ae=v(z);return z.linkHref=!1,ae}return A.match(y[H]),z.linkHref=!0,v(z)}}function N(H,A){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(A.f=F,H.next(),P.highlightFormatting&&(A.formatting="link"),A.linkText=!0,v(A)):n(H,A,f)}function F(H,A){if(H.match(/^\]:/,!0)){A.f=A.inline=X,P.highlightFormatting&&(A.formatting="link");var z=v(A);return A.linkText=!1,z}return H.match(/^([^\]\\]|\\.)+/,!0),B.linkText}function X(H,A){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?A.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),A.f=A.inline=f,B.linkHref+" url")}var Z={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:f,text:_,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(H){return{f:H.f,prevLine:H.prevLine,thisLine:H.thisLine,block:H.block,htmlState:H.htmlState&&ee.copyState(Y,H.htmlState),indentation:H.indentation,localMode:H.localMode,localState:H.localMode?ee.copyState(H.localMode,H.localState):null,inline:H.inline,text:H.text,formatting:!1,linkText:H.linkText,linkTitle:H.linkTitle,linkHref:H.linkHref,code:H.code,em:H.em,strong:H.strong,strikethrough:H.strikethrough,emoji:H.emoji,header:H.header,setext:H.setext,hr:H.hr,taskList:H.taskList,list:H.list,listStack:H.listStack.slice(0),quote:H.quote,indentedCode:H.indentedCode,trailingSpace:H.trailingSpace,trailingSpaceNewLine:H.trailingSpaceNewLine,md_inside:H.md_inside,fencedEndRE:H.fencedEndRE}},token:function(H,A){if(A.formatting=!1,H!=A.thisLine.stream){if(A.header=0,A.hr=!1,H.match(/^\s*$/,!0))return T(A),null;if(A.prevLine=A.thisLine,A.thisLine={stream:H},A.taskList=!1,A.trailingSpace=0,A.trailingSpaceNewLine=!1,!A.localState&&(A.f=A.block,A.f!=O)){var z=H.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(A.indentation=z,A.indentationDiff=null,z>0)return null}}return A.f(H,A)},innerMode:function(H){return H.block==O?{state:H.htmlState,mode:Y}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:Z}},indent:function(H,A,z){return H.block==O&&Y.indent?Y.indent(H.htmlState,A,z):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,A,z):ee.Pass},blankLine:T,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Z},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Be,we,k){"use strict";k.d(we,"a",function(){return M});var ee=k("cDcd"),V=k("biw7"),P=k("fyJ8");function Y(L){var I=L.className,p=L.index,m=L.children,u=L.colSpan,h=L.rowSpan,s=ee.useContext(V.a),l=s.prefixCls,i=s.fixedInfoList,r=i[p];return ee.createElement(P.a,Object.assign({className:I,index:p,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:u,rowSpan:h}}}},r))}function W(L){return ee.createElement("tr",Object.assign({},L))}function R(L){var I=L.children,p=ee.useContext(V.a),m=p.prefixCls;return ee.createElement("tfoot",{className:"".concat(m,"-summary")},I)}var B=we.b=R,M={Cell:Y,Row:W}},nCk5:function(Be,we,k){Be.exports=k.p+"static/d.53bf6ae3.svg"},nWbc:function(Be,we,k){},oE5q:function(Be,we,k){Be.exports=k.p+"static/t.0b94c5c3.svg"},oFv4:function(Be,we,k){Be.exports=k.p+"static/internal.da228387.png"},osHv:function(Be,we,k){(function(ee){ee(k("VrN/"))})(function(ee){"use strict";var V=ee.Pos;function P(i,r){return i.line-r.line||i.ch-r.ch}var Y="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",W=Y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",R=new RegExp("<(/?)(["+Y+"]["+W+"]*)","g");function B(i,r,n,d){this.line=r,this.ch=n,this.cm=i,this.text=i.getLine(r),this.min=d?Math.max(d.from,i.firstLine()):i.firstLine(),this.max=d?Math.min(d.to-1,i.lastLine()):i.lastLine()}function M(i,r){var n=i.cm.getTokenTypeAt(V(i.line,r));return n&&/\btag\b/.test(n)}function L(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function I(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function p(i){for(;;){var r=i.text.indexOf(">",i.ch);if(r==-1){if(L(i))continue;return}if(!M(i,r+1)){i.ch=r+1;continue}var n=i.text.lastIndexOf("/",r),d=n>-1&&!/\S/.test(i.text.slice(n+1,r));return i.ch=r+1,d?"selfClose":"regular"}}function m(i){for(;;){var r=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(r==-1){if(I(i))continue;return}if(!M(i,r+1)){i.ch=r;continue}R.lastIndex=r,i.ch=r;var n=R.exec(i.text);if(n&&n.index==r)return n}}function u(i){for(;;){R.lastIndex=i.ch;var r=R.exec(i.text);if(!r){if(L(i))continue;return}if(!M(i,r.index+1)){i.ch=r.index+1;continue}return i.ch=r.index+r[0].length,r}}function h(i){for(;;){var r=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(r==-1){if(I(i))continue;return}if(!M(i,r+1)){i.ch=r;continue}var n=i.text.lastIndexOf("/",r),d=n>-1&&!/\S/.test(i.text.slice(n+1,r));return i.ch=r+1,d?"selfClose":"regular"}}function s(i,r){for(var n=[];;){var d=u(i),w,T=i.line,x=i.ch-(d?d[0].length:0);if(!d||!(w=p(i)))return;if(w=="selfClose")continue;if(d[1]){for(var O=n.length-1;O>=0;--O)if(n[O]==d[2]){n.length=O;break}if(O<0&&(!r||r==d[2]))return{tag:d[2],from:V(T,x),to:V(i.line,i.ch)}}else n.push(d[2])}}function l(i,r){for(var n=[];;){var d=h(i);if(!d)return;if(d=="selfClose"){m(i);continue}var w=i.line,T=i.ch,x=m(i);if(!x)return;if(x[1])n.push(x[2]);else{for(var O=n.length-1;O>=0;--O)if(n[O]==x[2]){n.length=O;break}if(O<0&&(!r||r==x[2]))return{tag:x[2],from:V(i.line,i.ch),to:V(w,T)}}}}ee.registerHelper("fold","xml",function(i,r){for(var n=new B(i,r.line,0);;){var d=u(n);if(!d||n.line!=r.line)return;var w=p(n);if(!w)return;if(!d[1]&&w!="selfClose"){var T=V(n.line,n.ch),x=s(n,d[2]);return x&&P(x.from,T)>0?{from:T,to:x.from}:null}}}),ee.findMatchingTag=function(i,r,n){var d=new B(i,r.line,r.ch,n);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var w=p(d),T=w&&V(d.line,d.ch),x=w&&m(d);if(!w||!x||P(d,r)>0)return;var O={from:V(d.line,d.ch),to:T,tag:x[2]};return w=="selfClose"?{open:O,close:null,at:"open"}:x[1]?{open:l(d,x[2]),close:O,at:"close"}:(d=new B(i,T.line,T.ch,n),{open:O,close:s(d,x[2]),at:"open"})},ee.findEnclosingTag=function(i,r,n,d){for(var w=new B(i,r.line,r.ch,n);;){var T=l(w,d);if(!T)break;var x=new B(i,r.line,r.ch,n),O=s(x,T.tag);if(O)return{open:T,close:O}}},ee.scanForClosingTag=function(i,r,n,d){var w=new B(i,r.line,r.ch,d?{from:0,to:d}:null);return s(w,n)}})},p5ED:function(Be,we,k){"use strict";var ee=k("+L6B"),V=k("2/Rp"),P=k("5Dmo"),Y=k("3S7+"),W=k("k1fw"),R=k("tJVT"),B=k("cDcd"),M=k.n(B),L=k("vHTk"),I=k.n(L),p=k("yEEn"),m=k("ZW9T"),u=k("1vsH");we.a=function(h){var s=h.name,l=h.data,i=h.theme,r=h.type,n=h.filename,d=h.monacoEditor,w=h.className,T=h.style,x=h.close,O=h.onClose,E=h.hasMask,v=Object(B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_=Object(R.a)(v,2),f=_[0],c=_[1],S=Object(B.useState)(""),y=Object(R.a)(S,2),b=y[0],N=y[1],F,X=1024*1024,Z=10*X,H=Object(B.useRef)();r==="office"&&(F=Object(u.V)(l).filesize,F>Z&&(r="other")),n&&(d.filename=n),Object(B.useEffect)(function(){var ne,ae,me=(ne=document.cookie)===null||ne===void 0||((ae=ne.replace(/\s/g,""))===null||ae===void 0)?void 0:ae.split(";");me==null||me.map(function(xe){var Te=xe.split("=");Te[0]==="_educoder_session"&&N(Te[1])})},[]);var A=function(){if(l.startsWith("http")||l.startsWith("/")){z();return}Object(u.z)(n||"educoder",l,n)},z=function(){Object(u.x)(n||s,l)};return console.log("data:",l,"fileanme:",n," name:",s),M.a.createElement("div",{style:Object(W.a)({},T||{}),className:"".concat(E&&I.a.bgBlack," ").concat(r?I.a.wrp:"hide")},x&&M.a.createElement("div",{className:I.a.close,ref:H},M.a.createElement(Y.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return H.current}},M.a.createElement("span",{onClick:z},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(Y.a,{title:"\u5173\u95ED",getPopupContainer:function(){return H.current}},M.a.createElement("span",{className:"",onClick:O},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(I.a[w]," ").concat(w," ").concat(I.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&M.a.createElement(m.b,d)),r==="audio"&&M.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),r==="video"&&M.a.createElement(M.a.Fragment,null,l!=null&&l.startsWith("/")?M.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),r==="html"&&M.a.createElement("iframe",{src:l+"&disposition=inline"}),r==="pdf"&&M.a.createElement("embed",{className:I.a.embed,src:l}),r==="image"&&M.a.createElement(M.a.Fragment,null,M.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),r==="other"&&M.a.createElement("div",null,M.a.createElement(V.a,{type:"primary",size:"large",onClick:A},M.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&M.a.createElement(V.a,{type:"primary",size:"large",onClick:A},M.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Be,we,k){},pYxM:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ps8w:function(Be,we,k){Be.exports=k.p+"static/show.6268a056.svg"},psGv:function(Be,we,k){var ee,V;(function(){var P;(function(){"use strict";var B=[,,function(p){function m(s){this.__parent=s,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var s=new m(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},m.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},m.prototype.has_match=function(s){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(s))return!0;return!1},m.prototype.set_indent=function(s,l){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(s){this.__items.push(s);var l=s.lastIndexOf(`
`);l!==-1?this.__character_count=s.length-l:this.__character_count+=s.length},m.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function u(s,l){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),l=l||"",s.indent_level>0&&(l=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}u.prototype.get_indent_size=function(s,l){var i=this.__base_string_length;return l=l||0,s<0&&(i=0),i+=s*this.__indent_size,i+=l,i},u.prototype.get_indent_string=function(s,l){var i=this.__base_string;return l=l||0,s<0&&(s=0,i=""),l+=s*this.__indent_size,this.__ensure_cache(l),i+=this.__cache[l],i},u.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var s=this.__cache.length,l=0,i="";this.__indent_size&&s>=this.__indent_size&&(l=Math.floor(s/this.__indent_size),s-=l*this.__indent_size,i=new Array(l+1).join(this.__indent_string)),s&&(i+=new Array(s+1).join(" ")),this.__cache.push(i)};function h(s,l){this.__indent_cache=new u(s,l),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(s,l){return this.__indent_cache.get_indent_string(s,l)},h.prototype.get_indent_size=function(s,l){return this.__indent_cache.get_indent_size(s,l)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(s){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return s!==`
`&&(i=i.replace(/[\n]/g,s)),i},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(s,l){return s=s||0,l=l||0,this.next_line.set_indent(s,l),this.__lines.length>1?(this.current_line.set_indent(s,l),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(s){for(var l=0;l<s.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},h.prototype.remove_indent=function(s){for(var l=this.__lines.length;s<l;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(s,l){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(r.item(0).indexOf(s)!==0&&r.item(-1)!==l){this.__lines.splice(i+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},p.exports.Output=h},function(p){function m(u,h,s,l){this.type=u,this.text=h,this.comments_before=null,this.newlines=s||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=m},,,function(p){function m(s,l){this.raw_options=u(s,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(s,l){var i=this.raw_options[s],r=l||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(r=i.concat()):typeof i=="string"&&(r=i.split(/[^a-zA-Z0-9_\/\-]+/)),r},m.prototype._get_boolean=function(s,l){var i=this.raw_options[s],r=i===void 0?!!l:!!i;return r},m.prototype._get_characters=function(s,l){var i=this.raw_options[s],r=l||"";return typeof i=="string"&&(r=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},m.prototype._get_number=function(s,l){var i=this.raw_options[s];l=parseInt(l,10),isNaN(l)&&(l=0);var r=parseInt(i,10);return isNaN(r)&&(r=l),r},m.prototype._get_selection=function(s,l,i){var r=this._get_selection_list(s,l,i);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[s]+"'");return r[0]},m.prototype._get_selection_list=function(s,l,i){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[l[0]],!this._is_valid_selection(i,l))throw new Error("Invalid Default Value!");var r=this._get_array(s,i);if(!this._is_valid_selection(r,l))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[s]+"'");return r},m.prototype._is_valid_selection=function(s,l){return s.length&&l.length&&!s.some(function(i){return l.indexOf(i)===-1})};function u(s,l){var i={};s=h(s);var r;for(r in s)r!==l&&(i[r]=s[r]);if(l&&s[l])for(r in s[l])i[r]=s[l][r];return i}function h(s){var l={},i;for(i in s){var r=i.replace(/-/g,"_");l[r]=s[i]}return l}p.exports.Options=m,p.exports.normalizeOpts=h,p.exports.mergeOpts=u},,function(p){var m=RegExp.prototype.hasOwnProperty("sticky");function u(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},u.prototype.peek=function(h){var s=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(s=this.__input.charAt(h)),s},u.prototype.__match=function(h,s){h.lastIndex=s;var l=h.exec(this.__input);return l&&!(m&&h.sticky)&&(l.index!==s&&(l=null)),l},u.prototype.test=function(h,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(h,s):!1},u.prototype.testChar=function(h,s){var l=this.peek(s);return h.lastIndex=0,l!==null&&h.test(l)},u.prototype.match=function(h){var s=this.__match(h,this.__position);return s?this.__position+=s[0].length:s=null,s},u.prototype.read=function(h,s,l){var i="",r;return h&&(r=this.match(h),r&&(i+=r[0])),s&&(r||!h)&&(i+=this.readUntil(s,l)),i},u.prototype.readUntil=function(h,s){var l="",i=this.__position;h.lastIndex=this.__position;var r=h.exec(this.__input);return r?(i=r.index,s&&(i+=r[0].length)):i=this.__input_length,l=this.__input.substring(this.__position,i),this.__position=i,l},u.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},u.prototype.get_regexp=function(h,s){var l=null,i="g";return s&&m&&(i="y"),typeof h=="string"&&h!==""?l=new RegExp(h,i):h&&(l=new RegExp(h.source,i)),l},u.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(h){var s=this.__position,l=this.readUntilAfter(h);return this.__position=s,l},u.prototype.lookBack=function(h){var s=this.__position-1;return s>=h.length&&this.__input.substring(s-h.length,s).toLowerCase()===h},p.exports.InputScanner=u},function(p,m,u){var h=u(8).InputScanner,s=u(3).Token,l=u(10).TokenStream,i=u(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(d,w){this._input=new h(d),this._options=w||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,w=new s(r.START,""),T=null,x=[],O=new l;w.type!==r.EOF;){for(d=this._get_next_token(w,T);this._is_comment(d);)O.add(d),d=this._get_next_token(w,T);O.isEmpty()||(d.comments_before=O,O=new l),d.parent=T,this._is_opening(d)?(x.push(T),T=d):T&&this._is_closing(d,T)&&(d.opened=T,T.closed=d,T=x.pop(),d.parent=T),d.previous=w,w.next=d,this.__tokens.add(d),w=d}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(d,w){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(r.RAW,T):this._create_token(r.EOF,"")},n.prototype._is_comment=function(d){return!1},n.prototype._is_opening=function(d){return!1},n.prototype._is_closing=function(d,w){return!1},n.prototype._create_token=function(d,w){var T=new s(d,w,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=n,p.exports.TOKEN=r},function(p){function m(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},m.prototype.peek=function(u){var h=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(h=this.__tokens[u]),h},m.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},p.exports.TokenStream=m},function(p,m,u){var h=u(12).Pattern;function s(l,i){h.call(this,l,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new h,s.prototype.__set_whitespace_patterns=function(l,i){l+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},s.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var i=this.__split(this._newline_regexp,l);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return l},s.prototype.matching=function(l,i){var r=this._create();return r.__set_whitespace_patterns(l,i),r._update(),r},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(l,i){l.lastIndex=0;for(var r=0,n=[],d=l.exec(i);d;)n.push(i.substring(r,d.index)),r=d.index+d[0].length,d=l.exec(i);return r<i.length?n.push(i.substring(r,i.length)):n.push(""),n},p.exports.WhitespacePattern=s},function(p){function m(u,h){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}m.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(u){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(u),h._update(),h},m.prototype.until=function(u){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(u),h._update(),h},m.prototype.starting_with=function(u){var h=this._create();return h._starting_pattern=this._input.get_regexp(u,!0),h._update(),h},m.prototype.matching=function(u){var h=this._create();return h._match_pattern=this._input.get_regexp(u,!0),h._update(),h},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},p.exports.Pattern=m},function(p){function m(u,h){u=typeof u=="string"?u:u.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+h,"g")}m.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(u);s;)h[s[1]]=s[2],s=this.__directive_pattern.exec(u);return h},m.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=m},function(p,m,u){var h=u(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(i,r){h.call(this,i,r),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var n=new h(i);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new h,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(i){var r=this._create();return r._disabled[i]=!0,r._update(),r},l.prototype.read_options=function(i){var r=this._create();for(var n in s)r._disabled[n]=i.templating.indexOf(n)===-1;return r._update(),r},l.prototype.exclude=function(i){var r=this._create();return r._excluded[i]=!0,r._update(),r},l.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),i+=r,r=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},l.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},l.prototype._read_template=function(){var i="",r=this._input.peek();if(r==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(i=i||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},p.exports.TemplatablePattern=l},,,,function(p,m,u){var h=u(19).Beautifier,s=u(20).Options;function l(i,r,n,d){var w=new h(i,r,n,d);return w.beautify()}p.exports=l,p.exports.defaultOptions=function(){return new s}},function(p,m,u){var h=u(20).Options,s=u(2).Output,l=u(21).Tokenizer,i=u(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,d=function(S,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=S.max_preserve_newlines,this.preserve_newlines=S.preserve_newlines,this._output=new s(S,y)};d.prototype.current_line_has_match=function(S){return this._output.current_line.has_match(S)},d.prototype.set_space_before_token=function(S,y){this._output.space_before_token=S,this._output.non_breaking_space=y},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(S){this._output.add_raw_token(S)},d.prototype.print_preserved_newlines=function(S){var y=0;S.type!==i.TEXT&&S.previous.type!==i.TEXT&&(y=S.newlines?1:0),this.preserve_newlines&&(y=S.newlines<this.max_preserve_newlines+1?S.newlines:this.max_preserve_newlines+1);for(var b=0;b<y;b++)this.print_newline(b>0);return y!==0},d.prototype.traverse_whitespace=function(S){return S.whitespace_before||S.newlines?(this.print_preserved_newlines(S)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(S){this._output.add_new_line(S)},d.prototype.print_token=function(S){S.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(S.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(S){return S=this.indent_level+(S||0),S<1?"":this._output.get_indent_string(S)};var w=function(S){for(var y=null,b=S.next;b.type!==i.EOF&&S.closed!==b;){if(b.type===i.ATTRIBUTE&&b.text==="type"){b.next&&b.next.type===i.EQUALS&&b.next.next&&b.next.next.type===i.VALUE&&(y=b.next.next.text);break}b=b.next}return y},T=function(S,y){var b=null,N=null;return y.closed?(S==="script"?b="text/javascript":S==="style"&&(b="text/css"),b=w(y)||b,b.search("text/css")>-1?N="css":b.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":b.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":b.search(/test\/null/)>-1&&(N="null"),N):null};function x(S,y){return y.indexOf(S)!==-1}function O(S,y,b){this.parent=S||null,this.tag=y?y.tag_name:"",this.indent_level=b||0,this.parser_token=y||null}function E(S){this._printer=S,this._current_frame=null}E.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},E.prototype.record_tag=function(S){var y=new O(this._current_frame,S,this._printer.indent_level);this._current_frame=y},E.prototype._try_pop_frame=function(S){var y=null;return S&&(y=S.parser_token,this._printer.indent_level=S.indent_level,this._current_frame=S.parent),y},E.prototype._get_frame=function(S,y){for(var b=this._current_frame;b&&!(S.indexOf(b.tag)!==-1);){if(y&&y.indexOf(b.tag)!==-1){b=null;break}b=b.parent}return b},E.prototype.try_pop=function(S,y){var b=this._get_frame([S],y);return this._try_pop_frame(b)},E.prototype.indent_to_tag=function(S){var y=this._get_frame(S);y&&(this._printer.indent_level=y.indent_level)};function v(S,y,b,N){this._source_text=S||"",y=y||{},this._js_beautify=b,this._css_beautify=N,this._tag_stack=null;var F=new h(y,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var S=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,S&&r.test(S)&&(y=S.match(r)[0])),S=S.replace(n,`
`);var b=S.match(/^[\t ]*/)[0],N={text:"",type:""},F=new _,X=new d(this._options,b),Z=new l(S,this._options).tokenize();this._tag_stack=new E(X);for(var H=null,A=Z.next();A.type!==i.EOF;)A.type===i.TAG_OPEN||A.type===i.COMMENT?(H=this._handle_tag_open(X,A,F,N),F=H):A.type===i.ATTRIBUTE||A.type===i.EQUALS||A.type===i.VALUE||A.type===i.TEXT&&!F.tag_complete?H=this._handle_inside_tag(X,A,F,Z):A.type===i.TAG_CLOSE?H=this._handle_tag_close(X,A,F):A.type===i.TEXT?H=this._handle_text(X,A,F):X.add_raw_token(A),N=H,A=Z.next();var z=X._output.get_code(y);return z},v.prototype._handle_tag_close=function(S,y,b){var N={text:y.text,type:y.type};return S.alignment_size=0,b.tag_complete=!0,S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted?S.add_raw_token(y):(b.tag_start_char==="<"&&(S.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&b.has_wrapped_attrs&&S.print_newline(!1)),S.print_token(y)),b.indent_content&&!(b.is_unformatted||b.is_content_unformatted)&&(S.indent(),b.indent_content=!1),!b.is_inline_element&&!(b.is_unformatted||b.is_content_unformatted)&&S.set_wrap_point(),N},v.prototype._handle_inside_tag=function(S,y,b,N){var F=b.has_wrapped_attrs,X={text:y.text,type:y.type};if(S.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),b.is_unformatted)S.add_raw_token(y);else if(b.tag_start_char==="{"&&y.type===i.TEXT)S.print_preserved_newlines(y)?(y.newlines=0,S.add_raw_token(y)):S.print_token(y);else{if(y.type===i.ATTRIBUTE?(S.set_space_before_token(!0),b.attr_count+=1):(y.type===i.EQUALS||y.type===i.VALUE&&y.previous.type===i.EQUALS)&&S.set_space_before_token(!1),y.type===i.ATTRIBUTE&&b.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(S.traverse_whitespace(y),F=F||y.newlines!==0),this._is_wrap_attributes_force)){var Z=b.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&b.attr_count===1){var H=!0,A=0,z;do{if(z=N.peek(A),z.type===i.ATTRIBUTE){H=!1;break}A+=1}while(A<4&&z.type!==i.EOF&&z.type!==i.TAG_CLOSE);Z=!H}Z&&(S.print_newline(!1),F=!0)}S.print_token(y),F=F||S.previous_token_wrapped(),b.has_wrapped_attrs=F}return X},v.prototype._handle_text=function(S,y,b){var N={text:y.text,type:"TK_CONTENT"};return b.custom_beautifier_name?this._print_custom_beatifier_text(S,y,b):b.is_unformatted||b.is_content_unformatted?S.add_raw_token(y):(S.traverse_whitespace(y),S.print_token(y)),N},v.prototype._print_custom_beatifier_text=function(S,y,b){var N=this;if(y.text!==""){var F=y.text,X,Z=1,H="",A="";b.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?X=this._js_beautify:b.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?X=this._css_beautify:b.custom_beautifier_name==="html"&&(X=function(Te,Oe){var Ue=new v(Te,Oe,N._js_beautify,N._css_beautify);return Ue.beautify()}),this._options.indent_scripts==="keep"?Z=0:this._options.indent_scripts==="separate"&&(Z=-S.indent_level);var z=S.get_full_indent(Z);if(F=F.replace(/\n[ \t]*$/,""),b.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var ne=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!ne){S.add_raw_token(y);return}H=z+ne[1]+`
`,F=ne[4],ne[5]&&(A=z+ne[5]),F=F.replace(/\n[ \t]*$/,""),(ne[2]||ne[3].indexOf(`
`)!==-1)&&(ne=ne[3].match(/[ \t]+$/),ne&&(y.whitespace_before=ne[0]))}if(F)if(X){var ae=function(){this.eol=`
`};ae.prototype=this._options.raw_options;var me=new ae;F=X(z+F,me)}else{var xe=y.whitespace_before;xe&&(F=F.replace(new RegExp(`
(`+xe+")?","g"),`
`)),F=z+F.replace(/\n/g,`
`+z)}H&&(F?F=H+F+`
`+A:F=H+A),S.print_newline(!1),F&&(y.text=F,y.whitespace_before="",y.newlines=0,S.add_raw_token(y),S.print_newline(!0))}},v.prototype._handle_tag_open=function(S,y,b,N){var F=this._get_tag_open_token(y);return(b.is_unformatted||b.is_content_unformatted)&&!b.is_empty_element&&y.type===i.TAG_OPEN&&y.text.indexOf("</")===0?(S.add_raw_token(y),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(S.traverse_whitespace(y),this._set_tag_position(S,y,F,b,N),F.is_inline_element||S.set_wrap_point(),S.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=y.text.length+1),!F.tag_complete&&!F.is_unformatted&&(S.alignment_size=F.alignment_size),F};var _=function(S,y){if(this.parent=S||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var b;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(b=y.text.match(/^<([^\s>]*)/),this.tag_check=b?b[1]:""):(b=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=b?b[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};v.prototype._get_tag_open_token=function(S){var y=new _(this._tag_stack.get_parser_token(),S);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||x(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&x(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&x(y.tag_check,this._options.content_unformatted),y.is_inline_element=x(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},v.prototype._set_tag_position=function(S,y,b,N,F){if(b.is_empty_element||(b.is_end_tag?b.start_tag_token=this._tag_stack.try_pop(b.tag_name):(this._do_optional_end_element(b)&&(b.is_inline_element||S.print_newline(!1)),this._tag_stack.record_tag(b),(b.tag_name==="script"||b.tag_name==="style")&&!(b.is_unformatted||b.is_content_unformatted)&&(b.custom_beautifier_name=T(b.tag_check,y)))),x(b.tag_check,this._options.extra_liners)&&(S.print_newline(!1),S._output.just_added_blankline()||S.print_newline(!0)),b.is_empty_element){if(b.tag_start_char==="{"&&b.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),b.indent_content=!0;var X=S.current_line_has_match(/{{#if/);X||S.print_newline(!1)}b.tag_name==="!--"&&F.type===i.TAG_CLOSE&&N.is_end_tag&&b.text.indexOf(`
`)===-1||(b.is_inline_element||b.is_unformatted||S.print_newline(!1),this._calcluate_parent_multiline(S,b))}else if(b.is_end_tag){var Z=!1;Z=b.start_tag_token&&b.start_tag_token.multiline_content,Z=Z||!b.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===i.TAG_CLOSE&&b.start_tag_token===N)&&F.type!=="TK_CONTENT",(b.is_content_unformatted||b.is_unformatted)&&(Z=!1),Z&&S.print_newline(!1)}else b.indent_content=!b.custom_beautifier_name,b.tag_start_char==="<"&&(b.tag_name==="html"?b.indent_content=this._options.indent_inner_html:b.tag_name==="head"?b.indent_content=this._options.indent_head_inner_html:b.tag_name==="body"&&(b.indent_content=this._options.indent_body_inner_html)),!(b.is_inline_element||b.is_unformatted)&&(F.type!=="TK_CONTENT"||b.is_content_unformatted)&&S.print_newline(!1),this._calcluate_parent_multiline(S,b)},v.prototype._calcluate_parent_multiline=function(S,y){y.parent&&S._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var f=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],c=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(S){var y=null;if(S.is_empty_element||!S.is_start_tag||!S.parent)return;if(S.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(S.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(S.tag_name==="dd"||S.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(S.parent.tag_name==="p"&&f.indexOf(S.tag_name)!==-1){var b=S.parent.parent;(!b||c.indexOf(b.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else S.tag_name==="rp"||S.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):S.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):S.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):S.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):S.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):S.tag_name==="tbody"||S.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):S.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(S.tag_name==="th"||S.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return S.parent=this._tag_stack.get_parser_token(),y},p.exports.Beautifier=v},function(p,m,u){var h=u(6).Options;function s(l){h.call(this,l,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}s.prototype=new h,p.exports.Options=s},function(p,m,u){var h=u(9).Tokenizer,s=u(9).TOKEN,l=u(13).Directives,i=u(14).TemplatablePattern,r=u(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},d=new l(/<\!--/,/-->/),w=function(T,x){h.call(this,T,x),this._current_tag_name="";var O=new i(this._input).read_options(this._options),E=new r(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),handlebars_open:E.until(/[\n\r\t }]/),handlebars_raw_close:E.until(/}}/),comment:E.starting_with(/<!--/).until_after(/-->/),cdata:E.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:E.starting_with(/<!\[/).until_after(/]>/),processing:E.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=E.matching(v).until_after(v)}};w.prototype=new h,w.prototype._is_comment=function(T){return!1},w.prototype._is_opening=function(T){return T.type===n.TAG_OPEN},w.prototype._is_closing=function(T,x){return T.type===n.TAG_CLOSE&&x&&((T.text===">"||T.text==="/>")&&x.text[0]==="<"||T.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},w.prototype._reset=function(){this._current_tag_name=""},w.prototype._get_next_token=function(T,x){var O=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(n.EOF,""):(O=O||this._read_open_handlebars(E,x),O=O||this._read_attribute(E,T,x),O=O||this._read_close(E,x),O=O||this._read_raw_content(E,T,x),O=O||this._read_content_word(E),O=O||this._read_comment_or_cdata(E),O=O||this._read_processing(E),O=O||this._read_open(E,x),O=O||this._create_token(n.UNKNOWN,this._input.next()),O)},w.prototype._read_comment_or_cdata=function(T){var x=null,O=null,E=null;if(T==="<"){var v=this._input.peek(1);v==="!"&&(O=this.__patterns.comment.read(),O?(E=d.get_directives(O),E&&E.ignore==="start"&&(O+=d.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(x=this._create_token(n.COMMENT,O),x.directives=E)}return x},w.prototype._read_processing=function(T){var x=null,O=null,E=null;if(T==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(x=this._create_token(n.COMMENT,O),x.directives=E)}return x},w.prototype._read_open=function(T,x){var O=null,E=null;return x||T==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),E=this._create_token(n.TAG_OPEN,O)),E},w.prototype._read_open_handlebars=function(T,x){var O=null,E=null;return x||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),E=this._create_token(n.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),E=this._create_token(n.TAG_OPEN,O))),E},w.prototype._read_close=function(T,x){var O=null,E=null;return x&&(x.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(O=this._input.next(),T==="/"&&(O+=this._input.next()),E=this._create_token(n.TAG_CLOSE,O)):x.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),E=this._create_token(n.TAG_CLOSE,"}}"))),E},w.prototype._read_attribute=function(T,x,O){var E=null,v="";if(O&&O.text[0]==="<")if(T==="=")E=this._create_token(n.EQUALS,this._input.next());else if(T==='"'||T==="'"){var _=this._input.next();T==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),E=this._create_token(n.VALUE,_)}else v=this.__patterns.attribute.read(),v&&(x.type===n.EQUALS?E=this._create_token(n.VALUE,v):E=this._create_token(n.ATTRIBUTE,v));return E},w.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},w.prototype._read_raw_content=function(T,x,O){var E="";if(O&&O.text[0]==="{")E=this.__patterns.handlebars_raw_close.read();else if(x.type===n.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var v=x.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var _=this._read_comment_or_cdata(T);if(_)return _.type=n.TEXT,_;E=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(E=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return E?this._create_token(n.TEXT,E):null},w.prototype._read_content_word=function(T){var x="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(n.TEXT,x)},p.exports.Tokenizer=w,p.exports.TOKEN=n}],M={};function L(p){var m=M[p];if(m!==void 0)return m.exports;var u=M[p]={exports:{}};return B[p](u,u.exports,L),u.exports}var I=L(18);P=I})();var Y=P;if(!0)!(ee=[k,k("6UM0"),k("TXwP")],V=function(B){var M=k("6UM0"),L=k("TXwP");return{html_beautify:function(I,p){return Y(I,p,M.js_beautify,L.css_beautify)}}}.apply(we,ee),V!==void 0&&(Be.exports=V));else var W,R})()},"rAM+":function(Be,we,k){"use strict";k.d(we,"a",function(){return V});var ee=k("Qw5x");function V(P,Y){var W;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(W=Object(ee.a)(P))||Y&&P&&typeof P.length=="number"){W&&(P=W);var R=0,B=function(){};return{s:B,n:function(){return R>=P.length?{done:!0}:{done:!1,value:P[R++]}},e:function(m){throw m},f:B}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M=!0,L=!1,I;return{s:function(){W=P[Symbol.iterator]()},n:function(){var m=W.next();return M=m.done,m},e:function(m){L=!0,I=m},f:function(){try{!M&&W.return!=null&&W.return()}finally{if(L)throw I}}}}},rHrb:function(Be,we,k){"use strict";Object.defineProperty(we,"__esModule",{value:!0}),we.CopyToClipboard=void 0;var ee=P(k("cDcd")),V=P(k("+QRC"));function P(n){return n&&n.__esModule?n:{default:n}}function Y(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Y=function(w){return typeof w}:Y=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},Y(n)}function W(n,d){var w=Object.keys(n);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(n);d&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(n,x).enumerable})),w.push.apply(w,T)}return w}function R(n){for(var d=1;d<arguments.length;d++){var w=arguments[d]!=null?arguments[d]:{};d%2?W(w,!0).forEach(function(T){i(n,T,w[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(w)):W(w).forEach(function(T){Object.defineProperty(n,T,Object.getOwnPropertyDescriptor(w,T))})}return n}function B(n,d){if(n==null)return{};var w=M(n,d),T,x;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(n);for(x=0;x<O.length;x++){if(T=O[x],d.indexOf(T)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(n,T))continue;w[T]=n[T]}}return w}function M(n,d){if(n==null)return{};var w={},T=Object.keys(n),x,O;for(O=0;O<T.length;O++){if(x=T[O],d.indexOf(x)>=0)continue;w[x]=n[x]}return w}function L(n,d){if(!(n instanceof d))throw new TypeError("Cannot call a class as a function")}function I(n,d){for(var w=0;w<d.length;w++){var T=d[w];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(n,T.key,T)}}function p(n,d,w){return d&&I(n.prototype,d),w&&I(n,w),n}function m(n,d){return d&&(Y(d)==="object"||typeof d=="function")?d:h(n)}function u(n){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},u(n)}function h(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function s(n,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(d&&d.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),d&&l(n,d)}function l(n,d){return l=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},l(n,d)}function i(n,d,w){return d in n?Object.defineProperty(n,d,{value:w,enumerable:!0,configurable:!0,writable:!0}):n[d]=w,n}var r=function(n){s(d,n);function d(){var w,T;L(this,d);for(var x=arguments.length,O=new Array(x),E=0;E<x;E++)O[E]=arguments[E];return T=m(this,(w=u(d)).call.apply(w,[this].concat(O))),i(h(T),"onClick",function(v){var _=T.props,f=_.text,c=_.onCopy,S=_.children,y=_.options,b=ee.default.Children.only(S),N=(0,V.default)(f,y);c&&c(f,N),b&&b.props&&typeof b.props.onClick=="function"&&b.props.onClick(v)}),T}return p(d,[{key:"render",value:function(){var T=this.props,x=T.text,O=T.onCopy,E=T.options,v=T.children,_=B(T,["text","onCopy","options","children"]),f=ee.default.Children.only(v);return ee.default.cloneElement(f,R({},_,{onClick:this.onClick}))}}]),d}(ee.default.PureComponent);we.CopyToClipboard=r,i(r,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:function(Be,we){const k=/[&<>"']/,ee=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,Y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},W=E=>Y[E];function R(E,v){if(v){if(k.test(E))return E.replace(ee,W)}else if(V.test(E))return E.replace(P,W);return E}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(E){return E.replace(B,(v,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const L=/(^|[^\[])\^/g;function I(E,v){E=E.source||E,v=v||"";const _={replace:(f,c)=>(c=c.source||c,c=c.replace(L,"$1"),E=E.replace(f,c),_),getRegex:()=>new RegExp(E,v)};return _}const p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(E,v,_){if(E){let f;try{f=decodeURIComponent(M(_)).replace(p,"").toLowerCase()}catch(c){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}v&&!m.test(_)&&(_=r(v,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(f){return null}return _}const h={},s=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(E,v){h[" "+E]||(s.test(E)?h[" "+E]=E+"/":h[" "+E]=T(E,"/",!0)),E=h[" "+E];const _=E.indexOf(":")===-1;return v.substring(0,2)==="//"?_?v:E.replace(l,"$1")+v:v.charAt(0)==="/"?_?v:E.replace(i,"$1")+v:E+v}const n={exec:function(){}};function d(E){let v=1,_,f;for(;v<arguments.length;v++){_=arguments[v];for(f in _)Object.prototype.hasOwnProperty.call(_,f)&&(E[f]=_[f])}return E}function w(E,v){const _=E.replace(/\|/g,(S,y,b)=>{let N=!1,F=y;for(;--F>=0&&b[F]==="\\";)N=!N;return N?"|":" |"}),f=_.split(/ \|/);let c=0;if(f.length>v)f.splice(v);else for(;f.length<v;)f.push("");for(;c<f.length;c++)f[c]=f[c].trim().replace(/\\\|/g,"|");return f}function T(E,v,_){const f=E.length;if(f===0)return"";let c=0;for(;c<f;){const S=E.charAt(f-c-1);if(S===v&&!_)c++;else if(S!==v&&_)c++;else break}return E.substr(0,f-c)}function x(E,v){if(E.indexOf(v[1])===-1)return-1;const _=E.length;let f=0,c=0;for(;c<_;c++)if(E[c]==="\\")c++;else if(E[c]===v[0])f++;else if(E[c]===v[1]&&(f--,f<0))return c;return-1}function O(E){E&&E.sanitize&&!E.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Be.exports={escape:R,unescape:M,edit:I,cleanUrl:u,resolveUrl:r,noopTest:n,merge:d,splitCells:w,rtrim:T,findClosingBracket:x,checkSanitizeDeprecation:O}},rdUC:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"localStorage",read:Y,write:W,each:R,remove:B,clearAll:M};function P(){return V.localStorage}function Y(L){return P().getItem(L)}function W(L,I){return P().setItem(L,I)}function R(L){for(var I=P().length-1;I>=0;I--){var p=P().key(I);L(Y(p),p)}}function B(L){return P().removeItem(L)}function M(){return P().clear()}},"s8/Y":function(Be,we,k){Be.exports=k.p+"static/jx.6713fc81.svg"},"sB/4":function(Be,we,k){Be.exports=k.p+"static/b.7405990c.svg"},sNtx:function(Be,we,k){},sR1s:function(Be,we,k){"use strict";k.d(we,"b",function(){return Y}),k.d(we,"a",function(){return W}),k.d(we,"c",function(){return R}),k.d(we,"d",function(){return B});var ee=k("U8pU"),V="RC_TABLE_KEY";function P(M){return M==null?[]:Array.isArray(M)?M:[M]}function Y(M,L){if(!L&&typeof L!="number")return M;for(var I=P(L),p=M,m=0;m<I.length;m+=1){if(!p)return null;var u=I[m];p=p[u]}return p}function W(M){var L=[],I={};return M.forEach(function(p){for(var m=p||{},u=m.key,h=m.dataIndex,s=u||P(h).join("-")||V;I[s];)s="".concat(s,"_next");I[s]=!0,L.push(s)}),L}function R(){var M={};function L(u,h){h&&Object.keys(h).forEach(function(s){var l=h[s];l&&Object(ee.a)(l)==="object"?(u[s]=u[s]||{},L(u[s],l)):u[s]=l})}for(var I=arguments.length,p=new Array(I),m=0;m<I;m++)p[m]=arguments[m];return p.forEach(function(u){L(M,u)}),M}function B(M){return M!=null}},sboe:function(Be,we,k){"use strict";k.d(we,"a",function(){return P});var ee=k("cDcd"),V=k.n(ee),P=ee.createContext(null)},"t/PP":function(Be,we,k){Be.exports=k.p+"static/title.dd3b799f.svg"},t23M:function(Be,we,k){"use strict";var ee=k("VTBJ"),V=k("1OyB"),P=k("vuIU"),Y=k("Ji7U"),W=k("LK+K"),R=k("cDcd"),B=k.n(R),M=k("m+aA"),L=k("Zm9Q"),I=k("Kwbf"),p=k("c+Xe"),m=k("bdgK"),u="rc-observer-key",h=function(s){Object(Y.a)(i,s);var l=Object(W.a)(i);function i(){var r;return Object(V.a)(this,i),r=l.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(n){var d=r.props.onResize,w=n[0].target,T=w.getBoundingClientRect(),x=T.width,O=T.height,E=w.offsetWidth,v=w.offsetHeight,_=Math.floor(x),f=Math.floor(O);if(r.state.width!==_||r.state.height!==f||r.state.offsetWidth!==E||r.state.offsetHeight!==v){var c={width:_,height:f,offsetWidth:E,offsetHeight:v};r.setState(c),d&&Promise.resolve().then(function(){d(Object(ee.a)(Object(ee.a)({},c),{},{offsetWidth:E,offsetHeight:v}))})}},r.setChildNode=function(n){r.childNode=n},r}return Object(P.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var d=Object(M.a)(this.childNode||this),w=d!==this.currentElement;w&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,d=Object(L.a)(n);if(d.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var w=d[0];if(R.isValidElement(w)&&Object(p.c)(w)){var T=w.ref;d[0]=R.cloneElement(w,{ref:Object(p.a)(T,this.setChildNode)})}return d.length===1?d[0]:d.map(function(x,O){return!R.isValidElement(x)||"key"in x&&x.key!==null?x:R.cloneElement(x,{key:"".concat(u,"-").concat(O)})})}}]),i}(R.Component);h.displayName="ResizeObserver",we.a=h},twBr:function(Be,we,k){Be.exports=k.p+"static/s.1f286590.svg"},uMZB:function(Be,we,k){Be.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(Be,we,k){Be.exports=ee;function ee(){return k("gaXo"),{}}},ulZh:function(Be,we,k){typeof window!="undefined"&&function(V,P){Be.exports=P()}(this,function(){return function(ee){var V={};function P(Y){if(V[Y])return V[Y].exports;var W=V[Y]={i:Y,l:!1,exports:{}};return ee[Y].call(W.exports,W,W.exports,P),W.l=!0,W.exports}return P.m=ee,P.c=V,P.d=function(Y,W,R){P.o(Y,W)||Object.defineProperty(Y,W,{enumerable:!0,get:R})},P.r=function(Y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Y,"__esModule",{value:!0})},P.t=function(Y,W){if(W&1&&(Y=P(Y)),W&8)return Y;if(W&4&&typeof Y=="object"&&Y&&Y.__esModule)return Y;var R=Object.create(null);if(P.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:Y}),W&2&&typeof Y!="string")for(var B in Y)P.d(R,B,function(M){return Y[M]}.bind(null,B));return R},P.n=function(Y){var W=Y&&Y.__esModule?function(){return Y.default}:function(){return Y};return P.d(W,"a",W),W},P.o=function(Y,W){return Object.prototype.hasOwnProperty.call(Y,W)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,V,P){"use strict";var Y=Object.prototype.hasOwnProperty,W="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(W=!1));function B(p,m,u){this.fn=p,this.context=m,this.once=u||!1}function M(p,m,u,h,s){if(typeof u!="function")throw new TypeError("The listener must be a function");var l=new B(u,h||p,s),i=W?W+m:m;return p._events[i]?p._events[i].fn?p._events[i]=[p._events[i],l]:p._events[i].push(l):(p._events[i]=l,p._eventsCount++),p}function L(p,m){--p._eventsCount===0?p._events=new R:delete p._events[m]}function I(){this._events=new R,this._eventsCount=0}I.prototype.eventNames=function(){var m=[],u,h;if(this._eventsCount===0)return m;for(h in u=this._events)Y.call(u,h)&&m.push(W?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(u)):m},I.prototype.listeners=function(m){var u=W?W+m:m,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var s=0,l=h.length,i=new Array(l);s<l;s++)i[s]=h[s].fn;return i},I.prototype.listenerCount=function(m){var u=W?W+m:m,h=this._events[u];return h?h.fn?1:h.length:0},I.prototype.emit=function(m,u,h,s,l,i){var r=W?W+m:m;if(!this._events[r])return!1;var n=this._events[r],d=arguments.length,w,T;if(n.fn){n.once&&this.removeListener(m,n.fn,void 0,!0);switch(d){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,u),!0;case 3:return n.fn.call(n.context,u,h),!0;case 4:return n.fn.call(n.context,u,h,s),!0;case 5:return n.fn.call(n.context,u,h,s,l),!0;case 6:return n.fn.call(n.context,u,h,s,l,i),!0}for(T=1,w=new Array(d-1);T<d;T++)w[T-1]=arguments[T];n.fn.apply(n.context,w)}else{var x=n.length,O;for(T=0;T<x;T++){n[T].once&&this.removeListener(m,n[T].fn,void 0,!0);switch(d){case 1:n[T].fn.call(n[T].context);break;case 2:n[T].fn.call(n[T].context,u);break;case 3:n[T].fn.call(n[T].context,u,h);break;case 4:n[T].fn.call(n[T].context,u,h,s);break;default:if(!w)for(O=1,w=new Array(d-1);O<d;O++)w[O-1]=arguments[O];n[T].fn.apply(n[T].context,w)}}}return!0},I.prototype.on=function(m,u,h){return M(this,m,u,h,!1)},I.prototype.once=function(m,u,h){return M(this,m,u,h,!0)},I.prototype.removeListener=function(m,u,h,s){var l=W?W+m:m;if(!this._events[l])return this;if(!u)return L(this,l),this;var i=this._events[l];if(i.fn)i.fn===u&&(!s||i.once)&&(!h||i.context===h)&&L(this,l);else{for(var r=0,n=[],d=i.length;r<d;r++)(i[r].fn!==u||s&&!i[r].once||h&&i[r].context!==h)&&n.push(i[r]);n.length?this._events[l]=n.length===1?n[0]:n:L(this,l)}return this},I.prototype.removeAllListeners=function(m){var u;return m?(u=W?W+m:m,this._events[u]&&L(this,u)):(this._events=new R,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=W,I.EventEmitter=I,ee.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,V,P){(function(Y){var W=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,M=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,L={buildAbsoluteURL:function(I,p,m){if(m=m||{},I=I.trim(),p=p.trim(),!p){if(!m.alwaysNormalize)return I;var u=L.parseURL(I);if(!u)throw new Error("Error trying to parse base URL.");return u.path=L.normalizePath(u.path),L.buildURLFromParts(u)}var h=L.parseURL(p);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return m.alwaysNormalize?(h.path=L.normalizePath(h.path),L.buildURLFromParts(h)):p;var s=L.parseURL(I);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var l=R.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var i={scheme:s.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(i.netLoc=s.netLoc,h.path[0]!=="/"))if(!h.path)i.path=s.path,h.params||(i.params=s.params,h.query||(i.query=s.query));else{var r=s.path,n=r.substring(0,r.lastIndexOf("/")+1)+h.path;i.path=L.normalizePath(n)}return i.path===null&&(i.path=m.alwaysNormalize?L.normalizePath(h.path):h.path),L.buildURLFromParts(i)},parseURL:function(I){var p=W.exec(I);return p?{scheme:p[1]||"",netLoc:p[2]||"",path:p[3]||"",params:p[4]||"",query:p[5]||"",fragment:p[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(B,"");I.length!==(I=I.replace(M,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};ee.exports=L})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,V,P){function Y(m){var u={};function h(l){if(u[l])return u[l].exports;var i=u[l]={i:l,l:!1,exports:{}};return m[l].call(i.exports,i,i.exports,h),i.l=!0,i.exports}h.m=m,h.c=u,h.i=function(l){return l},h.d=function(l,i,r){h.o(l,i)||Object.defineProperty(l,i,{configurable:!1,enumerable:!0,get:r})},h.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},h.n=function(l){var i=l&&l.__esModule?function(){return l.default}:function(){return l};return h.d(i,"a",i),i},h.o=function(l,i){return Object.prototype.hasOwnProperty.call(l,i)},h.p="/",h.oe=function(l){throw console.error(l),l};var s=h(h.s=ENTRY_MODULE);return s.default||s}var W="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+W+").*?\\)";function B(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function M(m){return!isNaN(1*m)}function L(m,u,h){var s={};s[h]=[];var l=u.toString(),i=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return s;for(var r=i[1],n=new RegExp("(\\\\n|\\W)"+B(r)+R,"g"),d;d=n.exec(l);){if(d[3]==="dll-reference")continue;s[h].push(d[3])}for(n=new RegExp("\\("+B(r)+'\\("(dll-reference\\s('+W+'))"\\)\\)'+R,"g");d=n.exec(l);)m[d[2]]||(s[h].push(d[1]),m[d[2]]=P(d[1]).m),s[d[2]]=s[d[2]]||[],s[d[2]].push(d[4]);for(var w=Object.keys(s),T=0;T<w.length;T++)for(var x=0;x<s[w[T]].length;x++)M(s[w[T]][x])&&(s[w[T]][x]=1*s[w[T]][x]);return s}function I(m){var u=Object.keys(m);return u.reduce(function(h,s){return h||m[s].length>0},!1)}function p(m,u){for(var h={main:[u]},s={main:[]},l={main:{}};I(h);)for(var i=Object.keys(h),r=0;r<i.length;r++){var n=i[r],d=h[n],w=d.pop();if(l[n]=l[n]||{},l[n][w]||!m[n][w])continue;l[n][w]=!0,s[n]=s[n]||[],s[n].push(w);for(var T=L(m,m[n][w],n),x=Object.keys(T),O=0;O<x.length;O++)h[x[O]]=h[x[O]]||[],h[x[O]]=h[x[O]].concat(T[x[O]])}return s}ee.exports=function(m,u){u=u||{};var h={main:P.m},s=u.all?{main:Object.keys(h.main)}:p(h,m),l="";Object.keys(s).filter(function(w){return w!=="main"}).forEach(function(w){for(var T=0;s[w][T];)T++;s[w].push(T),h[w][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+w+" = ("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+s[w].map(function(x){return""+JSON.stringify(x)+": "+h[w][x].toString()}).join(",")+`});
`}),l=l+"new (("+Y.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+s.main.map(function(w){return""+JSON.stringify(w)+": "+h.main[w].toString()}).join(",")+"}))(self);";var i=new window.Blob([l],{type:"text/javascript"});if(u.bare)return i;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,n=r.createObjectURL(i),d=new window.Worker(n);return d.objectURL=n,d}},"./src/config.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"hlsDefaultConfig",function(){return O}),P.d(V,"mergeConfig",function(){return v}),P.d(V,"enableStreamingMode",function(){return _});var Y=P("./src/controller/abr-controller.ts"),W=P("./src/controller/audio-stream-controller.ts"),R=P("./src/controller/audio-track-controller.ts"),B=P("./src/controller/subtitle-stream-controller.ts"),M=P("./src/controller/subtitle-track-controller.ts"),L=P("./src/controller/buffer-controller.ts"),I=P("./src/controller/timeline-controller.ts"),p=P("./src/controller/cap-level-controller.ts"),m=P("./src/controller/fps-controller.ts"),u=P("./src/controller/eme-controller.ts"),h=P("./src/controller/cmcd-controller.ts"),s=P("./src/utils/xhr-loader.ts"),l=P("./src/utils/fetch-loader.ts"),i=P("./src/utils/cues.ts"),r=P("./src/utils/mediakeys-helper.ts"),n=P("./src/utils/logger.ts");function d(){return d=Object.assign||function(f){for(var c=1;c<arguments.length;c++){var S=arguments[c];for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(f[y]=S[y])}return f},d.apply(this,arguments)}function w(f,c){var S=Object.keys(f);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(f);c&&(y=y.filter(function(b){return Object.getOwnPropertyDescriptor(f,b).enumerable})),S.push.apply(S,y)}return S}function T(f){for(var c=1;c<arguments.length;c++){var S=arguments[c]!=null?arguments[c]:{};c%2?w(Object(S),!0).forEach(function(y){x(f,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(S)):w(Object(S)).forEach(function(y){Object.defineProperty(f,y,Object.getOwnPropertyDescriptor(S,y))})}return f}function x(f,c,S){return c in f?Object.defineProperty(f,c,{value:S,enumerable:!0,configurable:!0,writable:!0}):f[c]=S,f}var O=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Y.default,bufferController:L.default,capLevelController:p.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:M.default,timelineController:I.TimelineController,audioStreamController:W.default,audioTrackController:R.default,emeController:u.default,cmcdController:h.default});function E(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function v(f,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},f,c)}function _(f){var c=f.loader;if(c!==l.default&&c!==s.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var S=Object(l.fetchSupported)();S&&(f.loader=l.default,f.progressive=!0,f.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/ewma-bandwidth-estimator.ts"),R=P("./src/events.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/errors.ts"),L=P("./src/types/loader.ts"),I=P("./src/utils/logger.ts");function p(h,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(h,i.key,i)}}function m(h,s,l){return s&&p(h.prototype,s),l&&p(h,l),h}var u=function(){function h(l){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=l;var i=l.config;this.bwEstimator=new W.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var s=h.prototype;return s.registerListeners=function(){var i=this.hls;i.on(R.Events.FRAG_LOADING,this.onFragLoading,this),i.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(R.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(R.Events.FRAG_LOADING,this.onFragLoading,this),i.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(R.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(i,r){var n=r.frag;if(n.type===L.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=n,this.partCurrent=(d=r.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(i,r){var n=this.hls.config;r.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var i=this.fragCurrent,r=this.partCurrent,n=this.hls,d=n.autoLevelEnabled,w=n.config,T=n.media;if(!i||!T)return;var x=r?r.stats:i.stats,O=r?r.duration:i.duration;if(x.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||T.paused||!T.playbackRate||!T.readyState)return;var E=performance.now()-x.loading.start,v=Math.abs(T.playbackRate);if(E<=500*O/v)return;var _=n.levels,f=n.minAutoLevel,c=_[i.level],S=x.total||Math.max(x.loaded,Math.round(O*c.maxBitrate/8)),y=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/E),b=(S-x.loaded)/y,N=T.currentTime,F=(B.BufferHelper.bufferInfo(T,N,w.maxBufferHole).end-N)/v;if(F>=2*O/v||b<=F)return;var X=Number.POSITIVE_INFINITY,Z;for(Z=i.level-1;Z>f;Z--){var H=_[Z].maxBitrate;if(X=O*H/(8*.8*y),X<F)break}if(X>=b)return;var A=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+i.sn+(r?" part "+r.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Z+`
Current BW estimate: `+(Object(Y.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+b.toFixed(3)+` s
Estimated load time for the next fragment: `+X.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),n.nextLoadLevel=Z,this.bwEstimator.sample(E,x.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),n.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:x})},s.onFragLoaded=function(i,r){var n=r.frag,d=r.part;if(n.type===L.PlaylistLevelType.MAIN&&Object(Y.isFiniteNumber)(n.sn)){var w=d?d.stats:n.stats,T=d?d.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[n.level],O=(x.loaded?x.loaded.bytes:0)+w.loaded,E=(x.loaded?x.loaded.duration:0)+T;x.loaded={bytes:O,duration:E},x.realBitrate=Math.round(8*O/E)}if(n.bitrateTest){var v={stats:w,frag:n,part:d,id:n.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,v),n.bitrateTest=!1}}},s.onFragBuffered=function(i,r){var n=r.frag,d=r.part,w=d?d.stats:n.stats;if(w.aborted)return;if(n.type!==L.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var T=w.parsing.end-w.loading.start;this.bwEstimator.sample(T,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},s.onError=function(i,r){switch(r.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var i=this.fragCurrent,r=this.partCurrent,n=this.hls,d=n.maxAutoLevel,w=n.config,T=n.minAutoLevel,x=n.media,O=r?r.duration:i?i.duration:0,E=x?x.currentTime:0,v=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,f=(B.BufferHelper.bufferInfo(x,E,w.maxBufferHole).end-E)/v,c=this.findBestLevel(_,T,d,f,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(c>=0)return c;I.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=O?Math.min(O,w.maxStarvationDelay):w.maxStarvationDelay,y=w.abrBandWidthFactor,b=w.abrBandWidthUpFactor;if(!f){var N=this.bitrateTestDelay;if(N){var F=O?Math.min(O,w.maxLoadingDelay):w.maxLoadingDelay;S=F-N,I.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),y=b=1}}return c=this.findBestLevel(_,T,d,f+S,y,b),Math.max(c,0)},s.findBestLevel=function(i,r,n,d,w,T){for(var x,O=this.fragCurrent,E=this.partCurrent,v=this.lastLoadedFragLevel,_=this.hls.levels,f=_[v],c=!!(f!=null&&(x=f.details)!==null&&x!==void 0&&x.live),S=f==null?void 0:f.codecSet,y=E?E.duration:O?O.duration:0,b=n;b>=r;b--){var N=_[b];if(!N||S&&N.codecSet!==S)continue;var F=N.details,X=(E?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||y,Z=void 0;b<=v?Z=w*i:Z=T*i;var H=_[b].maxBitrate,A=H*X/Z;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+b+"/"+Math.round(Z)+"/"+H+"/"+X+"/"+d+"/"+A),Z>H&&(!A||c&&!this.bitrateTestDelay||A<d))return b}return-1},m(h,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,r=this.bwEstimator;if(i!==-1&&(!r||!r.canEstimate()))return i;var n=this.getNextABRAutoLevel();return i!==-1&&(n=Math.min(i,n)),n},set:function(i){this._nextAutoLevel=i}}]),h}();V.default=u},"./src/controller/audio-stream-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/polyfills/number.ts"),W=P("./src/controller/base-stream-controller.ts"),R=P("./src/events.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/controller/fragment-tracker.ts"),L=P("./src/types/level.ts"),I=P("./src/types/loader.ts"),p=P("./src/loader/fragment.ts"),m=P("./src/demux/chunk-cache.ts"),u=P("./src/demux/transmuxer-interface.ts"),h=P("./src/types/transmuxer.ts"),s=P("./src/controller/fragment-finders.ts"),l=P("./src/utils/discontinuities.ts"),i=P("./src/errors.ts"),r=P("./src/utils/logger.ts");function n(){return n=Object.assign||function(O){for(var E=1;E<arguments.length;E++){var v=arguments[E];for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(O[_]=v[_])}return O},n.apply(this,arguments)}function d(O,E){O.prototype=Object.create(E.prototype),O.prototype.constructor=O,w(O,E)}function w(O,E){return w=Object.setPrototypeOf||function(_,f){return _.__proto__=f,_},w(O,E)}var T=100,x=function(O){d(E,O);function E(_,f){var c;return c=O.call(this,_,f,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var v=E.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var f=this.hls;f.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(R.Events.ERROR,this.onError,this),f.on(R.Events.BUFFER_RESET,this.onBufferReset,this),f.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var f=this.hls;f.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(R.Events.ERROR,this.onError,this),f.off(R.Events.BUFFER_RESET,this.onBufferReset,this),f.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(f,c){var S=c.frag,y=c.id,b=c.initPTS;if(y==="main"){var N=S.cc;this.initPTS[S.cc]=b,this.log("InitPTS for cc: "+N+" found from main: "+b),this.videoTrackCC=N,this.state===W.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=W.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,c>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=W.State.IDLE):(this.loadedmetadata=!1,this.state=W.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},v.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_TRACK:{var f,c=this.levels,S=this.trackId,y=c==null||((f=c[S])===null||f===void 0)?void 0:f.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=W.State.WAITING_INIT_PTS}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var b,N=performance.now(),F=this.retryDate;(!F||N>=F||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=W.State.IDLE);break}case W.State.WAITING_INIT_PTS:{var X=this.waitingData;if(X){var Z=X.frag,H=X.part,A=X.cache,z=X.complete;if(this.initPTS[Z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.FRAG_LOADING;var ne=A.flush(),ae={frag:Z,part:H,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(ae),z&&O.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+Z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var me=this.getLoadPosition(),xe=B.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),Te=Object(s.fragmentWithinToleranceTest)(xe.end,this.config.maxFragLookUpTolerance,Z);Te<0&&(r.logger.log("Waiting fragment cc ("+Z.cc+") @ "+Z.start+" cancelled because another fragment at "+xe.end+" is needed"),this.clearWaitingFragment())}}else this.state=W.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.IDLE)},v.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:f,S=c.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},v.doTickIdle=function(){var f,c,S=this.hls,y=this.levels,b=this.media,N=this.trackId,F=S.config;if(!y||!y[N])return;if(!b&&(this.startFragRequested||!F.startFragPrefetch))return;var X=y[N],Z=X.details;if(!Z||Z.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(Z)){this.state=W.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(H===null)return;var A=H.len,z=this.getMaxBufferLength(),ne=this.audioSwitch;if(A>=z&&!ne)return;if(!ne&&this._streamEnded(H,Z)){S.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=W.State.ENDED;return}var ae=Z.fragments,me=ae[0].start,xe=H.end;if(ne){var Te=this.getLoadPosition();xe=Te,Z.PTSKnown&&Te<me&&((H.end>me||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),b.currentTime=me+.05))}var Oe=this.getNextFragment(xe,Z);if(!Oe){this.bufferFlushed=!0;return}((f=Oe.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((c=Oe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Oe,Z):this.loadFragment(Oe,Z,xe)},v.getMaxBufferLength=function(){var f=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return c===null?f:Math.max(f,c.len)},v.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(f,c){var S=c.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(y){return new L.Level(y)})},v.onAudioTrackSwitching=function(f,c){var S=!!c.url;this.trackId=c.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(T):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=W.State.IDLE):this.state=W.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(f,c){this.mainDetails=c.details},v.onAudioTrackLoaded=function(f,c){var S,y=this.levels,b=c.details,N=c.id;if(!y){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+b.startSN+","+b.endSN+"],duration:"+b.totalduration);var F=y[N],X=0;if(b.live||(S=F.details)!==null&&S!==void 0&&S.live){var Z=this.mainDetails;if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed||!Z)return;!F.details&&b.hasProgramDateTime&&Z.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(b,Z),X=b.fragments[0].start):X=this.alignPlaylists(b,F.details)}F.details=b,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!b.live)&&this.setStartPosition(F.details,X),this.state===W.State.WAITING_TRACK&&!this.waitForCdnTuneIn(b)&&(this.state=W.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(f){var c,S=f.frag,y=f.part,b=f.payload,N=this.config,F=this.trackId,X=this.levels;if(!X){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var Z=X[F];console.assert(Z,"Audio track is defined on fragment load progress");var H=Z.details;console.assert(H,"Audio track details are defined on fragment load progress");var A=N.defaultAudioCodec||Z.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new u.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[S.cc],ae=(c=S.initSegment)===null||c===void 0?void 0:c.data;if(ne!==void 0){var me=!1,xe=y?y.index:-1,Te=xe!==-1,Oe=new h.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,b.byteLength,xe,Te);z.push(b,ae,A,"",S,y,H.totalduration,me,Oe,ne)}else{r.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+F);var Ue=this.waitingData=this.waitingData||{frag:S,part:y,cache:new m.default,complete:!1},De=Ue.cache;De.push(new Uint8Array(b)),this.waitingVideoCC=this.videoTrackCC,this.state=W.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,f)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(f,c){var S=c.tracks.audio;S&&(this.mediaBuffer=S.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},v.onFragBuffered=function(f,c){var S=c.frag,y=c.part;if(S.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(y?" p: "+y.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,y)},v.onError=function(f,c){switch(c.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,c);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==W.State.ERROR&&this.state!==W.State.STOPPED&&(this.state=c.fatal?W.State.ERROR:W.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var S=!0,y=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);y&&y.len>.5&&(S=!this.reduceMaxBufferLength(y.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(f,c){var S=c.type;S===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(f){var c,S="audio",y=this.hls,b=f.remuxResult,N=f.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var X=F.frag,Z=F.part,H=b.audio,A=b.text,z=b.id3,ne=b.initSegment;if(this.fragContextChanged(X))return;if(this.state=W.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,X,N),y.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:X,id:S,tracks:ne.tracks})),H){var ae=H.startPTS,me=H.endPTS,xe=H.startDTS,Te=H.endDTS;Z&&(Z.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:me,startDTS:xe,endDTS:Te}),X.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ae,me,xe,Te),this.bufferFragmentData(H,X,Z,N)}if(z!=null&&(c=z.samples)!==null&&c!==void 0&&c.length){var Oe=n({frag:X,id:S},z);y.trigger(R.Events.FRAG_PARSING_METADATA,Oe)}if(A){var Ue=n({frag:X,id:S},A);y.trigger(R.Events.FRAG_PARSING_USERDATA,Ue)}},v._bufferInitSegment=function(f,c,S){if(this.state!==W.State.PARSING)return;f.video&&delete f.video;var y=f.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,f);var b=y.initSegment;if(b!=null&&b.byteLength){var N={type:"audio",frag:c,part:null,chunkMeta:S,parent:c.type,data:b};this.hls.trigger(R.Events.BUFFER_APPENDING,N)}this.tick()},v.loadFragment=function(f,c,S){var y=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||y===M.FragmentState.NOT_LOADED||y===M.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):c.live&&!Object(Y.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=W.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,f,c,S)))},v.completeAudioSwitch=function(){var f=this.hls,c=this.media,S=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:S})},E}(W.default);V.default=x},"./src/controller/audio-track-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/controller/base-playlist-controller.ts"),B=P("./src/types/loader.ts");function M(u,h){for(var s=0;s<h.length;s++){var l=h[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(u,l.key,l)}}function L(u,h,s){return h&&M(u.prototype,h),s&&M(u,s),u}function I(u,h){u.prototype=Object.create(h.prototype),u.prototype.constructor=u,p(u,h)}function p(u,h){return p=Object.setPrototypeOf||function(l,i){return l.__proto__=i,l},p(u,h)}var m=function(u){I(h,u);function h(l){var i;return i=u.call(this,l,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var s=h.prototype;return s.registerListeners=function(){var i=this.hls;i.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(Y.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var i=this.hls;i.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(Y.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(Y.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,u.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(i,r){this.tracks=r.audioTracks||[]},s.onAudioTrackLoaded=function(i,r){var n=r.id,d=r.details,w=this.tracksInGroup[n];if(!w){this.warn("Invalid audio track id "+n);return}var T=w.details;w.details=r.details,this.log("audioTrack "+n+" loaded ["+d.startSN+"-"+d.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,r,T))},s.onLevelLoading=function(i,r){this.switchLevel(r.level)},s.onLevelSwitching=function(i,r){this.switchLevel(r.level)},s.switchLevel=function(i){var r=this.hls.levels[i];if(!(r!=null&&r.audioGroupIds))return;var n=r.audioGroupIds[r.urlId];if(this.groupId!==n){this.groupId=n;var d=this.tracks.filter(function(T){return!n||T.groupId===n});this.selectDefaultTrack&&!d.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var w={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(Y.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},s.onError=function(i,r){if(u.prototype.onError.call(this,i,r),r.fatal||!r.context)return;r.context.type===B.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},s.setAudioTrack=function(i){var r=this.tracksInGroup;if(i<0||i>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=r[this.trackId];this.log("Now switching to audio-track index "+i);var d=r[i],w=d.id,T=d.groupId,x=T===void 0?"":T,O=d.name,E=d.type,v=d.url;if(this.trackId=i,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(Y.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:x,name:O,type:E,url:v}),d.details&&!d.details.live)return;var _=this.switchParams(d.url,n==null?void 0:n.details);this.loadPlaylist(_)},s.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,n=this.findTrackId(r)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(i){for(var r=this.tracksInGroup,n=0;n<r.length;n++){var d=r[n];if((!this.selectDefaultTrack||d.default)&&(!i||i===d.name))return d.id}return-1},s.loadPlaylist=function(i){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var n=r.id,d=r.groupId,w=r.url;if(i)try{w=i.addDirectives(w)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(Y.Events.AUDIO_TRACK_LOADING,{url:w,id:n,groupId:d,deliveryDirectives:i||null})}},L(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),h}(R.default);V.default=m},"./src/controller/base-playlist-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return L});var Y=P("./src/polyfills/number.ts"),W=P("./src/types/level.ts"),R=P("./src/controller/level-helper.ts"),B=P("./src/utils/logger.ts"),M=P("./src/errors.ts"),L=function(){function I(m,u){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,u+":"),this.warn=B.logger.warn.bind(B.logger,u+":"),this.hls=m}var p=I.prototype;return p.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},p.onError=function(u,h){h.fatal&&h.type===M.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},p.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},p.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},p.stopLoad=function(){this.canLoad=!1,this.clearTimer()},p.switchParams=function(u,h){var s=h==null?void 0:h.renditionReports;if(s)for(var l=0;l<s.length;l++){var i=s[l],r=""+i.URI;if(r===u.substr(-r.length)){var n=parseInt(i["LAST-MSN"]),d=parseInt(i["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var w=Math.min(h.age-h.partTarget,h.targetduration);d!==void 0&&w>h.partTarget&&(d+=1)}if(Object(Y.isFiniteNumber)(n))return new W.HlsUrlParameters(n,Object(Y.isFiniteNumber)(d)?d:void 0,W.HlsSkip.No)}}},p.loadPlaylist=function(u){},p.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},p.playlistLoaded=function(u,h,s){var l=this,i=h.details,r=h.stats,n=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(i.advancedDateTime=Date.now()-n,i.live||s!=null&&s.live){if(i.reloaded(s),s&&this.log("live playlist "+u+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),s&&i.fragments.length>0&&Object(R.mergeDetails)(s,i),!this.canLoad||!i.live)return;var d,w=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var x=this.hls.config.lowLatencyMode,O=i.lastPartSn,E=i.endSN,v=i.lastPartIndex,_=v!==-1,f=O===E,c=x?0:v;_?(w=f?E+1:O,T=f?c:v+1):w=E+1;var S=i.age,y=S+i.ageHeader,b=Math.min(y-i.partTarget,i.targetduration*1.5);if(b>0){if(s&&b>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+b+" with playlist age: "+i.age),b=0;else{var N=Math.floor(b/i.targetduration);if(w+=N,T!==void 0){var F=Math.round(b%i.targetduration/i.partTarget);T+=F}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+b+" skip sn "+N+" to part "+T)}i.tuneInGoal=b}if(d=this.getDeliveryDirectives(i,h.deliveryDirectives,w,T),x||!f){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(i,h.deliveryDirectives,w,T);var X=Object(R.computeReloadInterval)(i,r);w!==void 0&&i.canBlockReload&&(X-=i.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(X)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(d)},X)}else this.clearTimer()},p.getDeliveryDirectives=function(u,h,s,l){var i=Object(W.getSkipValue)(u,s);return h!=null&&h.skip&&u.deltaUpdateFailed&&(s=h.msn,l=h.part,i=W.HlsSkip.No),new W.HlsUrlParameters(s,l,i)},p.retryLoadingOrFail=function(u){var h=this,s=this.hls.config,l=this.retryCount<s.levelLoadingMaxRetry;if(l){var i;if(this.retryCount++,u.details.indexOf("LoadTimeOut")>-1&&(i=u.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return l},I}()},"./src/controller/base-stream-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"State",function(){return E}),P.d(V,"default",function(){return v});var Y=P("./src/polyfills/number.ts"),W=P("./src/task-loop.ts"),R=P("./src/controller/fragment-tracker.ts"),B=P("./src/utils/buffer-helper.ts"),M=P("./src/utils/logger.ts"),L=P("./src/events.ts"),I=P("./src/errors.ts"),p=P("./src/types/transmuxer.ts"),m=P("./src/utils/mp4-tools.ts"),u=P("./src/utils/discontinuities.ts"),h=P("./src/controller/fragment-finders.ts"),s=P("./src/controller/level-helper.ts"),l=P("./src/loader/fragment-loader.ts"),i=P("./src/crypt/decrypter.ts"),r=P("./src/utils/time-ranges.ts"),n=P("./src/types/loader.ts");function d(_,f){for(var c=0;c<f.length;c++){var S=f[c];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}function w(_,f,c){return f&&d(_.prototype,f),c&&d(_,c),_}function T(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function x(_,f){_.prototype=Object.create(f.prototype),_.prototype.constructor=_,O(_,f)}function O(_,f){return O=Object.setPrototypeOf||function(S,y){return S.__proto__=y,S},O(_,f)}var E={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},v=function(_){x(f,_);function f(S,y,b){var N;return N=_.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=E.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=b,N.log=M.logger.log.bind(M.logger,b+":"),N.warn=M.logger.warn.bind(M.logger,b+":"),N.hls=S,N.fragmentLoader=new l.default(S.config),N.fragmentTracker=y,N.config=S.config,N.decrypter=new i.default(S,S.config),S.on(L.Events.KEY_LOADED,N.onKeyLoaded,T(N)),N}var c=f.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(y){},c.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},c._streamEnded=function(y,b){var N=this.fragCurrent,F=this.fragmentTracker;if(!b.live&&N&&N.sn===b.endSN&&!y.nextStart){var X=F.getState(N);return X===R.FragmentState.PARTIAL||X===R.FragmentState.OK}return!1},c.onMediaAttached=function(y,b){var N=this.media=this.mediaBuffer=b.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(F.startPosition)},c.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var y=this.config,b=this.fragCurrent,N=this.media,F=this.mediaBuffer,X=this.state,Z=N?N.currentTime:0,H=B.BufferHelper.bufferInfo(F||N,Z,y.maxBufferHole);if(this.log("media seeking to "+(Object(Y.isFiniteNumber)(Z)?Z.toFixed(3):Z)+", state: "+X),X===E.ENDED)this.resetLoadingState();else if(b&&!H.len){var A=y.maxFragLookUpTolerance,z=b.start-A,ne=b.start+b.duration+A,ae=Z>ne;(Z<z||ae)&&(ae&&b.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),b.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=Z),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=Z),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(y,b){if(this.state!==E.KEY_LOADING||b.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var N=this.levels[b.frag.level].details;N&&this.loadFragment(b.frag,N,b.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(L.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,_.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(y,b){this.log("Loading key for "+y.sn+" of ["+b.startSN+"-"+b.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=E.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(L.Events.KEY_LOADING,{frag:y})},c.loadFragment=function(y,b,N){this._loadFragForPlayback(y,b,N)},c._loadFragForPlayback=function(y,b,N){var F=this,X=function(H){if(F.fragContextChanged(y)){F.warn("Fragment "+y.sn+(H.part?" p: "+H.part.index:"")+" of level "+y.level+" was dropped during download."),F.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,F._handleFragmentLoadProgress(H)};this._doFragLoad(y,b,N,X).then(function(Z){if(!Z)return;F.fragLoadError=0;var H=F.state;if(F.fragContextChanged(y)){(H===E.FRAG_LOADING||H===E.BACKTRACKING||!F.fragCurrent&&H===E.PARSING)&&(F.fragmentTracker.removeFragment(y),F.state=E.IDLE);return}if("payload"in Z&&(F.log("Loaded fragment "+y.sn+" of level "+y.level),F.hls.trigger(L.Events.FRAG_LOADED,Z),F.state===E.BACKTRACKING)){F.fragmentTracker.backtrack(y,Z),F.resetFragmentLoading(y);return}F._handleFragmentLoadComplete(Z)}).catch(function(Z){F.warn(Z),F.resetFragmentLoading(y)})},c.flushMainBuffer=function(y,b,N){if(N===void 0&&(N=null),!(y-b))return;var F={startOffset:y,endOffset:b,type:N};this.fragLoadError=0,this.hls.trigger(L.Events.BUFFER_FLUSHING,F)},c._loadInitSegment=function(y){var b=this;this._doFragLoad(y).then(function(N){if(!N||b.fragContextChanged(y)||!b.levels)throw new Error("init load aborted");return N}).then(function(N){var F=b.hls,X=N.payload,Z=y.decryptdata;if(X&&X.byteLength>0&&Z&&Z.key&&Z.iv&&Z.method==="AES-128"){var H=self.performance.now();return b.decrypter.webCryptoDecrypt(new Uint8Array(X),Z.key.buffer,Z.iv.buffer).then(function(A){var z=self.performance.now();return F.trigger(L.Events.FRAG_DECRYPTED,{frag:y,payload:A,stats:{tstart:H,tdecrypt:z}}),N.payload=A,N})}return N}).then(function(N){var F=b.fragCurrent,X=b.hls,Z=b.levels;if(!Z)throw new Error("init load aborted, missing levels");var H=Z[y.level].details;console.assert(H,"Level details are defined when init segment is loaded");var A=y.stats;b.state=E.IDLE,b.fragLoadError=0,y.data=new Uint8Array(N.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),N.frag===F&&X.trigger(L.Events.FRAG_BUFFERED,{stats:A,frag:F,part:null,id:y.type}),b.tick()}).catch(function(N){b.warn(N),b.resetFragmentLoading(y)})},c.fragContextChanged=function(y){var b=this.fragCurrent;return!y||!b||y.level!==b.level||y.sn!==b.sn||y.urlId!==b.urlId},c.fragBufferedComplete=function(y,b){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(b?" part: "+b.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+r.default.toString(B.BufferHelper.getBuffered(N))),this.state=E.IDLE,this.tick()},c._handleFragmentLoadComplete=function(y){var b=this.transmuxer;if(!b)return;var N=y.frag,F=y.part,X=y.partsLoaded,Z=!X||X.length===0||X.some(function(A){return!A}),H=new p.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!Z);b.flush(H)},c._handleFragmentLoadProgress=function(y){},c._doFragLoad=function(y,b,N,F){var X=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(y.start,N||0),this.config.lowLatencyMode&&b){var Z=b.partList;if(Z&&F){N>y.end&&b.fragmentHint&&(y=b.fragmentHint);var H=this.getNextPart(Z,y,N);if(H>-1){var A=Z[H];return this.log("Loading part sn: "+y.sn+" p: "+A.index+" cc: "+y.cc+" of playlist ["+b.startSN+"-"+b.endSN+"] parts [0-"+H+"-"+(Z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=E.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:y,part:Z[H],targetBufferTime:N}),this.doFragPartsLoad(y,Z,H,F).catch(function(z){return X.handleFragLoadError(z)})}else if(!y.url||this.loadedEndOfParts(Z,N))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(b?"of ["+b.startSN+"-"+b.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),Object(Y.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=E.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:y,targetBufferTime:N}),this.fragmentLoader.load(y,F).catch(function(z){return X.handleFragLoadError(z)})},c.doFragPartsLoad=function(y,b,N,F){var X=this;return new Promise(function(Z,H){var A=[],z=function ne(ae){var me=b[ae];X.fragmentLoader.loadPart(y,me,F).then(function(xe){A[me.index]=xe;var Te=xe.part;X.hls.trigger(L.Events.FRAG_LOADED,xe);var Oe=b[ae+1];if(Oe&&Oe.fragment===y)ne(ae+1);else return Z({frag:y,part:Te,partsLoaded:A})}).catch(H)};z(N)})},c.handleFragLoadError=function(y){var b=y.data;return b&&b.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(b.frag,b.part):this.hls.trigger(L.Events.ERROR,b),null},c._handleTransmuxerFlush=function(y){var b=this.getCurrentContext(y);if(!b||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var N=b.frag,F=b.part,X=b.level,Z=self.performance.now();N.stats.parsing.end=Z,F&&(F.stats.parsing.end=Z),this.updateLevelTiming(N,F,X,y.partial)},c.getCurrentContext=function(y){var b=this.levels,N=y.level,F=y.sn,X=y.part;if(!b||!b[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var Z=b[N],H=X>-1?Object(s.getPartWith)(Z,F,X):null,A=H?H.fragment:Object(s.getFragmentWithSN)(Z,F,this.fragCurrent);return A?{frag:A,part:H,level:Z}:null},c.bufferFragmentData=function(y,b,N,F){if(!y||this.state!==E.PARSING)return;var X=y.data1,Z=y.data2,H=X;if(X&&Z&&(H=Object(m.appendUint8Array)(X,Z)),!H||!H.length)return;var A={type:y.type,frag:b,part:N,chunkMeta:F,parent:b.type,data:H};this.hls.trigger(L.Events.BUFFER_APPENDING,A),y.dropped&&y.independent&&!N&&this.flushBufferGap(b)},c.flushBufferGap=function(y){var b=this.media;if(!b)return;if(!B.BufferHelper.isBuffered(b,b.currentTime)){this.flushMainBuffer(0,y.start);return}var N=b.currentTime,F=B.BufferHelper.bufferInfo(b,N,0),X=y.duration,Z=Math.min(this.config.maxFragLookUpTolerance*2,X*.25),H=Math.max(Math.min(y.start-Z,F.end-Z),N+Z);y.start-H>Z&&this.flushMainBuffer(H,y.start)},c.getFwdBufferInfo=function(y,b){var N=this.config,F=this.getLoadPosition();if(!Object(Y.isFiniteNumber)(F))return null;var X=B.BufferHelper.bufferInfo(y,F,N.maxBufferHole);if(X.len===0&&X.nextStart!==void 0){var Z=this.fragmentTracker.getBufferedFrag(F,b);if(Z&&X.nextStart<Z.end)return B.BufferHelper.bufferInfo(y,F,Math.max(X.nextStart,N.maxBufferHole))}return X},c.getMaxBufferLength=function(y){var b=this.config,N;return y?N=Math.max(8*b.maxBufferSize/y,b.maxBufferLength):N=b.maxBufferLength,Math.min(N,b.maxMaxBufferLength)},c.reduceMaxBufferLength=function(y){var b=this.config,N=y||b.maxBufferLength;return b.maxMaxBufferLength>=N?(b.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(y,b){var N,F,X=b.fragments,Z=X.length;if(!Z)return null;var H=this.config,A=X[0].start,z;if(b.live){var ne=H.initialLiveManifestSize;if(Z<ne)return this.warn("Not enough fragments to start playback (have: "+Z+", need: "+ne+")"),null;!b.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(b,X),this.startPosition=z?this.hls.liveSyncPosition||z.start:y)}else y<=A&&(z=X[0]);if(!z){var ae=H.lowLatencyMode?b.partEnd:b.fragmentEnd;z=this.getFragmentAtPosition(y,ae,b)}return(N=z)!==null&&N!==void 0&&N.initSegment&&!((F=z)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},c.getNextPart=function(y,b,N){for(var F=-1,X=!1,Z=!0,H=0,A=y.length;H<A;H++){var z=y[H];if(Z=Z&&!z.independent,F>-1&&N<z.start)break;var ne=z.loaded;!ne&&(X||z.independent||Z)&&z.fragment===b&&(F=H),X=ne}return F},c.loadedEndOfParts=function(y,b){var N=y[y.length-1];return N&&b>N.start&&N.loaded},c.getInitialLiveFragment=function(y,b){var N=this.fragPrevious,F=null;if(N){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(h.findFragmentByPDT)(b,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var X=N.sn+1;if(X>=y.startSN&&X<=y.endSN){var Z=b[X-y.startSN];N.cc===Z.cc&&(F=Z,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(h.findFragWithCC)(b,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(F=this.getFragmentAtPosition(H,this.bitrateTest?y.fragmentEnd:y.edge,y))}return F},c.getFragmentAtPosition=function(y,b,N){var F=this.config,X=this.fragPrevious,Z=N.fragments,H=N.endSN,A=N.fragmentHint,z=F.maxFragLookUpTolerance,ne=!!(F.lowLatencyMode&&N.partList&&A);ne&&A&&!this.bitrateTest&&(Z=Z.concat(A),H=A.sn);var ae;if(y<b){var me=y>b-z?0:z;ae=Object(h.findFragmentByPTS)(X,Z,y,me)}else ae=Z[Z.length-1];if(ae){var xe=ae.sn-N.startSN,Te=X&&ae.level===X.level,Oe=Z[xe+1],Ue=this.fragmentTracker.getState(ae);if(Ue===R.FragmentState.BACKTRACKED){ae=null;for(var De=xe;Z[De]&&this.fragmentTracker.getState(Z[De])===R.FragmentState.BACKTRACKED;)X?ae=Z[De--]:ae=Z[--De];ae||(ae=Oe)}else X&&ae.sn===X.sn&&!ne&&(Te&&(ae.sn<H&&this.fragmentTracker.getState(Oe)!==R.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+Oe.sn),ae=Oe):ae=null))}return ae},c.synchronizeToLiveEdge=function(y){var b=this.config,N=this.media;if(!N)return;var F=this.hls.liveSyncPosition,X=N.currentTime,Z=y.fragments[0].start,H=y.edge,A=X>=Z-b.maxFragLookUpTolerance&&X<=H;if(F!==null&&N.duration>F&&(X<F||!A)){var z=b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:b.liveMaxLatencyDurationCount*y.targetduration;(!A&&N.readyState<4||X<H-z)&&(this.loadedmetadata||(this.nextLoadPosition=F),N.readyState&&(this.warn("Playback: "+X.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+F.toFixed(3)),N.currentTime=F))}},c.alignPlaylists=function(y,b){var N=this.levels,F=this.levelLastLoaded,X=this.fragPrevious,Z=F!==null?N[F]:null,H=y.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var A=y.fragments[0].start,z=!b,ne=y.alignedSliding&&Object(Y.isFiniteNumber)(A);if(z||!ne&&!A){Object(u.alignStream)(X,Z,y);var ae=y.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(b?b.startSN:"na")+"->"+y.startSN+" prev-sn: "+(X?X.sn:"na")+" fragments: "+H),ae}return A},c.waitForCdnTuneIn=function(y){var b=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*b)},c.setStartPosition=function(y,b){var N=this.startPosition;if(N<b&&(N=-1),N===-1||this.lastCurrentTime===-1){var F=y.startTimeOffset;Object(Y.isFiniteNumber)(F)?(N=b+F,F<0&&(N+=y.totalduration),N=Math.min(Math.max(b,N),b+y.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+N),this.startPosition=N):y.live?N=this.hls.liveSyncPosition||b:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},c.getLoadPosition=function(){var y=this.media,b=0;return this.loadedmetadata&&y?b=y.currentTime:this.nextLoadPosition&&(b=this.nextLoadPosition),b},c.handleFragLoadAborted=function(y,b){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(b?" part"+b.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},c.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=E.IDLE)},c.onFragmentOrKeyLoadError=function(y,b){if(b.fatal)return;var N=b.frag;if(!N||N.type!==y)return;var F=this.fragCurrent;console.assert(F&&N.sn===F.sn&&N.level===F.level&&N.urlId===F.urlId,"Frag load error must match current frag to retry");var X=this.config;if(this.fragLoadError+1<=X.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var Z=Math.min(Math.pow(2,this.fragLoadError)*X.fragLoadingRetryDelay,X.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+y+" "+N.level+" failed to load, retrying in "+Z+"ms"),this.retryDate=self.performance.now()+Z,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else b.levelRetry?(y===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(M.logger.error(b.details+" reaches max retry, redispatch as fatal ..."),b.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},c.afterBufferFlushed=function(y,b,N){if(!y)return;var F=B.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(b,F,N),this.state===E.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},c.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var b=this.levels?this.levels[y].details:null;if(b!=null&&b.live)return this.startPosition=-1,this.setStartPosition(b,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(y,b,N,F){var X=this,Z=N.details;console.assert(!!Z,"level.details must be defined");var H=Object.keys(y.elementaryStreams).reduce(function(A,z){var ne=y.elementaryStreams[z];if(ne){var ae=ne.endPTS-ne.startPTS;if(ae<=0)return X.warn("Could not parse fragment "+y.sn+" "+z+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),X.resetTransmuxer(),A||!1;var me=F?0:Object(s.updateFragPTSDTS)(Z,y,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return X.hls.trigger(L.Events.LEVEL_PTS_UPDATED,{details:Z,level:N,drift:me,type:z,frag:y,start:ne.startPTS,end:ne.endPTS}),!0}return A},!1);H?(this.state=E.PARSED,this.hls.trigger(L.Events.FRAG_PARSED,{frag:y,part:b})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(f,[{key:"state",get:function(){return this._state},set:function(y){var b=this._state;b!==y&&(this._state=y,this.log(b+"->"+y))}}]),f}(W.default)},"./src/controller/buffer-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./src/polyfills/number.ts"),W=P("./src/events.ts"),R=P("./src/utils/logger.ts"),B=P("./src/errors.ts"),M=P("./src/utils/buffer-helper.ts"),L=P("./src/utils/mediasource-helper.ts"),I=P("./src/loader/fragment.ts"),p=P("./src/controller/buffer-operation-queue.ts"),m=Object(L.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function s(i){var r=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 n=r.hls,d=r.media,w=r.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),d&&(r.updateMediaElementDuration(),n.trigger(W.Events.MEDIA_ATTACHED,{media:d})),w&&w.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var l=s.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var r=this.hls;r.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(W.Events.BUFFER_RESET,this.onBufferReset,this),r.on(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(W.Events.BUFFER_EOS,this.onBufferEos,this),r.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(W.Events.FRAG_PARSED,this.onFragParsed,this),r.on(W.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(W.Events.BUFFER_RESET,this.onBufferReset,this),r.off(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(W.Events.BUFFER_EOS,this.onBufferEos,this),r.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(W.Events.FRAG_PARSED,this.onFragParsed,this),r.off(W.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(r,n){var d=2;(n.audio&&!n.video||!n.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(r,n){var d=this.media=n.media;if(d&&m){var w=this.mediaSource=new m;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(w),this._objectUrl=d.src}},l.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,d=this._objectUrl;if(n){if(R.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(w){R.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(d&&self.URL.revokeObjectURL(d),r.src===d?(r.removeAttribute("src"),r.load()):R.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(W.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(n){var d=r.sourceBuffer[n];try{d&&(r.removeBufferListeners(n),r.mediaSource&&r.mediaSource.removeSourceBuffer(d),r.sourceBuffer[n]=void 0)}catch(w){R.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",w)}}),this._initSourceBuffer()},l.onBufferCodecs=function(r,n){var d=this,w=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(T){if(w){var x=d.tracks[T];if(x&&typeof x.buffer.changeType=="function"){var O=n[T],E=O.codec,v=O.levelCodec,_=O.container,f=(x.levelCodec||x.codec).replace(u,"$1"),c=(v||E).replace(u,"$1");if(f!==c){var S=_+";codecs="+(v||E);d.appendChangeType(T,S)}}}else d.pendingTracks[T]=n[T]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(r,n){var d=this,w=this.operationQueue,T={execute:function(){var O=d.sourceBuffer[r];O&&(R.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),O.changeType(n)),w.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(O){R.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",O)}};w.append(T,r)},l.onBufferAppending=function(r,n){var d=this,w=this.hls,T=this.operationQueue,x=this.tracks,O=n.data,E=n.type,v=n.frag,_=n.part,f=n.chunkMeta,c=f.buffering[E],S=self.performance.now();c.start=S;var y=v.stats.buffering,b=_?_.stats.buffering:null;y.start===0&&(y.start=S),b&&b.start===0&&(b.start=S);var N=x.audio,F=E==="audio"&&f.id===1&&(N==null?void 0:N.container)==="audio/mpeg",X={execute:function(){if(c.executeStart=self.performance.now(),F){var H=d.sourceBuffer[E];if(H){var A=v.start-H.timestampOffset;Math.abs(A)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+A+") sn: "+v.sn+")"),H.timestampOffset=v.start)}}d.appendExecutor(O,E)},onStart:function(){},onComplete:function(){var H=self.performance.now();c.executeEnd=c.end=H,y.first===0&&(y.first=H),b&&b.first===0&&(b.first=H);var A=d.sourceBuffer,z={};for(var ne in A)z[ne]=M.BufferHelper.getBuffered(A[ne]);d.appendError=0,d.hls.trigger(W.Events.BUFFER_APPENDED,{type:E,frag:v,part:_,chunkMeta:f,parent:v.type,timeRanges:z})},onError:function(H){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",H);var A={type:B.ErrorTypes.MEDIA_ERROR,parent:v.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=B.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,A.details=B.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>w.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),w.trigger(W.Events.ERROR,A)}};T.append(X,E)},l.onBufferFlushing=function(r,n){var d=this,w=this.operationQueue,T=function(O){return{execute:d.removeExecutor.bind(d,O,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(W.Events.BUFFER_FLUSHED,{type:O})},onError:function(v){R.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",v)}}};n.type?w.append(T(n.type),n.type):this.getSourceBufferTypes().forEach(function(x){w.append(T(x),x)})},l.onFragParsed=function(r,n){var d=this,w=n.frag,T=n.part,x=[],O=T?T.elementaryStreams:w.elementaryStreams;O[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(O[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),O[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var E=function(){var _=self.performance.now();w.stats.buffering.end=_,T&&(T.stats.buffering.end=_);var f=T?T.stats:w.stats;d.hls.trigger(W.Events.FRAG_BUFFERED,{frag:w,part:T,stats:f,id:w.type})};x.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(E,x)},l.onFragChanged=function(r,n){this.flushBackBuffer()},l.onBufferEos=function(r,n){var d=this,w=this.getSourceBufferTypes().reduce(function(T,x){var O=d.sourceBuffer[x];return(!n.type||n.type===x)&&(O&&!O.ended&&(O.ended=!0,R.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),T&&!!(!O||O.ended)},!0);w&&this.blockBuffers(function(){var T=d.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},l.onLevelUpdated=function(r,n){var d=n.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var r=this.hls,n=this.details,d=this.media,w=this.sourceBuffer;if(!d||n===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var x=n.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(Y.isFiniteNumber)(x)||x<0)return;var O=d.currentTime,E=n.levelTargetDuration,v=Math.max(x,E),_=Math.floor(O/E)*E-v;T.forEach(function(f){var c=w[f];if(c){var S=M.BufferHelper.getBuffered(c);S.length>0&&_>S.start(0)&&(r.trigger(W.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),n.live&&r.trigger(W.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),r.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:f}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,d=this.media,w=this.mediaSource,T=r.fragments[0].start+r.totalduration,x=d.duration,O=Object(Y.isFiniteNumber)(w.duration)?w.duration:0;r.live&&n.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(r)):(T>O&&T>x||!Object(Y.isFiniteNumber)(x))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),w.duration=T)},l.updateSeekableRange=function(r){var n=this.mediaSource,d=r.fragments,w=d.length;if(w&&r.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var T=Math.max(0,d[0].start),x=Math.max(T,T+r.totalduration);n.setLiveSeekableRange(T,x)}},l.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,d=this.pendingTracks,w=Object.keys(d).length;if(w&&!r||w===2){this.createSourceBuffers(d),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(x){n.executeNext(x)})}},l.createSourceBuffers=function(r){var n=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var T in r)if(!n[T]){var x=r[T];if(!x)throw Error("source buffer exists for track "+T+", however track does not");var O=x.levelCodec||x.codec,E=x.container+";codecs="+O;R.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var v=n[T]=d.addSourceBuffer(E),_=T;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[T]={buffer:v,codec:O,container:x.container,levelCodec:x.levelCodec,id:x.id},w++}catch(f){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:E})}}w&&this.hls.trigger(W.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(r){var n=this.operationQueue,d=n.current(r);d.onStart()},l._onSBUpdateEnd=function(r){var n=this.operationQueue,d=n.current(r);d.onComplete(),n.shiftAndExecuteNext(r)},l._onSBUpdateError=function(r,n){R.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(W.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(r);d&&d.onError(n)},l.removeExecutor=function(r,n,d){var w=this.media,T=this.mediaSource,x=this.operationQueue,O=this.sourceBuffer,E=O[r];if(!w||!T||!E){R.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(r);return}var v=Object(Y.isFiniteNumber)(w.duration)?w.duration:Infinity,_=Object(Y.isFiniteNumber)(T.duration)?T.duration:Infinity,f=Math.max(0,n),c=Math.min(d,v,_);c>f?(R.logger.log("[buffer-controller]: Removing ["+f+","+c+"] from the "+r+" SourceBuffer"),console.assert(!E.updating,r+" sourceBuffer must not be updating"),E.remove(f,c)):x.shiftAndExecuteNext(r)},l.appendExecutor=function(r,n){var d=this.operationQueue,w=this.sourceBuffer,T=w[n];if(!T){R.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(n);return}T.ended=!1,console.assert(!T.updating,n+" sourceBuffer must not be updating"),T.appendBuffer(r)},l.blockBuffers=function(r,n){var d=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var w=this.operationQueue,T=n.map(function(x){return w.appendBlocker(x)});Promise.all(T).then(function(){r(),n.forEach(function(x){var O=d.sourceBuffer[x];(!O||!O.updating)&&w.shiftAndExecuteNext(x)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(r,n,d){var w=this.sourceBuffer[r];if(!w)return;var T=d.bind(this,r);this.listeners[r].push({event:n,listener:T}),w.addEventListener(n,T)},l.removeBufferListeners=function(r){var n=this.sourceBuffer[r];if(!n)return;this.listeners[r].forEach(function(d){n.removeEventListener(d.event,d.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return W});var Y=P("./src/utils/logger.ts"),W=function(){function R(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var B=R.prototype;return B.append=function(L,I){var p=this.queues[I];p.push(L),p.length===1&&this.buffers[I]&&this.executeNext(I)},B.insertAbort=function(L,I){var p=this.queues[I];p.unshift(L),this.executeNext(I)},B.appendBlocker=function(L){var I,p=new Promise(function(u){I=u}),m={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,L),p},B.executeNext=function(L){var I=this.buffers,p=this.queues,m=I[L],u=p[L];if(u.length){var h=u[0];try{h.execute()}catch(s){Y.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(s),(!m||!m.updating)&&(u.shift(),this.executeNext(L))}}},B.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},B.current=function(L){return this.queues[L][0]},R}()},"./src/controller/cap-level-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts");function W(M,L){for(var I=0;I<L.length;I++){var p=L[I];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(M,p.key,p)}}function R(M,L,I){return L&&W(M.prototype,L),I&&W(M,I),M}var B=function(){function M(I){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var L=M.prototype;return L.setStreamController=function(p){this.streamController=p},L.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},L.registerListeners=function(){var p=this.hls;p.on(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.unregisterListener=function(){var p=this.hls;p.off(Y.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(Y.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.onFpsDropLevelCapping=function(p,m){M.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},L.onMediaAttaching=function(p,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},L.onManifestParsed=function(p,m){var u=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,u.config.capLevelToPlayerSize&&m.video&&this.startCapping()},L.onBufferCodecs=function(p,m){var u=this.hls;u.config.capLevelToPlayerSize&&m.video&&this.startCapping()},L.onMediaDetaching=function(){this.stopCapping()},L.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(p.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},L.getMaxLevel=function(p){var m=this,u=this.hls.levels;if(!u.length)return-1;var h=u.filter(function(s,l){return M.isLevelAllowed(l,m.restrictedLevels)&&l<=p});return this.clientRect=null,M.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},L.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()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,m={width:0,height:0};if(p){var u=p.getBoundingClientRect();m.width=u.width,m.height=u.height,!m.width&&!m.height&&(m.width=u.right-u.left||p.width||0,m.height=u.bottom-u.top||p.height||0)}return this.clientRect=m,m},M.isLevelAllowed=function(p,m){return m===void 0&&(m=[]),m.indexOf(p)===-1},M.getMaxLevelByMediaSize=function(p,m,u){if(!p||!p.length)return-1;for(var h=function(n,d){return d?n.width!==d.width||n.height!==d.height:!0},s=p.length-1,l=0;l<p.length;l+=1){var i=p[l];if((i.width>=m||i.height>=u)&&h(i,p[l+1])){s=l;break}}return s},R(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(m){}return p}}]),M}();V.default=B},"./src/controller/cmcd-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./src/events.ts"),W=P("./src/types/cmcd.ts"),R=P("./src/utils/buffer-helper.ts"),B=P("./src/utils/logger.ts");function M(s,l){for(var i=0;i<l.length;i++){var r=l[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,r.key,r)}}function L(s,l,i){return l&&M(s.prototype,l),i&&M(s,i),s}function I(s,l){var i=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(i)return(i=i.call(s)).next.bind(i);if(Array.isArray(s)||(i=p(s))||l&&s&&typeof s.length=="number"){i&&(s=i);var r=0;return function(){return r>=s.length?{done:!0}:{done:!1,value:s[r++]}}}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 p(s,l){if(!s)return;if(typeof s=="string")return m(s,l);var i=Object.prototype.toString.call(s).slice(8,-1);if(i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set")return Array.from(s);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return m(s,l)}function m(s,l){(l==null||l>s.length)&&(l=s.length);for(var i=0,r=new Array(l);i<l;i++)r[i]=s[i];return r}function u(){return u=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(s[r]=i[r])}return s},u.apply(this,arguments)}var h=function(){function s(i){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(w){try{r.apply(w,{ot:W.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(T){B.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(w){try{var T=w.frag,x=r.hls.levels[T.level],O=r.getObjectType(T),E={d:T.duration*1e3,ot:O};(O===W.CMCDObjectType.VIDEO||O===W.CMCDObjectType.AUDIO||O==W.CMCDObjectType.MUXED)&&(E.br=x.bitrate/1e3,E.tb=r.getTopBandwidth(O),E.bl=r.getBufferLength(O)),r.apply(w,E)}catch(v){B.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=i;var n=this.config=i.config,d=n.cmcd;d!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||s.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var l=s.prototype;return l.registerListeners=function(){var r=this.hls;r.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(Y.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var r=this.hls;r.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(Y.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(r,n){var d,w;this.audioBuffer=(d=n.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(w=n.tracks.video)===null||w===void 0?void 0:w.buffer},l.createData=function(){var r;return{v:W.CMCDVersion,sf:W.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(r,n){n===void 0&&(n={}),u(n,this.createData());var d=n.ot===W.CMCDObjectType.INIT||n.ot===W.CMCDObjectType.VIDEO||n.ot===W.CMCDObjectType.MUXED;if(this.starved&&d&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var w=s.toHeaders(n);if(!Object.keys(w).length)return;r.headers||(r.headers={}),u(r.headers,w)}else{var T=s.toQuery(n);if(!T)return;r.url=s.appendQueryToUri(r.url,T)}},l.getObjectType=function(r){var n=r.type;return n==="subtitle"?W.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?W.CMCDObjectType.INIT:n==="audio"?W.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?W.CMCDObjectType.VIDEO:W.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(r){for(var n=0,d=r===W.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=I(d),T;!(T=w()).done;){var x=T.value;x.bitrate>n&&(n=x.bitrate)}return n>0?n:NaN},l.getBufferLength=function(r){var n=this.hls.media,d=r===W.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!n)return NaN;var w=R.BufferHelper.bufferInfo(d,n.currentTime,this.config.maxBufferHole);return w.len*1e3},l.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,d=r||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new d(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(O,E,v){n(O),this.loader.load(O,E,v)},L(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},l.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,d=r||this.config.loader;return function(){function w(x){this.loader=void 0,this.loader=new d(x)}var T=w.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(O,E,v){n(O),this.loader.load(O,E,v)},L(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},s.uuid=function(){var r=URL.createObjectURL(new Blob),n=r.toString();return URL.revokeObjectURL(r),n.substr(n.lastIndexOf("/")+1)},s.serialize=function(r){for(var n=[],d=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},w=function(F){return Math.round(F)},T=function(F){return w(F/100)*100},x=function(F){return encodeURIComponent(F)},O={br:w,d:w,bl:T,dl:T,mtp:T,nor:x,rtp:T,tb:w},E=Object.keys(r||{}).sort(),v=I(E),_;!(_=v()).done;){var f=_.value,c=r[f];if(!d(c))continue;if(f==="v"&&c===1)continue;if(f=="pr"&&c===1)continue;var S=O[f];S&&(c=S(c));var y=typeof c,b=void 0;f==="ot"||f==="sf"||f==="st"?b=f+"="+c:y==="boolean"?b=f:y==="number"?b=f+"="+c:b=f+"="+JSON.stringify(c),n.push(b)}return n.join(",")},s.toHeaders=function(r){for(var n=Object.keys(r),d={},w=["Object","Request","Session","Status"],T=[{},{},{},{}],x={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},O=0,E=n;O<E.length;O++){var v=E[O],_=x[v]!=null?x[v]:1;T[_][v]=r[v]}for(var f=0;f<T.length;f++){var c=s.serialize(T[f]);c&&(d["CMCD-"+w[f]]=c)}return d},s.toQuery=function(r){return"CMCD="+encodeURIComponent(s.serialize(r))},s.appendQueryToUri=function(r,n){if(!n)return r;var d=r.includes("?")?"&":"?";return""+r+d+n},s}()},"./src/controller/eme-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/utils/logger.ts"),B=P("./src/utils/mediakeys-helper.ts");function M(h,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(h,i.key,i)}}function L(h,s,l){return s&&M(h.prototype,s),l&&M(h,l),h}var I=3,p=function(s,l,i){var r={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(n){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:i.audioRobustness||""})}),l.forEach(function(n){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:i.videoRobustness||""})}),[r]},m=function(s,l,i,r){switch(s){case B.KeySystems.WIDEVINE:return p(l,i,r);default:throw new Error("Unknown key-system: "+s)}},u=function(){function h(l){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=l,this._config=l.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var s=h.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Y.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(i){switch(i){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},s._attemptKeySystemAccess=function(i,r,n){var d=this,w=m(i,r,n,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(i,w);this.mediaKeysPromise=T.then(function(x){return d._onMediaKeySystemAccessObtained(i,x)}),T.catch(function(x){R.logger.error('Failed to obtain key-system "'+i+'" access:',x)})},s._onMediaKeySystemAccessObtained=function(i,r){var n=this;R.logger.log('Access for key-system "'+i+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:i};this._mediaKeysList.push(d);var w=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(T){return d.mediaKeys=T,R.logger.log('Media-keys created for key-system "'+i+'"'),n._onMediaKeysCreated(),T});return w.catch(function(T){R.logger.error("Failed to create media-keys:",T)}),w},s._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),i._onNewMediaKeySession(r.mediaKeysSession))})},s._onNewMediaKeySession=function(i){var r=this;R.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(n){r._onKeySessionMessage(i,n.message)},!1)},s._onKeySessionMessage=function(i,r){R.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(n){R.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),i.update(n)})},s.onMediaEncrypted=function(i){var r=this;if(R.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(w){if(!r._media)return;r._attemptSetMediaKeys(w),r._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(n).catch(n)},s._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(i,r){var n=this,d=this._mediaKeysList[0];if(!d){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var w=d.mediaKeysSession;if(!w){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+i+'" init data type'),d.mediaKeysSessionInitialized=!0,w.generateRequest(i,r).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(T){R.logger.error("Error generating key-session request:",T),n.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(i,r,n){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,i,r,n);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,d,i),w=void 0}catch(T){R.logger.error(T)}try{d.readyState||d.open("POST",i,!0),w&&w.call(this.hls,d,i)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return d},s._onLicenseRequestReadyStageChange=function(i,r,n,d){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var w=i.response,T=this._licenseResponseCallback;if(T)try{w=T.call(this.hls,i,r)}catch(O){R.logger.error(O)}d(w)}else{if(R.logger.error("License Request XHR failed ("+r+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(n,d)}break}},s._generateLicenseRequestChallenge=function(i,r){switch(i.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},s._requestLicense=function(i,r){R.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(n.mediaKeySystemDomain),w=this._createLicenseXhr(d,i,r);R.logger.log("Sending license request to URL: "+d);var T=this._generateLicenseRequestChallenge(n,i);w.send(T)}catch(x){R.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(i,r){if(!this._emeEnabled)return;var n=r.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var i=this._media,r=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(i,r){if(!this._emeEnabled)return;var n=r.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),d=r.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,n,d)},L(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();V.default=u},"./src/controller/fps-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/utils/logger.ts"),R=function(){function B(L){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=L,this.registerListeners()}var M=B.prototype;return M.setStreamController=function(I){this.streamController=I},M.registerListeners=function(){this.hls.on(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(Y.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(I,p){var m=this.hls.config;if(m.capLevelOnFPSDrop){var u=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(I,p,m){var u=performance.now();if(p){if(this.lastTime){var h=u-this.lastTime,s=m-this.lastDroppedFrames,l=p-this.lastDecodedFrames,i=1e3*s/h,r=this.hls;if(r.trigger(Y.Events.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:m}),i>0&&s>r.config.fpsDroppedMonitoringThreshold*l){var n=r.currentLevel;W.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=n)&&(n=n-1,r.trigger(Y.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=m,this.lastDecodedFrames=p}},M.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var p=I.getVideoPlaybackQuality();this.checkFPS(I,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},B}();V.default=R},"./src/controller/fragment-finders.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"findFragmentByPDT",function(){return R}),P.d(V,"findFragmentByPTS",function(){return B}),P.d(V,"fragmentWithinToleranceTest",function(){return M}),P.d(V,"pdtWithinToleranceTest",function(){return L}),P.d(V,"findFragWithCC",function(){return I});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/binary-search.ts");function R(p,m,u){if(m===null||!Array.isArray(p)||!p.length||!Object(Y.isFiniteNumber)(m))return null;var h=p[0].programDateTime;if(m<(h||0))return null;var s=p[p.length-1].endProgramDateTime;if(m>=(s||0))return null;u=u||0;for(var l=0;l<p.length;++l){var i=p[l];if(L(m,u,i))return i}return null}function B(p,m,u,h){u===void 0&&(u=0),h===void 0&&(h=0);var s=null;if(p?s=m[p.sn-m[0].sn+1]||null:u===0&&m[0].start===0&&(s=m[0]),s&&M(u,h,s)===0)return s;var l=W.default.search(m,M.bind(null,u,h));return l||s}function M(p,m,u){p===void 0&&(p=0),m===void 0&&(m=0);var h=Math.min(m,u.duration+(u.deltaPTS?u.deltaPTS:0));return u.start+u.duration-h<=p?1:u.start-h>p&&u.start?-1:0}function L(p,m,u){var h=Math.min(m,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,s=u.endProgramDateTime||0;return s-h>p}function I(p,m){return W.default.search(p,function(u){return u.cc<m?1:u.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"FragmentState",function(){return R}),P.d(V,"FragmentTracker",function(){return B});var Y=P("./src/events.ts"),W=P("./src/types/loader.ts"),R;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(R||(R={}));var B=function(){function I(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var p=I.prototype;return p._registerListeners=function(){var u=this.hls;u.on(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var u=this.hls;u.off(Y.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(Y.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(Y.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(u,h){if(h===W.PlaylistLevelType.MAIN){var s=this.activeFragment,l=this.activeParts;if(!s)return null;if(l)for(var i=l.length;i--;){var r=l[i],n=r?r.end:s.appendedPTS;if(r.start<=u&&n!==void 0&&u<=n)return i>9&&(this.activeParts=l.slice(i-9)),r}else if(s.start<=u&&s.appendedPTS!==void 0&&u<=s.appendedPTS)return s}return this.getBufferedFrag(u,h)},p.getBufferedFrag=function(u,h){for(var s=this.fragments,l=Object.keys(s),i=l.length;i--;){var r=s[l[i]];if((r==null?void 0:r.body.type)===h&&r.buffered){var n=r.body;if(n.start<=u&&u<=n.end)return n}}return null},p.detectEvictedFragments=function(u,h,s){var l=this;Object.keys(this.fragments).forEach(function(i){var r=l.fragments[i];if(!r)return;if(!r.buffered){r.body.type===s&&l.removeFragment(r.body);return}var n=r.range[u];if(!n)return;n.time.some(function(d){var w=!l.isTimeBuffered(d.startPTS,d.endPTS,h);return w&&l.removeFragment(r.body),w})})},p.detectPartialFragments=function(u){var h=this,s=this.timeRanges,l=u.frag,i=u.part;if(!s||l.sn==="initSegment")return;var r=L(l),n=this.fragments[r];if(!n)return;Object.keys(s).forEach(function(d){var w=l.elementaryStreams[d];if(!w)return;var T=s[d],x=i!==null||w.partial===!0;n.range[d]=h.getBufferedTimes(l,i,x,T)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},p.fragBuffered=function(u){var h=L(u),s=this.fragments[h];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},p.getBufferedTimes=function(u,h,s,l){for(var i={time:[],partial:s},r=h?h.start:u.start,n=h?h.end:u.end,d=u.minEndPTS||n,w=u.maxStartPTS||r,T=0;T<l.length;T++){var x=l.start(T)-this.bufferPadding,O=l.end(T)+this.bufferPadding;if(w>=x&&d<=O){i.time.push({startPTS:Math.max(r,l.start(T)),endPTS:Math.min(n,l.end(T))});break}else if(r<O&&n>x)i.partial=!0,i.time.push({startPTS:Math.max(r,l.start(T)),endPTS:Math.min(n,l.end(T))});else if(n<=x)break}return i},p.getPartialFragment=function(u){var h=null,s,l,i,r=0,n=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(w){var T=d[w];if(!T)return;M(T)&&(l=T.body.start-n,i=T.body.end+n,u>=l&&u<=i&&(s=Math.min(u-l,i-u),r<=s&&(h=T.body,r=s)))}),h},p.getState=function(u){var h=L(u),s=this.fragments[h];return s?s.buffered?M(s)?R.PARTIAL:R.OK:s.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},p.backtrack=function(u,h){var s=L(u),l=this.fragments[s];if(!l||l.backtrack)return null;var i=l.backtrack=h||l.loaded;return l.loaded=null,i},p.getBacktrackData=function(u){var h=L(u),s=this.fragments[h];if(s){var l,i=s.backtrack;if(i!=null&&(l=i.payload)!==null&&l!==void 0&&l.byteLength)return i;this.removeFragment(u)}return null},p.isTimeBuffered=function(u,h,s){for(var l,i,r=0;r<s.length;r++){if(l=s.start(r)-this.bufferPadding,i=s.end(r)+this.bufferPadding,u>=l&&h<=i)return!0;if(h<=l)return!1}return!1},p.onFragLoaded=function(u,h){var s=h.frag,l=h.part;if(s.sn==="initSegment"||s.bitrateTest||l)return;var i=L(s);this.fragments[i]={body:s,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(u,h){var s=this,l=h.frag,i=h.part,r=h.timeRanges;if(l.type===W.PlaylistLevelType.MAIN)if(this.activeFragment=l,i){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(i)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(d){var w=r[d];if(s.detectEvictedFragments(d,w),!i)for(var T=0;T<w.length;T++)l.appendedPTS=Math.max(w.end(T),l.appendedPTS||0)})},p.onFragBuffered=function(u,h){this.detectPartialFragments(h)},p.hasFragment=function(u){var h=L(u);return!!this.fragments[h]},p.removeFragmentsInRange=function(u,h,s){var l=this;Object.keys(this.fragments).forEach(function(i){var r=l.fragments[i];if(!r)return;if(r.buffered){var n=r.body;n.type===s&&n.start<h&&n.end>u&&l.removeFragment(n)}})},p.removeFragment=function(u){var h=L(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[h]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function M(I){var p,m;return I.buffered&&(((p=I.range.video)===null||p===void 0?void 0:p.partial)||((m=I.range.audio)===null||m===void 0?void 0:m.partial))}function L(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"STALL_MINIMUM_DURATION_MS",function(){return M}),P.d(V,"MAX_START_GAP_JUMP",function(){return L}),P.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),P.d(V,"SKIP_BUFFER_RANGE_START",function(){return p}),P.d(V,"default",function(){return m});var Y=P("./src/utils/buffer-helper.ts"),W=P("./src/errors.ts"),R=P("./src/events.ts"),B=P("./src/utils/logger.ts"),M=250,L=2,I=.1,p=.05,m=function(){function u(s,l,i,r){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=s,this.media=l,this.fragmentTracker=i,this.hls=r}var h=u.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(l){var i=this.config,r=this.media,n=this.stalled,d=r.currentTime,w=r.seeking,T=this.seeking&&!w,x=!this.seeking&&w;if(this.seeking=w,d!==l){if(this.moved=!0,n!==null){if(this.stallReported){var O=self.performance.now()-n;B.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||T)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!Y.BufferHelper.getBuffered(r).length)return;var E=Y.BufferHelper.bufferInfo(r,d,0),v=E.len>0,_=E.nextStart||0;if(!v&&!_)return;if(w){var f=E.len>L,c=!_||_-d>L&&!this.fragmentTracker.getPartialFragment(d);if(f||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,y=Math.max(_,E.start||0)-d,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=b==null||((S=b.details)===null||S===void 0)?void 0:S.live,F=N?b.details.targetduration*2:L;if(y>0&&y<=F){this._trySkipBufferHole(null);return}}var X=self.performance.now();if(n===null){this.stalled=X;return}var Z=X-n;!w&&Z>=M&&this._reportStall(E.len);var H=Y.BufferHelper.bufferInfo(r,d,i.maxBufferHole);this._tryFixBufferStall(H,Z)},h._tryFixBufferStall=function(l,i){var r=this.config,n=this.fragmentTracker,d=this.media,w=d.currentTime,T=n.getPartialFragment(w);if(T){var x=this._trySkipBufferHole(T);if(x)return}l.len>r.maxBufferHole&&i>r.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(l){var i=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+l+")"),i.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},h._trySkipBufferHole=function(l){for(var i=this.config,r=this.hls,n=this.media,d=n.currentTime,w=0,T=Y.BufferHelper.getBuffered(n),x=0;x<T.length;x++){var O=T.start(x);if(d+i.maxBufferHole>=w&&d<O){var E=Math.max(O+p,n.currentTime+I);return B.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+E),this.moved=!0,this.stalled=null,n.currentTime=E,l&&r.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+E,frag:l}),E}w=T.end(x)}return 0},h._tryNudgeBuffer=function(){var l=this.config,i=this.hls,r=this.media,n=r.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<l.nudgeMaxRetry){var w=n+d*l.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+n+" to "+w),r.currentTime=w,i.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+l.nudgeMaxRetry+" nudges"),i.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},u}()},"./src/controller/id3-track-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/utils/texttrack-utils.ts"),R=P("./src/demux/id3.ts"),B=.25,M=function(){function L(p){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=p,this._registerListeners()}var I=L.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var m=this.hls;m.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var m=this.hls;m.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(Y.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(m,u){this.media=u.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(W.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(m){if(!this.media)return;for(var u=0;u<m.length;u++){var h=m[u];if(h.kind==="metadata"&&h.label==="id3")return Object(W.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(m,u){if(!this.media)return;var h=u.frag,s=u.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<s.length;i++){var r=R.getID3Frames(s[i].data);if(r){var n=s[i].pts,d=i<s.length-1?s[i+1].pts:h.end,w=d-n;w<=0&&(d=n+B);for(var T=0;T<r.length;T++){var x=r[T];if(!R.isTimeStampFrame(x)){var O=new l(n,d,"");O.value=x,this.id3Track.addCue(O)}}}}},I.onBufferFlushing=function(m,u){var h=u.startOffset,s=u.endOffset,l=u.type;if(!l||l==="audio"){var i=this.id3Track;i&&Object(W.removeCuesInRange)(i,h,s)}},L}();V.default=M},"./src/controller/latency-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return L});var Y=P("./src/errors.ts"),W=P("./src/events.ts"),R=P("./src/utils/logger.ts");function B(I,p){for(var m=0;m<p.length;m++){var u=p[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(I,u.key,u)}}function M(I,p,m){return p&&B(I.prototype,p),m&&B(I,m),I}var L=function(){function I(m){var u=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return u.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var p=I.prototype;return p.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},p.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(W.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(W.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(W.Events.ERROR,this.onError)},p.onMediaAttached=function(u,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},p.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},p.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},p.onLevelUpdated=function(u,h){var s=h.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},p.onError=function(u,h){if(h.details!==Y.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},p.timeupdate=function(){var u=this.media,h=this.levelDetails;if(!u||!h)return;this.currentTime=u.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var l=this.config,i=l.lowLatencyMode,r=l.maxLiveSyncPlaybackRate;if(!i||r===1)return;var n=this.targetLatency;if(n===null)return;var d=s-n,w=Math.min(this.maxLatency,n+h.targetduration),T=d<w;if(h.live&&T&&d>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,r)),O=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;u.playbackRate=Math.min(x,Math.max(1,O))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},p.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},p.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},M(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,h=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:h?u.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var h=u.holdBack,s=u.partHoldBack,l=u.targetduration,i=this.config,r=i.liveSyncDuration,n=i.liveSyncDurationCount,d=i.lowLatencyMode,w=this.hls.userConfig,T=d&&s||h;(w.liveSyncDuration||w.liveSyncDurationCount||T===0)&&(T=r!==void 0?r:n*l);var x=l,O=1;return T+Math.min(this.stallCount*O,x)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),h=this.targetLatency,s=this.levelDetails;if(u===null||h===null||s===null)return null;var l=s.edge,i=u-h-this.edgeStalled,r=l-s.totalduration,n=l-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(r,i),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var h=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-h,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,h=this.levelDetails;if(!u||!h)return 0;var s=u.buffered.length;return s?u.buffered.end(s-1):h.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return i});var Y=P("./src/types/level.ts"),W=P("./src/events.ts"),R=P("./src/errors.ts"),B=P("./src/utils/codecs.ts"),M=P("./src/controller/level-helper.ts"),L=P("./src/controller/base-playlist-controller.ts"),I=P("./src/types/loader.ts");function p(){return p=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var d=arguments[n];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(r[w]=d[w])}return r},p.apply(this,arguments)}function m(r,n){for(var d=0;d<n.length;d++){var w=n[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(r,w.key,w)}}function u(r,n,d){return n&&m(r.prototype,n),d&&m(r,d),r}function h(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,s(r,n)}function s(r,n){return s=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},s(r,n)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(r){h(n,r);function n(w){var T;return T=r.call(this,w,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var d=n.prototype;return d._registerListeners=function(){var T=this.hls;T.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(W.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var T=this.hls;T.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(W.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},d.startLoad=function(){var T=this._levels;T.forEach(function(x){x.loadError=0}),r.prototype.startLoad.call(this)},d.onManifestLoaded=function(T,x){var O=[],E=[],v=[],_,f={},c,S=!1,y=!1,b=!1;if(x.levels.forEach(function(Z){var H=Z.attrs;S=S||!!(Z.width&&Z.height),y=y||!!Z.videoCodec,b=b||!!Z.audioCodec,l&&Z.audioCodec&&Z.audioCodec.indexOf("mp4a.40.34")!==-1&&(Z.audioCodec=void 0);var A=Z.bitrate+"-"+Z.attrs.RESOLUTION+"-"+Z.attrs.CODECS;c=f[A],c?c.url.push(Z.url):(c=new Y.Level(Z),f[A]=c,O.push(c)),H&&(H.AUDIO&&Object(M.addGroupId)(c,"audio",H.AUDIO),H.SUBTITLES&&Object(M.addGroupId)(c,"text",H.SUBTITLES))}),(S||y)&&b&&(O=O.filter(function(Z){var H=Z.videoCodec,A=Z.width,z=Z.height;return!!H||!!(A&&z)})),O=O.filter(function(Z){var H=Z.audioCodec,A=Z.videoCodec;return(!H||Object(B.isCodecSupportedInMp4)(H,"audio"))&&(!A||Object(B.isCodecSupportedInMp4)(A,"video"))}),x.audioTracks&&(E=x.audioTracks.filter(function(Z){return!Z.audioCodec||Object(B.isCodecSupportedInMp4)(Z.audioCodec,"audio")}),Object(M.assignTrackIdsByGroup)(E)),x.subtitles&&(v=x.subtitles,Object(M.assignTrackIdsByGroup)(v)),O.length>0){_=O[0].bitrate,O.sort(function(Z,H){return Z.bitrate-H.bitrate}),this._levels=O;for(var N=0;N<O.length;N++)if(O[N].bitrate===_){this._firstLevel=N,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+_);break}var F=b&&!y,X={levels:O,audioTracks:E,subtitleTracks:v,firstLevel:this._firstLevel,stats:x.stats,audio:b,video:y,altAudio:!F&&E.some(function(Z){return!!Z.url})};this.hls.trigger(W.Events.MANIFEST_PARSED,X),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(W.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(T,x){if(r.prototype.onError.call(this,T,x),x.fatal)return;var O=x.context,E=this._levels[this.currentLevelIndex];if(O&&(O.type===I.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&O.groupId===E.audioGroupIds[E.urlId]||O.type===I.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&O.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,_=!0,f;switch(x.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var c=this._levels[x.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=x.frag.level)):f=x.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(_=!1),f=O.level),v=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:f=x.level,v=!0;break}f!==void 0&&this.recoverLevel(x,f,v,_)},d.recoverLevel=function(T,x,O,E){var v=T.details,_=this._levels[x];if(_.loadError++,O){var f=this.retryLoadingOrFail(T);if(f)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var c=_.url.length;if(c>1&&_.loadError<c)T.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var S=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(v+": switch to "+S),T.levelRetry=!0,this.hls.nextAutoLevel=S)}}},d.redundantFailover=function(T){var x=this._levels[T],O=x.url.length;if(O>1){var E=(x.urlId+1)%O;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(v){v.urlId=E}),this.level=T}},d.onFragLoaded=function(T,x){var O=x.frag;if(O!==void 0&&O.type===I.PlaylistLevelType.MAIN){var E=this._levels[O.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},d.onLevelLoaded=function(T,x){var O,E=x.level,v=x.details,_=this._levels[E];if(!_){var f;this.warn("Invalid level index "+E),(f=x.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(v.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(E,x,_.details)):(O=x.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(v.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(T,x){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var E=-1,v=this.hls.audioTracks[x.id].groupId,_=0;_<O.audioGroupIds.length;_++)if(O.audioGroupIds[_]===v){E=_;break}E!==O.urlId&&(O.urlId=E,this.startLoad())}},d.loadPlaylist=function(T){var x=this.currentLevelIndex,O=this._levels[x];if(this.canLoad&&O&&O.url.length>0){var E=O.urlId,v=O.url[E];if(T)try{v=T.addDirectives(v)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+x+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+E+" "+v),this.clearTimer(),this.hls.trigger(W.Events.LEVEL_LOADING,{url:v,level:x,id:E,deliveryDirectives:T||null})}},d.removeLevel=function(T,x){var O=function(_,f){return f!==x},E=this._levels.filter(function(v,_){return _!==T?!0:v.url.length>1&&x!==void 0?(v.url=v.url.filter(O),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(O)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(O)),v.urlId=0,!0):!1}).map(function(v,_){var f=v.details;return f!=null&&f.fragments&&f.fragments.forEach(function(c){c.level=_}),v});this._levels=E,this.hls.trigger(W.Events.LEVELS_UPDATED,{levels:E})},u(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var x,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===T&&(x=O[T])!==null&&x!==void 0&&x.details)return;if(T<0||T>=O.length){var E=T<0;if(this.hls.trigger(W.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:E,reason:"invalid level idx"}),E)return;T=Math.min(T,O.length-1)}this.clearTimer();var v=this.currentLevelIndex,_=O[v],f=O[T];this.log("switching to level "+T+" from "+v),this.currentLevelIndex=T;var c=p({},f,{level:T,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete c._urlId,this.hls.trigger(W.Events.LEVEL_SWITCHING,c);var S=f.details;if(!S||S.live){var y=this.switchParams(f.uri,_==null?void 0:_.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),n}(L.default)},"./src/controller/level-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"addGroupId",function(){return R}),P.d(V,"assignTrackIdsByGroup",function(){return B}),P.d(V,"updatePTS",function(){return M}),P.d(V,"updateFragPTSDTS",function(){return I}),P.d(V,"mergeDetails",function(){return p}),P.d(V,"mapPartIntersection",function(){return m}),P.d(V,"mapFragmentIntersection",function(){return u}),P.d(V,"adjustSliding",function(){return h}),P.d(V,"addSliding",function(){return s}),P.d(V,"computeReloadInterval",function(){return l}),P.d(V,"getFragmentWithSN",function(){return i}),P.d(V,"getPartWith",function(){return r});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/logger.ts");function R(n,d,w){switch(d){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(w);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(w);break}}function B(n){var d={};n.forEach(function(w){var T=w.groupId||"";w.id=d[T]=d[T]||0,d[T]++})}function M(n,d,w){var T=n[d],x=n[w];L(T,x)}function L(n,d){var w=d.startPTS;if(Object(Y.isFiniteNumber)(w)){var T=0,x;d.sn>n.sn?(T=w-n.start,x=n):(T=n.start-w,x=d),x.duration!==T&&(x.duration=T)}else if(d.sn>n.sn){var O=n.cc===d.cc;O&&n.minEndPTS?d.start=n.start+(n.minEndPTS-n.start):d.start=n.start+n.duration}else d.start=Math.max(n.start-d.duration,0)}function I(n,d,w,T,x,O){var E=T-w;E<=0&&(W.logger.warn("Fragment should have a positive duration",d),T=w+d.duration,O=x+d.duration);var v=w,_=T,f=d.startPTS,c=d.endPTS;if(Object(Y.isFiniteNumber)(f)){var S=Math.abs(f-w);Object(Y.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(S,d.deltaPTS):d.deltaPTS=S,v=Math.max(w,f),w=Math.min(w,f),x=Math.min(x,d.startDTS),_=Math.min(T,c),T=Math.max(T,c),O=Math.max(O,d.endDTS)}d.duration=T-w;var y=w-d.start;d.appendedPTS=T,d.start=d.startPTS=w,d.maxStartPTS=v,d.startDTS=x,d.endPTS=T,d.minEndPTS=_,d.endDTS=O;var b=d.sn;if(!n||b<n.startSN||b>n.endSN)return 0;var N,F=b-n.startSN,X=n.fragments;for(X[F]=d,N=F;N>0;N--)L(X[N],X[N-1]);for(N=F;N<X.length-1;N++)L(X[N],X[N+1]);return n.fragmentHint&&L(X[X.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,y}function p(n,d){for(var w=null,T=n.fragments,x=T.length-1;x>=0;x--){var O=T[x].initSegment;if(O){w=O;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var E=0,v;if(u(n,d,function(N,F){N.relurl&&(E=N.cc-F.cc),Object(Y.isFiniteNumber)(N.startPTS)&&Object(Y.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(v=F),d.PTSKnown=d.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,w=N.initSegment)}),w){var _=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;_.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=w)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=w)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(N){return!N}),d.deltaUpdateFailed)){W.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=d.skippedSegments;f--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var c=d.fragments;if(E){W.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<c.length;S++)c[S].cc+=E}d.skippedSegments&&(d.startCC=d.fragments[0].cc),m(n.partList,d.partList,function(N,F){F.elementaryStreams=N.elementaryStreams,F.stats=N.stats}),v?I(d,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):h(n,d),c.length&&(d.totalduration=d.edge-c[0].start),d.driftStartTime=n.driftStartTime,d.driftStart=n.driftStart;var y=d.advancedDateTime;if(d.advanced&&y){var b=d.edge;d.driftStart||(d.driftStartTime=y,d.driftStart=b),d.driftEndTime=y,d.driftEnd=b}else d.driftEndTime=n.driftEndTime,d.driftEnd=n.driftEnd,d.advancedDateTime=n.advancedDateTime}function m(n,d,w){if(n&&d)for(var T=0,x=0,O=n.length;x<=O;x++){var E=n[x],v=d[x+T];E&&v&&E.index===v.index&&E.fragment.sn===v.fragment.sn?w(E,v):T--}}function u(n,d,w){for(var T=d.skippedSegments,x=Math.max(n.startSN,d.startSN)-d.startSN,O=(n.fragmentHint?1:0)+(T?d.endSN:Math.min(n.endSN,d.endSN))-d.startSN,E=d.startSN-n.startSN,v=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,_=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,f=x;f<=O;f++){var c=_[E+f],S=v[f];T&&!S&&f<T&&(S=d.fragments[f]=c),c&&S&&w(c,S)}}function h(n,d){var w=d.startSN+d.skippedSegments-n.startSN,T=n.fragments;if(w<0||w>=T.length)return;s(d,T[w].start)}function s(n,d){if(d){for(var w=n.fragments,T=n.skippedSegments;T<w.length;T++)w[T].start+=d;n.fragmentHint&&(n.fragmentHint.start+=d)}}function l(n,d){var w=1e3*n.levelTargetDuration,T=w/2,x=n.age,O=x>0&&x<w*3,E=d.loading.end-d.loading.start,v,_=n.availabilityDelay;if(n.updated===!1)if(O){var f=333*n.misses;v=Math.max(Math.min(T,E*2),f),n.availabilityDelay=(n.availabilityDelay||0)+v}else v=T;else O?(_=Math.min(_||w/2,x),n.availabilityDelay=_,v=_+w-x):v=w-E;return Math.round(v)}function i(n,d,w){if(!n||!n.details)return null;var T=n.details,x=T.fragments[d-T.startSN];return x||(x=T.fragmentHint,x&&x.sn===d?x:d<T.startSN&&w&&w.sn===d?w:null)}function r(n,d,w){if(!n||!n.details)return null;var T=n.details.partList;if(T)for(var x=T.length;x--;){var O=T[x];if(O.index===w&&O.fragment.sn===d)return O}return null}},"./src/controller/stream-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return T});var Y=P("./src/polyfills/number.ts"),W=P("./src/controller/base-stream-controller.ts"),R=P("./src/is-supported.ts"),B=P("./src/events.ts"),M=P("./src/utils/buffer-helper.ts"),L=P("./src/controller/fragment-tracker.ts"),I=P("./src/types/loader.ts"),p=P("./src/loader/fragment.ts"),m=P("./src/demux/transmuxer-interface.ts"),u=P("./src/types/transmuxer.ts"),h=P("./src/controller/gap-controller.ts"),s=P("./src/errors.ts"),l=P("./src/utils/logger.ts");function i(x,O){for(var E=0;E<O.length;E++){var v=O[E];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(x,v.key,v)}}function r(x,O,E){return O&&i(x.prototype,O),E&&i(x,E),x}function n(x,O){x.prototype=Object.create(O.prototype),x.prototype.constructor=x,d(x,O)}function d(x,O){return d=Object.setPrototypeOf||function(v,_){return v.__proto__=_,v},d(x,O)}var w=100,T=function(x){n(O,x);function O(v,_){var f;return f=x.call(this,v,_,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var E=O.prototype;return E._registerListeners=function(){var _=this.hls;_.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(B.Events.ERROR,this.onError,this),_.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var _=this.hls;_.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(B.Events.ERROR,this.onError,this),_.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(_){if(this.levels){var f=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=c.startLevel;S===-1&&(c.config.testBandwidth?(S=0,this.bitrateTest=!0):S=c.nextAutoLevel),this.level=c.nextLoadLevel=S,this.loadedmetadata=!1}f>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),_=f),this.state=W.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=W.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_LEVEL:{var _,f=this.levels,c=this.level,S=f==null||((_=f[c])===null||_===void 0)?void 0:_.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=W.State.IDLE;break}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var y,b=self.performance.now(),N=this.retryDate;(!N||b>=N||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=W.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var _,f,c=this.hls,S=this.levelLastLoaded,y=this.levels,b=this.media,N=c.config,F=c.nextLoadLevel;if(S===null||!b&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[F])return;var X=y[F];this.level=c.nextLoadLevel=F;var Z=X.details;if(!Z||this.state===W.State.WAITING_LEVEL||Z.live&&this.levelLastLoaded!==F){this.state=W.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:b,I.PlaylistLevelType.MAIN);if(H===null)return;var A=H.len,z=this.getMaxBufferLength(X.maxBitrate);if(A>=z)return;if(this._streamEnded(H,Z)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,ne),this.state=W.State.ENDED;return}var ae=H.end,me=this.getNextFragment(ae,Z);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var xe=me.sn-Z.startSN;xe>1&&(me=Z.fragments[xe-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===L.FragmentState.OK&&this.nextLoadPosition>ae){var Te=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(b,Te,I.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,Z)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((_=me.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((f=me.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(me,Z):this.loadFragment(me,Z,ae)},E.loadFragment=function(_,f,c){var S,y=this.fragmentTracker.getState(_);if(this.fragCurrent=_,y===L.FragmentState.BACKTRACKED){var b=this.fragmentTracker.getBacktrackData(_);if(b){this._handleFragmentLoadProgress(b),this._handleFragmentLoadComplete(b);return}else y=L.FragmentState.NOT_LOADED}y===L.FragmentState.NOT_LOADED||y===L.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,_,f,c)):y===L.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(_){var f=this.fragmentTracker.getAppendedFrag(_,I.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},E.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,I.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var _=this.levels,f=this.media;if(f!=null&&f.readyState){var c,S=this.getAppendedFrag(f.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!f.paused&&_){var y=this.hls.nextLoadLevel,b=_[y],N=this.fragLastKbps;N&&this.fragCurrent?c=this.fragCurrent.duration*b.maxBitrate/(1e3*N)+1:c=0}else c=0;var F=this.getBufferedFrag(f.currentTime+c);if(F){var X=this.followingBufferedFrag(F);if(X){this.abortCurrentFrag();var Z=X.maxStartPTS?X.maxStartPTS:X.start,H=X.duration,A=Math.max(F.end,Z+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===W.State.KEY_LOADING&&(this.state=W.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(_,f){x.prototype.flushMainBuffer.call(this,_,f,this.altAudio?"video":null)},E.onMediaAttached=function(_,f){x.prototype.onMediaAttached.call(this,_,f);var c=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var _=this.media,f=_?_.currentTime:null;Object(Y.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(_,f){var c=!1,S=!1,y;f.levels.forEach(function(b){y=b.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(c=!0),y.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=c&&S&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},E.onLevelLoading=function(_,f){var c=this.levels;if(!c||this.state!==W.State.IDLE)return;var S=c[f.level];(!S.details||S.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(S.details))&&(this.state=W.State.WAITING_LEVEL)},E.onLevelLoaded=function(_,f){var c,S=this.levels,y=f.level,b=f.details,N=b.totalduration;if(!S){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+b.startSN+","+b.endSN+"], cc ["+b.startCC+", "+b.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===W.State.FRAG_LOADING||this.state===W.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==f.level&&F.loader&&(this.state=W.State.IDLE,F.loader.abort()));var X=S[y],Z=0;if(b.live||(c=X.details)!==null&&c!==void 0&&c.live){if(b.fragments[0]||(b.deltaUpdateFailed=!0),b.deltaUpdateFailed)return;Z=this.alignPlaylists(b,X.details)}if(X.details=b,this.levelLastLoaded=y,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:b,level:y}),this.state===W.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(b))return;this.state=W.State.IDLE}this.startFragRequested?b.live&&this.synchronizeToLiveEdge(b):this.setStartPosition(b,Z),this.tick()},E._handleFragmentLoadProgress=function(_){var f,c=_.frag,S=_.part,y=_.payload,b=this.levels;if(!b){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var N=b[c.level],F=N.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var X=N.videoCodec,Z=F.PTSKnown||!F.live,H=(f=c.initSegment)===null||f===void 0?void 0:f.data,A=this._getAudioCodec(N),z=this.transmuxer=this.transmuxer||new m.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=S?S.index:-1,ae=ne!==-1,me=new u.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,y.byteLength,ne,ae),xe=this.initPTS[c.cc];z.push(y,H,A,X,c,S,F.totalduration,Z,me,xe)},E.onAudioTrackSwitching=function(_,f){var c=this.altAudio,S=!!f.url,y=f.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var b=this.fragCurrent;b!=null&&b.loader&&(this.log("Switching to main audio track, cancel main fragment load"),b.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;c&&N.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:y})}},E.onAudioTrackSwitched=function(_,f){var c=f.id,S=!!this.hls.audioTracks[c].url;if(S){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=S,this.tick()},E.onBufferCreated=function(_,f){var c=f.tracks,S,y,b=!1;for(var N in c){var F=c[N];if(F.id==="main"){if(y=N,S=F,N==="video"){var X=c[N];X&&(this.videoBuffer=X.buffer)}}else b=!0}b&&S?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(_,f){var c=f.frag,S=f.part;if(c&&c.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(S?" p: "+S.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===W.State.PARSED&&(this.state=W.State.IDLE);return}var y=S?S.stats:c.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,S)},E.onError=function(_,f){switch(f.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,f);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==W.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=W.State.ERROR):!f.levelRetry&&this.state===W.State.WAITING_LEVEL&&(this.state=W.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var c=!0,S=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);S&&S.len>.5&&(c=!this.reduceMaxBufferLength(S.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var _=this.media,f=this.gapController;if(!_||!f||!_.readyState)return;var c=M.BufferHelper.getBuffered(_);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=W.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(_,f){var c=f.type;if(c!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(c===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,c,I.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(_,f){this.levels=f.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var _=this.media,f=_.currentTime,c=this.startPosition;if(c>=0&&f<c){if(_.seeking){l.logger.log("could not seek to "+c+", already seeking at "+f);return}var S=M.BufferHelper.getBuffered(_),y=S.length?S.start(0):0,b=y-c;b>0&&(b<this.config.maxBufferHole||b<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+b+" to match buffer start"),c+=b,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+f),_.currentTime=c}},E._getAudioCodec=function(_){var f=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},E._loadBitrateTestFrag=function(_){var f=this;this._doFragLoad(_).then(function(c){var S=f.hls;if(!c||S.nextLoadLevel||f.fragContextChanged(_))return;f.fragLoadError=0,f.state=W.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var y=_.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),S.trigger(B.Events.FRAG_LOADED,c)})},E._handleTransmuxComplete=function(_){var f,c="main",S=this.hls,y=_.remuxResult,b=_.chunkMeta,N=this.getCurrentContext(b);if(!N){this.warn("The loading context changed while buffering fragment "+b.sn+" of level "+b.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(b.level);return}var F=N.frag,X=N.part,Z=N.level,H=y.video,A=y.text,z=y.id3,ne=y.initSegment,ae=this.altAudio?void 0:y.audio;if(this.fragContextChanged(F))return;if(this.state=W.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(Z,ne.tracks,F,b),S.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:c,tracks:ne.tracks}));var me=ne.initPTS,xe=ne.timescale;Object(Y.isFiniteNumber)(me)&&(this.initPTS[F.cc]=me,S.trigger(B.Events.INIT_PTS_FOUND,{frag:F,id:c,initPTS:me,timescale:xe}))}if(H&&y.independent!==!1){if(Z.details){var Te=H.startPTS,Oe=H.endPTS,Ue=H.startDTS,De=H.endDTS;if(X)X.elementaryStreams[H.type]={startPTS:Te,endPTS:Oe,startDTS:Ue,endDTS:De};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<Te){this.backtrack(F);return}F.setElementaryStreamInfo(H.type,F.start,Oe,F.start,De,!0)}F.setElementaryStreamInfo(H.type,Te,Oe,Ue,De),this.bufferFragmentData(H,F,X,b)}}else if(y.independent===!1){this.backtrack(F);return}if(ae){var ge=ae.startPTS,He=ae.endPTS,ct=ae.startDTS,vt=ae.endDTS;X&&(X.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:He,startDTS:ct,endDTS:vt}),F.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ge,He,ct,vt),this.bufferFragmentData(ae,F,X,b)}if(z!=null&&(f=z.samples)!==null&&f!==void 0&&f.length){var _t={frag:F,id:c,samples:z.samples};S.trigger(B.Events.FRAG_PARSING_METADATA,_t)}if(A){var yt={frag:F,id:c,samples:A.samples};S.trigger(B.Events.FRAG_PARSING_USERDATA,yt)}},E._bufferInitSegment=function(_,f,c,S){var y=this;if(this.state!==W.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var b=f.audio,N=f.video,F=f.audiovideo;if(b){var X=_.audioCodec,Z=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(X&&(X.indexOf("mp4a.40.5")!==-1?X="mp4a.40.2":X="mp4a.40.5"),b.metadata.channelCount!==1&&Z.indexOf("firefox")===-1&&(X="mp4a.40.5")),Z.indexOf("android")!==-1&&b.container!=="audio/mpeg"&&(X="mp4a.40.2",this.log("Android: force audio codec to "+X)),_.audioCodec&&_.audioCodec!==X&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+X+'"'),b.levelCodec=X,b.id="main",this.log("Init audio buffer, container:"+b.container+", codecs[selected/level/parsed]=["+(X||"")+"/"+(_.audioCodec||"")+"/"+b.codec+"]")}N&&(N.levelCodec=_.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+N.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(H){var A=f[H],z=A.initSegment;z!=null&&z.byteLength&&y.hls.trigger(B.Events.BUFFER_APPENDING,{type:H,data:z,frag:c,part:null,chunkMeta:S,parent:c.type})}),this.tick()},E.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var f=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,f?this.resetFragmentLoading(_):this.state=W.State.BACKTRACKING},E.checkFragmentChanged=function(){var _=this.media,f=null;if(_&&_.readyState>1&&_.seeking===!1){var c=_.currentTime;if(M.BufferHelper.isBuffered(_,c)?f=this.getAppendedFrag(c):M.BufferHelper.isBuffered(_,c+.1)&&(f=this.getAppendedFrag(c+.1)),f){var S=this.fragPlaying,y=f.level;(!S||f.sn!==S.sn||S.level!==y||f.urlId!==S.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:f}),(!S||S.level!==y)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=f)}}},r(O,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(W.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"SubtitleStreamController",function(){return n});var Y=P("./src/events.ts"),W=P("./src/utils/logger.ts"),R=P("./src/utils/buffer-helper.ts"),B=P("./src/controller/fragment-finders.ts"),M=P("./src/utils/discontinuities.ts"),L=P("./src/controller/level-helper.ts"),I=P("./src/controller/fragment-tracker.ts"),p=P("./src/controller/base-stream-controller.ts"),m=P("./src/types/loader.ts"),u=P("./src/types/level.ts");function h(d,w){for(var T=0;T<w.length;T++){var x=w[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}function s(d,w,T){return w&&h(d.prototype,w),T&&h(d,T),d}function l(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,i(d,w)}function i(d,w){return i=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},i(d,w)}var r=500,n=function(d){l(w,d);function w(x,O){var E;return E=d.call(this,x,O,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var T=w.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var O=this.hls;O.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(Y.Events.ERROR,this.onError,this),O.on(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var O=this.hls;O.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(Y.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(Y.Events.ERROR,this.onError,this),O.off(Y.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(Y.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(Y.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(Y.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=p.State.IDLE,this.setInterval(r),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(O,E){this.mainDetails=E.details},T.onSubtitleFragProcessed=function(O,E){var v=E.frag,_=E.success;if(this.fragPrevious=v,this.state=p.State.IDLE,!_)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var c,S=v.start,y=0;y<f.length;y++)if(S>=f[y].start&&S<=f[y].end){c=f[y];break}var b=v.start+v.duration;c?c.end=b:(c={start:S,end:b},f.push(c)),this.fragmentTracker.fragBuffered(v)},T.onBufferFlushing=function(O,E){var v=E.startOffset,_=E.endOffset;if(v===0&&_!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,c=this.levels;if(!c.length||!c[f]||!c[f].details)return;var S=c[f].details,y=S.targetduration,b=_-y;if(b<=0)return;E.endOffsetSubtitles=Math.max(0,b),this.tracksBuffered.forEach(function(N){for(var F=0;F<N.length;){if(N[F].end<=b){N.shift();continue}else if(N[F].start<b)N[F].start=b;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(v,b,m.PlaylistLevelType.SUBTITLE)}},T.onError=function(O,E){var v,_=E.frag;if(!_||_.type!==m.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=p.State.IDLE},T.onSubtitleTracksUpdated=function(O,E){var v=this,_=E.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(f){return new u.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){v.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(O,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(r)},T.onSubtitleTrackLoaded=function(O,E){var v,_=E.details,f=E.id,c=this.currentTrackId,S=this.levels;if(!S.length)return;var y=S[c];if(f>=S.length||f!==c||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(v=y.details)!==null&&v!==void 0&&v.live){var b=this.mainDetails;if(_.deltaUpdateFailed||!b)return;var N=b.fragments[0];if(!y.details)_.hasProgramDateTime&&b.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(_,b):N&&Object(L.addSliding)(_,N.start);else{var F=this.alignPlaylists(_,y.details);F===0&&N&&Object(L.addSliding)(_,N.start)}}if(y.details=_,this.levelLastLoaded=f,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var X=Object(B.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);X||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},T._handleFragmentLoadComplete=function(O){var E=O.frag,v=O.payload,_=E.decryptdata,f=this.hls;if(this.fragContextChanged(E))return;if(v&&v.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),_.key.buffer,_.iv.buffer).then(function(S){var y=performance.now();f.trigger(Y.Events.FRAG_DECRYPTED,{frag:E,payload:S,stats:{tstart:c,tdecrypt:y}})})}},T.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var O,E=this.currentTrackId,v=this.levels;if(!v.length||!v[E]||!v[E].details)return;var _=v[E].details,f=_.targetduration,c=this.config,S=this.media,y=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-f,c.maxBufferHole),b=y.end,N=y.len,F=this.getMaxBufferLength()+f;if(N>F)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var X=_.fragments,Z=X.length,H=_.edge,A,z=this.fragPrevious;if(b<H){var ne=c.maxFragLookUpTolerance;z&&_.hasProgramDateTime&&(A=Object(B.findFragmentByPDT)(X,z.endProgramDateTime,ne)),A||(A=Object(B.findFragmentByPTS)(z,X,b,ne),!A&&z&&z.start<X[0].start&&(A=X[0]))}else A=X[Z-1];(O=A)!==null&&O!==void 0&&O.encrypted?(W.logger.log("Loading key for "+A.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(Y.Events.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===I.FragmentState.NOT_LOADED&&this.loadFragment(A,_,b)}},T.loadFragment=function(O,E,v){this.fragCurrent=O,d.prototype.loadFragment.call(this,O,E,v)},s(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(p.default)},"./src/controller/subtitle-track-controller.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/events.ts"),W=P("./src/utils/texttrack-utils.ts"),R=P("./src/controller/base-playlist-controller.ts"),B=P("./src/types/loader.ts");function M(h,s){for(var l=0;l<s.length;l++){var i=s[l];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(h,i.key,i)}}function L(h,s,l){return s&&M(h.prototype,s),l&&M(h,l),h}function I(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,p(h,s)}function p(h,s){return p=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},p(h,s)}var m=function(h){I(s,h);function s(i){var r;return r=h.call(this,i,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var l=s.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},l.registerListeners=function(){var r=this.hls;r.on(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(Y.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var r=this.hls;r.off(Y.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(Y.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(Y.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(Y.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(Y.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(Y.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(Y.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(Y.Events.ERROR,this.onError,this)},l.onMediaAttached=function(r,n){if(this.media=n.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},l.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},l.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 r=u(this.media.textTracks);r.forEach(function(n){Object(W.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},l.onSubtitleTrackLoaded=function(r,n){var d=n.id,w=n.details,T=this.trackId,x=this.tracksInGroup[T];if(!x){this.warn("Invalid subtitle track id "+d);return}var O=x.details;x.details=n.details,this.log("subtitle track "+d+" loaded ["+w.startSN+"-"+w.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,n,O))},l.onLevelLoading=function(r,n){this.switchLevel(n.level)},l.onLevelSwitching=function(r,n){this.switchLevel(n.level)},l.switchLevel=function(r){var n=this.hls.levels[r];if(!(n!=null&&n.textGroupIds))return;var d=n.textGroupIds[n.urlId];if(this.groupId!==d){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(E){return!d||E.groupId===d});this.tracksInGroup=T;var x=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=d;var O={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(Y.Events.SUBTITLE_TRACKS_UPDATED,O),x!==-1&&this.setSubtitleTrack(x,w)}},l.findTrackId=function(r){for(var n=this.tracksInGroup,d=0;d<n.length;d++){var w=n[d];if((!this.selectDefaultTrack||w.default)&&(!r||r===w.name))return w.id}return-1},l.onError=function(r,n){if(h.prototype.onError.call(this,r,n),n.fatal||!n.context)return;n.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},l.loadPlaylist=function(r){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var d=n.id,w=n.groupId,T=n.url;if(r)try{T=r.addDirectives(T)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(Y.Events.SUBTITLE_TRACK_LOADING,{url:T,id:d,groupId:w,deliveryDirectives:r||null})}},l.toggleTrackModes=function(r){var n=this,d=this.media,w=this.subtitleDisplay,T=this.trackId;if(!d)return;var x=u(d.textTracks),O=x.filter(function(_){return _.groupId===n.groupId});if(r===-1)[].slice.call(x).forEach(function(_){_.mode="disabled"});else{var E=O[T];E&&(E.mode="disabled")}var v=O[r];v&&(v.mode=w?"showing":"hidden")},l.setSubtitleTrack=function(r,n){var d,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(d=w[r])!==null&&d!==void 0&&d.details)||r<-1||r>=w.length)return;this.clearTimer();var T=w[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,T){var x=T.id,O=T.groupId,E=O===void 0?"":O,v=T.name,_=T.type,f=T.url;this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:E,name:v,type:_,url:f});var c=this.switchParams(T.url,n==null?void 0:n.details);this.loadPlaylist(c)}else this.hls.trigger(Y.Events.SUBTITLE_TRACK_SWITCH,{id:r})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=u(this.media.textTracks),d=0;d<n.length;d++)if(n[d].mode==="hidden")r=d;else if(n[d].mode==="showing"){r=d;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},L(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,n)}}]),s}(R.default);function u(h){for(var s=[],l=0;l<h.length;l++){var i=h[l];i.kind==="subtitles"&&i.label&&s.push(h[l])}return s}V.default=m},"./src/controller/timeline-controller.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"TimelineController",function(){return u});var Y=P("./src/polyfills/number.ts"),W=P("./src/events.ts"),R=P("./src/utils/cea-608-parser.ts"),B=P("./src/utils/output-filter.ts"),M=P("./src/utils/webvtt-parser.ts"),L=P("./src/utils/texttrack-utils.ts"),I=P("./src/utils/imsc1-ttml-parser.ts"),p=P("./src/types/loader.ts"),m=P("./src/utils/logger.ts"),u=function(){function i(n){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new B.default(this,"textTrack1"),w=new B.default(this,"textTrack2"),T=new B.default(this,"textTrack3"),x=new B.default(this,"textTrack4");this.cea608Parser1=new R.default(1,d,w),this.cea608Parser2=new R.default(3,T,x)}n.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(W.Events.FRAG_LOADING,this.onFragLoading,this),n.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=i.prototype;return r.destroy=function(){var d=this.hls;d.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(W.Events.FRAG_LOADING,this.onFragLoading,this),d.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(d,w,T,x,O){for(var E=!1,v=O.length;v--;){var _=O[v],f=s(_[0],_[1],w,T);if(f>=0&&(_[0]=Math.min(_[0],w),_[1]=Math.max(_[1],T),E=!0,f/(T-w)>.5))return}if(E||O.push([w,T]),this.config.renderTextTracksNatively){var c=this.captionsTracks[d];this.Cues.newCue(c,w,T,x)}else{var S=this.Cues.newCue(null,w,T,x);this.hls.trigger(W.Events.CUES_PARSED,{type:"captions",cues:S,track:d})}},r.onInitPtsFound=function(d,w){var T=this,x=w.frag,O=w.id,E=w.initPTS,v=w.timescale,_=this.unparsedVttFrags;O==="main"&&(this.initPTS[x.cc]=E,this.timescale[x.cc]=v),_.length&&(this.unparsedVttFrags=[],_.forEach(function(f){T.onFragLoaded(W.Events.FRAG_LOADED,f)}))},r.getExistingTrack=function(d){var w=this.media;if(w)for(var T=0;T<w.textTracks.length;T++){var x=w.textTracks[T];if(x[d])return x}return null},r.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},r.createNativeTrack=function(d){if(this.captionsTracks[d])return;var w=this.captionsProperties,T=this.captionsTracks,x=this.media,O=w[d],E=O.label,v=O.languageCode,_=this.getExistingTrack(d);if(_)T[d]=_,Object(L.clearCurrentCues)(T[d]),Object(L.sendAddTrackEvent)(T[d],x);else{var f=this.createTextTrack("captions",E,v);f&&(f[d]=!0,T[d]=f)}},r.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var w=this.captionsProperties[d];if(!w)return;var T=w.label,x={_id:d,label:T,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[d]=x,this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},r.createTextTrack=function(d,w,T){var x=this.media;return x?x.addTextTrack(d,w,T):void 0},r.onMediaAttaching=function(d,w){this.media=w.media,this._cleanTracks()},r.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(w){Object(L.clearCurrentCues)(d[w]),delete d[w]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var d=this.media;if(!d)return;var w=d.textTracks;if(w)for(var T=0;T<w.length;T++)Object(L.clearCurrentCues)(w[T])},r.onSubtitleTracksUpdated=function(d,w){var T=this;this.textTracks=[];var x=w.subtitleTracks||[],O=x.some(function(f){return f.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var E=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,c){var S;if(c<v.length){for(var y=null,b=0;b<v.length;b++)if(h(v[b],f)){y=v[b];break}y&&(S=y)}S?Object(L.clearCurrentCues)(S):(S=T.createTextTrack("subtitles",f.name,f.lang),S&&(S.mode="disabled")),S&&(S.groupId=f.groupId,T.textTracks.push(S))})}else if(!E&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},r.onManifestLoaded=function(d,w){var T=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(x){var O=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!O)return;var E="textTrack"+O[1],v=T.captionsProperties[E];if(!v)return;v.label=x.name,x.lang&&(v.languageCode=x.lang),v.media=x})},r.onFragLoading=function(d,w){var T=this.cea608Parser1,x=this.cea608Parser2,O=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(T&&x))return;if(w.frag.type===p.PlaylistLevelType.MAIN){var v,_,f=w.frag.sn,c=(v=w==null||((_=w.part)===null||_===void 0)?void 0:_.index)!=null?v:-1;f===O+1||f===O&&c===E+1||(T.reset(),x.reset()),this.lastSn=f,this.lastPartIndex=c}},r.onFragLoaded=function(d,w){var T=w.frag,x=w.payload,O=this.initPTS,E=this.unparsedVttFrags;if(T.type===p.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(Y.isFiniteNumber)(O[T.cc])){E.push(w),O.length&&this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var v=T.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var _=this.tracks[T.level],f=this.vttCCs;f[T.cc]||(f[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),_&&_.textCodec===I.IMSC1_CODEC?this._parseIMSC1(T,x):this._parseVTTs(T,x,f)}}else this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(d,w){var T=this,x=this.hls;Object(I.parseIMSC1)(w,this.initPTS[d.cc],this.timescale[d.cc],function(O){T._appendCues(O,d.level),x.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(O){m.logger.log("Failed to parse IMSC1: "+O),x.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:O})})},r._parseVTTs=function(d,w,T){var x=this,O=this.hls;Object(M.parseWebVTT)(w,this.initPTS[d.cc],this.timescale[d.cc],T,d.cc,d.start,function(E){x._appendCues(E,d.level),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(E){x._fallbackToIMSC1(d,w),m.logger.log("Failed to parse VTT cue: "+E),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:E})})},r._fallbackToIMSC1=function(d,w){var T=this,x=this.tracks[d.level];x.textCodec||Object(I.parseIMSC1)(w,this.initPTS[d.cc],this.timescale[d.cc],function(){x.textCodec=I.IMSC1_CODEC,T._parseIMSC1(d,w)},function(){x.textCodec="wvtt"})},r._appendCues=function(d,w){var T=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[w];if(x.mode==="disabled")return;d.forEach(function(v){return Object(L.addCueToTrack)(x,v)})}else{var O=this.tracks[w],E=O.default?"default":"subtitles"+w;T.trigger(W.Events.CUES_PARSED,{type:"subtitles",cues:d,track:E})}},r.onFragDecrypted=function(d,w){var T=w.frag;if(T.type===p.PlaylistLevelType.SUBTITLE){if(!Object(Y.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(W.Events.FRAG_LOADED,w)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(d,w){var T=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(T&&x))return;for(var O=0;O<w.samples.length;O++){var E=w.samples[O].bytes;if(E){var v=this.extractCea608Data(E);T.addData(w.samples[O].pts,v[0]),x.addData(w.samples[O].pts,v[1])}}},r.onBufferFlushing=function(d,w){var T=w.startOffset,x=w.endOffset,O=w.endOffsetSubtitles,E=w.type,v=this.media;if(!v||v.currentTime<x)return;if(!E||E==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(c){return Object(L.removeCuesInRange)(_[c],T,x)})}if(this.config.renderTextTracksNatively&&(T===0&&O!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(c){return Object(L.removeCuesInRange)(f[c],T,O)})}},r.extractCea608Data=function(d){for(var w=d[0]&31,T=2,x=[[],[]],O=0;O<w;O++){var E=d[T++],v=127&d[T++],_=127&d[T++],f=(4&E)!==0,c=3&E;if(v===0&&_===0)continue;f&&((c===0||c===1)&&(x[c].push(v),x[c].push(_)))}return x},i}();function h(i,r){return i&&i.label===r.name&&!(i.textTrack1||i.textTrack2)}function s(i,r,n,d){return Math.min(r,d)-Math.max(i,n)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function W(B,M){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=M}var R=W.prototype;return R.decrypt=function(M,L){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},L,M)},W}()},"./src/crypt/aes-decryptor.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"removePadding",function(){return W}),P.d(V,"default",function(){return R});var Y=P("./src/utils/typed-array.ts");function W(B){var M=B.byteLength,L=M&&new DataView(B.buffer).getUint8(M-1);return L?Object(Y.sliceUint8)(B,0,M-L):B}var R=function(){function B(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var M=B.prototype;return M.uint8ArrayToUint32Array_=function(I){for(var p=new DataView(I),m=new Uint32Array(4),u=0;u<4;u++)m[u]=p.getUint32(u*4);return m},M.initTable=function(){var I=this.sBox,p=this.invSBox,m=this.subMix,u=m[0],h=m[1],s=m[2],l=m[3],i=this.invSubMix,r=i[0],n=i[1],d=i[2],w=i[3],T=new Uint32Array(256),x=0,O=0,E=0;for(E=0;E<256;E++)E<128?T[E]=E<<1:T[E]=E<<1^283;for(E=0;E<256;E++){var v=O^O<<1^O<<2^O<<3^O<<4;v=v>>>8^v&255^99,I[x]=v,p[v]=x;var _=T[x],f=T[_],c=T[f],S=T[v]*257^v*16843008;u[x]=S<<24|S>>>8,h[x]=S<<16|S>>>16,s[x]=S<<8|S>>>24,l[x]=S,S=c*16843009^f*65537^_*257^x*16843008,r[v]=S<<24|S>>>8,n[v]=S<<16|S>>>16,d[v]=S<<8|S>>>24,w[v]=S,x?(x=_^T[T[T[c^_]]],O^=T[T[O]]):x=O=1}},M.expandKey=function(I){for(var p=this.uint8ArrayToUint32Array_(I),m=!0,u=0;u<p.length&&m;)m=p[u]===this.key[u],u++;if(m)return;this.key=p;var h=this.keySize=p.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var s=this.ksRows=(h+6+1)*4,l,i,r=this.keySchedule=new Uint32Array(s),n=this.invKeySchedule=new Uint32Array(s),d=this.sBox,w=this.rcon,T=this.invSubMix,x=T[0],O=T[1],E=T[2],v=T[3],_,f;for(l=0;l<s;l++){if(l<h){_=r[l]=p[l];continue}f=_,l%h===0?(f=f<<8|f>>>24,f=d[f>>>24]<<24|d[f>>>16&255]<<16|d[f>>>8&255]<<8|d[f&255],f^=w[l/h|0]<<24):h>6&&l%h===4&&(f=d[f>>>24]<<24|d[f>>>16&255]<<16|d[f>>>8&255]<<8|d[f&255]),r[l]=_=(r[l-h]^f)>>>0}for(i=0;i<s;i++)l=s-i,i&3?f=r[l]:f=r[l-4],i<4||l<=4?n[i]=f:n[i]=x[d[f>>>24]]^O[d[f>>>16&255]]^E[d[f>>>8&255]]^v[d[f&255]],n[i]=n[i]>>>0},M.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},M.decrypt=function(I,p,m){for(var u=this.keySize+6,h=this.invKeySchedule,s=this.invSBox,l=this.invSubMix,i=l[0],r=l[1],n=l[2],d=l[3],w=this.uint8ArrayToUint32Array_(m),T=w[0],x=w[1],O=w[2],E=w[3],v=new Int32Array(I),_=new Int32Array(v.length),f,c,S,y,b,N,F,X,Z,H,A,z,ne,ae,me=this.networkToHostOrderSwap;p<v.length;){for(Z=me(v[p]),H=me(v[p+1]),A=me(v[p+2]),z=me(v[p+3]),b=Z^h[0],N=z^h[1],F=A^h[2],X=H^h[3],ne=4,ae=1;ae<u;ae++)f=i[b>>>24]^r[N>>16&255]^n[F>>8&255]^d[X&255]^h[ne],c=i[N>>>24]^r[F>>16&255]^n[X>>8&255]^d[b&255]^h[ne+1],S=i[F>>>24]^r[X>>16&255]^n[b>>8&255]^d[N&255]^h[ne+2],y=i[X>>>24]^r[b>>16&255]^n[N>>8&255]^d[F&255]^h[ne+3],b=f,N=c,F=S,X=y,ne=ne+4;f=s[b>>>24]<<24^s[N>>16&255]<<16^s[F>>8&255]<<8^s[X&255]^h[ne],c=s[N>>>24]<<24^s[F>>16&255]<<16^s[X>>8&255]<<8^s[b&255]^h[ne+1],S=s[F>>>24]<<24^s[X>>16&255]<<16^s[b>>8&255]<<8^s[N&255]^h[ne+2],y=s[X>>>24]<<24^s[b>>16&255]<<16^s[N>>8&255]<<8^s[F&255]^h[ne+3],_[p]=me(f^T),_[p+1]=me(y^x),_[p+2]=me(S^O),_[p+3]=me(c^E),T=Z,x=H,O=A,E=z,p=p+4}return _.buffer},B}()},"./src/crypt/decrypter.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return p});var Y=P("./src/crypt/aes-crypto.ts"),W=P("./src/crypt/fast-aes-key.ts"),R=P("./src/crypt/aes-decryptor.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/mp4-tools.ts"),L=P("./src/utils/typed-array.ts"),I=16,p=function(){function m(h,s,l){var i=l===void 0?{}:l,r=i.removePKCS7Padding,n=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=h,this.config=s,this.removePKCS7Padding=n,n)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var u=m.prototype;return u.destroy=function(){this.observer=null},u.isSync=function(){return this.config.enableSoftwareAES},u.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var l=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(l):l},u.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},u.decrypt=function(s,l,i,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),l,i);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),l,i).then(r)},u.softwareDecrypt=function(s,l,i){var r=this.currentIV,n=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(s=Object(M.appendUint8Array)(d,s),this.remainderData=null);var w=this.getValidChunk(s);if(!w.length)return null;r&&(i=r);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new R.default),T.expandKey(l);var x=n;return this.currentResult=T.decrypt(w.buffer,0,i),this.currentIV=Object(L.sliceUint8)(w,-16).buffer,x||null},u.webCryptoDecrypt=function(s,l,i){var r=this,n=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new W.default(n,l)),this.fastAesKey.expandKey().then(function(d){if(!n)return Promise.reject(new Error("web crypto not initialized"));var w=new Y.default(n,i);return w.decrypt(s.buffer,d)}).catch(function(d){return r.onWebCryptoError(d,s,l,i)})},u.onWebCryptoError=function(s,l,i,r){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,i,r)},u.getValidChunk=function(s){var l=s,i=s.length-s.length%I;return i!==s.length&&(l=Object(L.sliceUint8)(s,0,i),this.remainderData=Object(L.sliceUint8)(s,i)),l},u.logOnce=function(s){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function W(B,M){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=M}var R=W.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},W}()},"./src/demux/aacdemuxer.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/demux/base-audio-demuxer.ts"),W=P("./src/demux/adts.ts"),R=P("./src/utils/logger.ts"),B=P("./src/demux/id3.ts");function M(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,L(p,m)}function L(p,m){return L=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},L(p,m)}var I=function(p){M(m,p);function m(h,s){var l;return l=p.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=h,l.config=s,l}var u=m.prototype;return u.resetInitSegment=function(s,l,i){p.prototype.resetInitSegment.call(this,s,l,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var l=B.getID3Data(s,0)||[],i=l.length,r=s.length;i<r;i++)if(W.probe(s,i))return R.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(s,l){return W.canParse(s,l)},u.appendFrame=function(s,l,i){W.initTrackConfig(s,this.observer,l,i,s.manifestCodec);var r=W.appendFrame(s,l,i,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},m}(Y.default);I.minProbeByteLength=9,V.default=I},"./src/demux/adts.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"getAudioConfig",function(){return B}),P.d(V,"isHeaderPattern",function(){return M}),P.d(V,"getHeaderLength",function(){return L}),P.d(V,"getFullFrameLength",function(){return I}),P.d(V,"canGetFrameLength",function(){return p}),P.d(V,"isHeader",function(){return m}),P.d(V,"canParse",function(){return u}),P.d(V,"probe",function(){return h}),P.d(V,"initTrackConfig",function(){return s}),P.d(V,"getFrameDuration",function(){return l}),P.d(V,"parseFrameHeader",function(){return i}),P.d(V,"appendFrame",function(){return r});var Y=P("./src/utils/logger.ts"),W=P("./src/errors.ts"),R=P("./src/events.ts");function B(n,d,w,T){var x,O,E,v,_=navigator.userAgent.toLowerCase(),f=T,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((d[w+2]&192)>>>6)+1;var S=(d[w+2]&60)>>>2;if(S>c.length-1){n.trigger(R.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return E=(d[w+2]&1)<<2,E|=(d[w+3]&192)>>>6,Y.logger.log("manifest codec:"+T+", ADTS type:"+x+", samplingIndex:"+S),/firefox/i.test(_)?S>=6?(x=5,v=new Array(4),O=S-3):(x=2,v=new Array(2),O=S):_.indexOf("android")!==-1?(x=2,v=new Array(2),O=S):(x=5,v=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&S>=6?O=S-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(S>=6&&E===1||/vivaldi/i.test(_))||!T&&E===1)&&(x=2,v=new Array(2)),O=S)),v[0]=x<<3,v[0]|=(S&14)>>1,v[1]|=(S&1)<<7,v[1]|=E<<3,x===5&&(v[1]|=(O&14)>>1,v[2]=(O&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:c[S],channelCount:E,codec:"mp4a.40."+x,manifestCodec:f}}function M(n,d){return n[d]===255&&(n[d+1]&246)===240}function L(n,d){return n[d+1]&1?7:9}function I(n,d){return(n[d+3]&3)<<11|n[d+4]<<3|(n[d+5]&224)>>>5}function p(n,d){return d+5<n.length}function m(n,d){return d+1<n.length&&M(n,d)}function u(n,d){return p(n,d)&&M(n,d)&&I(n,d)<=n.length-d}function h(n,d){if(m(n,d)){var w=L(n,d);if(d+w>=n.length)return!1;var T=I(n,d);if(T<=w)return!1;var x=d+T;return x===n.length||m(n,x)}return!1}function s(n,d,w,T,x){if(!n.samplerate){var O=B(d,w,T,x);if(!O)return;n.config=O.config,n.samplerate=O.samplerate,n.channelCount=O.channelCount,n.codec=O.codec,n.manifestCodec=O.manifestCodec,Y.logger.log("parsed codec:"+n.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function l(n){return 1024*9e4/n}function i(n,d,w,T,x){var O=L(n,d),E=I(n,d);if(E-=O,E>0){var v=w+T*x;return{headerLength:O,frameLength:E,stamp:v}}}function r(n,d,w,T,x){var O=l(n.samplerate),E=i(d,w,T,x,O);if(E){var v=E.frameLength,_=E.headerLength,f=E.stamp,c=_+v,S=Math.max(0,w+c-d.length),y;S?(y=new Uint8Array(c-_),y.set(d.subarray(w+_,d.length),0)):y=d.subarray(w+_,w+c);var b={unit:y,pts:f};return S||n.samples.push(b),{sample:b,length:c,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"initPTSFn",function(){return I});var Y=P("./src/polyfills/number.ts"),W=P("./src/demux/id3.ts"),R=P("./src/demux/dummy-demuxed-track.ts"),B=P("./src/utils/mp4-tools.ts"),M=P("./src/utils/typed-array.ts"),L=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=p.prototype;return m.resetInitSegment=function(h,s,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(h,s){return!1},m.appendFrame=function(h,s,l){},m.demux=function(h,s){this.cachedData&&(h=Object(B.appendUint8Array)(this.cachedData,h),this.cachedData=null);var l=W.getID3Data(h,0),i=l?l.length:0,r,n,d=this._audioTrack,w=this._id3Track,T=l?W.getTimeStamp(l):void 0,x=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(T,s)),l&&l.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),n=this.initPTS;i<x;){if(this.canParse(h,i)){var O=this.appendFrame(d,h,i);O?(this.frameIndex++,n=O.sample.pts,i+=O.length,r=i):i=x}else W.canParse(h,i)?(l=W.getID3Data(h,i),w.samples.push({pts:n,dts:n,data:l}),i+=l.length,r=i):i++;if(i===x&&r!==x){var E=Object(M.sliceUint8)(h,r);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:d,avcTrack:Object(R.dummyTrack)(),id3Track:w,textTrack:Object(R.dummyTrack)()}},m.demuxSampleAes=function(h,s,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(h){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},m.destroy=function(){},p}(),I=function(m,u){return Object(Y.isFiniteNumber)(m)?m*90:u*9e4};V.default=L},"./src/demux/chunk-cache.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function R(){this.chunks=[],this.dataLength=0}var B=R.prototype;return B.push=function(L){this.chunks.push(L),this.dataLength+=L.length},B.flush=function(){var L=this.chunks,I=this.dataLength,p;if(L.length)L.length===1?p=L[0]:p=W(L,I);else return new Uint8Array(0);return this.reset(),p},B.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function W(R,B){for(var M=new Uint8Array(B),L=0,I=0;I<R.length;I++){var p=R[I];M.set(p,L),L+=p.length}return M}},"./src/demux/dummy-demuxed-track.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"dummyTrack",function(){return Y});function Y(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/logger.ts"),W=function(){function R(M){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=M,this.bytesAvailable=M.byteLength,this.word=0,this.bitsAvailable=0}var B=R.prototype;return B.loadWord=function(){var L=this.data,I=this.bytesAvailable,p=L.byteLength-I,m=new Uint8Array(4),u=Math.min(4,I);if(u===0)throw new Error("no bytes available");m.set(L.subarray(p,p+u)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},B.skipBits=function(L){var I;this.bitsAvailable>L?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,I=L>>3,L-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},B.readBits=function(L){var I=Math.min(this.bitsAvailable,L),p=this.word>>>32-I;return L>32&&Y.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=L-I,I>0&&this.bitsAvailable?p<<I|this.readBits(I):p},B.skipLZ=function(){var L;for(L=0;L<this.bitsAvailable;++L)if((this.word&2147483648>>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},B.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(L){for(var I=8,p=8,m,u=0;u<L;u++)p!==0&&(m=this.readEG(),p=(I+m+256)%256),I=p===0?I:p},B.readSPS=function(){var L=0,I=0,p=0,m=0,u,h,s,l=this.readUByte.bind(this),i=this.readBits.bind(this),r=this.readUEG.bind(this),n=this.readBoolean.bind(this),d=this.skipBits.bind(this),w=this.skipEG.bind(this),T=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);l();var O=l();if(i(5),d(3),l(),T(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var E=r();if(E===3&&d(1),T(),T(),d(1),n())for(h=E!==3?8:12,s=0;s<h;s++)n()&&(s<6?x(16):x(64))}T();var v=r();if(v===0)r();else if(v===1)for(d(1),w(),w(),u=r(),s=0;s<u;s++)w();T(),d(1);var _=r(),f=r(),c=i(1);c===0&&d(1),d(1),n()&&(L=r(),I=r(),p=r(),m=r());var S=[1,1];if(n()&&n()){var y=l();switch(y){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((_+1)*16-L*2-I*2),height:(2-c)*(f+1)*16-(c?2:4)*(p+m),pixelRatio:S}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();V.default=W},"./src/demux/id3.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isHeader",function(){return Y}),P.d(V,"isFooter",function(){return W}),P.d(V,"getID3Data",function(){return R}),P.d(V,"canParse",function(){return M}),P.d(V,"getTimeStamp",function(){return L}),P.d(V,"isTimeStampFrame",function(){return I}),P.d(V,"getID3Frames",function(){return m}),P.d(V,"decodeFrame",function(){return u}),P.d(V,"utf8ArrayToStr",function(){return r}),P.d(V,"testables",function(){return n});var Y=function(x,O){return O+10<=x.length&&(x[O]===73&&x[O+1]===68&&x[O+2]===51&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},W=function(x,O){return O+10<=x.length&&(x[O]===51&&x[O+1]===68&&x[O+2]===73&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},R=function(x,O){for(var E=O,v=0;Y(x,O);){v+=10;var _=B(x,O+6);v+=_,W(x,O+10)&&(v+=10),O+=v}return v>0?x.subarray(E,E+v):void 0},B=function(x,O){var E=0;return E=(x[O]&127)<<21,E|=(x[O+1]&127)<<14,E|=(x[O+2]&127)<<7,E|=x[O+3]&127,E},M=function(x,O){return Y(x,O)&&B(x,O+6)+10<=x.length-O},L=function(x){for(var O=m(x),E=0;E<O.length;E++){var v=O[E];if(I(v))return i(v)}return},I=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},p=function(x){var O=String.fromCharCode(x[0],x[1],x[2],x[3]),E=B(x,4),v=10;return{type:O,size:E,data:x.subarray(v,v+E)}},m=function(x){for(var O=0,E=[];Y(x,O);){var v=B(x,O+6);O+=10;for(var _=O+v;O+8<_;){var f=p(x.subarray(O)),c=u(f);c&&E.push(c),O+=f.size+10}W(x,O)&&(O+=10)}return E},u=function(x){return x.type==="PRIV"?h(x):x.type[0]==="W"?l(x):s(x)},h=function(x){if(x.size<2)return;var O=r(x.data,!0),E=new Uint8Array(x.data.subarray(O.length+1));return{key:x.type,info:O,data:E.buffer}},s=function(x){if(x.size<2)return;if(x.type==="TXXX"){var O=1,E=r(x.data.subarray(O),!0);O+=E.length+1;var v=r(x.data.subarray(O));return{key:x.type,info:E,data:v}}var _=r(x.data.subarray(1));return{key:x.type,data:_}},l=function(x){if(x.type==="WXXX"){if(x.size<2)return;var O=1,E=r(x.data.subarray(O),!0);O+=E.length+1;var v=r(x.data.subarray(O));return{key:x.type,info:E,data:v}}var _=r(x.data);return{key:x.type,data:_}},i=function(x){if(x.data.byteLength===8){var O=new Uint8Array(x.data),E=O[3]&1,v=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return v/=45,E&&(v+=4772185884e-2),Math.round(v)}return},r=function(x,O){O===void 0&&(O=!1);var E=w();if(E){var v=E.decode(x);if(O){var _=v.indexOf("\0");return _!==-1?v.substring(0,_):v}return v.replace(/\0/g,"")}for(var f=x.length,c,S,y,b="",N=0;N<f;){if(c=x[N++],c===0&&O)return b;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:b+=String.fromCharCode(c);break;case 12:case 13:S=x[N++],b+=String.fromCharCode((c&31)<<6|S&63);break;case 14:S=x[N++],y=x[N++],b+=String.fromCharCode((c&15)<<12|(S&63)<<6|(y&63)<<0);break;default:}}return b},n={decodeTextFrame:s},d;function w(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/demux/base-audio-demuxer.ts"),W=P("./src/demux/id3.ts"),R=P("./src/utils/logger.ts"),B=P("./src/demux/mpegaudio.ts");function M(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,L(p,m)}function L(p,m){return L=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},L(p,m)}var I=function(p){M(m,p);function m(){return p.apply(this,arguments)||this}var u=m.prototype;return u.resetInitSegment=function(s,l,i){p.prototype.resetInitSegment.call(this,s,l,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:i,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var l=W.getID3Data(s,0)||[],i=l.length,r=s.length;i<r;i++)if(B.probe(s,i))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(s,l){return B.canParse(s,l)},u.appendFrame=function(s,l,i){return this.initPTS===null?void 0:B.appendFrame(s,l,i,this.initPTS,this.frameIndex)},m}(Y.default);I.minProbeByteLength=4,V.default=I},"./src/demux/mp4demuxer.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/mp4-tools.ts"),W=P("./src/demux/dummy-demuxed-track.ts"),R=function(){function B(L,I){this.remainderData=null,this.config=void 0,this.config=I}var M=B.prototype;return M.resetTimeStamp=function(){},M.resetInitSegment=function(){},M.resetContiguity=function(){},B.probe=function(I){return Object(Y.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},M.demux=function(I){var p=I,m=Object(W.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(Y.appendUint8Array)(this.remainderData,I));var u=Object(Y.segmentValidRange)(p);this.remainderData=u.remainder,m.samples=u.valid||new Uint8Array}else m.samples=p;return{audioTrack:Object(W.dummyTrack)(),avcTrack:m,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},M.flush=function(){var I=Object(W.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(W.dummyTrack)(),avcTrack:I,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},M.demuxSampleAes=function(I,p,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},B}();R.minProbeByteLength=1024,V.default=R},"./src/demux/mpegaudio.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"appendFrame",function(){return L}),P.d(V,"parseHeader",function(){return I}),P.d(V,"isHeaderPattern",function(){return p}),P.d(V,"isHeader",function(){return m}),P.d(V,"canParse",function(){return u}),P.d(V,"probe",function(){return h});var Y=null,W=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function L(s,l,i,r,n){if(i+24>l.length)return;var d=I(l,i);if(d&&i+d.frameLength<=l.length){var w=d.samplesPerFrame*9e4/d.sampleRate,T=r+n*w,x={unit:l.subarray(i,i+d.frameLength),pts:T,dts:T};return s.config=[],s.channelCount=d.channelCount,s.samplerate=d.sampleRate,s.samples.push(x),{sample:x,length:d.frameLength,missing:0}}}function I(s,l){var i=s[l+1]>>3&3,r=s[l+1]>>1&3,n=s[l+2]>>4&15,d=s[l+2]>>2&3;if(i!==1&&n!==0&&n!==15&&d!==3){var w=s[l+2]>>1&1,T=s[l+3]>>6,x=i===3?3-r:r===3?3:4,O=W[x*14+n-1]*1e3,E=i===3?0:i===2?1:2,v=R[E*3+d],_=T===3?1:2,f=B[i][r],c=M[r],S=f*8*c,y=Math.floor(f*O/v+w)*c;if(Y===null){var b=navigator.userAgent||"",N=b.match(/Chrome\/(\d+)/i);Y=N?parseInt(N[1]):0}var F=!!Y&&Y<=87;return F&&r===2&&O>=224e3&&T===0&&(s[l+3]=s[l+3]|128),{sampleRate:v,channelCount:_,frameLength:y,samplesPerFrame:S}}}function p(s,l){return s[l]===255&&(s[l+1]&224)===224&&(s[l+1]&6)!==0}function m(s,l){return l+1<s.length&&p(s,l)}function u(s,l){var i=4;return p(s,l)&&i<=s.length-l}function h(s,l){if(l+1<s.length&&p(s,l)){var i=4,r=I(s,l),n=i;r!=null&&r.frameLength&&(n=r.frameLength);var d=l+n;return d===s.length||m(s,d)}return!1}},"./src/demux/sample-aes.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/crypt/decrypter.ts"),W=P("./src/demux/tsdemuxer.ts"),R=function(){function B(L,I,p){this.keyData=void 0,this.decrypter=void 0,this.keyData=p,this.decrypter=new Y.default(L,I,{removePKCS7Padding:!1})}var M=B.prototype;return M.decryptBuffer=function(I,p){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,p)},M.decryptAacSample=function(I,p,m,u){var h=I[p].unit,s=h.subarray(16,h.length-h.length%16),l=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),i=this;this.decryptBuffer(l,function(r){var n=new Uint8Array(r);h.set(n,16),u||i.decryptAacSamples(I,p+1,m)})},M.decryptAacSamples=function(I,p,m){for(;;p++){if(p>=I.length){m();return}if(I[p].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(I,p,m,u),!u)return}},M.getAvcEncryptedData=function(I){for(var p=Math.floor((I.length-48)/160)*16+16,m=new Int8Array(p),u=0,h=32;h<=I.length-16;h+=160,u+=16)m.set(I.subarray(h,h+16),u);return m},M.getAvcDecryptedUnit=function(I,p){for(var m=new Uint8Array(p),u=0,h=32;h<=I.length-16;h+=160,u+=16)I.set(m.subarray(u,u+16),h);return I},M.decryptAvcSample=function(I,p,m,u,h,s){var l=Object(W.discardEPB)(h.data),i=this.getAvcEncryptedData(l),r=this;this.decryptBuffer(i.buffer,function(n){h.data=r.getAvcDecryptedUnit(l,n),s||r.decryptAvcSamples(I,p,m+1,u)})},M.decryptAvcSamples=function(I,p,m,u){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,m=0){if(p>=I.length){u();return}for(var h=I[p].units;!(m>=h.length);m++){var s=h[m];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(I,p,m,u,s,l),!l)return}}},B}();V.default=R},"./src/demux/transmuxer-interface.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h});var Y=P("./node_modules/webworkify-webpack/index.js"),W=P.n(Y),R=P("./src/events.ts"),B=P("./src/demux/transmuxer.ts"),M=P("./src/utils/logger.ts"),L=P("./src/errors.ts"),I=P("./src/utils/mediasource-helper.ts"),p=P("./node_modules/eventemitter3/index.js"),m=P.n(p),u=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function s(i,r,n,d){var w=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=i,this.id=r,this.onTransmuxComplete=n,this.onFlush=d;var T=i.config,x=function(f,c){c=c||{},c.frag=w.frag,c.id=w.id,i.trigger(f,c)};this.observer=new p.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,x),this.observer.on(R.Events.ERROR,x);var O={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var v;try{v=this.worker=Y("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(_){i.trigger(R.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},v.postMessage({cmd:"init",typeSupported:O,vendor:E,id:r,config:JSON.stringify(T)})}catch(_){M.logger.warn("Error in worker:",_),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new B.default(this.observer,O,T,E,r),this.worker=null}}else this.transmuxer=new B.default(this.observer,O,T,E,r)}var l=s.prototype;return l.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},l.push=function(r,n,d,w,T,x,O,E,v,_){var f=this;v.transmuxing.start=self.performance.now();var c=this.transmuxer,S=this.worker,y=x?x.start:T.start,b=T.decryptdata,N=this.frag,F=!(N&&T.cc===N.cc),X=!(N&&v.level===N.level),Z=N?v.sn-N.sn:-1,H=this.part?v.part-this.part.index:1,A=!X&&(Z===1||Z===0&&H===1),z=self.performance.now();(X||Z||T.stats.parsing.start===0)&&(T.stats.parsing.start=z),x&&(H||!A)&&(x.stats.parsing.start=z);var ne=new B.TransmuxState(F,A,E,X,y);if(!A||F){M.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
discontinuity: `+F+`
trackSwitch: `+X+`
contiguous: `+A+`
accurateTimeOffset: `+E+`
timeOffset: `+y);var ae=new B.TransmuxConfig(d,w,n,O,_);this.configureTransmuxer(ae)}if(this.frag=T,this.part=x,S)S.postMessage({cmd:"demux",data:r,decryptdata:b,chunkMeta:v,state:ne},r instanceof ArrayBuffer?[r]:[]);else if(c){var me=c.push(r,b,v,ne);Object(B.isPromise)(me)?me.then(function(xe){f.handleTransmuxComplete(xe)}):this.handleTransmuxComplete(me)}},l.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var d=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:r});else if(d){var T=d.flush(r);Object(B.isPromise)(T)?T.then(function(x){n.handleFlushResult(x,r)}):this.handleFlushResult(T,r)}},l.handleFlushResult=function(r,n){var d=this;r.forEach(function(w){d.handleTransmuxComplete(w)}),this.onFlush(n)},l.onWorkerMessage=function(r){var n=r.data,d=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,d.trigger(n.event,n.data);break}}},l.configureTransmuxer=function(r){var n=this.worker,d=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):d&&d.configure(r)},l.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},s}()},"./src/demux/transmuxer-worker.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return L});var Y=P("./src/demux/transmuxer.ts"),W=P("./src/events.ts"),R=P("./src/utils/logger.ts"),B=P("./node_modules/eventemitter3/index.js"),M=P.n(B);function L(h){var s=new B.EventEmitter,l=function(r,n){h.postMessage({event:r,data:n})};s.on(W.Events.FRAG_DECRYPTED,l),s.on(W.Events.ERROR,l),h.addEventListener("message",function(i){var r=i.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);h.transmuxer=new Y.default(s,r.typeSupported,n,r.vendor,r.id),Object(R.enableLogs)(n.debug),l("init",null);break}case"configure":{h.transmuxer.configure(r.config);break}case"demux":{var d=h.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(Y.isPromise)(d)?d.then(function(x){I(h,x)}):I(h,d);break}case"flush":{var w=r.chunkMeta,T=h.transmuxer.flush(w);Object(Y.isPromise)(T)?T.then(function(x){m(h,x,w)}):m(h,T,w);break}default:break}})}function I(h,s){if(u(s.remuxResult))return;var l=[],i=s.remuxResult,r=i.audio,n=i.video;r&&p(l,r),n&&p(l,n),h.postMessage({event:"transmuxComplete",data:s},l)}function p(h,s){s.data1&&h.push(s.data1.buffer),s.data2&&h.push(s.data2.buffer)}function m(h,s,l){s.forEach(function(i){I(h,i)}),h.postMessage({event:"flush",data:l})}function u(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n}),P.d(V,"isPromise",function(){return T}),P.d(V,"TransmuxConfig",function(){return x}),P.d(V,"TransmuxState",function(){return O});var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/crypt/decrypter.ts"),B=P("./src/demux/aacdemuxer.ts"),M=P("./src/demux/mp4demuxer.ts"),L=P("./src/demux/tsdemuxer.ts"),I=P("./src/demux/mp3demuxer.ts"),p=P("./src/remux/mp4-remuxer.ts"),m=P("./src/remux/passthrough-remuxer.ts"),u=P("./src/demux/chunk-cache.ts"),h=P("./src/utils/mp4-tools.ts"),s=P("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(E){s.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var i=[{demux:L.default,remux:p.default},{demux:M.default,remux:m.default},{demux:B.default,remux:p.default},{demux:I.default,remux:p.default}],r=1024;i.forEach(function(E){var v=E.demux;r=Math.max(r,v.minProbeByteLength)});var n=function(){function E(_,f,c,S,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new u.default,this.observer=_,this.typeSupported=f,this.config=c,this.vendor=S,this.id=y}var v=E.prototype;return v.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},v.push=function(f,c,S,y){var b=this,N=S.transmuxing;N.executeStart=l();var F=new Uint8Array(f),X=this.cache,Z=this.config,H=this.currentTransmuxState,A=this.transmuxConfig;y&&(this.currentTransmuxState=y);var z=d(F,c);if(z&&z.method==="AES-128"){var ne=this.getDecrypter();if(Z.enableSoftwareAES){var ae=ne.softwareDecrypt(F,z.key.buffer,z.iv.buffer);if(!ae)return N.executeEnd=l(),w(S);F=new Uint8Array(ae)}else return this.decryptionPromise=ne.webCryptoDecrypt(F,z.key.buffer,z.iv.buffer).then(function(ht){var xt=b.push(ht,null,S);return b.decryptionPromise=null,xt}),this.decryptionPromise}var me=y||H,xe=me.contiguous,Te=me.discontinuity,Oe=me.trackSwitch,Ue=me.accurateTimeOffset,De=me.timeOffset,be=A.audioCodec,ge=A.videoCodec,He=A.defaultInitPts,ct=A.duration,vt=A.initSegmentData;if((Te||Oe)&&this.resetInitSegment(vt,be,ge,ct),Te&&this.resetInitialTimestamp(He),xe||this.resetContiguity(),this.needsProbing(F,Te,Oe)){if(X.dataLength){var _t=X.flush();F=Object(h.appendUint8Array)(_t,F)}this.configureTransmuxer(F,A)}var yt=this.transmux(F,z,De,Ue,S),et=this.currentTransmuxState;return et.contiguous=!0,et.discontinuity=!1,et.trackSwitch=!1,N.executeEnd=l(),yt},v.flush=function(f){var c=this,S=f.transmuxing;S.executeStart=l();var y=this.decrypter,b=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(f)});var X=[],Z=N.timeOffset;if(y){var H=y.flush();H&&X.push(this.push(H,null,f))}var A=b.dataLength;b.reset();var z=this.demuxer,ne=this.remuxer;if(!z||!ne)return A>=r&&this.observer.emit(Y.Events.ERROR,Y.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=l(),[w(f)];var ae=z.flush(Z);return T(ae)?ae.then(function(me){return c.flushRemux(X,me,f),X}):(this.flushRemux(X,ae,f),X)},v.flushRemux=function(f,c,S){var y=c.audioTrack,b=c.avcTrack,N=c.id3Track,F=c.textTrack,X=this.currentTransmuxState,Z=X.accurateTimeOffset,H=X.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var A=this.remuxer.remux(y,b,N,F,H,Z,!0,this.id);f.push({remuxResult:A,chunkMeta:S}),S.transmuxing.executeEnd=l()},v.resetInitialTimestamp=function(f){var c=this.demuxer,S=this.remuxer;if(!c||!S)return;c.resetTimeStamp(f),S.resetTimeStamp(f)},v.resetContiguity=function(){var f=this.demuxer,c=this.remuxer;if(!f||!c)return;f.resetContiguity(),c.resetNextTimestamp()},v.resetInitSegment=function(f,c,S,y){var b=this.demuxer,N=this.remuxer;if(!b||!N)return;b.resetInitSegment(c,S,y),N.resetInitSegment(f,c,S)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(f,c,S,y,b){var N;return c&&c.method==="SAMPLE-AES"?N=this.transmuxSampleAes(f,c,S,y,b):N=this.transmuxUnencrypted(f,S,y,b),N},v.transmuxUnencrypted=function(f,c,S,y){var b=this.demuxer.demux(f,c,!1,!this.config.progressive),N=b.audioTrack,F=b.avcTrack,X=b.id3Track,Z=b.textTrack,H=this.remuxer.remux(N,F,X,Z,c,S,!1,this.id);return{remuxResult:H,chunkMeta:y}},v.transmuxSampleAes=function(f,c,S,y,b){var N=this;return this.demuxer.demuxSampleAes(f,c,S).then(function(F){var X=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,S,y,!1,N.id);return{remuxResult:X,chunkMeta:b}})},v.configureTransmuxer=function(f,c){for(var S=this.config,y=this.observer,b=this.typeSupported,N=this.vendor,F=c.audioCodec,X=c.defaultInitPts,Z=c.duration,H=c.initSegmentData,A=c.videoCodec,z,ne=0,ae=i.length;ne<ae;ne++)if(i[ne].demux.probe(f)){z=i[ne];break}z||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:M.default,remux:m.default});var me=this.demuxer,xe=this.remuxer,Te=z.remux,Oe=z.demux;(!xe||!(xe instanceof Te))&&(this.remuxer=new Te(y,S,b,N)),(!me||!(me instanceof Oe))&&(this.demuxer=new Oe(y,S,b),this.probe=Oe.probe),this.resetInitSegment(H,F,A,Z),this.resetInitialTimestamp(X)},v.needsProbing=function(f,c,S){return!this.demuxer||!this.remuxer||c||S},v.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new R.default(this.observer,this.config)),f},E}();function d(E,v){var _=null;return E.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(_=v),_}var w=function(v){return{remuxResult:{},chunkMeta:v}};function T(E){return"then"in E&&E.then instanceof Function}var x=function(v,_,f,c,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=_,this.initSegmentData=f,this.duration=c,this.defaultInitPts=S},O=function(v,_,f,c,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=_,this.accurateTimeOffset=f,this.trackSwitch=c,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"discardEPB",function(){return w});var Y=P("./src/demux/adts.ts"),W=P("./src/demux/mpegaudio.ts"),R=P("./src/demux/exp-golomb.ts"),B=P("./src/demux/id3.ts"),M=P("./src/demux/sample-aes.ts"),L=P("./src/events.ts"),I=P("./src/utils/mp4-tools.ts"),p=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},h=function(){function T(O,E,v){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=O,this.config=E,this.typeSupported=v}T.probe=function(E){var v=T.syncOffset(E);return v<0?!1:(v&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},T.syncOffset=function(E){for(var v=Math.min(1e3,E.length-3*188),_=0;_<v;){if(E[_]===71&&E[_+188]===71&&E[_+2*188]===71)return _;_++}return-1},T.createTrack=function(E,v){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:u[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?v:void 0}};var x=T.prototype;return x.resetInitSegment=function(E,v,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",_),this._audioTrack=T.createTrack("audio",_),this._id3Track=T.createTrack("id3",_),this._txtTrack=T.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=v,this._duration=_},x.resetTimeStamp=function(){},x.resetContiguity=function(){var E=this._audioTrack,v=this._avcTrack,_=this._id3Track;E&&(E.pesData=null),v&&(v.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(E,v,_,f){_===void 0&&(_=!1),f===void 0&&(f=!1),_||(this.sampleAes=null);var c,S=this._avcTrack,y=this._audioTrack,b=this._id3Track,N=S.pid,F=S.pesData,X=y.pid,Z=b.pid,H=y.pesData,A=b.pesData,z=!1,ne=this.pmtParsed,ae=this._pmtId,me=E.length;if(this.remainderData&&(E=Object(I.appendUint8Array)(this.remainderData,E),me=E.length,this.remainderData=null),me<188&&!f)return this.remainderData=E,{audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};var xe=Math.max(0,T.syncOffset(E));me-=(me+xe)%188,me<E.byteLength&&!f&&(this.remainderData=new Uint8Array(E.buffer,me,E.buffer.byteLength-me));for(var Te=xe;Te<me;Te+=188)if(E[Te]===71){var Oe=!!(E[Te+1]&64),Ue=((E[Te+1]&31)<<8)+E[Te+2],De=(E[Te+3]&48)>>4,be=void 0;if(De>1){if(be=Te+5+E[Te+4],be===Te+188)continue}else be=Te+4;switch(Ue){case N:Oe&&(F&&(c=r(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(E.subarray(be,Te+188)),F.size+=Te+188-be);break;case X:Oe&&(H&&(c=r(H))&&(y.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),H={data:[],size:0}),H&&(H.data.push(E.subarray(be,Te+188)),H.size+=Te+188-be);break;case Z:Oe&&(A&&(c=r(A))&&this.parseID3PES(c),A={data:[],size:0}),A&&(A.data.push(E.subarray(be,Te+188)),A.size+=Te+188-be);break;case 0:Oe&&(be+=E[be]+1),ae=this._pmtId=l(E,be);break;case ae:{Oe&&(be+=E[be]+1);var ge=i(E,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);N=ge.avc,N>0&&(S.pid=N),X=ge.audio,X>0&&(y.pid=X,y.isAAC=ge.isAAC),Z=ge.id3,Z>0&&(b.pid=Z),z&&!ne&&(p.logger.log("reparse from beginning"),z=!1,Te=xe-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=F,y.pesData=H,b.pesData=A;var He={audioTrack:y,avcTrack:S,id3Track:b,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(He),He},x.flush=function(){var E=this.remainderData;this.remainderData=null;var v;return E?v=this.demux(E,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},x.extractRemainingSamples=function(E){var v=E.audioTrack,_=E.avcTrack,f=E.id3Track,c=_.pesData,S=v.pesData,y=f.pesData,b;c&&(b=r(c))?(this.parseAVCPES(b,!0),_.pesData=null):_.pesData=c,S&&(b=r(S))?(v.isAAC?this.parseAACPES(b):this.parseMPEGPES(b),v.pesData=null):(S!=null&&S.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=S),y&&(b=r(y))?(this.parseID3PES(b),f.pesData=null):f.pesData=y},x.demuxSampleAes=function(E,v,_){var f=this.demux(E,_,!0,!this.config.progressive),c=this.sampleAes=new M.default(this.observer,this.config,v);return this.decrypt(f,c)},x.decrypt=function(E,v){return new Promise(function(_){var f=E.audioTrack,c=E.avcTrack;f.samples&&f.isAAC?v.decryptAacSamples(f.samples,0,function(){c.samples?v.decryptAvcSamples(c.samples,0,0,function(){_(E)}):_(E)}):c.samples&&v.decryptAvcSamples(c.samples,0,0,function(){_(E)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(E,v){var _=this,f=this._avcTrack,c=this.parseAVCNALu(E.data),S=!1,y=this.avcSample,b,N=!1;E.data=null,y&&c.length&&!f.audFound&&(n(y,f),y=this.avcSample=s(!1,E.pts,E.dts,"")),c.forEach(function(F){switch(F.type){case 1:{b=!0,y||(y=_.avcSample=s(!0,E.pts,E.dts,"")),S&&(y.debug+="NDR "),y.frame=!0;var X=F.data;if(N&&X.length>4){var Z=new R.default(X).readSliceType();(Z===2||Z===4||Z===7||Z===9)&&(y.key=!0)}break}case 5:b=!0,y||(y=_.avcSample=s(!0,E.pts,E.dts,"")),S&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{b=!0,S&&y&&(y.debug+="SEI ");var H=new R.default(w(F.data));H.readUByte();for(var A=0,z=0,ne=!1,ae=0;!ne&&H.bytesAvailable>1;){A=0;do ae=H.readUByte(),A+=ae;while(ae===255);z=0;do ae=H.readUByte(),z+=ae;while(ae===255);if(A===4&&H.bytesAvailable!==0){ne=!0;var me=H.readUByte();if(me===181){var xe=H.readUShort();if(xe===49){var Te=H.readUInt();if(Te===1195456820){var Oe=H.readUByte();if(Oe===3){for(var Ue=H.readUByte(),De=H.readUByte(),be=31&Ue,ge=[Ue,De],He=0;He<be;He++)ge.push(H.readUByte()),ge.push(H.readUByte()),ge.push(H.readUByte());d(_._txtTrack.samples,{type:3,pts:E.pts,bytes:ge})}}}}}else if(A===5&&H.bytesAvailable!==0){if(ne=!0,z>16){for(var ct=[],vt=0;vt<16;vt++)ct.push(H.readUByte().toString(16)),(vt===3||vt===5||vt===7||vt===9)&&ct.push("-");for(var _t=z-16,yt=new Uint8Array(_t),et=0;et<_t;et++)yt[et]=H.readUByte();d(_._txtTrack.samples,{pts:E.pts,payloadType:A,uuid:ct.join(""),userData:Object(B.utf8ArrayToStr)(yt),userDataBytes:yt})}}else if(z<H.bytesAvailable)for(var ht=0;ht<z;ht++)H.readUByte()}break}case 7:if(b=!0,N=!0,S&&y&&(y.debug+="SPS "),!f.sps){var xt=new R.default(F.data),Tt=xt.readSPS();f.width=Tt.width,f.height=Tt.height,f.pixelRatio=Tt.pixelRatio,f.sps=[F.data],f.duration=_._duration;for(var mt=F.data.subarray(1,4),Ie="avc1.",je=0;je<3;je++){var $e=mt[je].toString(16);$e.length<2&&($e="0"+$e),Ie+=$e}f.codec=Ie}break;case 8:b=!0,S&&y&&(y.debug+="PPS "),f.pps||(f.pps=[F.data]);break;case 9:b=!1,f.audFound=!0,y&&n(y,f),y=_.avcSample=s(!1,E.pts,E.dts,S?"AUD ":"");break;case 12:b=!1;break;default:b=!1,y&&(y.debug+="unknown NAL "+F.type+" ");break}if(y&&b){var at=y.units;at.push(F)}}),v&&y&&(n(y,f),this.avcSample=null)},x.getLastNalUnit=function(){var E,v=this.avcSample,_;if(!v||v.units.length===0){var f=this._avcTrack.samples;v=f[f.length-1]}if((E=v)!==null&&E!==void 0&&E.units){var c=v.units;_=c[c.length-1]}return _},x.parseAVCNALu=function(E){var v=E.byteLength,_=this._avcTrack,f=_.naluState||0,c=f,S=[],y=0,b,N,F,X=-1,Z=0;for(f===-1&&(X=0,Z=E[0]&31,f=0,y=1);y<v;){if(b=E[y++],!f){f=b?0:1;continue}if(f===1){f=b?0:2;continue}if(!b)f=3;else if(b===1){if(X>=0){var H={data:E.subarray(X,y-f-1),type:Z};S.push(H)}else{var A=this.getLastNalUnit();if(A&&(c&&y<=4-c&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-c))),N=y-f-1,N>0)){var z=new Uint8Array(A.data.byteLength+N);z.set(A.data,0),z.set(E.subarray(0,N),A.data.byteLength),A.data=z,A.state=0}}y<v?(F=E[y]&31,X=y,Z=F,f=0):f=-1}else f=0}if(X>=0&&f>=0){var ne={data:E.subarray(X,v),type:Z,state:f};S.push(ne)}if(S.length===0){var ae=this.getLastNalUnit();if(ae){var me=new Uint8Array(ae.data.byteLength+E.byteLength);me.set(ae.data,0),me.set(E,ae.data.byteLength),ae.data=me}}return _.naluState=f,S},x.parseAACPES=function(E){var v=0,_=this._audioTrack,f=this.aacOverFlow,c=E.data;if(f){this.aacOverFlow=null;var S=f.sample.unit.byteLength,y=Math.min(f.missing,S),b=S-y;f.sample.unit.set(c.subarray(0,y),b),_.samples.push(f.sample),v=f.missing}var N,F;for(N=v,F=c.length;N<F-1&&!Y.isHeader(c,N);N++);if(N!==v){var X,Z;if(N<F-1?(X="AAC PES did not start with ADTS header,offset:"+N,Z=!1):(X="no ADTS header found in AAC PES",Z=!0),p.logger.warn("parsing error:"+X),this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:Z,reason:X}),Z)return}Y.initTrackConfig(_,this.observer,c,N,this.audioCodec);var H;if(E.pts!==void 0)H=E.pts;else if(f){var A=Y.getFrameDuration(_.samplerate);H=f.sample.pts+A}else{p.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;N<F;)if(Y.isHeader(c,N)){if(N+5<F){var ne=Y.appendFrame(_,c,N,H,z);if(ne)if(ne.missing)this.aacOverFlow=ne;else{N+=ne.length,z++;continue}}break}else N++},x.parseMPEGPES=function(E){var v=E.data,_=v.length,f=0,c=0,S=E.pts;if(S===void 0){p.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<_;)if(W.isHeader(v,c)){var y=W.appendFrame(this._audioTrack,v,c,S,f);if(y)c+=y.length,f++;else break}else c++},x.parseID3PES=function(E){if(E.pts===void 0){p.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},T}();h.minProbeByteLength=188;function s(T,x,O,E){return{key:T,frame:!1,pts:x,dts:O,units:[],debug:E,length:0}}function l(T,x){return(T[x+10]&31)<<8|T[x+11]}function i(T,x,O,E){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(T[x+1]&15)<<8|T[x+2],f=x+3+_-4,c=(T[x+10]&15)<<8|T[x+11];for(x+=12+c;x<f;){var S=(T[x+1]&31)<<8|T[x+2];switch(T[x]){case 207:if(!E){p.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=S);break;case 21:v.id3===-1&&(v.id3=S);break;case 219:if(!E){p.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=S);break;case 3:case 4:O?v.audio===-1&&(v.audio=S,v.isAAC=!1):p.logger.log("MPEG audio found, not supported in this browser");break;case 36:p.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((T[x+3]&15)<<8|T[x+4])+5}return v}function r(T){var x=0,O,E,v,_,f,c=T.data;if(!T||T.size===0)return null;for(;c[0].length<19&&c.length>1;){var S=new Uint8Array(c[0].length+c[1].length);S.set(c[0]),S.set(c[1],c[0].length),c[0]=S,c.splice(1,1)}O=c[0];var y=(O[0]<<16)+(O[1]<<8)+O[2];if(y===1){if(E=(O[4]<<8)+O[5],E&&E>T.size-6)return null;var b=O[7];b&192&&(_=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,b&64?(f=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,_-f>60*9e4&&(p.logger.warn(Math.round((_-f)/9e4)+"s delta between PTS and DTS, align them"),_=f)):f=_),v=O[8];var N=v+9;if(T.size<=N)return null;T.size-=N;for(var F=new Uint8Array(T.size),X=0,Z=c.length;X<Z;X++){O=c[X];var H=O.byteLength;if(N)if(N>H){N-=H;continue}else O=O.subarray(N),H-=N,N=0;F.set(O,x),x+=H}return E&&(E-=v+3),{data:F,pts:_,dts:f,len:E}}return null}function n(T,x){if(T.units.length&&T.frame){if(T.pts===void 0){var O=x.samples,E=O.length;if(E){var v=O[E-1];T.pts=v.pts,T.dts=v.dts}else{x.dropped++;return}}x.samples.push(T)}T.debug.length&&p.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function d(T,x){var O=T.length;if(O>0){if(x.pts>=T[O-1].pts)T.push(x);else for(var E=O-1;E>=0;E--)if(x.pts<T[E].pts){T.splice(E,0,x);break}}else T.push(x)}function w(T){for(var x=T.byteLength,O=[],E=1;E<x-2;)T[E]===0&&T[E+1]===0&&T[E+2]===3?(O.push(E+2),E+=2):E++;if(O.length===0)return T;var v=x-O.length,_=new Uint8Array(v),f=0;for(E=0;E<v;f++,E++)f===O[0]&&(f++,O.shift()),_[E]=T[f];return _}V.default=h},"./src/errors.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"ErrorTypes",function(){return Y}),P.d(V,"ErrorDetails",function(){return W});var Y;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(Y||(Y={}));var W;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(W||(W={}))},"./src/events.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"Events",function(){return Y});var Y;(function(W){W.MEDIA_ATTACHING="hlsMediaAttaching",W.MEDIA_ATTACHED="hlsMediaAttached",W.MEDIA_DETACHING="hlsMediaDetaching",W.MEDIA_DETACHED="hlsMediaDetached",W.BUFFER_RESET="hlsBufferReset",W.BUFFER_CODECS="hlsBufferCodecs",W.BUFFER_CREATED="hlsBufferCreated",W.BUFFER_APPENDING="hlsBufferAppending",W.BUFFER_APPENDED="hlsBufferAppended",W.BUFFER_EOS="hlsBufferEos",W.BUFFER_FLUSHING="hlsBufferFlushing",W.BUFFER_FLUSHED="hlsBufferFlushed",W.MANIFEST_LOADING="hlsManifestLoading",W.MANIFEST_LOADED="hlsManifestLoaded",W.MANIFEST_PARSED="hlsManifestParsed",W.LEVEL_SWITCHING="hlsLevelSwitching",W.LEVEL_SWITCHED="hlsLevelSwitched",W.LEVEL_LOADING="hlsLevelLoading",W.LEVEL_LOADED="hlsLevelLoaded",W.LEVEL_UPDATED="hlsLevelUpdated",W.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",W.LEVELS_UPDATED="hlsLevelsUpdated",W.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",W.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",W.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",W.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",W.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",W.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",W.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",W.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",W.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",W.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",W.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",W.CUES_PARSED="hlsCuesParsed",W.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",W.INIT_PTS_FOUND="hlsInitPtsFound",W.FRAG_LOADING="hlsFragLoading",W.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",W.FRAG_LOADED="hlsFragLoaded",W.FRAG_DECRYPTED="hlsFragDecrypted",W.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",W.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",W.FRAG_PARSING_METADATA="hlsFragParsingMetadata",W.FRAG_PARSED="hlsFragParsed",W.FRAG_BUFFERED="hlsFragBuffered",W.FRAG_CHANGED="hlsFragChanged",W.FPS_DROP="hlsFpsDrop",W.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",W.ERROR="hlsError",W.DESTROYING="hlsDestroying",W.KEY_LOADING="hlsKeyLoading",W.KEY_LOADED="hlsKeyLoaded",W.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",W.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Y||(Y={}))},"./src/hls.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return T});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),W=P.n(Y),R=P("./src/loader/playlist-loader.ts"),B=P("./src/loader/key-loader.ts"),M=P("./src/controller/id3-track-controller.ts"),L=P("./src/controller/latency-controller.ts"),I=P("./src/controller/level-controller.ts"),p=P("./src/controller/fragment-tracker.ts"),m=P("./src/controller/stream-controller.ts"),u=P("./src/is-supported.ts"),h=P("./src/utils/logger.ts"),s=P("./src/config.ts"),l=P("./node_modules/eventemitter3/index.js"),i=P.n(l),r=P("./src/events.ts"),n=P("./src/errors.ts");function d(x,O){for(var E=0;E<O.length;E++){var v=O[E];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(x,v.key,v)}}function w(x,O,E){return O&&d(x.prototype,O),E&&d(x,E),x}var T=function(){x.isSupported=function(){return Object(u.isSupported)()};function x(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var v=this.config=Object(s.mergeConfig)(x.DefaultConfig,E);this.userConfig=E,Object(h.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(s.enableStreamingMode)(v);var _=v.abrController,f=v.bufferController,c=v.capLevelController,S=v.fpsController,y=this.abrController=new _(this),b=this.bufferController=new f(this),N=this.capLevelController=new c(this),F=new S(this),X=new R.default(this),Z=new B.default(this),H=new M.default(this),A=this.levelController=new I.default(this),z=new p.FragmentTracker(this),ne=this.streamController=new m.default(this,z);N.setStreamController(ne),F.setStreamController(ne);var ae=[A,ne];this.networkControllers=ae;var me=[X,Z,y,b,N,F,H,z];this.audioTrackController=this.createController(v.audioTrackController,null,ae),this.createController(v.audioStreamController,z,ae),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,ae),this.createController(v.subtitleStreamController,z,ae),this.createController(v.timelineController,null,me),this.emeController=this.createController(v.emeController,null,me),this.cmcdController=this.createController(v.cmcdController,null,me),this.latencyController=this.createController(L.default,null,me),this.coreComponents=me}var O=x.prototype;return O.createController=function(v,_,f){if(v){var c=_?new v(this,_):new v(this);return f&&f.push(c),c}return null},O.on=function(v,_,f){f===void 0&&(f=this),this._emitter.on(v,_,f)},O.once=function(v,_,f){f===void 0&&(f=this),this._emitter.once(v,_,f)},O.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},O.off=function(v,_,f,c){f===void 0&&(f=this),this._emitter.off(v,_,f,c)},O.listeners=function(v){return this._emitter.listeners(v)},O.emit=function(v,_,f){return this._emitter.emit(v,_,f)},O.trigger=function(v,_){if(this.config.debug)return this.emit(v,v,_);try{return this.emit(v,v,_)}catch(f){h.logger.error("An internal error happened while handling event "+v+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(r.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:f})}return!1},O.listenerCount=function(v){return this._emitter.listenerCount(v)},O.destroy=function(){h.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},O.attachMedia=function(v){h.logger.log("attachMedia"),this._media=v,this.trigger(r.Events.MEDIA_ATTACHING,{media:v})},O.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(v){this.stopLoad();var _=this.media,f=this.url,c=this.url=Y.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});h.logger.log("loadSource:"+c),_&&f&&f!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(r.Events.MANIFEST_LOADING,{url:v})},O.startLoad=function(v){v===void 0&&(v=-1),h.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(_){_.startLoad(v)})},O.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},O.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){h.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},O.removeLevel=function(v,_){_===void 0&&(_=0),this.levelController.removeLevel(v,_)},w(x,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){h.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){h.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){h.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){h.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){h.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var _=!!v;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(h.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,_=this.config.minAutoBitrate;if(!v)return 0;for(var f=v.length,c=0;c<f;c++)if(v[c].maxBitrate>_)return c;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,_=this.autoLevelCapping,f;return _===-1&&v&&v.length?f=v.length-1:f=_,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var _=this.audioTrackController;_&&(_.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var _=this.subtitleTrackController;_&&(_.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{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 r.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(v){x.defaultConfig=v}}]),x}();T.defaultConfig=void 0},"./src/is-supported.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isSupported",function(){return R}),P.d(V,"changeTypeSupported",function(){return B});var Y=P("./src/utils/mediasource-helper.ts");function W(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var M=Object(Y.getMediaSource)();if(!M)return!1;var L=W(),I=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!I&&!!p}function B(){var M,L=W();return typeof(L==null||((M=L.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return h}),P.d(V,"LoadError",function(){return l});var Y=P("./src/polyfills/number.ts"),W=P("./src/errors.ts");function R(i,r){i.prototype=Object.create(r.prototype),i.prototype.constructor=i,p(i,r)}function B(i){var r=typeof Map=="function"?new Map:void 0;return B=function(d){if(d===null||!I(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(d))return r.get(d);r.set(d,w)}function w(){return M(d,arguments,m(this).constructor)}return w.prototype=Object.create(d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p(w,d)},B(i)}function M(i,r,n){return L()?M=Reflect.construct:M=function(w,T,x){var O=[null];O.push.apply(O,T);var E=Function.bind.apply(w,O),v=new E;return x&&p(v,x.prototype),v},M.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function I(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function p(i,r){return p=Object.setPrototypeOf||function(d,w){return d.__proto__=w,d},p(i,r)}function m(i){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},m(i)}var u=Math.pow(2,17),h=function(){function i(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var r=i.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(d,w){var T=this,x=d.url;if(!x)return Promise.reject(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var O=this.config,E=O.fLoader,v=O.loader;return new Promise(function(_,f){T.loader&&T.loader.destroy();var c=T.loader=d.loader=E?new E(O):new v(O),S=s(d),y={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:u};d.stats=c.stats,c.load(S,y,{onSuccess:function(N,F,X,Z){T.resetLoader(d,c),_({frag:d,part:null,payload:N.data,networkDetails:Z})},onError:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:N,networkDetails:X}))},onAbort:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:X}))},onTimeout:function(N,F,X){T.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:X}))},onProgress:function(N,F,X,Z){w&&w({frag:d,part:null,payload:X,networkDetails:Z})}})})},r.loadPart=function(d,w,T){var x=this;this.abort();var O=this.config,E=O.fLoader,v=O.loader;return new Promise(function(_,f){x.loader&&x.loader.destroy();var c=x.loader=d.loader=E?new E(O):new v(O),S=s(d,w),y={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:u};w.stats=c.stats,c.load(S,y,{onSuccess:function(N,F,X,Z){x.resetLoader(d,c),x.updateStatsFromPart(d,w);var H={frag:d,part:w,payload:N.data,networkDetails:Z};T(H),_(H)},onError:function(N,F,X){x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:w,response:N,networkDetails:X}))},onAbort:function(N,F,X){d.stats.aborted=w.stats.aborted,x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:w,networkDetails:X}))},onTimeout:function(N,F,X){x.resetLoader(d,c),f(new l({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:w,networkDetails:X}))}})})},r.updateStatsFromPart=function(d,w){var T=d.stats,x=w.stats,O=x.total;if(T.loaded+=x.loaded,O){var E=Math.round(d.duration/w.duration),v=Math.min(Math.round(T.loaded/O),E),_=E-v,f=_*Math.round(T.loaded/v);T.total=T.loaded+f}else T.total=Math.max(T.loaded,T.total);var c=T.loading,S=x.loading;c.start?c.first+=S.first-S.start:(c.start=S.start,c.first=S.first),c.end=S.end},r.resetLoader=function(d,w){d.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},i}();function s(i,r){r===void 0&&(r=null);var n=r||i,d={frag:i,part:r,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},w=n.byteRangeStartOffset,T=n.byteRangeEndOffset;return Object(Y.isFiniteNumber)(w)&&Object(Y.isFiniteNumber)(T)&&(d.rangeStart=w,d.rangeEnd=T),d}var l=function(i){R(r,i);function r(n){for(var d,w=arguments.length,T=new Array(w>1?w-1:0),x=1;x<w;x++)T[x-1]=arguments[x];return d=i.call.apply(i,[this].concat(T))||this,d.data=void 0,d.data=n,d}return r}(B(Error))},"./src/loader/fragment.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"ElementaryStreamTypes",function(){return h}),P.d(V,"BaseSegment",function(){return s}),P.d(V,"Fragment",function(){return l}),P.d(V,"Part",function(){return i});var Y=P("./src/polyfills/number.ts"),W=P("./node_modules/url-toolkit/src/url-toolkit.js"),R=P.n(W),B=P("./src/utils/logger.ts"),M=P("./src/loader/level-key.ts"),L=P("./src/loader/load-stats.ts");function I(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,p(r,n)}function p(r,n){return p=Object.setPrototypeOf||function(w,T){return w.__proto__=T,w},p(r,n)}function m(r,n){for(var d=0;d<n.length;d++){var w=n[d];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(r,w.key,w)}}function u(r,n,d){return n&&m(r.prototype,n),d&&m(r,d),r}var h;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(h||(h={}));var s=function(){function r(d){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[h.AUDIO]=null,w[h.VIDEO]=null,w[h.AUDIOVIDEO]=null,w),this.baseurl=d}var n=r.prototype;return n.setByteRange=function(w,T){var x=w.split("@",2),O=[];x.length===1?O[0]=T?T.byteRangeEndOffset:0:O[0]=parseInt(x[1]),O[1]=parseInt(x[0])+O[0],this._byteRange=O},u(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(W.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),r}(),l=function(r){I(n,r);function n(w,T){var x;return x=r.call(this,T)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new L.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=w,x}var d=n.prototype;return d.createInitializationVector=function(T){for(var x=new Uint8Array(16),O=12;O<16;O++)x[O]=T>>8*(15-O)&255;return x},d.setDecryptDataFromLevelKey=function(T,x){var O=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(O=M.LevelKey.fromURI(T.uri),O.method=T.method,O.iv=this.createInitializationVector(x),O.keyFormat="identity"),O},d.setElementaryStreamInfo=function(T,x,O,E,v,_){_===void 0&&(_=!1);var f=this.elementaryStreams,c=f[T];if(!c){f[T]={startPTS:x,endPTS:O,startDTS:E,endDTS:v,partial:_};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,E),c.endDTS=Math.max(c.endDTS,v)},d.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[h.AUDIO]=null,T[h.VIDEO]=null,T[h.AUDIOVIDEO]=null},u(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Y.isFiniteNumber)(this.programDateTime))return null;var T=Object(Y.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),n}(s),i=function(r){I(n,r);function n(d,w,T,x,O){var E;E=r.call(this,T)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new L.LoadStats,E.duration=d.decimalFloatingPoint("DURATION"),E.gap=d.bool("GAP"),E.independent=d.bool("INDEPENDENT"),E.relurl=d.enumeratedString("URI"),E.fragment=w,E.index=x;var v=d.enumeratedString("BYTERANGE");return v&&E.setByteRange(v,O),O&&(E.fragOffset=O.fragOffset+O.duration),E}return u(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var w=this.elementaryStreams;return!!(w.audio||w.video||w.audiovideo)}}]),n}(s)},"./src/loader/key-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return B});var Y=P("./src/events.ts"),W=P("./src/errors.ts"),R=P("./src/utils/logger.ts"),B=function(){function M(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var L=M.prototype;return L._registerListeners=function(){this.hls.on(Y.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(Y.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var m=this.loaders[p];m&&m.destroy()}this.loaders={}},L.onKeyLoading=function(p,m){var u=m.frag,h=u.type,s=this.loaders[h];if(!u.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=u.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(s&&(R.logger.warn("abort previous key loader for type:"+h),s.abort()),!l){R.logger.warn("key uri is falsy");return}var r=i.loader,n=u.loader=this.loaders[h]=new r(i);this.decrypturl=l,this.decryptkey=null;var d={url:l,frag:u,responseType:"arraybuffer"},w={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(d,w,T)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(Y.Events.KEY_LOADED,{frag:u}))},L.loadsuccess=function(p,m,u){var h=u.frag;if(!h.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(p.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(Y.Events.KEY_LOADED,{frag:h})},L.loaderror=function(p,m){var u=m.frag,h=u.loader;h&&h.abort(),delete this.loaders[u.type],this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:p})},L.loadtimeout=function(p,m){var u=m.frag,h=u.loader;h&&h.abort(),delete this.loaders[u.type],this.hls.trigger(Y.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},M}()},"./src/loader/level-details.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"LevelDetails",function(){return M});var Y=P("./src/polyfills/number.ts");function W(L,I){for(var p=0;p<I.length;p++){var m=I[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(L,m.key,m)}}function R(L,I,p){return I&&W(L.prototype,I),p&&W(L,p),L}var B=10,M=function(){function L(p){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=p}var I=L.prototype;return I.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var u=this.lastPartSn-m.lastPartSn,h=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!h||!!u,this.advanced=this.endSN>m.endSN||u>0||u===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},R(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Y.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var u=this.driftEnd-this.driftStart;return u*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"LevelKey",function(){return M});var Y=P("./node_modules/url-toolkit/src/url-toolkit.js"),W=P.n(Y);function R(L,I){for(var p=0;p<I.length;p++){var m=I[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(L,m.key,m)}}function B(L,I,p){return I&&R(L.prototype,I),p&&R(L,p),L}var M=function(){L.fromURL=function(p,m){return new L(p,m)},L.fromURI=function(p){return new L(p)};function L(I,p){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,p?this._uri=Object(Y.buildAbsoluteURL)(I,p,{alwaysNormalize:!0}):this._uri=I}return B(L,[{key:"uri",get:function(){return this._uri}}]),L}()},"./src/loader/load-stats.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"LoadStats",function(){return Y});var Y=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n});var Y=P("./src/polyfills/number.ts"),W=P("./node_modules/url-toolkit/src/url-toolkit.js"),R=P.n(W),B=P("./src/loader/fragment.ts"),M=P("./src/loader/level-details.ts"),L=P("./src/loader/level-key.ts"),I=P("./src/utils/attr-list.ts"),p=P("./src/utils/logger.ts"),m=P("./src/utils/codecs.ts"),u=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function r(O){var E,v;return i.test((E=(v=W.parseURL(O))===null||v===void 0?void 0:v.path)!=null?E:"")}var n=function(){function O(){}return O.findGroup=function(v,_){for(var f=0;f<v.length;f++){var c=v[f];if(c.id===_)return c}},O.convertAVC1ToAVCOTI=function(v){var _=v.split(".");if(_.length>2){var f=_.shift()+".";return f+=parseInt(_.shift()).toString(16),f+=("000"+parseInt(_.shift()).toString(16)).substr(-4),f}return v},O.resolve=function(v,_){return W.buildAbsoluteURL(_,v,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(v,_){var f=[],c={},S=!1;u.lastIndex=0;for(var y;(y=u.exec(v))!=null;)if(y[1]){var b=new I.AttrList(y[1]),N={attrs:b,bitrate:b.decimalInteger("AVERAGE-BANDWIDTH")||b.decimalInteger("BANDWIDTH"),name:b.NAME,url:O.resolve(y[2],_)},F=b.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),d((b.CODECS||"").split(/[ ,]+/).filter(function(Z){return Z}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=O.convertAVC1ToAVCOTI(N.videoCodec)),f.push(N)}else if(y[3]){var X=new I.AttrList(y[3]);X["DATA-ID"]&&(S=!0,c[X["DATA-ID"]]=X)}return{levels:f,sessionData:S?c:null}},O.parseMasterPlaylistMedia=function(v,_,f,c){c===void 0&&(c=[]);var S,y=[],b=0;for(h.lastIndex=0;(S=h.exec(v))!==null;){var N=new I.AttrList(S[1]);if(N.TYPE===f){var F={attrs:N,bitrate:0,id:b++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:f,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?O.resolve(N.URI,_):""};if(c.length){var X=O.findGroup(c,F.groupId)||c[0];w(F,X,"audioCodec"),w(F,X,"textCodec")}y.push(F)}}return y},O.parseLevelPlaylist=function(v,_,f,c,S){var y=new M.LevelDetails(_),b=y.fragments,N=null,F=0,X=0,Z=0,H=0,A=null,z=new B.Fragment(c,_),ne,ae,me,xe=-1,Te=!1;for(s.lastIndex=0,y.m3u8=v;(ne=s.exec(v))!==null;){Te&&(Te=!1,z=new B.Fragment(c,_),z.start=Z,z.sn=F,z.cc=H,z.level=f,N&&(z.initSegment=N,z.rawProgramDateTime=N.rawProgramDateTime));var Oe=ne[1];if(Oe){z.duration=parseFloat(Oe);var Ue=(" "+ne[2]).slice(1);z.title=Ue||null,z.tagList.push(Ue?["INF",Oe,Ue]:["INF",Oe])}else if(ne[3])Object(Y.isFiniteNumber)(z.duration)&&(z.start=Z,me&&(z.levelkey=me),z.sn=F,z.level=f,z.cc=H,z.urlId=S,b.push(z),z.relurl=(" "+ne[3]).slice(1),x(z,A),A=z,Z+=z.duration,F++,X=0,Te=!0);else if(ne[4]){var De=(" "+ne[4]).slice(1);A?z.setByteRange(De,A):z.setByteRange(De)}else if(ne[5])z.rawProgramDateTime=(" "+ne[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),xe===-1&&(xe=b.length);else{if(ne=ne[0].match(l),!ne){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<ne.length&&!(typeof ne[ae]!="undefined");ae++);var be=(" "+ne[ae]).slice(1),ge=(" "+ne[ae+1]).slice(1),He=ne[ae+2]?(" "+ne[ae+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":y.type=ge.toUpperCase();break;case"MEDIA-SEQUENCE":F=y.startSN=parseInt(ge);break;case"SKIP":{var ct=new I.AttrList(ge),vt=ct.decimalInteger("SKIPPED-SEGMENTS");if(Object(Y.isFiniteNumber)(vt)){y.skippedSegments=vt;for(var _t=vt;_t--;)b.unshift(null);F+=vt}var yt=ct.enumeratedString("RECENTLY-REMOVED-DATERANGES");yt&&(y.recentlyRemovedDateranges=yt.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ge);break;case"VERSION":y.version=parseInt(ge);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ge||He)&&z.tagList.push(He?[ge,He]:[ge]);break;case"DIS":H++;case"GAP":z.tagList.push([be]);break;case"BITRATE":z.tagList.push([be,ge]);break;case"DISCONTINUITY-SEQ":H=parseInt(ge);break;case"KEY":{var et,ht=new I.AttrList(ge),xt=ht.enumeratedString("METHOD"),Tt=ht.URI,mt=ht.hexadecimalInteger("IV"),Ie=ht.enumeratedString("KEYFORMATVERSIONS"),je=ht.enumeratedString("KEYID"),$e=(et=ht.enumeratedString("KEYFORMAT"))!=null?et:"identity",at=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(at.indexOf($e)>-1){p.logger.warn("Keyformat "+$e+" is not supported from the manifest");continue}else if($e!=="identity")continue;xt&&(me=L.LevelKey.fromURL(_,Tt),Tt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(xt)>=0&&(me.method=xt,me.keyFormat=$e,je&&(me.keyID=je),Ie&&(me.keyFormatVersions=Ie),me.iv=mt));break}case"START":{var lt=new I.AttrList(ge),bt=lt.decimalFloatingPoint("TIME-OFFSET");Object(Y.isFiniteNumber)(bt)&&(y.startTimeOffset=bt);break}case"MAP":{var Mt=new I.AttrList(ge);z.relurl=Mt.URI,Mt.BYTERANGE&&z.setByteRange(Mt.BYTERANGE),z.level=f,z.sn="initSegment",me&&(z.levelkey=me),z.initSegment=null,N=z,Te=!0;break}case"SERVER-CONTROL":{var jt=new I.AttrList(ge);y.canBlockReload=jt.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=jt.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&jt.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=jt.optionalFloat("PART-HOLD-BACK",0),y.holdBack=jt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Me=new I.AttrList(ge);y.partTarget=Me.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Pe=y.partList;Pe||(Pe=y.partList=[]);var tt=X>0?Pe[Pe.length-1]:void 0,rt=X++,Fe=new B.Part(new I.AttrList(ge),z,_,rt,tt);Pe.push(Fe),z.duration+=Fe.duration;break}case"PRELOAD-HINT":{var Je=new I.AttrList(ge);y.preloadHint=Je;break}case"RENDITION-REPORT":{var Ee=new I.AttrList(ge);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Ee);break}default:p.logger.warn("line parsed but not handled: "+ne);break}}}A&&!A.relurl?(b.pop(),Z-=A.duration,y.partList&&(y.fragmentHint=A)):y.partList&&(x(z,A),z.cc=H,y.fragmentHint=z);var ye=b.length,_e=b[0],le=b[ye-1];if(Z+=y.skippedSegments*y.targetduration,Z>0&&ye&&le){y.averagetargetduration=Z/ye;var de=le.sn;y.endSN=de!=="initSegment"?de:0,_e&&(y.startCC=_e.cc,_e.initSegment||y.fragments.every(function(ve){return ve.relurl&&r(ve.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new B.Fragment(c,_),z.relurl=le.relurl,z.level=f,z.sn="initSegment",_e.initSegment=z,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(Z+=y.fragmentHint.duration),y.totalduration=Z,y.endCC=H,xe>0&&T(b,xe),y},O}();function d(O,E){["video","audio","text"].forEach(function(v){var _=O.filter(function(c){return Object(m.isCodecType)(c,v)});if(_.length){var f=_.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});E[v+"Codec"]=f.length>0?f[0]:_[0],O=O.filter(function(c){return _.indexOf(c)===-1})}}),E.unknownCodecs=O}function w(O,E,v){var _=E[v];_&&(O[v]=_)}function T(O,E){for(var v=O[E],_=E;_--;){var f=O[_];if(!f)return;f.programDateTime=v.programDateTime-f.duration*1e3,v=f}}function x(O,E){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):E!=null&&E.programDateTime&&(O.programDateTime=E.endProgramDateTime),Object(Y.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/polyfills/number.ts"),W=P("./src/events.ts"),R=P("./src/errors.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/mp4-tools.ts"),L=P("./src/loader/m3u8-parser.ts"),I=P("./src/types/loader.ts"),p=P("./src/utils/attr-list.ts");function m(s){var l=s.type;switch(l){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function u(s,l){var i=s.url;return(i===void 0||i.indexOf("data:")===0)&&(i=l.url),i}var h=function(){function s(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var l=s.prototype;return l.registerListeners=function(){var r=this.hls;r.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(r){var n=this.hls.config,d=n.pLoader,w=n.loader,T=d||w,x=new T(n);return r.loader=x,this.loaders[r.type]=x,x},l.getInternalLoader=function(r){return this.loaders[r.type]},l.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},l.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(r,n){var d=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},l.onLevelLoading=function(r,n){var d=n.id,w=n.level,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:null,level:w,responseType:"text",type:I.PlaylistContextType.LEVEL,url:T,deliveryDirectives:x})},l.onAudioTrackLoading=function(r,n){var d=n.id,w=n.groupId,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:x})},l.onSubtitleTrackLoading=function(r,n){var d=n.id,w=n.groupId,T=n.url,x=n.deliveryDirectives;this.load({id:d,groupId:w,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:x})},l.load=function(r){var n,d=this.hls.config,w=this.getInternalLoader(r);if(w){var T=w.context;if(T&&T.url===r.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),w.abort()}var x,O,E,v;switch(r.type){case I.PlaylistContextType.MANIFEST:x=d.manifestLoadingMaxRetry,O=d.manifestLoadingTimeOut,E=d.manifestLoadingRetryDelay,v=d.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,O=d.levelLoadingTimeOut;break;default:x=d.levelLoadingMaxRetry,O=d.levelLoadingTimeOut,E=d.levelLoadingRetryDelay,v=d.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(r),(n=r.deliveryDirectives)!==null&&n!==void 0&&n.part){var _;if(r.type===I.PlaylistContextType.LEVEL&&r.level!==null?_=this.hls.levels[r.level].details:r.type===I.PlaylistContextType.AUDIO_TRACK&&r.id!==null?_=this.hls.audioTracks[r.id].details:r.type===I.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(_=this.hls.subtitleTracks[r.id].details),_){var f=_.partTarget,c=_.targetduration;f&&c&&(O=Math.min(Math.max(f*3,c*.8)*1e3,O))}}var S={timeout:O,maxRetry:x,retryDelay:E,maxRetryDelay:v,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(r,S,y)},l.loadsuccess=function(r,n,d,w){if(w===void 0&&(w=null),d.isSidxRequest){this.handleSidxRequest(r,d),this.handlePlaylistLoaded(r,n,d,w);return}this.resetInternalLoader(d.type);var T=r.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,d,"no EXTM3U delimiter",w);return}n.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,d,w):this.handleMasterPlaylist(r,n,d,w)},l.loaderror=function(r,n,d){d===void 0&&(d=null),this.handleNetworkError(n,d,!1,r)},l.loadtimeout=function(r,n,d){d===void 0&&(d=null),this.handleNetworkError(n,d,!0)},l.handleMasterPlaylist=function(r,n,d,w){var T=this.hls,x=r.data,O=u(r,d),E=L.default.parseMasterPlaylist(x,O),v=E.levels,_=E.sessionData;if(!v.length){this.handleManifestParsingError(r,d,"no level found in manifest",w);return}var f=v.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=v.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),S=L.default.parseMasterPlaylistMedia(x,O,"AUDIO",f),y=L.default.parseMasterPlaylistMedia(x,O,"SUBTITLES",c),b=L.default.parseMasterPlaylistMedia(x,O,"CLOSED-CAPTIONS");if(S.length){var N=S.some(function(F){return!F.url});!N&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}T.trigger(W.Events.MANIFEST_LOADED,{levels:v,audioTracks:S,subtitles:y,captions:b,url:O,stats:n,networkDetails:w,sessionData:_})},l.handleTrackOrLevelPlaylist=function(r,n,d,w){var T=this.hls,x=d.id,O=d.level,E=d.type,v=u(r,d),_=Object(Y.isFiniteNumber)(x)?x:0,f=Object(Y.isFiniteNumber)(O)?O:_,c=m(d),S=L.default.parseLevelPlaylist(r.data,v,f,c,_);if(!S.fragments.length){T.trigger(W.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(E===I.PlaylistContextType.MANIFEST){var y={attrs:new p.AttrList({}),bitrate:0,details:S,name:"",url:v};T.trigger(W.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:v,stats:n,networkDetails:w,sessionData:null})}if(n.parsing.end=performance.now(),S.needSidxRanges){var b,N=(b=S.fragments[0].initSegment)===null||b===void 0?void 0:b.url;this.load({url:N,isSidxRequest:!0,type:E,level:O,levelDetails:S,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=S,this.handlePlaylistLoaded(r,n,d,w)},l.handleSidxRequest=function(r,n){var d=Object(M.parseSegmentIndex)(new Uint8Array(r.data));if(!d)return;var w=d.references,T=n.levelDetails;w.forEach(function(x,O){var E=x.info,v=T.fragments[O];v.byteRange.length===0&&v.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),v.initSegment&&v.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(r,n,d,w){this.hls.trigger(W.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===I.PlaylistContextType.MANIFEST,url:r.url,reason:d,response:r,context:n,networkDetails:w})},l.handleNetworkError=function(r,n,d,w){d===void 0&&(d=!1),B.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var T=R.ErrorDetails.UNKNOWN,x=!1,O=this.getInternalLoader(r);switch(r.type){case I.PlaylistContextType.MANIFEST:T=d?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:T=d?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:T=d?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:T=d?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}O&&this.resetInternalLoader(r.type);var E={type:R.ErrorTypes.NETWORK_ERROR,details:T,fatal:x,url:r.url,loader:O,context:r,networkDetails:n};w&&(E.response=w),this.hls.trigger(W.Events.ERROR,E)},l.handlePlaylistLoaded=function(r,n,d,w){var T=d.type,x=d.level,O=d.id,E=d.groupId,v=d.loader,_=d.levelDetails,f=d.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(r,d,"invalid target duration",w);return}if(!v)return;_.live&&(v.getCacheAge&&(_.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(T){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(W.Events.LEVEL_LOADED,{details:_,level:x||0,id:O||0,stats:n,networkDetails:w,deliveryDirectives:f});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,{details:_,id:O||0,groupId:E||"",stats:n,networkDetails:w,deliveryDirectives:f});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADED,{details:_,id:O||0,groupId:E||"",stats:n,networkDetails:w,deliveryDirectives:f});break}},s}();V.default=h},"./src/polyfills/number.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isFiniteNumber",function(){return Y}),P.d(V,"MAX_SAFE_INTEGER",function(){return W});var Y=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},W=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,V,P){"use strict";P.r(V);var Y=function(){function W(){}return W.getSilentFrame=function(B,M){switch(B){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===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(M===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(M===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(M===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(M===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},W}();V.default=Y},"./src/remux/mp4-generator.ts":function(ee,V,P){"use strict";P.r(V);var Y=Math.pow(2,32)-1,W=function(){function R(){}return R.init=function(){R.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 M;for(M in R.types)R.types.hasOwnProperty(M)&&(R.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var L=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]),I=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]);R.HDLR_TYPES={video:L,audio:I};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=m,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,u,s,u,h),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,p))},R.box=function(M){for(var L=8,I=arguments.length,p=new Array(I>1?I-1:0),m=1;m<I;m++)p[m-1]=arguments[m];for(var u=p.length,h=u;u--;)L+=p[u].byteLength;var s=new Uint8Array(L);for(s[0]=L>>24&255,s[1]=L>>16&255,s[2]=L>>8&255,s[3]=L&255,s.set(M,4),u=0,L=8;u<h;u++)s.set(p[u],L),L+=p[u].byteLength;return s},R.hdlr=function(M){return R.box(R.types.hdlr,R.HDLR_TYPES[M])},R.mdat=function(M){return R.box(R.types.mdat,M)},R.mdhd=function(M,L){L*=M;var I=Math.floor(L/(Y+1)),p=Math.floor(L%(Y+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,I>>24,I>>16&255,I>>8&255,I&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},R.mdia=function(M){return R.box(R.types.mdia,R.mdhd(M.timescale,M.duration),R.hdlr(M.type),R.minf(M))},R.mfhd=function(M){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},R.minf=function(M){return M.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(M)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(M))},R.moof=function(M,L,I){return R.box(R.types.moof,R.mfhd(M),R.traf(I,L))},R.moov=function(M){for(var L=M.length,I=[];L--;)I[L]=R.trak(M[L]);return R.box.apply(null,[R.types.moov,R.mvhd(M[0].timescale,M[0].duration)].concat(I).concat(R.mvex(M)))},R.mvex=function(M){for(var L=M.length,I=[];L--;)I[L]=R.trex(M[L]);return R.box.apply(null,[R.types.mvex].concat(I))},R.mvhd=function(M,L){L*=M;var I=Math.floor(L/(Y+1)),p=Math.floor(L%(Y+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,I>>24,I>>16&255,I>>8&255,I&255,p>>24,p>>16&255,p>>8&255,p&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 R.box(R.types.mvhd,m)},R.sdtp=function(M){var L=M.samples||[],I=new Uint8Array(4+L.length),p,m;for(p=0;p<L.length;p++)m=L[p].flags,I[p+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return R.box(R.types.sdtp,I)},R.stbl=function(M){return R.box(R.types.stbl,R.stsd(M),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(M){var L=[],I=[],p,m,u;for(p=0;p<M.sps.length;p++)m=M.sps[p],u=m.byteLength,L.push(u>>>8&255),L.push(u&255),L=L.concat(Array.prototype.slice.call(m));for(p=0;p<M.pps.length;p++)m=M.pps[p],u=m.byteLength,I.push(u>>>8&255),I.push(u&255),I=I.concat(Array.prototype.slice.call(m));var h=R.box(R.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|M.sps.length].concat(L).concat([M.pps.length]).concat(I))),s=M.width,l=M.height,i=M.pixelRatio[0],r=M.pixelRatio[1];return R.box(R.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,s>>8&255,s&255,l>>8&255,l&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]),h,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,r>>24,r>>16&255,r>>8&255,r&255])))},R.esds=function(M){var L=M.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(M.config).concat([6,1,2]))},R.mp4a=function(M){var L=M.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),R.box(R.types.esds,R.esds(M)))},R.mp3=function(M){var L=M.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,M.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},R.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(M)):R.box(R.types.stsd,R.STSD,R.mp4a(M)):R.box(R.types.stsd,R.STSD,R.avc1(M))},R.tkhd=function(M){var L=M.id,I=M.duration*M.timescale,p=M.width,m=M.height,u=Math.floor(I/(Y+1)),h=Math.floor(I%(Y+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,h>>24,h>>16&255,h>>8&255,h&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,p>>8&255,p&255,0,0,m>>8&255,m&255,0,0]))},R.traf=function(M,L){var I=R.sdtp(M),p=M.id,m=Math.floor(L/(Y+1)),u=Math.floor(L%(Y+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&255])),R.trun(M,I.length+16+20+8+16+8+8),I)},R.trak=function(M){return M.duration=M.duration||4294967295,R.box(R.types.trak,R.tkhd(M),R.mdia(M))},R.trex=function(M){var L=M.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(M,L){var I=M.samples||[],p=I.length,m=12+16*p,u=new Uint8Array(m),h,s,l,i,r,n;for(L+=8+m,u.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),h=0;h<p;h++)s=I[h],l=s.duration,i=s.size,r=s.flags,n=s.cts,u.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*h);return R.box(R.types.trun,u)},R.initSegment=function(M){R.types||R.init();var L=R.moov(M),I=new Uint8Array(R.FTYP.byteLength+L.byteLength);return I.set(R.FTYP),I.set(L,R.FTYP.byteLength),I},R}();W.types=void 0,W.HDLR_TYPES=void 0,W.STTS=void 0,W.STSC=void 0,W.STCO=void 0,W.STSZ=void 0,W.VMHD=void 0,W.SMHD=void 0,W.STSD=void 0,W.FTYP=void 0,W.DINF=void 0,V.default=W},"./src/remux/mp4-remuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return n}),P.d(V,"normalizePts",function(){return d});var Y=P("./src/polyfills/number.ts"),W=P("./src/remux/aac-helper.ts"),R=P("./src/remux/mp4-generator.ts"),B=P("./src/events.ts"),M=P("./src/errors.ts"),L=P("./src/utils/logger.ts"),I=P("./src/types/loader.ts"),p=P("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var E=1;E<arguments.length;E++){var v=arguments[E];for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(O[_]=v[_])}return O},m.apply(this,arguments)}var u=10*1e3,h=1024,s=1152,l=null,i=null,r=!1,n=function(){function O(v,_,f,c){if(c===void 0&&(c=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=v,this.config=_,this.typeSupported=f,this.ISGenerated=!1,l===null){var S=navigator.userAgent||"",y=S.match(/Chrome\/(\d+)/i);l=y?parseInt(y[1]):0}if(i===null){var b=navigator.userAgent.match(/Safari\/(\d+)/i);i=b?parseInt(b[1]):0}r=!!l&&l<75||!!i&&i<600}var E=O.prototype;return E.destroy=function(){},E.resetTimeStamp=function(_){L.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},E.resetNextTimestamp=function(){L.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){L.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(_){var f=!1,c=_.reduce(function(S,y){var b=y.pts-S;return b<-4294967296?(f=!0,d(S,y.pts)):b>0?S:y.pts},_[0].pts);return f&&L.logger.debug("PTS rollover detected"),c},E.remux=function(_,f,c,S,y,b,N,F){var X,Z,H,A,z,ne,ae=y,me=y,xe=_.pid>-1,Te=f.pid>-1,Oe=f.samples.length,Ue=_.samples.length>0,De=Oe>1,be=(!xe||Ue)&&(!Te||De)||this.ISGenerated||N;if(be){this.ISGenerated||(H=this.generateIS(_,f,y));var ge=this.isVideoContiguous,He=-1;if(De&&(He=w(f.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,He>0){L.logger.warn("[mp4-remuxer]: Dropped "+He+" out of "+Oe+" video samples due to a missing keyframe");var ct=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(He),f.dropped+=He,me+=(f.samples[0].pts-ct)/(f.timescale||9e4)}else He===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+Oe+" video samples"),ne=!1);if(this.ISGenerated){if(Ue&&De){var vt=this.getVideoStartPts(f.samples),_t=d(_.samples[0].pts,vt)-vt,yt=_t/f.inputTimeScale;ae+=Math.max(0,yt),me+=Math.max(0,-yt)}if(Ue){if(_.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(_,f,y)),Z=this.remuxAudio(_,ae,this.isAudioContiguous,b,Te||De||F===I.PlaylistLevelType.AUDIO?me:void 0),De){var et=Z?Z.endPTS-Z.startPTS:0;f.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(_,f,y)),X=this.remuxVideo(f,me,ge,et)}}else De&&(X=this.remuxVideo(f,me,ge,0));X&&(X.firstKeyFrame=He,X.independent=He!==-1)}}return this.ISGenerated&&(c.samples.length&&(z=this.remuxID3(c,y)),S.samples.length&&(A=this.remuxText(S,y))),{audio:Z,video:X,initSegment:H,independent:ne,text:A,id3:z}},E.generateIS=function(_,f,c){var S=_.samples,y=f.samples,b=this.typeSupported,N={},F=!Object(Y.isFiniteNumber)(this._initPTS),X="audio/mp4",Z,H,A;if(F&&(Z=H=Infinity),_.config&&S.length&&(_.timescale=_.samplerate,_.isAAC||(b.mpeg?(X="audio/mpeg",_.codec=""):b.mp3&&(_.codec="mp3")),N.audio={id:"audio",container:X,codec:_.codec,initSegment:!_.isAAC&&b.mpeg?new Uint8Array(0):R.default.initSegment([_]),metadata:{channelCount:_.channelCount}},F&&(A=_.inputTimeScale,Z=H=S[0].pts-Math.round(A*c))),f.sps&&f.pps&&y.length&&(f.timescale=f.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:R.default.initSegment([f]),metadata:{width:f.width,height:f.height}},F)){A=f.inputTimeScale;var z=this.getVideoStartPts(y),ne=Math.round(A*c);H=Math.min(H,d(y[0].dts,z)-ne),Z=Math.min(Z,z-ne)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=Z,this._initDTS=H),{tracks:N,initPTS:Z,timescale:A}},E.remuxVideo=function(_,f,c,S){var y=_.inputTimeScale,b=_.samples,N=[],F=b.length,X=this._initPTS,Z=this.nextAvcDts,H=8,A,z,ne,ae=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,xe=0,Te=!1;if(!c||Z===null){var Oe=f*y,Ue=b[0].pts-d(b[0].dts,b[0].pts);Z=Oe-Ue}for(var De=0;De<F;De++){var be=b[De];if(be.pts=d(be.pts-X,Z),be.dts=d(be.dts-X,Z),be.dts>be.pts){var ge=9e4*.2;xe=Math.max(Math.min(xe,be.pts-be.dts),-1*ge)}be.dts<b[De>0?De-1:De].dts&&(Te=!0)}Te&&b.sort(function(wt,Qe){var it=wt.dts-Qe.dts,We=wt.pts-Qe.pts;return it||We}),z=b[0].dts,ne=b[b.length-1].dts;var He=Math.round((ne-z)/(F-1));if(xe<0){if(xe<He*-2){L.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(p.toMsFromMpegTsClock)(-He,!0)+" ms");for(var ct=xe,vt=0;vt<F;vt++)b[vt].dts=ct=Math.max(ct,b[vt].pts-He),b[vt].pts=Math.max(ct,b[vt].pts)}else{L.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(p.toMsFromMpegTsClock)(xe,!0)+" ms to overcome this issue");for(var _t=0;_t<F;_t++)b[_t].dts=b[_t].dts+xe}z=b[0].dts}if(c){var yt=z-Z,et=yt>He,ht=yt<-1;if(et||ht){et?L.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(yt,!0)+" ms ("+yt+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-yt,!0)+" ms ("+yt+"dts) overlapping between fragments detected"),z=Z;var xt=b[0].pts-yt;b[0].dts=z,b[0].pts=xt,L.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(xt,!0)+"/"+Object(p.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(yt,!0)+" ms")}}r&&(z=Math.max(0,z));for(var Tt=0,mt=0,Ie=0;Ie<F;Ie++){for(var je=b[Ie],$e=je.units,at=$e.length,lt=0,bt=0;bt<at;bt++)lt+=$e[bt].data.length;mt+=lt,Tt+=at,je.length=lt,je.dts=Math.max(je.dts,z),je.pts=Math.max(je.pts,je.dts,0),ae=Math.min(je.pts,ae),me=Math.max(je.pts,me)}ne=b[F-1].dts;var Mt=mt+4*Tt+8,jt;try{jt=new Uint8Array(Mt)}catch(wt){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Mt,reason:"fail allocating video mdat "+Mt});return}var Me=new DataView(jt.buffer);Me.setUint32(0,Mt),jt.set(R.default.types.mdat,4);for(var Pe=0;Pe<F;Pe++){for(var tt=b[Pe],rt=tt.units,Fe=0,Je=0,Ee=rt.length;Je<Ee;Je++){var ye=rt[Je],_e=ye.data,le=ye.data.byteLength;Me.setUint32(H,le),H+=4,jt.set(_e,H),H+=le,Fe+=4+le}if(Pe<F-1)A=b[Pe+1].dts-tt.dts;else{var de=this.config,ve=tt.dts-b[Pe>0?Pe-1:Pe].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(de.maxBufferHole*y),Ce=(S?ae+S*y:this.nextAudioPts)-tt.pts;Ce>pe?(A=Ce-ve,A<0&&(A=ve),L.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=ve}else A=ve}var Ke=Math.round(tt.pts-tt.dts);N.push(new T(tt.key,A,Fe,Ke))}if(N.length&&l&&l<70){var st=N[0].flags;st.dependsOn=2,st.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Z=ne+A,this.isVideoContiguous=!0;var At=R.default.moof(_.sequenceNumber++,z,m({},_,{samples:N})),Ft="video",kt={data1:At,data2:jt,startPTS:ae/y,endPTS:(me+A)/y,startDTS:z/y,endDTS:Z/y,type:Ft,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(jt.length,"MDAT length must not be zero"),kt},E.remuxAudio=function(_,f,c,S,y){var b=_.inputTimeScale,N=_.samplerate?_.samplerate:b,F=b/N,X=_.isAAC?h:s,Z=X*F,H=this._initPTS,A=!_.isAAC&&this.typeSupported.mpeg,z=[],ne=_.samples,ae=A?0:8,me=this.nextAudioPts||-1,xe=f*b;if(this.isAudioContiguous=c=c||ne.length&&me>0&&(S&&Math.abs(xe-me)<9e3||Math.abs(d(ne[0].pts-H,xe)-me)<20*Z),ne.forEach(function(_e){_e.pts=d(_e.pts-H,xe)}),!c||me<0){if(ne=ne.filter(function(_e){return _e.pts>=0}),!ne.length)return;y===0?me=0:S?me=Math.max(0,xe):me=ne[0].pts}if(_.isAAC)for(var Te=y!==void 0,Oe=this.config.maxAudioFramesDrift,Ue=0,De=me;Ue<ne.length;Ue++){var be=ne[Ue],ge=be.pts,He=ge-De,ct=Math.abs(1e3*He/b);if(He<=-Oe*Z&&Te)Ue===0&&(L.logger.warn("Audio frame @ "+(ge/b).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*He/b)+" ms."),this.nextAudioPts=me=De=ge);else if(He>=Oe*Z&&ct<u&&Te){var vt=Math.round(He/Z);De=ge-vt*Z,De<0&&(vt--,De+=Z),Ue===0&&(this.nextAudioPts=me=De),L.logger.warn("[mp4-remuxer]: Injecting "+vt+" audio frame @ "+(De/b).toFixed(3)+"s due to "+Math.round(1e3*He/b)+" ms gap.");for(var _t=0;_t<vt;_t++){var yt=Math.max(De,0),et=W.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);et||(L.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),et=be.unit.subarray()),ne.splice(Ue,0,{unit:et,pts:yt}),De+=Z,Ue++}}be.pts=De,De+=Z}for(var ht=null,xt=null,Tt,mt=0,Ie=ne.length;Ie--;)mt+=ne[Ie].unit.byteLength;for(var je=0,$e=ne.length;je<$e;je++){var at=ne[je],lt=at.unit,bt=at.pts;if(xt!==null){var Mt=z[je-1];Mt.duration=Math.round((bt-xt)/F)}else if(c&&_.isAAC&&(bt=me),ht=bt,mt>0){mt+=ae;try{Tt=new Uint8Array(mt)}catch(_e){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:mt,reason:"fail allocating audio mdat "+mt});return}if(!A){var jt=new DataView(Tt.buffer);jt.setUint32(0,mt),Tt.set(R.default.types.mdat,4)}}else return;Tt.set(lt,ae);var Me=lt.byteLength;ae+=Me,z.push(new T(!0,X,Me,0)),xt=bt}var Pe=z.length;if(!Pe)return;var tt=z[z.length-1];this.nextAudioPts=me=xt+F*tt.duration;var rt=A?new Uint8Array(0):R.default.moof(_.sequenceNumber++,ht/F,m({},_,{samples:z}));_.samples=[];var Fe=ht/b,Je=me/b,Ee="audio",ye={data1:rt,data2:Tt,startPTS:Fe,endPTS:Je,startDTS:Fe,endDTS:Je,type:Ee,hasAudio:!0,hasVideo:!1,nb:Pe};return this.isAudioContiguous=!0,console.assert(Tt.length,"MDAT length must not be zero"),ye},E.remuxEmptyAudio=function(_,f,c,S){var y=_.inputTimeScale,b=_.samplerate?_.samplerate:y,N=y/b,F=this.nextAudioPts,X=(F!==null?F:S.startDTS*y)+this._initDTS,Z=S.endDTS*y+this._initDTS,H=N*h,A=Math.ceil((Z-X)/H),z=W.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],ae=0;ae<A;ae++){var me=X+ae*H;ne.push({unit:z,pts:me,dts:me})}return _.samples=ne,this.remuxAudio(_,f,c,!1)},E.remuxID3=function(_,f){var c=_.samples.length;if(!c)return;for(var S=_.inputTimeScale,y=this._initPTS,b=this._initDTS,N=0;N<c;N++){var F=_.samples[N];F.pts=d(F.pts-y,f*S)/S,F.dts=d(F.dts-b,f*S)/S}var X=_.samples;return _.samples=[],{samples:X}},E.remuxText=function(_,f){var c=_.samples.length;if(!c)return;for(var S=_.inputTimeScale,y=this._initPTS,b=0;b<c;b++){var N=_.samples[b];N.pts=d(N.pts-y,f*S)/S}_.samples.sort(function(X,Z){return X.pts-Z.pts});var F=_.samples;return _.samples=[],{samples:F}},O}();function d(O,E){var v;if(E===null)return O;for(E<O?v=-8589934592:v=8589934592;Math.abs(O-E)>4294967296;)O+=v;return O}function w(O){for(var E=0;E<O.length;E++)if(O[E].key)return E;return-1}var T=function(E,v,_,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=_,this.cts=f,this.flags=new x(E)},x=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/mp4-tools.ts"),R=P("./src/loader/fragment.ts"),B=P("./src/utils/logger.ts"),M=function(){function p(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=p.prototype;return m.destroy=function(){},m.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(h,s,l){this.audioCodec=s,this.videoCodec=l,this.generateInitSegment(h),this.emitInitSegment=!0},m.generateInitSegment=function(h){var s=this.audioCodec,l=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(W.parseInitSegment)(h);s||(s=I(i.audio,R.ElementaryStreamTypes.AUDIO)),l||(l=I(i.video,R.ElementaryStreamTypes.VIDEO));var r={};i.audio&&i.video?r.audiovideo={container:"video/mp4",codec:s+","+l,initSegment:h,id:"main"}:i.audio?r.audio={container:"audio/mp4",codec:s,initSegment:h,id:"audio"}:i.video?r.video={container:"video/mp4",codec:l,initSegment:h,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},m.remux=function(h,s,l,i,r){var n=this.initPTS,d=this.lastEndDTS,w={audio:void 0,video:void 0,text:i,id3:l,initSegment:void 0};Object(Y.isFiniteNumber)(d)||(d=this.lastEndDTS=r||0);var T=s.samples;if(!T||!T.length)return w;var x={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(T),O=this.initData),!O||!O.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(Y.isFiniteNumber)(n)||(this.initPTS=x.initPTS=n=L(O,T,d));var E=Object(W.getDuration)(T,O),v=d,_=E+v;Object(W.offsetStartDTS)(O,T,n),E>0?this.lastEndDTS=_:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!O.audio,c=!!O.video,S="";f&&(S+="audio"),c&&(S+="video");var y={data1:T,startPTS:v,startDTS:v,endPTS:_,endDTS:_,type:S,hasAudio:f,hasVideo:c,nb:1,dropped:0};return w.audio=y.type==="audio"?y:void 0,w.video=y.type!=="audio"?y:void 0,w.text=i,w.id3=l,w.initSegment=x,w},p}(),L=function(m,u,h){return Object(W.getStartDTS)(m,u)-h};function I(p,m){var u=p==null?void 0:p.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||m===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=M},"./src/task-loop.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function W(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=W.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},W}()},"./src/types/cmcd.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"CMCDVersion",function(){return Y}),P.d(V,"CMCDObjectType",function(){return W}),P.d(V,"CMCDStreamingFormat",function(){return R}),P.d(V,"CMCDStreamType",function(){return B});var Y=1,W;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(W||(W={}));var R;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(R||(R={}));var B;(function(M){M.VOD="v",M.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"HlsSkip",function(){return R}),P.d(V,"getSkipValue",function(){return B}),P.d(V,"HlsUrlParameters",function(){return M}),P.d(V,"Level",function(){return L});function Y(I,p){for(var m=0;m<p.length;m++){var u=p[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(I,u.key,u)}}function W(I,p,m){return p&&Y(I.prototype,p),m&&Y(I,m),I}var R;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(R||(R={}));function B(I,p){var m=I.canSkipUntil,u=I.canSkipDateRanges,h=I.endSN,s=p!==void 0?p-h:0;return m&&s<m?u?R.v2:R.Yes:R.No}var M=function(){function I(m,u,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=u,this.skip=h}var p=I.prototype;return p.addDirectives=function(u){var h=new self.URL(u);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},I}(),L=function(){function I(p){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return W(I,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var u=m%this.url.length;this._urlId!==u&&(this.details=void 0,this._urlId=u)}}]),I}()},"./src/types/loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"PlaylistContextType",function(){return Y}),P.d(V,"PlaylistLevelType",function(){return W});var Y;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(Y||(Y={}));var W;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(W||(W={}))},"./src/types/transmuxer.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"ChunkMetadata",function(){return Y});var Y=function(B,M,L,I,p,m){I===void 0&&(I=0),p===void 0&&(p=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=W(),this.buffering={audio:W(),video:W(),audiovideo:W()},this.level=B,this.sn=M,this.id=L,this.size=I,this.part=p,this.partial=m};function W(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"AttrList",function(){return R});var Y=/^(\d+)x(\d+)$/,W=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function B(L){typeof L=="string"&&(L=B.parseAttrList(L));for(var I in L)L.hasOwnProperty(I)&&(this[I]=L[I])}var M=B.prototype;return M.decimalInteger=function(I){var p=parseInt(this[I],10);return p>Number.MAX_SAFE_INTEGER?Infinity:p},M.hexadecimalInteger=function(I){if(this[I]){var p=(this[I]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var m=new Uint8Array(p.length/2),u=0;u<p.length/2;u++)m[u]=parseInt(p.slice(u*2,u*2+2),16);return m}else return null},M.hexadecimalIntegerAsNumber=function(I){var p=parseInt(this[I],16);return p>Number.MAX_SAFE_INTEGER?Infinity:p},M.decimalFloatingPoint=function(I){return parseFloat(this[I])},M.optionalFloat=function(I,p){var m=this[I];return m?parseFloat(m):p},M.enumeratedString=function(I){return this[I]},M.bool=function(I){return this[I]==="YES"},M.decimalResolution=function(I){var p=Y.exec(this[I]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},B.parseAttrList=function(I){var p,m={},u='"';for(W.lastIndex=0;(p=W.exec(I))!==null;){var h=p[2];h.indexOf(u)===0&&h.lastIndexOf(u)===h.length-1&&(h=h.slice(1,-1)),m[p[1]]=h}return m},B}()},"./src/utils/binary-search.ts":function(ee,V,P){"use strict";P.r(V);var Y={search:function(R,B){for(var M=0,L=R.length-1,I=null,p=null;M<=L;){I=(M+L)/2|0,p=R[I];var m=B(p);if(m>0)M=I+1;else if(m<0)L=I-1;else return p}return null}};V.default=Y},"./src/utils/buffer-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"BufferHelper",function(){return R});var Y=P("./src/utils/logger.ts"),W={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function B(){}return B.isBuffered=function(L,I){try{if(L){for(var p=B.getBuffered(L),m=0;m<p.length;m++)if(I>=p.start(m)&&I<=p.end(m))return!0}}catch(u){}return!1},B.bufferInfo=function(L,I,p){try{if(L){var m=B.getBuffered(L),u=[],h;for(h=0;h<m.length;h++)u.push({start:m.start(h),end:m.end(h)});return this.bufferedInfo(u,I,p)}}catch(s){}return{len:0,start:I,end:I,nextStart:void 0}},B.bufferedInfo=function(L,I,p){I=Math.max(0,I),L.sort(function(x,O){var E=x.start-O.start;return E||O.end-x.end});var m=[];if(p)for(var u=0;u<L.length;u++){var h=m.length;if(h){var s=m[h-1].end;L[u].start-s<p?L[u].end>s&&(m[h-1].end=L[u].end):m.push(L[u])}else m.push(L[u])}else m=L;for(var l=0,i,r=I,n=I,d=0;d<m.length;d++){var w=m[d].start,T=m[d].end;if(I+p>=w&&I<T)r=w,n=T,l=n-I;else if(I+p<w){i=w;break}}return{len:l,start:r||0,end:n||0,nextStart:i}},B.getBuffered=function(L){try{return L.buffered}catch(I){return Y.logger.log("failed to get media.buffered",I),W}},B}()},"./src/utils/cea-608-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"Row",function(){return n}),P.d(V,"CaptionScreen",function(){return d});var Y=P("./src/utils/logger.ts"),W={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},R=function(_){var f=_;return W.hasOwnProperty(_)&&(f=W[_]),String.fromCharCode(f)},B=15,M=100,L={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(h||(h={}));var s=function(){function v(){this.time=null,this.verboseLevel=h.ERROR}var _=v.prototype;return _.log=function(c,S){this.verboseLevel>=c&&Y.logger.log(this.time+" ["+c+"] "+S)},v}(),l=function(_){for(var f=[],c=0;c<_.length;c++)f.push(_[c].toString(16));return f},i=function(){function v(f,c,S,y,b){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=c||!1,this.italics=S||!1,this.background=y||"black",this.flash=b||!1}var _=v.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(c){for(var S=["foreground","underline","italics","background","flash"],y=0;y<S.length;y++){var b=S[y];c.hasOwnProperty(b)&&(this[b]=c[b])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},_.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),r=function(){function v(f,c,S,y,b,N){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new i(c,S,y,b,N)}var _=v.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(c,S){this.uchar=c,this.penState.copy(S)},_.setPenState=function(c){this.penState.copy(c)},_.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},_.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),n=function(){function v(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<M;c++)this.chars.push(new r);this.logger=f,this.pos=0,this.currPenState=new i}var _=v.prototype;return _.equals=function(c){for(var S=!0,y=0;y<M;y++)if(!this.chars[y].equals(c.chars[y])){S=!1;break}return S},_.copy=function(c){for(var S=0;S<M;S++)this.chars[S].copy(c.chars[S])},_.isEmpty=function(){for(var c=!0,S=0;S<M;S++)if(!this.chars[S].isEmpty()){c=!1;break}return c},_.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>M&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},_.moveCursor=function(c){var S=this.pos+c;if(c>1)for(var y=this.pos+1;y<S+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(S)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(c){c>=144&&this.backSpace();var S=R(c);if(this.pos>=M){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(c){var S;for(S=c;S<M;S++)this.chars[S].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var c=[],S=!0,y=0;y<M;y++){var b=this.chars[y].uchar;b!==" "&&(S=!1),c.push(b)}return S?"":c.join("")},_.setPenStyles=function(c){this.currPenState.setStyles(c);var S=this.chars[this.pos];S.setPenState(this.currPenState)},v}(),d=function(){function v(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<B;c++)this.rows.push(new n(f));this.logger=f,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=v.prototype;return _.reset=function(){for(var c=0;c<B;c++)this.rows[c].clear();this.currRow=B-1},_.equals=function(c){for(var S=!0,y=0;y<B;y++)if(!this.rows[y].equals(c.rows[y])){S=!1;break}return S},_.copy=function(c){for(var S=0;S<B;S++)this.rows[S].copy(c.rows[S])},_.isEmpty=function(){for(var c=!0,S=0;S<B;S++)if(!this.rows[S].isEmpty()){c=!1;break}return c},_.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},_.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},_.insertChar=function(c){var S=this.rows[this.currRow];S.insertChar(c)},_.setPen=function(c){var S=this.rows[this.currRow];S.setPenStyles(c)},_.moveCursor=function(c){var S=this.rows[this.currRow];S.moveCursor(c)},_.setCursor=function(c){this.logger.log(h.INFO,"setCursor: "+c);var S=this.rows[this.currRow];S.setCursor(c)},_.setPAC=function(c){this.logger.log(h.INFO,"pacData = "+JSON.stringify(c));var S=c.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var y=0;y<B;y++)this.rows[y].clear();var b=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var F=N.rows[b].cueStartTime,X=this.logger.time;if(F&&X!==null&&F<X)for(var Z=0;Z<this.nrRollUpRows;Z++)this.rows[S-this.nrRollUpRows+Z+1].copy(N.rows[b+Z])}}this.currRow=S;var H=this.rows[this.currRow];if(c.indent!==null){var A=c.indent,z=Math.max(A-1,0);H.setCursor(c.indent),c.color=H.chars[z].penState.foreground}var ne={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(ne)},_.setBkgData=function(c){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},_.setRollUpRows=function(c){this.nrRollUpRows=c},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(c,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(h.INFO,"Rolling up")},_.getDisplayText=function(c){c=c||!1;for(var S=[],y="",b=-1,N=0;N<B;N++){var F=this.rows[N].getTextString();F&&(b=N+1,c?S.push("Row "+b+": '"+F+"'"):S.push(F.trim()))}return S.length>0&&(c?y="["+S.join(" | ")+"]":y=S.join(`
`)),y},_.getTextAndFormat=function(){return this.rows},v}(),w=function(){function v(f,c,S){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=f,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new d(S),this.nonDisplayedMemory=new d(S),this.lastOutputScreen=new d(S),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var _=v.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(c){this.outputFilter=c},_.setPAC=function(c){this.writeScreen.setPAC(c)},_.setBkgData=function(c){this.writeScreen.setBkgData(c)},_.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=c},_.insertChars=function(c){for(var S=0;S<c.length;S++)this.writeScreen.insertChar(c[S]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(c){this.logger.log(h.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},_.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(c){this.logger.log(h.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},_.ccMIDROW=function(c){var S={flash:!1};if(S.underline=c%2===1,S.italics=c>=46,S.italics)S.foreground="white";else{var y=Math.floor(c/2)-16,b=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=b[y]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},_.outputDataUpdate=function(c){c===void 0&&(c=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},v}(),T=function(){function v(f,c,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new s;this.channels=[null,new w(f,c,y),new w(f+1,S,y)],this.cmdHistory=E(),this.logger=y}var _=v.prototype;return _.getHandler=function(c){return this.channels[c].getHandler()},_.setHandler=function(c,S){this.channels[c].setHandler(S)},_.addData=function(c,S){var y,b,N,F=!1;this.logger.time=c;for(var X=0;X<S.length;X+=2){if(b=S[X]&127,N=S[X+1]&127,b===0&&N===0)continue;if(this.logger.log(h.DATA,"["+l([S[X],S[X+1]])+"] -> ("+l([b,N])+")"),y=this.parseCmd(b,N),y||(y=this.parseMidrow(b,N)),y||(y=this.parsePAC(b,N)),y||(y=this.parseBackgroundAttributes(b,N)),!y&&(F=this.parseChars(b,N),F)){var Z=this.currentChannel;if(Z&&Z>0){var H=this.channels[Z];H.insertChars(F)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!F&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+l([b,N])+" orig: "+l([S[X],S[X+1]]))}},_.parseCmd=function(c,S){var y=this.cmdHistory,b=(c===20||c===28||c===21||c===29)&&S>=32&&S<=47,N=(c===23||c===31)&&S>=33&&S<=35;if(!(b||N))return!1;if(O(c,S,y))return x(null,null,y),this.logger.log(h.DEBUG,"Repeated command ("+l([c,S])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,X=this.channels[F];return c===20||c===21||c===28||c===29?S===32?X.ccRCL():S===33?X.ccBS():S===34?X.ccAOF():S===35?X.ccAON():S===36?X.ccDER():S===37?X.ccRU(2):S===38?X.ccRU(3):S===39?X.ccRU(4):S===40?X.ccFON():S===41?X.ccRDC():S===42?X.ccTR():S===43?X.ccRTD():S===44?X.ccEDM():S===45?X.ccCR():S===46?X.ccENM():S===47&&X.ccEOC():X.ccTO(S-32),x(c,S,y),this.currentChannel=F,!0},_.parseMidrow=function(c,S){var y=0;if((c===17||c===25)&&S>=32&&S<=47){if(c===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var b=this.channels[y];return b?(b.ccMIDROW(S),this.logger.log(h.DEBUG,"MIDROW ("+l([c,S])+")"),!0):!1}return!1},_.parsePAC=function(c,S){var y,b=this.cmdHistory,N=(c>=17&&c<=23||c>=25&&c<=31)&&S>=64&&S<=127,F=(c===16||c===24)&&S>=64&&S<=95;if(!(N||F))return!1;if(O(c,S,b))return x(null,null,b),!0;var X=c<=23?1:2;S>=64&&S<=95?y=X===1?L[c]:p[c]:y=X===1?I[c]:m[c];var Z=this.channels[X];return Z?(Z.setPAC(this.interpretPAC(y,S)),x(c,S,b),this.currentChannel=X,!0):!1},_.interpretPAC=function(c,S){var y,b={color:null,italics:!1,indent:null,underline:!1,row:c};return S>95?y=S-96:y=S-64,b.underline=(y&1)===1,y<=13?b.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(b.italics=!0,b.color="white"):b.indent=Math.floor((y-16)/2)*4,b},_.parseChars=function(c,S){var y,b=null,N=null;if(c>=25?(y=2,N=c-8):(y=1,N=c),N>=17&&N<=19){var F;N===17?F=S+80:N===18?F=S+112:F=S+144,this.logger.log(h.INFO,"Special char '"+R(F)+"' in channel "+y),b=[F]}else c>=32&&c<=127&&(b=S===0?[c]:[c,S]);if(b){var X=l(b);this.logger.log(h.DEBUG,"Char codes = "+X.join(",")),x(c,S,this.cmdHistory)}return b},_.parseBackgroundAttributes=function(c,S){var y=(c===16||c===24)&&S>=32&&S<=47,b=(c===23||c===31)&&S>=45&&S<=47;if(!(y||b))return!1;var N,F={};c===16||c===24?(N=Math.floor((S-32)/2),F.background=u[N],S%2===1&&(F.background=F.background+"_semi")):S===45?F.background="transparent":(F.foreground="black",S===47&&(F.underline=!0));var X=c<=23?1:2,Z=this.channels[X];return Z.setBkgData(F),x(c,S,this.cmdHistory),!0},_.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var S=this.channels[c];S&&S.reset()}this.cmdHistory=E()},_.cueSplitAtTime=function(c){for(var S=0;S<this.channels.length;S++){var y=this.channels[S];y&&y.cueSplitAtTime(c)}},v}();function x(v,_,f){f.a=v,f.b=_}function O(v,_,f){return f.a===v&&f.b===_}function E(){return{a:null,b:null}}V.default=T},"./src/utils/codecs.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"isCodecType",function(){return W}),P.d(V,"isCodecSupportedInMp4",function(){return R});var Y={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function W(B,M){var L=Y[M];return!!L&&L[B.slice(0,4)]===!0}function R(B,M){return MediaSource.isTypeSupported((M||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/vttparser.ts"),W=P("./src/utils/webvtt-parser.ts"),R=P("./src/utils/texttrack-utils.ts"),B=/\s/,M={newCue:function(I,p,m,u){for(var h=[],s,l,i,r,n,d=self.VTTCue||self.TextTrackCue,w=0;w<u.rows.length;w++)if(s=u.rows[w],i=!0,r=0,n="",!s.isEmpty()){for(var T=0;T<s.chars.length;T++)B.test(s.chars[T].uchar)&&i?r++:(n+=s.chars[T].uchar,i=!1);s.cueStartTime=p,p===m&&(m+=1e-4),r>=16?r--:r++;var x=Object(Y.fixLineBreaks)(n.trim()),O=Object(W.generateCueId)(p,m,x);(!I||!I.cues||!I.cues.getCueById(O))&&(l=new d(p,m,x),l.id=O,l.line=w+1,l.align="left",l.position=10+Math.min(80,Math.floor(r*8/32)*10),h.push(l))}return I&&h.length&&(h.sort(function(E,v){return E.line==="auto"||v.line==="auto"?0:E.line>8&&v.line>8?v.line-E.line:E.line-v.line}),h.forEach(function(E){return Object(R.addCueToTrack)(I,E)})),h}};V.default=M},"./src/utils/discontinuities.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"findFirstFragWithCC",function(){return B}),P.d(V,"shouldAlignOnDiscontinuities",function(){return M}),P.d(V,"findDiscontinuousReferenceFrag",function(){return L}),P.d(V,"adjustSlidingStart",function(){return p}),P.d(V,"alignStream",function(){return m}),P.d(V,"alignPDT",function(){return h}),P.d(V,"alignFragmentByPDTDelta",function(){return s}),P.d(V,"alignMediaPlaylistByPDT",function(){return l});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/logger.ts"),R=P("./src/controller/level-helper.ts");function B(i,r){for(var n=null,d=0,w=i.length;d<w;d++){var T=i[d];if(T&&T.cc===r){n=T;break}}return n}function M(i,r,n){return!!(r.details&&(n.endCC>n.startCC||i&&i.cc<n.startCC))}function L(i,r){var n=i.fragments,d=r.fragments;if(!d.length||!n.length){W.logger.log("No fragments to align");return}var w=B(n,d[0].cc);if(!w||w&&!w.startPTS){W.logger.log("No frag in previous level to align on");return}return w}function I(i,r){if(i){var n=i.start+r;i.start=i.startPTS=n,i.endPTS=n+i.duration}}function p(i,r){for(var n=r.fragments,d=0,w=n.length;d<w;d++)I(n[d],i);r.fragmentHint&&I(r.fragmentHint,i),r.alignedSliding=!0}function m(i,r,n){if(!r)return;u(i,n,r),!n.alignedSliding&&r.details&&h(n,r.details),!n.alignedSliding&&r.details&&!n.skippedSegments&&Object(R.adjustSliding)(r.details,n)}function u(i,r,n){if(M(i,n,r)){var d=L(n.details,r);d&&Object(Y.isFiniteNumber)(d.start)&&(W.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),p(d.start,r))}}function h(i,r){if(!r.fragments.length||!i.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,d=i.fragments[0].programDateTime,w=(d-n)/1e3+r.fragments[0].start;w&&Object(Y.isFiniteNumber)(w)&&(W.logger.log("Adjusting PTS using programDateTime delta "+(d-n)+"ms, sliding:"+w.toFixed(3)+" "+i.url+" "),p(w,i))}function s(i,r){var n=i.programDateTime;if(!n)return;var d=(n-r)/1e3;i.start=i.startPTS=d,i.endPTS=d+i.duration}function l(i,r){if(!r.fragments.length||!i.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,d=r.fragments[0].start,w=n-d*1e3;i.fragments.forEach(function(T){s(T,w)}),i.fragmentHint&&s(i.fragmentHint,w),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/ewma.ts"),W=function(){function R(M,L,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Y.default(M),this.fast_=new Y.default(L)}var B=R.prototype;return B.update=function(L,I){var p=this.slow_,m=this.fast_;this.slow_.halfLife!==L&&(this.slow_=new Y.default(L,p.getEstimate(),p.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new Y.default(I,m.getEstimate(),m.getTotalWeight()))},B.sample=function(L,I){L=Math.max(L,this.minDelayMs_);var p=8*I,m=L/1e3,u=p/m;this.fast_.sample(m,u),this.slow_.sample(m,u)},B.canEstimate=function(){var L=this.fast_;return L&&L.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},R}();V.default=W},"./src/utils/ewma.ts":function(ee,V,P){"use strict";P.r(V);var Y=function(){function W(B,M,L){M===void 0&&(M=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=M,this.totalWeight_=L}var R=W.prototype;return R.sample=function(M,L){var I=Math.pow(this.alpha_,M);this.estimate_=L*(1-I)+I*this.estimate_,this.totalWeight_+=M},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},W}();V.default=Y},"./src/utils/fetch-loader.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"fetchSupported",function(){return s});var Y=P("./src/polyfills/number.ts"),W=P("./src/loader/load-stats.ts"),R=P("./src/demux/chunk-cache.ts");function B(d,w){d.prototype=Object.create(w.prototype),d.prototype.constructor=d,m(d,w)}function M(d){var w=typeof Map=="function"?new Map:void 0;return M=function(x){if(x===null||!p(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(x))return w.get(x);w.set(x,O)}function O(){return L(x,arguments,u(this).constructor)}return O.prototype=Object.create(x.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,x)},M(d)}function L(d,w,T){return I()?L=Reflect.construct:L=function(O,E,v){var _=[null];_.push.apply(_,E);var f=Function.bind.apply(O,_),c=new f;return v&&m(c,v.prototype),c},L.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function p(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function m(d,w){return m=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},m(d,w)}function u(d){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},u(d)}function h(){return h=Object.assign||function(d){for(var w=1;w<arguments.length;w++){var T=arguments[w];for(var x in T)Object.prototype.hasOwnProperty.call(T,x)&&(d[x]=T[x])}return d},h.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var l=function(){function d(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||r,this.controller=new self.AbortController,this.stats=new W.LoadStats}var w=d.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(x,O,E){var v=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var f=i(x,this.controller.signal),c=E.onProgress,S=x.responseType==="arraybuffer",y=S?"byteLength":"length";this.context=x,this.config=O,this.callbacks=E,this.request=this.fetchSetup(x,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),E.onTimeout(_,x,v.response)},O.timeout),self.fetch(this.request).then(function(b){if(v.response=v.loader=b,!b.ok){var N=b.status,F=b.statusText;throw new n(F||"fetch, bad network response",N,b)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(b.headers.get("Content-Length")||"0"),c&&Object(Y.isFiniteNumber)(O.highWaterMark)?v.loadProgressively(b,_,x,O.highWaterMark,c):S?b.arrayBuffer():b.text()}).then(function(b){var N=v.response;self.clearTimeout(v.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=b[y];var F={url:N.url,data:b};c&&!Object(Y.isFiniteNumber)(O.highWaterMark)&&c(_,x,b,N),E.onSuccess(F,_,x,N)}).catch(function(b){if(self.clearTimeout(v.requestTimeout),_.aborted)return;var N=b.code||0;E.onError({code:N,text:b.message},x,b.details)})},w.getCacheAge=function(){var x=null;if(this.response){var O=this.response.headers.get("age");x=O?parseFloat(O):null}return x},w.loadProgressively=function(x,O,E,v,_){v===void 0&&(v=0);var f=new R.default,c=x.body.getReader(),S=function y(){return c.read().then(function(b){if(b.done)return f.dataLength&&_(O,E,f.flush(),x),Promise.resolve(new ArrayBuffer(0));var N=b.value,F=N.length;return O.loaded+=F,F<v||f.dataLength?(f.push(N),f.dataLength>=v&&_(O,E,f.flush(),x)):_(O,E,N,x),y()}).catch(function(){return Promise.reject()})};return S()},d}();function i(d,w){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(h({},d.headers))};return d.rangeEnd&&T.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),T}function r(d,w){return new self.Request(d.url,w)}var n=function(d){B(w,d);function w(T,x,O){var E;return E=d.call(this,T)||this,E.code=void 0,E.details=void 0,E.code=x,E.details=O,E}return w}(M(Error));V.default=l},"./src/utils/imsc1-ttml-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"IMSC1_CODEC",function(){return p}),P.d(V,"parseIMSC1",function(){return s});var Y=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/vttparser.ts"),R=P("./src/utils/vttcue.ts"),B=P("./src/demux/id3.ts"),M=P("./src/utils/timescale-conversion.ts"),L=P("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(v){for(var _=1;_<arguments.length;_++){var f=arguments[_];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(v[c]=f[c])}return v},I.apply(this,arguments)}var p="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,u=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(v,_,f,c,S){var y=Object(Y.findBox)(new Uint8Array(v),["mdat"]);if(y.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var b=y[0],N=Object(B.utf8ArrayToStr)(new Uint8Array(v,b.start,b.end-b.start)),F=Object(M.toTimescaleFromScale)(_,1,f);try{c(l(N,F))}catch(X){S(X)}}function l(v,_){var f=new DOMParser,c=f.parseFromString(v,"text/xml"),S=c.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},b=Object.keys(y).reduce(function(H,A){return H[A]=S.getAttribute("ttp:"+A)||y[A],H},{}),N=S.getAttribute("xml:space")!=="preserve",F=r(i(S,"styling","style")),X=r(i(S,"layout","region")),Z=i(S,"body","[begin]");return[].map.call(Z,function(H){var A=n(H,N);if(!A||!H.hasAttribute("begin"))return null;var z=x(H.getAttribute("begin"),b),ne=x(H.getAttribute("dur"),b),ae=x(H.getAttribute("end"),b);if(z===null)throw T(H);if(ae===null){if(ne===null)throw T(H);ae=z+ne}var me=new R.default(z-_,ae-_,A);me.id=Object(L.generateCueId)(me.startTime,me.endTime,me.text);var xe=X[H.getAttribute("region")],Te=F[H.getAttribute("style")];me.position=10,me.size=80;var Oe=d(xe,Te),Ue=Oe.textAlign;if(Ue){var De=h[Ue];De&&(me.lineAlign=De),me.align=Ue}return I(me,Oe),me}).filter(function(H){return H!==null})}function i(v,_,f){var c=v.getElementsByTagName(_)[0];return c?[].slice.call(c.querySelectorAll(f)):[]}function r(v){return v.reduce(function(_,f){var c=f.getAttribute("xml:id");return c&&(_[c]=f),_},{})}function n(v,_){return[].slice.call(v.childNodes).reduce(function(f,c,S){var y;return c.nodeName==="br"&&S?f+`
`:(y=c.childNodes)!==null&&y!==void 0&&y.length?n(c,_):_?f+c.textContent.trim().replace(/\s+/g," "):f+c.textContent},"")}function d(v,_){var f="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(S,y){var b=w(_,f,y)||w(v,f,y);return b&&(S[y]=b),S},{})}function w(v,_,f){return v.hasAttributeNS(_,f)?v.getAttributeNS(_,f):null}function T(v){return new Error("Could not parse ttml timestamp "+v)}function x(v,_){if(!v)return null;var f=Object(W.parseTimeStamp)(v);return f===null&&(m.test(v)?f=O(v,_):u.test(v)&&(f=E(v,_))),f}function O(v,_){var f=m.exec(v),c=(f[4]|0)+(f[5]|0)/_.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+c/_.frameRate}function E(v,_){var f=u.exec(v),c=Number(f[1]),S=f[2];switch(S){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/_.frameRate;case"t":return c/_.tickRate}return c}},"./src/utils/logger.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"enableLogs",function(){return L}),P.d(V,"logger",function(){return I});var Y=function(){},W={trace:Y,debug:Y,log:Y,warn:Y,info:Y,error:Y},R=W;function B(p){var m=self.console[p];return m?m.bind(self.console,"["+p+"] >"):Y}function M(p){for(var m=arguments.length,u=new Array(m>1?m-1:0),h=1;h<m;h++)u[h-1]=arguments[h];u.forEach(function(s){R[s]=p[s]?p[s].bind(p):B(s)})}function L(p){if(self.console&&p===!0||typeof p=="object"){M(p,"debug","log","info","warn","error");try{R.log()}catch(m){R=W}}else R=W}var I=R},"./src/utils/mediakeys-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"KeySystems",function(){return Y}),P.d(V,"requestMediaKeySystemAccess",function(){return W});var Y;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(Y||(Y={}));var W=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"getMediaSource",function(){return Y});function Y(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"bin2str",function(){return M}),P.d(V,"readUint16",function(){return L}),P.d(V,"readUint32",function(){return I}),P.d(V,"writeUint32",function(){return p}),P.d(V,"findBox",function(){return m}),P.d(V,"parseSegmentIndex",function(){return u}),P.d(V,"parseInitSegment",function(){return h}),P.d(V,"getStartDTS",function(){return s}),P.d(V,"getDuration",function(){return l}),P.d(V,"computeRawDurationFromSamples",function(){return i}),P.d(V,"offsetStartDTS",function(){return r}),P.d(V,"segmentValidRange",function(){return n}),P.d(V,"appendUint8Array",function(){return d});var Y=P("./src/utils/typed-array.ts"),W=P("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,B=[].push;function M(w){return String.fromCharCode.apply(null,w)}function L(w,T){"data"in w&&(T+=w.start,w=w.data);var x=w[T]<<8|w[T+1];return x<0?65536+x:x}function I(w,T){"data"in w&&(T+=w.start,w=w.data);var x=w[T]<<24|w[T+1]<<16|w[T+2]<<8|w[T+3];return x<0?4294967296+x:x}function p(w,T,x){"data"in w&&(T+=w.start,w=w.data),w[T]=x>>24,w[T+1]=x>>16&255,w[T+2]=x>>8&255,w[T+3]=x&255}function m(w,T){var x=[];if(!T.length)return x;var O,E,v;"data"in w?(O=w.data,E=w.start,v=w.end):(O=w,E=0,v=O.byteLength);for(var _=E;_<v;){var f=I(O,_),c=M(O.subarray(_+4,_+8)),S=f>1?_+f:v;if(c===T[0])if(T.length===1)x.push({data:O,start:_+8,end:S});else{var y=m({data:O,start:_+8,end:S},T.slice(1));y.length&&B.apply(x,y)}_=S}return x}function u(w){var T=m(w,["moov"]),x=T[0],O=x?x.end:null,E=m(w,["sidx"]);if(!E||!E[0])return null;var v=[],_=E[0],f=_.data[0],c=f===0?8:16,S=I(_,c);c+=4;var y=0,b=0;f===0?c+=8:c+=16,c+=2;var N=_.end+b,F=L(_,c);c+=2;for(var X=0;X<F;X++){var Z=c,H=I(_,Z);Z+=4;var A=H&2147483647,z=(H&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=I(_,Z);Z+=4,v.push({referenceSize:A,subsegmentDuration:ne,info:{duration:ne/S,start:N,end:N+A-1}}),N+=A,Z+=4,c=Z}return{earliestPresentationTime:y,timescale:S,version:f,referencesCount:F,references:v,moovEndOffset:O}}function h(w){for(var T=[],x=m(w,["moov","trak"]),O=0;O<x.length;O++){var E=x[O],v=m(E,["tkhd"])[0];if(v){var _=v.data[v.start],f=_===0?12:20,c=I(v,f),S=m(E,["mdia","mdhd"])[0];if(S){_=S.data[S.start],f=_===0?12:20;var y=I(S,f),b=m(E,["mdia","hdlr"])[0];if(b){var N=M(b.data.subarray(b.start+8,b.start+12)),F={soun:W.ElementaryStreamTypes.AUDIO,vide:W.ElementaryStreamTypes.VIDEO}[N];if(F){var X=m(E,["mdia","minf","stbl","stsd"])[0],Z=void 0;X&&(Z=M(X.data.subarray(X.start+12,X.start+16))),T[c]={timescale:y,type:F},T[F]={timescale:y,id:c,codec:Z}}}}}}var H=m(w,["moov","mvex","trex"]);return H.forEach(function(A){var z=I(A,4),ne=T[z];ne&&(ne.default={duration:I(A,12),flags:I(A,20)})}),T}function s(w,T){return m(T,["moof","traf"]).reduce(function(x,O){var E=m(O,["tfdt"])[0],v=E.data[E.start],_=m(O,["tfhd"]).reduce(function(f,c){var S=I(c,4),y=w[S];if(y){var b=I(E,4);v===1&&(b*=Math.pow(2,32),b+=I(E,8));var N=y.timescale||9e4,F=b/N;if(isFinite(F)&&(f===null||F<f))return F}return f},null);return _!==null&&isFinite(_)&&(x===null||_<x)?_:x},null)||0}function l(w,T){for(var x=0,O=0,E=0,v=m(w,["moof","traf"]),_=0;_<v.length;_++){var f=v[_],c=m(f,["tfhd"])[0],S=I(c,4),y=T[S];if(!y)continue;var b=y.default,N=I(c,0)|(b==null?void 0:b.flags),F=b==null?void 0:b.duration;N&8&&(N&2?F=I(c,12):F=I(c,8));for(var X=y.timescale||9e4,Z=m(f,["trun"]),H=0;H<Z.length;H++){if(F){var A=I(Z[H],4);x=F*A}else x=i(Z[H]);y.type===W.ElementaryStreamTypes.VIDEO?O+=x/X:y.type===W.ElementaryStreamTypes.AUDIO&&(E+=x/X)}}if(O===0&&E===0){var z=u(w);if(z!=null&&z.references)return z.references.reduce(function(ne,ae){return ne+ae.info.duration||0},0)}return O||E}function i(w){var T=I(w,0),x=8;T&1&&(x+=4),T&4&&(x+=4);for(var O=0,E=I(w,4),v=0;v<E;v++){if(T&256){var _=I(w,x);O+=_,x+=4}T&512&&(x+=4),T&1024&&(x+=4),T&2048&&(x+=4)}return O}function r(w,T,x){m(T,["moof","traf"]).forEach(function(O){m(O,["tfhd"]).forEach(function(E){var v=I(E,4),_=w[v];if(!_)return;var f=_.timescale||9e4;m(O,["tfdt"]).forEach(function(c){var S=c.data[c.start],y=I(c,4);if(S===0)p(c,4,y-x*f);else{y*=Math.pow(2,32),y+=I(c,8),y-=x*f,y=Math.max(y,0);var b=Math.floor(y/(R+1)),N=Math.floor(y%(R+1));p(c,4,b),p(c,8,N)}})})})}function n(w){var T={valid:null,remainder:null},x=m(w,["moof"]);if(x){if(x.length<2)return T.remainder=w,T}else return T;var O=x[x.length-1];return T.valid=Object(Y.sliceUint8)(w,0,O.start-8),T.remainder=Object(Y.sliceUint8)(w,O.start-8),T}function d(w,T){var x=new Uint8Array(w.length+T.length);return x.set(w),x.set(T,w.length),x}},"./src/utils/output-filter.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"default",function(){return Y});var Y=function(){function W(B,M){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=M}var R=W.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(M,L,I){(this.startTime===null||this.startTime>M)&&(this.startTime=M),this.endTime=L,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},W}()},"./src/utils/texttrack-utils.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"sendAddTrackEvent",function(){return W}),P.d(V,"addCueToTrack",function(){return R}),P.d(V,"clearCurrentCues",function(){return B}),P.d(V,"removeCuesInRange",function(){return M}),P.d(V,"getCuesInRange",function(){return I});var Y=P("./src/utils/logger.ts");function W(p,m){var u;try{u=new Event("addtrack")}catch(h){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=p,m.dispatchEvent(u)}function R(p,m){var u=p.mode;if(u==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(m.id))try{if(p.addCue(m),!p.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(s){Y.logger.debug("[texttrack-utils]: "+s);var h=new self.TextTrackCue(m.startTime,m.endTime,m.text);h.id=m.id,p.addCue(h)}u==="disabled"&&(p.mode=u)}function B(p){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues)for(var u=p.cues.length;u--;)p.removeCue(p.cues[u]);m==="disabled"&&(p.mode=m)}function M(p,m,u){var h=p.mode;if(h==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var s=I(p.cues,m,u),l=0;l<s.length;l++)p.removeCue(s[l]);h==="disabled"&&(p.mode=h)}function L(p,m){if(m<p[0].startTime)return 0;var u=p.length-1;if(m>p[u].endTime)return-1;for(var h=0,s=u;h<=s;){var l=Math.floor((s+h)/2);if(m<p[l].startTime)s=l-1;else if(m>p[l].startTime&&h<u)h=l+1;else return l}return p[h].startTime-m<m-p[s].startTime?h:s}function I(p,m,u){var h=[],s=L(p,m);if(s>-1)for(var l=s,i=p.length;l<i;l++){var r=p[l];if(r.startTime>=m&&r.endTime<=u)h.push(r);else if(r.startTime>u)return h}return h}},"./src/utils/time-ranges.ts":function(ee,V,P){"use strict";P.r(V);var Y={toString:function(R){for(var B="",M=R.length,L=0;L<M;L++)B+="["+R.start(L).toFixed(3)+","+R.end(L).toFixed(3)+"]";return B}};V.default=Y},"./src/utils/timescale-conversion.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"toTimescaleFromBase",function(){return W}),P.d(V,"toTimescaleFromScale",function(){return R}),P.d(V,"toMsFromMpegTsClock",function(){return B}),P.d(V,"toMpegTsClockFromTimescale",function(){return M});var Y=9e4;function W(L,I,p,m){p===void 0&&(p=1),m===void 0&&(m=!1);var u=L*I*p;return m?Math.round(u):u}function R(L,I,p,m){return p===void 0&&(p=1),m===void 0&&(m=!1),W(L,I,1/p,m)}function B(L,I){return I===void 0&&(I=!1),W(L,1e3,1/Y,I)}function M(L,I){return I===void 0&&(I=1),W(L,Y,1/I)}},"./src/utils/typed-array.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"sliceUint8",function(){return Y});function Y(W,R,B){return Uint8Array.prototype.slice?W.slice(R,B):new Uint8Array(Array.prototype.slice.call(W,R,B))}},"./src/utils/vttcue.ts":function(ee,V,P){"use strict";P.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Y=["","lr","rl"],W=["start","middle","end","left","right"];function R(p,m){if(typeof m!="string")return!1;if(!Array.isArray(p))return!1;var u=m.toLowerCase();return~p.indexOf(u)?u:!1}function B(p){return R(Y,p)}function M(p){return R(W,p)}function L(p){for(var m=arguments.length,u=new Array(m>1?m-1:0),h=1;h<m;h++)u[h-1]=arguments[h];for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var i in l)p[i]=l[i]}return p}function I(p,m,u){var h=this,s={enumerable:!0};h.hasBeenReset=!1;var l="",i=!1,r=p,n=m,d=u,w=null,T="",x=!0,O="auto",E="start",v=50,_="middle",f=50,c="middle";Object.defineProperty(h,"id",L({},s,{get:function(){return l},set:function(y){l=""+y}})),Object.defineProperty(h,"pauseOnExit",L({},s,{get:function(){return i},set:function(y){i=!!y}})),Object.defineProperty(h,"startTime",L({},s,{get:function(){return r},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",L({},s,{get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");n=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",L({},s,{get:function(){return d},set:function(y){d=""+y,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",L({},s,{get:function(){return w},set:function(y){w=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",L({},s,{get:function(){return T},set:function(y){var b=B(y);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",L({},s,{get:function(){return x},set:function(y){x=!!y,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",L({},s,{get:function(){return O},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",L({},s,{get:function(){return E},set:function(y){var b=M(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",L({},s,{get:function(){return v},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");v=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",L({},s,{get:function(){return _},set:function(y){var b=M(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");_=b,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",L({},s,{get:function(){return f},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");f=y,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",L({},s,{get:function(){return c},set:function(y){var b=M(y);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");c=b,this.hasBeenReset=!0}})),h.displayState=void 0}return I.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"parseTimeStamp",function(){return R}),P.d(V,"fixLineBreaks",function(){return m}),P.d(V,"VTTParser",function(){return u});var Y=P("./src/utils/vttcue.ts"),W=function(){function h(){}var s=h.prototype;return s.decode=function(i,r){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},h}();function R(h){function s(i,r,n,d){return(i|0)*3600+(r|0)*60+(n|0)+parseFloat(d||0)}var l=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?s(l[2],l[3],0,l[4]):s(l[1],l[2],l[3],l[4]):null}var B=function(){function h(){this.values=Object.create(null)}var s=h.prototype;return s.set=function(i,r){!this.get(i)&&r!==""&&(this.values[i]=r)},s.get=function(i,r,n){return n?this.has(i)?this.values[i]:r[n]:this.has(i)?this.values[i]:r},s.has=function(i){return i in this.values},s.alt=function(i,r,n){for(var d=0;d<n.length;++d)if(r===n[d]){this.set(i,r);break}},s.integer=function(i,r){/^-?\d+$/.test(r)&&this.set(i,parseInt(r,10))},s.percent=function(i,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var n=parseFloat(r);if(n>=0&&n<=100)return this.set(i,n),!0}return!1},h}();function M(h,s,l,i){var r=i?h.split(i):[h];for(var n in r){if(typeof r[n]!="string")continue;var d=r[n].split(l);if(d.length!==2)continue;var w=d[0],T=d[1];s(w,T)}}var L=new Y.default(0,0,""),I=L.align==="middle"?"middle":"center";function p(h,s,l){var i=h;function r(){var w=R(h);if(w===null)throw new Error("Malformed timestamp: "+i);return h=h.replace(/^[^\sa-zA-Z-]+/,""),w}function n(w,T){var x=new B;M(w,function(v,_){var f;switch(v){case"region":for(var c=l.length-1;c>=0;c--)if(l[c].id===_){x.set(v,l[c].region);break}break;case"vertical":x.alt(v,_,["rl","lr"]);break;case"line":f=_.split(","),x.integer(v,f[0]),x.percent(v,f[0])&&x.set("snapToLines",!1),x.alt(v,f[0],["auto"]),f.length===2&&x.alt("lineAlign",f[1],["start",I,"end"]);break;case"position":f=_.split(","),x.percent(v,f[0]),f.length===2&&x.alt("positionAlign",f[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(v,_);break;case"align":x.alt(v,_,["start",I,"end","left","right"]);break}},/:/,/\s/),T.region=x.get("region",null),T.vertical=x.get("vertical","");var O=x.get("line","auto");O==="auto"&&L.line===-1&&(O=-1),T.line=O,T.lineAlign=x.get("lineAlign","start"),T.snapToLines=x.get("snapToLines",!0),T.size=x.get("size",100),T.align=x.get("align",I);var E=x.get("position","auto");E==="auto"&&L.position===50&&(E=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=E}function d(){h=h.replace(/^\s+/,"")}if(d(),s.startTime=r(),d(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);h=h.substr(3),d(),s.endTime=r(),d(),n(h,s)}function m(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var u=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new W,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=h.prototype;return s.parse=function(i){var r=this;i&&(r.buffer+=r.decoder.decode(i,{stream:!0}));function n(){var E=r.buffer,v=0;for(E=m(E);v<E.length&&E[v]!=="\r"&&E[v]!==`
`;)++v;var _=E.substr(0,v);return E[v]==="\r"&&++v,E[v]===`
`&&++v,r.buffer=E.substr(v),_}function d(E){M(E,function(v,_){},/:/)}try{var w="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;w=n();var T=w.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var x=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;x?x=!1:w=n();switch(r.state){case"HEADER":/:/.test(w)?d(w):w||(r.state="ID");continue;case"NOTE":w||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){r.state="NOTE";break}if(!w)continue;if(r.cue=new Y.default(0,0,""),r.state="CUE",w.indexOf("-->")===-1){r.cue.id=w;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{p(w,r.cue,r.regionList)}catch(E){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var O=w.indexOf("-->")!==-1;if(!w||O&&(x=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=w}continue;case"BADCUE":w||(r.state="ID")}}}catch(E){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){i.onparsingerror&&i.onparsingerror(r)}return i.onflush&&i.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ee,V,P){"use strict";P.r(V),P.d(V,"generateCueId",function(){return u}),P.d(V,"parseWebVTT",function(){return s});var Y=P("./src/polyfills/number.ts"),W=P("./src/utils/vttparser.ts"),R=P("./src/demux/id3.ts"),B=P("./src/utils/timescale-conversion.ts"),M=P("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,I=function(i,r,n){return n===void 0&&(n=0),i.substr(n,r.length)===r},p=function(i){var r=parseInt(i.substr(-3)),n=parseInt(i.substr(-6,2)),d=parseInt(i.substr(-9,2)),w=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(Y.isFiniteNumber)(r)||!Object(Y.isFiniteNumber)(n)||!Object(Y.isFiniteNumber)(d)||!Object(Y.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return r+=1e3*n,r+=60*1e3*d,r+=60*60*1e3*w,r},m=function(i){for(var r=5381,n=i.length;n;)r=r*33^i.charCodeAt(--n);return(r>>>0).toString()};function u(l,i,r){return m(l.toString())+m(i.toString())+m(r)}var h=function(i,r,n){var d=i[r],w=i[d.prevCC];if(!w||!w.new&&d.new){i.ccOffset=i.presentationOffset=d.start,d.new=!1;return}for(;(T=w)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=d.start-w.start,d.new=!1,d=w,w=i[d.prevCC]}i.presentationOffset=n};function s(l,i,r,n,d,w,T,x){var O=new W.VTTParser,E=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(L,`
`).split(`
`),v=[],_=Object(B.toMpegTsClockFromTimescale)(i,r),f="00:00.000",c=0,S=0,y,b=!0,N=!1;O.oncue=function(F){var X=n[d],Z=n.ccOffset,H=(c-_)/9e4;if(X!=null&&X.new&&(S!==void 0?Z=n.ccOffset=X.start:h(n,d,H)),H&&(Z=H-n.presentationOffset),N){var A=F.endTime-F.startTime,z=Object(M.normalizePts)((F.startTime+Z-S)*9e4,w*9e4)/9e4;F.startTime=z,F.endTime=z+A}var ne=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(ne)),F.id||(F.id=u(F.startTime,F.endTime,ne)),F.endTime>0&&v.push(F)},O.onparsingerror=function(F){y=F},O.onflush=function(){if(y){x(y);return}T(v)},E.forEach(function(F){if(b)if(I(F,"X-TIMESTAMP-MAP=")){b=!1,N=!0,F.substr(16).split(",").forEach(function(X){I(X,"LOCAL:")?f=X.substr(6):I(X,"MPEGTS:")&&(c=parseInt(X.substr(7)))});try{S=p(f)/1e3}catch(X){N=!1,y=X}return}else F===""&&(b=!1);O.parse(F+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(ee,V,P){"use strict";P.r(V);var Y=P("./src/utils/logger.ts"),W=P("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,B=function(){function M(I){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=I?I.xhrSetup:null,this.stats=new W.LoadStats,this.retryDelay=0}var L=M.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},L.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(p,m,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=m,this.callbacks=u,this.retryDelay=m.retryDelay,this.loadInternal()},L.loadInternal=function(){var p=this.config,m=this.context;if(!p)return;var u=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var s=this.xhrSetup;try{if(s)try{s(u,m.url)}catch(r){u.open("GET",m.url,!0),s(u,m.url)}u.readyState||u.open("GET",m.url,!0);var l=this.context.headers;if(l)for(var i in l)u.setRequestHeader(i,l[i])}catch(r){this.callbacks.onError({code:u.status,text:r.message},m,u);return}m.rangeEnd&&u.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),u.send()},L.readystatechange=function(){var p=this.context,m=this.loader,u=this.stats;if(!p||!m)return;var h=m.readyState,s=this.config;if(u.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),h===4){m.onreadystatechange=null,m.onprogress=null;var l=m.status;if(l>=200&&l<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var i,r;if(p.responseType==="arraybuffer"?(i=m.response,r=i.byteLength):(i=m.responseText,r=i.length),u.loaded=u.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,p,i,m),!this.callbacks)return;var d={url:m.responseURL,data:i};this.callbacks.onSuccess(d,u,p,m)}else u.retry>=s.maxRetry||l>=400&&l<499?(Y.logger.error(l+" while loading "+p.url),this.callbacks.onError({code:l,text:m.statusText},p,m)):(Y.logger.warn(l+" while loading "+p.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,s.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},L.loadtimeout=function(){Y.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(p){var m=this.stats;m.loaded=p.loaded,p.lengthComputable&&(m.total=p.total)},L.getCacheAge=function(){var p=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");p=m?parseFloat(m):null}return p},M}();V.default=B}}).default})},vHTk:function(Be,we,k){Be.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(Be,we,k){Be.exports={upload:"upload___3GNI5"}},wCXF:function(Be,we,k){"use strict";k.d(we,"a",function(){return lt});var ee=k("rePB"),V=k("VTBJ"),P=k("KQm4"),Y=k("U8pU"),W=k("ODXe"),R=k("cDcd"),B=k("TSYQ"),M=k.n(B),L=k("Gytx"),I=k.n(L),p=k("Kwbf"),m=k("t23M"),u=k("qx4F"),h=k("6eGT"),s=k("IBYe"),l=k("Ff2n"),i=k("c+Xe"),r=k("fyJ8"),n=k("biw7");function d(Me,Pe,tt,rt,Fe){var Je=tt[Me]||{},Ee=tt[Pe]||{},ye,_e;Je.fixed==="left"?ye=rt.left[Me]:Ee.fixed==="right"&&(_e=rt.right[Pe]);var le=!1,de=!1,ve=!1,pe=!1,Ce=tt[Pe+1],Ke=tt[Me-1];if(Fe==="rtl"){if(ye!==void 0){var st=Ke&&Ke.fixed==="left";pe=!st}else if(_e!==void 0){var At=Ce&&Ce.fixed==="right";ve=!At}}else if(ye!==void 0){var Ft=Ce&&Ce.fixed==="left";le=!Ft}else if(_e!==void 0){var kt=Ke&&Ke.fixed==="right";de=!kt}return{fixLeft:ye,fixRight:_e,lastFixLeft:le,firstFixRight:de,lastFixRight:ve,firstFixLeft:pe,isSticky:rt.isSticky}}var w=k("sR1s");function T(Me){var Pe=Me.cells,tt=Me.stickyOffsets,rt=Me.flattenColumns,Fe=Me.rowComponent,Je=Me.cellComponent,Ee=Me.onHeaderRow,ye=Me.index,_e=R.useContext(n.a),le=_e.prefixCls,de=_e.direction,ve;Ee&&(ve=Ee(Pe.map(function(Ce){return Ce.column}),ye));var pe=Object(w.a)(Pe.map(function(Ce){return Ce.column}));return R.createElement(Fe,Object.assign({},ve),Pe.map(function(Ce,Ke){var st=Ce.column,At=d(Ce.colStart,Ce.colEnd,rt,tt,de),Ft;return st&&st.onHeaderCell&&(Ft=Ce.column.onHeaderCell(st)),R.createElement(r.a,Object.assign({},Ce,{ellipsis:st.ellipsis,align:st.align,component:Je,prefixCls:le,key:pe[Ke]},At,{additionalProps:Ft,rowType:"header"}))}))}T.displayName="HeaderRow";var x=T;function O(Me){var Pe=[];function tt(Ee,ye){var _e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Pe[_e]=Pe[_e]||[];var le=ye,de=Ee.filter(Boolean).map(function(ve){var pe={key:ve.key,className:ve.className||"",children:ve.title,column:ve,colStart:le},Ce=1,Ke=ve.children;return Ke&&Ke.length>0&&(Ce=tt(Ke,le,_e+1).reduce(function(st,At){return st+At},0),pe.hasSubColumns=!0),"colSpan"in ve&&(Ce=ve.colSpan),"rowSpan"in ve&&(pe.rowSpan=ve.rowSpan),pe.colSpan=Ce,pe.colEnd=pe.colStart+Ce-1,Pe[_e].push(pe),le+=Ce,Ce});return de}tt(Me,0);for(var rt=Pe.length,Fe=function(ye){Pe[ye].forEach(function(_e){!("rowSpan"in _e)&&!_e.hasSubColumns&&(_e.rowSpan=rt-ye)})},Je=0;Je<rt;Je+=1)Fe(Je);return Pe}function E(Me){var Pe=Me.stickyOffsets,tt=Me.columns,rt=Me.flattenColumns,Fe=Me.onHeaderRow,Je=R.useContext(n.a),Ee=Je.prefixCls,ye=Je.getComponent,_e=R.useMemo(function(){return O(tt)},[tt]),le=ye(["header","wrapper"],"thead"),de=ye(["header","row"],"tr"),ve=ye(["header","cell"],"th");return R.createElement(le,{className:"".concat(Ee,"-thead")},_e.map(function(pe,Ce){var Ke=R.createElement(x,{key:Ce,flattenColumns:rt,cells:pe,stickyOffsets:Pe,rowComponent:de,cellComponent:ve,onHeaderRow:Fe,index:Ce});return Ke}))}var v=E,_=k("hW8S");function f(Me){for(var Pe=Me.colWidths,tt=Me.columns,rt=Me.columCount,Fe=[],Je=rt||tt.length,Ee=!1,ye=Je-1;ye>=0;ye-=1){var _e=Pe[ye],le=tt&&tt[ye],de=le&&le[_.a];(_e||de||Ee)&&(Fe.unshift(R.createElement("col",Object.assign({key:ye,style:{width:_e,minWidth:_e}},de))),Ee=!0)}return R.createElement("colgroup",null,Fe)}var c=f;function S(Me,Pe){return Object(R.useMemo)(function(){for(var tt=[],rt=0;rt<Pe;rt+=1){var Fe=Me[rt];if(Fe!==void 0)tt[rt]=Fe;else return null}return tt},[Me.join("_"),Pe])}var y=R.forwardRef(function(Me,Pe){var tt=Me.noData,rt=Me.columns,Fe=Me.flattenColumns,Je=Me.colWidths,Ee=Me.columCount,ye=Me.stickyOffsets,_e=Me.direction,le=Me.fixHeader,de=Me.offsetHeader,ve=Me.stickyClassName,pe=Me.onScroll,Ce=Object(l.a)(Me,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ke=R.useContext(n.a),st=Ke.prefixCls,At=Ke.scrollbarSize,Ft=Ke.isSticky,kt=Ft&&!le?0:At,wt=R.useRef(null),Qe=R.useCallback(function(Lt){Object(i.b)(Pe,Lt),Object(i.b)(wt,Lt)},[]);R.useEffect(function(){var Lt;function Dt(ke){var qe=ke.currentTarget,Rt=ke.deltaX;Rt&&(pe({currentTarget:qe,scrollLeft:qe.scrollLeft+Rt}),ke.preventDefault())}return(Lt=wt.current)===null||Lt===void 0||Lt.addEventListener("wheel",Dt),function(){var ke;(ke=wt.current)===null||ke===void 0||ke.removeEventListener("wheel",Dt)}},[]);var it=Fe[Fe.length-1],We={fixed:it?it.fixed:null,onHeaderCell:function(){return{className:"".concat(st,"-cell-scrollbar")}}},ce=Object(R.useMemo)(function(){return kt?[].concat(Object(P.a)(rt),[We]):rt},[kt,rt]),Se=Object(R.useMemo)(function(){return kt?[].concat(Object(P.a)(Fe),[We]):Fe},[kt,Fe]),ot=Object(R.useMemo)(function(){var Lt=ye.right,Dt=ye.left;return Object(V.a)(Object(V.a)({},ye),{},{left:_e==="rtl"?[].concat(Object(P.a)(Dt.map(function(ke){return ke+kt})),[0]):Dt,right:_e==="rtl"?Lt:[].concat(Object(P.a)(Lt.map(function(ke){return ke+kt})),[0]),isSticky:Ft})},[kt,ye,Ft]),ze=S(Je,Ee);return R.createElement("div",{style:Object(V.a)({overflow:"hidden"},Ft?{top:de}:{}),ref:Qe,className:M()("".concat(st,"-header"),Object(ee.a)({},ve,!!ve))},R.createElement("table",{style:{tableLayout:"fixed",visibility:tt||ze?null:"hidden"}},R.createElement(c,{colWidths:ze?[].concat(Object(P.a)(ze),[kt]):[],columCount:Ee+1,columns:Se}),R.createElement(v,Object.assign({},Ce,{stickyOffsets:ot,columns:ce,flattenColumns:Se}))))});y.displayName="FixedHeader";var b=y,N=R.createContext(null),F=N;function X(Me){var Pe=Me.prefixCls,tt=Me.children,rt=Me.component,Fe=Me.cellComponent,Je=Me.fixHeader,Ee=Me.fixColumn,ye=Me.horizonScroll,_e=Me.className,le=Me.expanded,de=Me.componentWidth,ve=Me.colSpan,pe=R.useContext(n.a),Ce=pe.scrollbarSize;return R.useMemo(function(){var Ke=tt;return Ee&&(Ke=R.createElement("div",{style:{width:de-(Je?Ce:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Pe,"-expanded-row-fixed")},Ke)),R.createElement(rt,{className:_e,style:{display:le?null:"none"}},R.createElement(r.a,{component:Fe,prefixCls:Pe,colSpan:ve},Ke))},[tt,rt,Je,ye,_e,le,de,ve,Ce])}var Z=X;function H(Me){var Pe=Me.className,tt=Me.style,rt=Me.record,Fe=Me.index,Je=Me.rowKey,Ee=Me.getRowKey,ye=Me.rowExpandable,_e=Me.expandedKeys,le=Me.onRow,de=Me.indent,ve=de===void 0?0:de,pe=Me.rowComponent,Ce=Me.cellComponent,Ke=Me.childrenColumnName,st=R.useContext(n.a),At=st.prefixCls,Ft=st.fixedInfoList,kt=R.useContext(F),wt=kt.fixHeader,Qe=kt.fixColumn,it=kt.horizonScroll,We=kt.componentWidth,ce=kt.flattenColumns,Se=kt.expandableType,ot=kt.expandRowByClick,ze=kt.onTriggerExpand,Lt=kt.rowClassName,Dt=kt.expandedRowClassName,ke=kt.indentSize,qe=kt.expandIcon,Rt=kt.expandedRowRender,Pt=kt.expandIconColumnIndex,$t=R.useState(!1),fe=Object(W.a)($t,2),se=fe[0],U=fe[1],G=_e&&_e.has(Me.recordKey);R.useEffect(function(){G&&U(!0)},[G]);var Q=Se==="row"&&(!ye||ye(rt)),te=Se==="nest",he=Ke&&rt&&rt[Ke],Le=Q||te,Ge;le&&(Ge=le(rt,Fe));var Ot=function(C){if(ot&&Le&&ze(rt,C),Ge&&Ge.onClick){for(var D,K=arguments.length,re=new Array(K>1?K-1:0),J=1;J<K;J++)re[J-1]=arguments[J];(D=Ge).onClick.apply(D,[C].concat(re))}},Nt;typeof Lt=="string"?Nt=Lt:typeof Lt=="function"&&(Nt=Lt(rt,Fe,ve));var Xe=Object(w.a)(ce),It=R.createElement(pe,Object.assign({},Ge,{"data-row-key":Je,className:M()(Pe,"".concat(At,"-row"),"".concat(At,"-row-level-").concat(ve),Nt,Ge&&Ge.className),style:Object(V.a)(Object(V.a)({},tt),Ge?Ge.style:null),onClick:Ot}),ce.map(function($,C){var D=$.render,K=$.dataIndex,re=$.className,J=Xe[C],Re=Ft[C],ut;C===(Pt||0)&&te&&(ut=R.createElement(R.Fragment,null,R.createElement("span",{style:{paddingLeft:"".concat(ke*ve,"px")},className:"".concat(At,"-row-indent indent-level-").concat(ve)}),qe({prefixCls:At,expanded:G,expandable:he,record:rt,onExpand:ze})));var St;return $.onCell&&(St=$.onCell(rt,Fe)),R.createElement(r.a,Object.assign({className:re,ellipsis:$.ellipsis,align:$.align,component:Ce,prefixCls:At,key:J,record:rt,index:Fe,dataIndex:K,render:D,shouldCellUpdate:$.shouldCellUpdate},Re,{appendNode:ut,additionalProps:St}))})),an;if(Q&&(se||G)){var Ct=Rt(rt,Fe,ve+1,G),pn=Dt&&Dt(rt,Fe,ve);an=R.createElement(Z,{expanded:G,className:M()("".concat(At,"-expanded-row"),"".concat(At,"-expanded-row-level-").concat(ve+1),pn),prefixCls:At,fixHeader:wt,fixColumn:Qe,horizonScroll:it,component:pe,componentWidth:We,cellComponent:Ce,colSpan:ce.length},Ct)}var nn;return he&&G&&(nn=(rt[Ke]||[]).map(function($,C){var D=Ee($,C);return R.createElement(H,Object.assign({},Me,{key:D,rowKey:D,record:$,recordKey:D,index:C,indent:ve+1}))})),R.createElement(R.Fragment,null,It,an,nn)}H.displayName="BodyRow";var A=H,z=R.createContext(null),ne=z;function ae(Me){var Pe=Me.columnKey,tt=Me.onColumnResize,rt=R.useRef();return R.useEffect(function(){rt.current&&tt(Pe,rt.current.offsetWidth)},[]),R.createElement(m.a,{onResize:function(Je){var Ee=Je.offsetWidth;tt(Pe,Ee)}},R.createElement("td",{ref:rt,style:{padding:0,border:0,height:0}},R.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function me(Me){var Pe=Me.data,tt=Me.getRowKey,rt=Me.measureColumnWidth,Fe=Me.expandedKeys,Je=Me.onRow,Ee=Me.rowExpandable,ye=Me.emptyNode,_e=Me.childrenColumnName,le=R.useContext(ne),de=le.onColumnResize,ve=R.useContext(n.a),pe=ve.prefixCls,Ce=ve.getComponent,Ke=R.useContext(F),st=Ke.fixHeader,At=Ke.horizonScroll,Ft=Ke.flattenColumns,kt=Ke.componentWidth;return R.useMemo(function(){var wt=Ce(["body","wrapper"],"tbody"),Qe=Ce(["body","row"],"tr"),it=Ce(["body","cell"],"td"),We;Pe.length?We=Pe.map(function(Se,ot){var ze=tt(Se,ot);return R.createElement(A,{key:ze,rowKey:ze,record:Se,recordKey:ze,index:ot,rowComponent:Qe,cellComponent:it,expandedKeys:Fe,onRow:Je,getRowKey:tt,rowExpandable:Ee,childrenColumnName:_e})}):We=R.createElement(Z,{expanded:!0,className:"".concat(pe,"-placeholder"),prefixCls:pe,fixHeader:st,fixColumn:At,horizonScroll:At,component:Qe,componentWidth:kt,cellComponent:it,colSpan:Ft.length},ye);var ce=Object(w.a)(Ft);return R.createElement(wt,{className:"".concat(pe,"-tbody")},rt&&R.createElement("tr",{"aria-hidden":"true",className:"".concat(pe,"-measure-row"),style:{height:0}},ce.map(function(Se){return R.createElement(ae,{key:Se,columnKey:Se,onColumnResize:de})})),We)},[Pe,pe,Je,rt,Fe,tt,Ce,kt,ye,Ft])}var xe=R.memo(me);xe.displayName="Body";var Te=xe,Oe=k("wRmb"),Ue=k("xEkU"),De=k.n(Ue);function be(Me){var Pe=Object(R.useRef)(Me),tt=Object(R.useState)({}),rt=Object(W.a)(tt,2),Fe=rt[1],Je=Object(R.useRef)(null),Ee=Object(R.useRef)([]);function ye(_e){Je.current===null&&(Ee.current=[],Je.current=De()(function(){Ee.current.forEach(function(le){Pe.current=le(Pe.current)}),Je.current=null,Fe({})})),Ee.current.push(_e)}return Object(R.useEffect)(function(){return function(){De.a.cancel(Je.current)}},[]),[Pe.current,ye]}function ge(Me){var Pe=Object(R.useRef)(Me),tt=Object(R.useRef)(null);function rt(){window.clearTimeout(tt.current)}function Fe(Ee){Pe.current=Ee,rt(),tt.current=window.setTimeout(function(){Pe.current=null,tt.current=null},100)}function Je(){return Pe.current}return Object(R.useEffect)(function(){return rt},[]),[Fe,Je]}function He(Me,Pe,tt){var rt=Object(R.useMemo)(function(){for(var Fe=[],Je=[],Ee=0,ye=0,_e=0;_e<Pe;_e+=1)if(tt==="rtl"){Je[_e]=ye,ye+=Me[_e]||0;var le=Pe-_e-1;Fe[le]=Ee,Ee+=Me[le]||0}else{Fe[_e]=Ee,Ee+=Me[_e]||0;var de=Pe-_e-1;Je[de]=ye,ye+=Me[de]||0}return{left:Fe,right:Je}},[Me,Pe,tt]);return rt}var ct=He;function vt(Me){var Pe=Me.className,tt=Me.children;return R.createElement("div",{className:Pe},tt)}var _t=vt,yt=k("n6Qo");function et(Me){var Pe,tt=Me.prefixCls,rt=Me.record,Fe=Me.onExpand,Je=Me.expanded,Ee=Me.expandable,ye="".concat(tt,"-row-expand-icon");if(!Ee)return R.createElement("span",{className:M()(ye,"".concat(tt,"-row-spaced"))});var _e=function(de){Fe(rt,de),de.stopPropagation()};return R.createElement("span",{className:M()(ye,(Pe={},Object(ee.a)(Pe,"".concat(tt,"-row-expanded"),Je),Object(ee.a)(Pe,"".concat(tt,"-row-collapsed"),!Je),Pe)),onClick:_e})}function ht(Me,Pe,tt){var rt=[];function Fe(Je){(Je||[]).forEach(function(Ee,ye){rt.push(Pe(Ee,ye)),Fe(Ee[tt])})}return Fe(Me),rt}var xt=k("zT1h"),Tt=k("y0+3"),mt=function(Pe,tt){var rt,Fe,Je=Pe.scrollBodyRef,Ee=Pe.onScroll,ye=Pe.offsetScroll,_e=R.useContext(n.a),le=_e.prefixCls,de=((rt=Je.current)===null||rt===void 0?void 0:rt.scrollWidth)||0,ve=((Fe=Je.current)===null||Fe===void 0?void 0:Fe.clientWidth)||0,pe=de&&ve*(ve/de),Ce=R.useRef(),Ke=be({scrollLeft:0,isHiddenScrollBar:!1}),st=Object(W.a)(Ke,2),At=st[0],Ft=st[1],kt=R.useRef({delta:0,x:0}),wt=R.useState(!1),Qe=Object(W.a)(wt,2),it=Qe[0],We=Qe[1],ce=function(){We(!1)},Se=function(ke){ke.persist(),kt.current.delta=ke.pageX-At.scrollLeft,kt.current.x=0,We(!0),ke.preventDefault()},ot=function(ke){var qe,Rt=ke||((qe=window)===null||qe===void 0?void 0:qe.event),Pt=Rt.buttons;if(!it||Pt===0){it&&We(!1);return}var $t=kt.current.x+ke.pageX-kt.current.x-kt.current.delta;$t<=0&&($t=0),$t+pe>=ve&&($t=ve-pe),Ee({scrollLeft:$t/ve*(de+2)}),kt.current.x=ke.pageX},ze=function(){var ke=Object(Tt.b)(Je.current).top,qe=ke+Je.current.offsetHeight,Rt=document.documentElement.scrollTop+window.innerHeight;qe-Object(u.a)()<=Rt||ke>=Rt-ye?Ft(function(Pt){return Object(V.a)(Object(V.a)({},Pt),{},{isHiddenScrollBar:!0})}):Ft(function(Pt){return Object(V.a)(Object(V.a)({},Pt),{},{isHiddenScrollBar:!1})})},Lt=function(ke){Ft(function(qe){return Object(V.a)(Object(V.a)({},qe),{},{scrollLeft:ke/de*ve||0})})};return R.useImperativeHandle(tt,function(){return{setScrollLeft:Lt}}),R.useEffect(function(){var Dt=Object(xt.a)(document.body,"mouseup",ce,!1),ke=Object(xt.a)(document.body,"mousemove",ot,!1);return ze(),function(){Dt.remove(),ke.remove()}},[pe,it]),R.useEffect(function(){var Dt=Object(xt.a)(window,"scroll",ze,!1),ke=Object(xt.a)(window,"resize",ze,!1);return function(){Dt.remove(),ke.remove()}},[]),R.useEffect(function(){At.isHiddenScrollBar||Ft(function(Dt){var ke,qe;return Object(V.a)(Object(V.a)({},Dt),{},{scrollLeft:Je.current.scrollLeft/((ke=Je.current)===null||ke===void 0?void 0:ke.scrollWidth)*((qe=Je.current)===null||qe===void 0?void 0:qe.clientWidth)})})},[At.isHiddenScrollBar]),de<=ve||!pe||At.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(u.a)(),width:ve,bottom:ye},className:"".concat(le,"-sticky-scroll")},R.createElement("div",{onMouseDown:Se,ref:Ce,className:M()("".concat(le,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(le,"-sticky-scroll-bar-active"),it)),style:{width:"".concat(pe,"px"),transform:"translate3d(".concat(At.scrollLeft,"px, 0, 0)")}}))},Ie=R.forwardRef(mt);function je(Me,Pe){return R.useMemo(function(){var tt=!!Me;return{isSticky:tt,stickyClassName:tt?"".concat(Pe,"-sticky-header"):"",offsetHeader:Object(Y.a)(Me)==="object"&&Me.offsetHeader||0,offsetScroll:Object(Y.a)(Me)==="object"&&Me.offsetScroll||0}},[Me,Pe])}var $e=[],at={},lt="rc-table-internal-hook",bt=R.memo(function(Me){var Pe=Me.children;return Pe},function(Me,Pe){return I()(Me.props,Pe.props)?Me.pingLeft!==Pe.pingLeft||Me.pingRight!==Pe.pingRight:!1});function Mt(Me){var Pe,tt=Me.prefixCls,rt=Me.className,Fe=Me.rowClassName,Je=Me.style,Ee=Me.data,ye=Me.rowKey,_e=Me.scroll,le=Me.tableLayout,de=Me.direction,ve=Me.title,pe=Me.footer,Ce=Me.summary,Ke=Me.id,st=Me.showHeader,At=Me.components,Ft=Me.emptyText,kt=Me.onRow,wt=Me.onHeaderRow,Qe=Me.internalHooks,it=Me.transformColumns,We=Me.internalRefs,ce=Me.sticky,Se=Ee||$e,ot=!!Se.length,ze=R.useState(0),Lt=Object(W.a)(ze,2),Dt=Lt[0],ke=Lt[1];R.useEffect(function(){ke(Object(u.a)())});var qe=R.useMemo(function(){return Object(w.c)(At,{})},[At]),Rt=R.useCallback(function(tn,Xt){return Object(w.b)(qe,tn)||Xt},[qe]),Pt=R.useMemo(function(){return typeof ye=="function"?ye:function(tn){var Xt=tn&&tn[ye];return Xt}},[ye]),$t=Object(_.c)(Me),fe=$t.expandIcon,se=$t.expandedRowKeys,U=$t.defaultExpandedRowKeys,G=$t.defaultExpandAllRows,Q=$t.expandedRowRender,te=$t.onExpand,he=$t.onExpandedRowsChange,Le=$t.expandRowByClick,Ge=$t.rowExpandable,Ot=$t.expandIconColumnIndex,Nt=$t.expandedRowClassName,Xe=$t.childrenColumnName,It=$t.indentSize,an=fe||et,Ct=Xe||"children",pn=R.useMemo(function(){return Q?"row":Me.expandable&&Qe===lt&&Me.expandable.__PARENT_RENDER_ICON__||Se.some(function(tn){return tn&&Object(Y.a)(tn)==="object"&&tn[Ct]})?"nest":!1},[!!Q,Se]),nn=R.useState(function(){return U||(G?ht(Se,Pt,Ct):[])}),$=Object(W.a)(nn,2),C=$[0],D=$[1],K=R.useMemo(function(){return new Set(se||C||[])},[se,C]),re=R.useCallback(function(tn){var Xt=Pt(tn,Se.indexOf(tn)),nt,gt=K.has(Xt);gt?(K.delete(Xt),nt=Object(P.a)(K)):nt=[].concat(Object(P.a)(K),[Xt]),D(nt),te&&te(!gt,tn),he&&he(nt)},[Pt,K,Se,te,he]),J=R.useState(0),Re=Object(W.a)(J,2),ut=Re[0],St=Re[1],Yt=Object(Oe.b)(Object(V.a)(Object(V.a)(Object(V.a)({},Me),$t),{},{expandable:!!Q,expandedKeys:K,getRowKey:Pt,onTriggerExpand:re,expandIcon:an,expandIconColumnIndex:Ot,direction:de}),Qe===lt?it:null),dt=Object(W.a)(Yt,2),Gt=dt[0],sn=dt[1],Wn=R.useMemo(function(){return{columns:Gt,flattenColumns:sn}},[Gt,sn]),Si=R.useRef(),hi=R.useRef(),Fn=R.useRef(),di=R.useState(!1),Zi=Object(W.a)(di,2),_i=Zi[0],ri=Zi[1],wi=R.useState(!1),Di=Object(W.a)(wi,2),Oi=Di[0],Ri=Di[1],Vi=be(new Map),cr=Object(W.a)(Vi,2),rr=cr[0],ji=cr[1],Wi=Object(w.a)(sn),hr=Wi.map(function(tn){return rr.get(tn)}),Tr=R.useMemo(function(){return hr},[hr.join("_")]),ar=ct(Tr,sn.length,de),Hn=_e&&Object(w.d)(_e.y),Cn=_e&&Object(w.d)(_e.x),yi=Cn&&sn.some(function(tn){var Xt=tn.fixed;return Xt}),Nn=R.useRef(),Ti=je(ce,tt),ii=Ti.isSticky,Cr=Ti.offsetHeader,Ni=Ti.offsetScroll,Xi=Ti.stickyClassName,lr,gr,Hr;Hn&&(gr={overflowY:"scroll",maxHeight:_e.y}),Cn&&(lr={overflowX:"auto"},Hn||(gr={overflowY:"hidden"}),Hr={width:_e.x===!0?"auto":_e.x,minWidth:"100%"});var kr=R.useCallback(function(tn,Xt){ji(function(nt){var gt=new Map(nt);return gt.set(tn,Xt),gt})},[]),wr=ge(null),Xr=Object(W.a)(wr,2),vr=Xr[0],Yr=Xr[1];function $r(tn,Xt){if(!Xt)return;typeof Xt=="function"?Xt(tn):Xt.scrollLeft!==tn&&(Xt.scrollLeft=tn)}var fr=function(Xt){var nt=Xt.currentTarget,gt=Xt.scrollLeft,cn=typeof gt=="number"?gt:nt.scrollLeft,ft=nt||at;if(!Yr()||Yr()===ft){var hn;vr(ft),$r(cn,hi.current),$r(cn,Fn.current),$r(cn,(hn=Nn.current)===null||hn===void 0?void 0:hn.setScrollLeft)}if(nt){var Bt=nt.scrollWidth,vn=nt.clientWidth;ri(cn>0),Ri(cn<Bt-vn)}},Jr=function(){Fn.current&&fr({currentTarget:Fn.current})},mn=function(Xt){var nt=Xt.width;Jr(),St(Si.current?Si.current.offsetWidth:nt)};R.useEffect(function(){return Jr},[]),R.useEffect(function(){Cn&&Jr()},[Cn]),R.useEffect(function(){Qe===lt&&We&&(We.body.current=Fn.current)});var On=Rt(["table"],"table"),_n=R.useMemo(function(){return le||(yi?_e.x==="max-content"?"auto":"fixed":Hn||sn.some(function(tn){var Xt=tn.ellipsis;return Xt})?"fixed":"auto")},[Hn,yi,sn,le]),jn,Jn={colWidths:Tr,columCount:sn.length,stickyOffsets:ar,onHeaderRow:wt,fixHeader:Hn},un=R.useMemo(function(){return ot?null:typeof Ft=="function"?Ft():Ft},[ot,Ft]),Bn=R.createElement(Te,{data:Se,measureColumnWidth:Hn||Cn||ii,expandedKeys:K,rowExpandable:Ge,getRowKey:Pt,onRow:kt,emptyNode:un,childrenColumnName:Ct}),Ai=R.createElement(c,{colWidths:sn.map(function(tn){var Xt=tn.width;return Xt}),columns:sn}),Yi=Ce&&R.createElement(yt.b,null,Ce(Se)),Xn=Rt(["body"]);if(Hn||ii){var _r;typeof Xn=="function"?(_r=Xn(Se,{scrollbarSize:Dt,ref:Fn,onScroll:fr}),Jn.colWidths=sn.map(function(tn,Xt){var nt=tn.width,gt=Xt===Gt.length-1?nt-Dt:nt;return typeof gt=="number"&&!Number.isNaN(gt)?gt:(Object(p.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):_r=R.createElement("div",{style:Object(V.a)(Object(V.a)({},lr),gr),onScroll:fr,ref:Fn,className:M()("".concat(tt,"-body"))},R.createElement(On,{style:Object(V.a)(Object(V.a)({},Hr),{},{tableLayout:_n})},Ai,Bn,Yi),ii&&R.createElement(Ie,{ref:Nn,offsetScroll:Ni,scrollBodyRef:Fn,onScroll:fr})),jn=R.createElement(R.Fragment,null,st!==!1&&R.createElement(b,Object.assign({noData:!Se.length},Jn,Wn,{direction:de,offsetHeader:Cr,stickyClassName:Xi,ref:hi,onScroll:fr})),_r)}else jn=R.createElement("div",{style:Object(V.a)(Object(V.a)({},lr),gr),className:M()("".concat(tt,"-content")),onScroll:fr,ref:Fn},R.createElement(On,{style:Object(V.a)(Object(V.a)({},Hr),{},{tableLayout:_n})},Ai,st!==!1&&R.createElement(v,Object.assign({},Jn,Wn)),Bn,Yi));var oi=Object(_.b)(Me),Ye=R.createElement("div",Object.assign({className:M()(tt,rt,(Pe={},Object(ee.a)(Pe,"".concat(tt,"-rtl"),de==="rtl"),Object(ee.a)(Pe,"".concat(tt,"-ping-left"),_i),Object(ee.a)(Pe,"".concat(tt,"-ping-right"),Oi),Object(ee.a)(Pe,"".concat(tt,"-layout-fixed"),le==="fixed"),Object(ee.a)(Pe,"".concat(tt,"-fixed-header"),Hn),Object(ee.a)(Pe,"".concat(tt,"-fixed-column"),yi),Object(ee.a)(Pe,"".concat(tt,"-scroll-horizontal"),Cn),Object(ee.a)(Pe,"".concat(tt,"-has-fix-left"),sn[0]&&sn[0].fixed),Object(ee.a)(Pe,"".concat(tt,"-has-fix-right"),sn[sn.length-1]&&sn[sn.length-1].fixed==="right"),Pe)),style:Je,id:Ke,ref:Si},oi),R.createElement(bt,{pingLeft:_i,pingRight:Oi,props:Object(V.a)(Object(V.a)({},Me),{},{stickyOffsets:ar,mergedExpandedKeys:K})},ve&&R.createElement(_t,{className:"".concat(tt,"-title")},ve(Se)),R.createElement("div",{className:"".concat(tt,"-container")},jn),pe&&R.createElement(_t,{className:"".concat(tt,"-footer")},pe(Se))));Cn&&(Ye=R.createElement(m.a,{onResize:mn},Ye));var pt=R.useMemo(function(){return{prefixCls:tt,getComponent:Rt,scrollbarSize:Dt,direction:de,fixedInfoList:sn.map(function(tn,Xt){return d(Xt,Xt,sn,ar,de)}),isSticky:ii}},[tt,Rt,Dt,de,sn,ar,de,ii]),Kt=R.useMemo(function(){return Object(V.a)(Object(V.a)({},Wn),{},{tableLayout:_n,rowClassName:Fe,expandedRowClassName:Nt,componentWidth:ut,fixHeader:Hn,fixColumn:yi,horizonScroll:Cn,expandIcon:an,expandableType:pn,expandRowByClick:Le,expandedRowRender:Q,onTriggerExpand:re,expandIconColumnIndex:Ot,indentSize:It})},[Wn,_n,Fe,Nt,ut,Hn,yi,Cn,an,pn,Le,Q,re,Ot,It]),fn=R.useMemo(function(){return{onColumnResize:kr}},[kr]);return R.createElement(n.a.Provider,{value:pt},R.createElement(F.Provider,{value:Kt},R.createElement(ne.Provider,{value:fn},Ye)))}Mt.Column=s.a,Mt.ColumnGroup=h.a,Mt.Summary=yt.a,Mt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var jt=we.b=Mt},wRmb:function(Be,we,k){"use strict";k.d(we,"a",function(){return I});var ee=k("rePB"),V=k("KQm4"),P=k("VTBJ"),Y=k("Ff2n"),W=k("cDcd"),R=k.n(W),B=k("Kwbf"),M=k("Zm9Q"),L=k("hW8S");function I(s){return Object(M.a)(s).filter(function(l){return W.isValidElement(l)}).map(function(l){var i=l.key,r=l.props,n=r.children,d=Object(Y.a)(r,["children"]),w=Object(P.a)({key:i},d);return n&&(w.children=I(n)),w})}function p(s){return s.reduce(function(l,i){var r=i.fixed,n=r===!0?"left":r,d=i.children;return d&&d.length>0?[].concat(Object(V.a)(l),Object(V.a)(p(d).map(function(w){return Object(P.a)({fixed:n},w)}))):[].concat(Object(V.a)(l),[Object(P.a)(Object(P.a)({},i),{},{fixed:n})])},[])}function m(s){for(var l=!0,i=0;i<s.length;i+=1){var r=s[i];if(l&&r.fixed!=="left")l=!1;else if(!l&&r.fixed==="left"){Object(B.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var n=!0,d=s.length-1;d>=0;d-=1){var w=s[d];if(n&&w.fixed!=="right")n=!1;else if(!n&&w.fixed==="right"){Object(B.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function u(s){return s.map(function(l){var i=l.fixed,r=Object(Y.a)(l,["fixed"]),n=i;return i==="left"?n="right":i==="right"&&(n="left"),Object(P.a)({fixed:n},r)})}function h(s,l){var i=s.prefixCls,r=s.columns,n=s.children,d=s.expandable,w=s.expandedKeys,T=s.getRowKey,x=s.onTriggerExpand,O=s.expandIcon,E=s.rowExpandable,v=s.expandIconColumnIndex,_=s.direction,f=s.expandRowByClick,c=W.useMemo(function(){return r||I(n)},[r,n]),S=W.useMemo(function(){if(d){var N,F=v||0,X=c[F],Z=(N={},Object(ee.a)(N,L.a,{className:"".concat(i,"-expand-icon-col")}),Object(ee.a)(N,"title",""),Object(ee.a)(N,"fixed",X?X.fixed:null),Object(ee.a)(N,"className","".concat(i,"-row-expand-icon-cell")),Object(ee.a)(N,"render",function(z,ne,ae){var me=T(ne,ae),xe=w.has(me),Te=E?E(ne):!0,Oe=O({prefixCls:i,expanded:xe,expandable:Te,record:ne,onExpand:x});return f?W.createElement("span",{onClick:function(De){return De.stopPropagation()}},Oe):Oe}),N),H=c.slice();return F>=0&&H.splice(F,0,Z),H}return c},[d,c,T,w,O,_]),y=W.useMemo(function(){var N=S;return l&&(N=l(N)),N.length||(N=[{render:function(){return null}}]),N},[l,S,_]),b=W.useMemo(function(){return _==="rtl"?u(p(y)):p(y)},[y,_]);return[y,b]}we.b=h},wW8i:function(Be,we,k){Be.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(Be,we,k){"use strict";k.d(we,"a",function(){return p}),k.d(we,"b",function(){return u});var ee=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function Y(h){return h.nodeType===1?h.ownerDocument.defaultView.getComputedStyle(h,null):{}}function W(h,s,l){if(s=s.toLowerCase(),l==="auto"){if(s==="height")return h.offsetHeight;if(s==="width")return h.offsetWidth}return s in V||(V[s]=ee.test(s)),V[s]?parseFloat(l)||0:l}function R(h,s){var l=arguments.length,i=Y(h);return s=P[s]?"cssFloat"in h.style?"cssFloat":"styleFloat":s,l===1?i:W(h,s,i[s]||h.style[s])}function B(h,s,l){var i=arguments.length;if(s=P[s]?"cssFloat"in h.style?"cssFloat":"styleFloat":s,i===3)return typeof l=="number"&&ee.test(s)&&(l="".concat(l,"px")),h.style[s]=l,l;for(var r in s)s.hasOwnProperty(r)&&B(h,r,s[r]);return Y(h)}function M(h){return h===document.body?document.documentElement.clientWidth:h.offsetWidth}function L(h){return h===document.body?window.innerHeight||document.documentElement.clientHeight:h.offsetHeight}function I(){var h=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:h,height:s}}function p(){var h=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:h,height:s}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function u(h){var s=h.getBoundingClientRect(),l=document.documentElement;return{left:s.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},ynwM:function(Be,we,k){var ee=k("MFOe"),V=ee.Global;Be.exports={name:"oldFF-globalStorage",read:Y,write:W,each:R,remove:B,clearAll:M};var P=V.globalStorage;function Y(L){return P[L]}function W(L,I){P[L]=I}function R(L){for(var I=P.length-1;I>=0;I--){var p=P.key(I);L(P[p],p)}}function B(L){return P.removeItem(L)}function M(){R(function(L,I){delete P[L]})}}}]);