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__Classrooms__Lists__Exerc...

376 lines
1.2 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[64,3,5,6,7,8,9],{"+NIl":function(et,de,N){(function(ee){ee(N("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(K,P){"use strict";function z(y,f){y.cmdState.push(f)}function B(y){return y.cmdState.length>0?y.cmdState[y.cmdState.length-1]:null}function M(y){var f=y.cmdState.pop();f&&f.closeBracket()}function j(y){for(var f=y.cmdState,m=f.length-1;m>=0;m--){var a=f[m];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function U(y,f,m){return function(){this.name=y,this.bracketNo=0,this.style=f,this.styles=m,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _={};_.importmodule=U("importmodule","tag",["string","builtin"]),_.documentclass=U("documentclass","tag",["","atom"]),_.usepackage=U("usepackage","tag",["atom"]),_.begin=U("begin","tag",["atom"]),_.end=U("end","tag",["atom"]),_.label=U("label","tag",["atom"]),_.ref=U("ref","tag",["atom"]),_.eqref=U("eqref","tag",["atom"]),_.cite=U("cite","tag",["atom"]),_.bibitem=U("bibitem","tag",["atom"]),_.Bibitem=U("Bibitem","tag",["atom"]),_.RBibitem=U("RBibitem","tag",["atom"]),_.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(y,f){y.f=f}function c(y,f){var m;if(y.match(/^\\[a-zA-Z@]+/)){var a=y.current().slice(1);return m=_.hasOwnProperty(a)?_[a]:_.DEFAULT,m=new m,z(f,m),R(f,w),m.style}if(y.match(/^\\[$&%#{}_]/))return"tag";if(y.match(/^\\[,;!\/\\]/))return"tag";if(y.match("\\["))return R(f,function(o,u){return g(o,u,"\\]")}),"keyword";if(y.match("\\("))return R(f,function(o,u){return g(o,u,"\\)")}),"keyword";if(y.match("$$"))return R(f,function(o,u){return g(o,u,"$$")}),"keyword";if(y.match("$"))return R(f,function(o,u){return g(o,u,"$")}),"keyword";var n=y.next();if(n=="%")return y.skipToEnd(),"comment";if(n=="}"||n=="]"){if(m=B(f),m)m.closeBracket(n),R(f,w);else return"error";return"bracket"}else return n=="{"||n=="["?(m=_.DEFAULT,m=new m,z(f,m),"bracket"):/\d/.test(n)?(y.eatWhile(/[\w.%]/),"atom"):(y.eatWhile(/[\w\-_]/),m=j(f),m.name=="begin"&&(m.argument=y.current()),m.styleIdentifier())}function g(y,f,m){if(y.eatSpace())return null;if(m&&y.match(m))return R(f,c),"keyword";if(y.match(/^\\[a-zA-Z@]+/))return"tag";if(y.match(/^[a-zA-Z]+/))return"variable-2";if(y.match(/^\\[$&%#{}_]/))return"tag";if(y.match(/^\\[,;!\/]/))return"tag";if(y.match(/^[\^_&]/))return"tag";if(y.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(y.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=y.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(y.skipToEnd(),"comment"):"error"}function w(y,f){var m=y.peek(),a;return m=="{"||m=="["?(a=B(f),a.openBracket(m),y.eat(m),R(f,c),"bracket"):/[ \t\r]/.test(m)?(y.eat(m),null):(R(f,c),M(f),c(y,f))}return{startState:function(){var y=P.inMathMode?function(f,m){return g(f,m)}:c;return{cmdState:[],f:y}},copyState:function(y){return{cmdState:y.cmdState.slice(),f:y.f}},token:function(y,f){return f.f(y,f)},blankLine:function(y){y.f=c,y.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"+ua5":function(et,de,N){},"/GNS":function(et,de,N){et.exports=N.p+"static/search1.c4136dd4.png"},"/cxE":function(et,de,N){"use strict";N.d(de,"e",function(){return P}),N.d(de,"f",function(){return z}),N.d(de,"g",function(){return B}),N.d(de,"d",function(){return j}),N.d(de,"a",function(){return U}),N.d(de,"b",function(){return _}),N.d(de,"c",function(){return R});var ee=function(){function c(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(function(){throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}return c.prototype.emit=function(g){this.listeners.forEach(function(w){w(g)})},c.prototype.onUnexpectedError=function(g){this.unexpectedErrorHandler(g),this.emit(g)},c.prototype.onUnexpectedExternalError=function(g){this.unexpectedErrorHandler(g)},c}(),K=new ee;function P(c){j(c)||K.onUnexpectedError(c);return}function z(c){j(c)||K.onUnexpectedExternalError(c);return}function B(c){if(c instanceof Error){var g=c.name,w=c.message,y=c.stacktrace||c.stack;return{$isError:!0,name:g,message:w,stack:y}}return c}var M="Canceled";function j(c){return c instanceof Error&&c.name===M&&c.message===M}function U(){var c=new Error(M);return c.name=c.message,c}function _(c){return c?new Error("Illegal argument: "+c):new Error("Illegal argument")}function R(c){return c?new Error("Illegal state: "+c):new Error("Illegal state")}},"19Vz":function(et,de,N){(function(ee){ee(N("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(U,_,R){var c=R&&R!=ee.Init;if(_&&!c)U.on("blur",B),U.on("change",M),U.on("swapDoc",M),ee.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){z(U)}),M(U);else if(!_&&c){U.off("blur",B),U.off("change",M),U.off("swapDoc",M),ee.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),K(U);var g=U.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}_&&!U.hasFocus()&&B(U)});function K(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function P(U){K(U);var _=U.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=U.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var R=U.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),_.appendChild(R),U.display.lineSpace.insertBefore(_,U.display.lineSpace.firstChild)}function z(U){setTimeout(function(){var _=!1,R=U.getInputField();R.nodeName=="TEXTAREA"?_=!R.value:U.lineCount()==1&&(_=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),_?P(U):K(U)},20)}function B(U){j(U)&&P(U)}function M(U){var _=U.getWrapperElement(),R=j(U);_.className=_.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(U):K(U)}function j(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(et,de,N){(function(ee){ee(N("VrN/"))})(function(ee){"use strict";var K={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(z,B){var M=z.indentUnit,j={},U=B.htmlMode?K:P;for(var _ in U)j[_]=U[_];for(var _ in B)j[_]=B[_];var R,c;function g(l,D){function T(C){return D.tokenize=C,C(l,D)}var S=l.next();if(S=="<")return l.eat("!")?l.eat("[")?l.match("CDATA[")?T(f("atom","]]>")):null:l.match("--")?T(f("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),T(m(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),D.tokenize=f("meta","?>"),"meta"):(R=l.eat("/")?"closeTag":"openTag",D.tokenize=w,"tag bracket");if(S=="&"){var I;return l.eat("#")?l.eat("x")?I=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):I=l.eatWhile(/[\d]/)&&l.eat(";"):I=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),I?"atom":"error"}else return l.eatWhile(/[^&<]/),null}g.isInText=!0;function w(l,D){var T=l.next();if(T==">"||T=="/"&&l.eat(">"))return D.tokenize=g,R=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return R="equals",null;if(T=="<"){D.tokenize=g,D.state=u,D.tagName=D.tagStart=null;var S=D.tokenize(l,D);return S?S+" tag error":"tag error"}else return/[\'\"]/.test(T)?(D.tokenize=y(T),D.stringStartCol=l.column(),D.tokenize(l,D)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function y(l){var D=function(T,S){for(;!T.eol();)if(T.next()==l){S.tokenize=w;break}return"string"};return D.isInAttribute=!0,D}function f(l,D){return function(T,S){for(;!T.eol();){if(T.match(D)){S.tokenize=g;break}T.next()}return l}}function m(l){return function(D,T){for(var S;(S=D.next())!=null;){if(S=="<")return T.tokenize=m(l+1),T.tokenize(D,T);if(S==">")if(l==1){T.tokenize=g;break}else return T.tokenize=m(l-1),T.tokenize(D,T)}return"meta"}}function a(l,D,T){this.prev=l.context,this.tagName=D,this.indent=l.indented,this.startOfLine=T,(j.doNotIndent.hasOwnProperty(D)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function n(l){l.context&&(l.context=l.context.prev)}function o(l,D){for(var T;;){if(!l.context)return;if(T=l.context.tagName,!j.contextGrabbers.hasOwnProperty(T)||!j.contextGrabbers[T].hasOwnProperty(D))return;n(l)}}function u(l,D,T){return l=="openTag"?(T.tagStart=D.column(),x):l=="closeTag"?E:u}function x(l,D,T){return l=="word"?(T.tagName=D.current(),c="tag",A):j.allowMissingTagName&&l=="endTag"?(c="tag bracket",A(l,D,T)):(c="error",x)}function E(l,D,T){if(l=="word"){var S=D.current();return T.context&&T.context.tagName!=S&&j.implicitlyClosed.hasOwnProperty(T.context.tagName)&&n(T),T.context&&T.context.tagName==S||j.matchClosing===!1?(c="tag",v):(c="tag error",O)}else return j.allowMissingTagName&&l=="endTag"?(c="tag bracket",v(l,D,T)):(c="error",O)}function v(l,D,T){return l!="endTag"?(c="error",v):(n(T),u)}function O(l,D,T){return c="error",v(l,D,T)}function A(l,D,T){if(l=="word")return c="attribute",p;if(l=="endTag"||l=="selfcloseTag"){var S=T.tagName,I=T.tagStart;return T.tagName=T.tagStart=null,l=="selfcloseTag"||j.autoSelfClosers.hasOwnProperty(S)?o(T,S):(o(T,S),T.context=new a(T,S,I==T.indented)),u}return c="error",A}function p(l,D,T){return l=="equals"?h:(j.allowMissing||(c="error"),A(l,D,T))}function h(l,D,T){return l=="string"?s:l=="word"&&j.allowUnquoted?(c="string",A):(c="error",A(l,D,T))}function s(l,D,T){return l=="string"?s:A(l,D,T)}return{startState:function(l){var D={tokenize:g,state:u,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(D.baseIndent=l),D},token:function(l,D){if(!D.tagName&&l.sol()&&(D.indented=l.indentation()),l.eatSpace())return null;R=null;var T=D.tokenize(l,D);return(T||R)&&T!="comment"&&(c=null,D.state=D.state(R||T,l,D),c&&(T=c=="error"?T+" error":c)),T},indent:function(l,D,T){var S=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+M;if(S&&S.noIndent)return ee.Pass;if(l.tokenize!=w&&l.tokenize!=g)return T?T.match(/^(\s*)/)[0].length:0;if(l.tagName)return j.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+M*(j.multilineTagIndentFactor||1);if(j.alignCDATA&&/<!\[CDATA\[/.test(D))return 0;var I=D&&/^<(\/)?([\w_:\.-]*)/.exec(D);if(I&&I[1])for(;S;)if(S.tagName==I[2]){S=S.prev;break}else if(j.implicitlyClosed.hasOwnProperty(S.tagName))S=S.prev;else break;else if(I)for(;S;){var C=j.contextGrabbers[S.tagName];if(C&&C.hasOwnProperty(I[2]))S=S.prev;else break}for(;S&&S.prev&&!S.startOfLine;)S=S.prev;return S?S.indent+M:l.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:j.htmlMode?"html":"xml",helperType:j.htmlMode?"html":"xml",skipAttribute:function(l){l.state==h&&(l.state=A)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var D=[],T=l.context;T;T=T.prev)T.tagName&&D.push(T.tagName);return D.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(et,de,N){"use strict";N.d(de,"d",function(){return yt}),N.d(de,"b",function(){return Be}),N.d(de,"c",function(){return ut}),N.d(de,"a",function(){return Tt});var ee=N("VTBJ"),K=N("1OyB"),P=N("vuIU"),z=N("JX7q"),B=N("Ji7U"),M=N("LK+K"),j=N("q1tI"),U=N("I8Z2"),_=N("BGR+"),R=N("wx14"),c=N("rePB"),g=N("4IlW"),w=N("2GS6"),y=N("Gytx"),f=N.n(y),m=N("TSYQ"),a=N.n(m),n=N("U8pU"),o=N("ODXe"),u=/iPhone/i,x=/iPod/i,E=/iPad/i,v=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,A=/\bAndroid(?:.+)SD4930UR\b/i,p=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,h=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,l=/BlackBerry/i,D=/BB10/i,T=/Opera Mini/i,S=/\b(CriOS|Chrome)(?:.+)Mobile/i,I=/Mobile(?:.+)Firefox\b/i;function C(gt,qe){return gt.test(qe)}function W(gt){var qe=gt||(typeof navigator!="undefined"?navigator.userAgent:""),Xe=qe.split("[FBAN");if(typeof Xe[1]!="undefined"){var Pe=Xe,se=Object(o.a)(Pe,1);qe=se[0]}if(Xe=qe.split("Twitter"),typeof Xe[1]!="undefined"){var fe=Xe,$e=Object(o.a)(fe,1);qe=$e[0]}var ke={apple:{phone:C(u,qe)&&!C(h,qe),ipod:C(x,qe),tablet:!C(u,qe)&&C(E,qe)&&!C(h,qe),device:(C(u,qe)||C(x,qe)||C(E,qe))&&!C(h,qe)},amazon:{phone:C(A,qe),tablet:!C(A,qe)&&C(p,qe),device:C(A,qe)||C(p,qe)},android:{phone:!C(h,qe)&&C(A,qe)||!C(h,qe)&&C(v,qe),tablet:!C(h,qe)&&!C(A,qe)&&!C(v,qe)&&(C(p,qe)||C(O,qe)),device:!C(h,qe)&&(C(A,qe)||C(p,qe)||C(v,qe)||C(O,qe))||C(/\bokhttp\b/i,qe)},windows:{phone:C(h,qe),tablet:C(s,qe),device:C(h,qe)||C(s,qe)},other:{blackberry:C(l,qe),blackberry10:C(D,qe),opera:C(T,qe),firefox:C(I,qe),chrome:C(S,qe),device:C(l,qe)||C(D,qe)||C(T,qe)||C(I,qe)||C(S,qe)},any:null,phone:null,tablet:null};return ke.any=ke.apple.device||ke.android.device||ke.windows.device||ke.other.device,ke.phone=ke.apple.phone||ke.android.phone||ke.windows.phone,ke.tablet=ke.apple.tablet||ke.android.tablet||ke.windows.tablet,ke}var Y=Object(ee.a)(Object(ee.a)({},W()),{},{isMobile:W}),H=Y;function F(){}function q(gt,qe,Xe){var Pe=qe||"";return gt.key||"".concat(Pe,"item_").concat(Xe)}function le(gt){return"".concat(gt,"-menu-")}function pe(gt,qe){var Xe=-1;j.Children.forEach(gt,function(Pe){Xe+=1,Pe&&Pe.type&&Pe.type.isMenuItemGroup?j.Children.forEach(Pe.props.children,function(se){Xe+=1,qe(se,Xe)}):qe(Pe,Xe)})}function Ae(gt,qe,Xe){if(!gt||Xe.find)return;j.Children.forEach(gt,function(Pe){if(Pe){var se=Pe.type;if(!se||!(se.isSubMenu||se.isMenuItem||se.isMenuItemGroup))return;qe.indexOf(Pe.key)!==-1?Xe.find=!0:Pe.props.children&&Ae(Pe.props.children,qe,Xe)}})}var Ge=["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"],Fe=function(qe){var Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=qe&&typeof qe.getBoundingClientRect=="function"&&qe.getBoundingClientRect().width;if(Pe){if(Xe){var se=getComputedStyle(qe),fe=se.marginLeft,$e=se.marginRight;Pe+=+fe.replace("px","")+ +$e.replace("px","")}Pe=+Pe.toFixed(6)}return Pe||0},Ue=function(qe,Xe,Pe){qe&&Object(n.a)(qe.style)==="object"&&(qe.style[Xe]=Pe)},_e=function(){return H.any},je=N("KQm4"),xe=N("Ff2n"),he=N("i8i4"),te=N("bdgK"),ye=N("uciX"),ue=N("8XRh"),Le={adjustX:1,adjustY:1},ae={topLeft:{points:["bl","tl"],overflow:Le,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Le,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Le,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Le,offset:[4,0]}},oe={topLeft:{points:["bl","tl"],overflow:Le,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Le,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Le,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Le,offset:[4,0]}},Se=ae,Me=0,We={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ke=function(qe,Xe,Pe){var se=le(Xe),fe=qe.getState();qe.setState({defaultActiveFirst:Object(ee.a)(Object(ee.a)({},fe.defaultActiveFirst),{},Object(c.a)({},se,Pe))})},Qe=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(Pe){var se;Object(K.a)(this,Xe),se=qe.call(this,Pe),se.onDestroy=function(Ne){se.props.onDestroy(Ne)},se.onKeyDown=function(Ne){var Ve=Ne.keyCode,tt=se.menuInstance,ft=se.props,Ct=ft.isOpen,zt=ft.store;if(Ve===g.a.ENTER)return se.onTitleClick(Ne),Ke(zt,se.props.eventKey,!0),!0;if(Ve===g.a.RIGHT)return Ct?tt.onKeyDown(Ne):(se.triggerOpenChange(!0),Ke(zt,se.props.eventKey,!0)),!0;if(Ve===g.a.LEFT){var qt;if(Ct)qt=tt.onKeyDown(Ne);else return;return qt||(se.triggerOpenChange(!1),qt=!0),qt}return Ct&&(Ve===g.a.UP||Ve===g.a.DOWN)?tt.onKeyDown(Ne):void 0},se.onOpenChange=function(Ne){se.props.onOpenChange(Ne)},se.onPopupVisibleChange=function(Ne){se.triggerOpenChange(Ne,Ne?"mouseenter":"mouseleave")},se.onMouseEnter=function(Ne){var Ve=se.props,tt=Ve.eventKey,ft=Ve.onMouseEnter,Ct=Ve.store;Ke(Ct,se.props.eventKey,!1),ft({key:tt,domEvent:Ne})},se.onMouseLeave=function(Ne){var Ve=se.props,tt=Ve.parentMenu,ft=Ve.eventKey,Ct=Ve.onMouseLeave;tt.subMenuInstance=Object(z.a)(se),Ct({key:ft,domEvent:Ne})},se.onTitleMouseEnter=function(Ne){var Ve=se.props,tt=Ve.eventKey,ft=Ve.onItemHover,Ct=Ve.onTitleMouseEnter;ft({key:tt,hover:!0}),Ct({key:tt,domEvent:Ne})},se.onTitleMouseLeave=function(Ne){var Ve=se.props,tt=Ve.parentMenu,ft=Ve.eventKey,Ct=Ve.onItemHover,zt=Ve.onTitleMouseLeave;tt.subMenuInstance=Object(z.a)(se),Ct({key:ft,hover:!1}),zt({key:ft,domEvent:Ne})},se.onTitleClick=function(Ne){var Ve=Object(z.a)(se),tt=Ve.props;if(tt.onTitleClick({key:tt.eventKey,domEvent:Ne}),tt.triggerSubMenuAction==="hover")return;se.triggerOpenChange(!tt.isOpen,"click"),Ke(tt.store,se.props.eventKey,!1)},se.onSubMenuClick=function(Ne){typeof se.props.onClick=="function"&&se.props.onClick(se.addKeyPath(Ne))},se.onSelect=function(Ne){se.props.onSelect(Ne)},se.onDeselect=function(Ne){se.props.onDeselect(Ne)},se.getPrefixCls=function(){return"".concat(se.props.rootPrefixCls,"-submenu")},se.getActiveClassName=function(){return"".concat(se.getPrefixCls(),"-active")},se.getDisabledClassName=function(){return"".concat(se.getPrefixCls(),"-disabled")},se.getSelectedClassName=function(){return"".concat(se.getPrefixCls(),"-selected")},se.getOpenClassName=function(){return"".concat(se.props.rootPrefixCls,"-submenu-open")},se.saveMenuInstance=function(Ne){se.menuInstance=Ne},se.addKeyPath=function(Ne){return Object(ee.a)(Object(ee.a)({},Ne),{},{keyPath:(Ne.keyPath||[]).concat(se.props.eventKey)})},se.triggerOpenChange=function(Ne,Ve){var tt=se.props.eventKey,ft=function(){se.onOpenChange({key:tt,item:Object(z.a)(se),trigger:Ve,open:Ne})};Ve==="mouseenter"?se.mouseenterTimeout=setTimeout(function(){ft()},0):ft()},se.isChildrenSelected=function(){var Ne={find:!1};return Ae(se.props.children,se.props.selectedKeys,Ne),Ne.find},se.isOpen=function(){return se.props.openKeys.indexOf(se.props.eventKey)!==-1},se.adjustWidth=function(){if(!se.subMenuTitle||!se.menuInstance)return;var Ne=he.findDOMNode(se.menuInstance);if(Ne.offsetWidth>=se.subMenuTitle.offsetWidth)return;Ne.style.minWidth="".concat(se.subMenuTitle.offsetWidth,"px")},se.saveSubMenuTitle=function(Ne){se.subMenuTitle=Ne},se.getBaseProps=function(){var Ne=Object(z.a)(se),Ve=Ne.props;return{mode:Ve.mode==="horizontal"?"vertical":Ve.mode,visible:se.props.isOpen,level:Ve.level+1,inlineIndent:Ve.inlineIndent,focusable:!1,onClick:se.onSubMenuClick,onSelect:se.onSelect,onDeselect:se.onDeselect,onDestroy:se.onDestroy,selectedKeys:Ve.selectedKeys,eventKey:"".concat(Ve.eventKey,"-menu-"),openKeys:Ve.openKeys,motion:Ve.motion,onOpenChange:se.onOpenChange,subMenuOpenDelay:Ve.subMenuOpenDelay,parentMenu:Object(z.a)(se),subMenuCloseDelay:Ve.subMenuCloseDelay,forceSubMenuRender:Ve.forceSubMenuRender,triggerSubMenuAction:Ve.triggerSubMenuAction,builtinPlacements:Ve.builtinPlacements,defaultActiveFirst:Ve.store.getState().defaultActiveFirst[le(Ve.eventKey)],multiple:Ve.multiple,prefixCls:Ve.rootPrefixCls,id:se.internalMenuId,manualRef:se.saveMenuInstance,itemIcon:Ve.itemIcon,expandIcon:Ve.expandIcon,direction:Ve.direction}},se.getMotion=function(Ne,Ve){var tt=Object(z.a)(se),ft=tt.haveRendered,Ct=se.props,zt=Ct.motion,qt=Ct.rootPrefixCls,Qt=Object(ee.a)(Object(ee.a)({},zt),{},{leavedClassName:"".concat(qt,"-hidden"),removeOnLeave:!1,motionAppear:ft||!Ve||Ne!=="inline"});return Qt};var fe=Pe.store,$e=Pe.eventKey,ke=fe.getState(),it=ke.defaultActiveFirst;se.isRootMenu=!1;var at=!1;return it&&(at=it[$e]),Ke(fe,$e,at),se}return Object(P.a)(Xe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var se=this,fe=this.props,$e=fe.mode,ke=fe.parentMenu,it=fe.manualRef;if(it&&it(this),$e!=="horizontal"||!ke.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return se.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var se=this.props,fe=se.onDestroy,$e=se.eventKey;fe&&fe($e),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(se){var fe=this,$e=this.getBaseProps(),ke=this.getMotion($e.mode,$e.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||$e.visible||$e.forceSubMenuRender,!this.haveOpened)return j.createElement("div",null);var it=$e.direction;return j.createElement(ue.default,Object.assign({visible:$e.visible},ke),function(at){var Ne=at.className,Ve=at.style,tt=a()("".concat($e.prefixCls,"-sub"),Ne,Object(c.a)({},"".concat($e.prefixCls,"-rtl"),it==="rtl"));return j.createElement(Te,Object.assign({},$e,{id:fe.internalMenuId,className:tt,style:Ve}),se)})}},{key:"render",value:function(){var se,fe=Object(ee.a)({},this.props),$e=fe.isOpen,ke=this.getPrefixCls(),it=fe.mode==="inline",at=a()(ke,"".concat(ke,"-").concat(fe.mode),(se={},Object(c.a)(se,fe.className,!!fe.className),Object(c.a)(se,this.getOpenClassName(),$e),Object(c.a)(se,this.getActiveClassName(),fe.active||$e&&!it),Object(c.a)(se,this.getDisabledClassName(),fe.disabled),Object(c.a)(se,this.getSelectedClassName(),this.isChildrenSelected()),se));this.internalMenuId||(fe.eventKey?this.internalMenuId="".concat(fe.eventKey,"$Menu"):(Me+=1,this.internalMenuId="$__$".concat(Me,"$Menu")));var Ne={},Ve={},tt={};fe.disabled||(Ne={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ve={onClick:this.onTitleClick},tt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var ft={},Ct=fe.direction;it&&(Ct==="rtl"?ft.paddingRight=fe.inlineIndent*fe.level:ft.paddingLeft=fe.inlineIndent*fe.level);var zt={};this.props.isOpen&&(zt={"aria-owns":this.internalMenuId});var qt=null;fe.mode!=="horizontal"&&(qt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(qt=j.createElement(this.props.expandIcon,Object(ee.a)({},this.props))));var Qt=j.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:ft,className:"".concat(ke,"-title"),role:"button"},tt,Ve,{"aria-expanded":$e},zt,{"aria-haspopup":"true",title:typeof fe.title=="string"?fe.title:void 0}),fe.title,qt||j.createElement("i",{className:"".concat(ke,"-arrow")})),St=this.renderChildren(fe.children),ln=fe.parentMenu.isRootMenu?fe.parentMenu.props.getPopupContainer:function(un){return un.parentNode},Bt=We[fe.mode],Yt=fe.popupOffset?{offset:fe.popupOffset}:{},Mt=fe.mode==="inline"?"":fe.popupClassName;Mt+=Ct==="rtl"?" ".concat(ke,"-rtl"):"";var tn=fe.disabled,mn=fe.triggerSubMenuAction,An=fe.subMenuOpenDelay,lt=fe.forceSubMenuRender,Rt=fe.subMenuCloseDelay,Jt=fe.builtinPlacements;Ge.forEach(function(un){return delete fe[un]}),delete fe.onClick;var nn=Ct==="rtl"?Object.assign({},oe,Jt):Object.assign({},ae,Jt);return delete fe.direction,j.createElement("li",Object.assign({},fe,Ne,{className:at,role:"menuitem"}),it&&Qt,it&&St,!it&&j.createElement(ye.a,{prefixCls:ke,popupClassName:a()("".concat(ke,"-popup"),Mt),getPopupContainer:ln,builtinPlacements:nn,popupPlacement:Bt,popupVisible:$e,popupAlign:Yt,popup:St,action:tn?[]:[mn],mouseEnterDelay:An,mouseLeaveDelay:Rt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:lt},Qt))}}]),Xe}(j.Component);Qe.defaultProps={onMouseEnter:F,onMouseLeave:F,onTitleMouseEnter:F,onTitleMouseLeave:F,onTitleClick:F,manualRef:F,mode:"vertical",title:""};var Ze=Object(U.b)(function(gt,qe){var Xe=gt.openKeys,Pe=gt.activeKey,se=gt.selectedKeys,fe=qe.eventKey,$e=qe.subMenuKey;return{isOpen:Xe.indexOf(fe)>-1,active:Pe[$e]===fe,selectedKeys:se}})(Qe);Ze.isSubMenu=!0;var yt=Ze,vt="menuitem-overflowed",dt=.5,pt=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(){var Pe;return Object(K.a)(this,Xe),Pe=qe.apply(this,arguments),Pe.resizeObserver=null,Pe.mutationObserver=null,Pe.originalTotalWidth=0,Pe.overflowedItems=[],Pe.menuItemSizes=[],Pe.cancelFrameId=null,Pe.state={lastVisibleIndex:void 0},Pe.getMenuItemNodes=function(){var se=Pe.props.prefixCls,fe=he.findDOMNode(Object(z.a)(Pe));return fe?[].slice.call(fe.children).filter(function($e){return $e.className.split(" ").indexOf("".concat(se,"-overflowed-submenu"))<0}):[]},Pe.getOverflowedSubMenuItem=function(se,fe,$e){var ke=Pe.props,it=ke.overflowedIndicator,at=ke.level,Ne=ke.mode,Ve=ke.prefixCls,tt=ke.theme;if(at!==1||Ne!=="horizontal")return null;var ft=Pe.props.children[0],Ct=ft.props,zt=Ct.children,qt=Ct.title,Qt=Ct.style,St=Object(xe.a)(Ct,["children","title","style"]),ln=Object(ee.a)({},Qt),Bt="".concat(se,"-overflowed-indicator"),Yt="".concat(se,"-overflowed-indicator");fe.length===0&&$e!==!0?ln=Object(ee.a)(Object(ee.a)({},ln),{},{display:"none"}):$e&&(ln=Object(ee.a)(Object(ee.a)({},ln),{},{visibility:"hidden",position:"absolute"}),Bt="".concat(Bt,"-placeholder"),Yt="".concat(Yt,"-placeholder"));var Mt=tt?"".concat(Ve,"-").concat(tt):"",tn={};return Ge.forEach(function(mn){St[mn]!==void 0&&(tn[mn]=St[mn])}),j.createElement(yt,Object.assign({title:it,className:"".concat(Ve,"-overflowed-submenu"),popupClassName:Mt},tn,{key:Bt,eventKey:Yt,disabled:!1,style:ln}),fe)},Pe.setChildrenWidthAndResize=function(){if(Pe.props.mode!=="horizontal")return;var se=he.findDOMNode(Object(z.a)(Pe));if(!se)return;var fe=se.children;if(!fe||fe.length===0)return;var $e=se.children[fe.length-1];Ue($e,"display","inline-block");var ke=Pe.getMenuItemNodes(),it=ke.filter(function(at){return at.className.split(" ").indexOf(vt)>=0});it.forEach(function(at){Ue(at,"display","inline-block")}),Pe.menuItemSizes=ke.map(function(at){return Fe(at,!0)}),it.forEach(function(at){Ue(at,"display","none")}),Pe.overflowedIndicatorWidth=Fe(se.children[se.children.length-1],!0),Pe.originalTotalWidth=Pe.menuItemSizes.reduce(function(at,Ne){return at+Ne},0),Pe.handleResize(),Ue($e,"display","none")},Pe.handleResize=function(){if(Pe.props.mode!=="horizontal")return;var se=he.findDOMNode(Object(z.a)(Pe));if(!se)return;var fe=Fe(se);Pe.overflowedItems=[];var $e=0,ke;Pe.originalTotalWidth>fe+dt&&(ke=-1,Pe.menuItemSizes.forEach(function(it){$e+=it,$e+Pe.overflowedIndicatorWidth<=fe&&(ke+=1)})),Pe.setState({lastVisibleIndex:ke})},Pe}return Object(P.a)(Xe,[{key:"componentDidMount",value:function(){var se=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var fe=he.findDOMNode(this);if(!fe)return;this.resizeObserver=new te.default(function($e){$e.forEach(function(){var ke=se.cancelFrameId;cancelAnimationFrame(ke),se.cancelFrameId=requestAnimationFrame(se.setChildrenWidthAndResize)})}),[].slice.call(fe.children).concat(fe).forEach(function($e){se.resizeObserver.observe($e)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){se.resizeObserver.disconnect(),[].slice.call(fe.children).concat(fe).forEach(function($e){se.resizeObserver.observe($e)}),se.setChildrenWidthAndResize()}),this.mutationObserver.observe(fe,{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(se){var fe=this,$e=this.state.lastVisibleIndex;return(se||[]).reduce(function(ke,it,at){var Ne=it;if(fe.props.mode==="horizontal"){var Ve=fe.getOverflowedSubMenuItem(it.props.eventKey,[]);$e!==void 0&&fe.props.className.indexOf("".concat(fe.props.prefixCls,"-root"))!==-1&&(at>$e&&(Ne=j.cloneElement(it,{style:{display:"none"},eventKey:"".concat(it.props.eventKey,"-hidden"),className:"".concat(vt)})),at===$e+1&&(fe.overflowedItems=se.slice($e+1).map(function(ft){return j.cloneElement(ft,{key:ft.props.eventKey,mode:"vertical-left"})}),Ve=fe.getOverflowedSubMenuItem(it.props.eventKey,fe.overflowedItems)));var tt=[].concat(Object(je.a)(ke),[Ve,Ne]);return at===se.length-1&&tt.push(fe.getOverflowedSubMenuItem(it.props.eventKey,[],!0)),tt}return[].concat(Object(je.a)(ke),[Ne])},[])}},{key:"render",value:function(){var se=this.props,fe=se.visible,$e=se.prefixCls,ke=se.overflowedIndicator,it=se.mode,at=se.level,Ne=se.tag,Ve=se.children,tt=se.theme,ft=Object(xe.a)(se,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ct=Ne;return j.createElement(Ct,Object.assign({},ft),this.renderChildren(Ve))}}]),Xe}(j.Component);pt.defaultProps={tag:"div",className:""};var At=pt;function wt(gt){return gt.length?gt.every(function(qe){return!!qe.props.disabled}):!0}function Oe(gt,qe,Xe){var Pe=gt.getState();gt.setState({activeKey:Object(ee.a)(Object(ee.a)({},Pe.activeKey),{},Object(c.a)({},qe,Xe))})}function we(gt){return gt.eventKey||"0-menu-"}function Je(gt,qe){var Xe=qe,Pe=gt.children,se=gt.eventKey;if(Xe){var fe;if(pe(Pe,function($e,ke){$e&&$e.props&&!$e.props.disabled&&Xe===q($e,se,ke)&&(fe=!0)}),fe)return Xe}return Xe=null,gt.defaultActiveFirst&&pe(Pe,function($e,ke){!Xe&&$e&&!$e.props.disabled&&(Xe=q($e,se,ke))}),Xe}function st(gt){if(gt){var qe=this.instanceArray.indexOf(gt);qe!==-1?this.instanceArray[qe]=gt:this.instanceArray.push(gt)}}var He=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(Pe){var se;return Object(K.a)(this,Xe),se=qe.call(this,Pe),se.onKeyDown=function(fe,$e){var ke=fe.keyCode,it;if(se.getFlatInstanceArray().forEach(function(Ne){Ne&&Ne.props.active&&Ne.onKeyDown&&(it=Ne.onKeyDown(fe))}),it)return 1;var at=null;return(ke===g.a.UP||ke===g.a.DOWN)&&(at=se.step(ke===g.a.UP?-1:1)),at?(fe.preventDefault(),Oe(se.props.store,we(se.props),at.props.eventKey),typeof $e=="function"&&$e(at),1):void 0},se.onItemHover=function(fe){var $e=fe.key,ke=fe.hover;Oe(se.props.store,we(se.props),ke?$e:null)},se.onDeselect=function(fe){se.props.onDeselect(fe)},se.onSelect=function(fe){se.props.onSelect(fe)},se.onClick=function(fe){se.props.onClick(fe)},se.onOpenChange=function(fe){se.props.onOpenChange(fe)},se.onDestroy=function(fe){se.props.onDestroy(fe)},se.getFlatInstanceArray=function(){return se.instanceArray},se.step=function(fe){var $e=se.getFlatInstanceArray(),ke=se.props.store.getState().activeKey[we(se.props)],it=$e.length;if(!it)return null;fe<0&&($e=$e.concat().reverse());var at=-1;if($e.every(function(ft,Ct){return ft&&ft.props.eventKey===ke?(at=Ct,!1):!0}),!se.props.defaultActiveFirst&&at!==-1&&wt($e.slice(at,it-1)))return;var Ne=(at+1)%it,Ve=Ne;do{var tt=$e[Ve];if(!tt||tt.props.disabled)Ve=(Ve+1)%it;else return tt}while(Ve!==Ne);return null},se.renderCommonMenuItem=function(fe,$e,ke){var it=se.props.store.getState(),at=Object(z.a)(se),Ne=at.props,Ve=q(fe,Ne.eventKey,$e),tt=fe.props;if(!tt||typeof fe.type=="string")return fe;var ft=Ve===it.activeKey,Ct=Object(ee.a)(Object(ee.a)({mode:tt.mode||Ne.mode,level:Ne.level,inlineIndent:Ne.inlineIndent,renderMenuItem:se.renderMenuItem,rootPrefixCls:Ne.prefixCls,index:$e,parentMenu:Ne.parentMenu,manualRef:tt.disabled?void 0:Object(w.a)(fe.ref,st.bind(Object(z.a)(se))),eventKey:Ve,active:!tt.disabled&&ft,multiple:Ne.multiple,onClick:function(qt){(tt.onClick||F)(qt),se.onClick(qt)},onItemHover:se.onItemHover,motion:Ne.motion,subMenuOpenDelay:Ne.subMenuOpenDelay,subMenuCloseDelay:Ne.subMenuCloseDelay,forceSubMenuRender:Ne.forceSubMenuRender,onOpenChange:se.onOpenChange,onDeselect:se.onDeselect,onSelect:se.onSelect,builtinPlacements:Ne.builtinPlacements,itemIcon:tt.itemIcon||se.props.itemIcon,expandIcon:tt.expandIcon||se.props.expandIcon},ke),{},{direction:Ne.direction});return(Ne.mode==="inline"||_e())&&(Ct.triggerSubMenuAction="click"),j.cloneElement(fe,Ct)},se.renderMenuItem=function(fe,$e,ke){if(!fe)return null;var it=se.props.store.getState(),at={openKeys:it.openKeys,selectedKeys:it.selectedKeys,triggerSubMenuAction:se.props.triggerSubMenuAction,subMenuKey:ke};return se.renderCommonMenuItem(fe,$e,at)},Pe.store.setState({activeKey:Object(ee.a)(Object(ee.a)({},Pe.store.getState().activeKey),{},Object(c.a)({},Pe.eventKey,Je(Pe,Pe.activeKey)))}),se.instanceArray=[],se}return Object(P.a)(Xe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(se){return this.props.visible||se.visible||this.props.className!==se.className||!f()(this.props.style,se.style)}},{key:"componentDidUpdate",value:function(se){var fe=this.props,$e="activeKey"in fe?fe.activeKey:fe.store.getState().activeKey[we(fe)],ke=Je(fe,$e);if(ke!==$e)Oe(fe.store,we(fe),ke);else if("activeKey"in se){var it=Je(se,se.activeKey);ke!==it&&Oe(fe.store,we(fe),ke)}}},{key:"render",value:function(){var se=this,fe=Object(R.a)({},this.props);this.instanceArray=[];var $e=a()(fe.prefixCls,fe.className,"".concat(fe.prefixCls,"-").concat(fe.mode)),ke={className:$e,role:fe.role||"menu"};fe.id&&(ke.id=fe.id),fe.focusable&&(ke.tabIndex=0,ke.onKeyDown=this.onKeyDown);var it=fe.prefixCls,at=fe.eventKey,Ne=fe.visible,Ve=fe.level,tt=fe.mode,ft=fe.overflowedIndicator,Ct=fe.theme;return Ge.forEach(function(zt){return delete fe[zt]}),delete fe.onClick,j.createElement(At,Object.assign({},fe,{prefixCls:it,mode:tt,tag:"ul",level:Ve,theme:Ct,visible:Ne,overflowedIndicator:ft},ke),j.Children.map(fe.children,function(zt,qt){return se.renderMenuItem(zt,qt,at||"0-menu-")}))}}]),Xe}(j.Component);He.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:F};var nt=Object(U.b)()(He),Te=nt,ge=N("Kwbf");function be(gt,qe,Xe){var Pe=gt.prefixCls,se=gt.motion,fe=gt.defaultMotions,$e=fe===void 0?{}:fe,ke=gt.openAnimation,it=gt.openTransitionName,at=qe.switchingModeFromInline;if(se)return se;if(Object(n.a)(ke)==="object"&&ke)Object(ge.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ke=="string")return{motionName:"".concat(Pe,"-open-").concat(ke)};if(it)return{motionName:it};var Ne=$e[Xe];return Ne||(at?null:$e.other)}var re=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(Pe){var se;Object(K.a)(this,Xe),se=qe.call(this,Pe),se.inlineOpenKeys=[],se.onSelect=function(ke){var it=Object(z.a)(se),at=it.props;if(at.selectable){var Ne=se.store.getState(),Ve=Ne.selectedKeys,tt=ke.key;at.multiple?Ve=Ve.concat([tt]):Ve=[tt],"selectedKeys"in at||se.store.setState({selectedKeys:Ve}),at.onSelect(Object(ee.a)(Object(ee.a)({},ke),{},{selectedKeys:Ve}))}},se.onClick=function(ke){var it=se.getRealMenuMode(),at=Object(z.a)(se),Ne=at.store,Ve=at.props.onOpenChange;it!=="inline"&&!("openKeys"in se.props)&&(Ne.setState({openKeys:[]}),Ve([])),se.props.onClick(ke)},se.onKeyDown=function(ke,it){se.innerMenu.getWrappedInstance().onKeyDown(ke,it)},se.onOpenChange=function(ke){var it=Object(z.a)(se),at=it.props,Ne=se.store.getState().openKeys.concat(),Ve=!1,tt=function(Ct){var zt=!1;if(Ct.open)zt=Ne.indexOf(Ct.key)===-1,zt&&Ne.push(Ct.key);else{var qt=Ne.indexOf(Ct.key);zt=qt!==-1,zt&&Ne.splice(qt,1)}Ve=Ve||zt};Array.isArray(ke)?ke.forEach(tt):tt(ke),Ve&&("openKeys"in se.props||se.store.setState({openKeys:Ne}),at.onOpenChange(Ne))},se.onDeselect=function(ke){var it=Object(z.a)(se),at=it.props;if(at.selectable){var Ne=se.store.getState().selectedKeys.concat(),Ve=ke.key,tt=Ne.indexOf(Ve);tt!==-1&&Ne.splice(tt,1),"selectedKeys"in at||se.store.setState({selectedKeys:Ne}),at.onDeselect(Object(ee.a)(Object(ee.a)({},ke),{},{selectedKeys:Ne}))}},se.onMouseEnter=function(ke){se.restoreModeVerticalFromInline();var it=se.props.onMouseEnter;it&&it(ke)},se.onTransitionEnd=function(ke){var it=ke.propertyName==="width"&&ke.target===ke.currentTarget,at=ke.target.className,Ne=Object.prototype.toString.call(at)==="[object SVGAnimatedString]"?at.animVal:at,Ve=ke.propertyName==="font-size"&&Ne.indexOf("anticon")>=0;(it||Ve)&&se.restoreModeVerticalFromInline()},se.setInnerMenu=function(ke){se.innerMenu=ke},se.isRootMenu=!0;var fe=Pe.defaultSelectedKeys,$e=Pe.defaultOpenKeys;return"selectedKeys"in Pe&&(fe=Pe.selectedKeys||[]),"openKeys"in Pe&&($e=Pe.openKeys||[]),se.store=Object(U.c)({selectedKeys:fe,openKeys:$e,activeKey:{"0-menu-":Je(Pe,Pe.activeKey)}}),se.state={switchingModeFromInline:!1},se}return Object(P.a)(Xe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(se){this.updateOpentKeysWhenSwitchMode(se),this.updateMiniStore();var fe=this.props,$e=fe.siderCollapsed,ke=fe.inlineCollapsed,it=fe.onOpenChange;(!se.inlineCollapsed&&ke||!se.siderCollapsed&&$e)&&it([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(se){var fe=this.props,$e=this.store,ke=this.inlineOpenKeys,it=$e.getState(),at={};se.mode==="inline"&&fe.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in fe||((fe.inlineCollapsed&&!se.inlineCollapsed||fe.siderCollapsed&&!se.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=it.openKeys.concat(),at.openKeys=[]),(!fe.inlineCollapsed&&se.inlineCollapsed||!fe.siderCollapsed&&se.siderCollapsed)&&(at.openKeys=ke,this.inlineOpenKeys=[])),Object.keys(at).length&&$e.setState(at)}},{key:"updateMenuDisplay",value:function(){var se=this.props.collapsedWidth,fe=this.store,$e=this.prevOpenKeys,ke=this.getInlineCollapsed()&&(se===0||se==="0"||se==="0px");ke?(this.prevOpenKeys=fe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):$e&&(this.store.setState({openKeys:$e}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var se=this.props.mode,fe=this.state.switchingModeFromInline,$e=this.getInlineCollapsed();return fe&&$e?"inline":$e?"vertical":se}},{key:"getInlineCollapsed",value:function(){var se=this.props,fe=se.inlineCollapsed,$e=se.siderCollapsed;return $e!==void 0?$e:fe}},{key:"restoreModeVerticalFromInline",value:function(){var se=this.state.switchingModeFromInline;se&&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 se=Object(ee.a)({},Object(_.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),fe=this.getRealMenuMode();return se.className+=" ".concat(se.prefixCls,"-root"),se.direction==="rtl"&&(se.className+=" ".concat(se.prefixCls,"-rtl")),se=Object(ee.a)(Object(ee.a)({},se),{},{mode:fe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:be(this.props,this.state,fe)}),delete se.openAnimation,delete se.openTransitionName,j.createElement(U.a,{store:this.store},j.createElement(Te,Object.assign({},se,{ref:this.setInnerMenu}),this.props.children))}}]),Xe}(j.Component);re.defaultProps={selectable:!0,onClick:F,onSelect:F,onOpenChange:F,onDeselect:F,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:j.createElement("span",null,"\xB7\xB7\xB7")};var ie=re,ce=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(){var Pe;return Object(K.a)(this,Xe),Pe=qe.apply(this,arguments),Pe.onKeyDown=function(se){var fe=se.keyCode;return fe===g.a.ENTER?(Pe.onClick(se),!0):void 0},Pe.onMouseLeave=function(se){var fe=Pe.props,$e=fe.eventKey,ke=fe.onItemHover,it=fe.onMouseLeave;ke({key:$e,hover:!1}),it({key:$e,domEvent:se})},Pe.onMouseEnter=function(se){var fe=Pe.props,$e=fe.eventKey,ke=fe.onItemHover,it=fe.onMouseEnter;ke({key:$e,hover:!0}),it({key:$e,domEvent:se})},Pe.onClick=function(se){var fe=Pe.props,$e=fe.eventKey,ke=fe.multiple,it=fe.onClick,at=fe.onSelect,Ne=fe.onDeselect,Ve=fe.isSelected,tt={key:$e,keyPath:[$e],item:Object(z.a)(Pe),domEvent:se};it(tt),ke?Ve?Ne(tt):at(tt):Ve||at(tt)},Pe.saveNode=function(se){Pe.node=se},Pe}return Object(P.a)(Xe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var se=this.props;se.onDestroy&&se.onDestroy(se.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 se,fe=Object(ee.a)({},this.props),$e=a()(this.getPrefixCls(),fe.className,(se={},Object(c.a)(se,this.getActiveClassName(),!fe.disabled&&fe.active),Object(c.a)(se,this.getSelectedClassName(),fe.isSelected),Object(c.a)(se,this.getDisabledClassName(),fe.disabled),se)),ke=Object(ee.a)(Object(ee.a)({},fe.attribute),{},{title:typeof fe.title=="string"?fe.title:void 0,className:$e,role:fe.role||"menuitem","aria-disabled":fe.disabled});fe.role==="option"?ke=Object(ee.a)(Object(ee.a)({},ke),{},{role:"option","aria-selected":fe.isSelected}):(fe.role===null||fe.role==="none")&&(ke.role="none");var it={onClick:fe.disabled?null:this.onClick,onMouseLeave:fe.disabled?null:this.onMouseLeave,onMouseEnter:fe.disabled?null:this.onMouseEnter},at=Object(ee.a)({},fe.style);fe.mode==="inline"&&(fe.direction==="rtl"?at.paddingRight=fe.inlineIndent*fe.level:at.paddingLeft=fe.inlineIndent*fe.level),Ge.forEach(function(Ve){return delete fe[Ve]}),delete fe.direction;var Ne=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ne=j.createElement(this.props.itemIcon,this.props)),j.createElement("li",Object.assign({},Object(_.default)(fe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ke,it,{style:at,ref:this.saveNode}),fe.children,Ne)}}]),Xe}(j.Component);ce.isMenuItem=!0,ce.defaultProps={onSelect:F,onMouseEnter:F,onMouseLeave:F,manualRef:F};var Ee=Object(U.b)(function(gt,qe){var Xe=gt.activeKey,Pe=gt.selectedKeys,se=qe.eventKey,fe=qe.subMenuKey;return{active:Xe[fe]===se,isSelected:Pe.indexOf(se)!==-1}})(ce),Be=Ee,Ie=function(gt){Object(B.a)(Xe,gt);var qe=Object(M.a)(Xe);function Xe(){var Pe;return Object(K.a)(this,Xe),Pe=qe.apply(this,arguments),Pe.renderInnerMenuItem=function(se){var fe=Pe.props,$e=fe.renderMenuItem,ke=fe.index;return $e(se,ke,Pe.props.subMenuKey)},Pe}return Object(P.a)(Xe,[{key:"render",value:function(){var se=Object(R.a)({},this.props),fe=se.className,$e=fe===void 0?"":fe,ke=se.rootPrefixCls,it="".concat(ke,"-item-group-title"),at="".concat(ke,"-item-group-list"),Ne=se.title,Ve=se.children;return Ge.forEach(function(tt){return delete se[tt]}),delete se.onClick,delete se.direction,j.createElement("li",Object.assign({},se,{className:"".concat($e," ").concat(ke,"-item-group")}),j.createElement("div",{className:it,title:typeof Ne=="string"?Ne:void 0},Ne),j.createElement("ul",{className:at},j.Children.map(Ve,this.renderInnerMenuItem)))}}]),Xe}(j.Component);Ie.isMenuItemGroup=!0,Ie.defaultProps={disabled:!0};var ut=Ie,bt=function(qe){var Xe=qe.className,Pe=qe.rootPrefixCls,se=qe.style;return j.createElement("li",{className:"".concat(Xe," ").concat(Pe,"-item-divider"),style:se})};bt.defaultProps={disabled:!0,className:"",style:{}};var Tt=bt,xt=de.e=ie},"24hK":function(et,de,N){"use strict";N.d(de,"a",function(){return P});var ee=N("JYp7"),K=function(){function z(B){this.element=B,this.next=z.Undefined,this.prev=z.Undefined}return z.Undefined=new z(void 0),z}(),P=function(){function z(){this._first=K.Undefined,this._last=K.Undefined,this._size=0}return Object.defineProperty(z.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),z.prototype.isEmpty=function(){return this._first===K.Undefined},z.prototype.clear=function(){this._first=K.Undefined,this._last=K.Undefined,this._size=0},z.prototype.unshift=function(B){return this._insert(B,!1)},z.prototype.push=function(B){return this._insert(B,!0)},z.prototype._insert=function(B,M){var j=this,U=new K(B);if(this._first===K.Undefined)this._first=U,this._last=U;else if(M){var _=this._last;this._last=U,U.prev=_,_.next=U}else{var R=this._first;this._first=U,U.next=R,R.prev=U}this._size+=1;var c=!1;return function(){c||(c=!0,j._remove(U))}},z.prototype.shift=function(){if(this._first===K.Undefined)return;var B=this._first.element;return this._remove(this._first),B},z.prototype.pop=function(){if(this._last===K.Undefined)return;var B=this._last.element;return this._remove(this._last),B},z.prototype._remove=function(B){if(B.prev!==K.Undefined&&B.next!==K.Undefined){var M=B.prev;M.next=B.next,B.next.prev=M}else B.prev===K.Undefined&&B.next===K.Undefined?(this._first=K.Undefined,this._last=K.Undefined):B.next===K.Undefined?(this._last=this._last.prev,this._last.next=K.Undefined):B.prev===K.Undefined&&(this._first=this._first.next,this._first.prev=K.Undefined);this._size-=1},z.prototype.iterator=function(){var B,M=this._first;return{next:function(){return M===K.Undefined?ee.c:(B?B.value=M.element:B={done:!1,value:M.element},M=M.next,B)}}},z.prototype.toArray=function(){for(var B=[],M=this._first;M!==K.Undefined;M=M.next)B.push(M.element);return B},z}()},"4qgm":function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70YcZS5WNj5UAsr0PS74cG+C/DLNrjppYTm0wKaSW7gUxvz2HL0q/Jpxs4tgeVN+rRvUWPF+Hx/qEURmOl7uh1ePweN11Iua+XjtsYLUjSP+BZLW0vlmLEvk07paK+LNWoxWwQxBXKhWm8u2n2MpA+/+S/suQDXvfxc1ti0ioIC/ybK5o5BbJbSJj1pD+HLXnu0DBlmEaIIzNjbfi6VhErydNeAmgX2MPCu8ZxMaNJptlBjSi6zv+VbKOcSHFVgwxXY/CFc6AI7Hzc14kzBni7xPJtFgZnxp/S+WJLFAsvEYWiko04vKMMKbOtK7Y9/+h/4mmchkFWkWz6VxyvkzYBm9vzKjmsFFnX9PfZkbPYl0BSVBy7CzvNwvqsfm3/WMct1WXUy65h1lyNMb9CS9iEsUouVls3w/tDsTeCZDjDxduhqKqHk5ZJpaprgQ/VZleug3KOnl/1dJ6QvjL4Z5uohbAx2+fBWG/ziY7icTFHLp4W96ug1lM3l0eCxvIhQicWIqBu/IbhyLDz7cErCiRup6qX5ej/2u4iXVaFyVdlxfUyFN0UojbJPGlozH4B5o+DAJfh1GxjR+VYs2deNFrx2vELa+qIfSqAxUtqkW61iXvY7+zJ55+/mFGHcsN0FJ8+a89Y1RoL3xWVF85TwF8ahBZY16RtSzEtRBRq5RmTogbqtn6GGh+vDThHiLWVyadYstffvl/Q1cu8LHnrc/giMxjzdOxNrCU6rsry1Qv5sflkQ1x8qjN5VJWvD2C2cQGMpwmG4t8lJUUAtobDds1l3coJcnVulox2LdU4xzyc62berWmbfG4GSKo80SVKK0gfjfIWaGDXFcoJW32dZ6yR5x4hYuEafUaixbcYaX3cT7NlVLfMGXGAmq4nPHlz2YvMjbJ41k4iSbYOSylBz6VThZ+2dbPzga3Jj4Todhcd6FZ4XAd8DJwZucqAF3q4gPgCWZ78GK2/S76nFBonxSKhzZfoc5ydpxGNpy2Q5HFCr0mew2WjZPOJmXZcMuMDgFZiPi1Dv3SRuXmTOqdWhRV28ZHkc3hGXw+VN+rAK67GYjWD1VCAYd/Q9borHZrWpaymTjoWv6igtZh0E59OAWnYbMIGljbrDGc4L3g3eRQNqB83A89bo4zb81HYodV06VKkb+S4b4/slMbFRn7JsaiTGF7JpZu5S/ARH8FjSMkUaja35cZ1lCTUBNXPwzhHLRmAywd7dcZlb2Bhs1C3EGNTlsOr0eLkyZ7kOdYawyoJXRCj2PDArbjvguRxVl1d2rZXGCa36oO2zBmWexLCD+ExwHai91M6WszOkc06Vfi5msc4QNzmrO7VsIbEiSCTYubtaXiiowNJmfcBssumVniGw2XaY6Jl3gN1W2oj0fTrUY9PIf7HB0Cxv0ifUZhF+SlxzuZy4i1ofV5NOyu5ltXiqvlL+VlCBGWNzV+vX7RgHnRj3JXPeRKZ6ZtP0fBbviacugTItoOakY60PasalLTuIx3dIsrh+rZwKIy6YR9iOmX7z6zUmbTwhQq1l82gugtk20zRvqrKJDrZeKaX9/vd42oIay7kzQ+aaS/C8x3WEtZc9tu2PS6TXPZEFZibx4w36YMKl2lRPIti9xY2haQh4LmcQbqBMSBPpcX2zPKDB91m8Oy4no8LIi2D3QRZW6Uxs6sLQtMzhNkfq724zTf2aKutH+rwej0gt217eBLONLKzWh8z/wWgImr1RCKgZ0h4N4rJk59pUIupPK4jAzAQWxPU7QJ3t8MW+YjMXNfW55ivriy+xbfv23C9ToootqEAzeEDTplqV+X3FZibbWqlE0iCwZOdr/adWcBfNtarzqvS7tkWt1QtNE2uGGrAhNpzXty8qDLV7IjBDUy3ioszHwspk2lux5tOgHkt3xaU1quuF7V9wF+2Rpk0dwjhTXypcQ9lYdD9bB4LaPSPYPdOqsAcYh8336yulOSyF/vT7P83Gv9qVBJysAAAAAElFTkSuQmCC"},"4u4S":function(et,de){et.exports="data:image/png;base64,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"},"55Ip":function(et,de,N){"use strict";N.d(de,"a",function(){return o}),N.d(de,"b",function(){return A});var ee=N("Ty5D"),K=N("dI71"),P=N("q1tI"),z=N.n(P),B=N("YS25"),M=N("17x9"),j=N.n(M),U=N("wx14"),_=N("zLVn"),R=N("9R94"),c=function(h){Object(K.a)(s,h);function s(){for(var D,T=arguments.length,S=new Array(T),I=0;I<T;I++)S[I]=arguments[I];return D=h.call.apply(h,[this].concat(S))||this,D.history=Object(B.a)(D.props),D}var l=s.prototype;return l.render=function(){return z.a.createElement(ee.c,{history:this.history,children:this.props.children})},s}(z.a.Component),g=function(h){Object(K.a)(s,h);function s(){for(var D,T=arguments.length,S=new Array(T),I=0;I<T;I++)S[I]=arguments[I];return D=h.call.apply(h,[this].concat(S))||this,D.history=Object(B.b)(D.props),D}var l=s.prototype;return l.render=function(){return z.a.createElement(ee.c,{history:this.history,children:this.props.children})},s}(z.a.Component),w=function(s,l){return typeof s=="function"?s(l):s},y=function(s,l){return typeof s=="string"?Object(B.c)(s,null,null,l):s},f=function(s){return s},m=z.a.forwardRef;typeof m=="undefined"&&(m=f);function a(h){return!!(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)}var n=m(function(h,s){var l=h.innerRef,D=h.navigate,T=h.onClick,S=Object(_.a)(h,["innerRef","navigate","onClick"]),I=S.target,C=Object(U.a)({},S,{onClick:function(Y){try{T&&T(Y)}catch(H){throw Y.preventDefault(),H}!Y.defaultPrevented&&Y.button===0&&(!I||I==="_self")&&!a(Y)&&(Y.preventDefault(),D())}});return f!==m?C.ref=s||l:C.ref=l,z.a.createElement("a",C)}),o=m(function(h,s){var l=h.component,D=l===void 0?n:l,T=h.replace,S=h.to,I=h.innerRef,C=Object(_.a)(h,["component","replace","to","innerRef"]);return z.a.createElement(ee.e.Consumer,null,function(W){W||Object(R.a)(!1);var Y=W.history,H=y(w(S,W.location),W.location),F=H?Y.createHref(H):"",q=Object(U.a)({},C,{href:F,navigate:function(){var pe=w(S,W.location),Ae=T?Y.replace:Y.push;Ae(pe)}});return f!==m?q.ref=s||I:q.innerRef=I,z.a.createElement(D,q)})});if(!1)var u,x;var E=function(s){return s},v=z.a.forwardRef;typeof v=="undefined"&&(v=E);function O(){for(var h=arguments.length,s=new Array(h),l=0;l<h;l++)s[l]=arguments[l];return s.filter(function(D){return D}).join(" ")}var A=v(function(h,s){var l=h["aria-current"],D=l===void 0?"page":l,T=h.activeClassName,S=T===void 0?"active":T,I=h.activeStyle,C=h.className,W=h.exact,Y=h.isActive,H=h.location,F=h.sensitive,q=h.strict,le=h.style,pe=h.to,Ae=h.innerRef,Ge=Object(_.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(ee.e.Consumer,null,function(Fe){Fe||Object(R.a)(!1);var Ue=H||Fe.location,_e=y(w(pe,Ue),Ue),je=_e.pathname,xe=je&&je.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),he=xe?Object(ee.f)(Ue.pathname,{path:xe,exact:W,sensitive:F,strict:q}):null,te=!!(Y?Y(he,Ue):he),ye=te?O(C,S):C,ue=te?Object(U.a)({},le,{},I):le,Le=Object(U.a)({"aria-current":te&&D||null,className:ye,style:ue,to:_e},Ge);return E!==v?Le.ref=s||Ae:Le.innerRef=Ae,z.a.createElement(o,Le)})});if(!1)var p},"5D2P":function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"6+eU":function(et,de,N){"use strict";N.d(de,"a",function(){return v});var ee=N("wx14"),K=N("rePB"),P=N("VTBJ"),z=N("1OyB"),B=N("vuIU"),M=N("Ji7U"),j=N("LK+K"),U=N("q1tI"),_=N.n(U),R=N("TSYQ"),c=N.n(R),g=function(A){var p,h="".concat(A.rootPrefixCls,"-item"),s=c()(h,"".concat(h,"-").concat(A.page),(p={},Object(K.a)(p,"".concat(h,"-active"),A.active),Object(K.a)(p,A.className,!!A.className),Object(K.a)(p,"".concat(h,"-disabled"),!A.page),p)),l=function(){A.onClick(A.page)},D=function(S){A.onKeyPress(S,A.onClick,A.page)};return _.a.createElement("li",{title:A.showTitle?A.page:null,className:s,onClick:l,onKeyPress:D,tabIndex:"0"},A.itemRender(A.page,"page",_.a.createElement("a",{rel:"nofollow"},A.page)))},w=g,y={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},f=function(O){Object(M.a)(p,O);var A=Object(j.a)(p);function p(){var h;Object(z.a)(this,p);for(var s=arguments.length,l=new Array(s),D=0;D<s;D++)l[D]=arguments[D];return h=A.call.apply(A,[this].concat(l)),h.state={goInputText:""},h.buildOptionText=function(T){return"".concat(T," ").concat(h.props.locale.items_per_page)},h.changeSize=function(T){h.props.changeSize(Number(T))},h.handleChange=function(T){h.setState({goInputText:T.target.value})},h.handleBlur=function(T){var S=h.props,I=S.goButton,C=S.quickGo,W=S.rootPrefixCls,Y=h.state.goInputText;if(I||Y==="")return;if(T.relatedTarget&&(T.relatedTarget.className.indexOf("".concat(W,"-prev"))>=0||T.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;h.setState({goInputText:""}),C(h.getValidValue())},h.go=function(T){var S=h.state.goInputText;if(S==="")return;(T.keyCode===y.ENTER||T.type==="click")&&(h.setState({goInputText:""}),h.props.quickGo(h.getValidValue()))},h}return Object(B.a)(p,[{key:"getValidValue",value:function(){var s=this.state,l=s.goInputText,D=s.current;return!l||isNaN(l)?D:Number(l)}},{key:"getPageSizeOptions",value:function(){var s=this.props,l=s.pageSize,D=s.pageSizeOptions;return D.some(function(T){return T.toString()===l.toString()})?D:D.concat([l.toString()]).sort(function(T,S){var I=isNaN(Number(T))?0:Number(T),C=isNaN(Number(S))?0:Number(S);return I-C})}},{key:"render",value:function(){var s=this,l=this.props,D=l.pageSize,T=l.locale,S=l.rootPrefixCls,I=l.changeSize,C=l.quickGo,W=l.goButton,Y=l.selectComponentClass,H=l.buildOptionText,F=l.selectPrefixCls,q=l.disabled,le=this.state.goInputText,pe="".concat(S,"-options"),Ae=Y,Ge=null,Fe=null,Ue=null;if(!I&&!C)return null;var _e=this.getPageSizeOptions();if(I&&Ae){var je=_e.map(function(xe,he){return _.a.createElement(Ae.Option,{key:he,value:xe.toString()},(H||s.buildOptionText)(xe))});Ge=_.a.createElement(Ae,{disabled:q,prefixCls:F,showSearch:!1,className:"".concat(pe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(D||_e[0]).toString(),onChange:this.changeSize,getPopupContainer:function(he){return he.parentNode}},je)}return C&&(W&&(Ue=typeof W=="boolean"?_.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:q,className:"".concat(pe,"-quick-jumper-button")},T.jump_to_confirm):_.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),Fe=_.a.createElement("div",{className:"".concat(pe,"-quick-jumper")},T.jump_to,_.a.createElement("input",{disabled:q,type:"text",value:le,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,Ue)),_.a.createElement("li",{className:"".concat(pe)},Ge,Fe)}}]),p}(_.a.Component);f.defaultProps={pageSizeOptions:["10","20","50","100"]};var m=f,a=N("N2Kk");function n(){}function o(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function u(O,A,p){return p}function x(O,A,p){var h=typeof O=="undefined"?A.pageSize:O;return Math.floor((p.total-1)/h)+1}var E=function(O){Object(M.a)(p,O);var A=Object(j.a)(p);function p(h){var s;Object(z.a)(this,p),s=A.call(this,h),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(x(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(I,C){var W=s.props.prefixCls,Y=I||_.a.createElement("button",{type:"button","aria-label":C,className:"".concat(W,"-item-link")});return typeof I=="function"&&(Y=_.a.createElement(I,Object(P.a)({},s.props))),Y},s.savePaginationNode=function(I){s.paginationNode=I},s.isValid=function(I){return o(I)&&I!==s.state.current},s.shouldDisplayQuickJumper=function(){var I=s.props,C=I.showQuickJumper,W=I.pageSize,Y=I.total;return Y<=W?!1:C},s.handleKeyDown=function(I){(I.keyCode===y.ARROW_UP||I.keyCode===y.ARROW_DOWN)&&I.preventDefault()},s.handleKeyUp=function(I){var C=s.getValidValue(I),W=s.state.currentInputValue;C!==W&&s.setState({currentInputValue:C}),I.keyCode===y.ENTER?s.handleChange(C):I.keyCode===y.ARROW_UP?s.handleChange(C-1):I.keyCode===y.ARROW_DOWN&&s.handleChange(C+1)},s.changePageSize=function(I){var C=s.state.current,W=x(I,s.state,s.props);C=C>W?W:C,W===0&&(C=s.state.current),typeof I=="number"&&("pageSize"in s.props||s.setState({pageSize:I}),"current"in s.props||s.setState({current:C,currentInputValue:C})),s.props.onShowSizeChange(C,I),"onChange"in s.props&&s.props.onChange&&s.props.onChange(C,I)},s.handleChange=function(I){var C=s.props.disabled,W=I;if(s.isValid(W)&&!C){var Y=x(void 0,s.state,s.props);W>Y?W=Y:W<1&&(W=1),"current"in s.props||s.setState({current:W,currentInputValue:W});var H=s.state.pageSize;return s.props.onChange(W,H),W}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current<x(void 0,s.state,s.props)},s.runIfEnter=function(I,C){if(I.key==="Enter"||I.charCode===13){for(var W=arguments.length,Y=new Array(W>2?W-2:0),H=2;H<W;H++)Y[H-2]=arguments[H];C.apply(void 0,Y)}},s.runIfEnterPrev=function(I){s.runIfEnter(I,s.prev)},s.runIfEnterNext=function(I){s.runIfEnter(I,s.next)},s.runIfEnterJumpPrev=function(I){s.runIfEnter(I,s.jumpPrev)},s.runIfEnterJumpNext=function(I){s.runIfEnter(I,s.jumpNext)},s.handleGoTO=function(I){(I.keyCode===y.ENTER||I.type==="click")&&s.handleChange(s.state.currentInputValue)};var l=h.onChange!==n,D="current"in h;D&&!l&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var T=h.defaultCurrent;"current"in h&&(T=h.current);var S=h.defaultPageSize;return"pageSize"in h&&(S=h.pageSize),T=Math.min(T,x(S,void 0,h)),s.state={current:T,currentInputValue:T,pageSize:S},s}return Object(B.a)(p,[{key:"componentDidUpdate",value:function(s,l){var D=this.props.prefixCls;if(l.current!==this.state.current&&this.paginationNode){var T=this.paginationNode.querySelector(".".concat(D,"-item-").concat(l.current));T&&document.activeElement===T&&T.blur()}}},{key:"getValidValue",value:function(s){var l=s.target.value,D=x(void 0,this.state,this.props),T=this.state.currentInputValue,S;return l===""?S=l:isNaN(Number(l))?S=T:l>=D?S=D:S=Number(l),S}},{key:"getShowSizeChanger",value:function(){var s=this.props,l=s.showSizeChanger,D=s.total,T=s.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:D>T}},{key:"renderPrev",value:function(s){var l=this.props,D=l.prevIcon,T=l.itemRender,S=T(s,"prev",this.getItemIcon(D,"prev page")),I=!this.hasPrev();return Object(U.isValidElement)(S)?Object(U.cloneElement)(S,{disabled:I}):S}},{key:"renderNext",value:function(s){var l=this.props,D=l.nextIcon,T=l.itemRender,S=T(s,"next",this.getItemIcon(D,"next page")),I=!this.hasNext();return Object(U.isValidElement)(S)?Object(U.cloneElement)(S,{disabled:I}):S}},{key:"render",value:function(){var s=this,l=this.props,D=l.prefixCls,T=l.className,S=l.style,I=l.disabled,C=l.hideOnSinglePage,W=l.total,Y=l.locale,H=l.showQuickJumper,F=l.showLessItems,q=l.showTitle,le=l.showTotal,pe=l.simple,Ae=l.itemRender,Ge=l.showPrevNextJumpers,Fe=l.jumpPrevIcon,Ue=l.jumpNextIcon,_e=l.selectComponentClass,je=l.selectPrefixCls,xe=l.pageSizeOptions,he=this.state,te=he.current,ye=he.pageSize,ue=he.currentInputValue;if(C===!0&&W<=ye)return null;var Le=x(void 0,this.state,this.props),ae=[],oe=null,Se=null,Me=null,We=null,Ke=null,Qe=H&&H.goButton,Ze=F?1:2,yt=te-1>0?te-1:0,vt=te+1<Le?te+1:Le,dt=Object.keys(this.props).reduce(function(re,ie){return(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(re[ie]=s.props[ie]),re},{});if(pe)return Qe&&(typeof Qe=="boolean"?Ke=_.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Y.jump_to_confirm):Ke=_.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Qe),Ke=_.a.createElement("li",{title:q?"".concat(Y.jump_to).concat(te,"/").concat(Le):null,className:"".concat(D,"-simple-pager")},Ke)),_.a.createElement("ul",Object(ee.a)({className:c()(D,"".concat(D,"-simple"),Object(K.a)({},"".concat(D,"-disabled"),I),T),style:S,ref:this.savePaginationNode},dt),_.a.createElement("li",{title:q?Y.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:c()("".concat(D,"-prev"),Object(K.a)({},"".concat(D,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(yt)),_.a.createElement("li",{title:q?"".concat(te,"/").concat(Le):null,className:"".concat(D,"-simple-pager")},_.a.createElement("input",{type:"text",value:ue,disabled:I,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),_.a.createElement("span",{className:"".concat(D,"-slash")},"/"),Le),_.a.createElement("li",{title:q?Y.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:c()("".concat(D,"-next"),Object(K.a)({},"".concat(D,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(vt)),Ke);if(Le<=3+Ze*2){var pt={locale:Y,rootPrefixCls:D,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:q,itemRender:Ae};Le||ae.push(_.a.createElement(w,Object(ee.a)({},pt,{key:"noPager",page:Le,className:"".concat(D,"-disabled")})));for(var At=1;At<=Le;At+=1){var wt=te===At;ae.push(_.a.createElement(w,Object(ee.a)({},pt,{key:At,page:At,active:wt})))}}else{var Oe=F?Y.prev_3:Y.prev_5,we=F?Y.next_3:Y.next_5;Ge&&(oe=_.a.createElement("li",{title:q?Oe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:c()("".concat(D,"-jump-prev"),Object(K.a)({},"".concat(D,"-jump-prev-custom-icon"),!!Fe))},Ae(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Fe,"prev page"))),Se=_.a.createElement("li",{title:q?we:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:c()("".concat(D,"-jump-next"),Object(K.a)({},"".concat(D,"-jump-next-custom-icon"),!!Ue))},Ae(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ue,"next page")))),We=_.a.createElement(w,{locale:Y,last:!0,rootPrefixCls:D,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Le,page:Le,active:!1,showTitle:q,itemRender:Ae}),Me=_.a.createElement(w,{locale:Y,rootPrefixCls:D,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:q,itemRender:Ae});var Je=Math.max(1,te-Ze),st=Math.min(te+Ze,Le);te-1<=Ze&&(st=1+Ze*2),Le-te<=Ze&&(Je=Le-Ze*2);for(var He=Je;He<=st;He+=1){var nt=te===He;ae.push(_.a.createElement(w,{locale:Y,rootPrefixCls:D,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:nt,showTitle:q,itemRender:Ae}))}te-1>=Ze*2&&te!==1+2&&(ae[0]=Object(U.cloneElement)(ae[0],{className:"".concat(D,"-item-after-jump-prev")}),ae.unshift(oe)),Le-te>=Ze*2&&te!==Le-2&&(ae[ae.length-1]=Object(U.cloneElement)(ae[ae.length-1],{className:"".concat(D,"-item-before-jump-next")}),ae.push(Se)),Je!==1&&ae.unshift(Me),st!==Le&&ae.push(We)}var Te=null;le&&(Te=_.a.createElement("li",{className:"".concat(D,"-total-text")},le(W,[W===0?0:(te-1)*ye+1,te*ye>W?W:te*ye])));var ge=!this.hasPrev()||!Le,be=!this.hasNext()||!Le;return _.a.createElement("ul",Object(ee.a)({className:c()(D,T,Object(K.a)({},"".concat(D,"-disabled"),I)),style:S,unselectable:"unselectable",ref:this.savePaginationNode},dt),Te,_.a.createElement("li",{title:q?Y.prev_page:null,onClick:this.prev,tabIndex:ge?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(D,"-prev"),Object(K.a)({},"".concat(D,"-disabled"),ge)),"aria-disabled":ge},this.renderPrev(yt)),ae,_.a.createElement("li",{title:q?Y.next_page:null,onClick:this.next,tabIndex:be?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(D,"-next"),Object(K.a)({},"".concat(D,"-disabled"),be)),"aria-disabled":be},this.renderNext(vt)),_.a.createElement(m,{disabled:I,locale:Y,rootPrefixCls:D,selectComponentClass:_e,selectPrefixCls:je,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:te,pageSize:ye,pageSizeOptions:xe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Qe}))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var D={};if("current"in s&&(D.current=s.current,s.current!==l.current&&(D.currentInputValue=D.current)),"pageSize"in s&&s.pageSize!==l.pageSize){var T=l.current,S=x(s.pageSize,l,s);T=T>S?S:T,"current"in s||(D.current=T,D.currentInputValue=T),D.pageSize=s.pageSize}return D}}]),p}(_.a.Component);E.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:a.a,style:{},itemRender:u,totalBoundaryShowSizeChanger:50};var v=E},"6RRn":function(et,de,N){"use strict";var ee=N("wCXF"),K=N("n6Qo");N.d(de,"b",function(){return K.a});var P=N("IBYe"),z=N("6eGT"),B=N("hW8S");N.d(de,"a",function(){return B.a}),de.c=ee.b},"6eGT":function(et,de,N){"use strict";function ee(K){return null}de.a=ee},"746U":function(et,de,N){"use strict";N.d(de,"d",function(){return K}),N.d(de,"j",function(){return P}),N.d(de,"i",function(){return z}),N.d(de,"h",function(){return B}),N.d(de,"e",function(){return M}),N.d(de,"k",function(){return j}),N.d(de,"l",function(){return U}),N.d(de,"a",function(){return _}),N.d(de,"f",function(){return c}),N.d(de,"g",function(){return g}),N.d(de,"m",function(){return w}),N.d(de,"c",function(){return m}),N.d(de,"b",function(){return a}),N.d(de,"n",function(){return n}),N.d(de,"o",function(){return o});var ee={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function K(u){return Array.isArray?Array.isArray(u):!!(u&&typeof u.length===ee.number&&u.constructor===Array)}function P(u){return typeof u===ee.string||u instanceof String}function z(u){return typeof u===ee.object&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function B(u){return(typeof u===ee.number||u instanceof Number)&&!isNaN(u)}function M(u){return u===!0||u===!1}function j(u){return typeof u===ee.undefined}function U(u){return j(u)||u===null}function _(u,x){if(!u)throw new Error(x?"Unexpected type, expected '"+x+"'":"Unexpected type")}var R=Object.prototype.hasOwnProperty;function c(u){if(!z(u))return!1;for(var x in u)if(R.call(u,x))return!1;return!0}function g(u){return typeof u===ee.function}function w(u,x){for(var E=Math.min(u.length,x.length),v=0;v<E;v++)y(u[v],x[v])}function y(u,x){if(P(x)){if(typeof u!==x)throw new Error("argument does not match constraint: typeof "+x)}else if(g(x)){try{if(u instanceof x)return}catch(E){}if(!U(u)&&u.constructor===x)return;if(x.length===1&&x.call(void 0,u)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function f(u){for(var x=[],E=Object.getPrototypeOf(u);Object.prototype!==E;)x=x.concat(Object.getOwnPropertyNames(E)),E=Object.getPrototypeOf(E);return x}function m(u){for(var x=[],E=0,v=f(u);E<v.length;E++){var O=v[E];typeof u[O]=="function"&&x.push(O)}return x}function a(u,x){for(var E=function(h){return function(){var s=Array.prototype.slice.call(arguments,0);return x(h,s)}},v={},O=0,A=u;O<A.length;O++){var p=A[O];v[p]=E(p)}return v}function n(u){return u===null?void 0:u}function o(u){return typeof u=="undefined"?null:u}},"7Cbv":function(et,de,N){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),K=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(K)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function B(w){return typeof w=="string"&&z.test(w)}for(var M=B,j=[],U=0;U<256;++U)j.push((U+256).toString(16).substr(1));function _(w){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,f=(j[w[y+0]]+j[w[y+1]]+j[w[y+2]]+j[w[y+3]]+"-"+j[w[y+4]]+j[w[y+5]]+"-"+j[w[y+6]]+j[w[y+7]]+"-"+j[w[y+8]]+j[w[y+9]]+"-"+j[w[y+10]]+j[w[y+11]]+j[w[y+12]]+j[w[y+13]]+j[w[y+14]]+j[w[y+15]]).toLowerCase();if(!M(f))throw TypeError("Stringified UUID is invalid");return f}var R=_;function c(w,y,f){w=w||{};var m=w.random||(w.rng||P)();if(m[6]=m[6]&15|64,m[8]=m[8]&63|128,y){f=f||0;for(var a=0;a<16;++a)y[f+a]=m[a];return y}return R(m)}var g=de.a=c},"7ZXX":function(et,de,N){et.exports=N.p+"static/err.6e7c5817.png"},"7ahc":function(et,de,N){"use strict";N.d(de,"a",function(){return x});var ee=N("k1fw"),K=N("0Owb"),P=N("+L6B"),z=N("2/Rp"),B=N("y8nQ"),M=N("Vl3Y"),j=N("tJVT"),U=N("OaEy"),_=N("2fM7"),R=N("q1tI"),c=N.n(R),g=N("VrN/"),w=N.n(g),y=N("p77/"),f=N.n(y),m=N("c5Ni"),a=N.n(m),n=_.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},u={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"]};de.b=function(E){var v=E.callback,O=E.onCancel,A=Object(R.useState)("python"),p=Object(j.a)(A,2),h=p[0],s=p[1];function l(T){s(u[T][1])}function D(T){v(T)}return c.a.createElement(M.a,Object(K.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:D}),c.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(_.a,{onChange:l},Object.keys(u).map(function(T){return c.a.createElement(n,{key:T,value:T},u[T][0])}))),c.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(x,{mode:h})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(z.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function x(E){var v=E.value,O=E.onChange,A=E.mode,p=E.options,h=p===void 0?{}:p,s=Object(R.useRef)(),l=Object(R.useState)(),D=Object(j.a)(l,2),T=D[0],S=D[1];return Object(R.useEffect)(function(){if(T){function I(C){var W=C.getValue();O&&O(W)}return T.on("change",I),function(){T.off("change",I)}}},[T,O]),Object(R.useEffect)(function(){T&&T.setOption("mode",A)},[T,A]),Object(R.useEffect)(function(){T&&((v!==T.getValue()||v==="")&&setTimeout(function(){T.setValue(v||" ")},300))},[T,v]),Object(R.useEffect)(function(){if(s.current&&!T){var I=w.a.fromTextArea(s.current,Object(ee.a)({mode:A,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},h));S(I)}},[s.current,T]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:s}))}},"7ixt":function(et,de,N){"use strict";N.d(de,"a",function(){return P});var ee={adjustX:1,adjustY:1},K=[0,0],P={left:{points:["cr","cl"],overflow:ee,offset:[-4,0],targetOffset:K},right:{points:["cl","cr"],overflow:ee,offset:[4,0],targetOffset:K},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:K},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:K},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:K},leftTop:{points:["tr","tl"],overflow:ee,offset:[-4,0],targetOffset:K},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:K},rightTop:{points:["tl","tr"],overflow:ee,offset:[4,0],targetOffset:K},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:K},rightBottom:{points:["bl","br"],overflow:ee,offset:[4,0],targetOffset:K},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:K},leftBottom:{points:["br","bl"],overflow:ee,offset:[-4,0],targetOffset:K}},z=P},"7v3h":function(et,de,N){et.exports=N.p+"static/empty2.dd73f390.png"},"8/bI":function(et,de,N){et.exports=N.p+"static/empty.8918e228.png"},"815F":function(et,de,N){"use strict";N.d(de,"e",function(){return j}),N.d(de,"c",function(){return _}),N.d(de,"d",function(){return R}),N.d(de,"a",function(){return g}),N.d(de,"f",function(){return w}),N.d(de,"b",function(){return y});var ee=N("KQm4"),K=N("VTBJ"),P=N("Ff2n"),z=N("Zm9Q"),B=N("Kwbf"),M=N("OZM5");function j(f,m){return f!=null?f:m}function U(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=new Map;function a(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(u){var x=u.key,E=u.children;Object(B.a)(x!=null,"Tree node must have a certain key: [".concat(o).concat(x,"]"));var v=String(x);Object(B.a)(!m.has(v)||x===null||x===void 0,"Same 'key' exist in the Tree: ".concat(v)),m.set(v,!0),a(E,"".concat(o).concat(v," > "))})}a(f)}function _(f){function m(a){var n=Object(z.a)(a);return n.map(function(o){if(!Object(M.i)(o))return Object(B.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var u=o.key,x=o.props,E=x.children,v=Object(P.a)(x,["children"]),O=Object(K.a)({key:u},v),A=m(E);return A.length&&(O.children=A),O}).filter(function(o){return o})}return m(f)}function R(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(m===!0?[]:m),n=[];function o(u){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(E,v){var O=Object(M.h)(x?x.pos:"0",v),A=j(E.key,O),p=Object(K.a)(Object(K.a)({},E),{},{parent:x,pos:O,children:null,data:E,isStart:[].concat(Object(ee.a)(x?x.isStart:[]),[v===0]),isEnd:[].concat(Object(ee.a)(x?x.isEnd:[]),[v===u.length-1])});return n.push(p),m===!0||a.has(A)?p.children=o(E.children||[],p):p.children=[],p})}return o(f),n}function c(f,m,a){var n;a?typeof a=="string"?n=function(x){return x[a]}:typeof a=="function"&&(n=function(x){return a(x)}):n=function(x,E){return j(x.key,E)};function o(u,x,E){var v=u?u.children:f,O=u?Object(M.h)(E.pos,x):"0";if(u){var A=n(u,O),p={node:u,index:x,pos:O,key:A,parentPos:E.node?E.pos:null,level:E.level+1};m(p)}v&&v.forEach(function(h,s){o(h,s,{node:u,pos:O,level:E?E.level+1:-1})})}o(null)}function g(f){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=m.initWrapper,n=m.processEntity,o=m.onProcessFinished,u=arguments.length>2?arguments[2]:void 0,x={},E={},v={posEntities:x,keyEntities:E};return a&&(v=a(v)||v),c(f,function(O){var A=O.node,p=O.index,h=O.pos,s=O.key,l=O.parentPos,D=O.level,T={node:A,index:p,key:s,pos:h,level:D},S=j(s,h);x[h]=T,E[S]=T,T.parent=x[l],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),n&&n(T,v)},u),o&&o(v),v}function w(f,m){var a=m.expandedKeys,n=m.selectedKeys,o=m.loadedKeys,u=m.loadingKeys,x=m.checkedKeys,E=m.halfCheckedKeys,v=m.dragOverNodeKey,O=m.dropPosition,A=m.keyEntities,p=A[f],h={eventKey:f,expanded:a.indexOf(f)!==-1,selected:n.indexOf(f)!==-1,loaded:o.indexOf(f)!==-1,loading:u.indexOf(f)!==-1,checked:x.indexOf(f)!==-1,halfChecked:E.indexOf(f)!==-1,pos:String(p?p.pos:""),dragOver:v===f&&O===0,dragOverGapTop:v===f&&O===-1,dragOverGapBottom:v===f&&O===1};return h}function y(f){var m=f.data,a=f.expanded,n=f.selected,o=f.checked,u=f.loaded,x=f.loading,E=f.halfChecked,v=f.dragOver,O=f.dragOverGapTop,A=f.dragOverGapBottom,p=f.pos,h=f.active,s=Object(K.a)(Object(K.a)({},m),{},{expanded:a,selected:n,checked:o,loaded:u,loading:x,halfChecked:E,dragOver:v,dragOverGapTop:O,dragOverGapBottom:A,pos:p,active:h});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(B.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),s}},"8EBN":function(et,de,N){(function(ee){ee(N("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 K=0;K<ee.modeInfo.length;K++){var P=ee.modeInfo[K];P.mimes&&(P.mime=P.mimes[0])}ee.findModeByMIME=function(z){z=z.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var M=ee.modeInfo[B];if(M.mime==z)return M;if(M.mimes){for(var j=0;j<M.mimes.length;j++)if(M.mimes[j]==z)return M}}if(/\+xml$/.test(z))return ee.findModeByMIME("application/xml");if(/\+json$/.test(z))return ee.findModeByMIME("application/json")},ee.findModeByExtension=function(z){z=z.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var M=ee.modeInfo[B];if(M.ext){for(var j=0;j<M.ext.length;j++)if(M.ext[j]==z)return M}}},ee.findModeByFileName=function(z){for(var B=0;B<ee.modeInfo.length;B++){var M=ee.modeInfo[B];if(M.file&&M.file.test(z))return M}var j=z.lastIndexOf("."),U=j>-1&&z.substring(j+1,z.length);if(U)return ee.findModeByExtension(U)},ee.findModeByName=function(z){z=z.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var M=ee.modeInfo[B];if(M.name.toLowerCase()==z)return M;if(M.alias){for(var j=0;j<M.alias.length;j++)if(M.alias[j].toLowerCase()==z)return M}}}})},"8HAY":function(et,de,N){"use strict";N.d(de,"a",function(){return M}),N.d(de,"b",function(){return j});var ee=N("pmY6"),K=N("MI8n"),P=function(){var U=function(_,R){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,g){c.__proto__=g}||function(c,g){for(var w in g)g.hasOwnProperty(w)&&(c[w]=g[w])},U(_,R)};return function(_,R){U(_,R);function c(){this.constructor=_}_.prototype=R===null?Object.create(R):(c.prototype=R.prototype,new c)}}(),z=function(U,_,R,c){function g(w){return w instanceof R?w:new R(function(y){y(w)})}return new(R||(R=Promise))(function(w,y){function f(n){try{a(c.next(n))}catch(o){y(o)}}function m(n){try{a(c.throw(n))}catch(o){y(o)}}function a(n){n.done?w(n.value):g(n.value).then(f,m)}a((c=c.apply(U,_||[])).next())})},B=function(U,_){var R={label:0,sent:function(){if(w[0]&1)throw w[1];return w[1]},trys:[],ops:[]},c,g,w,y;return y={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function f(a){return function(n){return m([a,n])}}function m(a){if(c)throw new TypeError("Generator is already executing.");for(;R;)try{if(c=1,g&&(w=a[0]&2?g.return:a[0]?g.throw||((w=g.return)&&w.call(g),0):g.next)&&!(w=w.call(g,a[1])).done)return w;(g=0,w)&&(a=[a[0]&2,w.value]);switch(a[0]){case 0:case 1:w=a;break;case 4:return R.label++,{value:a[1],done:!1};case 5:R.label++,g=a[1],a=[0];continue;case 7:a=R.ops.pop(),R.trys.pop();continue;default:if(!(w=R.trys,w=w.length>0&&w[w.length-1])&&(a[0]===6||a[0]===2)){R=0;continue}if(a[0]===3&&(!w||a[1]>w[0]&&a[1]<w[3])){R.label=a[1];break}if(a[0]===6&&R.label<w[1]){R.label=w[1],w=a;break}if(w&&R.label<w[2]){R.label=w[2],R.ops.push(a);break}w[2]&&R.ops.pop(),R.trys.pop();continue}a=_.call(U,R)}catch(n){a=[6,n],g=0}finally{c=w=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},M=function(U){P(_,U);function _(R,c,g,w,y){c===void 0&&(c=""),g===void 0&&(g=""),w===void 0&&(w=!0);var f=U.call(this)||this;return f._onDidChange=f._register(new K.a),f.onDidChange=f._onDidChange.event,f._enabled=!0,f._checked=!1,f._id=R,f._label=c,f._cssClass=g,f._enabled=w,f._actionCallback=y,f}return Object.defineProperty(_.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"label",{get:function(){return this._label},set:function(R){this._setLabel(R)},enumerable:!0,configurable:!0}),_.prototype._setLabel=function(R){this._label!==R&&(this._label=R,this._onDidChange.fire({label:R}))},Object.defineProperty(_.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(R){this._setTooltip(R)},enumerable:!0,configurable:!0}),_.prototype._setTooltip=function(R){this._tooltip!==R&&(this._tooltip=R,this._onDidChange.fire({tooltip:R}))},Object.defineProperty(_.prototype,"class",{get:function(){return this._cssClass},set:function(R){this._setClass(R)},enumerable:!0,configurable:!0}),_.prototype._setClass=function(R){this._cssClass!==R&&(this._cssClass=R,this._onDidChange.fire({class:R}))},Object.defineProperty(_.prototype,"enabled",{get:function(){return this._enabled},set:function(R){this._setEnabled(R)},enumerable:!0,configurable:!0}),_.prototype._setEnabled=function(R){this._enabled!==R&&(this._enabled=R,this._onDidChange.fire({enabled:R}))},Object.defineProperty(_.prototype,"checked",{get:function(){return this._checked},set:function(R){this._setChecked(R)},enumerable:!0,configurable:!0}),_.prototype._setChecked=function(R){this._checked!==R&&(this._checked=R,this._onDidChange.fire({checked:R}))},_.prototype.run=function(R,c){return this._actionCallback?this._actionCallback(R):Promise.resolve(!0)},_}(ee.a),j=function(U){P(_,U);function _(){var R=U!==null&&U.apply(this,arguments)||this;return R._onDidBeforeRun=R._register(new K.a),R.onDidBeforeRun=R._onDidBeforeRun.event,R._onDidRun=R._register(new K.a),R.onDidRun=R._onDidRun.event,R}return _.prototype.run=function(R,c){return z(this,void 0,void 0,function(){var g,w;return B(this,function(y){switch(y.label){case 0:if(!R.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:R}),y.label=1;case 1:return y.trys.push([1,3,,4]),[4,this.runAction(R,c)];case 2:return g=y.sent(),this._onDidRun.fire({action:R,result:g}),[3,4];case 3:return w=y.sent(),this._onDidRun.fire({action:R,error:w}),[3,4];case 4:return[2]}})})},_.prototype.runAction=function(R,c){var g=c?R.run(c):R.run();return Promise.resolve(g)},_}(ee.a)},"8hTe":function(et,de,N){et.exports={button:"button___1wy9m"}},"9Bee":function(et,de,N){"use strict";var ee=N("DYRE"),K=N("zeV3"),P=N("+L6B"),z=N("2/Rp"),B=N("k1fw"),M=N("9og8"),j=N("tJVT"),U=N("WmNS"),_=N.n(U),R=N("q1tI"),c=N.n(R),g=N("vg9a"),w=N("DlQD"),y=N.n(w),f=N("rUJ1");function m(G,b){var L=G.match(/^(\s+)(?:```)/);if(L===null)return b;var V=L[1];return b.split(`
`).map(function(J){var Q=J.match(/^\s+/);if(Q===null)return J;var De=Object(j.a)(Q,1),ot=De[0];return ot.length>=V.length?J.slice(V.length):J}).join(`
`)}var a=[],n=["<ul>"],o=new y.a.Renderer,u=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){a.length=0,n=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function v(G,b,L,V){if(b>=G.length||G[b].level<=L)return b;var J=G[b];V.push("<li><a href='#"+J.anchor+"'>"+J.text+"</a>"),b++;var Q=[];return b=v(G,b,J.level,Q),Q.length>0&&(V.push("<ul>"),Q.forEach(function(De){V.push(De)}),V.push("</ul>")),V.push("</li>"),b=v(G,b,L,V),b}function O(){return v(a,0,0,n),n.push("</ul>"),n.join("")}var A={heading:function(b){var L=u.exec(b);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(b){var L=this.rules.block.fences.exec(b);if(L){var V=L[0],J=m(V,L[3]||""),Q=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Q)>=0){var De=s(),ot=J;J=De,l[De]={type:"block",expression:ot}}return{type:"code",raw:V,lang:Q,text:J}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,s=function(){return"__special_katext_id_".concat(h++,"__")},l={};function D(){return l}function T(){h=0,l={}}function S(G){return G=G.replace(p,function(b,L){var V=s();return l[V]={type:"inline",expression:L},V}),G}var I=o.listitem;o.listitem=function(G){return I(S(G))};var C=o.paragraph;o.paragraph=function(G){return C(S(G))};var W=o.tablecell;o.tablecell=function(G,b){return W(S(G),b)},o.code=function(G,b,L){var V=(b||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(b,'">').concat(L?G:Object(f.escape)(G,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(L?G:Object(f.escape)(G,!0))+"</code></pre>"},o.heading=function(G,b,L){var V=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:V,level:b,text:G}),"<h"+b+' id="'+V+'">'+G+"</h"+b+">"},y.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),y.a.use({tokenizer:A,renderer:o});var Y=y.a,H=N("SJMd"),F=N("ulZh"),q=N.n(F),le=N("m3rI"),pe=N("Oy/b"),Ae=N("p5ED"),Ge=N("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 Fe=function(G,b){return(Fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var J in V)Object.prototype.hasOwnProperty.call(V,J)&&(L[J]=V[J])})(G,b)};function Ue(G,b){function L(){this.constructor=G}Fe(G,b),G.prototype=b===null?Object.create(b):(L.prototype=b.prototype,new L)}function _e(G,b,L,V){return new(L||(L=Promise))(function(J,Q){function De(Ft){try{Ot(V.next(Ft))}catch(ve){Q(ve)}}function ot(Ft){try{Ot(V.throw(Ft))}catch(ve){Q(ve)}}function Ot(Ft){var ve;Ft.done?J(Ft.value):(ve=Ft.value,ve instanceof L?ve:new L(function(Gt){Gt(ve)})).then(De,ot)}Ot((V=V.apply(G,b||[])).next())})}function je(G,b){var L,V,J,Q,De={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return Q={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ot(Ot){return function(Ft){return function(ve){if(L)throw new TypeError("Generator is already executing.");for(;De;)try{if(L=1,V&&(J=2&ve[0]?V.return:ve[0]?V.throw||((J=V.return)&&J.call(V),0):V.next)&&!(J=J.call(V,ve[1])).done)return J;switch(V=0,J&&(ve=[2&ve[0],J.value]),ve[0]){case 0:case 1:J=ve;break;case 4:return De.label++,{value:ve[1],done:!1};case 5:De.label++,V=ve[1],ve=[0];continue;case 7:ve=De.ops.pop(),De.trys.pop();continue;default:if(!(J=De.trys,(J=J.length>0&&J[J.length-1])||ve[0]!==6&&ve[0]!==2)){De=0;continue}if(ve[0]===3&&(!J||ve[1]>J[0]&&ve[1]<J[3])){De.label=ve[1];break}if(ve[0]===6&&De.label<J[1]){De.label=J[1],J=ve;break}if(J&&De.label<J[2]){De.label=J[2],De.ops.push(ve);break}J[2]&&De.ops.pop(),De.trys.pop();continue}ve=b.call(G,De)}catch(Gt){ve=[6,Gt],V=0}finally{L=J=0}if(5&ve[0])throw ve[1];return{value:ve[0]?ve[1]:void 0,done:!0}}([Ot,Ft])}}}function xe(){for(var G=0,b=0,L=arguments.length;b<L;b++)G+=arguments[b].length;var V=Array(G),J=0;for(b=0;b<L;b++)for(var Q=arguments[b],De=0,ot=Q.length;De<ot;De++,J++)V[J]=Q[De];return V}var he=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(b,L){for(var V=0,J=L;V<J.length;V++){var Q=J[V],De=Q[0],ot=Q[1];b.setAttribute(De,ot)}},G.createRect=function(b,L,V){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",b.toString()),J.setAttribute("height",L.toString()),V&&G.setAttributes(J,V),J},G.createLine=function(b,L,V,J,Q){var De=document.createElementNS("http://www.w3.org/2000/svg","line");return De.setAttribute("x1",b.toString()),De.setAttribute("y1",L.toString()),De.setAttribute("x2",V.toString()),De.setAttribute("y2",J.toString()),Q&&G.setAttributes(De,Q),De},G.createPolygon=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",b),L&&G.setAttributes(V,L),V},G.createCircle=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(b/2).toString()),V.setAttribute("cy",(b/2).toString()),V.setAttribute("r",b.toString()),L&&G.setAttributes(V,L),V},G.createEllipse=function(b,L,V){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(b/2).toString()),J.setAttribute("cy",(L/2).toString()),J.setAttribute("rx",(b/2).toString()),J.setAttribute("ry",(L/2).toString()),V&&G.setAttributes(J,V),J},G.createGroup=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return b&&G.setAttributes(L,b),L},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(b,L,V,J,Q,De,ot){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Ot,[["id",b],["orient",L],["markerWidth",V.toString()],["markerHeight",J.toString()],["refX",Q.toString()],["refY",De.toString()]]),Ot.appendChild(ot),Ot},G.createText=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),b&&G.setAttributes(L,b),L},G.createTSpan=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=b,L&&G.setAttributes(V,L),V},G.createImage=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return b&&G.setAttributes(L,b),L},G.createPoint=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=b,V.y=L,V},G.createPath=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",b),L&&G.setAttributes(V,L),V},G}(),te=function(){function G(){}return G.addKey=function(b){G.key=b},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),ye=function(){function G(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return G.prototype.rasterize=function(b,L,V){var J=this;return new Promise(function(Q){var De=V!==void 0?V:document.createElement("canvas");b===null&&(J.markersOnly=!0,J.naturalSize=!1);var ot=document.createElementNS("http://www.w3.org/2000/svg","svg");ot.setAttribute("xmlns","http://www.w3.org/2000/svg"),ot.setAttribute("width",L.width.baseVal.valueAsString),ot.setAttribute("height",L.height.baseVal.valueAsString),ot.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),ot.innerHTML=L.innerHTML,J.naturalSize===!0?(ot.width.baseVal.value=b.naturalWidth,ot.height.baseVal.value=b.naturalHeight):J.width!==void 0&&J.height!==void 0&&(ot.width.baseVal.value=J.width,ot.height.baseVal.value=J.height),De.width=ot.width.baseVal.value,De.height=ot.height.baseVal.value;var Ot=ot.outerHTML,Ft=De.getContext("2d");J.markersOnly!==!0&&Ft.drawImage(b,0,0,De.width,De.height);var ve=window.URL,Gt=new Image(De.width,De.height);Gt.setAttribute("crossOrigin","anonymous");var en=new Blob([Ot],{type:"image/svg+xml"}),Tn=ve.createObjectURL(en);Gt.onload=function(){Ft.drawImage(Gt,0,0),ve.revokeObjectURL(Tn);var Wn=De.toDataURL(J.imageType,J.imageQuality);Q(Wn)},Gt.src=Tn})},G}(),ue=function(){},Le=function(){function G(b){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+b+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(b){return this.styleSheet===void 0&&this.addStyleSheet(),b.name=""+this.classNamePrefix+b.localName,this.classes.push(b),this.styleSheet.sheet.insertRule("."+b.name+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length),b},G.prototype.addRule=function(b){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(b),this.styleSheet.sheet.insertRule(b.selector+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var b;this.styleSheet=document.createElement("style"),((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).appendChild(this.styleSheet),this.addRule(new ae("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ae("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ae("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new oe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new oe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var b;this.styleSheet&&(((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),ae=function(G,b){this.selector=G,this.style=b},oe=function(G,b){this.localName=G,this.style=b},Se=function(){function G(b,L,V,J,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=b,this.displayMode=L,this.markerItems=V,this.uiStyleSettings=J,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return G.prototype.show=function(b){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=b,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Q){var De=document.createElement("div");De.className=""+L.toolbarButtonStyleClass.name,De.setAttribute("data-type-name",Q.typeName),De.innerHTML=Q.icon,De.addEventListener("click",function(){L.markerToolbarButtonClicked(De,Q)}),L.buttons.push(De),L.markerButtons.push(De)}),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 J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'<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(J,'<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()},G.prototype.addButtonClickListener=function(b){this.buttonClickListeners.push(b)},G.prototype.removeButtonClickListener=function(b){this.buttonClickListeners.indexOf(b)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(b),1)},G.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},G.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var b=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<b||L===b&&this.markerButtons.length-1===b?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===b&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},G.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")},G.prototype.resetButtonStyles=function(){var b=this;this.buttons.forEach(function(L){L.className=L.className.replace(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:b.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name)})},G.prototype.addActionButton=function(b,L,V){var J=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=L,Q.setAttribute("data-action",V),Q.addEventListener("click",function(){J.actionToolbarButtonClicked(Q,V)}),V){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}b.appendChild(Q),this.buttons.push(Q)},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new oe("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 oe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new oe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new oe("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 oe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var b=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new oe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*b)+`px;
padding: `+b+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ae("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ae("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},G.prototype.markerToolbarButtonClicked=function(b,L){this.setActiveButton(b),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},G.prototype.actionToolbarButtonClicked=function(b,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},G.prototype.setActiveButton=function(b){this.resetButtonStyles(),b.className=b.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),b.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},G.prototype.setActiveMarkerButton=function(b){var L=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===b});L&&this.setActiveButton(L)},G.prototype.setCurrentMarker=function(b){var L=this;this.currentMarker=b,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){L.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},G}(),Me=function(){function G(b,L,V,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=b,this.displayMode=L,this.uiStyleSettings=V,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return G.prototype.addStyles=function(){var b;this.toolboxStyleClass=this.styles.addClass(new oe("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 oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new oe("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 oe("toolbox-panel-row_colors",`
background-color: `+((b=this.uiStyleSettings.toolboxBackgroundColor)!==null&&b!==void 0?b:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ae("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ae("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},G.prototype.show=function(b){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=b,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},G.prototype.setPanelButtons=function(b){var L,V,J=this;this.panels=b,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var De;Q.uiStyleSettings=J.uiStyleSettings;var ot=document.createElement("div");ot.className=J.toolboxButtonStyleClass.name+" "+((De=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:J.toolboxButtonStyleColorsClass.name),ot.innerHTML=Q.icon,ot.title=Q.title,ot.addEventListener("click",function(){J.panelButtonClick(Q)}),J.panelButtons.push(ot),J.buttonRow.appendChild(ot)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},G.prototype.panelButtonClick=function(b){var L=this,V=-1;if(b!==this.activePanel){V=this.panels.indexOf(b),this.panelRow.innerHTML="";var J=b.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=b}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,De){var ot,Ot;Q.className=L.toolboxButtonStyleClass.name+" "+(De===V?""+((ot=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ot!==void 0?ot:L.toolboxActiveButtonStyleColorsClass.name):""+((Ot=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:L.toolboxButtonStyleColorsClass.name))})},G}(),We=function(G,b){this.title=G,this.icon=b},Ke=function(G){function b(L,V,J,Q){var De=G.call(this,L,Q||'<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 De.colors=[],De.addTransparent=!1,De.colorBoxes=[],De.colors=V,De.currentColor=J,De.setCurrentColor=De.setCurrentColor.bind(De),De.getColorBox=De.getColorBox.bind(De),De}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(J){var Q=L.getColorBox(J);V.appendChild(Q),L.colorBoxes.push(Q)}),V},b.prototype.getColorBox=function(L){var V=this,J=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-J,De=document.createElement("div");De.style.display="inline-block",De.style.boxSizing="content-box",De.style.width=Q-2+"px",De.style.height=Q-2+"px",De.style.padding="1px",De.style.marginRight="2px",De.style.marginBottom="2px",De.style.borderWidth="2px",De.style.borderStyle="solid",De.style.borderRadius=(Q+2)/2+"px",De.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",De.addEventListener("click",function(){V.setCurrentColor(L,De)});var ot=document.createElement("div");return ot.style.display="inline-block",ot.style.width=Q-2+"px",ot.style.height=Q-2+"px",ot.style.backgroundColor=L,ot.style.borderRadius=Q/2+"px",L==="transparent"&&(ot.style.fill=this.uiStyleSettings.toolboxAccentColor,ot.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>`),De.appendChild(ot),De},b.prototype.setCurrentColor=function(L,V){var J=this;this.currentColor=L,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},b}(We),Qe=function(){function G(b,L,V){this._state="new",this._isSelected=!1,this._container=b,this._overlayContainer=L,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(G.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),G.prototype.ownsTarget=function(b){return!1},Object.defineProperty(G.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),G.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},G.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},G.prototype.pointerDown=function(b,L){},G.prototype.dblClick=function(b,L){},G.prototype.manipulate=function(b){},G.prototype.pointerUp=function(b){this.stateChanged()},G.prototype.dispose=function(){},G.prototype.addMarkerVisualToContainer=function(b){this.container.childNodes.length>0?this.container.insertBefore(b,this.container.childNodes[0]):this.container.appendChild(b)},G.prototype.getState=function(){return{typeName:G.typeName,state:this.state,notes:this.notes}},G.prototype.restoreState=function(b){this._state=b.state,this.notes=b.notes},G.prototype.scale=function(b,L){},G.prototype.colorChanged=function(b){this.onColorChanged&&this.onColorChanged(b),this.stateChanged()},G.prototype.fillColorChanged=function(b){this.onFillColorChanged&&this.onFillColorChanged(b),this.stateChanged()},G.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var b=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),b.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(b)&&this.onStateChanged(this)}},G.typeName="MarkerBase",G}(),Ze=function(){function G(){this.findGripByVisual=this.findGripByVisual.bind(this)}return G.prototype.findGripByVisual=function(b){return this.topLeft.ownsTarget(b)?this.topLeft:this.topCenter.ownsTarget(b)?this.topCenter:this.topRight.ownsTarget(b)?this.topRight:this.centerLeft.ownsTarget(b)?this.centerLeft:this.centerRight.ownsTarget(b)?this.centerRight:this.bottomLeft.ownsTarget(b)?this.bottomLeft:this.bottomCenter.ownsTarget(b)?this.bottomCenter:this.bottomRight.ownsTarget(b)?this.bottomRight:void 0},G}(),yt=function(){function G(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(b){return b===this.visual||b===this.visual.childNodes[0]||b===this.visual.childNodes[1]},G}(),vt=function(){function G(){}return G.toITransformMatrix=function(b){return{a:b.a,b:b.b,c:b.c,d:b.d,e:b.e,f:b.f}},G.toSVGMatrix=function(b,L){return b.a=L.a,b.b=L.b,b.c=L.c,b.d=L.d,b.e=L.e,b.f=L.f,b},G}(),dt=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(he.createTransform()),Q.setupControlBox(),Q}return Ue(b,G),Object.defineProperty(b.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var V=he.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(L){return!!G.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(L);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var De=this.container.transform.baseVal.getItem(0);De.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(De,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},b.prototype.pointerUp=function(L){var V=this.state;G.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},b.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},b.prototype.manipulate=function(L){var V=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(L)},b.prototype.resize=function(L){var V=this.manipulationStartLeft,J=this.manipulationStartWidth,Q=this.manipulationStartTop,De=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+L.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+L.y-this.manipulationStartY,De=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:De=this.manipulationStartHeight+L.y-this.manipulationStartY}J>=0?(this.left=V,this.width=J):(this.left=V+J,this.width=-J),De>=0?(this.top=Q,this.height=De):(this.top=Q+De,this.height=-De),this.setSize()},b.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},b.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var V=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},b.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},b.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM(),J=he.createPoint(L.x,L.y);return{x:(J=J.matrixTransform(V)).x,y:J.y}},b.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM();V=V.inverse();var J=he.createPoint(L.x,L.y);return{x:(J=J.matrixTransform(V)).x,y:J.y}},b.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var L=he.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=he.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=he.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 Ze,this.addControlGrips(),this.controlBox.style.display="none"},b.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,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()},b.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()},b.prototype.createGrip=function(){var L=new yt;return L.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(L.visual),L},b.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,V=-L/2,J=V,Q=(this.width+this.CB_DISTANCE)/2-L/2,De=(this.height+this.CB_DISTANCE)/2-L/2,ot=this.height+this.CB_DISTANCE-L/2,Ot=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,V,J),this.positionGrip(this.controlGrips.topCenter.visual,Q,J),this.positionGrip(this.controlGrips.topRight.visual,Ot,J),this.positionGrip(this.controlGrips.centerLeft.visual,V,De),this.positionGrip(this.controlGrips.centerRight.visual,Ot,De),this.positionGrip(this.controlGrips.bottomLeft.visual,V,ot),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,ot),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,ot),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,J-3*this.CB_DISTANCE)},b.prototype.positionGrip=function(L,V,J){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,J),L.transform.baseVal.replaceItem(Q,0)},b.prototype.hideControlBox=function(){this.controlBox.style.display="none"},b.prototype.showControlBox=function(){this.controlBox.style.display=""},b.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},G.prototype.getState.call(this))},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L);var V=L;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V);var J=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:J.x*L,y:J.y*V});this.left=Q.x,this.top=Q.y,this.width=this.width*L,this.height=this.height*V,this.adjustControlBox()},b}(Qe),pt=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.visual)},b.prototype.createVisual=function(){this.visual=he.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)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},b.prototype.manipulate=function(L){G.prototype.manipulate.call(this,L)},b.prototype.resize=function(L){G.prototype.resize.call(this,L),this.setSize()},b.prototype.setSize=function(){G.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(L){G.prototype.pointerUp.call(this,L),this.setSize()},b.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},b.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},b.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},b.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this))},b.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),G.prototype.restoreState.call(this,L),this.setSize()},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.setSize()},b.title="Rectangle marker",b}(dt),At=function(G){function b(L,V,J,Q){var De=G.call(this,L,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return De.widths=[],De.widthBoxes=[],De.widths=V,De.currentWidth=J,De.setCurrentWidth=De.setCurrentWidth.bind(De),De}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(J){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=J===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentWidth(J,Q)}),V.appendChild(Q);var De=document.createElement("div");De.innerText=J.toString(),De.style.marginRight="5px",Q.appendChild(De);var ot=document.createElement("div");ot.style.minHeight="20px",ot.style.flexGrow="2",ot.style.display="flex",ot.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=J+"px solid "+L.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",ot.appendChild(Ot),Q.appendChild(ot),L.widthBoxes.push(Q)}),V},b.prototype.setCurrentWidth=function(L,V){var J=this;this.currentWidth=L,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},b}(We),wt=function(G){function b(L,V,J,Q){var De=G.call(this,L,Q||'<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 De.styles=[],De.styleBoxes=[],De.styles=V,De.currentStyle=J,De.setCurrentStyle=De.setCurrentStyle.bind(De),De}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(J){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.styles.length-5+"%",Q.style.borderColor=J===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentStyle(J,Q)}),V.appendChild(Q);var De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.overflow="hidden";var ot=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(J!==""?'stroke-dasharray="'+J+'"':"")+` />
</svg>`;De.innerHTML=ot,Q.appendChild(De),L.styleBoxes.push(Q)}),V},b.prototype.setCurrentStyle=function(L,V){var J=this;this.currentStyle=L,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},b}(We),Oe=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.strokeColor=J.defaultColor,Q.strokeWidth=J.defaultStrokeWidth,Q.strokeDasharray=J.defaultStrokeDasharray,Q.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new At("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new wt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ue(b,G),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=G.prototype.getState.call(this);return L.typeName=b.typeName,L},b.typeName="FrameMarker",b.title="Frame marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',b}(pt),we=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},Je=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!!G.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},b.prototype.pointerUp=function(L){var V=this.state;G.prototype.pointerUp.call(this,L),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(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},b.prototype.adjustVisual=function(){},b.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},b.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},b.prototype.select=function(){G.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){G.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},b.prototype.adjustControlBox=function(){this.positionGrips()},b.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},b.prototype.createGrip=function(){var L=new yt;return L.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(L.visual),L},b.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},b.prototype.positionGrip=function(L,V,J){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,J),L.transform.baseVal.replaceItem(Q,0)},b.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},G.prototype.getState.call(this))},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L);var V=L;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.x1=this.x1*L,this.y1=this.y1*V,this.x2=this.x2*L,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},b}(Qe),st=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=J.defaultColor,Q.strokeWidth=J.defaultStrokeWidth,Q.strokeDasharray=J.defaultStrokeDasharray,Q.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new At("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new wt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},b.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},b.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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},b.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},b.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},b.typeName="LineMarker",b.title="Line marker",b.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',b}(Je),He=function(G){function b(L,V,J,Q){var De=G.call(this,L,Q||'<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 De.fonts=[],De.fontBoxes=[],De.fonts=V,De.currentFont=J,De.setCurrentFont=De.setCurrentFont.bind(De),De}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(J){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.fonts.length-5+"%",Q.style.borderColor=J===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentFont(J,Q)}),V.appendChild(Q);var De=document.createElement("div");De.style.display="flex",De.style.minHeight="20px",De.style.flexGrow="2",De.style.fontFamily=J,De.style.overflow="hidden";var ot=document.createElement("div");ot.style.whiteSpace="nowrap",ot.style.overflow="hidden",ot.style.textOverflow="ellipsis",ot.innerHTML="The quick brown fox jumps over the lazy dog",De.appendChild(ot),Q.appendChild(De),L.fontBoxes.push(Q)}),V},b.prototype.setCurrentFont=function(L,V){var J=this;this.currentFont=L,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},b}(We),nt=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=J.defaultColor,Q.fontFamily=J.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new Ke("Color",J.defaultColorSet,J.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new He("Font",J.defaultFontFamilies,J.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){if(G.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(J){J===L&&(V=!0)}),V},b.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},b.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(V){L.textElement.appendChild(he.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},b.prototype.getTextScale=function(){var L=this.textElement.getBBox(),V=1;if(L.width>0&&L.height>0){var J=(1*this.width-this.width*this.padding*2/100)/L.width,Q=(1*this.height-this.height*this.padding*2/100)/L.height;V=Math.min(J,Q)}return V},b.prototype.getTextPosition=function(L){var V=this.textElement.getBBox(),J=0,Q=0;return V.width>0&&V.height>0&&(J=(this.width-V.width*L)/2,Q=this.height/2-V.height*L/2),{x:J,y:Q}},b.prototype.sizeText=function(){var L=this.textElement.getBBox(),V=this.getTextScale(),J=this.getTextPosition(V);J.y-=L.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},b.prototype.manipulate=function(L){G.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},b.prototype.resize=function(L){G.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},b.prototype.setSize=function(){G.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},b.prototype.pointerUp=function(L){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),G.prototype.pointerUp.call(this,L),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},b.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&V>.9;)V-=.1,L.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var J=V.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(J)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},b.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),Q={x:J.width*L,y:J.height*L};V.x-=Q.x/2,V.y-=Q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},b.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},b.prototype.select=function(){G.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},b.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),G.prototype.deselect.call(this)},b.prototype.dblClick=function(L,V){G.prototype.dblClick.call(this,L,V),this.showTextEditor()},b.prototype.setColor=function(L){this.textElement&&he.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},b.prototype.setFont=function(L){this.textElement&&he.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},b.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},b.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){var V=L;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),G.prototype.restoreState.call(this,L),this.setSize()},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.setSize(),this.sizeText(),this.positionTextEditor()},b.typeName="TextMarker",b.title="Text marker",b.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>',b}(dt),Te=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=J.defaultColor,Q.lineWidth=J.defaultStrokeWidth,Q.pixelRatio=J.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new Ke("Color",J.defaultColorSet,J.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new At("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},b.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var L=he.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},b.prototype.pointerDown=function(L,V){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):G.prototype.pointerDown.call(this,L,V)},b.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):G.prototype.manipulate.call(this,L)},b.prototype.resize=function(L){G.prototype.resize.call(this,L),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):G.prototype.pointerUp.call(this,L)},b.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)},b.prototype.select=function(){this.state==="creating"&&this.finishCreation(),G.prototype.select.call(this)},b.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),G.prototype.deselect.call(this)},b.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=V[0],Q=V[1],De=V[2],ot=V[3],Ot=!1,Ft=0;Ft<this.canvasElement.height;Ft++)for(var ve=0;ve<this.canvasElement.width;ve++)L.data[Ft*this.canvasElement.width*4+4*ve+3]>0&&(Ot=!0,Ft<Q&&(Q=Ft),ve<J&&(J=ve),Ft>ot&&(ot=Ft),ve>De&&(De=ve));if(Ot){this.left=J/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(De-J)/this.pixelRatio,this.height=(ot-Q)/this.pixelRatio;var Gt=document.createElement("canvas");Gt.width=De-J,Gt.height=ot-Q,Gt.getContext("2d").putImageData(this.canvasContext.getImageData(J,Q,De-J,ot-Q),0,0),this.drawingImgUrl=Gt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},b.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},b.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},b.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){this.createVisual(),G.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.setDrawingImage()},b.typeName="FreehandMarker",b.title="Freehand marker",b.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>',b}(dt),ge=function(G){function b(L,V,J){var Q=G.call(this,L,J||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=V,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var J=function(ot){var Ot="both";switch(ot){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var Ft=document.createElement("div");if(Ft.style.display="flex",Ft.style.flexGrow="2",Ft.style.alignItems="center",Ft.style.justifyContent="space-between",Ft.style.padding="5px",Ft.style.borderWidth="2px",Ft.style.borderStyle="solid",Ft.style.borderColor=Ot===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Ft.addEventListener("click",function(){L.setCurrentType(Ot,Ft)}),V.appendChild(Ft),Ot==="both"||Ot==="start"){var ve=document.createElement("div");ve.style.display="flex",ve.style.alignItems="center",ve.style.minHeight="20px",ve.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ve.style.marginLeft="5px",Ft.appendChild(ve)}var Gt=document.createElement("div");Gt.style.display="flex",Gt.style.alignItems="center",Gt.style.minHeight="20px",Gt.style.flexGrow="2";var en=document.createElement("hr");if(en.style.minWidth="20px",en.style.border="0px",en.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),en.style.flexGrow="2",Gt.appendChild(en),Ft.appendChild(Gt),Ot==="both"||Ot==="end"){var Tn=document.createElement("div");Tn.style.display="flex",Tn.style.alignItems="center",Tn.style.minHeight="20px",Tn.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Tn.style.marginRight="5px",Ft.appendChild(Tn)}Q.typeBoxes.push(Ft)},Q=this,De=0;De<4;De++)J(De);return V},b.prototype.setCurrentType=function(L,V){var J=this;this.currentType=L,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},b}(We),be=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new ge("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},b.prototype.getArrowPoints=function(L,V){var J=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return L-J/2+","+(V+Q/2)+" "+L+","+(V-Q/2)+" "+(L+J/2)+","+(V+Q/2)},b.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(G.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",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},b.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L);var V=L;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},b.typeName="ArrowMarker",b.title="Arrow marker",b.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',b}(st),re=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.fillColor=J.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new Ke("Color",J.defaultColorSet,J.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Ue(b,G),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=G.prototype.getState.call(this);return L.typeName=b.typeName,L},b.typeName="CoverMarker",b.title="Cover marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',b}(pt),ie=function(G){function b(L,V,J,Q){var De=G.call(this,L,Q||'<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 De.opacities=[],De.opacityBoxes=[],De.opacities=V,De.currentOpacity=J,De.setCurrentOpacity=De.setCurrentOpacity.bind(De),De}return Ue(b,G),b.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(J){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=J===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentOpacity(J,Q)}),V.appendChild(Q);var De=document.createElement("div");De.innerText=100*J+"%",Q.appendChild(De),L.opacityBoxes.push(Q)}),V},b.prototype.setCurrentOpacity=function(L,V){var J=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},b}(We),ce=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=J.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=J.defaultHighlightOpacity,Q.fillPanel=new Ke("Color",J.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ue(b,G),b.prototype.setOpacity=function(L){this.opacity=L,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=G.prototype.getState.call(this);return L.typeName=b.typeName,L},b.typeName="HighlightMarker",b.title="Highlight marker",b.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>',b}(re),Ee='<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>',Be=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=J.defaultStrokeColor,Q.bgColor=J.defaultFillColor,Q.fontFamily=J.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new Ke("Text color",J.defaultColorSet,Q.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>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new Ke("Fill color",J.defaultColorSet,Q.bgColor,Ee),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new He("Font",J.defaultFontFamilies,J.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new yt,Q.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return G.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},b.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},b.prototype.pointerDown=function(L,V){this.state==="new"&&G.prototype.pointerDown.call(this,L,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):G.prototype.pointerDown.call(this,L,V)},b.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,G.prototype.pointerUp.call(this,L);else{var V=this.state==="creating";G.prototype.pointerUp.call(this,L),this.setTipPoints(V),this.positionTip()}},b.prototype.manipulate=function(L){if(this.tipMoving){var V=this.unrotatePoint(L);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else G.prototype.manipulate.call(this,L)},b.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",L]]),he.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},b.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},b.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var V=Math.min(this.height/2,15),J=this.height/5;L&&(this.tipPosition={x:V+J/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(J=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+J,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(J=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-J,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(J=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-J,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-J},this.tipBase2Position={x:this.width,y:this.height-V}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(J=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+J,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-J})},b.prototype.resize=function(L){G.prototype.resize.call(this,L),this.positionTip()},b.prototype.positionTip=function(){he.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),b.prototype.select=function(){this.positionTip(),G.prototype.select.call(this)},b.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){var V=L;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,G.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*V},this.positionTip()},b.typeName="CalloutMarker",b.title="Callout marker",b.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>',b}(nt),Ie=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=J.defaultColor,Q.strokeWidth=J.defaultStrokeWidth,Q.strokeDasharray=J.defaultStrokeDasharray,Q.fillColor=J.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new Ke("Line color",xe(J.defaultColorSet,["transparent"]),J.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new Ke("Fill color",xe(J.defaultColorSet,["transparent"]),Q.fillColor,Ee),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new At("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new wt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.visual)},b.prototype.createVisual=function(){this.visual=he.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)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},b.prototype.manipulate=function(L){G.prototype.manipulate.call(this,L)},b.prototype.resize=function(L){G.prototype.resize.call(this,L),this.setSize()},b.prototype.setSize=function(){G.prototype.setSize.call(this),he.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},b.prototype.pointerUp=function(L){G.prototype.pointerUp.call(this,L),this.setSize()},b.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},b.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},b.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},b.prototype.setOpacity=function(L){this.opacity=L,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),G.prototype.restoreState.call(this,L),this.setSize()},b.prototype.scale=function(L,V){G.prototype.scale.call(this,L,V),this.setSize()},b.typeName="EllipseMarker",b.title="Ellipse marker",b.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>',b}(dt),ut=function(G){function b(L,V,J){return G.call(this,L,V,J)||this}return Ue(b,G),Object.defineProperty(b.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},b.prototype.createTips=function(){this.tip1=he.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(he.createTransform()),this.visual.appendChild(this.tip1),this.tip2=he.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(he.createTransform()),this.visual.appendChild(this.tip2)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(G.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(he.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()]]),he.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 L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=G.prototype.getState.call(this);return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},b.typeName="MeasurementMarker",b.title="Measurement marker",b.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>',b}(st),bt=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.strokePanel.colors=J.defaultColorSet,Q.fillColor="transparent",Q}return Ue(b,G),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=G.prototype.getState.call(this);return L.typeName=b.typeName,L},b.typeName="EllipseFrameMarker",b.title="Ellipse frame marker",b.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>',b}(Ie),Tt=function(){function G(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),G.prototype.addUndoStep=function(b){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(b)||(this.undoStack.push(b),JSON.stringify(this.lastRedoStep)!==JSON.stringify(b)&&this.redoStack.splice(0,this.redoStack.length))},G.prototype.replaceLastUndoStep=function(b){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=b)},G.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},G.prototype.undo=function(){if(this.undoStack.length>1){var b=this.undoStack.pop();return b!==void 0&&this.redoStack.push(b),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},G.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},G}(),xt=function(G){function b(L,V,J){var Q=G.call(this,L,V,J)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=J.defaultColor,Q.strokeWidth=J.defaultStrokeWidth,Q.strokeDasharray=J.defaultStrokeDasharray,Q.strokePanel=new Ke("Line color",J.defaultColorSet,J.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new At("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new wt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ue(b,G),b.prototype.ownsTarget=function(L){return!(!G.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},b.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},b.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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)},b.prototype.pointerDown=function(L,V){G.prototype.pointerDown.call(this,L,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},b.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setupControlBox=function(){G.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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)},b.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,G.prototype.addControlGrips.call(this)},b.prototype.positionGrips=function(){G.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/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()))},b.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),G.prototype.manipulate.call(this,L)},b.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),G.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},b.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},b.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},b.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},b.prototype.scale=function(L,V){this.curveX=this.curveX*L,this.curveY=this.curveY*V,G.prototype.scale.call(this,L,V)},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},G.prototype.getState.call(this));return L.typeName=b.typeName,L},b.prototype.restoreState=function(L){G.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},b.typeName="CurveMarker",b.title="Curve marker",b.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>',b}(Je),gt=function(){function G(b,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=b,this.cancelable=L}return Object.defineProperty(G.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),G.prototype.preventDefault=function(){this._defaultPrevented=!0},G}(),qe=function(G){function b(L,V,J){var Q=G.call(this,L,!1)||this;return Q.dataUrl=V,Q.state=J,Q}return Ue(b,G),b}(gt),Xe=function(G){function b(L,V,J){J===void 0&&(J=!1);var Q=G.call(this,L,J)||this;return Q.marker=V,Q}return Ue(b,G),b}(gt),Pe=function(){function G(){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 G.prototype.addEventListener=function(b,L){this[b].push(L)},G.prototype.removeEventListener=function(b,L){var V=this[b].indexOf(L);V>-1&&this[b].splice(V,1)},G}(),se=function(){function G(b){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new we,this._isOpen=!1,this.undoRedoManager=new Tt,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 Pe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=G.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=b,this.targetRoot=document.body,this.width=b.clientWidth,this.height=b.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(G.prototype,"ALL_MARKER_TYPES",{get:function(){return[Oe,Te,be,nt,bt,Ie,ce,Be,ut,re,st,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Oe,Te,be,nt,Ie,ce,Be]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Oe,Te,be,nt,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(b){var L=this;this._availableMarkerTypes.splice(0),b.forEach(function(V){if(typeof V=="string"){var J=L.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===V});J!==void 0&&L._availableMarkerTypes.push(J)}else L._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(b){this._zoomLevel=b,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),G.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},G.prototype.show=function(){var b=this;this.styles.styleSheetRoot===void 0&&ue.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ue.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new gt(b))})},G.prototype.render=function(){return _e(this,void 0,void 0,function(){var b;return je(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(b=new ye).naturalSize=this.renderAtNaturalSize,b.imageType=this.renderImageType,b.imageQuality=this.renderImageQuality,b.markersOnly=this.renderMarkersOnly,b.width=this.renderWidth,b.height=this.renderHeight,[4,b.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,b.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},G.prototype.close=function(b){var L=this;if(b===void 0&&(b=!1),this.isOpen){var V=!1;b||this.eventListeners.beforeclose.forEach(function(J){var Q=new gt(L,!0);J(Q),Q.defaultPrevented&&(V=!0)}),V||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(J){return J(new gt(L))}),this.detachEvents(),this._isOpen=!1)}},G.prototype.addMarkersToToolbar=function(){for(var b,L=[],V=0;V<arguments.length;V++)L[V]=arguments[V];(b=this._availableMarkerTypes).push.apply(b,L)},G.prototype.addRenderEventListener=function(b){this.addEventListener("render",function(L){b(L.dataUrl,L.state)})},G.prototype.removeRenderEventListener=function(b){},G.prototype.addCloseEventListener=function(b){this.addEventListener("close",function(){b()})},G.prototype.removeCloseEventListener=function(b){},G.prototype.setupResizeObserver=function(){var b=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){b.resize(b.target.clientWidth,b.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return b.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},G.prototype.onPopupTargetResize=function(){var b=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/b>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*b:this.editorCanvas.clientWidth,V=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/b;this.resize(L,V)},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.prototype.resize=function(b,L){this._isResizing=!0;var V=b/this.imageWidth,J=L/this.imageHeight;this.imageWidth=Math.round(b),this.imageHeight=Math.round(L),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(V,J),this._isResizing=!1},G.prototype.scaleMarkers=function(b,L){var V,J=this;this._currentMarker&&this._currentMarker instanceof nt?this._currentMarker.scale(b,L):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==J._currentMarker&&Q.scale(b,L)}),V!==void 0&&this.setCurrentMarker(V)},G.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"},G.prototype.setTopLeft=function(){var b=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=b.left-L.left,this.top=b.top-L.top},G.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)},G.prototype.addDefs=function(){for(var b,L=[],V=0;V<arguments.length;V++)L[V]=arguments[V];this.defs=he.createDefs(),this.addDefsToImage(),(b=this.defs).append.apply(b,L)},G.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},G.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)},G.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},G.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},G.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)},G.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},G.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)},G.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 b=document.createElement("a");b.href="https://markerjs.com/",b.target="_blank",b.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>',b.title="Powered by marker.js",b.style.display="grid",b.style.alignItems="center",b.style.justifyItems="center",b.style.padding="3px",b.style.width="20px",b.style.height="20px",this.logoUI.appendChild(b),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},G.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")},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 b=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=b+"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 Se(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 Me(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},G.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.removeMarker=function(b){this.markerImage.removeChild(b.container),this.markers.indexOf(b)>-1&&this.markers.splice(this.markers.indexOf(b),1),b.dispose()},G.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())},G.prototype.toolbarButtonClicked=function(b,L){if(b==="marker"&&L!==void 0)this.createNewMarker(L);else if(b==="action")switch(L){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()}},G.prototype.deleteSelectedMarker=function(){var b=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var Q=new Xe(b,b._currentMarker,!0);J(Q),Q.defaultPrevented&&(L=!0)}),!L){var V=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(J){return J(new Xe(b,V))})}}},G.prototype.clear=function(){var b=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(De){var ot=new Xe(b,void 0,!0);De(ot),ot.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var V=function(De){var ot=J.markers[De];J.setCurrentMarker(J.markers[De]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(Ot){return Ot(new Xe(b,ot))})},J=this,Q=this.markers.length-1;Q>=0;Q--)V(Q);this.addUndoStep()}},Object.defineProperty(G.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),G.prototype.showNotesEditor=function(){var b;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=(b=this._currentMarker.notes)!==null&&b!==void 0?b:"",this.overlayContainer.appendChild(this.notesArea))},G.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)},G.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},G.prototype.addUndoStep=function(){var b=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===L.width&&V.height===L.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),J<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new gt(b))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function(Q){return Q(new gt(b))})}},G.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},G.prototype.undoStep=function(){var b=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new gt(b))}))},G.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},G.prototype.redoStep=function(){var b=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new gt(b))}))},G.prototype.stepZoom=function(){var b=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=b<this.zoomSteps.length-1?this.zoomSteps[b+1]:this.zoomSteps[0]},G.prototype.panTo=function(b){this.contentDiv.scrollBy({left:this.prevPanPoint.x-b.x,top:this.prevPanPoint.y-b.y}),this.prevPanPoint=b},G.prototype.startRenderAndClose=function(){return _e(this,void 0,void 0,function(){var b,L,V=this;return je(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return b=J.sent(),L=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new qe(V,b,L))}),this.close(!0),[2]}})})},G.prototype.getState=function(b){b===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return L.markers.push(V.getState())}),L},G.prototype.restoreState=function(b){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);b.markers.forEach(function(V){var J=L._availableMarkerTypes.find(function(De){return De.typeName===V.typeName});if(J!==void 0){var Q=L.addNewMarker(J);Q.restoreState(V),L.markers.push(Q)}}),b.width&&b.height&&(b.width!==this.imageWidth||b.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/b.width,this.imageHeight/b.height),this.eventListeners.restorestate.forEach(function(V){return V(new gt(L))})},G.prototype.addNewMarker=function(b){var L=he.createGroup();return this.markerImage.appendChild(L),new b(L,this.overlayContainer,this.settings)},G.prototype.createNewMarker=function(b){var L,V=this;(L=typeof b=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===b}):b)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),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(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(J){return J(new Xe(V,V._currentMarker))}))},G.prototype.markerCreated=function(b){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(b),this.setCurrentMarker(b),b instanceof Te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new Xe(L,L._currentMarker))})},G.prototype.colorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=b,this.settings.defaultStrokeColor=b)},G.prototype.fillColorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=b)},G.prototype.markerStateChanged=function(b){var L=this;this.eventListeners.markerchange.forEach(function(V){return V(new Xe(L,b))})},G.prototype.setCurrentMarker=function(b){var L=this;this._currentMarker!==b&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new Xe(L,L._currentMarker))})),this._currentMarker=b,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(V){return V(new Xe(L,L._currentMarker))}))},G.prototype.onPointerDown=function(b){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||b.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(V){return V.ownsTarget(b.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(b.clientX,b.clientY),b.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:b.clientX,y:b.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(b.clientX,b.clientY))},G.prototype.onDblClick=function(b){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(V){return V.ownsTarget(b.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(b.clientX,b.clientY),b.target):this.setCurrentMarker()}},G.prototype.onPointerMove=function(b){this.touchPoints!==1&&b.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||b.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(b.clientX,b.clientY)):this.zoomLevel>1&&this.panTo({x:b.clientX,y:b.clientY}))},G.prototype.onPointerUp=function(b){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(b.clientX,b.clientY)),this.isDragging=!1,this.addUndoStep()},G.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},G.prototype.onKeyUp=function(b){this._currentMarker===void 0||this.notesArea!==void 0||b.key!=="Delete"&&b.key!=="Backspace"||this.deleteSelectedMarker()},G.prototype.clientToLocalCoordinates=function(b,L){var V=this.markerImage.getBoundingClientRect();return{x:(b-V.left)/this.zoomLevel,y:(L-V.top)/this.zoomLevel}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var b=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=b+"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()},G.prototype.addLicenseKey=function(b){te.addKey(b)},G.prototype.addEventListener=function(b,L){this.eventListeners.addEventListener(b,L)},G.prototype.removeEventListener=function(b,L){this.eventListeners.removeEventListener(b,L)},G.prototype.renderState=function(b){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(b),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(G.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),G.prototype.focus=function(){var b=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new gt(b))}))},G.prototype.blur=function(){var b=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new gt(b))}))},G.instanceCounter=0,G}();/* **********************************
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 fe=function(G,b){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var J in V)Object.prototype.hasOwnProperty.call(V,J)&&(L[J]=V[J])})(G,b)};function $e(G,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function L(){this.constructor=G}fe(G,b),G.prototype=b===null?Object.create(b):(L.prototype=b.prototype,new L)}function ke(G,b,L,V){return new(L||(L=Promise))(function(J,Q){function De(Ft){try{Ot(V.next(Ft))}catch(ve){Q(ve)}}function ot(Ft){try{Ot(V.throw(Ft))}catch(ve){Q(ve)}}function Ot(Ft){var ve;Ft.done?J(Ft.value):(ve=Ft.value,ve instanceof L?ve:new L(function(Gt){Gt(ve)})).then(De,ot)}Ot((V=V.apply(G,b||[])).next())})}function it(G,b){var L,V,J,Q,De={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return Q={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ot(Ot){return function(Ft){return function(ve){if(L)throw new TypeError("Generator is already executing.");for(;De;)try{if(L=1,V&&(J=2&ve[0]?V.return:ve[0]?V.throw||((J=V.return)&&J.call(V),0):V.next)&&!(J=J.call(V,ve[1])).done)return J;switch(V=0,J&&(ve=[2&ve[0],J.value]),ve[0]){case 0:case 1:J=ve;break;case 4:return De.label++,{value:ve[1],done:!1};case 5:De.label++,V=ve[1],ve=[0];continue;case 7:ve=De.ops.pop(),De.trys.pop();continue;default:if(!(J=De.trys,(J=J.length>0&&J[J.length-1])||ve[0]!==6&&ve[0]!==2)){De=0;continue}if(ve[0]===3&&(!J||ve[1]>J[0]&&ve[1]<J[3])){De.label=ve[1];break}if(ve[0]===6&&De.label<J[1]){De.label=J[1],J=ve;break}if(J&&De.label<J[2]){De.label=J[2],De.ops.push(ve);break}J[2]&&De.ops.pop(),De.trys.pop();continue}ve=b.call(G,De)}catch(Gt){ve=[6,Gt],V=0}finally{L=J=0}if(5&ve[0])throw ve[1];return{value:ve[0]?ve[1]:void 0,done:!0}}([Ot,Ft])}}}var at=function(){function G(){}return G.addKey=function(b){G.key=b},Object.defineProperty(G,"isLicensed",{get:function(){return!!G.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(G.key)},enumerable:!1,configurable:!0}),G}(),Ne=function(){function G(){}return G.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},G.setAttributes=function(b,L){for(var V=0,J=L;V<J.length;V++){var Q=J[V],De=Q[0],ot=Q[1];b.setAttribute(De,ot)}},G.createRect=function(b,L,V){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",b.toString()),J.setAttribute("height",L.toString()),V&&G.setAttributes(J,V),J},G.createLine=function(b,L,V,J,Q){var De=document.createElementNS("http://www.w3.org/2000/svg","line");return De.setAttribute("x1",b.toString()),De.setAttribute("y1",L.toString()),De.setAttribute("x2",V.toString()),De.setAttribute("y2",J.toString()),Q&&G.setAttributes(De,Q),De},G.createPolygon=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",b),L&&G.setAttributes(V,L),V},G.createCircle=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(b/2).toString()),V.setAttribute("cy",(b/2).toString()),V.setAttribute("r",b.toString()),L&&G.setAttributes(V,L),V},G.createEllipse=function(b,L,V){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(b/2).toString()),J.setAttribute("cy",(L/2).toString()),J.setAttribute("rx",(b/2).toString()),J.setAttribute("ry",(L/2).toString()),V&&G.setAttributes(J,V),J},G.createGroup=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return b&&G.setAttributes(L,b),L},G.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},G.createMarker=function(b,L,V,J,Q,De,ot){var Ot=document.createElementNS("http://www.w3.org/2000/svg","marker");return G.setAttributes(Ot,[["id",b],["orient",L],["markerWidth",V.toString()],["markerHeight",J.toString()],["refX",Q.toString()],["refY",De.toString()]]),Ot.appendChild(ot),Ot},G.createText=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),b&&G.setAttributes(L,b),L},G.createTSpan=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=b,L&&G.setAttributes(V,L),V},G.createImage=function(b){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return b&&G.setAttributes(L,b),L},G.createPoint=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=b,V.y=L,V},G.createPath=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",b),L&&G.setAttributes(V,L),V},G.createElement=function(b,L){var V=document.createElementNS("http://www.w3.org/2000/svg",b);return L&&G.setAttributes(V,L),V},G.getHollowRectanglePath=function(b,L,V,J,Q,De,ot,Ot){return"M"+b+","+L+"V"+(L+J)+"H"+(b+V)+"V"+L+"H"+Q+"V"+De+"H"+(Q+ot)+"V"+(De+Ot)+"H"+Q+"V"+L+"Z"},G}(),Ve=function(){function G(b){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+b+"_"}return Object.defineProperty(G.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(G.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(G.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),G.prototype.addClass=function(b){return this.styleSheet===void 0&&this.addStyleSheet(),b.name=""+this.classNamePrefix+b.localName,this.classes.push(b),this.styleSheet.sheet.insertRule("."+b.name+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length),b},G.prototype.addRule=function(b){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(b),this.styleSheet.sheet.insertRule(b.selector+" {"+b.style+"}",this.styleSheet.sheet.cssRules.length)},G.prototype.addStyleSheet=function(){var b;this.styleSheet=document.createElement("style"),((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).appendChild(this.styleSheet),this.addRule(new tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ft("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ft("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},G.prototype.removeStyleSheet=function(){var b;this.styleSheet&&(((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},G}(),tt=function(G,b){this.selector=G,this.style=b},ft=function(G,b){this.localName=G,this.style=b},Ct=function(){function G(){this.blocks=[],this.display=""}return G.prototype.addButtonBlock=function(b){b.className=this.blockClassName,b.buttonClassName=this.buttonClassName,b.buttonColorsClassName=this.buttonColorsClassName,b.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(b)},G.prototype.addElementBlock=function(b){b.className===void 0&&(b.className=this.blockClassName),this.blocks.push(b)},G.prototype.getUI=function(){var b=document.createElement("div");return b.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,b.style.display=this.display,this.blocks.forEach(function(L){return b.appendChild(L.getUI())}),b},G}(),zt=function(){function G(){}return G.prototype.getUI=function(){var b=document.createElement("div");if(b.className=this.className,this.minWidth!==void 0&&(b.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":b.style.justifyContent="flex-start";break;case"center":b.style.justifyContent="center";break;case"end":b.style.justifyContent="flex-end"}return b.style.whiteSpace="nowrap",b},G}(),qt=function(G){function b(){var L=G!==null&&G.apply(this,arguments)||this;return L.buttons=[],L}return $e(b,G),b.prototype.addButton=function(L){L.className=this.buttonClassName,L.colorsClassName=this.buttonColorsClassName,L.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(L)},b.prototype.getUI=function(){var L=G.prototype.getUI.call(this);return this.buttons.forEach(function(V){return L.appendChild(V.getUI())}),L},b}(zt),Qt=function(){function G(b,L){this._isActive=!1,this._isHidden=!1,this._icon=b,this.title=L,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(G.prototype,"icon",{get:function(){return this._icon},set:function(b){this._icon=b,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isActive",{get:function(){return this._isActive},set:function(b){this._isActive=b,this.adjustClassName()},enumerable:!1,configurable:!0}),G.prototype.getUI=function(){var b=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 b.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},G.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,"")))},G.prototype.hide=function(){this._isHidden=!0},G}(),St=function(G){function b(){var L=G!==null&&G.apply(this,arguments)||this;return L.elements=[],L}return $e(b,G),b.prototype.addElement=function(L){this.elements.push(L)},b.prototype.getUI=function(){var L=G.prototype.getUI.call(this);return this.elements.forEach(function(V){return L.appendChild(V)}),L},b}(zt),ln=function(){function G(b,L){this.horizontal=b,this.vertical=L}return Object.defineProperty(G.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),G.prototype.getVerticalLength=function(b){return b/this.ratio},G.prototype.getHorizontalLength=function(b){return b*this.ratio},G}(),Bt=function(){function G(){}return G.getIcon=function(b,L){if(b>0&&L>0){var V=new ln(b,L),J=V.ratio>=1?20:V.getHorizontalLength(20),Q=V.ratio<1?20:V.getVerticalLength(20),De=document.createElementNS("http://www.w3.org/2000/svg","svg");De.setAttribute("xmlns","http://www.w3.org/2000/svg"),De.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(De);var ot=Ne.createDefs();De.appendChild(ot);var Ot=Ne.createElement("clipPath",[["id","text-bg-clip"]]);ot.appendChild(Ot);var Ft=Ne.createPath(Ne.getHollowRectanglePath((24-J)/2,(24-Q)/2,J,Q,(24-J)/2+2,(24-Q)/2+2,J-4,Q-4));De.appendChild(Ft);var ve=Ne.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ve.appendChild(Ne.createTSpan(b+":"+L)),De.appendChild(ve);var Gt=ve.getBBox();Ne.setAttributes(ve,[["x",((24-Gt.width)/2).toString()],["y",((24-Gt.height)/2-Gt.y).toString()]]);var en=Ne.createPath(Ne.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 Ot.appendChild(en),Ne.setAttributes(Ft,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(De),De.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>'},G}(),Yt=function(G){function b(L,V,J){var Q=G.call(this,L,V)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=J,Q}return $e(b,G),b.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=L.className,V.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},b.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},b.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},b.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},b.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},b.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},b}(Qt),Mt=function(){function G(b,L){this.GRIP_SIZE=10,this.color=b,this.fillColor=L,this.visual=Ne.createGroup(),this.visual.appendChild(Ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ne.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return G.prototype.ownsTarget=function(b){return b===this.visual||b===this.visual.childNodes[0]||b===this.visual.childNodes[1]},G.prototype.setCenter=function(b,L){this.visual.childNodes.forEach(function(V){return Ne.setAttributes(V,[["cx",b.toString()],["cy",L.toString()]])})},G}(),tn=function(){function G(b,L,V,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=b,this.canvasHeight=L,this.margin=V,this.container=J,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(G.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(b){this._aspectRatio=b,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(b){this._isGridVisible=b,this.gridContainer&&Ne.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(b){this._zoomFactor=b,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),G.prototype.open=function(){var b=this;this.cropShadeElement=Ne.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ne.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;L<this.numberOfGridLines;L++)this.horizontalGridLines.push(Ne.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ne.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return b.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return b.gridContainer.appendChild(V)}),this.cropRectElement=Ne.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},G.prototype.setCropRectangle=function(b){this.cropRect=b;var L=Object.assign({},this.cropRect);this.zoomFactor!==1&&(L.width=this.cropRect.width*this.zoomFactor,L.height=this.cropRect.height*this.zoomFactor,L.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-L.width/2,L.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),Ne.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var V=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,De){var ot=L.y+V*(De+1);Ne.setAttributes(Q,[["x1",""+L.x],["y1",""+ot],["x2",""+(L.x+L.width)],["y2",""+ot]])});var J=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,De){var ot=L.x+J*(De+1);Ne.setAttributes(Q,[["x1",""+ot],["y1",""+L.y],["x2",""+ot],["y2",""+(L.y+L.height)]])}),Ne.setAttributes(this.cropShadeElement,[["d",Ne.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},G.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)},G.prototype.clientToLocalCoordinates=function(b,L){var V=this.container.getBoundingClientRect();return{x:b-V.left+this.margin,y:L-V.top+this.margin}},G.prototype.onPointerDown=function(b){this.container.setPointerCapture(b.pointerId),this.previousPoint=this.clientToLocalCoordinates(b.clientX,b.clientY),this.cropRectElement===b.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(b.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(b.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(b.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(b.target)&&(this.activeGrip=this.bottomRightGrip)},G.prototype.onPointerMove=function(b){if(this.isMoving)this.move(this.clientToLocalCoordinates(b.clientX,b.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(b.clientX,b.clientY);this.resize(L)}b.preventDefault()},G.prototype.onPointerUp=function(b){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(b.pointerId)},G.prototype.move=function(b){var L=b.x-this.previousPoint.x,V=b.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=b},G.prototype.resize=function(b){var L=Object.assign({},this.cropRect),V=b.x-this.previousPoint.x,J=b.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+V<this.margin&&(V=this.margin-L.x),L.x+=V,L.width=this.cropRect.x+this.cropRect.width-L.x;break;case this.bottomRightGrip:case this.topRightGrip:L.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-L.width),L.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=J,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=J}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=b,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},G.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var b=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<J/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=J,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=b-this.cropRect.width/2,this.cropRect.y=L-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)}},G.prototype.getRescaledRect=function(b,L,V,J,Q,De){var ot=V/b,Ot=J/L;return{x:(Q.x-De)*ot+De,y:(Q.y-De)*Ot+De,width:Q.width*ot,height:Q.height*Ot}},G.prototype.scaleCanvas=function(b,L){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,b,L,this.cropRect,this.margin);this.canvasWidth=b,this.canvasHeight=L,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},G}(),mn=function(){function G(b){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=b,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(G.prototype,"angle",{get:function(){return this._angle},set:function(b){this._angle=b,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),G.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},G.prototype.onPointerDown=function(b){this.controlContainer.setPointerCapture(b.pointerId),this.isDragging=!0,this.previousPoint={x:b.clientX,y:b.clientY}},G.prototype.onPointerMove=function(b){this.isDragging&&(this.onAngleChange&&this.onAngleChange((b.clientX-this.previousPoint.x)/5),this.previousPoint.x=b.clientX)},G.prototype.onPointerUp=function(b){this.isDragging&&this.onAngleChange&&this.onAngleChange((b.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(b.pointerId)},G.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var b=this.angleLabelText.getBBox();Ne.setAttributes(this.angleLabelElement,[["x",((this.width-b.width)/2).toString()],["y",(this.height/2).toString()]])}},G.prototype.positionScaleShape=function(){if(this.scaleShape){var b=this.scaleShape.transform.baseVal.getItem(0);b.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(b,0)}},G.prototype.getVisual=function(){var b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("xmlns","http://www.w3.org/2000/svg"),b.setAttribute("width",this.width+"px"),b.setAttribute("height",this.height+"px"),b.setAttribute("viewBox","0 0 "+this.width+" "+this.height),b.style.flexShrink="0",document.body.appendChild(b);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var J=V%5==0?this.height/3:this.height/6;L+="h4v"+-J+"h1v"+J}L+="v1H0Z",this.scaleShape=Ne.createPath(L);var Q=Ne.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),b.appendChild(this.scaleShape),this.angleLabelElement=Ne.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ne.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var De=Ne.createTSpan("");return De.innerHTML="&deg;",this.angleLabelElement.appendChild(De),b.appendChild(this.angleLabelElement),document.body.removeChild(b),b},G}(),An=function(){function G(){this.naturalSize=!1,this.imageType="image/png"}return G.prototype.rasterize=function(b,L,V,J,Q,De,ot){var Ot=this;return new Promise(function(Ft){var ve=document.createElement("canvas");ve.width=b.width.baseVal.value-2*J,ve.height=b.height.baseVal.value-2*J;var Gt=1,en=1;Ot.naturalSize===!0?(Gt=L.naturalWidth/(b.width.baseVal.value-2*J)/De,en=L.naturalHeight/(b.height.baseVal.value-2*J)/ot,ve.width=L.naturalWidth/De,ve.height=L.naturalHeight/ot):Ot.width!==void 0&&Ot.height!==void 0&&(Gt=Ot.width/V.width,en=Ot.height/V.height,ve.width*=Gt,ve.height*=en);var Tn=ve.getContext("2d");Tn.translate(ve.width/2,ve.height/2),Tn.rotate(Q*Math.PI/180),Tn.scale(De,ot),Tn.translate(-ve.width/2,-ve.height/2),Tn.drawImage(L,0,0,ve.width,ve.height);var Wn=document.createElement("canvas");Wn.width=V.width*Gt,Wn.height=V.height*en,Wn.getContext("2d").putImageData(Tn.getImageData((V.x-J)*Gt,(V.y-J)*en,V.width*Gt,V.height*en),0,0),Ft(Wn.toDataURL(Ot.imageType,Ot.imageQuality))})},G}(),lt=function(){function G(b){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=G.instanceCounter++,this.styles=new Ve(this.instanceNo),this.target=b,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(G.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(b){this._zoomToCropEnabled=b,b?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(b){this._isGridVisible=b,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"gridLines",{get:function(){return this._gridLines},set:function(b){this._gridLines=b,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(b){this._rotationAngle=b,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"aspectRatio",{get:function(){var b;return(b=this._aspectRatio)!==null&&b!==void 0?b:this.aspectRatios[0]},set:function(b){this._aspectRatio=b},enumerable:!1,configurable:!0}),G.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},G.prototype.show=function(){this.showUI(),this.open()},G.prototype.close=function(b){b===void 0&&(b=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),b||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},G.prototype.addRenderEventListener=function(b){this.renderEventListeners.push(b)},G.prototype.removeRenderEventListener=function(b){this.renderEventListeners.indexOf(b)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(b),1)},G.prototype.addCloseEventListener=function(b){this.closeEventListeners.push(b)},G.prototype.removeCloseEventListener=function(b){this.closeEventListeners.indexOf(b)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(b),1)},G.prototype.setupResizeObserver=function(){var b=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){b.resize(b.target.clientWidth,b.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))},G.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var b=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/b>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*b:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=L+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/b;this.resize(L,V)}},G.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},G.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",Ne.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},G.prototype.resize=function(b,L){this.imageWidth=Math.round(b),this.imageHeight=Math.round(L),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()},G.prototype.setEditingTarget=function(){var b=document.createElement("canvas");b.width=this.target.naturalWidth,b.height=this.target.naturalHeight,b.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var L=b.toDataURL();Ne.setAttributes(this.editingTarget,[["href",L]]),this.setEditingTargetSize()},G.prototype.setTopLeft=function(){var b=this.target.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=b.left-L.left-this.CANVAS_MARGIN,this.top=b.top-L.top-this.CANVAS_MARGIN},G.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=Ne.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ne.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ne.createGroup(),this.editingTargetRotationScaleContainer=Ne.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var b=Ne.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(b);var L=Ne.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(L),this.editingTargetContainer=Ne.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)},G.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},G.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ne.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new tn(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()},G.prototype.zoomToCrop=function(){if(this.cropRect){var b=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,L=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=b+"px "+L+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-b+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-L+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},G.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)},G.prototype.cropRectChanged=function(b){this.cropRect=b,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},G.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},G.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"},G.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},G.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 b=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,L=this.target.offsetTop>b+this.CANVAS_MARGIN?this.target.offsetTop-(b+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"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},G.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},G.prototype.addTopToolbar=function(){var b=this;this.topToolbar=new Ct,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 L=new qt;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var V=[];this.aspectRatios.forEach(function(en){var Tn=new Qt(Bt.getIcon(en.horizontal,en.vertical),en.horizontal===0&&en.vertical===0?"FREE":en.horizontal+":"+en.vertical);Tn.onClick=function(){return b.ratioButtonClicked(en)},V.push(Tn)}),this.aspectRatioButton=new Yt(Bt.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new Qt('<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");J.isActive=this.isGridVisible,J.onClick=function(){b.isGridVisible=!b.isGridVisible,J.isActive=b.isGridVisible},L.addButton(J);var Q=new Qt('<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(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){b.zoomToCropEnabled=!b.zoomToCropEnabled,Q.isActive=b.zoomToCropEnabled},L.addButton(Q),!at.isLicensed){var De=new St;this.topToolbar.addElementBlock(De);var ot=document.createElement("div");ot.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.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>',ot.appendChild(Ot),De.addElement(ot)}var Ft=new qt;Ft.minWidth=3*this.toolbarHeight+"px",Ft.contentAlign="end",this.topToolbar.addButtonBlock(Ft);var ve=new Qt('<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");ve.onClick=this.startRenderAndClose,Ft.addButton(ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gt=new Qt('<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,Ft.addButton(Gt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},G.prototype.addBottomToolbar=function(){var b=this;this.bottomToolbar=new Ct,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 L=new qt;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var V=new Qt('<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");V.onClick=this.rotateLeftButtonClicked,L.addButton(V);var J=new Qt('<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");J.onClick=this.rotateRightButtonClicked,L.addButton(J);var Q=new St;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new mn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Ft){b.rotateBy(Ft),b.straightener.angle=b.rotationAngle},Q.addElement(this.straightener.getUI());var De=new qt;De.minWidth=2*this.toolbarHeight+"px",De.contentAlign="end",this.bottomToolbar.addButtonBlock(De);var ot=new Qt('<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");ot.onClick=this.flipHorizontallyButtonClicked,De.addButton(ot);var Ot=new Qt('<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");Ot.onClick=this.flipVerticallyButtonClicked,De.addButton(Ot)},G.prototype.ratioButtonClicked=function(b){this.aspectRatio=b,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},G.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Bt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},G.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ln(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},G.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},G.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},G.prototype.restoreState=function(b){if(b){var L=this.cropLayer.getRescaledRect(b.width,b.height,this.imageWidth,this.imageHeight,b.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=b.flippedHorizontally,this.flippedVertically=b.flippedVertically,this.applyFlip(),this.rotationAngle=b.rotationAngle,this.applyRotation()}},G.prototype.clientToLocalCoordinates=function(b,L){var V=this.cropImage.getBoundingClientRect();return{x:b-V.left,y:L-V.top}},G.prototype.onWindowResize=function(){this.positionUI()},G.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var b=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=b+"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()},G.prototype.rotateLeftButtonClicked=function(){var b=this.rotationAngle-90;this.rotationAngle%90!=0&&(b+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(b)},G.prototype.rotateRightButtonClicked=function(){var b=this.rotationAngle+90;this.rotationAngle%90!=0&&(b-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(b)},G.prototype.rotateTo=function(b){b=(b=b>180?b-360:b)<=-180?b+360:b,this.rotationAngle=b,this.applyRotation()},G.prototype.rotateBy=function(b){this.rotateTo((this.rotationAngle+b)%360)},G.prototype.applyRotation=function(){var b=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=b},G.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},G.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},G.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},G.prototype.startRenderAndClose=function(){return ke(this,void 0,void 0,function(){var b,L;return it(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return b=V.sent(),L=this.getState(),this.renderEventListeners.forEach(function(J){return J(b,L)}),this.close(!0),[2]}})})},G.prototype.render=function(){return ke(this,void 0,void 0,function(){var b;return it(this,function(L){switch(L.label){case 0:return(b=new An).naturalSize=this.renderAtNaturalSize,b.imageType=this.renderImageType,b.imageQuality=this.renderImageQuality,b.width=this.renderWidth,b.height=this.renderHeight,this.unzoomFromCrop(),Ne.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,b.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 L.sent(),[4,b.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,L.sent()]}})})},G.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ft("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 ft("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ft("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var b=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ft("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*b)+`px;
height: `+(this.toolbarHeight-2*b)+`px;
padding: `+b+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ft("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 ft("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ft("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 ft("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*b)+`px;
padding: `+b+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ft("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},G.instanceCounter=0,G}(),Rt=N("8hTe"),Jt=N.n(Rt),nn=/<pre[^>]*>/g;function un(G){var b=document.createElement("div");return b.innerHTML=G,b.childNodes.length===0?"":b.childNodes[0].nodeValue}var cn=de.a=function(G){var b=G.value,L=b===void 0?"":b,V=G.edit,J=V===void 0?!1:V,Q=G.className,De=G.showTextOnly,ot=G.showLines,Ot=G.replaces,Ft=G.zoomImg,ve=G.hasMask,Gt=G.style,en=Gt===void 0?{}:Gt,Tn=G.stylesPrev,Wn=Tn===void 0?{}:Tn,tr=String(L),Rn=Object(R.useRef)(),or=Object(R.useRef)(),fr=Object(R.useState)(""),Vn=Object(j.a)(fr,2),sr=Vn[0],Jn=Vn[1],Mr=Object(R.useState)("office"),Xn=Object(j.a)(Mr,2),Ir=Xn[0],yr=Xn[1],Tr=function(){var hn=new lt(or.current);hn.displayMode="popup",hn.addRenderEventListener(function(){var kn=Object(M.a)(_.a.mark(function yn(Ln){var bn;return _.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Rn.current.style.display="none",Bn.next=3,Object(Ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ln}});case 3:bn=Bn.sent,bn!=null&&bn.id&&Ot(or.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(bn==null?void 0:bn.id,"?type=").concat(bn.content_type));case 5:case"end":return Bn.stop()}},yn)}));return function(yn){return kn.apply(this,arguments)}}()),hn.show()},Yr=function(){var hn=new se(or.current);hn.settings.displayMode="popup",hn.addEventListener("render",function(){var kn=Object(M.a)(_.a.mark(function yn(Ln){var bn;return _.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:if(Rn.current.style.display="none",!or.current){Bn.next=6;break}return Bn.next=4,Object(Ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ln.dataUrl}});case 4:bn=Bn.sent,bn!=null&&bn.id&&Ot(or.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(bn==null?void 0:bn.id,"?type=").concat(bn.content_type));case 6:case"end":return Bn.stop()}},yn)}));return function(yn){return kn.apply(this,arguments)}}()),hn.show(),window.markerArea=hn},br=Object(R.useMemo)(function(){try{var Sn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,hn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,kn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;tr=tr.replace(Sn,"("+le.a.API_SERVER+"/api/attachments/").replace(hn,'"'+le.a.API_SERVER+"/api/attachments/").replace(kn,'"'+le.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,`
`),tr=tr.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(wr){}var yn=Y(tr),Ln=D();if(tr.match(/\[TOC\]/)&&(yn=yn.replace("<p>[TOC]</p>",O()),x()),yn=yn.replace(/(__special_katext_id_\d+__)/g,function(wr,Bn){var Qn=Ln[Bn],zr=Qn.type,jr=Qn.expression;return Object(pe.renderToString)(un(jr)||"",{displayMode:zr==="block",throwOnError:!1,output:"html"})}),yn=yn.replace(/▁/g,"\u2581\u2581\u2581"),T(),De){var bn=document.createElement("div");return bn.innerHTML=yn,bn.innerText}return setTimeout(function(){return _r()},500),yn},[tr]),nr=Object(R.useRef)();E.WebkitLineClamp=ot,ot&&(en=Object(B.a)(Object(B.a)({},en),E));function Ur(Sn){var hn=Sn.target;if(hn.tagName.toUpperCase()==="IMG"){if(Ft){var kn=hn.getAttribute("src");Jn(kn),yr("image")}}else if(hn.tagName.toUpperCase()==="A"){var yn=hn.getAttribute("href");if(yn.indexOf("office")>-1)Sn.preventDefault(),Jn(yn),yr("office");else if(yn.indexOf("application/pdf")>-1)Sn.preventDefault(),Jn(yn),yr("pdf");else if(yn.indexOf("type=text")>-1)Sn.preventDefault(),Jn(yn),yr("html");else if(yn.startsWith("#")){Sn.preventDefault();var Ln=document.getElementById(yn.replace("#",""));Ln&&Ln.scrollIntoView(!0)}}}var _r=function(){var hn,kn=(hn=nr.current)===null||hn===void 0?void 0:hn.querySelectorAll("video");kn==null||kn.forEach(function(yn){if(yn.oncontextmenu=function(){return!1},yn.src.indexOf(".m3u8")>-1&&!yn.canPlayType("application/vnd.apple.mpegurl")){if(q.a.isSupported()){var Ln=new q.a;Ln.loadSource(yn.src),Ln.attachMedia(yn)}}})};Object(R.useEffect)(function(){if(nr.current&&br&&(br.match(nn)&&window.PR.prettyPrint()),nr.current)return nr.current.addEventListener("click",Ur),function(){nr.current.removeEventListener("click",Ur),T(),x()}},[br,nr.current,Ur]);var Fr=function(hn){if(!J)return;hn.target.nodeName==="IMG"?(Rn.current.style.display="flex",Rn.current.style.width=hn.target.clientWidth+"px",Rn.current.style.height=hn.target.clientHeight+"px",Rn.current.style.top=hn.target.offsetTop+"px",Rn.current.style.left=hn.target.offsetLeft+"px",or.current.src=hn.target.getAttribute("src")):Rn.current.style.display="none"};return c.a.createElement("div",{style:{position:"relative"}},c.a.createElement("div",{ref:nr,style:Object(B.a)({},en),className:"".concat(Q||""," markdown-body ").concat(Jt.a.mdBody),onMouseOver:Fr,dangerouslySetInnerHTML:{__html:br}}),c.a.createElement("div",{ref:Rn,className:Jt.a.button},c.a.createElement(K.a,null,c.a.createElement(z.a,{onClick:function(){return Tr()}},"\u88C1\u526A"),c.a.createElement(z.a,{onClick:function(){return Yr()}},"\u7F16\u8F91"))),c.a.createElement("img",{ref:or,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),c.a.createElement(Ae.a,{close:!0,data:sr,hasMask:ve,type:sr!=null&&sr.length?Ir:"",style:Object(B.a)({},Wn),onClose:function(){return Jn("")}}))}},"9GDu":function(et,de,N){et.exports={flex_box_center:"flex_box_center___2Dduc",flex_space_between:"flex_space_between___2Le2r",flex_box_vertical_center:"flex_box_vertical_center___2KZsK",flex_box_center_end:"flex_box_center_end___1aosz",flex_box_column:"flex_box_column___cFN2D",bg:"bg___ka_0p",title:"title___3M9-E",questionIcons:"questionIcons___VjWTs",green:"green___2q3Jn",orange:"orange___KXt8o",greenTip:"greenTip___1nV5h",redTip:"redTip___3QDm4",orangeTip:"orangeTip___3F21W",pollDesc:"pollDesc___3Jb8Y",answered:"answered___1tbR8",unanswer:"unanswer___2Jts9",anchor:"anchor___3_nBp",answerFlag:"answerFlag___32KcB",flagActive:"flagActive___3ac8b",flagHalf:"flagHalf___1AvT6",answerStudentFlag:"answerStudentFlag___UbvlB",answerStudentActive:"answerStudentActive___27het",questionItem:"questionItem___3nBk4",itemType:"itemType___3NNh-",itemFlag:"itemFlag___2fz1F",answerWrap:"answerWrap___23vJg",answerSubjective:"answerSubjective___1i3N-",otherInput:"otherInput___gQ5U6",submitButton:"submitButton___RAvWu",randomFlag:"randomFlag___1J_UJ",answerTrue:"answerTrue___1cUgp",answerFalse:"answerFalse___Q16xV",answerHalf:"answerHalf___2I-fp",renderHtml:"renderHtml___1O15z",simpleText:"simpleText___1-h1E",answerYes:"answerYes___3w-7A",answerNo:"answerNo___2TuuH",answerInfo:"answerInfo___3KPDJ",answerSheet:"answerSheet___1UuGf",active:"active___2njWQ",countDown:"countDown___ViVY-",red:"red___RmODq",fold:"fold___ZVRBm",cardList:"cardList___1KJD0",iframe:"iframe___8V6GW"}},"9VGf":function(et,de,N){"use strict";N.d(de,"a",function(){return P});var ee=N("q1tI"),K=N.n(ee);function P(z,B){var M=Object(ee.useRef)();Object(ee.useEffect)(function(){M.current=z}),Object(ee.useEffect)(function(){function j(){M.current()}if(B!==null){var U=setInterval(j,B);return function(){return clearInterval(U)}}},[B])}},"A/g1":function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoI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"},BU3w:function(et,de,N){"use strict";N.d(de,"a",function(){return M});var ee=N("MNnm"),K="rc-util-key";function P(j){if(j.attachTo)return j.attachTo;var U=document.querySelector("head");return U||document.body}function z(j){var U,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var R=document.createElement("style");if((U=_.csp)===null||U===void 0?void 0:U.nonce){var c;R.nonce=(c=_.csp)===null||c===void 0?void 0:c.nonce}R.innerHTML=j;var g=P(_),w=g.firstChild;return _.prepend&&g.prepend?g.prepend(R):_.prepend&&w?g.insertBefore(R,w):g.appendChild(R),R}var B=new Map;function M(j,U){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(_);if(!B.has(R)){var c=z("",_),g=c.parentNode;B.set(R,g),g.removeChild(c)}var w=Array.from(B.get(R).children).find(function(n){return n.tagName==="STYLE"&&n[K]===U});if(w){var y,f;if(((y=_.csp)===null||y===void 0?void 0:y.nonce)&&w.nonce!==((f=_.csp)===null||f===void 0?void 0:f.nonce)){var m;w.nonce=(m=_.csp)===null||m===void 0?void 0:m.nonce}return w.innerHTML!==j&&(w.innerHTML=j),w}var a=z(j,_);return a[K]=U,a}},Bd2K:function(et,de,N){(function(ee){ee(N("VrN/"),N("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(_,R,c){if(c!=ee.Init&&c&&_.removeKeyMap("autoCloseTags"),!R)return;var g={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(g["'/'"]=function(w){return M(w)}),(typeof R!="object"||R.whenOpening!==!1)&&(g["'>'"]=function(w){return z(w)}),_.addKeyMap(g)});var K=["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 z(_){if(_.getOption("disableInput"))return ee.Pass;for(var R=_.listSelections(),c=[],g=_.getOption("autoCloseTags"),w=0;w<R.length;w++){if(!R[w].empty())return ee.Pass;var y=R[w].head,f=_.getTokenAt(y),m=ee.innerMode(_.getMode(),f.state),a=m.state,n=m.mode.xmlCurrentTag&&m.mode.xmlCurrentTag(a),o=n&&n.name;if(!o)return ee.Pass;var u=m.mode.configuration=="html",x=typeof g=="object"&&g.dontCloseTags||u&&K,E=typeof g=="object"&&g.indentTags||u&&P;f.end>y.ch&&(o=o.slice(0,o.length-f.end+y.ch));var v=o.toLowerCase();if(!o||f.type=="string"&&(f.end!=y.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||f.string.length==1)||f.type=="tag"&&n.close||f.string.indexOf("/")==y.ch-f.start-1||x&&j(x,v)>-1||U(_,m.mode.xmlCurrentContext&&m.mode.xmlCurrentContext(a)||[],o,y,!0))return ee.Pass;var O=typeof g=="object"&&g.emptyTags;if(O&&j(O,o)>-1){c[w]={text:"/>",newPos:ee.Pos(y.line,y.ch+2)};continue}var A=E&&j(E,v)>-1;c[w]={indent:A,text:">"+(A?`
`:"")+"</"+o+">",newPos:A?ee.Pos(y.line+1,0):ee.Pos(y.line,y.ch+1)}}for(var p=typeof g=="object"&&g.dontIndentOnAutoClose,w=R.length-1;w>=0;w--){var h=c[w];_.replaceRange(h.text,R[w].head,R[w].anchor,"+insert");var s=_.listSelections().slice(0);s[w]={head:h.newPos,anchor:h.newPos},_.setSelections(s),!p&&h.indent&&(_.indentLine(h.newPos.line,null,!0),_.indentLine(h.newPos.line+1,null,!0))}}function B(_,R){for(var c=_.listSelections(),g=[],w=R?"/":"</",y=_.getOption("autoCloseTags"),f=typeof y=="object"&&y.dontIndentOnSlash,m=0;m<c.length;m++){if(!c[m].empty())return ee.Pass;var a=c[m].head,n=_.getTokenAt(a),o=ee.innerMode(_.getMode(),n.state),u=o.state;if(R&&(n.type=="string"||n.string.charAt(0)!="<"||n.start!=a.ch-1))return ee.Pass;var x,E=o.mode.name!="xml"&&_.getMode().name=="htmlmixed";if(E&&o.mode.name=="javascript")x=w+"script";else if(E&&o.mode.name=="css")x=w+"style";else{var v=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(u);if(!v||v.length&&U(_,v,v[v.length-1],a))return ee.Pass;x=w+v[v.length-1]}_.getLine(a.line).charAt(n.end)!=">"&&(x+=">"),g[m]=x}if(_.replaceSelections(g),c=_.listSelections(),!f)for(var m=0;m<c.length;m++)(m==c.length-1||c[m].head.line<c[m+1].head.line)&&_.indentLine(c[m].head.line)}function M(_){return _.getOption("disableInput")?ee.Pass:B(_,!0)}ee.commands.closeTag=function(_){return B(_)};function j(_,R){if(_.indexOf)return _.indexOf(R);for(var c=0,g=_.length;c<g;++c)if(_[c]==R)return c;return-1}function U(_,R,c,g,w){if(!ee.scanForClosingTag)return!1;var y=Math.min(_.lastLine()+1,g.line+500),f=ee.scanForClosingTag(_,g,null,y);if(!f||f.tag!=c)return!1;for(var m=w?1:0,a=R.length-1;a>=0&&R[a]==c;a--)++m;g=f.to;for(var a=1;a<m;a++){var n=ee.scanForClosingTag(_,g,null,y);if(!n||n.tag!=c)return!1;g=n.to}return!0}})},BjJ7:function(et,de,N){"use strict";N.d(de,"d",function(){return K}),N.d(de,"c",function(){return P}),N.d(de,"e",function(){return z}),N.d(de,"b",function(){return B}),N.d(de,"a",function(){return j});var ee=N("m3rI");function K(U){var _=!0;if(U.length>0){for(var R=0;R<U.length;R++)if(U[R].compile_success==0||!U[R].compile_success){_=!1;break}}else _=!1;return _}function P(U){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",R=[],c=0;c<U.length;c++){var g=U[c],w=_?"".concat(_,"/").concat(g.name):"".concat(g.name);R.push({title:g.name,isLeaf:!(g.type==="tree"),key:w})}return R}function z(U,_,R){for(var c=0;c<U.length;c++){var g=U[c];if(g.key===_){g.children=R;break}g.children&&z(g.children,_,R)}return U}function B(U,_,R){var c;return function(){var g=this,w=arguments,y=function(){c=null,R||U.apply(g,w)},f=R&&!c;clearTimeout(c),c=setTimeout(y,_),f&&U.apply(g,w)}}var M=!0,j=ee.a.API_SERVER},BlwA:function(et,de,N){"use strict";var ee=N("9og8"),K=N("miYZ"),P=N("tsqr"),z=N("tJVT"),B=N("WmNS"),M=N.n(B),j=N("q1tI"),U=N.n(j),_=N("Ty5D"),R=N("ErOA"),c=N("m3rI"),g=N("DR4n"),w=N.n(g),y=function(a,n){for(var o=a.split(","),u=o[0].match(/:(.*?);/)[1],x=atob(o[1]),E=x.length,v=new Uint8Array(E);E--;)v[E]=x.charCodeAt(E);return new Blob([v],{type:u})},f=Object(j.forwardRef)(function(m,a){var n=m.time,o=m.number,u=m.supportCamera,x=m.take_photo,E=m.update,v=m.id,O=Object(j.useRef)(),A=Object(j.useRef)(),p=Object(_.i)(),h=Object(j.useState)([]),s=Object(z.a)(h,2),l=s[0],D=s[1],T=Object(j.useState)(0),S=Object(z.a)(T,2),I=S[0],C=S[1],W=Object(j.useState)(""),Y=Object(z.a)(W,2),H=Y[0],F=Y[1],q=Object(j.useState)(),le=Object(z.a)(q,2),pe=le[0],Ae=le[1],Ge=Object(j.useState)(0),Fe=Object(z.a)(Ge,2),Ue=Fe[0],_e=Fe[1];Object(j.useEffect)(function(){return he(),function(){ye(),je()}},[]),Object(j.useEffect)(function(){I===2&&n&&o>0&&(xe(),_e(1))},[n]),Object(j.useEffect)(function(){if(Ue===0)return;if(Ue===2)clearInterval(pe);else{var Le=0,ae=setInterval(function(){l.includes(Le)&&te(),Le++},1e3);Ae(ae)}return function(){return clearInterval(pe)}},[Ue]),Object(j.useImperativeHandle)(a,function(){return{handlePhoto:te}});var je=function(){_e(2)},xe=function(){var ae=n/o,oe=[];function Se(Me,We){return parseInt(Math.floor(Math.random()*(We-Me+1))+Me)}new Array(o).fill(0).map(function(Me,We){x?oe.push(Se(ae*We,ae*(We+1))):We==0?oe.push(0):oe.push(Se(ae*We,ae*(We+1)))}),l=oe,D([].concat(oe)),console.log(oe)},he=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(ae){var oe=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return oe?new Promise(function(Se,Me){oe.call(navigator,ae,Se,Me)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:{width:640,height:480}}).then(function(ae){u&&u(2),C(2),"srcObject"in O.current?O.current.srcObject=ae:O.current.src=window.URL.createObjectURL(ae),O.current.onloadedmetadata=function(oe){O.current.play()},O.current.addEventListener("ended",function(){console.log("\u64AD\u653E\u7ED3\u675F"),je(),P.b.error({content:"\u60A8\u5DF2\u7ECF\u5173\u95ED\u4E86\u6444\u50CF\u5934\uFF0C\u8BF7\u572810\u79D2\u949F\u5185\u6062\u590D\u6444\u50CF\u5934\uFF0C\u5426\u5219\u5C06\u63A8\u51FA\u8003\u8BD5",duration:10,key:9998})},!1)}).catch(function(ae){C(1),u&&u(1),ae.message==="Permission denied"||ae.name==="NotAllowedError"?P.b.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"):P.b.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"),console.log("errname: "+ae.name),console.log("err: "+ae.message)})},te=function(){try{A.current.width=O.current.videoWidth,A.current.height=O.current.videoHeight;var ae=A.current.getContext("2d");ae.drawImage(O.current,0,0,A.current.width,A.current.height),F(A.current.toDataURL("image/png")),ue(A.current.toDataURL("image/png"))}catch(oe){}},ye=function(){try{var ae=O.current.srcObject,oe=ae.getTracks();oe.forEach(function(Se){Se.stop()}),O.current.srcObject=null}catch(Se){}},ue=function(){var Le=Object(ee.a)(M.a.mark(function ae(oe){var Se,Me;return M.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:Se=new FormData,Se.append("file",y(oe,"1")),Se.append("1","123"),Me=new window.XMLHttpRequest,Me.withCredentials=!0,Me.addEventListener("load",function(Qe){var Ze=JSON.parse(Qe.target.responseText);Object(R.a)("/api/exercises/".concat(v,"/upload_photo.json"),{method:"post",body:{attachment_id:Ze.id}})},!1),Me.addEventListener("error",function(Qe){console.error(Qe)},!1),Me.open("POST","".concat(c.a.API_SERVER,"/api/attachments.json")),Me.send(Se);case 9:case"end":return Ke.stop()}},ae)}));return function(oe){return Le.apply(this,arguments)}}();return U.a.createElement(U.a.Fragment,null,I!==3&&U.a.createElement("aside",{className:w.a.video,id:"screenshot"},I===0&&U.a.createElement("span",null,"\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."),I===1&&U.a.createElement("span",null,"\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"),I===2&&U.a.createElement("div",null,U.a.createElement("video",{width:"288",ref:O,autoPlay:!0}),U.a.createElement("canvas",{style:{display:"none"},ref:A}))))});de.a=f},"C+DQ":function(et,de,N){},"C/vA":function(et,de,N){"use strict";N.d(de,"a",function(){return ee});function ee(K){var P=this,z=!1,B;return function(){return z||(z=!0,B=K.apply(P,arguments)),B}}},"Cg/j":function(et,de,N){"use strict";N.d(de,"b",function(){return ee}),N.d(de,"a",function(){return K}),N.d(de,"c",function(){return z}),N.d(de,"d",function(){return B});var ee;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function j(U){return U[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=j})(ee||(ee={}));var K=z("instantiationService");function P(M,j,U,_){j[ee.DI_TARGET]===j?j[ee.DI_DEPENDENCIES].push({id:M,index:U,optional:_}):(j[ee.DI_DEPENDENCIES]=[{id:M,index:U,optional:_}],j[ee.DI_TARGET]=j)}function z(M){if(ee.serviceIds.has(M))return ee.serviceIds.get(M);var j=function(U,_,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");P(j,U,R,!1)};return j.toString=function(){return M},ee.serviceIds.set(M,j),j}function B(M){return function(j,U,_){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(M,j,_,!0)}}},DR4n:function(et,de,N){et.exports={flex_box_center:"flex_box_center___2zmmW",flex_space_between:"flex_space_between___3nCIw",flex_box_vertical_center:"flex_box_vertical_center___1PFij",flex_box_center_end:"flex_box_center_end___2FA05",flex_box_column:"flex_box_column___2k0kx",video:"video___1mYnG"}},DlQD:function(et,de,N){(function(ee,K){et.exports=K()})(this,function(){"use strict";function ee(Te,ge){for(var be=0;be<ge.length;be++){var re=ge[be];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(Te,re.key,re)}}function K(Te,ge,be){return ge&&ee(Te.prototype,ge),be&&ee(Te,be),Te}function P(Te,ge){if(!Te)return;if(typeof Te=="string")return z(Te,ge);var be=Object.prototype.toString.call(Te).slice(8,-1);if(be==="Object"&&Te.constructor&&(be=Te.constructor.name),be==="Map"||be==="Set")return Array.from(Te);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return z(Te,ge)}function z(Te,ge){(ge==null||ge>Te.length)&&(ge=Te.length);for(var be=0,re=new Array(ge);be<ge;be++)re[be]=Te[be];return re}function B(Te,ge){var be;if(typeof Symbol=="undefined"||Te[Symbol.iterator]==null){if(Array.isArray(Te)||(be=P(Te))||ge&&Te&&typeof Te.length=="number"){be&&(Te=be);var re=0;return function(){return re>=Te.length?{done:!0}:{done:!1,value:Te[re++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return be=Te[Symbol.iterator](),be.next.bind(be)}function M(Te,ge){return ge={exports:{}},Te(ge,ge.exports),ge.exports}var j=M(function(Te){function ge(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function be(re){Te.exports.defaults=re}Te.exports={defaults:ge(),getDefaults:ge,changeDefaults:be}}),U=j.defaults,_=j.getDefaults,R=j.changeDefaults,c=/[&<>"']/,g=/[&<>"']/g,w=/[<>"']|&(?!#?\w+;)/,y=/[<>"']|&(?!#?\w+;)/g,f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},m=function(ge){return f[ge]};function a(Te,ge){if(ge){if(c.test(Te))return Te.replace(g,m)}else if(w.test(Te))return Te.replace(y,m);return Te}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Te){return Te.replace(n,function(ge,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var u=/(^|[^\[])\^/g;function x(Te,ge){Te=Te.source||Te,ge=ge||"";var be={replace:function(ie,ce){return ce=ce.source||ce,ce=ce.replace(u,"$1"),Te=Te.replace(ie,ce),be},getRegex:function(){return new RegExp(Te,ge)}};return be}var E=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Te,ge,be){if(Te){var re;try{re=decodeURIComponent(o(be)).replace(E,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}ge&&!v.test(be)&&(be=l(ge,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(ie){return null}return be}var A={},p=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(Te,ge){A[" "+Te]||(p.test(Te)?A[" "+Te]=Te+"/":A[" "+Te]=I(Te,"/",!0)),Te=A[" "+Te];var be=Te.indexOf(":")===-1;return ge.substring(0,2)==="//"?be?ge:Te.replace(h,"$1")+ge:ge.charAt(0)==="/"?be?ge:Te.replace(s,"$1")+ge:Te+ge}var D={exec:function(){}};function T(Te){for(var ge=1,be,re;ge<arguments.length;ge++){be=arguments[ge];for(re in be)Object.prototype.hasOwnProperty.call(be,re)&&(Te[re]=be[re])}return Te}function S(Te,ge){var be=Te.replace(/\|/g,function(ce,Ee,Be){for(var Ie=!1,ut=Ee;--ut>=0&&Be[ut]==="\\";)Ie=!Ie;return Ie?"|":" |"}),re=be.split(/ \|/),ie=0;if(re.length>ge)re.splice(ge);else for(;re.length<ge;)re.push("");for(;ie<re.length;ie++)re[ie]=re[ie].trim().replace(/\\\|/g,"|");return re}function I(Te,ge,be){var re=Te.length;if(re===0)return"";for(var ie=0;ie<re;){var ce=Te.charAt(re-ie-1);if(ce===ge&&!be)ie++;else if(ce!==ge&&be)ie++;else break}return Te.substr(0,re-ie)}function C(Te,ge){if(Te.indexOf(ge[1])===-1)return-1;for(var be=Te.length,re=0,ie=0;ie<be;ie++)if(Te[ie]==="\\")ie++;else if(Te[ie]===ge[0])re++;else if(Te[ie]===ge[1]&&(re--,re<0))return ie;return-1}function W(Te){Te&&Te.sanitize&&!Te.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Y={escape:a,unescape:o,edit:x,cleanUrl:O,resolveUrl:l,noopTest:D,merge:T,splitCells:S,rtrim:I,findClosingBracket:C,checkSanitizeDeprecation:W},H=j.defaults,F=Y.rtrim,q=Y.splitCells,le=Y.escape,pe=Y.findClosingBracket;function Ae(Te,ge,be){var re=ge.href,ie=ge.title?le(ge.title):null,ce=Te[1].replace(/\\([\[\]])/g,"$1");return Te[0].charAt(0)!=="!"?{type:"link",raw:be,href:re,title:ie,text:ce}:{type:"image",raw:be,href:re,title:ie,text:le(ce)}}function Ge(Te,ge){var be=Te.match(/^(\s+)(?:```)/);if(be===null)return ge;var re=be[1];return ge.split(`
`).map(function(ie){var ce=ie.match(/^\s+/);if(ce===null)return ie;var Ee=ce[0];return Ee.length>=re.length?ie.slice(re.length):ie}).join(`
`)}var Fe=function(){function Te(be){this.options=be||H}var ge=Te.prototype;return ge.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},ge.code=function(re,ie){var ce=this.rules.block.code.exec(re);if(ce){var Ee=ie[ie.length-1];if(Ee&&Ee.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Be=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:F(Be,`
`)}}},ge.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var ce=ie[0],Ee=Ge(ce,ie[3]||"");return{type:"code",raw:ce,lang:ie[2]?ie[2].trim():ie[2],text:Ee}}},ge.heading=function(re){var ie=this.rules.block.heading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ge.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var ce={type:"table",header:q(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(ce.header.length===ce.align.length){var Ee=ce.align.length,Be;for(Be=0;Be<Ee;Be++)/^ *-+: *$/.test(ce.align[Be])?ce.align[Be]="right":/^ *:-+: *$/.test(ce.align[Be])?ce.align[Be]="center":/^ *:-+ *$/.test(ce.align[Be])?ce.align[Be]="left":ce.align[Be]=null;for(Ee=ce.cells.length,Be=0;Be<Ee;Be++)ce.cells[Be]=q(ce.cells[Be],ce.header.length);return ce}}},ge.hr=function(re){var ie=this.rules.block.hr.exec(re);if(ie)return{type:"hr",raw:ie[0]}},ge.blockquote=function(re){var ie=this.rules.block.blockquote.exec(re);if(ie){var ce=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:ce}}},ge.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var ce=ie[0],Ee=ie[2],Be=Ee.length>1,Ie=Ee[Ee.length-1]===")",ut={type:"list",raw:ce,ordered:Be,start:Be?+Ee.slice(0,-1):"",loose:!1,items:[]},bt=ie[0].match(this.rules.block.item),Tt=!1,xt,gt,qe,Xe,Pe,se,fe,$e=bt.length,ke=0;ke<$e;ke++)xt=bt[ke],ce=xt,gt=xt.length,xt=xt.replace(/^ *([*+-]|\d+[.)]) */,""),~xt.indexOf(`
`)&&(gt-=xt.length,xt=this.options.pedantic?xt.replace(/^ {1,4}/gm,""):xt.replace(new RegExp("^ {1,"+gt+"}","gm"),"")),ke!==$e-1&&(qe=this.rules.block.bullet.exec(bt[ke+1])[0],(Be?qe.length===1||!Ie&&qe[qe.length-1]===")":qe.length>1||this.options.smartLists&&qe!==Ee)&&(Xe=bt.slice(ke+1).join(`
`),ut.raw=ut.raw.substring(0,ut.raw.length-Xe.length),ke=$e-1)),Pe=Tt||/\n\n(?!\s*$)/.test(xt),ke!==$e-1&&(Tt=xt.charAt(xt.length-1)===`
`,Pe||(Pe=Tt)),Pe&&(ut.loose=!0),se=/^\[[ xX]\] /.test(xt),fe=void 0,se&&(fe=xt[1]!==" ",xt=xt.replace(/^\[[ xX]\] +/,"")),ut.items.push({type:"list_item",raw:ce,task:se,checked:fe,loose:Pe,text:xt});return ut}},ge.html=function(re){var ie=this.rules.block.html.exec(re);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):le(ie[0]):ie[0]}},ge.def=function(re){var ie=this.rules.block.def.exec(re);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var ce=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ie[0],href:ie[2],title:ie[3]}}},ge.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var ce={type:"table",header:q(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(ce.header.length===ce.align.length){ce.raw=ie[0];var Ee=ce.align.length,Be;for(Be=0;Be<Ee;Be++)/^ *-+: *$/.test(ce.align[Be])?ce.align[Be]="right":/^ *:-+: *$/.test(ce.align[Be])?ce.align[Be]="center":/^ *:-+ *$/.test(ce.align[Be])?ce.align[Be]="left":ce.align[Be]=null;for(Ee=ce.cells.length,Be=0;Be<Ee;Be++)ce.cells[Be]=q(ce.cells[Be].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},ge.lheading=function(re){var ie=this.rules.block.lheading.exec(re);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},ge.paragraph=function(re){var ie=this.rules.block.paragraph.exec(re);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
`?ie[1].slice(0,-1):ie[1]}},ge.text=function(re,ie){var ce=this.rules.block.text.exec(re);if(ce){var Ee=ie[ie.length-1];return Ee&&Ee.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},ge.escape=function(re){var ie=this.rules.inline.escape.exec(re);if(ie)return{type:"escape",raw:ie[0],text:le(ie[1])}},ge.tag=function(re,ie,ce){var Ee=this.rules.inline.tag.exec(re);if(Ee)return!ie&&/^<a /i.test(Ee[0])?ie=!0:ie&&/^<\/a>/i.test(Ee[0])&&(ie=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ee[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ee[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:Ee[0],inLink:ie,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):le(Ee[0]):Ee[0]}},ge.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var ce=pe(ie[2],"()");if(ce>-1){var Ee=ie[0].indexOf("!")===0?5:4,Be=Ee+ie[1].length+ce;ie[2]=ie[2].substring(0,ce),ie[0]=ie[0].substring(0,Be).trim(),ie[3]=""}var Ie=ie[2],ut="";if(this.options.pedantic){var bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);bt?(Ie=bt[1],ut=bt[3]):ut=""}else ut=ie[3]?ie[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var Tt=Ae(ie,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:ut&&ut.replace(this.rules.inline._escapes,"$1")},ie[0]);return Tt}},ge.reflink=function(re,ie){var ce;if((ce=this.rules.inline.reflink.exec(re))||(ce=this.rules.inline.nolink.exec(re))){var Ee=(ce[2]||ce[1]).replace(/\s+/g," ");if(Ee=ie[Ee.toLowerCase()],!Ee||!Ee.href){var Be=ce[0].charAt(0);return{type:"text",raw:Be,text:Be}}var Ie=Ae(ce,Ee,ce[0]);return Ie}},ge.strong=function(re,ie,ce){ce===void 0&&(ce="");var Ee=this.rules.inline.strong.start.exec(re);if(Ee&&(!Ee[1]||Ee[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ie=ie.slice(-1*re.length);var Be=Ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Be.lastIndex=0;for(var Ie;(Ee=Be.exec(ie))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ie.slice(0,Ee.index+3)),Ie)return{type:"strong",raw:re.slice(0,Ie[0].length),text:re.slice(2,Ie[0].length-2)}}},ge.em=function(re,ie,ce){ce===void 0&&(ce="");var Ee=this.rules.inline.em.start.exec(re);if(Ee&&(!Ee[1]||Ee[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ie=ie.slice(-1*re.length);var Be=Ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Be.lastIndex=0;for(var Ie;(Ee=Be.exec(ie))!=null;)if(Ie=this.rules.inline.em.middle.exec(ie.slice(0,Ee.index+2)),Ie)return{type:"em",raw:re.slice(0,Ie[0].length),text:re.slice(1,Ie[0].length-1)}}},ge.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var ce=ie[2].replace(/\n/g," "),Ee=/[^ ]/.test(ce),Be=ce.startsWith(" ")&&ce.endsWith(" ");return Ee&&Be&&(ce=ce.substring(1,ce.length-1)),ce=le(ce,!0),{type:"codespan",raw:ie[0],text:ce}}},ge.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},ge.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ge.autolink=function(re,ie){var ce=this.rules.inline.autolink.exec(re);if(ce){var Ee,Be;return ce[2]==="@"?(Ee=le(this.options.mangle?ie(ce[1]):ce[1]),Be="mailto:"+Ee):(Ee=le(ce[1]),Be=Ee),{type:"link",raw:ce[0],text:Ee,href:Be,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ge.url=function(re,ie){var ce;if(ce=this.rules.inline.url.exec(re)){var Ee,Be;if(ce[2]==="@")Ee=le(this.options.mangle?ie(ce[0]):ce[0]),Be="mailto:"+Ee;else{var Ie;do Ie=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Ie!==ce[0]);Ee=le(ce[0]),ce[1]==="www."?Be="http://"+Ee:Be=Ee}return{type:"link",raw:ce[0],text:Ee,href:Be,tokens:[{type:"text",raw:Ee,text:Ee}]}}},ge.inlineText=function(re,ie,ce){var Ee=this.rules.inline.text.exec(re);if(Ee){var Be;return ie?Be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):le(Ee[0]):Ee[0]:Be=le(this.options.smartypants?ce(Ee[0]):Ee[0]),{type:"text",raw:Ee[0],text:Be}}},Te}(),Ue=Y.noopTest,_e=Y.edit,je=Y.merge,xe={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:Ue,table:Ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};xe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,xe.def=_e(xe.def).replace("label",xe._label).replace("title",xe._title).getRegex(),xe.bullet=/(?:[*+-]|\d{1,9}[.)])/,xe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,xe.item=_e(xe.item,"gm").replace(/bull/g,xe.bullet).getRegex(),xe.list=_e(xe.list).replace(/bull/g,xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+xe.def.source+")").getRegex(),xe._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",xe._comment=/<!--(?!-?>)[\s\S]*?-->/,xe.html=_e(xe.html,"i").replace("comment",xe._comment).replace("tag",xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xe.paragraph=_e(xe._paragraph).replace("hr",xe.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",xe._tag).getRegex(),xe.blockquote=_e(xe.blockquote).replace("paragraph",xe.paragraph).getRegex(),xe.normal=je({},xe),xe.gfm=je({},xe.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*|$)"}),xe.gfm.nptable=_e(xe.gfm.nptable).replace("hr",xe.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",xe._tag).getRegex(),xe.gfm.table=_e(xe.gfm.table).replace("hr",xe.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",xe._tag).getRegex(),xe.pedantic=je({},xe.normal,{html:_e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe._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:Ue,paragraph:_e(xe.normal._paragraph).replace("hr",xe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ue,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:Ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=_e(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=_e(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=_e(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=_e(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=_e(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=_e(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=_e(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=_e(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=_e(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=_e(he._blockSkip,"g").getRegex(),he.overlapSkip=_e(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=_e(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=_e(he.tag).replace("comment",xe._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=_e(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=_e(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=_e(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=je({},he),he.pedantic=je({},he.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:_e(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:_e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=je({},he.normal,{escape:_e(he.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),he.gfm.url=_e(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=je({},he.gfm,{br:_e(he.br).replace("{2,}","*").getRegex(),text:_e(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var te={block:xe,inline:he},ye=j.defaults,ue=te.block,Le=te.inline;function ae(Te){return Te.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function oe(Te){var ge="",be,re,ie=Te.length;for(be=0;be<ie;be++)re=Te.charCodeAt(be),Math.random()>.5&&(re="x"+re.toString(16)),ge+="&#"+re+";";return ge}var Se=function(){function Te(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||ye,this.options.tokenizer=this.options.tokenizer||new Fe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ue.normal,inline:Le.normal};this.options.pedantic?(re.block=ue.pedantic,re.inline=Le.pedantic):this.options.gfm&&(re.block=ue.gfm,this.options.breaks?re.inline=Le.breaks:re.inline=Le.gfm),this.tokenizer.rules=re}Te.lex=function(re,ie){var ce=new Te(ie);return ce.lex(re)};var ge=Te.prototype;return ge.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(re,ie,ce){ie===void 0&&(ie=[]),ce===void 0&&(ce=!0),re=re.replace(/^ +$/gm,"");for(var Ee,Be,Ie,ut;re;){if(Ee=this.tokenizer.space(re)){re=re.substring(Ee.raw.length),Ee.type&&ie.push(Ee);continue}if(Ee=this.tokenizer.code(re,ie)){re=re.substring(Ee.raw.length),Ee.type?ie.push(Ee):(ut=ie[ie.length-1],ut.raw+=`
`+Ee.raw,ut.text+=`
`+Ee.text);continue}if(Ee=this.tokenizer.fences(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.heading(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.nptable(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.hr(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.blockquote(re)){re=re.substring(Ee.raw.length),Ee.tokens=this.blockTokens(Ee.text,[],ce),ie.push(Ee);continue}if(Ee=this.tokenizer.list(re)){for(re=re.substring(Ee.raw.length),Ie=Ee.items.length,Be=0;Be<Ie;Be++)Ee.items[Be].tokens=this.blockTokens(Ee.items[Be].text,[],!1);ie.push(Ee);continue}if(Ee=this.tokenizer.html(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(ce&&(Ee=this.tokenizer.def(re))){re=re.substring(Ee.raw.length),this.tokens.links[Ee.tag]||(this.tokens.links[Ee.tag]={href:Ee.href,title:Ee.title});continue}if(Ee=this.tokenizer.table(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.lheading(re)){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(ce&&(Ee=this.tokenizer.paragraph(re))){re=re.substring(Ee.raw.length),ie.push(Ee);continue}if(Ee=this.tokenizer.text(re,ie)){re=re.substring(Ee.raw.length),Ee.type?ie.push(Ee):(ut=ie[ie.length-1],ut.raw+=`
`+Ee.raw,ut.text+=`
`+Ee.text);continue}if(re){var bt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return ie},ge.inline=function(re){var ie,ce,Ee,Be,Ie,ut,bt=re.length;for(ie=0;ie<bt;ie++){ut=re[ie];switch(ut.type){case"paragraph":case"text":case"heading":{ut.tokens=[],this.inlineTokens(ut.text,ut.tokens);break}case"table":{for(ut.tokens={header:[],cells:[]},Be=ut.header.length,ce=0;ce<Be;ce++)ut.tokens.header[ce]=[],this.inlineTokens(ut.header[ce],ut.tokens.header[ce]);for(Be=ut.cells.length,ce=0;ce<Be;ce++)for(Ie=ut.cells[ce],ut.tokens.cells[ce]=[],Ee=0;Ee<Ie.length;Ee++)ut.tokens.cells[ce][Ee]=[],this.inlineTokens(Ie[Ee],ut.tokens.cells[ce][Ee]);break}case"blockquote":{this.inline(ut.tokens);break}case"list":{for(Be=ut.items.length,ce=0;ce<Be;ce++)this.inline(ut.items[ce].tokens);break}}}return re},ge.inlineTokens=function(re,ie,ce,Ee,Be){ie===void 0&&(ie=[]),ce===void 0&&(ce=!1),Ee===void 0&&(Ee=!1),Be===void 0&&(Be="");var Ie,ut=re,bt;if(this.tokens.links){var Tt=Object.keys(this.tokens.links);if(Tt.length>0)for(;(bt=this.tokenizer.rules.inline.reflinkSearch.exec(ut))!=null;)Tt.includes(bt[0].slice(bt[0].lastIndexOf("[")+1,-1))&&(ut=ut.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+ut.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(bt=this.tokenizer.rules.inline.blockSkip.exec(ut))!=null;)ut=ut.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+ut.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Ie=this.tokenizer.escape(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.tag(re,ce,Ee)){re=re.substring(Ie.raw.length),ce=Ie.inLink,Ee=Ie.inRawBlock,ie.push(Ie);continue}if(Ie=this.tokenizer.link(re)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,Ee)),ie.push(Ie);continue}if(Ie=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,Ee)),ie.push(Ie);continue}if(Ie=this.tokenizer.strong(re,ut,Be)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ce,Ee),ie.push(Ie);continue}if(Ie=this.tokenizer.em(re,ut,Be)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ce,Ee),ie.push(Ie);continue}if(Ie=this.tokenizer.codespan(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.br(re)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.del(re)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ce,Ee),ie.push(Ie);continue}if(Ie=this.tokenizer.autolink(re,oe)){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(!ce&&(Ie=this.tokenizer.url(re,oe))){re=re.substring(Ie.raw.length),ie.push(Ie);continue}if(Ie=this.tokenizer.inlineText(re,Ee,ae)){re=re.substring(Ie.raw.length),Be=Ie.raw.slice(-1),ie.push(Ie);continue}if(re){var xt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(xt);break}else throw new Error(xt)}}return ie},K(Te,null,[{key:"rules",get:function(){return{block:ue,inline:Le}}}]),Te}(),Me=j.defaults,We=Y.cleanUrl,Ke=Y.escape,Qe=function(){function Te(be){this.options=be||Me}var ge=Te.prototype;return ge.code=function(re,ie,ce){var Ee=(ie||"").match(/\S*/)[0];if(this.options.highlight){var Be=this.options.highlight(re,Ee);Be!=null&&Be!==re&&(ce=!0,re=Be)}return Ee?'<pre><code class="'+this.options.langPrefix+Ke(Ee,!0)+'">'+(ce?re:Ke(re,!0))+`</code></pre>
`:"<pre><code>"+(ce?re:Ke(re,!0))+`</code></pre>
`},ge.blockquote=function(re){return`<blockquote>
`+re+`</blockquote>
`},ge.html=function(re){return re},ge.heading=function(re,ie,ce,Ee){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+Ee.slug(ce)+'">'+re+"</h"+ie+`>
`:"<h"+ie+">"+re+"</h"+ie+`>
`},ge.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ge.list=function(re,ie,ce){var Ee=ie?"ol":"ul",Be=ie&&ce!==1?' start="'+ce+'"':"";return"<"+Ee+Be+`>
`+re+"</"+Ee+`>
`},ge.listitem=function(re){return"<li>"+re+`</li>
`},ge.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(re){return"<p>"+re+`</p>
`},ge.table=function(re,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
<thead>
`+re+`</thead>
`+ie+`</table>
`},ge.tablerow=function(re){return`<tr>
`+re+`</tr>
`},ge.tablecell=function(re,ie){var ce=ie.header?"th":"td",Ee=ie.align?"<"+ce+' align="'+ie.align+'">':"<"+ce+">";return Ee+re+"</"+ce+`>
`},ge.strong=function(re){return"<strong>"+re+"</strong>"},ge.em=function(re){return"<em>"+re+"</em>"},ge.codespan=function(re){return"<code>"+re+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(re){return"<del>"+re+"</del>"},ge.link=function(re,ie,ce){if(re=We(this.options.sanitize,this.options.baseUrl,re),re===null)return ce;var Ee='<a href="'+Ke(re)+'"';return ie&&(Ee+=' title="'+ie+'"'),Ee+=">"+ce+"</a>",Ee},ge.image=function(re,ie,ce){if(re=We(this.options.sanitize,this.options.baseUrl,re),re===null)return ce;var Ee='<img src="'+re+'" alt="'+ce+'"';return ie&&(Ee+=' title="'+ie+'"'),Ee+=this.options.xhtml?"/>":">",Ee},ge.text=function(re){return re},Te}(),Ze=function(){function Te(){}var ge=Te.prototype;return ge.strong=function(re){return re},ge.em=function(re){return re},ge.codespan=function(re){return re},ge.del=function(re){return re},ge.html=function(re){return re},ge.text=function(re){return re},ge.link=function(re,ie,ce){return""+ce},ge.image=function(re,ie,ce){return""+ce},ge.br=function(){return""},Te}(),yt=function(){function Te(){this.seen={}}var ge=Te.prototype;return ge.slug=function(re){var ie=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var ce=ie;do this.seen[ce]++,ie=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Te}(),vt=j.defaults,dt=Y.unescape,pt=function(){function Te(be){this.options=be||vt,this.options.renderer=this.options.renderer||new Qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new yt}Te.parse=function(re,ie){var ce=new Te(ie);return ce.parse(re)};var ge=Te.prototype;return ge.parse=function(re,ie){ie===void 0&&(ie=!0);var ce="",Ee,Be,Ie,ut,bt,Tt,xt,gt,qe,Xe,Pe,se,fe,$e,ke,it,at,Ne,Ve=re.length;for(Ee=0;Ee<Ve;Ee++){Xe=re[Ee];switch(Xe.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Xe.tokens),Xe.depth,dt(this.parseInline(Xe.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Xe.text,Xe.lang,Xe.escaped);continue}case"table":{for(gt="",xt="",ut=Xe.header.length,Be=0;Be<ut;Be++)xt+=this.renderer.tablecell(this.parseInline(Xe.tokens.header[Be]),{header:!0,align:Xe.align[Be]});for(gt+=this.renderer.tablerow(xt),qe="",ut=Xe.cells.length,Be=0;Be<ut;Be++){for(Tt=Xe.tokens.cells[Be],xt="",bt=Tt.length,Ie=0;Ie<bt;Ie++)xt+=this.renderer.tablecell(this.parseInline(Tt[Ie]),{header:!1,align:Xe.align[Ie]});qe+=this.renderer.tablerow(xt)}ce+=this.renderer.table(gt,qe);continue}case"blockquote":{qe=this.parse(Xe.tokens),ce+=this.renderer.blockquote(qe);continue}case"list":{for(Pe=Xe.ordered,se=Xe.start,fe=Xe.loose,ut=Xe.items.length,qe="",Be=0;Be<ut;Be++)ke=Xe.items[Be],it=ke.checked,at=ke.task,$e="",ke.task&&(Ne=this.renderer.checkbox(it),fe?ke.tokens.length>0&&ke.tokens[0].type==="text"?(ke.tokens[0].text=Ne+" "+ke.tokens[0].text,ke.tokens[0].tokens&&ke.tokens[0].tokens.length>0&&ke.tokens[0].tokens[0].type==="text"&&(ke.tokens[0].tokens[0].text=Ne+" "+ke.tokens[0].tokens[0].text)):ke.tokens.unshift({type:"text",text:Ne}):$e+=Ne),$e+=this.parse(ke.tokens,fe),qe+=this.renderer.listitem($e,at,it);ce+=this.renderer.list(qe,Pe,se);continue}case"html":{ce+=this.renderer.html(Xe.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Xe.tokens));continue}case"text":{for(qe=Xe.tokens?this.parseInline(Xe.tokens):Xe.text;Ee+1<Ve&&re[Ee+1].type==="text";)Xe=re[++Ee],qe+=`
`+(Xe.tokens?this.parseInline(Xe.tokens):Xe.text);ce+=ie?this.renderer.paragraph(qe):qe;continue}default:{var tt='Token with "'+Xe.type+'" type was not found.';if(this.options.silent){console.error(tt);return}else throw new Error(tt)}}}return ce},ge.parseInline=function(re,ie){ie=ie||this.renderer;var ce="",Ee,Be,Ie=re.length;for(Ee=0;Ee<Ie;Ee++){Be=re[Ee];switch(Be.type){case"escape":{ce+=ie.text(Be.text);break}case"html":{ce+=ie.html(Be.text);break}case"link":{ce+=ie.link(Be.href,Be.title,this.parseInline(Be.tokens,ie));break}case"image":{ce+=ie.image(Be.href,Be.title,Be.text);break}case"strong":{ce+=ie.strong(this.parseInline(Be.tokens,ie));break}case"em":{ce+=ie.em(this.parseInline(Be.tokens,ie));break}case"codespan":{ce+=ie.codespan(Be.text);break}case"br":{ce+=ie.br();break}case"del":{ce+=ie.del(this.parseInline(Be.tokens,ie));break}case"text":{ce+=ie.text(Be.text);break}default:{var ut='Token with "'+Be.type+'" type was not found.';if(this.options.silent){console.error(ut);return}else throw new Error(ut)}}}return ce},Te}(),At=Y.merge,wt=Y.checkSanitizeDeprecation,Oe=Y.escape,we=j.getDefaults,Je=j.changeDefaults,st=j.defaults;function He(Te,ge,be){if(typeof Te=="undefined"||Te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Te)+", string expected");if(typeof ge=="function"&&(be=ge,ge=null),ge=At({},He.defaults,ge||{}),wt(ge),be){var re=ge.highlight,ie;try{ie=Se.lex(Te,ge)}catch(Ie){return be(Ie)}var ce=function(ut){var bt;if(!ut)try{bt=pt.parse(ie,ge)}catch(Tt){ut=Tt}return ge.highlight=re,ut?be(ut):be(null,bt)};if(!re||re.length<3)return ce();if(delete ge.highlight,!ie.length)return ce();var Ee=0;He.walkTokens(ie,function(Ie){Ie.type==="code"&&(Ee++,setTimeout(function(){re(Ie.text,Ie.lang,function(ut,bt){if(ut)return ce(ut);bt!=null&&bt!==Ie.text&&(Ie.text=bt,Ie.escaped=!0),Ee--,Ee===0&&ce()})},0))}),Ee===0&&ce();return}try{var Be=Se.lex(Te,ge);return ge.walkTokens&&He.walkTokens(Be,ge.walkTokens),pt.parse(Be,ge)}catch(Ie){if(Ie.message+=`
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+Oe(Ie.message+"",!0)+"</pre>";throw Ie}}He.options=He.setOptions=function(Te){return At(He.defaults,Te),Je(He.defaults),He},He.getDefaults=we,He.defaults=st,He.use=function(Te){var ge=At({},Te);if(Te.renderer&&function(){var re=He.defaults.renderer||new Qe,ie=function(Be){var Ie=re[Be];re[Be]=function(){for(var ut=arguments.length,bt=new Array(ut),Tt=0;Tt<ut;Tt++)bt[Tt]=arguments[Tt];var xt=Te.renderer[Be].apply(re,bt);return xt===!1&&(xt=Ie.apply(re,bt)),xt}};for(var ce in Te.renderer)ie(ce);ge.renderer=re}(),Te.tokenizer&&function(){var re=He.defaults.tokenizer||new Fe,ie=function(Be){var Ie=re[Be];re[Be]=function(){for(var ut=arguments.length,bt=new Array(ut),Tt=0;Tt<ut;Tt++)bt[Tt]=arguments[Tt];var xt=Te.tokenizer[Be].apply(re,bt);return xt===!1&&(xt=Ie.apply(re,bt)),xt}};for(var ce in Te.tokenizer)ie(ce);ge.tokenizer=re}(),Te.walkTokens){var be=He.defaults.walkTokens;ge.walkTokens=function(re){Te.walkTokens(re),be&&be(re)}}He.setOptions(ge)},He.walkTokens=function(Te,ge){for(var be=B(Te),re;!(re=be()).done;){var ie=re.value;ge(ie);switch(ie.type){case"table":{for(var ce=B(ie.tokens.header),Ee;!(Ee=ce()).done;){var Be=Ee.value;He.walkTokens(Be,ge)}for(var Ie=B(ie.tokens.cells),ut;!(ut=Ie()).done;)for(var bt=ut.value,Tt=B(bt),xt;!(xt=Tt()).done;){var gt=xt.value;He.walkTokens(gt,ge)}break}case"list":{He.walkTokens(ie.items,ge);break}default:ie.tokens&&He.walkTokens(ie.tokens,ge)}}},He.Parser=pt,He.parser=pt.parse,He.Renderer=Qe,He.TextRenderer=Ze,He.Lexer=Se,He.lexer=Se.lex,He.Tokenizer=Fe,He.Slugger=yt,He.parse=He;var nt=He;return nt})},E7E6:function(et,de){et.exports="data:image/png;base64,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"},ELLl:function(et,de,N){(function(ee){ee(N("VrN/"))})(function(ee){var K={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(f,m,a){a&&a!=ee.Init&&(f.removeKeyMap(B),f.state.closeBrackets=null),m&&(M(z(m,"pairs")),f.state.closeBrackets=m,f.addKeyMap(B))});function z(f,m){return m=="pairs"&&typeof f=="string"?f:typeof f=="object"&&f[m]!=null?f[m]:K[m]}var B={Backspace:_,Enter:R};function M(f){for(var m=0;m<f.length;m++){var a=f.charAt(m),n="'"+a+"'";B[n]||(B[n]=j(a))}}M(K.pairs+"`");function j(f){return function(m){return g(m,f)}}function U(f){var m=f.state.closeBrackets;if(!m||m.override)return m;var a=f.getModeAt(f.getCursor());return a.closeBrackets||m}function _(f){var m=U(f);if(!m||f.getOption("disableInput"))return ee.Pass;for(var a=z(m,"pairs"),n=f.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return ee.Pass;var u=w(f,n[o].head);if(!u||a.indexOf(u)%2!=0)return ee.Pass}for(var o=n.length-1;o>=0;o--){var x=n[o].head;f.replaceRange("",P(x.line,x.ch-1),P(x.line,x.ch+1),"+delete")}}function R(f){var m=U(f),a=m&&z(m,"explode");if(!a||f.getOption("disableInput"))return ee.Pass;for(var n=f.listSelections(),o=0;o<n.length;o++){if(!n[o].empty())return ee.Pass;var u=w(f,n[o].head);if(!u||a.indexOf(u)%2!=0)return ee.Pass}f.operation(function(){var x=f.lineSeparator()||`
`;f.replaceSelection(x+x,null),f.execCommand("goCharLeft"),n=f.listSelections();for(var E=0;E<n.length;E++){var v=n[E].head.line;f.indentLine(v,null,!0),f.indentLine(v+1,null,!0)}})}function c(f){var m=ee.cmpPos(f.anchor,f.head)>0;return{anchor:new P(f.anchor.line,f.anchor.ch+(m?-1:1)),head:new P(f.head.line,f.head.ch+(m?1:-1))}}function g(f,m){var a=U(f);if(!a||f.getOption("disableInput"))return ee.Pass;var n=z(a,"pairs"),o=n.indexOf(m);if(o==-1)return ee.Pass;for(var u=z(a,"closeBefore"),x=z(a,"triples"),E=n.charAt(o+1)==m,v=f.listSelections(),O=o%2==0,A,p=0;p<v.length;p++){var h=v[p],s=h.head,l,D=f.getRange(s,P(s.line,s.ch+1));if(O&&!h.empty())l="surround";else if((E||!O)&&D==m)E&&y(f,s)?l="both":x.indexOf(m)>=0&&f.getRange(s,P(s.line,s.ch+3))==m+m+m?l="skipThree":l="skip";else if(E&&s.ch>1&&x.indexOf(m)>=0&&f.getRange(P(s.line,s.ch-2),s)==m+m){if(s.ch>2&&/\bstring/.test(f.getTokenTypeAt(P(s.line,s.ch-2))))return ee.Pass;l="addFour"}else if(E){var T=s.ch==0?" ":f.getRange(P(s.line,s.ch-1),s);if(!ee.isWordChar(D)&&T!=m&&!ee.isWordChar(T))l="both";else return ee.Pass}else if(O&&(D.length===0||/\s/.test(D)||u.indexOf(D)>-1))l="both";else return ee.Pass;if(!A)A=l;else if(A!=l)return ee.Pass}var S=o%2?n.charAt(o-1):m,I=o%2?m:n.charAt(o+1);f.operation(function(){if(A=="skip")f.execCommand("goCharRight");else if(A=="skipThree")for(var C=0;C<3;C++)f.execCommand("goCharRight");else if(A=="surround"){for(var W=f.getSelections(),C=0;C<W.length;C++)W[C]=S+W[C]+I;f.replaceSelections(W,"around"),W=f.listSelections().slice();for(var C=0;C<W.length;C++)W[C]=c(W[C]);f.setSelections(W)}else A=="both"?(f.replaceSelection(S+I,null),f.triggerElectric(S+I),f.execCommand("goCharLeft")):A=="addFour"&&(f.replaceSelection(S+S+S+S,"before"),f.execCommand("goCharRight"))})}function w(f,m){var a=f.getRange(P(m.line,m.ch-1),P(m.line,m.ch+1));return a.length==2?a:null}function y(f,m){var a=f.getTokenAt(P(m.line,m.ch+1));return/\bstring/.test(a.type)&&a.start==m.ch&&(m.ch==0||!/\bstring/.test(f.getTokenTypeAt(m)))}})},FOrL:function(et,de,N){et.exports=N.p+"static/nodata.a6b3f948.png"},FPkq:function(et,de,N){et.exports=N.p+"static/qrCode.dd0fe9b2.png"},GABl:function(et,de){et.exports="data:image/png;base64,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"},Gytx:function(et,de){et.exports=function(ee,K,P,z){var B=P?P.call(z,ee,K):void 0;if(B!==void 0)return!!B;if(ee===K)return!0;if(typeof ee!="object"||!ee||typeof K!="object"||!K)return!1;var M=Object.keys(ee),j=Object.keys(K);if(M.length!==j.length)return!1;for(var U=Object.prototype.hasOwnProperty.bind(K),_=0;_<M.length;_++){var R=M[_];if(!U(R))return!1;var c=ee[R],g=K[R];if(B=P?P.call(z,c,g,R):void 0,B===!1||B===void 0&&c!==g)return!1}return!0}},HmJG:function(et,de,N){},HpTS:function(et,de,N){et.exports=N.p+"static/small_program.f74069ec.png"},I8Z2:function(et,de,N){"use strict";N.d(de,"a",function(){return z}),N.d(de,"b",function(){return w}),N.d(de,"c",function(){return f});var ee=N("q1tI"),K=function(){var m=function(a,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var x in u)u.hasOwnProperty(x)&&(o[x]=u[x])},m(a,n)};return function(a,n){m(a,n);function o(){this.constructor=a}a.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),P=ee.createContext(null),z=function(m){K(a,m);function a(){return m!==null&&m.apply(this,arguments)||this}return a.prototype.render=function(){return ee.createElement(P.Provider,{value:this.props.store},this.props.children)},a}(ee.Component),B=N("Gytx"),M=N.n(B),j=N("2mql"),U=N.n(j),_=function(){var m=function(a,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var x in u)u.hasOwnProperty(x)&&(o[x]=u[x])},m(a,n)};return function(a,n){m(a,n);function o(){this.constructor=a}a.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),R=function(){return R=Object.assign||function(m){for(var a,n=1,o=arguments.length;n<o;n++){a=arguments[n];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(m[u]=a[u])}return m},R.apply(this,arguments)};function c(m){return m.displayName||m.name||"Component"}var g=function(){return{}};function w(m,a){a===void 0&&(a={});var n=!!m,o=m||g;return function(x){var E=function(O){_(A,O);function A(p,h){var s=O.call(this,p,h)||this;return s.unsubscribe=null,s.handleChange=function(){if(!s.unsubscribe)return;var l=o(s.store.getState(),s.props);s.setState({subscribed:l})},s.store=s.context,s.state={subscribed:o(s.store.getState(),p),store:s.store,props:p},s}return A.getDerivedStateFromProps=function(p,h){return m&&m.length===2&&p!==h.props?{subscribed:o(h.store.getState(),p),props:p}:{props:p}},A.prototype.componentDidMount=function(){this.trySubscribe()},A.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},A.prototype.shouldComponentUpdate=function(p,h){return!M()(this.props,p)||!M()(this.state.subscribed,h.subscribed)},A.prototype.trySubscribe=function(){n&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},A.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},A.prototype.render=function(){var p=R(R(R({},this.props),this.state.subscribed),{store:this.store});return ee.createElement(x,R({},p,{ref:this.props.miniStoreForwardedRef}))},A.displayName="Connect("+c(x)+")",A.contextType=P,A}(ee.Component);if(a.forwardRef){var v=ee.forwardRef(function(O,A){return ee.createElement(E,R({},O,{miniStoreForwardedRef:A}))});return U()(v,x)}return U()(E,x)}}var y=function(){return y=Object.assign||function(m){for(var a,n=1,o=arguments.length;n<o;n++){a=arguments[n];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(m[u]=a[u])}return m},y.apply(this,arguments)};function f(m){var a=m,n=[];function o(E){a=y(y({},a),E);for(var v=0;v<n.length;v++)n[v]()}function u(){return a}function x(E){return n.push(E),function(){var O=n.indexOf(E);n.splice(O,1)}}return{setState:o,getState:u,subscribe:x}}},IBYe:function(et,de,N){"use strict";function ee(K){return null}de.a=ee},J66h:function(et,de,N){(function(ee){var K,P;(function(z,B){et.exports=B(z)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof ee!="undefined"?ee:this,function(z){"use strict";z=z||{};var B=z.Base64,M="2.6.4",j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(S){for(var I={},C=0,W=S.length;C<W;C++)I[S.charAt(C)]=C;return I}(j),_=String.fromCharCode,R=function(S){if(S.length<2){var I=S.charCodeAt(0);return I<128?S:I<2048?_(192|I>>>6)+_(128|I&63):_(224|I>>>12&15)+_(128|I>>>6&63)+_(128|I&63)}else{var I=65536+(S.charCodeAt(0)-55296)*1024+(S.charCodeAt(1)-56320);return _(240|I>>>18&7)+_(128|I>>>12&63)+_(128|I>>>6&63)+_(128|I&63)}},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(S){return S.replace(c,R)},w=function(S){var I=[0,2,1][S.length%3],C=S.charCodeAt(0)<<16|(S.length>1?S.charCodeAt(1):0)<<8|(S.length>2?S.charCodeAt(2):0),W=[j.charAt(C>>>18),j.charAt(C>>>12&63),I>=2?"=":j.charAt(C>>>6&63),I>=1?"=":j.charAt(C&63)];return W.join("")},y=z.btoa&&typeof z.btoa=="function"?function(S){return z.btoa(S)}:function(S){if(S.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return S.replace(/[\s\S]{1,3}/g,w)},f=function(S){return y(g(String(S)))},m=function(S){return S.replace(/[+\/]/g,function(I){return I=="+"?"-":"_"}).replace(/=/g,"")},a=function(S,I){return I?m(f(S)):f(S)},n=function(S){return a(S,!0)},o;z.Uint8Array&&(o=function(S,I){for(var C="",W=0,Y=S.length;W<Y;W+=3){var H=S[W],F=S[W+1],q=S[W+2],le=H<<16|F<<8|q;C+=j.charAt(le>>>18)+j.charAt(le>>>12&63)+(typeof F!="undefined"?j.charAt(le>>>6&63):"=")+(typeof q!="undefined"?j.charAt(le&63):"=")}return I?m(C):C});var u=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=function(S){switch(S.length){case 4:var I=(7&S.charCodeAt(0))<<18|(63&S.charCodeAt(1))<<12|(63&S.charCodeAt(2))<<6|63&S.charCodeAt(3),C=I-65536;return _((C>>>10)+55296)+_((C&1023)+56320);case 3:return _((15&S.charCodeAt(0))<<12|(63&S.charCodeAt(1))<<6|63&S.charCodeAt(2));default:return _((31&S.charCodeAt(0))<<6|63&S.charCodeAt(1))}},E=function(S){return S.replace(u,x)},v=function(S){var I=S.length,C=I%4,W=(I>0?U[S.charAt(0)]<<18:0)|(I>1?U[S.charAt(1)]<<12:0)|(I>2?U[S.charAt(2)]<<6:0)|(I>3?U[S.charAt(3)]:0),Y=[_(W>>>16),_(W>>>8&255),_(W&255)];return Y.length-=[0,0,2,1][C],Y.join("")},O=z.atob&&typeof z.atob=="function"?function(S){return z.atob(S)}:function(S){return S.replace(/\S{1,4}/g,v)},A=function(S){return O(String(S).replace(/[^A-Za-z0-9\+\/]/g,""))},p=function(S){return E(O(S))},h=function(S){return String(S).replace(/[-_]/g,function(I){return I=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},s=function(S){return p(h(S))},l;z.Uint8Array&&(l=function(S){return Uint8Array.from(A(h(S)),function(I){return I.charCodeAt(0)})});var D=function(){var S=z.Base64;return z.Base64=B,S};if(z.Base64={VERSION:M,atob:A,btoa:y,fromBase64:s,toBase64:a,utob:g,encode:a,encodeURI:n,btou:E,decode:s,noConflict:D,fromUint8Array:o,toUint8Array:l},typeof Object.defineProperty=="function"){var T=function(S){return{value:S,enumerable:!1,writable:!0,configurable:!0}};z.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T(function(){return s(this)})),Object.defineProperty(String.prototype,"toBase64",T(function(S){return a(this,S)})),Object.defineProperty(String.prototype,"toBase64URI",T(function(){return a(this,!0)}))}}return z.Meteor&&(Base64=z.Base64),et.exports?et.exports.Base64=z.Base64:!(K=[],P=function(){return z.Base64}.apply(de,K),P!==void 0&&(et.exports=P)),{Base64:z.Base64}})}).call(this,N("IyRk"))},JWDV:function(et,de,N){et.exports=N.p+"static/charpter-white.5fa14f93.svg"},JYp7:function(et,de,N){"use strict";N.d(de,"c",function(){return K}),N.d(de,"d",function(){return P}),N.d(de,"f",function(){return B}),N.d(de,"a",function(){return M}),N.d(de,"b",function(){return j}),N.d(de,"e",function(){return U});var ee=function(){var _=function(R,c){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var y in w)w.hasOwnProperty(y)&&(g[y]=w[y])},_(R,c)};return function(R,c){_(R,c);function g(){this.constructor=R}R.prototype=c===null?Object.create(c):(g.prototype=c.prototype,new g)}}(),K={done:!0,value:void 0},P;(function(_){var R={next:function(){return K}};function c(){return R}_.empty=c;function g(E){var v=!1;return{next:function(){return v?K:(v=!0,{done:!1,value:E})}}}_.single=g;function w(E,v,O){return v===void 0&&(v=0),O===void 0&&(O=E.length),{next:function(){return v>=O?K:{done:!1,value:E[v++]}}}}_.fromArray=w;function y(E){return{next:function(){var v=E.next();return v.done?K:{done:!1,value:v.value}}}}_.fromNativeIterator=y;function f(E){return E?Array.isArray(E)?_.fromArray(E):E:_.empty()}_.from=f;function m(E,v){return{next:function(){var O=E.next();return O.done?K:{done:!1,value:v(O.value)}}}}_.map=m;function a(E,v){return{next:function(){for(;;){var O=E.next();if(O.done)return K;if(v(O.value))return{done:!1,value:O.value}}}}}_.filter=a;function n(E,v){for(var O=E.next();!O.done;O=E.next())v(O.value)}_.forEach=n;function o(E,v){v===void 0&&(v=Number.POSITIVE_INFINITY);var O=[];if(v===0)return O;for(var A=0,p=E.next();!p.done&&!(O.push(p.value),++A>=v);p=E.next());return O}_.collect=o;function u(){for(var E=[],v=0;v<arguments.length;v++)E[v]=arguments[v];var O=0;return{next:function(){if(O>=E.length)return K;var A=E[O],p=A.next();return p.done?(O++,this.next()):p}}}_.concat=u;function x(E){return new z(E)}_.chain=x})(P||(P={}));var z=function(){function _(R){this.it=R}return _.prototype.next=function(){return this.it.next()},_}();function B(_){return Array.isArray(_)?P.fromArray(_):_||P.empty()}var M=function(){function _(R,c,g,w){c===void 0&&(c=0),g===void 0&&(g=R.length),w===void 0&&(w=c-1),this.items=R,this.start=c,this.end=g,this.index=w}return _.prototype.first=function(){return this.index=this.start,this.current()},_.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},_.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},_}(),j=function(_){ee(R,_);function R(c,g,w,y){return g===void 0&&(g=0),w===void 0&&(w=c.length),y===void 0&&(y=g-1),_.call(this,c,g,w,y)||this}return R.prototype.current=function(){return _.prototype.current.call(this)},R.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},R.prototype.first=function(){return this.index=this.start,this.current()},R.prototype.last=function(){return this.index=this.end-1,this.current()},R.prototype.parent=function(){return null},R}(M),U=function(){function _(R,c){this.iterator=R,this.fn=c}return _.prototype.next=function(){return this.fn(this.iterator.next())},_}()},JeFH:function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/9qgVaWlHIggHMB+AA8K4TIbe2ek/FzKWUmgLGw7THQtLlCiBUn4z6j9ySa26SUMg3A+ZDyaljBMTC87mXrAUwSQtT+fxBOSqmbpjnaMIyrYJnToRvtQ/sOAJgihFh1ssvRSEFSysEAroJlXQZdp8VhXUEAS07UYGavBPSIQz10vacQ4vjJLJiUMgPAhZByJoQYyr0erZFYmFOFZK+GK7szGOB3Qoi/nsxycG9KQVLKKyDltbDMbBge5NYD87+twvxjNdhbZiIoJZZMysRpPqsShreXECL/ZBRMSjkAwM2wzIugG2k2gOW59fjgaDU2FNbjRI2Fm/r48eigdtz+TUKIF05GOSL3JKSUDwN4SALYXBRQwqzIrUNBvQ1DAIYm4BHAJxMz0TPOLoJu9BFClJxsglVVVWXGx8d/IYTIOl4rsSCnGvNzarCvIghLAl5NoN6WuKVPAu4dkMjtXyuEeP1kk6NJDpJSHgTQ8+Ht5Xj5UBWoqBhNQAsFP/6dwi2alIlTYq1caEY/IUT5zyGYlLIvgD4AugLIgm0zF3qgaccDgcCbMTExu1v6Xinl6YDc/lWxiWvWF6E04BiYxxUEQK0lcUe/BNx9qlLQFUKIt38mOVIAnA6gG4AugM104Qe0ajo1gA+FEHTwVhc96CoAbzy9txJP7KpAPKWKWFRQrCawZEoHZHnN4yEFVbX65DZeIKW8DVI+DiHimrtVSnlCCDFUCHGihc+TYJl7jwf1DlOW5KHWltCiLqSCfndqIm7vlwDLsi41DOP9Nm6z1cullL0BLATAP1tavxZCvNTqw5iDpJSnwrZ2rC60tKvXFTayOCc/AXGGwNIpHdDRCOZA9/QXQtASfrIlpdQg5TYpxMDXDlVhf7mJ/DoLZQEbNabEnf0TMbVTLL+PCHJZy15kL5EQk6ctK8De8mATWaige09LxC19lYIuMQxj7k8mROhBUsrbAfydOW/pd3XIr7VQXG+jImjjtHYePHlmMmDb7wpdv/yHfDcV5Idt7c0NalmTl+Sh2pTh8OYqiF5FBXXwWEeh6acKIWp+yMPbco2U9icS4pyJSwuwsywQDrM1lsQDA5JwW78EPu4iIcS8lhUkHwfw+1s3l2LesRrE6o2jARV032mJuLlv689qy94bRRwpL2YIe3F/Fe7bVqYiEqMs82CvBAOrpmQA0vpUaAZry1ZXCMXZS22ISVM/L8CBSlPFbnfRg/53FCQfAXD/7VtKMTen4XB5qDf38eO+AUm0+usMw3j1exR0GYB3nttXicd2VSDu/0ZB/WCZuzaU2NqMNYUKZHFRQR3jdKyclgGvZa0XhjGqVe2EYbZlzYGm3fmbjSX47EQtYiIEaxTiPNa3IQ/6SUOc46nyUgDvRh8uFXRlNx+eGKKg8d1CiDktCRYIBM7wGPrW5flBce36IgVuIldkiANwsRDiox9ySG25RkqZEIpInRiRGKKFAGwJtPNqWD4tE8nC3AXNOEMIYbX2bLcOugbA63N2V+CpvZWNLK8RSPCYx6ErFPdzgIRBsK2tn+ebuG5Dw+HWWRLnZsXhxWEERnhMCHH/93hQMqzggaP1RuovPs9TsDpSRZEgAcAvhRAftHZAP+ZzadurLCHGTl5agMNVTkRyz3HxlA7o7LVyoOk/KJe7ChoKyE0Lj9fhpk0ljT0oBLs/m9QBp8SYuSEF/eQwW0oZDyuYc7BWb3/usjyY0qmiA7bEqLQYvD0mlWf1ohDixu9RkICUGwJCDJu4OB/HaixERrn/RZj9NIDbZq4vxvLcOnWeVBBR5fzsTPT3WaXQPb2FEEWtGYBSUHV1dYd4r+fA7hrNf8HyfBCgu5bHB//UhaqUkoVIOoBhAPrRBmzbLtSAWyul1mnSkjzk19nqcIO2xMBkLxZOSCP6eU/oOvNMRI6UQgjBbaolpXwZwHUz1hRhXWF9ozBHBf2UhaqUMgYA+T3Wb8Nh2+2haWUASDBf/PDX5XjpYFU4ItHo3hmThuFJMgiPt4sQIu/7ZOFnrgcZsO3tFdBOzV6Up2BhZKFKzX+cnYFTfXZFdV2gt9/v/1FUjySdBDkLltUVUqbD8BjRFsRYfeGqQmwvCSiYTKG6+XR8PjkDBuQ2CLEItt0NQrSDgAe2TIG0bWh6IYTYzLINwB/u31qG149UNwrXVND1Pf340xlJ/NofTfXU19f39Xq9s2Gb/WHLTjA8ityLXm8crsa928rCe6i3JF4a3h5TM3UJ3fMEbDsTQhB3xwOaH9KKhRAVEPpRAK8KIdaEQ7S07XkQ4oJzlxcqmBtZgfPQPhiXjiGJdn2IizvWmmtGfy6lZFW9RwKxJC4Lak10idPw6M5yFNbb+GXXeFzcNV7ddsvmEnx8rFbBZKKf9FgNi7LTkRLTUHrSy/k3opWgDSRqzt8BnABkp1cPVeOB7eVNFBQBOO4RQjzZVjlCXsrcdUlREDhaaSIzVmDZd3X49EQtuvkN/On0JFU7rs6rw9Xri8NnSQN5cnA7XO6QtY0WQ0CpBcTrjoUBKCAb0aAgKWfT8m7cVIKFx53DcRfDzH9Gp2F0CiQML0HC/rYKpmgcK7hnY4kUV68rUjH53yPb456vSrG33MRV3X145uxk9di/7KrA0/scsELj8BsCn2WnI8unozJo48ZNpThYaeLBgYnYWFiPuTm1qgh8a0wqvJBFsILJK4ulPnNdUSNDI+C4oHMcnh2qAMd/CyEeaqscIQV9CuAXF64sxLqCekUd8bQe31WBjDgNyyZloFO8joMVJs5fUYiAdMAKEd0fByTiJqcOwz8PVOH1w1U4MyUGl54Shxs3l6qQPOesZIzLYItHnBGpoGvpVpGH426ervmv4e0xrRNDrhgshNjWVsEU/LTMfTlBvePUJXmqsv7nsBS8eaQaq/LrMSkzFm+Odto17x2twV1fliojoSKJguaPT0PfJI8SctLnBYoE/duZyYoxeOVQNXonGlg5NQMeKbfBtjKP1GkdiOSCIbDB51KOiR1i8dpI9T1/F0Lc0VY5Qgr6C4B7fr2xRBXE/9UlHqPSY3DP1jL4DIF549JwajuPYkKmLisI51N6ENn0+weoEKsMcfaucozJiFVsyTXrihXyZBg8t5MHEPrASAWNAbD6g6M1uCN0OO7m+WAexi9PUSFoLGPjjxLMNldYQh9PtmBPWQCzB7XDzrIg3jlag8EpHiwYn6YKu/UF9bhibTGMUMyiF707JhVnp3ph2sD0lYX4orgejw9uh5wqCy8erELfRAMrpmRAk3I5YPtroA9lPs0LgQ3ul4hwWGoM3h+bSsDxutB1GmWbl5TySgBv/m1PpTrg4WkxuKG3Hzdsckj+N0elYkxGjArPF6wsxI5SJ2XwHGd08+GvTk2Hlw86bMPZqTGKgmI4DNAZRrTHtEwD0IwBkQrqBjO4f0s5PJeuLmwCTx8+PQmzevn53POFECQD27yklH8D8NvrNhRj/rFaxSxz46y9uvsNLMpOQ5JXw+FKE+etKAzXMTzYV4a3x6SOTnS+bE0RluXW4bFB7VBYZ+Mf+yrRN8nAyikZENL6BEJUAtrl01cUYnvocHgfQzUtm+ESkB8LoV3YZiEcpDgYtvXVkrwgfrWhGF19BmYPSsJvNpWi0rTxzFnJ4XxKL1sUKv7pwdM6xeFfw1WIxYff1uCWLaUYlOzBg6cn4ep1xUqJLzUo6LRIBfnJBp8IGllTluaiNlQB80G86bd9E3DPaYqmv0YI8caPFGwmgNfo2k/srsDlp8Qr6/n91jKkxmjq4Dr79CahgbnjqQYPBhmPD3Nq8OczklAdlHhyTwX6JXlCCpLzIcQOAA+wplsQkU9p0V18uvI0XVqrhWaM+5FyJMMyD3xTr6VOXZoHQwhVSN/5ZamqvR6MyDN/+roc/wpB7UYeDCgjo1JoNGwiXrWuSHGhLSlIwLLWB3R9+ITF+ar76OIEKmhmD5/bibxTCEFPaPOSUp4FaW9ZeCKAK9cWIjszFtf38mPWphIFBOaOS1PJngfJ5LorhCb5/Q8NTMKveysPxj1fluLFA1UqxFF5j+wsR/8kD9ZOy2SIWwCHwnl99s4KPLu/gRlhqGwf49AticLeAaExn7ZKt0QLKqXkWa0L6vqIMZ/l43BVEO+NTsXsXRXYURpU3OEDpzt55pWDVXjwawdN0oO5zwUT0lTk2FJUjwtWFqFPoqFY7l+uLkKVaePVkak4p0NUiOPDpGW9BU2bcdGqQnxV3AC1eQjnd47D8w76mS2EuK/N2nFCQxos8+CROi3pmT3lGJcRi3GZMThQEYTf0NAtwQjDYoaOz79zqnAq6Na+CfiD48F4dl8l3v6mBvcPSFR55aUDVciM1/HyiPZU0GIIQVZ7Fa8hSnRJUwIO/j97W508P5xuaU5WaVkvQdOuZzTgc6/p4VP1I/dDUjQjTle3LT5Ri1kbHXaGhpcVr6tQ7vdoCuUxb9Eo7+yfgPu3laOo3sJ9A5MwJt3DQqIBxSkFSevPgPbHyDqE/67olvQYvD1a0S0vCyFm/UgFMe0vAHBOa/f/cVsZXjvsFJqKMO3uwxODneRKS9SEaJQnSeqSlARAmuVvsM0ja4tsjZ7q1nSN6Ra7HLpBuoX1RpuXlJKMxluhcqzF+1lwX7LaKSu4Rw6tUEHpcboqIUwpm5C6vFYA3wEYFD3Vo6B2dGhwkqsXn2Wn8VsWCE2b3maJQjdIy3oWmnbzoUoTu0sD4J8Mp2VBG+MzY1U9xPX8/ipVxFJBTK6/6BSHf4aSKwWl0tgrMm2pckCiV7iCPsueECwz51Cd3v6cz3PDvB6fy+v/MyYNo5Jhw/D2FUKw5d/mFQgEzvZ4PBtKA7bOsMYocLTKVF6UYGi4f2CiYq+P11j4xfICVAUdVpvjBJ9MSEP3BIdEoWyUg+iNy+fRVLiHo6Ah0QrKZu76z5Fqlbjd0MB7WXitmJoBr5QbhaaNaLNEroKkZKv3+ivWOkhMF05Di0ZwVmqMgtr8+8c5DsJhLUQPJpR9zyFMwVKAwIAWqLwJAt0SdLwxJg0+2NugaUMh7a8qpDYgmrpiuH5uaAqmdyYiFMOEQw+1eUkpR3IqjWiUYcqlxnig3Ne8cakYmhajCutpywuVEfIafv7h2FSckeLF8WoLszYWozhgKzaEi2TJY4OSMaFDDEzTHButIDabdq8sssQ16xoof35hokdg2bQOSBXBQ8Lw9mqzRA0Kuo1h6IHtZSAdE2kEGaR0JqarMECGYMba4jBhyuRKwpR10ltHqnHXV2WID6EY7o/UysppHZCpBQ/C8PRh11IKfdoUNiErzHBNRc8jFUNwYprmVI/Hs+THyCKl7MjWxs4qzXfhinwVwtzD5HfMGZKMy7rFK2WRcXDhPg3qjVGpGJsRg9waC5OXFaAiKMPhmt7E8uFXPX1sUJ4TraBUwsd9NVry+cvyQHjDC9xqfmF2Jnr7ZAU0/WYyF5ZlBXVdZ+uBtHkhgJLWUJGUcjyAFe+G2ILIBO4RAgsmpKJ3ogeHKkyct7IAAduxSCZXwvAEj8CSUOL1hhTkTh4tntwBXY3AMeGN6SKlfB7AjVeuLcaagrpwnHc6tAm4zxm9eoZgIiQiaT1WmoW5ublFHTt2/N62vpTSoJdWSW1g9uI8VY+5XsTvuK1vAn4fAjXXbyjGkhDgoQeTaiLlRDZl2rJCfFcbgZhNiQcGJuGGPgqxXhKtIC9sc0exbfSZuCgX5cGG+QTGblbgrFuaLCtILZZBEzmAthuatgXAJgC7opt7UsosWOb+rytF/EUr8xs11BTnNyoVozNiUFRnYeryQpTUO77PeM7kSnS0pSigilXG9EgD+nRSB/SMDeZB92ax+0p67O4vy/Du0eowt8jDu7RrPJ46y+H9Gi9m7WA9OH+uaQcgxVZo2kYAXzU3TSSl/A/Ht/5rdRE2FzW0NqiECzvH4x9Dne+4f1sZXncBjynxyKAkXNvTr8IzywnSVW5rnB70+9DkkRoNa7LFEB2TvSQfR6ut8HwCFXR1D78q9MgxsQ3AhMeDIyLJ8nnQJUFHsoMunWWrIRNO4XDQYzWngVQNIe2vK0P5gUx2ZL311JBkXNotXiXPc1YUKhDBz0kiMrn2SDAUPD1vRUGYZ6MH8WvnT8xEvzirCIansxr9Bd5+anclntxbEQ6HlKN/Oy+u6BavWHQeJnOyz9CQGqujY7yBLgkecIgozJ1bZiU0fSOEmA/gUyHEtxRPSnkngDkPbCvHq4cb+j7MmUNDlBIP+B97SQk5I200kDv7JeAuZzYPl68pwvqIvlXU5zObKsiy3oCmXXXxKvJdgUYQkBqnYoii3EUrpiAMN0keTYUi4nomyKEZcch05+5tcz804zXCdABPsKl2yaoibClusDxu7u7+ibijv8P2snDbVFQfhslMroNSvMirtVTiLQ84YcWN//MmZGCAzy6F4ekCgHPmq9/5pgZ3R9RCym4kFI0ULQc/Y5jlQTIf9kr04Mz2XgzPiMOApJDlUVm6MS8YDD7r8XiINFa/d7RGuOQun+H2sBiSmRvfP1qjWAYCnqiiHzdvLlG0l9s9iKr5rm+qIOlM1xCZfBLVdmgmJoT/ycX5lnSUyAezah+c4sW5WfGY2iUOPgVx7G+gaXyFZURkrcMHcXNXdPPhLyEy8abNJVgQ2jyN4/WR7RUUJ2SdtrxAQVh6l2svH43PwOl+uxyGh72nNNjmvpWFtrhmXWGTWqM1WYhc6W18NsEIPZdM+PSufvTya4AVtKF7lsK2sr8utz00aNdQ3AERNySvyqvDNaG+ED32vKw4vODMWOCh0ESvm4sV493bj/sHKibixuYUdAOAF6Lbtc0JFIlcmvvchcG8jo2sy06Jx8zeCfCFYke0dTOsTciMxb9HOW0HjiO/dMgJHRTs6RAJGc0Su8Yxd3w6BiXKSuieHirxm8HDe2q0xOlRbfwmYT0CgbUkJ5VFKEwyl3u8oU8CBrRzapnSehtTlxegIMScu6Dq4/FpiiPcWRoE2RlmUxrayLQYvBMqGUj0so8UqaAbeoWpojuaU9D5DOccvPtzqFBsbtOM26xhyoO2StbMEU0eFnEjvYqxmXCZMHdkeoxqa7PKdhc3f1o7L+YTTgsWq5V4dKez+Wg+jiTjyvw6lQe5qDR2fc9MlNUwPD0BFMO29hVYeveJi3OV10VNYYW/l8+vNKkAp6qPGqdrJD4Pn8aSYAjF7nOgkgn+stVF2BgBFKhQth0IeFjvqGLVlGCEcUqGdAX93/3GKRkiFeS25W3bvrc5BZ0NyM3zcupw65aSJtOZ7mEwRr8wNEX1c5Z8V4ttJQGF+qIH1qOVSyUxIb86IgUDkr3IXpoftjx3uI+MBS2VdPxvv2iI3bf2ScAfHHiMO74oxQffNgw48t73xqbj7CS7FoaX7zB9J01zY0DXh41flN8IykbuiV5Lqp9Tn5wJZIf0WLXDn5IiakmpjA40mut6+vDIoHaNvJ33Rno8cyVzZm6t81wW/Qx/CR5NFevkHd0ZPj7zVz39iqlnBGxOQd3ZF9pQCmPGmoIw/IsUyn0Dgl/S1e+4OamOJSfqlJD7Kkz1by1ZIjcxOdTZvDTC8sLt7YnpCmxExu7oZtdjO8rx3IHGEzPvjk3DsCRZF1LQCWnbH0GIC5ubs3DlIay9JwKYENZTSQuP1SqPYK0SPQDp3suQReiwYnK6Ipdd5oOfc78kc2/qk6A8k/0twmlGHRofzy4zTse24gAuWeNEESqD913bw1E6gEeaU1AKK+QDofk0WmZzoYskH2sWkqiRix7yRVFAdQpzqhvPpbnXEUGNSY/BW6NTG1meS2Z+NC4NA5I9qhN58aoiFbvJVU3uGItXRjj5iQz2wzsahkIYUt4Zm47h7WR4sEVKSV7uZhUO8xxmPHrR0i/uEo+nQ/MQkZ/nVJsKIr//bU2TQXxe5+6XHs9zohLckTUe9KyefjzseEIYTtMrvRoUpUWU+E2liXNXFKIuNGTJ+8iMk00g2m1OQSxWdxbZRm8Wq6QhmnNzh85oh8u6NZ5QIXTlLNjf91Y2mex0hWdTikPst/ZLULxaZIs9Eq19W+Vsntczdg9J8aqeEXNeJFfH51JBb49Jx4hkOwAjhm8B5kgp2RZ59M4vStUhRw/T8z4a1NntY/DBuNQmhsgcee/WMhURmosGBA0MjQuz05SXTF3mhDFeq1o0WXF4PoTWIuE0IwV5xbNSvYpc5dyCO+qmFNTdh8cc5v6pZvO6NM11AV0fOWFRPk5E0BCR1sUH3d43Ab8L0Rn8jNwS0R/Hj2itzT2c3tPDb+DDcWmqixqJcHh9ZPeU4YZwmuiI1trDr+PT7HR10Gvz63HVuoa5BSrorTHpGJksAzC8bCN868zhNWXnI+Wg5XcO0Uh+TmiGPOONQ9X4y+4K1cJuLsRxP/Tqv4eQJf9OApjhkddHd08f3F6OV0KIVPWwhrXHlE6xSt5zlheGR4R5rld392G2o6B/NK8g254LIS4i8thd1vQ9G94ZNcKkRlypnCNVZpO3CsKhzZJIi9Xx0vAUDGmvKlirPGjrfJ8nt9ZhFLhB9x0efgeti/PNZKzTYjUsmZiu6ivuiwMZbkihBb/ltBGCIQUdlVKy7/QJhzMeCnU1o0McrZmTOJ9mp6GLz1Dv8/x5RznmH69VRWtz0YP38JDZRAzxbWpMj/ex00tERtRK7yL7QWNlRGEbh0Uw5XpySDtc0d2nDI811JchUoDyX9XNh8edWvCF5hUk5XOcvKRFrA1ZRLRgbmh4dWQKnttXpV6fpBVHDjy691Agbur0ZA/+OiQZpyWzWwjONbAiunJGhOU5yMiP/z4jSVX6v95UonIRn8HD+mBMKrr4DQe6rnD6LG67Qs3uJUsTHhXiqKCz+eotK3WGmOZCHDfCZ88dm6qg9h+3l6mhlehXVyKNjAq9q38iZjkt+BO2bc/RNDw1L6c+jHzpmWkxDjtPg/oop0bVOxSYaeOWvn4FILhmbSjG4ojuccRw5cstKehBAH+6dUsp5kW8qxOpJB4eebgOcbqi0psLaS6lQgqI3NftpybB7zAmfHn3N7ZtX6tp2ov0vGdCg4pU5PSsOLzqzK6pxR81CNJrTaB9aFiY0JXexbEqV0Fvjk7D2BSYMLx80fmIlLIXrODedSVSvzLiXZ1oY6MVD2znwd4KE7Wm3fQtw1CByetGcMhlQJIaEwPkIUCws3oIZvDYvlo9gQM3zE0uA7F0UrpiIbiIbflfre30fZw5WuAPX5XhzW8cQleh1VPinTfxgH+3pKDf8E2C1tgEKoDJO9JruDGGG1oQc8yUjnG4rlcC+iTqpHlKoWlU/nMceJdSjgawhvnk42M1yIo3kBqroXeiF0NTlZftA+R+SMpix4PDj0KvghBZpo0uVNCByqCK+QpcjErD+BRuKIY56JDk/LcZPLCnRk+avjyv0UsB0Uri/Sw4Iw+EMjBSsBgelOLBzB5+nNfZfYXWfh/Q7uJvRvAHMyDlF3UQgx7dXoZYQ1NcXlqsgeyOsTTKenBWAjYhbxxs6YemG3B+EGQY5xo4ekbPZF7j/OEcR0FzW1IQmeCPommI5iyPnkQlURgqhxU26Y3JHeNwXhcfsuL4/p9pQTdIzfP9ngPuc6SU3AU7mo0bgCYrXg/Hi2dETrHyXVa+HS2l5Ft21+6usMBuhMtidE/UECdlDYSggk6oV1psa893Qb3rlCW54ZepouXg37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(et,de,N){et.exports=N.p+"static/qrcode.54870d9b.png"},LdHM:function(et,de,N){"use strict";N.d(de,"b",function(){return u}),N.d(de,"a",function(){return E});var ee=N("1OyB"),K=N("vuIU"),P=N("Ji7U"),z=N("LK+K"),B=N("q1tI"),M=N("rePB"),j=N("Ff2n"),U=N("ODXe"),_=N("4IlW"),R=N("bX4T"),c=N("YrtM"),g=N("TSYQ"),w=N.n(g),y=N("+nKL"),f=N("8OUc"),m=function(q,le){var pe=q.prefixCls,Ae=q.id,Ge=q.flattenOptions,Fe=q.childrenAsData,Ue=q.values,_e=q.searchValue,je=q.multiple,xe=q.defaultActiveFirstOption,he=q.height,te=q.itemHeight,ye=q.notFoundContent,ue=q.open,Le=q.menuItemSelectedIcon,ae=q.virtual,oe=q.onSelect,Se=q.onToggleOpen,Me=q.onActiveValue,We=q.onScroll,Ke=q.onMouseEnter,Qe="".concat(pe,"-item"),Ze=Object(c.a)(function(){return Ge},[ue,Ge],function(nt,Te){return Te[0]&&nt[1]!==Te[1]}),yt=B.useRef(null),vt=function(Te){Te.preventDefault()},dt=function(Te){yt.current&&yt.current.scrollTo({index:Te})},pt=function(Te){for(var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,be=Ze.length,re=0;re<be;re+=1){var ie=(Te+re*ge+be)%be,ce=Ze[ie],Ee=ce.group,Be=ce.data;if(!Ee&&!Be.disabled)return ie}return-1},At=B.useState(function(){return pt(0)}),wt=Object(U.a)(At,2),Oe=wt[0],we=wt[1],Je=function(Te){we(Te);var ge=Ze[Te];if(!ge){Me(null,-1);return}Me(ge.data.value,Te)};B.useEffect(function(){Je(xe!==!1?pt(0):-1)},[Ze.length,_e]),B.useEffect(function(){var nt=setTimeout(function(){if(!je&&ue&&Ue.size===1){var Te=Array.from(Ue)[0],ge=Ze.findIndex(function(be){var re=be.data;return re.value===Te});Je(ge),dt(ge)}});return function(){return clearTimeout(nt)}},[ue]);var st=function(Te){Te!==void 0&&oe(Te,{selected:!Ue.has(Te)}),je||Se(!1)};if(B.useImperativeHandle(le,function(){return{onKeyDown:function(Te){var ge=Te.which;switch(ge){case _.a.UP:case _.a.DOWN:{var be=0;if(ge===_.a.UP?be=-1:ge===_.a.DOWN&&(be=1),be!==0){var re=pt(Oe+be,be);dt(re),Je(re)}break}case _.a.ENTER:{var ie=Ze[Oe];ie&&!ie.data.disabled?st(ie.data.value):st(void 0),ue&&Te.preventDefault();break}case _.a.ESC:Se(!1)}},onKeyUp:function(){},scrollTo:function(Te){dt(Te)}}}),Ze.length===0)return B.createElement("div",{role:"listbox",id:"".concat(Ae,"_list"),className:"".concat(Qe,"-empty"),onMouseDown:vt},ye);function He(nt){var Te=Ze[nt];if(!Te)return null;var ge=Te.data||{},be=ge.value,re=ge.label,ie=ge.children,ce=Object(R.a)(ge,!0),Ee=Fe?ie:re;return Te?B.createElement("div",Object.assign({"aria-label":typeof Ee=="string"?Ee:null},ce,{key:nt,role:"option",id:"".concat(Ae,"_list_").concat(nt),"aria-selected":Ue.has(be)}),be):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(Ae,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(Oe-1),He(Oe),He(Oe+1)),B.createElement(y.a,{itemKey:"key",ref:yt,data:Ze,height:he,itemHeight:te,fullHeight:!1,onMouseDown:vt,onScroll:We,virtual:ae,onMouseEnter:Ke},function(nt,Te){var ge,be=nt.group,re=nt.groupOption,ie=nt.data,ce=ie.label,Ee=ie.key;if(be)return B.createElement("div",{className:w()(Qe,"".concat(Qe,"-group"))},ce!==void 0?ce:Ee);var Be=ie.disabled,Ie=ie.value,ut=ie.title,bt=ie.children,Tt=ie.style,xt=ie.className,gt=Object(j.a)(ie,["disabled","value","title","children","style","className"]),qe=Ue.has(Ie),Xe="".concat(Qe,"-option"),Pe=w()(Qe,Xe,xt,(ge={},Object(M.a)(ge,"".concat(Xe,"-grouped"),re),Object(M.a)(ge,"".concat(Xe,"-active"),Oe===Te&&!Be),Object(M.a)(ge,"".concat(Xe,"-disabled"),Be),Object(M.a)(ge,"".concat(Xe,"-selected"),qe),ge)),se=Fe?bt:ce,fe=!Le||typeof Le=="function"||qe;return B.createElement("div",Object.assign({},gt,{"aria-selected":qe,className:Pe,title:ut,onMouseMove:function(){if(Oe===Te||Be)return;Je(Te)},onClick:function(){Be||st(Ie)},style:Tt}),B.createElement("div",{className:"".concat(Xe,"-content")},se||Ie),B.isValidElement(Le)||qe,fe&&B.createElement(f.a,{className:"".concat(Qe,"-option-state"),customizeIcon:Le,customizeIconProps:{isSelected:qe}},qe?"\u2713":null))}))},a=B.forwardRef(m);a.displayName="OptionList";var n=a,o=function(){return null};o.isSelectOption=!0;var u=o,x=function(){return null};x.isSelectOptGroup=!0;var E=x,v=N("VTBJ"),O=N("Zm9Q");function A(F){var q=F.key,le=F.props,pe=le.children,Ae=le.value,Ge=Object(j.a)(le,["children","value"]);return Object(v.a)({key:q,value:Ae!==void 0?Ae:q,children:pe},Ge)}function p(F){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(F).map(function(le,pe){if(!B.isValidElement(le)||!le.type)return null;var Ae=le.type.isSelectOptGroup,Ge=le.key,Fe=le.props,Ue=Fe.children,_e=Object(j.a)(Fe,["children"]);return q||!Ae?A(le):Object(v.a)(Object(v.a)({key:"__RC_SELECT_GRP__".concat(Ge===null?pe:Ge,"__"),label:Ge},_e),{},{options:p(Ue)})}).filter(function(le){return le})}var h=N("2Qr1"),s=N("qNPg"),l=N("U8pU"),D=N("Kwbf"),T=N("WKfj");function S(F){var q=F.mode,le=F.options,pe=F.children,Ae=F.backfill,Ge=F.allowClear,Fe=F.placeholder,Ue=F.getInputElement,_e=F.showSearch,je=F.onSearch,xe=F.defaultOpen,he=F.autoFocus,te=F.labelInValue,ye=F.value,ue=F.inputValue,Le=F.optionLabelProp,ae=q==="multiple"||q==="tags",oe=_e!==void 0?_e:ae||q==="combobox",Se=le||p(pe);if(Object(D.a)(q!=="tags"||Se.every(function(Qe){return!Qe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),q==="tags"||q==="combobox"){var Me=Se.some(function(Qe){return Qe.options?Qe.options.some(function(Ze){return typeof("value"in Ze?Ze.value:Ze.key)=="number"}):typeof("value"in Qe?Qe.value:Qe.key)=="number"});Object(D.a)(!Me,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(D.a)(q!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(D.a)(q==="combobox"||!Ae,"`backfill` only works with `combobox` mode."),Object(D.a)(q==="combobox"||!Ue,"`getInputElement` only work with `combobox` mode."),Object(D.b)(q!=="combobox"||!Ue||!Ge||!Fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),je&&!oe&&q!=="combobox"&&q!=="tags"&&Object(D.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(D.b)(!xe||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ye!=null){var We=Object(T.d)(ye);Object(D.a)(!te||We.every(function(Qe){return Object(l.a)(Qe)==="object"&&("key"in Qe||"value"in Qe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(D.a)(!ae||Array.isArray(ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(pe){var Ke=null;Object(O.a)(pe).some(function(Qe){if(!B.isValidElement(Qe)||!Qe.type)return!1;var Ze=Qe.type;if(Ze.isSelectOption)return!1;if(Ze.isSelectOptGroup){var yt=Object(O.a)(Qe.props.children).every(function(vt){return!B.isValidElement(vt)||!Qe.type||vt.type.isSelectOption?!0:(Ke=vt.type,!1)});return!yt}return Ke=Ze,!0}),Ke&&Object(D.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(D.a)(ue===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=S,C=Object(s.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:p,flattenOptions:h.d,getLabeledValue:h.e,filterOptions:h.b,isValueDisabled:h.g,findValueOption:h.c,warningProps:I,fillOptionsWithMissingValue:h.a}),W=function(F){Object(P.a)(le,F);var q=Object(z.a)(le);function le(){var pe;return Object(ee.a)(this,le),pe=q.apply(this,arguments),pe.selectRef=B.createRef(),pe.focus=function(){pe.selectRef.current.focus()},pe.blur=function(){pe.selectRef.current.blur()},pe}return Object(K.a)(le,[{key:"render",value:function(){return B.createElement(C,Object.assign({ref:this.selectRef},this.props))}}]),le}(B.Component);W.Option=u,W.OptGroup=E;var Y=W,H=de.c=Y},M8RZ:function(et,de,N){"use strict";N.d(de,"a",function(){return _});var ee=N("fWQN"),K=N("mtLc"),P=N("yKVA"),z=N("879j"),B=N("q1tI"),M=N.n(B),j=N("i8i4"),U=N.n(j),_=function(R){Object(P.a)(g,R);var c=Object(z.a)(g);function g(w){var y;Object(ee.a)(this,g),y=c.call(this,w);var f=window.document;return y.node=f.createElement("div"),f.body.appendChild(y.node),y}return Object(K.a)(g,[{key:"render",value:function(){var y=this.props.children;return Object(j.createPortal)(y,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(M.a.Component)},MI8n:function(et,de,N){"use strict";N.d(de,"b",function(){return M}),N.d(de,"a",function(){return _}),N.d(de,"e",function(){return R}),N.d(de,"d",function(){return c}),N.d(de,"c",function(){return g}),N.d(de,"f",function(){return w});var ee=N("/cxE"),K=N("C/vA"),P=N("pmY6"),z=N("24hK"),B=function(){var y=function(f,m){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var o in n)n.hasOwnProperty(o)&&(a[o]=n[o])},y(f,m)};return function(f,m){y(f,m);function a(){this.constructor=f}f.prototype=m===null?Object.create(m):(a.prototype=m.prototype,new a)}}(),M;(function(y){y.None=function(){return P.a.None};function f(I){return function(C,W,Y){W===void 0&&(W=null);var H=!1,F;return F=I(function(q){return H?void 0:(F?F.dispose():H=!0,C.call(W,q))},null,Y),H&&F.dispose(),F}}y.once=f;function m(I,C){return E(function(W,Y,H){return Y===void 0&&(Y=null),I(function(F){return W.call(Y,C(F))},null,H)})}y.map=m;function a(I,C){return E(function(W,Y,H){return Y===void 0&&(Y=null),I(function(F){C(F),W.call(Y,F)},null,H)})}y.forEach=a;function n(I,C){return E(function(W,Y,H){return Y===void 0&&(Y=null),I(function(F){return C(F)&&W.call(Y,F)},null,H)})}y.filter=n;function o(I){return I}y.signal=o;function u(){for(var I=[],C=0;C<arguments.length;C++)I[C]=arguments[C];return function(W,Y,H){return Y===void 0&&(Y=null),P.e.apply(void 0,I.map(function(F){return F(function(q){return W.call(Y,q)},null,H)}))}}y.any=u;function x(I,C,W){var Y=W;return m(I,function(H){return Y=C(Y,H),Y})}y.reduce=x;function E(I){var C,W=new _({onFirstListenerAdd:function(){C=I(W.fire,W)},onLastListenerRemove:function(){C.dispose()}});return W.event}y.snapshot=E;function v(I,C,W,Y,H){W===void 0&&(W=100),Y===void 0&&(Y=!1);var F,q=void 0,le=void 0,pe=0,Ae=new _({leakWarningThreshold:H,onFirstListenerAdd:function(){F=I(function(Ge){pe++,q=C(q,Ge),Y&&!le&&(Ae.fire(q),q=void 0),clearTimeout(le),le=setTimeout(function(){var Fe=q;q=void 0,le=void 0,(!Y||pe>1)&&Ae.fire(Fe),pe=0},W)})},onLastListenerRemove:function(){F.dispose()}});return Ae.event}y.debounce=v;function O(I){var C=new Date().getTime();return m(f(I),function(W){return new Date().getTime()-C})}y.stopwatch=O;function A(I){var C=!0,W;return n(I,function(Y){var H=C||Y!==W;return C=!1,W=Y,H})}y.latch=A;function p(I,C,W){C===void 0&&(C=!1),W===void 0&&(W=[]);var Y=W.slice(),H=I(function(le){Y?Y.push(le):q.fire(le)}),F=function(){Y&&Y.forEach(function(le){return q.fire(le)}),Y=null},q=new _({onFirstListenerAdd:function(){H||(H=I(function(le){return q.fire(le)}))},onFirstListenerDidAdd:function(){Y&&(C?setTimeout(F):F())},onLastListenerRemove:function(){H&&H.dispose(),H=null}});return q.event}y.buffer=p;var h=function(){function I(C){this.event=C}return I.prototype.map=function(C){return new I(m(this.event,C))},I.prototype.forEach=function(C){return new I(a(this.event,C))},I.prototype.filter=function(C){return new I(n(this.event,C))},I.prototype.reduce=function(C,W){return new I(x(this.event,C,W))},I.prototype.latch=function(){return new I(A(this.event))},I.prototype.debounce=function(C,W,Y,H){return W===void 0&&(W=100),Y===void 0&&(Y=!1),new I(v(this.event,C,W,Y,H))},I.prototype.on=function(C,W,Y){return this.event(C,W,Y)},I.prototype.once=function(C,W,Y){return f(this.event)(C,W,Y)},I}();function s(I){return new h(I)}y.chain=s;function l(I,C,W){W===void 0&&(W=function(le){return le});var Y=function(){for(var le=[],pe=0;pe<arguments.length;pe++)le[pe]=arguments[pe];return q.fire(W.apply(void 0,le))},H=function(){return I.on(C,Y)},F=function(){return I.removeListener(C,Y)},q=new _({onFirstListenerAdd:H,onLastListenerRemove:F});return q.event}y.fromNodeEventEmitter=l;function D(I,C,W){W===void 0&&(W=function(le){return le});var Y=function(){for(var le=[],pe=0;pe<arguments.length;pe++)le[pe]=arguments[pe];return q.fire(W.apply(void 0,le))},H=function(){return I.addEventListener(C,Y)},F=function(){return I.removeEventListener(C,Y)},q=new _({onFirstListenerAdd:H,onLastListenerRemove:F});return q.event}y.fromDOMEventEmitter=D;function T(I){var C=new _,W=!1;return I.then(void 0,function(){return null}).then(function(){W?C.fire(void 0):setTimeout(function(){return C.fire(void 0)},0)}),W=!0,C.event}y.fromPromise=T;function S(I){return new Promise(function(C){return f(I)(C)})}y.toPromise=S})(M||(M={}));var j=-1,U=function(){function y(f,m){m===void 0&&(m=Math.random().toString(18).slice(2,5)),this.customThreshold=f,this.name=m,this._warnCountdown=0}return y.prototype.dispose=function(){this._stacks&&this._stacks.clear()},y.prototype.check=function(f){var m=this,a=j;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||f<a)return;this._stacks||(this._stacks=new Map);var n=new Error().stack.split(`
`).slice(3).join(`
`),o=this._stacks.get(n)||0;if(this._stacks.set(n,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;var u,x=0;this._stacks.forEach(function(E,v){(!u||x<E)&&(u=v,x=E)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+f+" listeners already. MOST frequent listener ("+x+"):"),console.warn(u)}return function(){var E=m._stacks.get(n)||0;m._stacks.set(n,E-1)}},y}(),_=function(){function y(f){this._disposed=!1,this._options=f,this._leakageMon=j>0?new U(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(y.prototype,"event",{get:function(){var f=this;return this._event||(this._event=function(m,a,n){f._listeners||(f._listeners=new z.a);var o=f._listeners.isEmpty();o&&f._options&&f._options.onFirstListenerAdd&&f._options.onFirstListenerAdd(f);var u=f._listeners.push(a?[m,a]:m);o&&f._options&&f._options.onFirstListenerDidAdd&&f._options.onFirstListenerDidAdd(f),f._options&&f._options.onListenerDidAdd&&f._options.onListenerDidAdd(f,m,a);var x;f._leakageMon&&(x=f._leakageMon.check(f._listeners.size));var E;return E={dispose:function(){if(x&&x(),E.dispose=y._noop,!f._disposed&&(u(),f._options&&f._options.onLastListenerRemove)){var v=f._listeners&&!f._listeners.isEmpty();v||f._options.onLastListenerRemove(f)}}},n instanceof P.b?n.add(E):Array.isArray(n)&&n.push(E),E}),this._event},enumerable:!0,configurable:!0}),y.prototype.fire=function(f){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new z.a);for(var m=this._listeners.iterator(),a=m.next();!a.done;a=m.next())this._deliveryQueue.push([a.value,f]);for(;this._deliveryQueue.size>0;){var n=this._deliveryQueue.shift(),o=n[0],u=n[1];try{typeof o=="function"?o.call(void 0,u):o[0].call(o[1],u)}catch(x){Object(ee.e)(x)}}}},y.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},y._noop=function(){},y}(),R=function(y){B(f,y);function f(m){var a=y.call(this,m)||this;return a._isPaused=0,a._eventQueue=new z.a,a._mergeFn=m&&m.merge,a}return f.prototype.pause=function(){this._isPaused++},f.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var m=this._eventQueue.toArray();this._eventQueue.clear(),y.prototype.fire.call(this,this._mergeFn(m))}else for(;!this._isPaused&&this._eventQueue.size!==0;)y.prototype.fire.call(this,this._eventQueue.shift())},f.prototype.fire=function(m){this._listeners&&(this._isPaused!==0?this._eventQueue.push(m):y.prototype.fire.call(this,m))},f}(_),c=function(){function y(){var f=this;this.hasListeners=!1,this.events=[],this.emitter=new _({onFirstListenerAdd:function(){return f.onFirstListenerAdd()},onLastListenerRemove:function(){return f.onLastListenerRemove()}})}return Object.defineProperty(y.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),y.prototype.add=function(f){var m=this,a={event:f,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var n=function(){m.hasListeners&&m.unhook(a);var o=m.events.indexOf(a);m.events.splice(o,1)};return Object(P.h)(Object(K.a)(n))},y.prototype.onFirstListenerAdd=function(){var f=this;this.hasListeners=!0,this.events.forEach(function(m){return f.hook(m)})},y.prototype.onLastListenerRemove=function(){var f=this;this.hasListeners=!1,this.events.forEach(function(m){return f.unhook(m)})},y.prototype.hook=function(f){var m=this;f.listener=f.event(function(a){return m.emitter.fire(a)})},y.prototype.unhook=function(f){f.listener&&f.listener.dispose(),f.listener=null},y.prototype.dispose=function(){this.emitter.dispose()},y}(),g=function(){function y(){this.buffers=[]}return y.prototype.wrapEvent=function(f){var m=this;return function(a,n,o){return f(function(u){var x=m.buffers[m.buffers.length-1];x?x.push(function(){return a.call(n,u)}):a.call(n,u)},void 0,o)}},y.prototype.bufferEvents=function(f){var m=[];this.buffers.push(m);var a=f();return this.buffers.pop(),m.forEach(function(n){return n()}),a},y}(),w=function(){function y(){var f=this;this.listening=!1,this.inputEvent=M.None,this.inputEventListener=P.a.None,this.emitter=new _({onFirstListenerDidAdd:function(){f.listening=!0,f.inputEventListener=f.inputEvent(f.emitter.fire,f.emitter)},onLastListenerRemove:function(){f.listening=!1,f.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(y.prototype,"input",{set:function(f){this.inputEvent=f,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=f(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),y.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},y}()},N0LK:function(et,de,N){"use strict";N.d(de,"x",function(){return ee}),N.d(de,"F",function(){return K}),N.d(de,"r",function(){return z}),N.d(de,"o",function(){return B}),N.d(de,"p",function(){return M}),N.d(de,"Q",function(){return j}),N.d(de,"K",function(){return _}),N.d(de,"k",function(){return R}),N.d(de,"N",function(){return c}),N.d(de,"m",function(){return g}),N.d(de,"l",function(){return w}),N.d(de,"I",function(){return y}),N.d(de,"H",function(){return f}),N.d(de,"q",function(){return m}),N.d(de,"t",function(){return a}),N.d(de,"D",function(){return n}),N.d(de,"e",function(){return o}),N.d(de,"f",function(){return u}),N.d(de,"B",function(){return x}),N.d(de,"C",function(){return E}),N.d(de,"n",function(){return O}),N.d(de,"O",function(){return p}),N.d(de,"c",function(){return h}),N.d(de,"d",function(){return s}),N.d(de,"z",function(){return l}),N.d(de,"A",function(){return D}),N.d(de,"u",function(){return T}),N.d(de,"E",function(){return I}),N.d(de,"G",function(){return C}),N.d(de,"i",function(){return Y}),N.d(de,"g",function(){return F}),N.d(de,"v",function(){return le}),N.d(de,"h",function(){return pe}),N.d(de,"y",function(){return Ae}),N.d(de,"w",function(){return Ge}),N.d(de,"a",function(){return Fe}),N.d(de,"P",function(){return Ue}),N.d(de,"L",function(){return _e}),N.d(de,"J",function(){return je}),N.d(de,"j",function(){return xe}),N.d(de,"M",function(){return he}),N.d(de,"s",function(){return te}),N.d(de,"b",function(){return ye});function ee(ae){return!ae||typeof ae!="string"?!0:ae.trim().length===0}function K(ae,oe,Se){Se===void 0&&(Se="0");for(var Me=""+ae,We=[Me],Ke=Me.length;Ke<oe;Ke++)We.push(Se);return We.reverse().join("")}var P=/{(\d+)}/g;function z(ae){for(var oe=[],Se=1;Se<arguments.length;Se++)oe[Se-1]=arguments[Se];return oe.length===0?ae:ae.replace(P,function(Me,We){var Ke=parseInt(We,10);return isNaN(Ke)||Ke<0||Ke>=oe.length?Me:oe[Ke]})}function B(ae){return ae.replace(/[<>&]/g,function(oe){switch(oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return oe}})}function M(ae){return ae.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function j(ae,oe){oe===void 0&&(oe=" ");var Se=U(ae,oe);return _(Se,oe)}function U(ae,oe){if(!ae||!oe)return ae;var Se=oe.length;if(Se===0||ae.length===0)return ae;for(var Me=0;ae.indexOf(oe,Me)===Me;)Me=Me+Se;return ae.substring(Me)}function _(ae,oe){if(!ae||!oe)return ae;var Se=oe.length,Me=ae.length;if(Se===0||Me===0)return ae;for(var We=Me,Ke=-1;!(Ke=ae.lastIndexOf(oe,We-1),Ke===-1||Ke+Se!==We);){if(Ke===0)return"";We=Ke}return ae.substring(0,We)}function R(ae){return ae.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function c(ae,oe){if(ae.length<oe.length)return!1;if(ae===oe)return!0;for(var Se=0;Se<oe.length;Se++)if(ae[Se]!==oe[Se])return!1;return!0}function g(ae,oe){var Se=ae.length-oe.length;return Se>0?ae.indexOf(oe,Se)===Se:Se===0?ae===oe:!1}function w(ae,oe,Se){if(Se===void 0&&(Se={}),!ae)throw new Error("Cannot create regex from empty string");oe||(ae=M(ae)),Se.wholeWord&&(/\B/.test(ae.charAt(0))||(ae="\\b"+ae),/\B/.test(ae.charAt(ae.length-1))||(ae=ae+"\\b"));var Me="";return Se.global&&(Me+="g"),Se.matchCase||(Me+="i"),Se.multiline&&(Me+="m"),Se.unicode&&(Me+="u"),new RegExp(ae,Me)}function y(ae){if(ae.source==="^"||ae.source==="^$"||ae.source==="$"||ae.source==="^\\s*$")return!1;var oe=ae.exec("");return!!(oe&&ae.lastIndex===0)}function f(ae){return(ae.global?"g":"")+(ae.ignoreCase?"i":"")+(ae.multiline?"m":"")+(ae.unicode?"u":"")}function m(ae){for(var oe=0,Se=ae.length;oe<Se;oe++){var Me=ae.charCodeAt(oe);if(Me!==32&&Me!==9)return oe}return-1}function a(ae,oe,Se){oe===void 0&&(oe=0),Se===void 0&&(Se=ae.length);for(var Me=oe;Me<Se;Me++){var We=ae.charCodeAt(Me);if(We!==32&&We!==9)return ae.substring(oe,Me)}return ae.substring(oe,Se)}function n(ae,oe){oe===void 0&&(oe=ae.length-1);for(var Se=oe;Se>=0;Se--){var Me=ae.charCodeAt(Se);if(Me!==32&&Me!==9)return Se}return-1}function o(ae,oe){return ae<oe?-1:ae>oe?1:0}function u(ae,oe){for(var Se=Math.min(ae.length,oe.length),Me=0;Me<Se;Me++){var We=ae.charCodeAt(Me),Ke=oe.charCodeAt(Me);if(We===Ke)continue;E(We)&&(We+=32),E(Ke)&&(Ke+=32);var Qe=We-Ke;if(Qe===0)continue;return x(We)&&x(Ke)?Qe:o(ae.toLowerCase(),oe.toLowerCase())}return ae.length<oe.length?-1:ae.length>oe.length?1:0}function x(ae){return ae>=97&&ae<=122}function E(ae){return ae>=65&&ae<=90}function v(ae){return x(ae)||E(ae)}function O(ae,oe){return ae.length===oe.length&&A(ae,oe)}function A(ae,oe,Se){Se===void 0&&(Se=ae.length);for(var Me=0;Me<Se;Me++){var We=ae.charCodeAt(Me),Ke=oe.charCodeAt(Me);if(We===Ke)continue;if(v(We)&&v(Ke)){var Qe=Math.abs(We-Ke);if(Qe!==0&&Qe!==32)return!1}else if(String.fromCharCode(We).toLowerCase()!==String.fromCharCode(Ke).toLowerCase())return!1}return!0}function p(ae,oe){var Se=oe.length;return oe.length>ae.length?!1:A(ae,oe,Se)}function h(ae,oe){var Se,Me=Math.min(ae.length,oe.length);for(Se=0;Se<Me;Se++)if(ae.charCodeAt(Se)!==oe.charCodeAt(Se))return Se;return Me}function s(ae,oe){var Se,Me=Math.min(ae.length,oe.length),We=ae.length-1,Ke=oe.length-1;for(Se=0;Se<Me;Se++)if(ae.charCodeAt(We-Se)!==oe.charCodeAt(Ke-Se))return Se;return Me}function l(ae){return 55296<=ae&&ae<=56319}function D(ae){return 56320<=ae&&ae<=57343}function T(ae,oe,Se){var Me=ae.charCodeAt(Se);if(l(Me)&&Se+1<oe){var We=ae.charCodeAt(Se+1);if(D(We))return(Me-55296<<10)+(We-56320)+65536}return Me}function S(ae,oe){var Se=ae.charCodeAt(oe-1);if(D(Se)&&oe>1){var Me=ae.charCodeAt(oe-2);if(l(Me))return(Me-55296<<10)+(Se-56320)+65536}return Se}function I(ae,oe){var Se=ue.getInstance(),Me=oe,We=ae.length,Ke=T(ae,We,oe);oe+=Ke>=65536?2:1;for(var Qe=Se.getGraphemeBreakType(Ke);oe<We;){var Ze=T(ae,We,oe),yt=Se.getGraphemeBreakType(Ze);if(ye(Qe,yt))break;oe+=Ze>=65536?2:1,Qe=yt}return oe-Me}function C(ae,oe){var Se=ue.getInstance(),Me=oe,We=S(ae,oe);oe-=We>=65536?2:1;for(var Ke=Se.getGraphemeBreakType(We);oe>0;){var Qe=S(ae,oe),Ze=Se.getGraphemeBreakType(Qe);if(ye(Ze,Ke))break;oe-=Qe>=65536?2:1,Ke=Ze}return Me-oe}var W=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function Y(ae){return W.test(ae)}var H=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function F(ae){return H.test(ae)}var q=/^[\t\n\r\x20-\x7E]*$/;function le(ae){return q.test(ae)}function pe(ae){for(var oe=0,Se=ae.length;oe<Se;oe++)if(Ae(ae.charCodeAt(oe)))return!0;return!1}function Ae(ae){return ae=+ae,ae>=11904&&ae<=55215||ae>=63744&&ae<=64255||ae>=65281&&ae<=65374}function Ge(ae){return ae>=127462&&ae<=127487||ae>=9728&&ae<=10175||ae>=127744&&ae<=128591||ae>=128640&&ae<=128764||ae>=128992&&ae<=129003||ae>=129280&&ae<=129535||ae>=129648&&ae<=129651||ae>=129656&&ae<=129666||ae>=129680&&ae<=129685}var Fe=String.fromCharCode(65279);function Ue(ae){return!!(ae&&ae.length>0&&ae.charCodeAt(0)===65279)}function _e(ae){return btoa(encodeURIComponent(ae))}function je(ae,oe){for(var Se="",Me=0;Me<oe;Me++)Se+=ae;return Se}function xe(ae,oe){return oe===void 0&&(oe=!1),ae?(oe&&(ae=ae.replace(/\\./g,"")),ae.toLowerCase()!==ae):!1}function he(ae){var oe=90-65+1;return ae=ae%(2*oe),ae<oe?String.fromCharCode(97+ae):String.fromCharCode(65+ae-oe)}function te(ae){var oe=ue.getInstance();return oe.getGraphemeBreakType(ae)}function ye(ae,oe){return ae===0?oe!==5&&oe!==7:ae===2&&oe===3?!1:ae===4||ae===2||ae===3||(oe===4||oe===2||oe===3)?!0:ae===8&&(oe===8||oe===9||oe===11||oe===12)||((ae===11||ae===9)&&(oe===9||oe===10)||((ae===12||ae===10)&&oe===10||(oe===5||oe===13||(oe===7||(ae===1||ae===13&&oe===14)))))?!1:!(ae===6&&oe===6)}var ue=function(){function ae(){this._data=Le()}return ae.getInstance=function(){return ae._INSTANCE||(ae._INSTANCE=new ae),ae._INSTANCE},ae.prototype.getGraphemeBreakType=function(oe){if(oe<32)return oe===10?3:oe===13?2:4;if(oe<127)return 0;for(var Se=this._data,Me=Se.length/3,We=1;We<=Me;)if(oe<Se[3*We])We=2*We;else if(oe>Se[3*We+1])We=2*We+1;else return Se[3*We+2];return 0},ae._INSTANCE=null,ae}();function Le(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},Nmxd:function(et,de){et.exports="data:image/png;base64,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"},NvD2:function(et,de,N){"use strict";N.d(de,"a",function(){return M});var ee=N("Kwbf");function K(j,U){var _=new Set;return j.forEach(function(R){U.has(R)||_.add(R)}),_}function P(j){var U=j||{},_=U.disabled,R=U.disableCheckbox,c=U.checkable;return!!(_||R)||c===!1}function z(j,U,_,R){for(var c=new Set(j),g=new Set,w=0;w<=_;w+=1){var y=U.get(w)||new Set;y.forEach(function(n){var o=n.key,u=n.node,x=n.children,E=x===void 0?[]:x;c.has(o)&&!R(u)&&E.filter(function(v){return!R(v.node)}).forEach(function(v){c.add(v.key)})})}for(var f=new Set,m=_;m>=0;m-=1){var a=U.get(m)||new Set;a.forEach(function(n){var o=n.parent,u=n.node;if(R(u)||!n.parent||f.has(n.parent.key))return;if(R(n.parent.node)){f.add(o.key);return}var x=!0,E=!1;(o.children||[]).filter(function(v){return!R(v.node)}).forEach(function(v){var O=v.key,A=c.has(O);x&&!A&&(x=!1),!E&&(A||g.has(O))&&(E=!0)}),x&&c.add(o.key),E&&g.add(o.key),f.add(o.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(K(g,c))}}function B(j,U,_,R,c){for(var g=new Set(j),w=new Set(U),y=0;y<=R;y+=1){var f=_.get(y)||new Set;f.forEach(function(o){var u=o.key,x=o.node,E=o.children,v=E===void 0?[]:E;!g.has(u)&&!w.has(u)&&!c(x)&&v.filter(function(O){return!c(O.node)}).forEach(function(O){g.delete(O.key)})})}w=new Set;for(var m=new Set,a=R;a>=0;a-=1){var n=_.get(a)||new Set;n.forEach(function(o){var u=o.parent,x=o.node;if(c(x)||!o.parent||m.has(o.parent.key))return;if(c(o.parent.node)){m.add(u.key);return}var E=!0,v=!1;(u.children||[]).filter(function(O){return!c(O.node)}).forEach(function(O){var A=O.key,p=g.has(A);E&&!p&&(E=!1),!v&&(p||w.has(A))&&(v=!0)}),E||g.delete(u.key),v&&w.add(u.key),m.add(u.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(K(w,g))}}function M(j,U,_,R){var c=[],g;R?g=R:g=P;var w=new Set(j.filter(function(a){var n=!!_[a];return n||c.push(a),n})),y=new Map,f=0;Object.keys(_).forEach(function(a){var n=_[a],o=n.level,u=y.get(o);u||(u=new Set,y.set(o,u)),u.add(n),f=Math.max(f,o)}),Object(ee.a)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map(function(a){return"'".concat(a,"'")}).join(", ")));var m;return U===!0?m=z(w,y,f,g):m=B(w,U.halfCheckedKeys,y,f,g),m}},OLES:function(et,de,N){"use strict";var ee=N("U8pU"),K=N("VTBJ"),P=N("Ff2n"),z=N("q1tI"),B=N("uciX"),M=N("7ixt"),j=function(w){var y=w.overlay,f=w.prefixCls,m=w.id,a=w.overlayInnerStyle;return z.createElement("div",{className:"".concat(f,"-inner"),id:m,role:"tooltip",style:a},typeof y=="function"?y():y)},U=j,_=function(w,y){var f=w.overlayClassName,m=w.trigger,a=m===void 0?["hover"]:m,n=w.mouseEnterDelay,o=n===void 0?0:n,u=w.mouseLeaveDelay,x=u===void 0?.1:u,E=w.overlayStyle,v=w.prefixCls,O=v===void 0?"rc-tooltip":v,A=w.children,p=w.onVisibleChange,h=w.afterVisibleChange,s=w.transitionName,l=w.animation,D=w.placement,T=D===void 0?"right":D,S=w.align,I=S===void 0?{}:S,C=w.destroyTooltipOnHide,W=C===void 0?!1:C,Y=w.defaultVisible,H=w.getTooltipContainer,F=w.overlayInnerStyle,q=Object(P.a)(w,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),le=Object(z.useRef)(null);Object(z.useImperativeHandle)(y,function(){return le.current});var pe=Object(K.a)({},q);"visible"in w&&(pe.popupVisible=w.visible);var Ae=function(){var je=w.arrowContent,xe=je===void 0?null:je,he=w.overlay,te=w.id;return[z.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},xe),z.createElement(U,{key:"content",prefixCls:O,id:te,overlay:he,overlayInnerStyle:F})]},Ge=!1,Fe=!1;if(typeof W=="boolean")Ge=W;else if(W&&Object(ee.a)(W)==="object"){var Ue=W.keepParent;Ge=Ue===!0,Fe=Ue===!1}return z.createElement(B.a,Object.assign({popupClassName:f,prefixCls:O,popup:Ae,action:a,builtinPlacements:M.a,popupPlacement:T,ref:le,popupAlign:I,getPopupContainer:H,onPopupVisibleChange:p,afterPopupVisibleChange:h,popupTransitionName:s,popupAnimation:l,defaultPopupVisible:Y,destroyPopupOnHide:Ge,autoDestroy:Fe,mouseLeaveDelay:x,popupStyle:E,mouseEnterDelay:o},pe),A)},R=Object(z.forwardRef)(_),c=de.a=R},OZM5:function(et,de,N){"use strict";N.d(de,"b",function(){return R}),N.d(de,"a",function(){return c}),N.d(de,"k",function(){return g}),N.d(de,"h",function(){return w}),N.d(de,"i",function(){return y}),N.d(de,"g",function(){return f}),N.d(de,"c",function(){return m}),N.d(de,"d",function(){return a}),N.d(de,"j",function(){return u}),N.d(de,"e",function(){return x}),N.d(de,"f",function(){return E});var ee=N("KQm4"),K=N("U8pU"),P=N("Ff2n"),z=N("q1tI"),B=N.n(z),M=N("Kwbf"),j=N("WaYH"),U=.25,_=2;function R(v,O){var A=v.slice(),p=A.indexOf(O);return p>=0&&A.splice(p,1),A}function c(v,O){var A=v.slice();return A.indexOf(O)===-1&&A.push(O),A}function g(v){return v.split("-")}function w(v,O){return"".concat(v,"-").concat(O)}function y(v){return v&&v.type&&v.type.isTreeNode}function f(v,O){var A=[v],p=O[v];function h(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(l){var D=l.key,T=l.children;A.push(D),h(T)})}return h(p.children),A}function m(v,O){var A=v.clientY,p=O.selectHandle.getBoundingClientRect(),h=p.top,s=p.bottom,l=p.height,D=Math.max(l*U,_);return A<=h+D?-1:A>=s-D?1:0}function a(v,O){if(!v)return;var A=O.multiple;return A?v.slice():v.length?[v[0]]:v}var n=function(O){return O};function o(v,O){if(!v)return[];var A=O||{},p=A.processProps,h=p===void 0?n:p,s=Array.isArray(v)?v:[v];return s.map(function(l){var D=l.children,T=Object(P.a)(l,["children"]),S=o(D,O);return B.a.createElement(j.a,Object.assign({},h(T)),S)})}function u(v){if(!v)return null;var O;if(Array.isArray(v))O={checkedKeys:v,halfCheckedKeys:void 0};else if(Object(K.a)(v)==="object")O={checkedKeys:v.checked||void 0,halfCheckedKeys:v.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function x(v,O){var A=new Set;function p(h){if(A.has(h))return;var s=O[h];if(!s)return;A.add(h);var l=s.parent,D=s.node;if(D.disabled)return;l&&p(l.key)}return(v||[]).forEach(function(h){p(h)}),Object(ee.a)(A)}function E(v){var O={};return Object.keys(v).forEach(function(A){(A.startsWith("data-")||A.startsWith("aria-"))&&(O[A]=v[A])}),O}},Ohmc:function(et,de,N){et.exports=N.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(et,de,N){"use strict";var ee=N("2qtc"),K=N("kLXV"),P=N("rAM+"),z=N("miYZ"),B=N("tsqr"),M=N("9og8"),j=N("tJVT"),U=N("jrin"),_=N("WmNS"),R=N.n(_),c=N("q1tI"),g=N.n(c),w=N("VrN/"),y=N.n(w),f=N("bdgK"),m=N("p77/"),a=N("Bd2K"),n=N("ELLl"),o=N("19Vz"),u=N("lZu9"),x=N("+NIl"),E=N("kSUc"),v=N("9Bee"),O=function(Ie){var ut=Ie.value,bt=ut===void 0?"":ut,Tt=Ie.className,xt=Ie.showTextOnly,gt=Ie.showLines,qe=Ie.style,Xe=qe===void 0?{}:qe,Pe=Object(c.useMemo)(function(){return""},[bt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:Pe}}))},A=N("0Owb"),p=N("dejd"),h=N("C+DQ"),s=N("1vsH"),l=N("m3rI"),D=[{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 T(Ie){var ut=Ie.onActionCallback,bt=Ie.title,Tt=Ie.icon,xt=Ie.actionName,gt=Ie.className,qe=gt===void 0?"":gt,Xe=Ie.children;function Pe(){ut(xt)}return g.a.createElement("a",{title:bt,className:qe,onClick:Pe},g.a.createElement("i",{className:"md-iconfont ".concat(Tt)}),Xe)}var S=function(Ie){var ut=Ie.watch,bt=Ie.showNullButton,Tt=Ie.onActionCallback,xt=Ie.fullScreen,gt=Ie.insertTemp,qe=Ie.hidetoolBar,Xe=Ie.uuid,Pe=Ie.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.D)("_educoder_session"),"&key=").concat(Xe,"&api=").concat(encodeURIComponent(l.a.PROXY_SERVER)));var se=[].concat(D,[{title:"".concat(ut?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ut?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!qe&&se.map(function(fe,$e){return g.a.createElement("li",{key:$e},fe.actionName?g.a.createElement(T,Object(A.a)({},fe,{onActionCallback:Tt})):g.a.createElement("span",{className:"v-line"}))}),bt?g.a.createElement("li",null,g.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Tt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,gt&&g.a.createElement("li",null,g.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(gt),onActionCallback:Tt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(T,{icon:"".concat(xt?"icon-shrink":"icon-enlarge"),title:xt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Tt})))},I=N("M8RZ"),C=N("+L6B"),W=N("2/Rp"),Y=N("y8nQ"),H=N("Vl3Y"),F=N("5NDa"),q=N("5rEg"),le={labelCol:{span:4},wrapperCol:{span:20}},pe=function(Ie){var ut=Ie.callback,bt=Ie.onCancel;function Tt(xt){ut(xt)}return g.a.createElement(H.a,Object(A.a)({},le,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Tt}),g.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(q.a,null)),g.a.createElement(H.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(q.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(W.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},Ae=N("7ahc"),Ge=N("k1fw"),Fe=N("HmJG"),Ue=N("BjJ7"),_e=H.a.useForm,je={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}},he=function(Ie){var ut=Ie.callback,bt=Ie.onCancel,Tt=_e(),xt=Object(j.a)(Tt,1),gt=xt[0],qe=Object(c.useRef)();function Xe(fe){ut(Object(Ge.a)(Object(Ge.a)({},fe),{},{name:qe.current}))}function Pe(fe,$e){gt.setFieldsValue({src:"/api/attachments/".concat(fe.id,"?type=").concat(fe.content_type),type:$e.type})}function se(fe){var $e=fe.target.files[0];qe.current=$e.name,ye($e,Pe)}return g.a.createElement(H.a,Object(A.a)({form:gt},xe,{className:"upload-image-panel",onFinish:Xe}),g.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(H.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},g.a.createElement(q.a,{style:je})),g.a.createElement(te,{onFileChange:se}))),g.a.createElement(H.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},g.a.createElement(q.a,{style:{width:264}})),g.a.createElement(H.a.Item,{style:{textAlign:"right"}},g.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(W.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))};function te(Ie){var ut=Ie.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:ut}))}function ye(Ie,ut){if(!Ie)throw new String("\u6CA1\u6709\u6587\u4EF6");var bt=new FormData;bt.append("editormd-image-file",Ie),bt.append("file_param_name","editormd-image-file"),bt.append("byxhr","true");var Tt=new window.XMLHttpRequest;Tt.withCredentials=!0,Tt.addEventListener("load",function(xt){ut(JSON.parse(xt.target.responseText),Ie)},!1),Tt.addEventListener("error",function(xt){console.error(xt)},!1),Tt.open("POST","".concat(Ue.a,"/api/attachments.json")),Tt.send(bt)}var ue=N("giR+"),Le=N("fyUT"),ae=N("7Kak"),oe=N("9yH6"),Se=oe.a.Group,Me={margin:"0 8px"},We=function(Ie){var ut=Ie.callback,bt=Ie.onCancel;function Tt(xt){ut(xt)}return g.a.createElement(H.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Tt},g.a.createElement("div",{className:"flex-container"},g.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:Me},"\u884C\u6570"),g.a.createElement(H.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(Le.a,null)),g.a.createElement("span",{style:Me},"\u5217\u6570"),g.a.createElement(H.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(Le.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12}},g.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(H.a.Item,{name:"align"},g.a.createElement(Se,null,g.a.createElement(oe.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(oe.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(oe.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(oe.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(W.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},Ke=N("ErOA"),Qe=N("7Cbv"),Ze="link",yt="upload-image",vt="code-block",dt="add-table",pt="------------",At={default:pt,left:":".concat(pt),center:":".concat(pt,":"),right:"".concat(pt,":")},wt=N("9VGf"),Oe,we;function Je(){}var st=0,He=1e4,nt="\u2581",Te=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ge(Ie){return/^\d+$/.test(Ie)?"".concat(Ie,"px"):Ie}var be=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=be?"Cmd":"Ctrl",ie=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ce=(Oe={},Object(U.a)(Oe,re+"-B","bold"),Object(U.a)(Oe,re+"-I","italic"),Oe),Ee=(we={},Object(U.a)(we,Ze,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(we,vt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(we,yt,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(we,dt,"\u6DFB\u52A0\u8868\u683C"),we),Be=de.a=function(Ie){var ut=Ie.defaultValue,bt=ut===void 0?"":ut,Tt=Ie.onChange,xt=Ie.width,gt=xt===void 0?"100%":xt,qe=Ie.height,Xe=qe===void 0?400:qe,Pe=Ie.miniToolbar,se=Pe===void 0?!1:Pe,fe=Ie.isFocus,$e=fe===void 0?!1:fe,ke=Ie.watch,it=Ie.insertTemp,at=Ie.mode,Ne=at===void 0?"markdown":at,Ve=Ie.id,tt=Ve===void 0?"markdown-editor-id":Ve,ft=Ie.showResizeBar,Ct=ft===void 0?!1:ft,zt=Ie.noStorage,qt=zt===void 0?!1:zt,Qt=Ie.showNullButton,St=Qt===void 0?!1:Qt,ln=Ie.hidetoolBar,Bt=ln===void 0?!1:ln,Yt=Ie.fullScreen,Mt=Yt===void 0?!1:Yt,tn=Ie.onBlur,mn=Ie.onCMBeforeChange,An=Ie.onFullScreen,lt=Ie.className,Rt=lt===void 0?"":lt,Jt=Ie.disablePaste,nn=Jt===void 0?!1:Jt,un=Ie.placeholder,cn=un===void 0?"":un,G=Ie.values,b=G===void 0?"":G,L=Object(c.useState)(null),V=Object(j.a)(L,2),J=V[0],Q=V[1],De=Object(c.useState)(bt),ot=Object(j.a)(De,2),Ot=ot[0],Ft=ot[1],ve=Object(c.useState)(ke),Gt=Object(j.a)(ve,2),en=Gt[0],Tn=Gt[1],Wn=Object(c.useState)(Mt),tr=Object(j.a)(Wn,2),Rn=tr[0],or=tr[1],fr=Object(c.useState)(""),Vn=Object(j.a)(fr,2),sr=Vn[0],Jn=Vn[1],Mr=Object(c.useState)(0),Xn=Object(j.a)(Mr,2),Ir=Xn[0],yr=Xn[1],Tr=Object(c.useState)(Xe),Yr=Object(j.a)(Tr,2),br=Yr[0],nr=Yr[1],Ur=Object(c.useState)(!1),_r=Object(j.a)(Ur,2),Fr=_r[0],Sn=_r[1],hn=Object(c.useRef)(Object(Qe.a)()),kn=Object(c.useRef)(!1),yn=Object(c.useRef)(),Ln=Object(c.useRef)(),bn=Object(c.useRef)(),wr=Object(c.useRef)(),Bn=Object(c.useRef)(),Qn=function(){var Xt=Object(M.a)(R.a.mark(function on(){var $t,dn;return R.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(Ke.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:hn.current}});case 2:dn=wn.sent,dn!=null&&($t=dn.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",J,Ln),dn.attachments.map(function(gn){gn.content_type.indexOf("image")>-1?J.replaceSelection("![,](/api/attachments/".concat(gn.id,"?type=").concat(gn.content_type,")")):gn.content_type.indexOf("video")>-1?J.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):gn.content_type.indexOf("pdf")>-1?J.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,'&disposition=inline" target="_blank">').concat(gn.name,"</a>")):J.replaceSelection("[".concat(gn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(gn.id,"?type=").concat(gn.content_type,")"))}));case 4:case"end":return wn.stop()}},on)}));return function(){return Xt.apply(this,arguments)}}();Object(c.useEffect)(function(){Ft(b),J==null||J.setValue(b)},[b]),Object(c.useEffect)(function(){An==null||An(Rn)},[Rn]),Object(c.useEffect)(function(){if(Ln.current){var Xt=y.a.fromTextArea(Ln.current,{mode:Ne,lineNumbers:!se,lineWrapping:!0,value:bt,autoCloseTags:!0,autoCloseBrackets:!0});$e&&Xt.focus();function on($t,dn){if(nn){dn.preventDefault();return}var En=dn.clipboardData;if(En){var wn=En.types.toString(),gn=En.items;if(wn==="Files"||En.types.indexOf("Files")>-1){if(dn.preventDefault(),Ne=="stex")return;try{var xn,Hn=gn[1];((xn=gn[0])===null||xn===void 0?void 0:xn.kind)==="file"&&(Hn=gn[0]);var fn=Hn.getAsFile(),Pr=fn.name.split(".").pop();ye(fn,function(Ht){if(Ht.id){var _n,pr,lr;(fn==null||((_n=fn.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Xt.replaceSelection("![,](/api/attachments/".concat(Ht.id,"?type=").concat(Ht.content_type,")")):(fn==null||((pr=fn.type)===null||pr===void 0)?void 0:pr.indexOf("video"))>-1?Xt.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,'"></video>')):(fn==null||((lr=fn.type)===null||lr===void 0)?void 0:lr.indexOf("pdf"))>-1?Xt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ie.includes(Pr)?Xt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Xt.replaceSelection("[".concat(fn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(Ht.content_type,")"))}else(Ht==null?void 0:Ht.status)===401&&(document.location.href="/user/login")})}catch(Ht){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Xt.on("paste",on),Xt.on("dragleave",function($t,dn){bn.current.classList.remove("mouse-hover-md")}),Xt.on("dragover",function($t,dn){bn.current.classList.add("mouse-hover-md")}),Xt.on("drop",function($t,dn){bn.current.classList.add("mouse-hover-md");var En;if(En=dn.dataTransfer.files,En.length>0){dn.preventDefault(),dn.stopPropagation();for(var wn=function(Hn){var fn=En[Hn],Pr=fn.name.split(".").pop();ye(fn,function(Ht){if(Ht.id){var _n,pr,lr;(fn==null||((_n=fn.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Xt.replaceSelection("![,](/api/attachments/".concat(Ht.id,"?type=").concat(Ht.content_type,")")):(fn==null||((pr=fn.type)===null||pr===void 0)?void 0:pr.indexOf("video"))>-1?Xt.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,'"></video>')):(fn==null||((lr=fn.type)===null||lr===void 0)?void 0:lr.indexOf("pdf"))>-1?Xt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ie.includes(Pr)?Xt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Xt.replaceSelection("[".concat(fn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Ht.id,"?type=").concat(Ht.content_type,")"))}else(Ht==null?void 0:Ht.status)===401&&(document.location.href="/user/login")})},gn=0;gn<En.length;gn++)wn(gn)}}),Q(Xt),function(){Xt.off("paste",on)}}},[]);var zr=Object(c.useCallback)(function(){if(bn.current)try{}catch(Xt){console.log(Xt,"---- to set md editor body height")}},[br,bn,Rn]);Object(c.useEffect)(function(){function Xt(){var $t=new f.default(function(dn){var En=Object(P.a)(dn),wn;try{for(En.s();!(wn=En.n()).done;){var gn=wn.value;(gn.target.offsetHeight>0||gn.target.offsetWidth>0)&&(zr(),J.setSize("100%","100%"),J.refresh())}}catch(xn){En.e(xn)}finally{En.f()}});return $t.observe(Ln.current.parentElement),$t}if(J){var on=Xt();return function(){on.unobserve(Ln.current.parentElement)}}},[J,zr]),Object(c.useEffect)(function(){if(J){for(var Xt=[],on=function(){var gn=dn[$t];En=Object(j.a)(gn,2);var xn=En[0],Hn=En[1],fn=Object(U.a)({},xn,function(){jr(Hn)});Xt.push(fn),J.addKeyMap(fn)},$t=0,dn=Object.entries(ce);$t<dn.length;$t++){var En;on()}return yn.current=setInterval(function(){kn.current&&Qn()},4e3),function(){clearInterval(yn.current);var wn=Object(P.a)(Xt),gn;try{for(wn.s();!(gn=wn.n()).done;){var xn=gn.value;J.removeKeyMap(xn)}}catch(Hn){wn.e(Hn)}finally{wn.f()}}}},[J]),Object(c.useEffect)(function(){Mt!==Rn&&or(Mt)},[Mt]),Object(wt.a)(function(){if(!qt&&Ir>0){var Xt=new Date().getTime(),on=window.sessionStorage.getItem(tt);Xt>=Ir+He&&(!on||on!==Ot)&&(window.sessionStorage.setItem(tt,Ot),Sn(!0))}},He),Object(c.useEffect)(function(){Tn(ke)},[J,ke]),Object(c.useEffect)(function(){J&&($e&&J.focus())},[J,$e]),Object(c.useEffect)(function(){if(en&&J){var Xt=J.getScrollerElement();function on($t){var dn=$t.target;if(Bn.current){var En=dn.scrollTop/dn.scrollHeight;Bn.current.scrollTop=Bn.current.scrollHeight*En}}return Xt.addEventListener("scroll",on),function(){Xt.removeEventListener("scroll",on)}}},[J,en]),Object(c.useEffect)(function(){if(J&&mn){function Xt(on,$t){mn(on,$t)}return J.on("beforeChange",Xt),function(){J.off("beforeChange",Xt)}}},[J,mn]),Object(c.useEffect)(function(){if(J&&tn){function Xt(){tn(J.getValue())}return J.on("blur",Xt),function(){J.off("blur",Xt)}}},[J,tn]),Object(c.useEffect)(function(){if(J){function Xt(on){var $t=on.getValue();Ft($t),yr(new Date().getTime()),on.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Tt&&Tt($t)}return J.on("change",Xt),function(){J.off("change",Xt)}}},[J,Tt]),Object(c.useEffect)(function(){J&&(bt==null?(J.setValue(""),Ft("")):bt!==J.getValue()&&(J.setValue(bt),Ft(bt),J.setCursor(J.lineCount(),0)))},[J,bt]);var jr=Object(c.useCallback)(function(Xt){var on=J.getCursor(),$t=J.getSelection(),dn=$t.split(`
`);switch(Xt){case"bold":return J.replaceSelection("**"+$t+"**"),$t===""&&J.setCursor(on.line,on.ch+2),J.focus();case"italic":return J.replaceSelection("*"+$t+"*"),$t===""&&J.setCursor(on.line,on.ch+1),J.focus();case"code":return J.replaceSelection("`"+$t+"`"),$t===""&&J.setCursor(on.line,on.ch+1),J.focus();case"inline-latex":return J.replaceSelection("`$$"+$t+"$$`"),$t===""&&J.setCursor(on.line,on.ch+3),J.focus();case"latex":return J.replaceSelection("```latex\n"+$t+"\n```"),J.setCursor(on.line+1,$t.length+1),J.focus();case"line-break":return J.replaceSelection(`<br/>
`),J.focus();case"list-ul":return $t===""?J.replaceSelection("- "+$t):J.replaceSelection(dn.map(function(En){return En===""?"":"- ".concat(En)}).join(`
`)),J.focus();case"list-ol":return $t===""?J.replaceSelection("1. "+$t):J.replaceSelection(dn.map(function(En,wn){return En===""?"":"".concat(wn+1,". ").concat(En)}).join(`
`)),J.focus();case"add-null-ch":return $t===""&&J.setCursor(on.line,on.ch+1),J.replaceSelection(nt),J.focus();case"inster-template-1":return $t===""&&J.setCursor(on.line,on.ch),J.replaceSelection(Te),J.focus();case"eraser":return J.setValue(""),J.focus();case"trigger-watch":return Tn(!en),J.focus();case"trigger-full-screen":return or(!Rn),J.focus();case Ze:Jn(Ze);return;case vt:Jn(vt);return;case yt:Jn(yt);return;case dt:Jn(dt);return;default:throw new Error}},[J,en,Rn]),Dr=Object(c.useCallback)(function(Xt){Jn("");switch(sr){case Ze:var on=Xt.title,$t=Xt.link;return J.replaceSelection("[".concat(on,"](").concat($t,")")),J.focus();case vt:var dn=Xt.language,En=Xt.content;return J.replaceSelection(["```"+dn,En,"```"].join(`
`)),J.focus();case yt:var wn=Xt.src,gn=Xt.alt,xn=Xt.name;return wn.indexOf("type=image")>-1?J.replaceSelection("![ ".concat(gn||""," ]( ").concat(wn,' "').concat(gn||"",'" )')):wn.indexOf("type=application/pdf")>-1?J.replaceSelection('<a href="'.concat(wn,'&disposition=inline" target="_blank">').concat(xn,"</a>")):J.replaceSelection('<a href="'.concat(wn,'" target="_blank">').concat(xn,"</a>")),J.focus();case dt:for(var Hn=Xt.row,fn=Xt.col,Pr=Xt.align,Ht=`
`,_n=0;_n<Hn;_n++){for(var pr=[],lr=[],Kt=0;Kt<fn;Kt++)_n===1&&lr.push(At[Pr]),pr.push(" ");_n===1&&(Ht+="| ".concat(lr.join(" | "),` |
`)),Ht+="| ".concat(pr.join(fn===1?"":" | "),` |
`)}return J.replaceSelection(Ht+`
`),J.focus();default:throw new Error}},[J,sr]),Jr=Object(c.useMemo)(function(){switch(sr){case Ze:return g.a.createElement(pe,{callback:Dr,onCancel:rr});case vt:return g.a.createElement(Ae.b,{callback:Dr,onCancel:rr});case yt:return g.a.createElement(he,{callback:Dr,onCancel:rr});case dt:return g.a.createElement(We,{callback:Dr,onCancel:rr});default:return null}},[sr]);function rr(){Jn("")}Object(c.useEffect)(function(){if(wr.current){var Xt=wr.current,on=!1,$t=0;function dn(gn){on=!0,$t=gn.pageY}function En(){on=!1}function wn(gn){if(on){var xn=gn.pageY-$t;xn<0&&(xn=0),xn>300&&(xn=300);var Hn=Xe+xn+"px";nr(Hn)}}return Xt.addEventListener("mousedown",dn),document.addEventListener("mousemove",wn),document.addEventListener("mouseup",En),function(){Xt.removeEventListener("mousedown",dn),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",En)}}},[J,wr]),Object(c.useEffect)(function(){nr(Xe)},[Xe]);var Wr=ge(gt),Er=ge(br),Hr={width:Wr,height:Er},Zr=Object(c.useMemo)(function(){if(Ir){var Xt=new Date(Ir),on=Xt.getHours(),$t=Xt.getMinutes(),dn=Xt.getSeconds();return on=on<10?"0"+on:on,$t=$t<10?"0"+$t:$t,dn=dn<10?"0"+dn:dn,"".concat(on,":").concat($t,":").concat(dn)}return 0},[Ir]);function ir(){window.sessionStorage.removeItem(tt),Sn(!1),yr(0)}function ri(){Sn(!1),yr(0),J.setValue(window.sessionStorage.getItem(tt))}function ii(Xt,on){var $t=J.getValue();$t=$t.replace(Xt,on),Ft($t),J==null||J.setValue($t)}return g.a.createElement(c.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:bn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Rt," ").concat(en?"on-preview":""," ").concat(se?"mini":""," ").concat(Rn?"full-screen":""),style:Hr},g.a.createElement(S,{insertTemp:it,watch:en,fullScreen:Rn,showNullButton:St,onActionCallback:jr,hidetoolBar:Bt,uuid:hn.current,setOpenPhones:function(){kn.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:Ln,placeholder:cn})),en?g.a.createElement("div",{ref:Bn,className:"preview-container"},Ne==="stex"&&g.a.createElement(O,{value:Ot}),Ne!=="stex"&&g.a.createElement(v.a,{edit:!0,value:Ot,replaces:ii})):null))),Ct?g.a.createElement("a",{ref:wr,className:"editor-resize"}):null,g.a.createElement(I.a,null,Ee[sr]?g.a.createElement(K.a,{centered:!0,title:Ee[sr],visible:!0,onCancel:rr,footer:null},Jr):null))}},QDVR:function(et,de,N){"use strict";N.d(de,"e",function(){return K}),N.d(de,"d",function(){return P}),N.d(de,"c",function(){return j}),N.d(de,"b",function(){return U}),N.d(de,"a",function(){return R});var ee=function(){var c=function(g,w){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var m in f)f.hasOwnProperty(m)&&(y[m]=f[m])},c(g,w)};return function(g,w){c(g,w);function y(){this.constructor=g}g.prototype=w===null?Object.create(w):(y.prototype=w.prototype,new y)}}();function K(c){var g=[];return c.forEach(function(w){return g.push(w)}),g}function P(c){var g=[];return c.forEach(function(w,y){return g.push(y)}),g}var z=function(){function c(){this._value="",this._pos=0}return c.prototype.reset=function(g){return this._value=g,this._pos=0,this},c.prototype.next=function(){return this._pos+=1,this},c.prototype.hasNext=function(){return this._pos<this._value.length-1},c.prototype.cmp=function(g){var w=g.charCodeAt(0),y=this._value.charCodeAt(this._pos);return w-y},c.prototype.value=function(){return this._value[this._pos]},c}(),B=function(){function c(g){g===void 0&&(g=!0),this._splitOnBackslash=g}return c.prototype.reset=function(g){return this._value=g.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},c.prototype.hasNext=function(){return this._to<this._value.length},c.prototype.next=function(){this._from=this._to;for(var g=!0;this._to<this._value.length;this._to++){var w=this._value.charCodeAt(this._to);if(w===47||this._splitOnBackslash&&w===92)if(g)this._from++;else break;else g=!1}return this},c.prototype.cmp=function(g){for(var w=0,y=g.length,f=this._from;w<y&&f<this._to;){var m=g.charCodeAt(w)-this._value.charCodeAt(f);if(m!==0)return m;w+=1,f+=1}return y===this._to-this._from?0:w<y?-1:1},c.prototype.value=function(){return this._value.substring(this._from,this._to)},c}(),M=function(){function c(){}return c}(),j=function(){function c(g){this._iter=g}return c.forPaths=function(){return new c(new B)},c.forStrings=function(){return new c(new z)},c.prototype.clear=function(){this._root=void 0},c.prototype.set=function(g,w){var y=this._iter.reset(g),f;for(this._root||(this._root=new M,this._root.segment=y.value()),f=this._root;;){var m=y.cmp(f.segment);if(m>0)f.left||(f.left=new M,f.left.segment=y.value()),f=f.left;else if(m<0)f.right||(f.right=new M,f.right.segment=y.value()),f=f.right;else if(y.hasNext())y.next(),f.mid||(f.mid=new M,f.mid.segment=y.value()),f=f.mid;else break}var a=f.value;return f.value=w,f.key=g,a},c.prototype.get=function(g){for(var w=this._iter.reset(g),y=this._root;y;){var f=w.cmp(y.segment);if(f>0)y=y.left;else if(f<0)y=y.right;else if(w.hasNext())w.next(),y=y.mid;else break}return y?y.value:void 0},c.prototype.findSubstr=function(g){for(var w=this._iter.reset(g),y=this._root,f=void 0;y;){var m=w.cmp(y.segment);if(m>0)y=y.left;else if(m<0)y=y.right;else if(w.hasNext())w.next(),f=y.value||f,y=y.mid;else break}return y&&y.value||f},c.prototype.forEach=function(g){this._forEach(this._root,g)},c.prototype._forEach=function(g,w){g&&(this._forEach(g.left,w),g.value&&w(g.value,g.key),this._forEach(g.mid,w),this._forEach(g.right,w))},c}(),U=function(){function c(){this.map=new Map,this.ignoreCase=!1}return c.prototype.set=function(g,w){this.map.set(this.toKey(g),w)},c.prototype.get=function(g){return this.map.get(this.toKey(g))},c.prototype.toKey=function(g){var w=g.toString();return this.ignoreCase&&(w=w.toLowerCase()),w},c}(),_=function(){function c(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return c.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),c.prototype.get=function(g,w){w===void 0&&(w=0);var y=this._map.get(g);return y?(w!==0&&this.touch(y,w),y.value):void 0},c.prototype.set=function(g,w,y){y===void 0&&(y=0);var f=this._map.get(g);if(f)f.value=w,y!==0&&this.touch(f,y);else{f={key:g,value:w,next:void 0,previous:void 0};switch(y){case 0:this.addItemLast(f);break;case 1:this.addItemFirst(f);break;case 2:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(g,f),this._size++}},c.prototype.delete=function(g){return!!this.remove(g)},c.prototype.remove=function(g){var w=this._map.get(g);return w?(this._map.delete(g),this.removeItem(w),this._size--,w.value):void 0},c.prototype.forEach=function(g,w){for(var y=this._head;y;)w?g.bind(w)(y.value,y.key,this):g(y.value,y.key,this),y=y.next},c.prototype.trimOld=function(g){if(g>=this.size)return;if(g===0){this.clear();return}for(var w=this._head,y=this.size;w&&y>g;)this._map.delete(w.key),w=w.next,y--;this._head=w,this._size=y,w&&(w.previous=void 0)},c.prototype.addItemFirst=function(g){if(!this._head&&!this._tail)this._tail=g;else if(this._head)g.next=this._head,this._head.previous=g;else throw new Error("Invalid list");this._head=g},c.prototype.addItemLast=function(g){if(!this._head&&!this._tail)this._head=g;else if(this._tail)g.previous=this._tail,this._tail.next=g;else throw new Error("Invalid list");this._tail=g},c.prototype.removeItem=function(g){if(g===this._head&&g===this._tail)this._head=void 0,this._tail=void 0;else if(g===this._head){if(!g.next)throw new Error("Invalid list");g.next.previous=void 0,this._head=g.next}else if(g===this._tail){if(!g.previous)throw new Error("Invalid list");g.previous.next=void 0,this._tail=g.previous}else{var w=g.next,y=g.previous;if(!w||!y)throw new Error("Invalid list");w.previous=y,y.next=w}g.next=void 0,g.previous=void 0},c.prototype.touch=function(g,w){if(!this._head||!this._tail)throw new Error("Invalid list");if(w!==1&&w!==2)return;if(w===1){if(g===this._head)return;var y=g.next,f=g.previous;g===this._tail?(f.next=void 0,this._tail=f):(y.previous=f,f.next=y),g.previous=void 0,g.next=this._head,this._head.previous=g,this._head=g}else if(w===2){if(g===this._tail)return;var y=g.next,f=g.previous;g===this._head?(y.previous=void 0,this._head=y):(y.previous=f,f.next=y),g.next=void 0,g.previous=this._tail,this._tail.next=g,this._tail=g}},c.prototype.toJSON=function(){var g=[];return this.forEach(function(w,y){g.push([y,w])}),g},c}(),R=function(c){ee(g,c);function g(w,y){y===void 0&&(y=1);var f=c.call(this)||this;return f._limit=w,f._ratio=Math.min(Math.max(0,y),1),f}return g.prototype.get=function(w){return c.prototype.get.call(this,w,2)},g.prototype.peek=function(w){return c.prototype.get.call(this,w,0)},g.prototype.set=function(w,y){c.prototype.set.call(this,w,y,2),this.checkTrim()},g.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},g}(_)},RMFE:function(et,de){et.exports="data:image/png;base64,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"},"SA+Z":function(et,de,N){var ee=N("wTVA"),K=N("EbDI"),P=N("ZhPi"),z=N("wkBT");function B(M){return ee(M)||K(M)||P(M)||z()}et.exports=B,et.exports.__esModule=!0,et.exports.default=et.exports},SJMd:function(et,de){/**
* @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 N,ee,K,P=!1,z,B;window.PR_SHOULD_USE_CONTINUATION=!0;var M,j;(function(){var U=window,_=["break,continue,do,else,for,if,return,while"],R=[_,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],c=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[c,"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"],w=[c,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],y=[c,"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"],f="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",m=[c,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",n=[_,"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"],o=[_,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],u=[_,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],x=[g,y,w,m,a,n,o,u],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,v="str",O="kwd",A="com",p="typ",h="lit",s="pun",l="pln",D="tag",T="dec",S="src",I="atn",C="atv",W="nocode",Y="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(oe){for(var Se=0,Me=!1,We=!1,Ke=0,Qe=oe.length;Ke<Qe;++Ke){var Ze=oe[Ke];if(Ze.ignoreCase)We=!0;else if(/[a-z]/i.test(Ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Me=!0,We=!1;break}}var yt={b:8,t:9,n:10,v:11,f:12,r:13};function vt(Oe){var we=Oe.charCodeAt(0);if(we!==92)return we;var Je=Oe.charAt(1);return we=yt[Je],we||("0"<=Je&&Je<="7"?parseInt(Oe.substring(1),8):Je==="u"||Je==="x"?parseInt(Oe.substring(2),16):Oe.charCodeAt(1))}function dt(Oe){if(Oe<32)return(Oe<16?"\\x0":"\\x")+Oe.toString(16);var we=String.fromCharCode(Oe);return we==="\\"||we==="-"||we==="]"||we==="^"?"\\"+we:we}function pt(Oe){var we=Oe.substring(1,Oe.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")),Je=[],st=we[0]==="^",He=["["];st&&He.push("^");for(var nt=st?1:0,Te=we.length;nt<Te;++nt){var ge=we[nt];if(/\\[bdsw]/i.test(ge))He.push(ge);else{var be=vt(ge),re;nt+2<Te&&we[nt+1]==="-"?(re=vt(we[nt+2]),nt+=2):re=be,Je.push([be,re]),re<65||be>122||(re<65||be>90||Je.push([Math.max(65,be)|32,Math.min(re,90)|32]),re<97||be>122||Je.push([Math.max(97,be)&~32,Math.min(re,122)&~32]))}}Je.sort(function(Be,Ie){return Be[0]-Ie[0]||Ie[1]-Be[1]});for(var ie=[],ce=[],nt=0;nt<Je.length;++nt){var Ee=Je[nt];Ee[0]<=ce[1]+1?ce[1]=Math.max(ce[1],Ee[1]):ie.push(ce=Ee)}for(var nt=0;nt<ie.length;++nt){var Ee=ie[nt];He.push(dt(Ee[0])),Ee[1]>Ee[0]&&(Ee[1]+1>Ee[0]&&He.push("-"),He.push(dt(Ee[1])))}return He.push("]"),He.join("")}function At(Oe){for(var we=Oe.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")),Je=we.length,st=[],He=0,nt=0;He<Je;++He){var Te=we[He];if(Te==="(")++nt;else if(Te.charAt(0)==="\\"){var ge=+Te.substring(1);ge&&(ge<=nt?st[ge]=-1:we[He]=dt(ge))}}for(var He=1;He<st.length;++He)st[He]===-1&&(st[He]=++Se);for(var He=0,nt=0;He<Je;++He){var Te=we[He];if(Te==="(")++nt,st[nt]||(we[He]="(?:");else if(Te.charAt(0)==="\\"){var ge=+Te.substring(1);ge&&ge<=nt&&(we[He]="\\"+st[ge])}}for(var He=0;He<Je;++He)we[He]==="^"&&we[He+1]!=="^"&&(we[He]="");if(Oe.ignoreCase&&Me)for(var He=0;He<Je;++He){var Te=we[He],be=Te.charAt(0);Te.length>=2&&be==="["?we[He]=pt(Te):be!=="\\"&&(we[He]=Te.replace(/[a-zA-Z]/g,function(ce){var Ee=ce.charCodeAt(0);return"["+String.fromCharCode(Ee&~32,Ee|32)+"]"}))}return we.join("")}for(var wt=[],Ke=0,Qe=oe.length;Ke<Qe;++Ke){var Ze=oe[Ke];if(Ze.global||Ze.multiline)throw new Error(""+Ze);wt.push("(?:"+At(Ze)+")")}return new RegExp(wt.join("|"),We?"gi":"g")}function F(oe,Se){var Me=/(?:^|\s)nocode(?:\s|$)/,We=[],Ke=0,Qe=[],Ze=0;function yt(vt){var dt=vt.nodeType;if(dt==1){if(Me.test(vt.className))return;for(var pt=vt.firstChild;pt;pt=pt.nextSibling)yt(pt);var At=vt.nodeName.toLowerCase();(At==="br"||At==="li")&&(We[Ze]=`
`,Qe[Ze<<1]=Ke++,Qe[Ze++<<1|1]=vt)}else if(dt==3||dt==4){var wt=vt.nodeValue;wt.length&&(Se?wt=wt.replace(/\r\n?/g,`
`):wt=wt.replace(/[ \t\r\n]+/g," "),We[Ze]=wt,Qe[Ze<<1]=Ke,Ke+=wt.length,Qe[Ze++<<1|1]=vt)}}return yt(oe),{sourceCode:We.join("").replace(/\n$/,""),spans:Qe}}function q(oe,Se,Me,We,Ke){if(!Me)return;var Qe={sourceNode:oe,pre:1,langExtension:null,numberLines:null,sourceCode:Me,spans:null,basePos:Se,decorations:null};We(Qe),Ke.push.apply(Ke,Qe.decorations)}var le=/\S/;function pe(oe){for(var Se=void 0,Me=oe.firstChild;Me;Me=Me.nextSibling){var We=Me.nodeType;Se=We===1?Se?oe:Me:We===3&&le.test(Me.nodeValue)?oe:Se}return Se===oe?void 0:Se}function Ae(oe,Se){var Me={},We;(function(){for(var Ze=oe.concat(Se),yt=[],vt={},dt=0,pt=Ze.length;dt<pt;++dt){var At=Ze[dt],wt=At[3];if(wt)for(var Oe=wt.length;--Oe>=0;)Me[wt.charAt(Oe)]=At;var we=At[1],Je=""+we;vt.hasOwnProperty(Je)||(yt.push(we),vt[Je]=null)}yt.push(/[\0-\uffff]/),We=H(yt)})();var Ke=Se.length,Qe=function(Ze){for(var yt=Ze.sourceCode,vt=Ze.basePos,dt=Ze.sourceNode,pt=[vt,l],At=0,wt=yt.match(We)||[],Oe={},we=0,Je=wt.length;we<Je;++we){var st=wt[we],He=Oe[st],nt=void 0,Te;if(typeof He=="string")Te=!1;else{var ge=Me[st.charAt(0)];if(ge)nt=st.match(ge[1]),He=ge[0];else{for(var be=0;be<Ke;++be)if(ge=Se[be],nt=st.match(ge[1]),nt){He=ge[0];break}nt||(He=l)}Te=He.length>=5&&He.substring(0,5)==="lang-",Te&&!(nt&&typeof nt[1]=="string")&&(Te=!1,He=S),Te||(Oe[st]=He)}var re=At;if(At+=st.length,!Te)pt.push(vt+re,He);else{var ie=nt[1],ce=st.indexOf(ie),Ee=ce+ie.length;nt[2]&&(Ee=st.length-nt[2].length,ce=Ee-ie.length);var Be=He.substring(5);q(dt,vt+re,st.substring(0,ce),Qe,pt),q(dt,vt+re+ce,ie,he(Be,ie),pt),q(dt,vt+re+Ee,st.substring(Ee),Qe,pt)}}Ze.decorations=pt};return Qe}function Ge(oe){var Se=[],Me=[];oe.tripleQuotedStrings?Se.push([v,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?Se.push([v,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Se.push([v,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&Me.push([v,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var We=oe.hashComments;We&&(oe.cStyleComments?(We>1?Se.push([A,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Se.push([A,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Me.push([v,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Se.push([A,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(Me.push([A,/^\/\/[^\r\n]*/,null]),Me.push([A,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=oe.regexLiterals;if(Ke){var Qe=Ke>1?"":`
\r`,Ze=Qe?".":"[\\S\\s]",yt="/(?=[^/*"+Qe+"])(?:[^/\\x5B\\x5C"+Qe+"]|\\x5C"+Ze+"|\\x5B(?:[^\\x5C\\x5D"+Qe+"]|\\x5C"+Ze+")*(?:\\x5D|$))+/";Me.push(["lang-regex",RegExp("^"+Y+"("+yt+")")])}var vt=oe.types;vt&&Me.push([p,vt]);var dt=(""+oe.keywords).replace(/^ | $/g,"");dt.length&&Me.push([O,new RegExp("^(?:"+dt.replace(/[\s,]+/g,"|")+")\\b"),null]),Se.push([l,/^\s+/,null,` \r
\xA0`]);var pt="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(pt+="(?!s*/)"),Me.push([h,/^@[a-z_$][a-z_$@0-9]*/i,null],[p,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[h,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[s,new RegExp(pt),null]),Ae(Se,Me)}var Fe=Ge({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(oe,Se,Me){for(var We=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,Qe=oe.ownerDocument,Ze=Qe.createElement("li");oe.firstChild;)Ze.appendChild(oe.firstChild);var yt=[Ze];function vt(we){var Je=we.nodeType;if(Je==1&&!We.test(we.className))if(we.nodeName==="br")dt(we),we.parentNode&&we.parentNode.removeChild(we);else for(var st=we.firstChild;st;st=st.nextSibling)vt(st);else if((Je==3||Je==4)&&Me){var He=we.nodeValue,nt=He.match(Ke);if(nt){var Te=He.substring(0,nt.index);we.nodeValue=Te;var ge=He.substring(nt.index+nt[0].length);if(ge){var be=we.parentNode;be.insertBefore(Qe.createTextNode(ge),we.nextSibling)}dt(we),Te||we.parentNode.removeChild(we)}}}function dt(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function Je(nt,Te){var ge=Te?nt.cloneNode(!1):nt,be=nt.parentNode;if(be){var re=Je(be,1),ie=nt.nextSibling;re.appendChild(ge);for(var ce=ie;ce;ce=ie)ie=ce.nextSibling,re.appendChild(ce)}return ge}for(var st=Je(we.nextSibling,0),He;(He=st.parentNode)&&He.nodeType===1;)st=He;yt.push(st)}for(var pt=0;pt<yt.length;++pt)vt(yt[pt]);Se===(Se|0)&&yt[0].setAttribute("value",Se);var At=Qe.createElement("ol");At.className="linenums";for(var wt=Math.max(0,Se-1|0)||0,pt=0,Oe=yt.length;pt<Oe;++pt)Ze=yt[pt],Ze.className="L"+(pt+wt)%10,Ze.firstChild||Ze.appendChild(Qe.createTextNode("\xA0")),At.appendChild(Ze);oe.appendChild(At)}function _e(oe){var Se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Se=Se&&+Se[1]<=8;var Me=/\n/g,We=oe.sourceCode,Ke=We.length,Qe=0,Ze=oe.spans,yt=Ze.length,vt=0,dt=oe.decorations,pt=dt.length,At=0;dt[pt]=Ke;var wt,Oe;for(Oe=wt=0;Oe<pt;)dt[Oe]!==dt[Oe+2]?(dt[wt++]=dt[Oe++],dt[wt++]=dt[Oe++]):Oe+=2;for(pt=wt,Oe=wt=0;Oe<pt;){for(var we=dt[Oe],Je=dt[Oe+1],st=Oe+2;st+2<=pt&&dt[st+1]===Je;)st+=2;dt[wt++]=we,dt[wt++]=Je,Oe=st}pt=dt.length=wt;var He=oe.sourceNode,nt="";He&&(nt=He.style.display,He.style.display="none");try{for(var Te=null;vt<yt;){var ge=Ze[vt],be=Ze[vt+2]||Ke,re=dt[At+2]||Ke,st=Math.min(be,re),ie=Ze[vt+1],ce;if(ie.nodeType!==1&&(ce=We.substring(Qe,st))){Se&&(ce=ce.replace(Me,"\r")),ie.nodeValue=ce;var Ee=ie.ownerDocument,Be=Ee.createElement("span");Be.className=dt[At+1];var Ie=ie.parentNode;Ie.replaceChild(Be,ie),Be.appendChild(ie),Qe<be&&(Ze[vt+1]=ie=Ee.createTextNode(We.substring(st,be)),Ie.insertBefore(ie,Be.nextSibling))}Qe=st,Qe>=be&&(vt+=2),Qe>=re&&(At+=2)}}finally{He&&(He.style.display=nt)}}var je={};function xe(oe,Se){for(var Me=Se.length;--Me>=0;){var We=Se[Me];je.hasOwnProperty(We)?U.console&&console.warn("cannot override language handler %s",We):je[We]=oe}}function he(oe,Se){return oe&&je.hasOwnProperty(oe)||(oe=/^\s*</.test(Se)?"default-markup":"default-code"),je[oe]}xe(Fe,["default-code"]),xe(Ae([],[[l,/^[^<?]+/],[T,/^<!\w[^>]*(?:>|$)/],[A,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),xe(Ae([[l,/^[\s]+/,null,` \r
`],[C,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[D,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),xe(Ae([],[[C,/^[\s\S]+/]]),["uq.val"]),xe(Ge({keywords:g,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),xe(Ge({keywords:"null,true,false"}),["json"]),xe(Ge({keywords:y,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),xe(Ge({keywords:w,cStyleComments:!0}),["java"]),xe(Ge({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),xe(Ge({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),xe(Ge({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),xe(Ge({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),xe(Ge({keywords:m,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),xe(Ge({keywords:f,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),xe(Ae([],[[v,/^[\s\S]+/]]),["regex"]);function te(oe){var Se=oe.langExtension;try{var Me=F(oe.sourceNode,oe.pre),We=Me.sourceCode;oe.sourceCode=We,oe.spans=Me.spans,oe.basePos=0,he(Se,We)(oe),_e(oe)}catch(Ke){U.console&&console.log(Ke&&Ke.stack||Ke)}}function ye(oe,Se,Me){var We=Me||!1,Ke=Se||null,Qe=document.createElement("div");Qe.innerHTML="<pre>"+oe+"</pre>",Qe=Qe.firstChild,We&&Ue(Qe,We,!0);var Ze={langExtension:Ke,numberLines:We,sourceNode:Qe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return te(Ze),Qe.innerHTML}function ue(oe,Se){var Me=Se||document.body,We=Me.ownerDocument||document;function Ke(ge){return Me.getElementsByTagName(ge)}for(var Qe=[Ke("pre"),Ke("code"),Ke("xmp")],Ze=[],yt=0;yt<Qe.length;++yt)for(var vt=0,dt=Qe[yt].length;vt<dt;++vt)Ze.push(Qe[yt][vt]);Qe=null;var pt=Date;pt.now||(pt={now:function(){return+new Date}});var At=0,wt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Oe=/\bprettyprint\b/,we=/\bprettyprinted\b/,Je=/pre|xmp/i,st=/^code$/i,He=/^(?:pre|code|xmp)$/i,nt={};function Te(){for(var ge=U.PR_SHOULD_USE_CONTINUATION?pt.now()+250:Infinity;At<Ze.length&&pt.now()<ge;At++){for(var be=Ze[At],re=nt,ie=be;ie=ie.previousSibling;){var ce=ie.nodeType,Ee=(ce===7||ce===8)&&ie.nodeValue;if(Ee?!/^\??prettify\b/.test(Ee):ce!==3||/\S/.test(ie.nodeValue))break;if(Ee){re={},Ee.replace(/\b(\w+)=([\w:.%+-]+)/g,function($e,ke,it){re[ke]=it});break}}var Be=be.className;if((re!==nt||Oe.test(Be))&&!we.test(Be)){for(var Ie=!1,ut=be.parentNode;ut;ut=ut.parentNode){var bt=ut.tagName;if(He.test(bt)&&ut.className&&Oe.test(ut.className)){Ie=!0;break}}if(!Ie){be.className+=" prettyprinted";var Tt=re.lang;if(!Tt){Tt=Be.match(wt);var xt;!Tt&&(xt=pe(be))&&st.test(xt.tagName)&&(Tt=xt.className.match(wt)),Tt&&(Tt=Tt[1])}var gt;if(Je.test(be.tagName))gt=1;else{var qe=be.currentStyle,Xe=We.defaultView,Pe=qe?qe.whiteSpace:Xe&&Xe.getComputedStyle?Xe.getComputedStyle(be,null).getPropertyValue("white-space"):0;gt=Pe&&Pe.substring(0,3)==="pre"}var se=re.linenums;(se=se==="true"||+se)||(se=Be.match(/\blinenums\b(?::(\d+))?/),se=se?se[1]&&se[1].length?+se[1]:!0:!1),se&&Ue(be,se,gt);var fe={langExtension:Tt,sourceNode:be,numberLines:se,pre:gt,sourceCode:null,basePos:null,spans:null,decorations:null};te(fe)}}}At<Ze.length?U.setTimeout(Te,250):typeof oe=="function"&&oe()}Te()}var Le=U.PR={createSimpleLexer:Ae,registerLangHandler:xe,sourceDecorator:Ge,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:C,PR_COMMENT:A,PR_DECLARATION:T,PR_KEYWORD:O,PR_LITERAL:h,PR_NOCODE:W,PR_PLAIN:l,PR_PUNCTUATION:s,PR_SOURCE:S,PR_STRING:v,PR_TAG:D,PR_TYPE:p,prettyPrintOne:P?U.prettyPrintOne=ye:M=ye,prettyPrint:j=P?U.prettyPrint=ue:j=ue},ae=U.define;typeof ae=="function"&&ae.amd&&ae("google-code-prettify",[],function(){return Le})})()},SMhR:function(et,de){et.exports="data:image/png;base64,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"},T8No:function(et,de,N){"use strict";N.d(de,"a",function(){return z}),N.d(de,"b",function(){return w}),N.d(de,"d",function(){return y}),N.d(de,"c",function(){return f}),N.d(de,"e",function(){return m});var ee=N("N0LK"),K=N("Cg/j"),P=function(){var a=function(n,o){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,x){u.__proto__=x}||function(u,x){for(var E in x)x.hasOwnProperty(E)&&(u[E]=x[E])},a(n,o)};return function(n,o){a(n,o);function u(){this.constructor=n}n.prototype=o===null?Object.create(o):(u.prototype=o.prototype,new u)}}(),z=function(){function a(){}return a.has=function(n){return M.create(n)},a.equals=function(n,o){return j.create(n,o)},a.regex=function(n,o){return R.create(n,o)},a.not=function(n){return _.create(n)},a.and=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return g.create(n)},a.or=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return w.create(n)},a.deserialize=function(n,o){return o===void 0&&(o=!1),n?this._deserializeOrExpression(n,o):void 0},a._deserializeOrExpression=function(n,o){var u=this,x=n.split("||");return w.create(x.map(function(E){return u._deserializeAndExpression(E,o)}))},a._deserializeAndExpression=function(n,o){var u=this,x=n.split("&&");return g.create(x.map(function(E){return u._deserializeOne(E,o)}))},a._deserializeOne=function(n,o){if(n=n.trim(),n.indexOf("!=")>=0){var u=n.split("!=");return U.create(u[0].trim(),this._deserializeValue(u[1],o))}if(n.indexOf("==")>=0){var u=n.split("==");return j.create(u[0].trim(),this._deserializeValue(u[1],o))}if(n.indexOf("=~")>=0){var u=n.split("=~");return R.create(u[0].trim(),this._deserializeRegexValue(u[1],o))}return/^\!\s*/.test(n)?_.create(n.substr(1).trim()):M.create(n)},a._deserializeValue=function(n,o){if(n=n.trim(),n==="true")return!0;if(n==="false")return!1;var u=/^'([^']*)'$/.exec(n);return u?u[1].trim():n},a._deserializeRegexValue=function(n,o){if(Object(ee.x)(n)){if(o)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var u=n.indexOf("/"),x=n.lastIndexOf("/");if(u===x||u<0){if(o)throw new Error("bad regexp-value '"+n+"', missing /-enclosure");return console.warn("bad regexp-value '"+n+"', missing /-enclosure"),null}var E=n.slice(u+1,x),v=n[x+1]==="i"?"i":"";try{return new RegExp(E,v)}catch(O){if(o)throw new Error("bad regexp-value '"+n+"', parse error: "+O);return console.warn("bad regexp-value '"+n+"', parse error: "+O),null}},a}();function B(a,n){var o=a.getType(),u=n.getType();if(o!==u)return o-u;switch(o){case 1:return a.cmp(n);case 2:return a.cmp(n);case 3:return a.cmp(n);case 4:return a.cmp(n);case 6:return a.cmp(n);case 7:return a.cmp(n);case 5:return a.cmp(n);default:throw new Error("Unknown ContextKeyExpr!")}}var M=function(){function a(n){this.key=n}return a.create=function(n){return new a(n)},a.prototype.getType=function(){return 1},a.prototype.cmp=function(n){return this.key<n.key?-1:this.key>n.key?1:0},a.prototype.equals=function(n){return n instanceof a?this.key===n.key:!1},a.prototype.evaluate=function(n){return!!n.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return _.create(this.key)},a}(),j=function(){function a(n,o){this.key=n,this.value=o}return a.create=function(n,o){return typeof o=="boolean"?o?M.create(n):_.create(n):new a(n,o)},a.prototype.getType=function(){return 3},a.prototype.cmp=function(n){return this.key<n.key?-1:this.key>n.key?1:this.value<n.value?-1:this.value>n.value?1:0},a.prototype.equals=function(n){return n instanceof a?this.key===n.key&&this.value===n.value:!1},a.prototype.evaluate=function(n){return n.getValue(this.key)==this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return U.create(this.key,this.value)},a}(),U=function(){function a(n,o){this.key=n,this.value=o}return a.create=function(n,o){return typeof o=="boolean"?o?_.create(n):M.create(n):new a(n,o)},a.prototype.getType=function(){return 4},a.prototype.cmp=function(n){return this.key<n.key?-1:this.key>n.key?1:this.value<n.value?-1:this.value>n.value?1:0},a.prototype.equals=function(n){return n instanceof a?this.key===n.key&&this.value===n.value:!1},a.prototype.evaluate=function(n){return n.getValue(this.key)!=this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return j.create(this.key,this.value)},a}(),_=function(){function a(n){this.key=n}return a.create=function(n){return new a(n)},a.prototype.getType=function(){return 2},a.prototype.cmp=function(n){return this.key<n.key?-1:this.key>n.key?1:0},a.prototype.equals=function(n){return n instanceof a?this.key===n.key:!1},a.prototype.evaluate=function(n){return!n.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return M.create(this.key)},a}(),R=function(){function a(n,o){this.key=n,this.regexp=o}return a.create=function(n,o){return new a(n,o)},a.prototype.getType=function(){return 6},a.prototype.cmp=function(n){if(this.key<n.key)return-1;if(this.key>n.key)return 1;var o=this.regexp?this.regexp.source:"",u=n.regexp?n.regexp.source:"";return o<u?-1:o>u?1:0},a.prototype.equals=function(n){if(n instanceof a){var o=this.regexp?this.regexp.source:"",u=n.regexp?n.regexp.source:"";return this.key===n.key&&o===u}return!1},a.prototype.evaluate=function(n){var o=n.getValue(this.key);return this.regexp?this.regexp.test(o):!1},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return c.create(this)},a}(),c=function(){function a(n){this._actual=n}return a.create=function(n){return new a(n)},a.prototype.getType=function(){return 7},a.prototype.cmp=function(n){return this._actual.cmp(n._actual)},a.prototype.equals=function(n){return n instanceof a?this._actual.equals(n._actual):!1},a.prototype.evaluate=function(n){return!this._actual.evaluate(n)},a.prototype.keys=function(){return this._actual.keys()},a.prototype.negate=function(){return this._actual},a}(),g=function(){function a(n){this.expr=n}return a.create=function(n){var o=a._normalizeArr(n);return o.length===0?void 0:o.length===1?o[0]:new a(o)},a.prototype.getType=function(){return 5},a.prototype.cmp=function(n){if(this.expr.length<n.expr.length)return-1;if(this.expr.length>n.expr.length)return 1;for(var o=0,u=this.expr.length;o<u;o++){var x=B(this.expr[o],n.expr[o]);if(x!==0)return x}return 0},a.prototype.equals=function(n){if(n instanceof a){if(this.expr.length!==n.expr.length)return!1;for(var o=0,u=this.expr.length;o<u;o++)if(!this.expr[o].equals(n.expr[o]))return!1;return!0}return!1},a.prototype.evaluate=function(n){for(var o=0,u=this.expr.length;o<u;o++)if(!this.expr[o].evaluate(n))return!1;return!0},a._normalizeArr=function(n){var o=[];if(n){for(var u=0,x=n.length;u<x;u++){var E=n[u];if(!E)continue;if(E instanceof a){o=o.concat(E.expr);continue}if(E instanceof w)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');o.push(E)}o.sort(B)}return o},a.prototype.keys=function(){for(var n=[],o=0,u=this.expr;o<u.length;o++){var x=u[o];n.push.apply(n,x.keys())}return n},a.prototype.negate=function(){for(var n=[],o=0,u=this.expr;o<u.length;o++){var x=u[o];n.push(x.negate())}return w.create(n)},a}(),w=function(){function a(n){this.expr=n}return a.create=function(n){var o=a._normalizeArr(n);return o.length===0?void 0:o.length===1?o[0]:new a(o)},a.prototype.getType=function(){return 8},a.prototype.equals=function(n){if(n instanceof a){if(this.expr.length!==n.expr.length)return!1;for(var o=0,u=this.expr.length;o<u;o++)if(!this.expr[o].equals(n.expr[o]))return!1;return!0}return!1},a.prototype.evaluate=function(n){for(var o=0,u=this.expr.length;o<u;o++)if(this.expr[o].evaluate(n))return!0;return!1},a._normalizeArr=function(n){var o=[];if(n){for(var u=0,x=n.length;u<x;u++){var E=n[u];if(!E)continue;if(E instanceof a){o=o.concat(E.expr);continue}o.push(E)}o.sort(B)}return o},a.prototype.keys=function(){for(var n=[],o=0,u=this.expr;o<u.length;o++){var x=u[o];n.push.apply(n,x.keys())}return n},a.prototype.negate=function(){for(var n=[],o=0,u=this.expr;o<u.length;o++){var x=u[o];n.push(x.negate())}for(var E=function(S){return S instanceof a?S.expr:[S]};n.length>1;){for(var v=n.shift(),O=n.shift(),A=[],p=0,h=E(v);p<h.length;p++)for(var s=h[p],l=0,D=E(O);l<D.length;l++){var T=D[l];A.push(z.and(s,T))}n.unshift(z.or.apply(z,A))}return n[0]},a}(),y=function(a){P(n,a);function n(o,u){var x=a.call(this,o)||this;return x._defaultValue=u,x}return n.prototype.bindTo=function(o){return o.createKey(this.key,this._defaultValue)},n.prototype.getValue=function(o){return o.getContextKeyValue(this.key)},n.prototype.toNegated=function(){return z.not(this.key)},n}(M),f=Object(K.c)("contextKeyService"),m="setContext"},TGq3:function(et,de,N){et.exports=N.p+"static/lockclose.365036e8.svg"},"VrN/":function(et,de,N){(function(ee,K){et.exports=K()})(this,function(){"use strict";var ee=navigator.userAgent,K=navigator.platform,P=/gecko\/\d/i.test(ee),z=/MSIE \d/.test(ee),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee),M=/Edge\/(\d+)/.exec(ee),j=z||B||M,U=j&&(z?document.documentMode||6:+(M||B)[1]),_=!M&&/WebKit\//.test(ee),R=_&&/Qt\/\d+\.\d+/.test(ee),c=!M&&/Chrome\//.test(ee),g=/Opera\//.test(ee),w=/Apple Computer/.test(navigator.vendor),y=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ee),f=/PhantomJS/.test(ee),m=!M&&/AppleWebKit/.test(ee)&&/Mobile\/\w+/.test(ee),a=/Android/.test(ee),n=m||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ee),o=m||/Mac/.test(K),u=/\bCrOS\b/.test(ee),x=/win/i.test(K),E=g&&ee.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(g=!1,_=!0);var v=o&&(R||g&&(E==null||E<12.11)),O=P||j&&U>=9;function A(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var p=function(e,t){var i=e.className,r=A(t).exec(i);if(r){var d=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(d?r[1]+d:"")}};function h(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return h(e).appendChild(t)}function l(e,t,i,r){var d=document.createElement(e);if(i&&(d.className=i),r&&(d.style.cssText=r),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var k=0;k<t.length;++k)d.appendChild(t[k]);return d}function D(e,t,i,r){var d=l(e,t,i,r);return d.setAttribute("role","presentation"),d}var T;document.createRange?T=function(e,t,i,r){var d=document.createRange();return d.setEnd(r||e,i),d.setStart(e,t),d}:T=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(d){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function S(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 I(){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 C(e,t){var i=e.className;A(t).test(i)||(e.className+=(i?" ":"")+t)}function W(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!A(i[r]).test(t)&&(t+=" "+i[r]);return t}var Y=function(e){e.select()};m?Y=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:j&&(Y=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 F(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function q(e,t,i,r,d){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var k=r||0,X=d||0;;){var Z=e.indexOf(" ",k);if(Z<0||Z>=t)return X+(t-k);X+=Z-k,X+=i-X%i,k=Z+1}}var le=function(){this.id=null,this.f=null,this.time=0,this.handler=H(this.onTimeout,this)};le.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},le.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function pe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ae=50,Ge={toString:function(){return"CodeMirror.Pass"}},Fe={scroll:!1},Ue={origin:"*mouse"},_e={origin:"+move"};function je(e,t,i){for(var r=0,d=0;;){var k=e.indexOf(" ",r);k==-1&&(k=e.length);var X=k-r;if(k==e.length||d+X>=t)return r+Math.min(X,t-d);if(d+=k-r,d+=i-d%i,r=k+1,d>=t)return r}}var xe=[""];function he(e){for(;xe.length<=e;)xe.push(te(xe)+" ");return xe[e]}function te(e){return e[e.length-1]}function ye(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function ue(e,t,i){for(var r=0,d=i(t);r<e.length&&i(e[r])<=d;)r++;e.splice(r,0,t)}function Le(){}function ae(e,t){var i;return Object.create?i=Object.create(e):(Le.prototype=e,i=new Le),t&&F(t,i),i}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function Me(e,t){return t?t.source.indexOf("\\w")>-1&&Se(e)?!0:t.test(e):Se(e)}function We(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ke=/[\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 Qe(e){return e.charCodeAt(0)>=768&&Ke.test(e)}function Ze(e,t,i){for(;(i<0?t>0:t<e.length)&&Qe(e.charAt(t));)t+=i;return t}function yt(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var d=(t+i)/2,k=r<0?Math.ceil(d):Math.floor(d);if(k==t)return e(k)?t:i;e(k)?i=k:t=k+r}}function vt(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var d=!1,k=0;k<e.length;++k){var X=e[k];(X.from<i&&X.to>t||t==i&&X.to==t)&&(r(Math.max(X.from,t),Math.min(X.to,i),X.level==1?"rtl":"ltr",k),d=!0)}d||r(t,i,"ltr")}var dt=null;function pt(e,t,i){var r;dt=null;for(var d=0;d<e.length;++d){var k=e[d];if(k.from<t&&k.to>t)return d;k.to==t&&(k.from!=k.to&&i=="before"?r=d:dt=d),k.from==t&&(k.from!=k.to&&i!="before"?r=d:dt=d)}return r!=null?r:dt}var At=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ne){return ne<=247?e.charAt(ne):1424<=ne&&ne<=1524?"R":1536<=ne&&ne<=1785?t.charAt(ne-1536):1774<=ne&&ne<=2220?"r":8192<=ne&&ne<=8203?"w":ne==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,k=/[LRr]/,X=/[Lb1n]/,Z=/[1n]/;function $(ne,Ce,Re){this.level=ne,this.from=Ce,this.to=Re}return function(ne,Ce){var Re=Ce=="ltr"?"L":"R";if(ne.length==0||Ce=="ltr"&&!r.test(ne))return!1;for(var Ye=ne.length,ze=[],ht=0;ht<Ye;++ht)ze.push(i(ne.charCodeAt(ht)));for(var Et=0,Dt=Re;Et<Ye;++Et){var Pt=ze[Et];Pt=="m"?ze[Et]=Dt:Dt=Pt}for(var Wt=0,kt=Re;Wt<Ye;++Wt){var Vt=ze[Wt];Vt=="1"&&kt=="r"?ze[Wt]="n":k.test(Vt)&&(kt=Vt,Vt=="r"&&(ze[Wt]="R"))}for(var sn=1,an=ze[0];sn<Ye-1;++sn){var vn=ze[sn];vn=="+"&&an=="1"&&ze[sn+1]=="1"?ze[sn]="1":vn==","&&an==ze[sn+1]&&(an=="1"||an=="n")&&(ze[sn]=an),an=vn}for(var Pn=0;Pn<Ye;++Pn){var $n=ze[Pn];if($n==",")ze[Pn]="N";else if($n=="%"){var Fn=void 0;for(Fn=Pn+1;Fn<Ye&&ze[Fn]=="%";++Fn);for(var Lr=Pn&&ze[Pn-1]=="!"||Fn<Ye&&ze[Fn]=="1"?"1":"N",Cr=Pn;Cr<Fn;++Cr)ze[Cr]=Lr;Pn=Fn-1}}for(var zn=0,Sr=Re;zn<Ye;++zn){var ar=ze[zn];Sr=="L"&&ar=="1"?ze[zn]="L":k.test(ar)&&(Sr=ar)}for(var Yn=0;Yn<Ye;++Yn)if(d.test(ze[Yn])){var Gn=void 0;for(Gn=Yn+1;Gn<Ye&&d.test(ze[Gn]);++Gn);for(var jn=(Yn?ze[Yn-1]:Re)=="L",Ar=(Gn<Ye?ze[Gn]:Re)=="L",Ki=jn==Ar?jn?"L":"R":Re,mi=Yn;mi<Gn;++mi)ze[mi]=Ki;Yn=Gn-1}for(var hr=[],$r,er=0;er<Ye;)if(X.test(ze[er])){var Io=er;for(++er;er<Ye&&X.test(ze[er]);++er);hr.push(new $(0,Io,er))}else{var ni=er,Ai=hr.length,Ti=Ce=="rtl"?1:0;for(++er;er<Ye&&ze[er]!="L";++er);for(var vr=ni;vr<er;)if(Z.test(ze[vr])){ni<vr&&(hr.splice(Ai,0,new $(1,ni,vr)),Ai+=Ti);var zi=vr;for(++vr;vr<er&&Z.test(ze[vr]);++vr);hr.splice(Ai,0,new $(2,zi,vr)),Ai+=Ti,ni=vr}else++vr;ni<er&&hr.splice(Ai,0,new $(1,ni,er))}return Ce=="ltr"&&(hr[0].level==1&&($r=ne.match(/^\s+/))&&(hr[0].from=$r[0].length,hr.unshift(new $(0,0,$r[0].length))),te(hr).level==1&&($r=ne.match(/\s+$/))&&(te(hr).to-=$r[0].length,hr.push(new $(0,Ye-$r[0].length,Ye)))),Ce=="rtl"?hr.reverse():hr}}();function wt(e,t){var i=e.order;return i==null&&(i=e.order=At(e.text,t)),i}var Oe=[],we=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Oe).concat(i)}};function Je(e,t){return e._handlers&&e._handlers[t]||Oe}function st(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,d=r&&r[t];if(d){var k=pe(d,i);k>-1&&(r[t]=d.slice(0,k).concat(d.slice(k+1)))}}}function He(e,t){var i=Je(e,t);if(!i.length)return;for(var r=Array.prototype.slice.call(arguments,2),d=0;d<i.length;++d)i[d].apply(null,r)}function nt(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,i||t.type,e,t),ce(t)||t.codemirrorIgnore}function Te(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)pe(i,t[r])==-1&&i.push(t[r])}function ge(e,t){return Je(e,t).length>0}function be(e){e.prototype.on=function(t,i){we(this,t,i)},e.prototype.off=function(t,i){st(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ee(e){re(e),ie(e)}function Be(e){return e.target||e.srcElement}function Ie(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),o&&e.ctrlKey&&t==1&&(t=3),t}var ut=function(){if(j&&U<9)return!1;var e=l("div");return"draggable"in e||"dragDrop"in e}(),bt;function Tt(e){if(bt==null){var t=l("span","\u200B");s(e,l("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(j&&U<8))}var i=bt?l("span","\u200B"):l("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var xt;function gt(e){if(xt!=null)return xt;var t=s(e,document.createTextNode("A\u062EA")),i=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return h(e),!i||i.left==i.right?!1:xt=r.right-i.right<3}var qe=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var d=e.indexOf(`
`,t);d==-1&&(d=e.length);var k=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),X=k.indexOf("\r");X!=-1?(i.push(k.slice(0,X)),t+=X+1):(i.push(k),t=d+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Xe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Pe=function(){var e=l("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),se=null;function fe(e){if(se!=null)return se;var t=s(e,l("span","x")),i=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return se=Math.abs(i.left-r.left)>1}var $e={},ke={};function it(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$e[e]=t}function at(e,t){ke[e]=t}function Ne(e){if(typeof e=="string"&&ke.hasOwnProperty(e))e=ke[e];else if(e&&typeof e.name=="string"&&ke.hasOwnProperty(e.name)){var t=ke[e.name];typeof t=="string"&&(t={name:t}),e=ae(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ne("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ne("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ve(e,t){t=Ne(t);var i=$e[t.name];if(!i)return Ve(e,"text/plain");var r=i(e,t);if(tt.hasOwnProperty(t.name)){var d=tt[t.name];for(var k in d){if(!d.hasOwnProperty(k))continue;r.hasOwnProperty(k)&&(r["_"+k]=r[k]),r[k]=d[k]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)r[X]=t.modeProps[X];return r}var tt={};function ft(e,t){var i=tt.hasOwnProperty(e)?tt[e]:tt[e]={};F(t,i)}function Ct(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var d=t[r];d instanceof Array&&(d=d.concat([])),i[r]=d}return i}function zt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function qt(e,t,i){return e.startState?e.startState(t,i):!0}var Qt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Qt.prototype.eol=function(){return this.pos>=this.string.length},Qt.prototype.sol=function(){return this.pos==this.lineStart},Qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Qt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qt.prototype.skipToEnd=function(){this.pos=this.string.length},Qt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qt.prototype.backUp=function(e){this.pos-=e},Qt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.indentation=function(){return q(this.string,null,this.tabSize)-(this.lineStart?q(this.string,this.lineStart,this.tabSize):0)},Qt.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(X){return i?X.toLowerCase():X},d=this.string.substr(this.pos,e.length);if(r(d)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var k=this.string.slice(this.pos).match(e);return k&&k.index>0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function St(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var d=i.children[r],k=d.chunkSize();if(t<k){i=d;break}t-=k}return i.lines[t]}function ln(e,t,i){var r=[],d=t.line;return e.iter(t.line,i.line+1,function(k){var X=k.text;d==i.line&&(X=X.slice(0,i.ch)),d==t.line&&(X=X.slice(t.ch)),r.push(X),++d}),r}function Bt(e,t,i){var r=[];return e.iter(t,i,function(d){r.push(d.text)}),r}function Yt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function Mt(e){if(e.parent==null)return null;for(var t=e.parent,i=pe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var d=0;!(r.children[d]==t);++d)i+=r.children[d].chunkSize();return i+t.first}function tn(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var d=e.children[r],k=d.height;if(t<k){e=d;continue e}t-=k,i+=d.chunkSize()}return i}while(!e.lines);for(var X=0;X<e.lines.length;++X){var Z=e.lines[X],$=Z.height;if(t<$)break;t-=$}return i+X}function mn(e,t){return t>=e.first&&t<e.first+e.size}function An(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function lt(e,t,i){if(i===void 0&&(i=null),!(this instanceof lt))return new lt(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Rt(e,t){return e.line-t.line||e.ch-t.ch}function Jt(e,t){return e.sticky==t.sticky&&Rt(e,t)==0}function nn(e){return lt(e.line,e.ch)}function un(e,t){return Rt(e,t)<0?t:e}function cn(e,t){return Rt(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function b(e,t){if(t.line<e.first)return lt(e.first,0);var i=e.first+e.size-1;return t.line>i?lt(i,St(e,i).text.length):L(t,St(e,t.line).text.length)}function L(e,t){var i=e.ch;return i==null||i>t?lt(e.line,t):i<0?lt(e.line,0):e}function V(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=b(e,t[r]);return i}var J=function(e,t){this.state=e,this.lookAhead=t},Q=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Q.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}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,t,i){return t instanceof J?new Q(e,Ct(e.mode,t.state),i,t.lookAhead):new Q(e,Ct(e.mode,t),i)},Q.prototype.save=function(e){var t=e!==!1?Ct(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function De(e,t,i,r){var d=[e.state.modeGen],k={};tr(e,t.text,e.doc.mode,i,function(ne,Ce){return d.push(ne,Ce)},k,r);for(var X=i.state,Z=function(ne){i.baseTokens=d;var Ce=e.state.overlays[ne],Re=1,Ye=0;i.state=!0,tr(e,t.text,Ce.mode,i,function(ze,ht){for(var Et=Re;Ye<ze;){var Dt=d[Re];Dt>ze&&d.splice(Re,1,ze,d[Re+1],Dt),Re+=2,Ye=Math.min(ze,Dt)}if(!ht)return;if(Ce.opaque)d.splice(Et,Re-Et,ze,"overlay "+ht),Re=Et+2;else for(;Et<Re;Et+=2){var Pt=d[Et+1];d[Et+1]=(Pt?Pt+" ":"")+"overlay "+ht}},k),i.state=X,i.baseTokens=null,i.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)Z($);return{styles:d,classes:k.bgClass||k.textClass?k:null}}function ot(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ot(e,Mt(t)),d=t.text.length>e.options.maxHighlightLength&&Ct(e.doc.mode,r.state),k=De(e,t,r);d&&(r.state=d),t.stateAfter=r.save(!d),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ot(e,t,i){var r=e.doc,d=e.display;if(!r.mode.startState)return new Q(r,!0,t);var k=Rn(e,t,i),X=k>r.first&&St(r,k-1).stateAfter,Z=X?Q.fromSaved(r,X,k):new Q(r,qt(r.mode),k);return r.iter(k,t,function($){Ft(e,$.text,Z);var ne=Z.line;$.stateAfter=ne==t-1||ne%5==0||ne>=d.viewFrom&&ne<d.viewTo?Z.save():null,Z.nextLine()}),i&&(r.modeFrontier=Z.line),Z}function Ft(e,t,i,r){var d=e.doc.mode,k=new Qt(t,e.options.tabSize,i);for(k.start=k.pos=r||0,t==""&&ve(d,i.state);!k.eol();)Gt(d,k,i.state),k.start=k.pos}function ve(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=zt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Gt(e,t,i,r){for(var d=0;d<10;d++){r&&(r[0]=zt(e,i).mode);var k=e.token(t,i);if(t.pos>t.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var en=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Tn(e,t,i,r){var d=e.doc,k=d.mode,X;t=b(d,t);var Z=St(d,t.line),$=Ot(e,t.line,i),ne=new Qt(Z.text,e.options.tabSize,$),Ce;for(r&&(Ce=[]);(r||ne.pos<t.ch)&&!ne.eol();)ne.start=ne.pos,X=Gt(k,ne,$.state),r&&Ce.push(new en(ne,X,Ct(d.mode,$.state)));return r?Ce:new en(ne,X,$.state)}function Wn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function tr(e,t,i,r,d,k,X){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var $=0,ne=null,Ce=new Qt(t,e.options.tabSize,r),Re,Ye=e.options.addModeClass&&[null];for(t==""&&Wn(ve(i,r.state),k);!Ce.eol();){if(Ce.pos>e.options.maxHighlightLength?(Z=!1,X&&Ft(e,t,r,Ce.pos),Ce.pos=t.length,Re=null):Re=Wn(Gt(i,Ce,r.state,Ye),k),Ye){var ze=Ye[0].name;ze&&(Re="m-"+(Re?ze+" "+Re:ze))}if(!Z||ne!=Re){for(;$<Ce.start;)$=Math.min(Ce.start,$+5e3),d($,ne);ne=Re}Ce.start=Ce.pos}for(;$<Ce.pos;){var ht=Math.min(Ce.pos,$+5e3);d(ht,ne),$=ht}}function Rn(e,t,i){for(var r,d,k=e.doc,X=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>X;--Z){if(Z<=k.first)return k.first;var $=St(k,Z-1),ne=$.stateAfter;if(ne&&(!i||Z+(ne instanceof J?ne.lookAhead:0)<=k.modeFrontier))return Z;var Ce=q($.text,null,e.options.tabSize);(d==null||r>Ce)&&(d=Z-1,r=Ce)}return d}function or(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,r=t-1;r>i;r--){var d=St(e,r).stateAfter;if(d&&(!(d instanceof J)||r+d.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var fr=!1,Vn=!1;function sr(){fr=!0}function Jn(){Vn=!0}function Mr(e,t,i){this.marker=e,this.from=t,this.to=i}function Xn(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Ir(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function yr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Tr(e,t,i){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],X=k.marker,Z=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);if(Z||k.from==t&&X.type=="bookmark"&&(!i||!k.marker.insertLeft)){var $=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);(r||(r=[])).push(new Mr(X,k.from,$?null:k.to))}}return r}function Yr(e,t,i){var r;if(e)for(var d=0;d<e.length;++d){var k=e[d],X=k.marker,Z=k.to==null||(X.inclusiveRight?k.to>=t:k.to>t);if(Z||k.from==t&&X.type=="bookmark"&&(!i||k.marker.insertLeft)){var $=k.from==null||(X.inclusiveLeft?k.from<=t:k.from<t);(r||(r=[])).push(new Mr(X,$?null:k.from-t,k.to==null?null:k.to-t))}}return r}function br(e,t){if(t.full)return null;var i=mn(e,t.from.line)&&St(e,t.from.line).markedSpans,r=mn(e,t.to.line)&&St(e,t.to.line).markedSpans;if(!i&&!r)return null;var d=t.from.ch,k=t.to.ch,X=Rt(t.from,t.to)==0,Z=Tr(i,d,X),$=Yr(r,k,X),ne=t.text.length==1,Ce=te(t.text).length+(ne?d:0);if(Z)for(var Re=0;Re<Z.length;++Re){var Ye=Z[Re];if(Ye.to==null){var ze=Xn($,Ye.marker);ze?ne&&(Ye.to=ze.to==null?null:ze.to+Ce):Ye.to=d}}if($)for(var ht=0;ht<$.length;++ht){var Et=$[ht];if(Et.to!=null&&(Et.to+=Ce),Et.from==null){var Dt=Xn(Z,Et.marker);Dt||(Et.from=Ce,ne&&(Z||(Z=[])).push(Et))}else Et.from+=Ce,ne&&(Z||(Z=[])).push(Et)}Z&&(Z=nr(Z)),$&&$!=Z&&($=nr($));var Pt=[Z];if(!ne){var Wt=t.text.length-2,kt;if(Wt>0&&Z)for(var Vt=0;Vt<Z.length;++Vt)Z[Vt].to==null&&(kt||(kt=[])).push(new Mr(Z[Vt].marker,null,null));for(var sn=0;sn<Wt;++sn)Pt.push(kt);Pt.push($)}return Pt}function nr(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ur(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(ze){if(ze.markedSpans)for(var ht=0;ht<ze.markedSpans.length;++ht){var Et=ze.markedSpans[ht].marker;Et.readOnly&&(!r||pe(r,Et)==-1)&&(r||(r=[])).push(Et)}}),!r)return null;for(var d=[{from:t,to:i}],k=0;k<r.length;++k)for(var X=r[k],Z=X.find(0),$=0;$<d.length;++$){var ne=d[$];if(Rt(ne.to,Z.from)<0||Rt(ne.from,Z.to)>0)continue;var Ce=[$,1],Re=Rt(ne.from,Z.from),Ye=Rt(ne.to,Z.to);(Re<0||!X.inclusiveLeft&&!Re)&&Ce.push({from:ne.from,to:Z.from}),(Ye>0||!X.inclusiveRight&&!Ye)&&Ce.push({from:Z.to,to:ne.to}),d.splice.apply(d,Ce),$+=Ce.length-3}return d}function _r(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Fr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Sn(e){return e.inclusiveLeft?-1:0}function hn(e){return e.inclusiveRight?1:0}function kn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),d=t.find(),k=Rt(r.from,d.from)||Sn(e)-Sn(t);if(k)return-k;var X=Rt(r.to,d.to)||hn(e)-hn(t);return X||t.id-e.id}function yn(e,t){var i=Vn&&e.markedSpans,r;if(i)for(var d=void 0,k=0;k<i.length;++k)d=i[k],d.marker.collapsed&&(t?d.from:d.to)==null&&(!r||kn(r,d.marker)<0)&&(r=d.marker);return r}function Ln(e){return yn(e,!0)}function bn(e){return yn(e,!1)}function wr(e,t){var i=Vn&&e.markedSpans,r;if(i)for(var d=0;d<i.length;++d){var k=i[d];k.marker.collapsed&&(k.from==null||k.from<t)&&(k.to==null||k.to>t)&&(!r||kn(r,k.marker)<0)&&(r=k.marker)}return r}function Bn(e,t,i,r,d){var k=St(e,t),X=Vn&&k.markedSpans;if(X)for(var Z=0;Z<X.length;++Z){var $=X[Z];if(!$.marker.collapsed)continue;var ne=$.marker.find(0),Ce=Rt(ne.from,i)||Sn($.marker)-Sn(d),Re=Rt(ne.to,r)||hn($.marker)-hn(d);if(Ce>=0&&Re<=0||Ce<=0&&Re>=0)continue;if(Ce<=0&&($.marker.inclusiveRight&&d.inclusiveLeft?Rt(ne.to,i)>=0:Rt(ne.to,i)>0)||Ce>=0&&($.marker.inclusiveRight&&d.inclusiveLeft?Rt(ne.from,r)<=0:Rt(ne.from,r)<0))return!0}}function Qn(e){for(var t;t=Ln(e);)e=t.find(-1,!0).line;return e}function zr(e){for(var t;t=bn(e);)e=t.find(1,!0).line;return e}function jr(e){for(var t,i;t=bn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Dr(e,t){var i=St(e,t),r=Qn(i);return i==r?t:Mt(r)}function Jr(e,t){if(t>e.lastLine())return t;var i=St(e,t),r;if(!rr(e,i))return t;for(;r=bn(i);)i=r.find(1,!0).line;return Mt(i)+1}function rr(e,t){var i=Vn&&t.markedSpans;if(i)for(var r=void 0,d=0;d<i.length;++d){if(r=i[d],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Wr(e,t,r))return!0}}function Wr(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return Wr(e,r.line,Xn(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var d=void 0,k=0;k<t.markedSpans.length;++k)if(d=t.markedSpans[k],d.marker.collapsed&&!d.marker.widgetNode&&d.from==i.to&&(d.to==null||d.to!=i.from)&&(d.marker.inclusiveLeft||i.marker.inclusiveRight)&&Wr(e,t,d))return!0}function Er(e){e=Qn(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var d=i.lines[r];if(d==e)break;t+=d.height}for(var k=i.parent;k;i=k,k=i.parent)for(var X=0;X<k.children.length;++X){var Z=k.children[X];if(Z==i)break;t+=Z.height}return t}function Hr(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Ln(r);){var d=i.find(0,!0);r=d.from.line,t+=d.from.ch-d.to.ch}for(r=e;i=bn(r);){var k=i.find(0,!0);t-=r.text.length-k.from.ch,r=k.to.line,t+=r.text.length-k.to.ch}return t}function Zr(e){var t=e.display,i=e.doc;t.maxLine=St(i,i.first),t.maxLineLength=Hr(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var d=Hr(r);d>t.maxLineLength&&(t.maxLineLength=d,t.maxLine=r)})}var ir=function(e,t,i){this.text=e,Fr(this,t),this.height=i?i(this):1};ir.prototype.lineNo=function(){return Mt(this)},be(ir);function ri(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),_r(e),Fr(e,i);var d=r?r(e):1;d!=e.height&&Yt(e,d)}function ii(e){e.parent=null,_r(e)}var Xt={},on={};function $t(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?on:Xt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function dn(e,t){var i=D("span",null,null,_?"padding-right: .1px":null),r={pre:D("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var d=0;d<=(t.rest?t.rest.length:0);d++){var k=d?t.rest[d-1]:t.line,X=void 0;r.pos=0,r.addToken=wn,gt(e.display.measure)&&(X=wt(k,e.doc.direction))&&(r.addToken=xn(r.addToken,X)),r.map=[];var Z=t!=e.display.externalMeasured&&Mt(k);fn(k,r,ot(e,k,Z)),k.styleClasses&&(k.styleClasses.bgClass&&(r.bgClass=W(k.styleClasses.bgClass,r.bgClass||"")),k.styleClasses.textClass&&(r.textClass=W(k.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Tt(e.display.measure))),d==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var $=r.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=W(r.pre.className,r.textClass||"")),r}function En(e){var t=l("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function wn(e,t,i,r,d,k,X){if(!t)return;var Z=e.splitSpaces?gn(t,e.trailingSpace):t,$=e.cm.state.specialChars,ne=!1,Ce;if(!$.test(t))e.col+=t.length,Ce=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,Ce),j&&U<9&&(ne=!0),e.pos+=t.length;else{Ce=document.createDocumentFragment();for(var Re=0;;){$.lastIndex=Re;var Ye=$.exec(t),ze=Ye?Ye.index-Re:t.length-Re;if(ze){var ht=document.createTextNode(Z.slice(Re,Re+ze));j&&U<9?Ce.appendChild(l("span",[ht])):Ce.appendChild(ht),e.map.push(e.pos,e.pos+ze,ht),e.col+=ze,e.pos+=ze}if(!Ye)break;Re+=ze+1;var Et=void 0;if(Ye[0]==" "){var Dt=e.cm.options.tabSize,Pt=Dt-e.col%Dt;Et=Ce.appendChild(l("span",he(Pt),"cm-tab")),Et.setAttribute("role","presentation"),Et.setAttribute("cm-text"," "),e.col+=Pt}else Ye[0]=="\r"||Ye[0]==`
`?(Et=Ce.appendChild(l("span",Ye[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Et.setAttribute("cm-text",Ye[0]),e.col+=1):(Et=e.cm.options.specialCharPlaceholder(Ye[0]),Et.setAttribute("cm-text",Ye[0]),j&&U<9?Ce.appendChild(l("span",[Et])):Ce.appendChild(Et),e.col+=1);e.map.push(e.pos,e.pos+1,Et),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||r||d||ne||k||X){var Wt=i||"";r&&(Wt+=r),d&&(Wt+=d);var kt=l("span",[Ce],Wt,k);if(X)for(var Vt in X)X.hasOwnProperty(Vt)&&Vt!="style"&&Vt!="class"&&kt.setAttribute(Vt,X[Vt]);return e.content.appendChild(kt)}e.content.appendChild(Ce)}function gn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",d=0;d<e.length;d++){var k=e.charAt(d);k==" "&&i&&(d==e.length-1||e.charCodeAt(d+1)==32)&&(k="\xA0"),r+=k,i=k==" "}return r}function xn(e,t){return function(i,r,d,k,X,Z,$){d=d?d+" cm-force-border":"cm-force-border";for(var ne=i.pos,Ce=ne+r.length;;){for(var Re=void 0,Ye=0;Ye<t.length&&!(Re=t[Ye],Re.to>ne&&Re.from<=ne);Ye++);if(Re.to>=Ce)return e(i,r,d,k,X,Z,$);e(i,r.slice(0,Re.to-ne),d,k,null,Z,$),k=null,r=r.slice(Re.to-ne),ne=Re.to}}}function Hn(e,t,i,r){var d=!r&&i.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!r&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",i.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function fn(e,t,i){var r=e.markedSpans,d=e.text,k=0;if(!r){for(var X=1;X<i.length;X+=2)t.addToken(t,d.slice(k,k=i[X]),$t(i[X+1],t.cm.options));return}for(var Z=d.length,$=0,ne=1,Ce="",Re,Ye,ze=0,ht,Et,Dt,Pt,Wt;;){if(ze==$){ht=Et=Dt=Ye="",Wt=null,Pt=null,ze=Infinity;for(var kt=[],Vt=void 0,sn=0;sn<r.length;++sn){var an=r[sn],vn=an.marker;if(vn.type=="bookmark"&&an.from==$&&vn.widgetNode)kt.push(vn);else if(an.from<=$&&(an.to==null||an.to>$||vn.collapsed&&an.to==$&&an.from==$)){if(an.to!=null&&an.to!=$&&ze>an.to&&(ze=an.to,Et=""),vn.className&&(ht+=" "+vn.className),vn.css&&(Ye=(Ye?Ye+";":"")+vn.css),vn.startStyle&&an.from==$&&(Dt+=" "+vn.startStyle),vn.endStyle&&an.to==ze&&(Vt||(Vt=[])).push(vn.endStyle,an.to),vn.title&&((Wt||(Wt={})).title=vn.title),vn.attributes)for(var Pn in vn.attributes)(Wt||(Wt={}))[Pn]=vn.attributes[Pn];vn.collapsed&&(!Pt||kn(Pt.marker,vn)<0)&&(Pt=an)}else an.from>$&&ze>an.from&&(ze=an.from)}if(Vt)for(var $n=0;$n<Vt.length;$n+=2)Vt[$n+1]==ze&&(Et+=" "+Vt[$n]);if(!Pt||Pt.from==$)for(var Fn=0;Fn<kt.length;++Fn)Hn(t,0,kt[Fn]);if(Pt&&(Pt.from||0)==$){if(Hn(t,(Pt.to==null?Z+1:Pt.to)-$,Pt.marker,Pt.from==null),Pt.to==null)return;Pt.to==$&&(Pt=!1)}}if($>=Z)break;for(var Lr=Math.min(Z,ze);;){if(Ce){var Cr=$+Ce.length;if(!Pt){var zn=Cr>Lr?Ce.slice(0,Lr-$):Ce;t.addToken(t,zn,Re?Re+ht:ht,Dt,$+zn.length==ze?Et:"",Ye,Wt)}if(Cr>=Lr){Ce=Ce.slice(Lr-$),$=Lr;break}$=Cr,Dt=""}Ce=d.slice(k,k=i[ne++]),Re=$t(i[ne++],t.cm.options)}}}function Pr(e,t,i){this.line=t,this.rest=jr(t),this.size=this.rest?Mt(te(this.rest))-i+1:1,this.node=this.text=null,this.hidden=rr(e,t)}function Ht(e,t,i){for(var r=[],d,k=t;k<i;k=d){var X=new Pr(e.doc,St(e.doc,k),k);d=k+X.size,r.push(X)}return r}var _n=null;function pr(e){_n?_n.ops.push(e):e.ownsGroup=_n={ops:[e],delayedCallbacks:[]}}function lr(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var d=e.ops[r];if(d.cursorActivityHandlers)for(;d.cursorActivityCalled<d.cursorActivityHandlers.length;)d.cursorActivityHandlers[d.cursorActivityCalled++].call(null,d.cm)}}while(i<t.length)}function Kt(e,t){var i=e.ownsGroup;if(!i)return;try{lr(i)}finally{_n=null,t(i)}}var pn=null;function Cn(e,t){var i=Je(e,t);if(!i.length)return;var r=Array.prototype.slice.call(arguments,2),d;_n?d=_n.delayedCallbacks:pn?d=pn:(d=pn=[],setTimeout(ur,0));for(var k=function(Z){d.push(function(){return i[Z].apply(null,r)})},X=0;X<i.length;++X)k(X)}function ur(){var e=pn;pn=null;for(var t=0;t<e.length;++t)e[t]()}function qr(e,t,i,r){for(var d=0;d<t.changes.length;d++){var k=t.changes[d];k=="text"?ai(e,t):k=="gutter"?xa(e,t,i,r):k=="class"?Gi(e,t):k=="widget"&&Ca(e,t,r)}t.changes=null}function Rr(e){return e.node==e.text&&(e.node=l("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),j&&U<8&&(e.node.style.zIndex=2)),e.node}function gi(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=Rr(t);t.background=r.insertBefore(l("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function vi(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):dn(e,t)}function ai(e,t){var i=t.text.className,r=vi(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Gi(e,t)):i&&(t.text.className=i)}function Gi(e,t){gi(e,t),t.line.wrapClass?Rr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function xa(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var d=Rr(t);t.gutterBackground=l("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),d.insertBefore(t.gutterBackground,t.text)}var k=t.line.gutterMarkers;if(e.options.lineNumbers||k){var X=Rr(t),Z=t.gutter=l("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),X.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!k||!k["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(l("div",An(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),k)for(var $=0;$<e.display.gutterSpecs.length;++$){var ne=e.display.gutterSpecs[$].className,Ce=k.hasOwnProperty(ne)&&k[ne];Ce&&Z.appendChild(l("div",[Ce],"CodeMirror-gutter-elt","left: "+r.gutterLeft[ne]+"px; width: "+r.gutterWidth[ne]+"px"))}}}function Ca(e,t,i){t.alignable&&(t.alignable=null);for(var r=A("CodeMirror-linewidget"),d=t.node.firstChild,k=void 0;d;d=k)k=d.nextSibling,r.test(d.className)&&t.node.removeChild(d);wi(e,t,i)}function Sa(e,t,i,r){var d=vi(e,t);return t.text=t.node=d.pre,d.bgClass&&(t.bgClass=d.bgClass),d.textClass&&(t.textClass=d.textClass),Gi(e,t),xa(e,t,i,r),wi(e,t,r),t.node}function wi(e,t,i){if(Aa(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)Aa(e,t.rest[r],t,i,!1)}function Aa(e,t,i,r,d){if(!t.widgets)return;for(var k=Rr(i),X=0,Z=t.widgets;X<Z.length;++X){var $=Z[X],ne=l("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||ne.setAttribute("cm-ignore-events","true"),Ta($,ne,i,r),e.display.input.setUneditable(ne),d&&$.above?k.insertBefore(ne,i.gutter||i.text):k.appendChild(ne),Cn($,"redraw")}}function Ta(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var d=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(d-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=d+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function oi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!S(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,l("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Gr(e,t){for(var i=Be(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function yi(e){return e.lineSpace.offsetTop}function wa(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Da(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,l("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function dr(e){return Ae-e.display.nativeBarWidth}function si(e){return e.display.scroller.clientWidth-dr(e)-e.display.barWidth}function ei(e){return e.display.scroller.clientHeight-dr(e)-e.display.barHeight}function ro(e,t,i){var r=e.options.lineWrapping,d=r&&si(e);if(!t.measure.heights||r&&t.measure.width!=d){var k=t.measure.heights=[];if(r){t.measure.width=d;for(var X=t.text.firstChild.getClientRects(),Z=0;Z<X.length-1;Z++){var $=X[Z],ne=X[Z+1];Math.abs($.bottom-ne.bottom)>2&&k.push(($.bottom+ne.top)/2-i.top)}}k.push(i.bottom-i.top)}}function Di(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var d=0;d<e.rest.length;d++)if(Mt(e.rest[d])>i)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function io(e,t){t=Qn(t);var i=Mt(t),r=e.display.externalMeasured=new Pr(e.doc,t,i);r.lineN=i;var d=r.built=dn(e,r);return r.text=d.pre,s(e.display.lineMeasure,d.pre),r}function Vi(e,t,i,r){return mr(e,li(e,t),i,r)}function Xi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Nt(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function li(e,t){var i=Mt(t),r=Xi(e,i);r&&!r.text?r=null:r&&r.changes&&(qr(e,r,i,ct(e)),e.curOp.forceUpdate=!0),r||(r=io(e,t));var d=Di(r,t,i);return{line:t,view:r,rect:null,map:d.map,cache:d.cache,before:d.before,hasHeights:!1}}function mr(e,t,i,r,d){t.before&&(i=-1);var k=i+(r||""),X;return t.cache.hasOwnProperty(k)?X=t.cache[k]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ro(e,t.view,t.rect),t.hasHeights=!0),X=Ri(e,t,i,r),X.bogus||(t.cache[k]=X)),{left:X.left,right:X.right,top:d?X.rtop:X.top,bottom:d?X.rbottom:X.bottom}}var Qi={left:0,right:0,top:0,bottom:0};function Yi(e,t,i){for(var r,d,k,X,Z,$,ne=0;ne<e.length;ne+=3)if(Z=e[ne],$=e[ne+1],t<Z?(d=0,k=1,X="left"):t<$?(d=t-Z,k=d+1):(ne==e.length-3||t==$&&e[ne+3]>t)&&(k=$-Z,d=k-1,t>=$&&(X="right")),d!=null){if(r=e[ne+2],Z==$&&i==(r.insertLeft?"left":"right")&&(X=i),i=="left"&&d==0)for(;ne&&e[ne-2]==e[ne-3]&&e[ne-1].insertLeft;)r=e[(ne-=3)+2],X="left";if(i=="right"&&d==$-Z)for(;ne<e.length-3&&e[ne+3]==e[ne+4]&&!e[ne+5].insertLeft;)r=e[(ne+=3)+2],X="right";break}return{node:r,start:d,end:k,collapse:X,coverStart:Z,coverEnd:$}}function ao(e,t){var i=Qi;if(t=="left")for(var r=0;r<e.length&&!((i=e[r]).left!=i.right);r++);else for(var d=e.length-1;d>=0&&!((i=e[d]).left!=i.right);d--);return i}function Ri(e,t,i,r){var d=Yi(t.map,i,r),k=d.node,X=d.start,Z=d.end,$=d.collapse,ne;if(k.nodeType==3){for(var Ce=0;Ce<4;Ce++){for(;X&&Qe(t.line.text.charAt(d.coverStart+X));)--X;for(;d.coverStart+Z<d.coverEnd&&Qe(t.line.text.charAt(d.coverStart+Z));)++Z;if(j&&U<9&&X==0&&Z==d.coverEnd-d.coverStart?ne=k.parentNode.getBoundingClientRect():ne=ao(T(k,X,Z).getClientRects(),r),ne.left||ne.right||X==0)break;Z=X,X=X-1,$="right"}j&&U<11&&(ne=oo(e.display.measure,ne))}else{X>0&&($=r="right");var Re;e.options.lineWrapping&&(Re=k.getClientRects()).length>1?ne=Re[r=="right"?Re.length-1:0]:ne=k.getBoundingClientRect()}if(j&&U<9&&!X&&(!ne||!ne.left&&!ne.right)){var Ye=k.parentNode.getClientRects()[0];Ye?ne={left:Ye.left,right:Ye.left+me(e.display),top:Ye.top,bottom:Ye.bottom}:ne=Qi}for(var ze=ne.top-t.rect.top,ht=ne.bottom-t.rect.top,Et=(ze+ht)/2,Dt=t.view.measure.heights,Pt=0;Pt<Dt.length-1&&!(Et<Dt[Pt]);Pt++);var Wt=Pt?Dt[Pt-1]:0,kt=Dt[Pt],Vt={left:($=="right"?ne.right:ne.left)-t.rect.left,right:($=="left"?ne.left:ne.right)-t.rect.left,top:Wt,bottom:kt};return!ne.left&&!ne.right&&(Vt.bogus=!0),e.options.singleCursorHeightPerLine||(Vt.rtop=ze,Vt.rbottom=ht),Vt}function oo(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!fe(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function Ra(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 Oa(e){e.display.externalMeasure=null,h(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ra(e.display.view[t])}function bi(e){Oa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function La(){return c&&a?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ji(){return c&&a?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Zi(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=oi(e.widgets[i]));return t}function Oi(e,t,i,r,d){if(!d){var k=Zi(t);i.top+=k,i.bottom+=k}if(r=="line")return i;r||(r="local");var X=Er(t);if(r=="local"?X+=yi(e.display):X-=e.display.viewOffset,r=="page"||r=="window"){var Z=e.display.lineSpace.getBoundingClientRect();X+=Z.top+(r=="window"?0:Ji());var $=Z.left+(r=="window"?0:La());i.left+=$,i.right+=$}return i.top+=X,i.bottom+=X,i}function Ma(e,t,i){if(i=="div")return t;var r=t.left,d=t.top;if(i=="page")r-=La(),d-=Ji();else if(i=="local"||!i){var k=e.display.sizer.getBoundingClientRect();r+=k.left,d+=k.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:r-X.left,top:d-X.top}}function qi(e,t,i,r,d){return r||(r=St(e.doc,t.line)),Oi(e,r,Vi(e,r,t.ch,d),i)}function kr(e,t,i,r,d,k){r=r||St(e.doc,t.line),d||(d=li(e,r));function X(ht,Et){var Dt=mr(e,d,ht,Et?"right":"left",k);return Et?Dt.left=Dt.right:Dt.right=Dt.left,Oi(e,r,Dt,i)}var Z=wt(r,e.doc.direction),$=t.ch,ne=t.sticky;if($>=r.text.length?($=r.text.length,ne="before"):$<=0&&($=0,ne="after"),!Z)return X(ne=="before"?$-1:$,ne=="before");function Ce(ht,Et,Dt){var Pt=Z[Et],Wt=Pt.level==1;return X(Dt?ht-1:ht,Wt!=Dt)}var Re=pt(Z,$,ne),Ye=dt,ze=Ce($,Re,ne=="before");return Ye!=null&&(ze.other=Ce($,Ye,ne!="before")),ze}function Ia(e,t){var i=0;t=b(e.doc,t),e.options.lineWrapping||(i=me(e.display)*t.ch);var r=St(e.doc,t.line),d=Er(r)+yi(e.display);return{left:i,right:i,top:d,bottom:d+r.height}}function Kr(e,t,i,r,d){var k=lt(e,t,i);return k.xRel=d,r&&(k.outside=r),k}function $i(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Kr(r.first,0,null,-1,-1);var d=tn(r,i),k=r.first+r.size-1;if(d>k)return Kr(r.first+r.size-1,St(r,k).text.length,null,1,1);t<0&&(t=0);for(var X=St(r,d);;){var Z=ka(e,X,d,t,i),$=wr(X,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!$)return Z;var ne=$.find(1);if(ne.line==d)return ne;X=St(r,d=ne.line)}}function _a(e,t,i,r){r-=Zi(t);var d=t.text.length,k=yt(function(X){return mr(e,i,X-1).bottom<=r},d,0);return d=yt(function(X){return mr(e,i,X).top>r},k,d),{begin:k,end:d}}function Pa(e,t,i,r){i||(i=li(e,t));var d=Oi(e,t,mr(e,i,r),"line").top;return _a(e,t,i,d)}function ea(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function ka(e,t,i,r,d){d-=Er(t);var k=li(e,t),X=Zi(t),Z=0,$=t.text.length,ne=!0,Ce=wt(t,e.doc.direction);if(Ce){var Re=(e.options.lineWrapping?Ba:Na)(e,t,i,k,Ce,r,d);ne=Re.level!=1,Z=ne?Re.from:Re.to-1,$=ne?Re.to:Re.from-1}var Ye=null,ze=null,ht=yt(function(sn){var an=mr(e,k,sn);return an.top+=X,an.bottom+=X,ea(an,r,d,!1)?(an.top<=d&&an.left<=r&&(Ye=sn,ze=an),!0):!1},Z,$),Et,Dt,Pt=!1;if(ze){var Wt=r-ze.left<ze.right-r,kt=Wt==ne;ht=Ye+(kt?0:1),Dt=kt?"after":"before",Et=Wt?ze.left:ze.right}else{!ne&&(ht==$||ht==Z)&&ht++,Dt=ht==0?"after":ht==t.text.length?"before":mr(e,k,ht-(ne?1:0)).bottom+X<=d==ne?"after":"before";var Vt=kr(e,lt(i,ht,Dt),"line",t,k);Et=Vt.left,Pt=d<Vt.top?-1:d>=Vt.bottom?1:0}return ht=Ze(t.text,ht,1),Kr(i,ht,Dt,Pt,r-Et)}function Na(e,t,i,r,d,k,X){var Z=yt(function(Re){var Ye=d[Re],ze=Ye.level!=1;return ea(kr(e,lt(i,ze?Ye.to:Ye.from,ze?"before":"after"),"line",t,r),k,X,!0)},0,d.length-1),$=d[Z];if(Z>0){var ne=$.level!=1,Ce=kr(e,lt(i,ne?$.from:$.to,ne?"after":"before"),"line",t,r);ea(Ce,k,X,!0)&&Ce.top>X&&($=d[Z-1])}return $}function Ba(e,t,i,r,d,k,X){var Z=_a(e,t,r,X),$=Z.begin,ne=Z.end;/\s/.test(t.text.charAt(ne-1))&&ne--;for(var Ce=null,Re=null,Ye=0;Ye<d.length;Ye++){var ze=d[Ye];if(ze.from>=ne||ze.to<=$)continue;var ht=ze.level!=1,Et=mr(e,r,ht?Math.min(ne,ze.to)-1:Math.max($,ze.from)).right,Dt=Et<k?k-Et+1e9:Et-k;(!Ce||Re>Dt)&&(Ce=ze,Re=Dt)}return Ce||(Ce=d[d.length-1]),Ce.from<$&&(Ce={from:$,to:Ce.to,level:Ce.level}),Ce.to>ne&&(Ce={from:Ce.from,to:ne,level:Ce.level}),Ce}var Vr;function Ut(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vr==null){Vr=l("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Vr.appendChild(document.createTextNode("x")),Vr.appendChild(l("br"));Vr.appendChild(document.createTextNode("x"))}s(e.measure,Vr);var i=Vr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),h(e.measure),i||1}function me(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=l("span","xxxxxxxxxx"),i=l("pre",[t],"CodeMirror-line-like");s(e.measure,i);var r=t.getBoundingClientRect(),d=(r.right-r.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ct(e){for(var t=e.display,i={},r={},d=t.gutters.clientLeft,k=t.gutters.firstChild,X=0;k;k=k.nextSibling,++X){var Z=e.display.gutterSpecs[X].className;i[Z]=k.offsetLeft+k.clientLeft+d,r[Z]=k.clientWidth}return{fixedPos:rt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function rt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _t(e){var t=Ut(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/me(e.display)-3);return function(d){if(rr(e.doc,d))return 0;var k=0;if(d.widgets)for(var X=0;X<d.widgets.length;X++)d.widgets[X].height&&(k+=d.widgets[X].height);return i?k+(Math.ceil(d.text.length/r)||1)*t:k+t}}function mt(e){var t=e.doc,i=_t(e);t.iter(function(r){var d=i(r);d!=r.height&&Yt(r,d)})}function It(e,t,i,r){var d=e.display;if(!i&&Be(t).getAttribute("cm-not-content")=="true")return null;var k,X,Z=d.lineSpace.getBoundingClientRect();try{k=t.clientX-Z.left,X=t.clientY-Z.top}catch(Re){return null}var $=$i(e,k,X),ne;if(r&&$.xRel>0&&(ne=St(e.doc,$.line).text).length==$.ch){var Ce=q(ne,ne.length,e.options.tabSize)-ne.length;$=lt($.line,Math.max(0,Math.round((k-Da(e.display).left)/me(e.display))-Ce))}return $}function Nt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function Lt(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var d=e.display;if(r&&i<d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>t)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)Vn&&Dr(e.doc,t)<d.viewTo&&jt(e);else if(i<=d.viewFrom)Vn&&Jr(e.doc,i+r)>d.viewFrom?jt(e):(d.viewFrom+=r,d.viewTo+=r);else if(t<=d.viewFrom&&i>=d.viewTo)jt(e);else if(t<=d.viewFrom){var k=rn(e,i,i+r,1);k?(d.view=d.view.slice(k.index),d.viewFrom=k.lineN,d.viewTo+=r):jt(e)}else if(i>=d.viewTo){var X=rn(e,t,t,-1);X?(d.view=d.view.slice(0,X.index),d.viewTo=X.lineN):jt(e)}else{var Z=rn(e,t,t,-1),$=rn(e,i,i+r,1);Z&&$?(d.view=d.view.slice(0,Z.index).concat(Ht(e,Z.lineN,$.lineN)).concat(d.view.slice($.index)),d.viewTo+=r):jt(e)}var ne=d.externalMeasured;ne&&(i<ne.lineN?ne.lineN+=r:t<ne.lineN+ne.size&&(d.externalMeasured=null))}function Zt(e,t,i){e.curOp.viewChanged=!0;var r=e.display,d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var k=r.view[Nt(e,t)];if(k.node==null)return;var X=k.changes||(k.changes=[]);pe(X,i)==-1&&X.push(i)}function jt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function rn(e,t,i,r){var d=Nt(e,t),k,X=e.display.view;if(!Vn||i==e.doc.first+e.doc.size)return{index:d,lineN:i};for(var Z=e.display.viewFrom,$=0;$<d;$++)Z+=X[$].size;if(Z!=t){if(r>0){if(d==X.length-1)return null;k=Z+X[d].size-t,d++}else k=Z-t;t+=k,i+=k}for(;Dr(e.doc,i)!=i;){if(d==(r<0?0:X.length-1))return null;i+=r*X[d-(r<0?1:0)].size,d+=r}return{index:d,lineN:i}}function Mn(e,t,i){var r=e.display,d=r.view;d.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Ht(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Ht(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Nt(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Ht(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,Nt(e,i)))),r.viewTo=i}function Nn(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var d=t[r];!d.hidden&&(!d.node||d.changes)&&++i}return i}function In(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ui(e,t){t===void 0&&(t=!0);for(var i=e.doc,r={},d=r.cursors=document.createDocumentFragment(),k=r.selection=document.createDocumentFragment(),X=0;X<i.sel.ranges.length;X++){if(!t&&X==i.sel.primIndex)continue;var Z=i.sel.ranges[X];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var $=Z.empty();($||e.options.showCursorWhenSelecting)&&Ua(e,Z.head,d),$||Xs(e,Z,k)}return r}function Ua(e,t,i){var r=kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),d=i.appendChild(l("div","\xA0","CodeMirror-cursor"));if(d.style.left=r.left+"px",d.style.top=r.top+"px",d.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var k=i.appendChild(l("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));k.style.display="",k.style.left=r.other.left+"px",k.style.top=r.other.top+"px",k.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Li(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var r=e.display,d=e.doc,k=document.createDocumentFragment(),X=Da(e.display),Z=X.left,$=Math.max(r.sizerWidth,si(e)-r.sizer.offsetLeft)-X.right,ne=d.direction=="ltr";function Ce(kt,Vt,sn,an){Vt<0&&(Vt=0),Vt=Math.round(Vt),an=Math.round(an),k.appendChild(l("div",null,"CodeMirror-selected","position: absolute; left: "+kt+`px;
top: `+Vt+"px; width: "+(sn==null?$-kt:sn)+`px;
height: `+(an-Vt)+"px"))}function Re(kt,Vt,sn){var an=St(d,kt),vn=an.text.length,Pn,$n;function Fn(zn,Sr){return qi(e,lt(kt,zn),"div",an,Sr)}function Lr(zn,Sr,ar){var Yn=Pa(e,an,null,zn),Gn=Sr=="ltr"==(ar=="after")?"left":"right",jn=ar=="after"?Yn.begin:Yn.end-(/\s/.test(an.text.charAt(Yn.end-1))?2:1);return Fn(jn,Gn)[Gn]}var Cr=wt(an,d.direction);return vt(Cr,Vt||0,sn==null?vn:sn,function(zn,Sr,ar,Yn){var Gn=ar=="ltr",jn=Fn(zn,Gn?"left":"right"),Ar=Fn(Sr-1,Gn?"right":"left"),Ki=Vt==null&&zn==0,mi=sn==null&&Sr==vn,hr=Yn==0,$r=!Cr||Yn==Cr.length-1;if(Ar.top-jn.top<=3){var er=(ne?Ki:mi)&&hr,Io=(ne?mi:Ki)&&$r,ni=er?Z:(Gn?jn:Ar).left,Ai=Io?$:(Gn?Ar:jn).right;Ce(ni,jn.top,Ai-ni,jn.bottom)}else{var Ti,vr,zi,_o;Gn?(Ti=ne&&Ki&&hr?Z:jn.left,vr=ne?$:Lr(zn,ar,"before"),zi=ne?Z:Lr(Sr,ar,"after"),_o=ne&&mi&&$r?$:Ar.right):(Ti=ne?Lr(zn,ar,"before"):Z,vr=!ne&&Ki&&hr?$:jn.right,zi=!ne&&mi&&$r?Z:Ar.left,_o=ne?Lr(Sr,ar,"after"):$),Ce(Ti,jn.top,vr-Ti,jn.bottom),jn.bottom<Ar.top&&Ce(Z,jn.bottom,null,Ar.top),Ce(zi,Ar.top,_o-zi,Ar.bottom)}(!Pn||Li(jn,Pn)<0)&&(Pn=jn),Li(Ar,Pn)<0&&(Pn=Ar),(!$n||Li(jn,$n)<0)&&($n=jn),Li(Ar,$n)<0&&($n=Ar)}),{start:Pn,end:$n}}var Ye=t.from(),ze=t.to();if(Ye.line==ze.line)Re(Ye.line,Ye.ch,ze.ch);else{var ht=St(d,Ye.line),Et=St(d,ze.line),Dt=Qn(ht)==Qn(Et),Pt=Re(Ye.line,Ye.ch,Dt?ht.text.length+1:null).end,Wt=Re(ze.line,Dt?0:null,ze.ch).start;Dt&&(Pt.top<Wt.top-2?(Ce(Pt.right,Pt.top,null,Pt.bottom),Ce(Z,Wt.top,Wt.left,Wt.bottom)):Ce(Pt.right,Pt.top,Wt.left-Pt.right,Pt.bottom)),Pt.bottom<Wt.top&&Ce(Z,Pt.bottom,null,Wt.top)}i.appendChild(k)}function so(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Mi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Po(e){e.state.focused||(e.display.input.focus(),lo(e))}function ko(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Mi(e))},100)}function lo(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,C(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),so(e)}function Mi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,p(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Fa(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var d=t.view[r],k=e.options.lineWrapping,X=void 0,Z=0;if(d.hidden)continue;if(j&&U<8){var $=d.node.offsetTop+d.node.offsetHeight;X=$-i,i=$}else{var ne=d.node.getBoundingClientRect();X=ne.bottom-ne.top,!k&&d.text.firstChild&&(Z=d.text.firstChild.getBoundingClientRect().right-ne.left-1)}var Ce=d.line.height-X;if((Ce>.005||Ce<-.005)&&(Yt(d.line,X),No(d.line),d.rest))for(var Re=0;Re<d.rest.length;Re++)No(d.rest[Re]);if(Z>e.display.sizerWidth){var Ye=Math.ceil(Z/me(e.display));Ye>e.display.maxLineLength&&(e.display.maxLineLength=Ye,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function No(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function ja(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-yi(e));var d=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,k=tn(t,r),X=tn(t,d);if(i&&i.ensure){var Z=i.ensure.from.line,$=i.ensure.to.line;Z<k?(k=Z,X=tn(t,Er(St(t,Z))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=X&&(k=tn(t,Er(St(t,$))-e.wrapper.clientHeight),X=$)}return{from:k,to:Math.max(X,k+1)}}function Qs(e,t){if(nt(e,"scrollCursorIntoView"))return;var i=e.display,r=i.sizer.getBoundingClientRect(),d=null;if(t.top+r.top<0?d=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!f){var k=l("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-yi(e.display))+`px;
height: `+(t.bottom-t.top+dr(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(d),e.display.lineSpace.removeChild(k)}}function Ys(e,t,i,r){r==null&&(r=0);var d;!e.options.lineWrapping&&t==i&&(t=t.ch?lt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?lt(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var X=!1,Z=kr(e,t),$=!i||i==t?Z:kr(e,i);d={left:Math.min(Z.left,$.left),top:Math.min(Z.top,$.top)-r,right:Math.max(Z.left,$.left),bottom:Math.max(Z.bottom,$.bottom)+r};var ne=uo(e,d),Ce=e.doc.scrollTop,Re=e.doc.scrollLeft;if(ne.scrollTop!=null&&(na(e,ne.scrollTop),Math.abs(e.doc.scrollTop-Ce)>1&&(X=!0)),ne.scrollLeft!=null&&(Ei(e,ne.scrollLeft),Math.abs(e.doc.scrollLeft-Re)>1&&(X=!0)),!X)break}return d}function Js(e,t){var i=uo(e,t);i.scrollTop!=null&&na(e,i.scrollTop),i.scrollLeft!=null&&Ei(e,i.scrollLeft)}function uo(e,t){var i=e.display,r=Ut(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,k=ei(e),X={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Z=e.doc.height+wa(i),$=t.top<r,ne=t.bottom>Z-r;if(t.top<d)X.scrollTop=$?0:t.top;else if(t.bottom>d+k){var Ce=Math.min(t.top,(ne?Z:t.bottom)-k);Ce!=d&&(X.scrollTop=Ce)}var Re=e.options.fixedGutter?0:i.gutters.offsetWidth,Ye=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Re,ze=si(e)-i.gutters.offsetWidth,ht=t.right-t.left>ze;return ht&&(t.right=t.left+ze),t.left<10?X.scrollLeft=0:t.left<Ye?X.scrollLeft=Math.max(0,t.left+Re-(ht?0:10)):t.right>ze+Ye-3&&(X.scrollLeft=t.right+(ht?0:10)-ze),X}function co(e,t){if(t==null)return;Wa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ii(e){Wa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ta(e,t,i){(t!=null||i!=null)&&Wa(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Wa(e),e.curOp.scrollToPos=t}function Wa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ia(e,t.from),r=Ia(e,t.to);Bo(e,i,r,t.margin)}}function Bo(e,t,i,r){var d=uo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ta(e,d.scrollLeft,d.scrollTop)}function na(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||fo(e,{top:t}),Uo(e,t,!0),P&&fo(e),aa(e,100)}function Uo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ei(e,t,i,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Ko(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ra(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+wa(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+dr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var xi=function(e,t,i){this.cm=i;var r=this.vert=l("div",[l("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d=this.horiz=l("div",[l("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=d.tabIndex=-1,e(r),e(d),we(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),we(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,j&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var d=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+d)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},xi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xi.prototype.zeroWidthHack=function(){var e=o&&!y?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new le,this.disableVert=new le},xi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var d=e.getBoundingClientRect(),k=i=="vert"?document.elementFromPoint(d.right-1,(d.top+d.bottom)/2):document.elementFromPoint((d.right+d.left)/2,d.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},xi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ia=function(){};ia.prototype.update=function(){return{bottom:0,right:0}},ia.prototype.setScrollLeft=function(){},ia.prototype.setScrollTop=function(){},ia.prototype.clear=function(){};function _i(e,t){t||(t=ra(e));var i=e.display.barWidth,r=e.display.barHeight;Fo(e,t);for(var d=0;d<4&&i!=e.display.barWidth||r!=e.display.barHeight;d++)i!=e.display.barWidth&&e.options.lineWrapping&&Fa(e),Fo(e,ra(e)),i=e.display.barWidth,r=e.display.barHeight}function Fo(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var jo={native:xi,null:ia};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&p(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new jo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),we(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ei(e,t):na(e,t)},e),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function Ci(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},pr(e.curOp)}function Si(e){var t=e.curOp;t&&Kt(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;$s(i)})}function $s(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var r=0;r<t.length;r++)tl(t[r]);for(var d=0;d<t.length;d++)nl(t[d]);for(var k=0;k<t.length;k++)rl(t[k]);for(var X=0;X<t.length;X++)il(t[X])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Zr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ha(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ho(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Fa(t),e.barMeasure=ra(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Vi(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+dr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-si(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ei(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==I();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&_i(t,e.barMeasure),e.updatedDisplay&&mo(t,e.barMeasure),e.selectionChanged&&so(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Po(e.cm)}function il(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&Ho(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Uo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ei(t,e.scrollLeft,!0,!0),e.scrollToPos){var d=Ys(t,b(r,e.scrollToPos.from),b(r,e.scrollToPos.to),e.scrollToPos.margin);Qs(t,d)}var k=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(k)for(var Z=0;Z<k.length;++Z)k[Z].lines.length||He(k[Z],"hide");if(X)for(var $=0;$<X.length;++$)X[$].lines.length&&He(X[$],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Or(e,t){if(e.curOp)return t();Ci(e);try{return t()}finally{Si(e)}}function Zn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ci(e);try{return t.apply(e,arguments)}finally{Si(e)}}}function gr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ci(this);try{return e.apply(this,arguments)}finally{Si(this)}}}function qn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ci(t);try{return e.apply(this,arguments)}finally{Si(t)}}}function aa(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 i=+new Date+e.options.workTime,r=Ot(e,t.highlightFrontier),d=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(r.line>=e.display.viewFrom){var X=k.styles,Z=k.text.length>e.options.maxHighlightLength?Ct(t.mode,r.state):null,$=De(e,k,r,!0);Z&&(r.state=Z),k.styles=$.styles;var ne=k.styleClasses,Ce=$.classes;Ce?k.styleClasses=Ce:ne&&(k.styleClasses=null);for(var Re=!X||X.length!=k.styles.length||ne!=Ce&&(!ne||!Ce||ne.bgClass!=Ce.bgClass||ne.textClass!=Ce.textClass),Ye=0;!Re&&Ye<X.length;++Ye)Re=X[Ye]!=k.styles[Ye];Re&&d.push(r.line),k.stateAfter=r.save(),r.nextLine()}else k.text.length<=e.options.maxHighlightLength&&Ft(e,k.text,r),k.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return aa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),d.length&&Or(e,function(){for(var k=0;k<d.length;k++)Zt(e,d[k],"text")})}var Ha=function(e,t,i){var r=e.display;this.viewport=t,this.visible=ja(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=si(e),this.force=i,this.dims=ct(e),this.events=[]};Ha.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},Ha.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.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=dr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=dr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=I();if(!t||!S(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&S(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&S(document.body,e.anchorNode)&&S(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function ho(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return jt(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Nn(e)==0)return!1;zo(e)&&(jt(e),t.dims=ct(e));var d=r.first+r.size,k=Math.max(t.visible.from-e.options.viewportMargin,r.first),X=Math.min(d,t.visible.to+e.options.viewportMargin);i.viewFrom<k&&k-i.viewFrom<20&&(k=Math.max(r.first,i.viewFrom)),i.viewTo>X&&i.viewTo-X<20&&(X=Math.min(d,i.viewTo)),Vn&&(k=Dr(e.doc,k),X=Jr(e.doc,X));var Z=k!=i.viewFrom||X!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Mn(e,k,X),i.viewOffset=Er(St(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var $=Nn(e);if(!Z&&$==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ne=sl(e);return $>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),$>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(ne),h(i.cursorDiv),h(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,aa(e,400)),i.updateLineNumbers=null,!0}function Ho(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==si(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+wa(e.display)-ei(e),i.top)}),t.visible=ja(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ja(e.display,e.doc,i));if(!ho(e,t))break;Fa(e);var d=ra(e);In(e),_i(e,d),mo(e,d),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function fo(e,t){var i=new Ha(e,t);if(ho(e,i)){Fa(e),Ho(e,i);var r=ra(e);In(e),_i(e,r),mo(e,r),i.finish()}}function ul(e,t,i){var r=e.display,d=e.options.lineNumbers,k=r.lineDiv,X=k.firstChild;function Z(ht){var Et=ht.nextSibling;return _&&o&&e.display.currentWheelTarget==ht?ht.style.display="none":ht.parentNode.removeChild(ht),Et}for(var $=r.view,ne=r.viewFrom,Ce=0;Ce<$.length;Ce++){var Re=$[Ce];if(!Re.hidden)if(!Re.node||Re.node.parentNode!=k){var Ye=Sa(e,Re,ne,i);k.insertBefore(Ye,X)}else{for(;X!=Re.node;)X=Z(X);var ze=d&&t!=null&&t<=ne&&Re.lineNumber;Re.changes&&(pe(Re.changes,"gutter")>-1&&(ze=!1),qr(e,Re,ne,i)),ze&&(h(Re.lineNumber),Re.lineNumber.appendChild(document.createTextNode(An(e.options,ne)))),X=Re.node.nextSibling}ne+=Re.size}for(;X;)X=Z(X)}function po(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function mo(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+dr(e)+"px"}function Ko(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=rt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,k=r+"px",X=0;X<i.length;X++)if(!i[X].hidden){e.options.fixedGutter&&(i[X].gutter&&(i[X].gutter.style.left=k),i[X].gutterBackground&&(i[X].gutterBackground.style.left=k));var Z=i[X].alignable;if(Z)for(var $=0;$<Z.length;$++)Z[$].style.left=k}e.options.fixedGutter&&(t.gutters.style.left=r+d+"px")}function zo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=An(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var d=r.measure.appendChild(l("div",[l("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),k=d.firstChild.offsetWidth,X=d.offsetWidth-k;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(k,r.lineGutter.offsetWidth-X)+1,r.lineNumWidth=r.lineNumInnerWidth+X,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",po(e.display),!0}return!1}function go(e,t){for(var i=[],r=!1,d=0;d<e.length;d++){var k=e[d],X=null;if(typeof k!="string"&&(X=k.style,k=k.className),k=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:k,style:X})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Go(e){var t=e.gutters,i=e.gutterSpecs;h(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var d=i[r],k=d.className,X=d.style,Z=t.appendChild(l("div",null,"CodeMirror-gutter "+k));X&&(Z.style.cssText=X),k=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",po(e)}function oa(e){Go(e.display),Lt(e),Ko(e)}function dl(e,t,i,r){var d=this;this.input=i,d.scrollbarFiller=l("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=l("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=D("div",null,"CodeMirror-code"),d.selectionDiv=l("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=l("div",null,"CodeMirror-cursors"),d.measure=l("div",null,"CodeMirror-measure"),d.lineMeasure=l("div",null,"CodeMirror-measure"),d.lineSpace=D("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none");var k=D("div",[d.lineSpace],"CodeMirror-lines");d.mover=l("div",[k],null,"position: relative"),d.sizer=l("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=l("div",null,null,"position: absolute; height: "+Ae+"px; width: 1px;"),d.gutters=l("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=l("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=l("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),j&&U<8&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),!_&&!(P&&n)&&(d.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(d.wrapper):e(d.wrapper)),d.viewFrom=d.viewTo=t.first,d.reportedViewFrom=d.reportedViewTo=t.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,d.gutterSpecs=go(r.gutters,r.lineNumbers),Go(d),i.init(d)}var Ka=0,Nr=null;j?Nr=-.53:P?Nr=15:c?Nr=-.7:w&&(Nr=-1/3);function Vo(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Vo(e);return t.x*=Nr,t.y*=Nr,t}function Xo(e,t){var i=Vo(t),r=i.x,d=i.y,k=e.display,X=k.scroller,Z=X.scrollWidth>X.clientWidth,$=X.scrollHeight>X.clientHeight;if(!(r&&Z||d&&$))return;if(d&&o&&_){e:for(var ne=t.target,Ce=k.view;ne!=X;ne=ne.parentNode)for(var Re=0;Re<Ce.length;Re++)if(Ce[Re].node==ne){e.display.currentWheelTarget=ne;break e}}if(r&&!P&&!g&&Nr!=null){d&&$&&na(e,Math.max(0,X.scrollTop+d*Nr)),Ei(e,Math.max(0,X.scrollLeft+r*Nr)),(!d||d&&$)&&re(t),k.wheelStartX=null;return}if(d&&Nr!=null){var Ye=d*Nr,ze=e.doc.scrollTop,ht=ze+k.wrapper.clientHeight;Ye<0?ze=Math.max(0,ze+Ye-50):ht=Math.min(e.doc.height,ht+Ye+50),fo(e,{top:ze,bottom:ht})}Ka<20&&(k.wheelStartX==null?(k.wheelStartX=X.scrollLeft,k.wheelStartY=X.scrollTop,k.wheelDX=r,k.wheelDY=d,setTimeout(function(){if(k.wheelStartX==null)return;var Et=X.scrollLeft-k.wheelStartX,Dt=X.scrollTop-k.wheelStartY,Pt=Dt&&k.wheelDY&&Dt/k.wheelDY||Et&&k.wheelDX&&Et/k.wheelDX;if(k.wheelStartX=k.wheelStartY=null,!Pt)return;Nr=(Nr*Ka+Pt)/(Ka+1),++Ka},200)):(k.wheelDX+=r,k.wheelDY+=d))}var Br=function(e,t){this.ranges=e,this.primIndex=t};Br.prototype.primary=function(){return this.ranges[this.primIndex]},Br.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!Jt(i.anchor,r.anchor)||!Jt(i.head,r.head))return!1}return!0},Br.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Dn(nn(this.ranges[t].anchor),nn(this.ranges[t].head));return new Br(e,this.primIndex)},Br.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Br.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(Rt(t,r.from())>=0&&Rt(e,r.to())<=0)return i}return-1};var Dn=function(e,t){this.anchor=e,this.head=t};Dn.prototype.from=function(){return cn(this.anchor,this.head)},Dn.prototype.to=function(){return un(this.anchor,this.head)},Dn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Xr(e,t,i){var r=e&&e.options.selectionsMayTouch,d=t[i];t.sort(function(Ye,ze){return Rt(Ye.from(),ze.from())}),i=pe(t,d);for(var k=1;k<t.length;k++){var X=t[k],Z=t[k-1],$=Rt(Z.to(),X.from());if(r&&!X.empty()?$>0:$>=0){var ne=cn(Z.from(),X.from()),Ce=un(Z.to(),X.to()),Re=Z.empty()?X.from()==X.head:Z.from()==Z.head;k<=i&&--i,t.splice(--k,2,new Dn(Re?Ce:ne,Re?ne:Ce))}}return new Br(t,i)}function di(e,t){return new Br([new Dn(e,t||e)],0)}function ci(e){return e.text?lt(e.from.line+e.text.length-1,te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qo(e,t){if(Rt(e,t.from)<0)return e;if(Rt(e,t.to)<=0)return ci(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ci(t).ch-t.to.ch),lt(i,r)}function vo(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var d=e.sel.ranges[r];i.push(new Dn(Qo(d.anchor,t),Qo(d.head,t)))}return Xr(e.cm,i,e.sel.primIndex)}function Yo(e,t,i){return e.line==t.line?lt(i.line,e.ch-t.ch+i.ch):lt(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var r=[],d=lt(e.first,0),k=d,X=0;X<t.length;X++){var Z=t[X],$=Yo(Z.from,d,k),ne=Yo(ci(Z),d,k);if(d=Z.to,k=ne,i=="around"){var Ce=e.sel.ranges[X],Re=Rt(Ce.head,Ce.anchor)<0;r[X]=new Dn(Re?ne:$,Re?$:ne)}else r[X]=new Dn($,$)}return new Br(r,e.sel.primIndex)}function yo(e){e.doc.mode=Ve(e.options,e.doc.modeOption),sa(e)}function sa(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,aa(e,100),e.state.modeGen++,e.curOp&&Lt(e)}function Jo(e,t){return t.from.ch==0&&t.to.ch==0&&te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function bo(e,t,i,r){function d(Wt){return i?i[Wt]:null}function k(Wt,kt,Vt){ri(Wt,kt,Vt,r),Cn(Wt,"change",Wt,t)}function X(Wt,kt){for(var Vt=[],sn=Wt;sn<kt;++sn)Vt.push(new ir(ne[sn],d(sn),r));return Vt}var Z=t.from,$=t.to,ne=t.text,Ce=St(e,Z.line),Re=St(e,$.line),Ye=te(ne),ze=d(ne.length-1),ht=$.line-Z.line;if(t.full)e.insert(0,X(0,ne.length)),e.remove(ne.length,e.size-ne.length);else if(Jo(e,t)){var Et=X(0,ne.length-1);k(Re,Re.text,ze),ht&&e.remove(Z.line,ht),Et.length&&e.insert(Z.line,Et)}else if(Ce==Re)if(ne.length==1)k(Ce,Ce.text.slice(0,Z.ch)+Ye+Ce.text.slice($.ch),ze);else{var Dt=X(1,ne.length-1);Dt.push(new ir(Ye+Ce.text.slice($.ch),ze,r)),k(Ce,Ce.text.slice(0,Z.ch)+ne[0],d(0)),e.insert(Z.line+1,Dt)}else if(ne.length==1)k(Ce,Ce.text.slice(0,Z.ch)+ne[0]+Re.text.slice($.ch),d(0)),e.remove(Z.line+1,ht);else{k(Ce,Ce.text.slice(0,Z.ch)+ne[0],d(0)),k(Re,Ye+Re.text.slice($.ch),ze);var Pt=X(1,ne.length-1);ht>1&&e.remove(Z.line+1,ht-1),e.insert(Z.line+1,Pt)}Cn(e,"change",e,t)}function hi(e,t,i){function r(d,k,X){if(d.linked)for(var Z=0;Z<d.linked.length;++Z){var $=d.linked[Z];if($.doc==k)continue;var ne=X&&$.sharedHist;if(i&&!ne)continue;t($.doc,ne),r($.doc,d,ne)}}r(e,null,!0)}function Zo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,mt(e),yo(e),qo(e),e.options.lineWrapping||Zr(e),e.options.mode=t.modeOption,Lt(e)}function qo(e){(e.doc.direction=="rtl"?C:p)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Or(e,function(){qo(e),Lt(e)})}function za(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 Eo(e,t){var i={from:nn(t.from),to:ci(t),text:ln(e,t.from,t.to)};return ts(e,i,t.from.line,t.to.line+1),hi(e,function(r){return ts(r,i,t.from.line,t.to.line+1)},!0),i}function $o(e){for(;e.length;){var t=te(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return $o(e.done),te(e.done);if(e.done.length&&!te(e.done).ranges)return te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),te(e.done)}function es(e,t,i,r){var d=e.history;d.undone.length=0;var k=+new Date,X,Z;if((d.lastOp==r||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(d,d.lastOp==r)))Z=te(X.changes),Rt(t.from,t.to)==0&&Rt(t.from,Z.to)==0?Z.to=ci(t):X.changes.push(Eo(e,t));else{var $=te(d.done);for((!$||!$.ranges)&&Ga(e.sel,d.done),X={changes:[Eo(e,t)],generation:d.generation},d.done.push(X);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(i),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=k,d.lastOp=d.lastSelOp=r,d.lastOrigin=d.lastSelOrigin=t.origin,Z||He(e,"historyAdded")}function ml(e,t,i,r){var d=t.charAt(0);return d=="*"||d=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,r){var d=e.history,k=r&&r.origin;i==d.lastSelOp||k&&d.lastSelOrigin==k&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==k||ml(e,k,te(d.done),t))?d.done[d.done.length-1]=t:Ga(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=k,d.lastSelOp=i,r&&r.clearRedo!==!1&&$o(d.undone)}function Ga(e,t){var i=te(t);i&&i.ranges&&i.equals(e)||t.push(e)}function ts(e,t,i,r){var d=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(X){X.markedSpans&&((d||(d=t["spans_"+e.id]={}))[k]=X.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],d=0;d<t.text.length;++d)r.push(vl(i[d]));return r}function ns(e,t){var i=yl(e,t),r=br(e,t);if(!i)return r;if(!r)return i;for(var d=0;d<i.length;++d){var k=i[d],X=r[d];if(k&&X){e:for(var Z=0;Z<X.length;++Z){for(var $=X[Z],ne=0;ne<k.length;++ne)if(k[ne].marker==$.marker)continue e;k.push($)}}else X&&(i[d]=X)}return i}function Pi(e,t,i){for(var r=[],d=0;d<e.length;++d){var k=e[d];if(k.ranges){r.push(i?Br.prototype.deepCopy.call(k):k);continue}var X=k.changes,Z=[];r.push({changes:Z});for(var $=0;$<X.length;++$){var ne=X[$],Ce=void 0;if(Z.push({from:ne.from,to:ne.to,text:ne.text}),t)for(var Re in ne)(Ce=Re.match(/^spans_(\d+)$/))&&(pe(t,Number(Ce[1]))>-1&&(te(Z)[Re]=ne[Re],delete ne[Re]))}}return r}function xo(e,t,i,r){if(r){var d=e.anchor;if(i){var k=Rt(t,d)<0;k!=Rt(i,d)<0?(d=t,t=i):k!=Rt(t,i)<0&&(t=i)}return new Dn(d,t)}else return new Dn(i||t,t)}function Va(e,t,i,r,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),cr(e,new Br([xo(e.sel.primary(),t,i,d)],0),r)}function rs(e,t,i){for(var r=[],d=e.cm&&(e.cm.display.shift||e.extend),k=0;k<e.sel.ranges.length;k++)r[k]=xo(e.sel.ranges[k],t[k],null,d);var X=Xr(e.cm,r,e.sel.primIndex);cr(e,X,i)}function Co(e,t,i,r){var d=e.sel.ranges.slice(0);d[t]=i,cr(e,Xr(e.cm,d,e.sel.primIndex),r)}function is(e,t,i,r){cr(e,di(t,i),r)}function bl(e,t,i){var r={ranges:t.ranges,update:function(d){this.ranges=[];for(var k=0;k<d.length;k++)this.ranges[k]=new Dn(b(e,d[k].anchor),b(e,d[k].head))},origin:i&&i.origin};return He(e,"beforeSelectionChange",e,r),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Xr(e.cm,r.ranges,r.ranges.length-1):t}function as(e,t,i){var r=e.history.done,d=te(r);d&&d.ranges?(r[r.length-1]=t,Xa(e,t,i)):cr(e,t,i)}function cr(e,t,i){Xa(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Xa(e,t,i){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var r=i&&i.bias||(Rt(t.primary().head,e.sel.primary().head)<0?-1:1);os(e,ls(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&Ii(e.cm)}function os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Cn(e,"cursorActivity",e)}function ss(e){os(e,ls(e,e.sel,null,!1))}function ls(e,t,i,r){for(var d,k=0;k<t.ranges.length;k++){var X=t.ranges[k],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[k],$=Qa(e,X.anchor,Z&&Z.anchor,i,r),ne=Qa(e,X.head,Z&&Z.head,i,r);(d||$!=X.anchor||ne!=X.head)&&(d||(d=t.ranges.slice(0,k)),d[k]=new Dn($,ne))}return d?Xr(e.cm,d,t.primIndex):t}function ki(e,t,i,r,d){var k=St(e,t.line);if(k.markedSpans)for(var X=0;X<k.markedSpans.length;++X){var Z=k.markedSpans[X],$=Z.marker,ne="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,Ce="selectRight"in $?!$.selectRight:$.inclusiveRight;if((Z.from==null||(ne?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(Ce?Z.to>=t.ch:Z.to>t.ch))){if(d&&(He($,"beforeCursorEnter"),$.explicitlyCleared))if(k.markedSpans){--X;continue}else break;if(!$.atomic)continue;if(i){var Re=$.find(r<0?1:-1),Ye=void 0;if((r<0?Ce:ne)&&(Re=us(e,Re,-r,Re&&Re.line==t.line?k:null)),Re&&Re.line==t.line&&(Ye=Rt(Re,i))&&(r<0?Ye<0:Ye>0))return ki(e,Re,t,r,d)}var ze=$.find(r<0?-1:1);return(r<0?ne:Ce)&&(ze=us(e,ze,r,ze.line==t.line?k:null)),ze?ki(e,ze,t,r,d):null}}return t}function Qa(e,t,i,r,d){var k=r||1,X=ki(e,t,i,k,d)||!d&&ki(e,t,i,k,!0)||ki(e,t,i,-k,d)||!d&&ki(e,t,i,-k,!0);return X||(e.cantEdit=!0,lt(e.first,0))}function us(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?b(e,lt(t.line-1)):null:i>0&&t.ch==(r||St(e,t.line)).text.length?t.line<e.first+e.size-1?lt(t.line+1,0):null:new lt(t.line,t.ch+i)}function ds(e){e.setSelection(lt(e.firstLine(),0),lt(e.lastLine()),Fe)}function cs(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(d,k,X,Z){d&&(r.from=b(e,d)),k&&(r.to=b(e,k)),X&&(r.text=X),Z!==void 0&&(r.origin=Z)}),He(e,"beforeChange",e,r),e.cm&&He(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ni(e,t,i){if(e.cm){if(!e.cm.curOp)return Zn(e.cm,Ni)(e,t,i);if(e.cm.state.suppressEdits)return}if((ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var r=fr&&!i&&Ur(e,t.from,t.to);if(r)for(var d=r.length-1;d>=0;--d)hs(e,{from:r[d].from,to:r[d].to,text:d?[""]:t.text,origin:t.origin});else hs(e,t)}function hs(e,t){if(t.text.length==1&&t.text[0]==""&&Rt(t.from,t.to)==0)return;var i=vo(e,t);es(e,t,i,e.cm?e.cm.curOp.id:NaN),la(e,t,i,br(e,t));var r=[];hi(e,function(d,k){!k&&pe(r,d.history)==-1&&(gs(d.history,t),r.push(d.history)),la(d,t,null,br(d,t))})}function Ya(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!i)return;for(var d=e.history,k,X=e.sel,Z=t=="undo"?d.done:d.undone,$=t=="undo"?d.undone:d.done,ne=0;ne<Z.length&&!(k=Z[ne],i?k.ranges&&!k.equals(e.sel):!k.ranges);ne++);if(ne==Z.length)return;for(d.lastOrigin=d.lastSelOrigin=null;;)if(k=Z.pop(),k.ranges){if(Ga(k,$),i&&!k.equals(e.sel)){cr(e,k,{clearRedo:!1});return}X=k}else if(r){Z.push(k);return}else break;var Ce=[];Ga(X,$),$.push({changes:Ce,generation:d.generation}),d.generation=k.generation||++d.maxGeneration;for(var Re=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),Ye=function(Et){var Dt=k.changes[Et];if(Dt.origin=t,Re&&!cs(e,Dt,!1))return Z.length=0,{};Ce.push(Eo(e,Dt));var Pt=Et?vo(e,Dt):te(Z);la(e,Dt,Pt,ns(e,Dt)),!Et&&e.cm&&e.cm.scrollIntoView({from:Dt.from,to:ci(Dt)});var Wt=[];hi(e,function(kt,Vt){!Vt&&pe(Wt,kt.history)==-1&&(gs(kt.history,Dt),Wt.push(kt.history)),la(kt,Dt,null,ns(kt,Dt))})},ze=k.changes.length-1;ze>=0;--ze){var ht=Ye(ze);if(ht)return ht.v}}function fs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Br(ye(e.sel.ranges,function(d){return new Dn(lt(d.anchor.line+t,d.anchor.ch),lt(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Lt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Zt(e.cm,r,"gutter")}}function la(e,t,i,r){if(e.cm&&!e.cm.curOp)return Zn(e.cm,la)(e,t,i,r);if(t.to.line<e.first){fs(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var d=t.text.length-1-(e.first-t.from.line);fs(e,d),t={from:lt(e.first,0),to:lt(t.to.line+d,t.to.ch),text:[te(t.text)],origin:t.origin}}var k=e.lastLine();t.to.line>k&&(t={from:t.from,to:lt(k,St(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ln(e,t.from,t.to),i||(i=vo(e,t)),e.cm?El(e.cm,t,r):bo(e,t,r),Xa(e,i,Fe),e.cantEdit&&Qa(e,lt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var r=e.doc,d=e.display,k=t.from,X=t.to,Z=!1,$=k.line;e.options.lineWrapping||($=Mt(Qn(St(r,k.line))),r.iter($,X.line+1,function(ze){if(ze==d.maxLine)return Z=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Te(e),bo(r,t,i,_t(e)),e.options.lineWrapping||(r.iter($,k.line+t.text.length,function(ze){var ht=Hr(ze);ht>d.maxLineLength&&(d.maxLine=ze,d.maxLineLength=ht,d.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),or(r,k.line),aa(e,400);var ne=t.text.length-(X.line-k.line)-1;t.full?Lt(e):k.line==X.line&&t.text.length==1&&!Jo(e.doc,t)?Zt(e,k.line,"text"):Lt(e,k.line,X.line+1,ne);var Ce=ge(e,"changes"),Re=ge(e,"change");if(Re||Ce){var Ye={from:k,to:X,text:t.text,removed:t.removed,origin:t.origin};Re&&Cn(e,"change",e,Ye),Ce&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ye)}e.display.selForContextMenu=null}function Bi(e,t,i,r,d){var k;r||(r=i),Rt(r,i)<0&&(k=[r,i],i=k[0],r=k[1]),typeof t=="string"&&(t=e.splitLines(t)),Ni(e,{from:i,to:r,text:t,origin:d})}function ps(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ms(e,t,i,r){for(var d=0;d<e.length;++d){var k=e[d],X=!0;if(k.ranges){k.copied||(k=e[d]=k.deepCopy(),k.copied=!0);for(var Z=0;Z<k.ranges.length;Z++)ps(k.ranges[Z].anchor,t,i,r),ps(k.ranges[Z].head,t,i,r);continue}for(var $=0;$<k.changes.length;++$){var ne=k.changes[$];if(i<ne.from.line)ne.from=lt(ne.from.line+r,ne.from.ch),ne.to=lt(ne.to.line+r,ne.to.ch);else if(t<=ne.to.line){X=!1;break}}X||(e.splice(0,d+1),d=0)}}function gs(e,t){var i=t.from.line,r=t.to.line,d=t.text.length-(r-i)-1;ms(e.done,i,r,d),ms(e.undone,i,r,d)}function ua(e,t,i,r){var d=t,k=t;return typeof t=="number"?k=St(e,G(e,t)):d=Mt(t),d==null?null:(r(k,d)&&e.cm&&Zt(e.cm,d,i),k)}function da(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var d=this.lines[i];this.height-=d.height,ii(d),Cn(d,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var d=e[r];t+=d.chunkSize(),i+=d.height,d.parent=this}this.size=t,this.height=i,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],d=r.chunkSize();if(e<d){var k=Math.min(t,d-e),X=r.height;if(r.removeInner(e,k),this.height-=X-r.height,d==k&&(this.children.splice(i--,1),r.parent=null),(t-=k)==0)break;e=0}else e-=d}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof da))){var Z=[];this.collapse(Z),this.children=[new da(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<=k){if(d.insertInner(e,t,i),d.lines&&d.lines.length>50){for(var X=d.lines.length%25+25,Z=X;Z<d.lines.length;){var $=new da(d.lines.slice(Z,Z+=25));d.height-=$.height,this.children.splice(++r,0,$),$.parent=this}d.lines=d.lines.slice(0,X),this.maybeSpill()}break}e-=k}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new ca(t);if(e.parent){e.size-=i.size,e.height-=i.height;var d=pe(e.parent.children,e);e.parent.children.splice(d+1,0,i)}else{var r=new ca(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var d=this.children[r],k=d.chunkSize();if(e<k){var X=Math.min(t,k-e);if(d.iterN(e,X,i))return!0;if((t-=X)==0)break;e=0}else e-=k}}};var ha=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=Mt(i);if(r==null||!t)return;for(var d=0;d<t.length;++d)t[d]==this&&t.splice(d--,1);t.length||(i.widgets=null);var k=oi(this);Yt(i,Math.max(0,i.height-k)),e&&(Or(e,function(){vs(e,i,-k),Zt(e,r,"widget")}),Cn(e,"lineWidgetCleared",e,this,r))},ha.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var d=oi(this)-t;if(!d)return;rr(this.doc,r)||Yt(r,r.height+d),i&&Or(i,function(){i.curOp.forceUpdate=!0,vs(i,r,d),Cn(i,"lineWidgetChanged",i,e,Mt(r))})},be(ha);function vs(e,t,i){Er(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&co(e,i)}function xl(e,t,i,r){var d=new ha(e,i,r),k=e.cm;return k&&d.noHScroll&&(k.display.alignWidgets=!0),ua(e,t,"widget",function(X){var Z=X.widgets||(X.widgets=[]);if(d.insertAt==null?Z.push(d):Z.splice(Math.min(Z.length-1,Math.max(0,d.insertAt)),0,d),d.line=X,k&&!rr(e,X)){var $=Er(X)<e.scrollTop;Yt(X,X.height+oi(d)),$&&co(k,d.height),k.curOp.forceUpdate=!0}return!0}),k&&Cn(k,"lineWidgetAdded",k,d,typeof t=="number"?t:Mt(t)),d}var ys=0,fi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ys};fi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ci(e),ge(this,"clear")){var i=this.find();i&&Cn(this,"clear",i.from,i.to)}for(var r=null,d=null,k=0;k<this.lines.length;++k){var X=this.lines[k],Z=Xn(X.markedSpans,this);e&&!this.collapsed?Zt(e,Mt(X),"text"):e&&(Z.to!=null&&(d=Mt(X)),Z.from!=null&&(r=Mt(X))),X.markedSpans=Ir(X.markedSpans,Z),Z.from==null&&this.collapsed&&!rr(this.doc,X)&&e&&Yt(X,Ut(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var ne=Qn(this.lines[$]),Ce=Hr(ne);Ce>e.display.maxLineLength&&(e.display.maxLine=ne,e.display.maxLineLength=Ce,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Lt(e,r,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ss(e.doc)),e&&Cn(e,"markerCleared",e,this,r,d),t&&Si(e),this.parent&&this.parent.clear()},fi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,d=0;d<this.lines.length;++d){var k=this.lines[d],X=Xn(k.markedSpans,this);if(X.from!=null&&(i=lt(t?k:Mt(k),X.from),e==-1))return i;if(X.to!=null&&(r=lt(t?k:Mt(k),X.to),e==1))return r}return i&&{from:i,to:r}},fi.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;if(!t||!r)return;Or(r,function(){var d=t.line,k=Mt(t.line),X=Xi(r,k);if(X&&(Ra(X),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!rr(i.doc,d)&&i.height!=null){var Z=i.height;i.height=null;var $=oi(i)-Z;$&&Yt(d,d.height+$)}Cn(r,"markerChanged",r,e)})},fi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||pe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},fi.prototype.detachLine=function(e){if(this.lines.splice(pe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(fi);function Ui(e,t,i,r,d){if(r&&r.shared)return Cl(e,t,i,r,d);if(e.cm&&!e.cm.curOp)return Zn(e.cm,Ui)(e,t,i,r,d);var k=new fi(e,d),X=Rt(t,i);if(r&&F(r,k,!1),X>0||X==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=D("span",[k.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(Bn(e,t.line,t,i,k)||t.line!=i.line&&Bn(e,i.line,t,i,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");Jn()}k.addToHistory&&es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,$=e.cm,ne;if(e.iter(Z,i.line+1,function(Re){$&&k.collapsed&&!$.options.lineWrapping&&Qn(Re)==$.display.maxLine&&(ne=!0),k.collapsed&&Z!=t.line&&Yt(Re,0),yr(Re,new Mr(k,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),k.collapsed&&e.iter(t.line,i.line+1,function(Re){rr(e,Re)&&Yt(Re,0)}),k.clearOnEnter&&we(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(sr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++ys,k.atomic=!0),$){if(ne&&($.curOp.updateMaxLine=!0),k.collapsed)Lt($,t.line,i.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var Ce=t.line;Ce<=i.line;Ce++)Zt($,Ce,"text");k.atomic&&ss($.doc),Cn($,"markerAdded",$,k)}return k}var fa=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};fa.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Cn(this,"clear")},fa.prototype.find=function(e,t){return this.primary.find(e,t)},be(fa);function Cl(e,t,i,r,d){r=F(r),r.shared=!1;var k=[Ui(e,t,i,r,d)],X=k[0],Z=r.widgetNode;return hi(e,function($){Z&&(r.widgetNode=Z.cloneNode(!0)),k.push(Ui($,b($,t),b($,i),r,d));for(var ne=0;ne<$.linked.length;++ne)if($.linked[ne].isParent)return;X=te(k)}),new fa(k,X)}function bs(e){return e.findMarks(lt(e.first,0),e.clipPos(lt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var i=0;i<t.length;i++){var r=t[i],d=r.find(),k=e.clipPos(d.from),X=e.clipPos(d.to);if(Rt(k,X)){var Z=Ui(e,k,X,r.primary,r.primary.type);r.markers.push(Z),Z.parent=r}}}function Al(e){for(var t=function(r){var d=e[r],k=[d.primary.doc];hi(d.primary.doc,function($){return k.push($)});for(var X=0;X<d.markers.length;X++){var Z=d.markers[X];pe(k,Z.doc)==-1&&(Z.parent=null,d.markers.splice(X--,1))}},i=0;i<e.length;i++)t(i)}var Tl=0,xr=function(e,t,i,r,d){if(!(this instanceof xr))return new xr(e,t,i,r,d);i==null&&(i=0),ca.call(this,[new da([new ir("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var k=lt(i,0);this.sel=di(k),this.history=new za(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=d=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),bo(this,{from:k,to:k,text:e}),cr(this,di(k),Fe)};xr.prototype=ae(ca.prototype,{constructor:xr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Bt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:qn(function(e){var t=lt(this.first,0),i=this.first+this.size-1;Ni(this,{from:t,to:lt(i,St(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ta(this.cm,0,0),cr(this,di(t),Fe)}),replaceRange:function(e,t,i,r){t=b(this,t),i=i?b(this,i):t,Bi(this,e,t,i,r)},getRange:function(e,t,i){var r=ln(this,b(this,e),b(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(mn(this,e))return St(this,e)},getLineNumber:function(e){return Mt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=St(this,e)),Qn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return b(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qn(function(e,t,i){is(this,b(this,typeof e=="number"?lt(e,t||0):e),null,i)}),setSelection:qn(function(e,t,i){is(this,b(this,e),b(this,t||e),i)}),extendSelection:qn(function(e,t,i){Va(this,b(this,e),t&&b(this,t),i)}),extendSelections:qn(function(e,t){rs(this,V(this,e),t)}),extendSelectionsBy:qn(function(e,t){var i=ye(this.sel.ranges,e);rs(this,V(this,i),t)}),setSelections:qn(function(e,t,i){if(!e.length)return;for(var r=[],d=0;d<e.length;d++)r[d]=new Dn(b(this,e[d].anchor),b(this,e[d].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),cr(this,Xr(this.cm,r,t),i)}),addSelection:qn(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Dn(b(this,e),b(this,t||e))),cr(this,Xr(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var d=ln(this,t[r].from(),t[r].to());i=i?i.concat(d):d}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var d=ln(this,i[r].from(),i[r].to());e!==!1&&(d=d.join(e||this.lineSeparator())),t[r]=d}return t},replaceSelection:function(e,t,i){for(var r=[],d=0;d<this.sel.ranges.length;d++)r[d]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:qn(function(e,t,i){for(var r=[],d=this.sel,k=0;k<d.ranges.length;k++){var X=d.ranges[k];r[k]={from:X.from(),to:X.to(),text:this.splitLines(e[k]),origin:i}}for(var Z=t&&t!="end"&&hl(this,r,t),$=r.length-1;$>=0;$--)Ni(this,r[$]);Z?as(this,Z):this.cm&&Ii(this.cm)}),undo:qn(function(){Ya(this,"undo")}),redo:qn(function(){Ya(this,"redo")}),undoSelection:qn(function(){Ya(this,"undo",!0)}),redoSelection:qn(function(){Ya(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var d=0;d<e.undone.length;d++)e.undone[d].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new za(this.history.maxGeneration),hi(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:Pi(this.history.done),undone:Pi(this.history.undone)}},setHistory:function(e){var t=this.history=new za(this.history.maxGeneration);t.done=Pi(e.done.slice(0),null,!0),t.undone=Pi(e.undone.slice(0),null,!0)},setGutterMarker:qn(function(e,t,i){return ua(this,e,"gutter",function(r){var d=r.gutterMarkers||(r.gutterMarkers={});return d[t]=i,!i&&We(d)&&(r.gutterMarkers=null),!0})}),clearGutter:qn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&ua(t,i,"gutter",function(){return i.gutterMarkers[e]=null,We(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!mn(this,e))return null;if(t=e,e=St(this,e),!e)return null}else if(t=Mt(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:qn(function(e,t,i){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[d])r[d]=i;else{if(A(i).test(r[d]))return!1;r[d]+=" "+i}return!0})}),removeLineClass:qn(function(e,t,i){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var d=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",k=r[d];if(k)if(i==null)r[d]=null;else{var X=k.match(A(i));if(!X)return!1;var Z=X.index+X[0].length;r[d]=k.slice(0,X.index)+(!X.index||Z==k.length?"":" ")+k.slice(Z)||null}else return!1;return!0})}),addLineWidget:qn(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ui(this,b(this,e),b(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=b(this,e),Ui(this,e,e,i,"bookmark")},findMarksAt:function(e){e=b(this,e);var t=[],i=St(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var d=i[r];(d.from==null||d.from<=e.ch)&&(d.to==null||d.to>=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,i){e=b(this,e),t=b(this,t);var r=[],d=e.line;return this.iter(e.line,t.line+1,function(k){var X=k.markedSpans;if(X)for(var Z=0;Z<X.length;Z++){var $=X[Z];!($.to!=null&&d==e.line&&e.ch>=$.to||$.from==null&&d!=e.line||$.from!=null&&d==t.line&&$.from>=t.ch)&&(!i||i($.marker))&&r.push($.marker.parent||$.marker)}++d}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(d){var k=d.text.length+r;if(k>e)return t=e,!0;e-=k,++i}),b(this,lt(i,t))},indexFromPos:function(e){e=b(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new xr(Bt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new xr(Bt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,bs(this)),r},unlinkDoc:function(e){if(e instanceof Un&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(bs(this));break}if(e.history==this.history){var r=[e.id];hi(e,function(d){return r.push(d.id)},!0),e.history=new za(null),e.history.done=Pi(this.history.done,r),e.history.undone=Pi(this.history.undone,r)}},iterLinkedDocs:function(e){hi(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:qn(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)})}),xr.prototype.eachLine=xr.prototype.iter;var Es=0;function wl(e){var t=this;if(xs(t),nt(t,e)||Gr(t.display,e))return;re(e),j&&(Es=+new Date);var i=It(t,e,!0),r=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var d=r.length,k=Array(d),X=0,Z=function(){++X==d&&Zn(t,function(){i=b(t.doc,i);var ze={from:i,to:i,text:t.doc.splitLines(k.filter(function(ht){return ht!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ni(t.doc,ze),as(t.doc,di(b(t.doc,i),b(t.doc,ci(ze))))})()},$=function(ze,ht){if(t.options.allowDropFileTypes&&pe(t.options.allowDropFileTypes,ze.type)==-1){Z();return}var Et=new FileReader;Et.onerror=function(){return Z()},Et.onload=function(){var Dt=Et.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Dt)){Z();return}k[ht]=Dt,Z()},Et.readAsText(ze)},ne=0;ne<r.length;ne++)$(r[ne],ne);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ce=e.dataTransfer.getData("Text");if(Ce){var Re;if(t.state.draggingText&&!t.state.draggingText.copy&&(Re=t.listSelections()),Xa(t.doc,di(i,i)),Re)for(var Ye=0;Ye<Re.length;++Ye)Bi(t.doc,"",Re[Ye].anchor,Re[Ye].head,"drag");t.replaceSelection(Ce,"around","paste"),t.display.input.focus()}}catch(ze){}}}function Dl(e,t){if(j&&(!e.state.draggingText||+new Date-Es<100)){Ee(t);return}if(nt(e,t)||Gr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!w){var i=l("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),g&&i.parentNode.removeChild(i)}}function Rl(e,t){var i=It(e,t);if(!i)return;var r=document.createDocumentFragment();Ua(e,i,r),e.display.dragCursor||(e.display.dragCursor=l("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,r)}function xs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var d=t[r].CodeMirror;d&&i.push(d)}i.length&&i[0].operation(function(){for(var k=0;k<i.length;k++)e(i[k])})}var Ss=!1;function Ol(){if(Ss)return;Ll(),Ss=!0}function Ll(){var e;we(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cs(Ml)},100))}),we(window,"blur",function(){return Cs(Mi)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var pi={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"},pa=0;pa<10;pa++)pi[pa+48]=pi[pa+96]=String(pa);for(var Ja=65;Ja<=90;Ja++)pi[Ja]=String.fromCharCode(Ja);for(var ma=1;ma<=12;ma++)pi[ma+111]=pi[ma+63235]="F"+ma;var ti={};ti.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"},ti.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"},ti.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"},ti.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"]},ti.default=o?ti.macDefault:ti.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,d,k,X=0;X<t.length-1;X++){var Z=t[X];if(/^(cmd|meta|m)$/i.test(Z))k=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))r=!0;else if(/^s(hift)?$/i.test(Z))d=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),k&&(e="Cmd-"+e),d&&(e="Shift-"+e),e}function _l(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var d=ye(i.split(" "),Il),k=0;k<d.length;k++){var X=void 0,Z=void 0;k==d.length-1?(Z=d.join(" "),X=r):(Z=d.slice(0,k+1).join(" "),X="...");var $=t[Z];if(!$)t[Z]=X;else if($!=X)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var ne in t)e[ne]=t[ne];return e}function Fi(e,t,i,r){t=Za(t);var d=t.call?t.call(e,r):t[e];if(d===!1)return"nothing";if(d==="...")return"multi";if(d!=null&&i(d))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Fi(e,t.fallthrough,i,r);for(var k=0;k<t.fallthrough.length;k++){var X=Fi(e,t.fallthrough[k],i,r);if(X)return X}}}function As(e){var t=typeof e=="string"?e:pi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ts(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(v?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(v?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ws(e,t){if(g&&e.keyCode==34&&e.char)return!1;var i=pi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Ts(i,e,t))}function Za(e){return typeof e=="string"?ti[e]:e}function ji(e,t){for(var i=e.doc.sel.ranges,r=[],d=0;d<i.length;d++){for(var k=t(i[d]);r.length&&Rt(k.from,te(r).to)<=0;){var X=r.pop();if(Rt(X.from,k.from)<0){k.from=X.from;break}}r.push(k)}Or(e,function(){for(var Z=r.length-1;Z>=0;Z--)Bi(e.doc,"",r[Z].from,r[Z].to,"+delete");Ii(e)})}function So(e,t,i){var r=Ze(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ao(e,t,i){var r=So(e,t.ch,i);return r==null?null:new lt(t.line,r,i<0?"after":"before")}function To(e,t,i,r,d){if(e){t.doc.direction=="rtl"&&(d=-d);var k=wt(i,t.doc.direction);if(k){var X=d<0?te(k):k[0],Z=d<0==(X.level==1),$=Z?"after":"before",ne;if(X.level>0||t.doc.direction=="rtl"){var Ce=li(t,i);ne=d<0?i.text.length-1:0;var Re=mr(t,Ce,ne).top;ne=yt(function(Ye){return mr(t,Ce,Ye).top==Re},d<0==(X.level==1)?X.from:X.to-1,ne),$=="before"&&(ne=So(i,ne,1))}else ne=d<0?X.to:X.from;return new lt(r,ne,$)}}return new lt(r,d<0?i.text.length:0,d<0?"before":"after")}function Pl(e,t,i,r){var d=wt(t,e.doc.direction);if(!d)return Ao(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var k=pt(d,i.ch,i.sticky),X=d[k];if(e.doc.direction=="ltr"&&X.level%2==0&&(r>0?X.to>i.ch:X.from<i.ch))return Ao(t,i,r);var Z=function(Pt,Wt){return So(t,Pt instanceof lt?Pt.ch:Pt,Wt)},$,ne=function(Pt){return e.options.lineWrapping?($=$||li(e,t),Pa(e,t,$,Pt)):{begin:0,end:t.text.length}},Ce=ne(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||X.level==1){var Re=X.level==1==r<0,Ye=Z(i,Re?1:-1);if(Ye!=null&&(Re?Ye<=X.to&&Ye<=Ce.end:Ye>=X.from&&Ye>=Ce.begin)){var ze=Re?"before":"after";return new lt(i.line,Ye,ze)}}var ht=function(Pt,Wt,kt){for(var Vt=function(Pn,$n){return $n?new lt(i.line,Z(Pn,1),"before"):new lt(i.line,Pn,"after")};Pt>=0&&Pt<d.length;Pt+=Wt){var sn=d[Pt],an=Wt>0==(sn.level!=1),vn=an?kt.begin:Z(kt.end,-1);if(sn.from<=vn&&vn<sn.to)return Vt(vn,an);if(vn=an?sn.from:Z(sn.to,-1),kt.begin<=vn&&vn<kt.end)return Vt(vn,an)}},Et=ht(k+r,r,Ce);if(Et)return Et;var Dt=r>0?Ce.end:Z(Ce.begin,-1);return Dt!=null&&!(r>0&&Dt==t.text.length)&&(Et=ht(r>0?0:d.length-1,r,ne(Dt)),Et)?Et:null}var ga={selectAll:ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Fe)},killLine:function(e){return ji(e,function(t){if(t.empty()){var i=St(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:lt(t.head.line+1,0)}:{from:t.head,to:lt(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ji(e,function(t){return{from:lt(t.from().line,0),to:b(e.doc,lt(t.to().line+1,0))}})},delLineLeft:function(e){return ji(e,function(t){return{from:lt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ji(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ji(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(lt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(lt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Rs(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 i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},_e)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},_e)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Rs(e,t.head):r},_e)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,d=0;d<i.length;d++){var k=i[d].from(),X=q(e.getLine(k.line),k.ch,r);t.push(he(r-X%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Or(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var d=t[r].head,k=St(e.doc,d.line).text;if(k){if(d.ch==k.length&&(d=new lt(d.line,d.ch-1)),d.ch>0)d=new lt(d.line,d.ch+1),e.replaceRange(k.charAt(d.ch-1)+k.charAt(d.ch-2),lt(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var X=St(e.doc,d.line-1).text;X&&(d=new lt(d.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),lt(d.line-1,X.length-1),d,"+transpose"))}}i.push(new Dn(d,d))}e.setSelections(i)})},newlineAndIndent:function(e){return Or(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Ii(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ds(e,t){var i=St(e.doc,t),r=Qn(i);return r!=i&&(t=Mt(r)),To(!0,e,r,t,1)}function kl(e,t){var i=St(e.doc,t),r=zr(i);return r!=i&&(t=Mt(r)),To(!0,e,i,t,-1)}function Rs(e,t){var i=Ds(e,t.line),r=St(e.doc,i.line),d=wt(r,e.doc.direction);if(!d||d[0].level==0){var k=Math.max(i.ch,r.text.search(/\S/)),X=t.line==i.line&&t.ch<=k&&t.ch;return lt(i.line,X?0:k,i.sticky)}return i}function qa(e,t,i){if(typeof t=="string"&&(t=ga[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),d=t(e)!=Ge}finally{e.display.shift=r,e.state.suppressEdits=!1}return d}function Nl(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var d=Fi(t,e.state.keyMaps[r],i,e);if(d)return d}return e.options.extraKeys&&Fi(t,e.options.extraKeys,i,e)||Fi(t,e.options.keyMap,i,e)}var Bl=new le;function va(e,t,i,r){var d=e.state.keySeq;if(d){if(As(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==d&&(e.state.keySeq=null,e.display.input.reset())}),Os(e,d+" "+t,i,r))return!0}return Os(e,t,i,r)}function Os(e,t,i,r){var d=Nl(e,t,r);return d=="multi"&&(e.state.keySeq=t),d=="handled"&&Cn(e,"keyHandled",e,t,i),(d=="handled"||d=="multi")&&(re(i),so(e)),!!d}function Ls(e,t){var i=ws(t,!0);return i?t.shiftKey&&!e.state.keySeq?va(e,"Shift-"+i,t,function(r){return qa(e,r,!0)})||va(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return qa(e,r)}):va(e,i,t,function(r){return qa(e,r)}):!1}function Ul(e,t,i){return va(e,"'"+i+"'",t,function(r){return qa(e,r,!0)})}var wo=null;function Ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=I(),nt(t,e))return;j&&U<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Ls(t,e);g&&(wo=r?i:null,!r&&i==88&&!Pe&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),P&&!o&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;C(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(p(t,"CodeMirror-crosshair"),st(document,"keyup",i),st(document,"mouseover",i))}we(document,"keyup",i),we(document,"mouseover",i)}function Is(e){e.keyCode==16&&(this.doc.sel.shift=!1),nt(this,e)}function _s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Gr(t.display,e)||nt(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var i=e.keyCode,r=e.charCode;if(g&&i==wo){wo=null,re(e);return}if(g&&(!e.which||e.which<10)&&Ls(t,e))return;var d=String.fromCharCode(r==null?i:r);if(d=="\b")return;if(Ul(t,e,d))return;t.display.input.onKeyPress(e)}var jl=400,Do=function(e,t,i){this.time=e,this.pos=t,this.button=i};Do.prototype.compare=function(e,t,i){return this.time+jl>e&&Rt(t,this.pos)==0&&i==this.button};var ya,ba;function Wl(e,t){var i=+new Date;return ba&&ba.compare(i,e,t)?(ya=ba=null,"triple"):ya&&ya.compare(i,e,t)?(ba=new Do(i,e,t),ya=null,"double"):(ya=new Do(i,e,t),ba=null,"single")}function Ps(e){var t=this,i=t.display;if(nt(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Gr(i,e)){_||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Ro(t,e))return;var r=It(t,e),d=Ie(e),k=r?Wl(r,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,d,r,k,e))return;d==1?r?zl(t,r,k,e):Be(e)==i.scroller&&re(e):d==2?(r&&Va(t.doc,r),setTimeout(function(){return i.input.focus()},20)):d==3&&(O?t.display.input.onContextMenu(e):ko(t))}function Hl(e,t,i,r,d){var k="Click";return r=="double"?k="Double"+k:r=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,va(e,Ts(k,d),d,function(X){if(typeof X=="string"&&(X=ga[X]),!X)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=X(e,i)!=Ge}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,i){var r=e.getOption("configureMouse"),d=r?r(e,t,i):{};if(d.unit==null){var k=u?i.shiftKey&&i.metaKey:i.altKey;d.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||i.shiftKey),d.addNew==null&&(d.addNew=o?i.metaKey:i.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(o?i.altKey:i.ctrlKey)),d}function zl(e,t,i,r){j?setTimeout(H(Po,e),0):e.curOp.focus=I();var d=Kl(e,i,r),k=e.doc.sel,X;e.options.dragDrop&&ut&&!e.isReadOnly()&&i=="single"&&(X=k.contains(t))>-1&&(Rt((X=k.ranges[X]).from(),t)<0||t.xRel>0)&&(Rt(X.to(),t)>0||t.xRel<0)?Gl(e,r,t,d):Vl(e,r,t,d)}function Gl(e,t,i,r){var d=e.display,k=!1,X=Zn(e,function(ne){_&&(d.scroller.draggable=!1),e.state.draggingText=!1,st(d.wrapper.ownerDocument,"mouseup",X),st(d.wrapper.ownerDocument,"mousemove",Z),st(d.scroller,"dragstart",$),st(d.scroller,"drop",X),k||(re(ne),r.addNew||Va(e.doc,i,null,null,r.extend),_&&!w||j&&U==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),Z=function(ne){k=k||Math.abs(t.clientX-ne.clientX)+Math.abs(t.clientY-ne.clientY)>=10},$=function(){return k=!0};_&&(d.scroller.draggable=!0),e.state.draggingText=X,X.copy=!r.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),we(d.wrapper.ownerDocument,"mouseup",X),we(d.wrapper.ownerDocument,"mousemove",Z),we(d.scroller,"dragstart",$),we(d.scroller,"drop",X),ko(e),setTimeout(function(){return d.input.focus()},20)}function ks(e,t,i){if(i=="char")return new Dn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Dn(lt(t.line,0),b(e.doc,lt(t.line+1,0)));var r=i(e,t);return new Dn(r.from,r.to)}function Vl(e,t,i,r){var d=e.display,k=e.doc;re(t);var X,Z,$=k.sel,ne=$.ranges;if(r.addNew&&!r.extend?(Z=k.sel.contains(i),Z>-1?X=ne[Z]:X=new Dn(i,i)):(X=k.sel.primary(),Z=k.sel.primIndex),r.unit=="rectangle")r.addNew||(X=new Dn(i,i)),i=It(e,t,!0,!0),Z=-1;else{var Ce=ks(e,i,r.unit);r.extend?X=xo(X,Ce.anchor,Ce.head,r.extend):X=Ce}r.addNew?Z==-1?(Z=ne.length,cr(k,Xr(e,ne.concat([X]),Z),{scroll:!1,origin:"*mouse"})):ne.length>1&&ne[Z].empty()&&r.unit=="char"&&!r.extend?(cr(k,Xr(e,ne.slice(0,Z).concat(ne.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),$=k.sel):Co(k,Z,X,Ue):(Z=0,cr(k,new Br([X],0),Ue),$=k.sel);var Re=i;function Ye(kt){if(Rt(Re,kt)==0)return;if(Re=kt,r.unit=="rectangle"){for(var Vt=[],sn=e.options.tabSize,an=q(St(k,i.line).text,i.ch,sn),vn=q(St(k,kt.line).text,kt.ch,sn),Pn=Math.min(an,vn),$n=Math.max(an,vn),Fn=Math.min(i.line,kt.line),Lr=Math.min(e.lastLine(),Math.max(i.line,kt.line));Fn<=Lr;Fn++){var Cr=St(k,Fn).text,zn=je(Cr,Pn,sn);Pn==$n?Vt.push(new Dn(lt(Fn,zn),lt(Fn,zn))):Cr.length>zn&&Vt.push(new Dn(lt(Fn,zn),lt(Fn,je(Cr,$n,sn))))}Vt.length||Vt.push(new Dn(i,i)),cr(k,Xr(e,$.ranges.slice(0,Z).concat(Vt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(kt)}else{var Sr=X,ar=ks(e,kt,r.unit),Yn=Sr.anchor,Gn;Rt(ar.anchor,Yn)>0?(Gn=ar.head,Yn=cn(Sr.from(),ar.anchor)):(Gn=ar.anchor,Yn=un(Sr.to(),ar.head));var jn=$.ranges.slice(0);jn[Z]=Xl(e,new Dn(b(k,Yn),Gn)),cr(k,Xr(e,jn,Z),Ue)}}var ze=d.wrapper.getBoundingClientRect(),ht=0;function Et(kt){var Vt=++ht,sn=It(e,kt,!0,r.unit=="rectangle");if(!sn)return;if(Rt(sn,Re)!=0){e.curOp.focus=I(),Ye(sn);var an=ja(d,k);(sn.line>=an.to||sn.line<an.from)&&setTimeout(Zn(e,function(){ht==Vt&&Et(kt)}),150)}else{var vn=kt.clientY<ze.top?-20:kt.clientY>ze.bottom?20:0;vn&&setTimeout(Zn(e,function(){if(ht!=Vt)return;d.scroller.scrollTop+=vn,Et(kt)}),50)}}function Dt(kt){e.state.selectingText=!1,ht=Infinity,kt&&(re(kt),d.input.focus()),st(d.wrapper.ownerDocument,"mousemove",Pt),st(d.wrapper.ownerDocument,"mouseup",Wt),k.history.lastSelOrigin=null}var Pt=Zn(e,function(kt){kt.buttons===0||!Ie(kt)?Dt(kt):Et(kt)}),Wt=Zn(e,Dt);e.state.selectingText=Wt,we(d.wrapper.ownerDocument,"mousemove",Pt),we(d.wrapper.ownerDocument,"mouseup",Wt)}function Xl(e,t){var i=t.anchor,r=t.head,d=St(e.doc,i.line);if(Rt(i,r)==0&&i.sticky==r.sticky)return t;var k=wt(d);if(!k)return t;var X=pt(k,i.ch,i.sticky),Z=k[X];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var $=X+(Z.from==i.ch==(Z.level!=1)?0:1);if($==0||$==k.length)return t;var ne;if(r.line!=i.line)ne=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ce=pt(k,r.ch,r.sticky),Re=Ce-X||(r.ch-i.ch)*(Z.level==1?-1:1);Ce==$-1||Ce==$?ne=Re<0:ne=Re>0}var Ye=k[$+(ne?-1:0)],ze=ne==(Ye.level==1),ht=ze?Ye.from:Ye.to,Et=ze?"after":"before";return i.ch==ht&&i.sticky==Et?t:new Dn(new lt(i.line,ht,Et),r)}function Ns(e,t,i,r){var d,k;if(t.touches)d=t.touches[0].clientX,k=t.touches[0].clientY;else try{d=t.clientX,k=t.clientY}catch(Ye){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&re(t);var X=e.display,Z=X.lineDiv.getBoundingClientRect();if(k>Z.bottom||!ge(e,i))return ce(t);k-=Z.top-X.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var ne=X.gutters.childNodes[$];if(ne&&ne.getBoundingClientRect().right>=d){var Ce=tn(e.doc,k),Re=e.display.gutterSpecs[$];return He(e,i,e,Ce,Re.className,t),ce(t)}}}function Ro(e,t){return Ns(e,t,"gutterClick",!0)}function Bs(e,t){if(Gr(e.display,t)||Ql(e,t))return;if(nt(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Ql(e,t){return ge(e,"gutterContextMenu")?Ns(e,t,"gutterContextMenu",!1):!1}function Us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bi(e)}var Wi={toString:function(){return"CodeMirror.Init"}},Fs={},$a={};function Yl(e){var t=e.optionHandlers;function i(r,d,k,X){e.defaults[r]=d,k&&(t[r]=X?function(Z,$,ne){ne!=Wi&&k(Z,$,ne)}:k)}e.defineOption=i,e.Init=Wi,i("value","",function(r,d){return r.setValue(d)},!0),i("mode",null,function(r,d){r.doc.modeOption=d,yo(r)},!0),i("indentUnit",2,yo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){sa(r),bi(r),Lt(r)},!0),i("lineSeparator",null,function(r,d){if(r.doc.lineSep=d,!d)return;var k=[],X=r.doc.first;r.doc.iter(function($){for(var ne=0;;){var Ce=$.text.indexOf(d,ne);if(Ce==-1)break;ne=Ce+d.length,k.push(lt(X,Ce))}X++});for(var Z=k.length-1;Z>=0;Z--)Bi(r.doc,d,k[Z],lt(k[Z].line,k[Z].ch+d.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,d,k){r.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),k!=Wi&&r.refresh()}),i("specialCharPlaceholder",En,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,d){return r.getInputField().spellcheck=d},!0),i("autocorrect",!1,function(r,d){return r.getInputField().autocorrect=d},!0),i("autocapitalize",!1,function(r,d){return r.getInputField().autocapitalize=d},!0),i("rtlMoveVisually",!x),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Us(r),oa(r)},!0),i("keyMap","default",function(r,d,k){var X=Za(d),Z=k!=Wi&&Za(k);Z&&Z.detach&&Z.detach(r,X),X.attach&&X.attach(r,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(r,d){r.display.gutterSpecs=go(d,r.options.lineNumbers),oa(r)},!0),i("fixedGutter",!0,function(r,d){r.display.gutters.style.left=d?rt(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return _i(r)},!0),i("scrollbarStyle","native",function(r){Wo(r),_i(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,d){r.display.gutterSpecs=go(r.options.gutters,d),oa(r)},!0),i("firstLineNumber",1,oa,!0),i("lineNumberFormatter",function(r){return r},oa,!0),i("showCursorWhenSelecting",!1,In,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,d){d=="nocursor"&&(Mi(r),r.display.input.blur()),r.display.input.readOnlyChanged(d)}),i("screenReaderLabel",null,function(r,d){d=d===""?null:d,r.display.input.screenReaderLabelChanged(d)}),i("disableInput",!1,function(r,d){d||r.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,In,!0),i("singleCursorHeightPerLine",!0,In,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,sa,!0),i("addModeClass",!1,sa,!0),i("pollInterval",100),i("undoDepth",200,function(r,d){return r.doc.history.undoDepth=d}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,sa,!0),i("moveInputWithCursor",!0,function(r,d){d||r.display.input.resetPosition()}),i("tabindex",null,function(r,d){return r.display.input.getField().tabIndex=d||""}),i("autofocus",null),i("direction","ltr",function(r,d){return r.doc.setDirection(d)},!0),i("phrases",null)}function Jl(e,t,i){var r=i&&i!=Wi;if(!t!=!r){var d=e.display.dragFunctions,k=t?we:st;k(e.display.scroller,"dragstart",d.start),k(e.display.scroller,"dragenter",d.enter),k(e.display.scroller,"dragover",d.over),k(e.display.scroller,"dragleave",d.leave),k(e.display.scroller,"drop",d.drop)}}function Zl(e){e.options.lineWrapping?(C(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(p(e.display.wrapper,"CodeMirror-wrap"),Zr(e)),mt(e),Lt(e),bi(e),setTimeout(function(){return _i(e)},100)}function Un(e,t){var i=this;if(!(this instanceof Un))return new Un(e,t);this.options=t=t?F(t):{},F(Fs,t,!1);var r=t.value;typeof r=="string"?r=new xr(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var d=new Un.inputStyles[t.inputStyle](this),k=this.display=new dl(e,r,d,t);k.wrapper.CodeMirror=this,Us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new le,keySeq:null,specialChars:null},t.autofocus&&!n&&k.input.focus(),j&&U<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Ol(),Ci(this),this.curOp.forceUpdate=!0,Zo(this,r),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&lo(i)},20):Mi(this);for(var X in $a)$a.hasOwnProperty(X)&&$a[X](this,t[X],Wi);zo(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<Oo.length;++Z)Oo[Z](this);Si(this),_&&t.lineWrapping&&getComputedStyle(k.lineDiv).textRendering=="optimizelegibility"&&(k.lineDiv.style.textRendering="auto")}Un.defaults=Fs,Un.optionHandlers=$a;function ql(e){var t=e.display;we(t.scroller,"mousedown",Zn(e,Ps)),j&&U<11?we(t.scroller,"dblclick",Zn(e,function($){if(nt(e,$))return;var ne=It(e,$);if(!ne||Ro(e,$)||Gr(e.display,$))return;re($);var Ce=e.findWordAt(ne);Va(e.doc,Ce.anchor,Ce.head)})):we(t.scroller,"dblclick",function($){return nt(e,$)||re($)}),we(t.scroller,"contextmenu",function($){return Bs(e,$)}),we(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||Bs(e,$)});var i,r={end:0};function d(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function k($){if($.touches.length!=1)return!1;var ne=$.touches[0];return ne.radiusX<=1&&ne.radiusY<=1}function X($,ne){if(ne.left==null)return!0;var Ce=ne.left-$.left,Re=ne.top-$.top;return Ce*Ce+Re*Re>20*20}we(t.scroller,"touchstart",function($){if(!nt(e,$)&&!k($)&&!Ro(e,$)){t.input.ensurePolled(),clearTimeout(i);var ne=+new Date;t.activeTouch={start:ne,moved:!1,prev:ne-r.end<=300?r:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),we(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),we(t.scroller,"touchend",function($){var ne=t.activeTouch;if(ne&&!Gr(t,$)&&ne.left!=null&&!ne.moved&&new Date-ne.start<300){var Ce=e.coordsChar(t.activeTouch,"page"),Re;!ne.prev||X(ne,ne.prev)?Re=new Dn(Ce,Ce):!ne.prev.prev||X(ne,ne.prev.prev)?Re=e.findWordAt(Ce):Re=new Dn(lt(Ce.line,0),b(e.doc,lt(Ce.line+1,0))),e.setSelection(Re.anchor,Re.head),e.focus(),re($)}d()}),we(t.scroller,"touchcancel",d),we(t.scroller,"scroll",function(){t.scroller.clientHeight&&(na(e,t.scroller.scrollTop),Ei(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),we(t.scroller,"mousewheel",function($){return Xo(e,$)}),we(t.scroller,"DOMMouseScroll",function($){return Xo(e,$)}),we(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){nt(e,$)||Ee($)},over:function($){nt(e,$)||(Rl(e,$),Ee($))},start:function($){return Dl(e,$)},drop:Zn(e,wl),leave:function($){nt(e,$)||xs(e)}};var Z=t.input.getField();we(Z,"keyup",function($){return Is.call(e,$)}),we(Z,"keydown",Zn(e,Ms)),we(Z,"keypress",Zn(e,_s)),we(Z,"focus",function($){return lo(e,$)}),we(Z,"blur",function($){return Mi(e,$)})}var Oo=[];Un.defineInitHook=function(e){return Oo.push(e)};function Ea(e,t,i,r){var d=e.doc,k;i==null&&(i="add"),i=="smart"&&(d.mode.indent?k=Ot(e,t).state:i="prev");var X=e.options.tabSize,Z=St(d,t),$=q(Z.text,null,X);Z.stateAfter&&(Z.stateAfter=null);var ne=Z.text.match(/^\s*/)[0],Ce;if(!r&&!/\S/.test(Z.text))Ce=0,i="not";else if(i=="smart"&&(Ce=d.mode.indent(k,Z.text.slice(ne.length),Z.text),Ce==Ge||Ce>150)){if(!r)return;i="prev"}i=="prev"?t>d.first?Ce=q(St(d,t-1).text,null,X):Ce=0:i=="add"?Ce=$+e.options.indentUnit:i=="subtract"?Ce=$-e.options.indentUnit:typeof i=="number"&&(Ce=$+i),Ce=Math.max(0,Ce);var Re="",Ye=0;if(e.options.indentWithTabs)for(var ze=Math.floor(Ce/X);ze;--ze)Ye+=X,Re+=" ";if(Ye<Ce&&(Re+=he(Ce-Ye)),Re!=ne)return Bi(d,Re,lt(t,0),lt(t,ne.length),"+input"),Z.stateAfter=null,!0;for(var ht=0;ht<d.sel.ranges.length;ht++){var Et=d.sel.ranges[ht];if(Et.head.line==t&&Et.head.ch<ne.length){var Dt=lt(t,ne.length);Co(d,ht,new Dn(Dt,Dt));break}}}var Qr=null;function eo(e){Qr=e}function Lo(e,t,i,r,d){var k=e.doc;e.display.shift=!1,r||(r=k.sel);var X=+new Date-200,Z=d=="paste"||e.state.pasteIncoming>X,$=qe(t),ne=null;if(Z&&r.ranges.length>1)if(Qr&&Qr.text.join(`
`)==t){if(r.ranges.length%Qr.text.length==0){ne=[];for(var Ce=0;Ce<Qr.text.length;Ce++)ne.push(k.splitLines(Qr.text[Ce]))}}else $.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(ne=ye($,function(Pt){return[Pt]}));for(var Re=e.curOp.updateInput,Ye=r.ranges.length-1;Ye>=0;Ye--){var ze=r.ranges[Ye],ht=ze.from(),Et=ze.to();ze.empty()&&(i&&i>0?ht=lt(ht.line,ht.ch-i):e.state.overwrite&&!Z?Et=lt(Et.line,Math.min(St(k,Et.line).text.length,Et.ch+te($).length)):Z&&Qr&&Qr.lineWise&&Qr.text.join(`
`)==$.join(`
`)&&(ht=Et=lt(ht.line,0)));var Dt={from:ht,to:Et,text:ne?ne[Ye%ne.length]:$,origin:d||(Z?"paste":e.state.cutIncoming>X?"cut":"+input")};Ni(e.doc,Dt),Cn(e,"inputRead",e,Dt)}t&&!Z&&Ws(e,t),Ii(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Re),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function js(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Or(t,function(){return Lo(t,i,0,null,"paste")}),!0}function Ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var d=i.ranges[r];if(d.head.ch>100||r&&i.ranges[r-1].head.line==d.head.line)continue;var k=e.getModeAt(d.head),X=!1;if(k.electricChars){for(var Z=0;Z<k.electricChars.length;Z++)if(t.indexOf(k.electricChars.charAt(Z))>-1){X=Ea(e,d.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(St(e.doc,d.head.line).text.slice(0,d.head.ch))&&(X=Ea(e,d.head.line,"smart")));X&&Cn(e,"electricInput",e,d.head.line)}}function Hs(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var d=e.doc.sel.ranges[r].head.line,k={anchor:lt(d,0),head:lt(d+1,0)};i.push(k),t.push(e.getRange(k.anchor,k.head))}return{text:t,ranges:i}}function Ks(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function zs(){var e=l("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=l("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return _?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Ks(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,d){var k=this.options,X=k[r];if(k[r]==d&&r!="mode")return;k[r]=d,t.hasOwnProperty(r)&&Zn(this,t[r])(this,d,X),He(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,d){this.state.keyMaps[d?"push":"unshift"](Za(r))},removeKeyMap:function(r){for(var d=this.state.keyMaps,k=0;k<d.length;++k)if(d[k]==r||d[k].name==r)return d.splice(k,1),!0},addOverlay:gr(function(r,d){var k=r.token?r:e.getMode(this.options,r);if(k.startState)throw new Error("Overlays may not be stateful.");ue(this.state.overlays,{mode:k,modeSpec:r,opaque:d&&d.opaque,priority:d&&d.priority||0},function(X){return X.priority}),this.state.modeGen++,Lt(this)}),removeOverlay:gr(function(r){for(var d=this.state.overlays,k=0;k<d.length;++k){var X=d[k].modeSpec;if(X==r||typeof r=="string"&&X.name==r){d.splice(k,1),this.state.modeGen++,Lt(this);return}}}),indentLine:gr(function(r,d,k){typeof d!="string"&&typeof d!="number"&&(d==null?d=this.options.smartIndent?"smart":"prev":d=d?"add":"subtract"),mn(this.doc,r)&&Ea(this,r,d,k)}),indentSelection:gr(function(r){for(var d=this.doc.sel.ranges,k=-1,X=0;X<d.length;X++){var Z=d[X];if(Z.empty())Z.head.line>k&&(Ea(this,Z.head.line,r,!0),k=Z.head.line,X==this.doc.sel.primIndex&&Ii(this));else{var $=Z.from(),ne=Z.to(),Ce=Math.max(k,$.line);k=Math.min(this.lastLine(),ne.line-(ne.ch?0:1))+1;for(var Re=Ce;Re<k;++Re)Ea(this,Re,r);var Ye=this.doc.sel.ranges;$.ch==0&&d.length==Ye.length&&Ye[X].from().ch>0&&Co(this.doc,X,new Dn($,Ye[X].to()),Fe)}}}),getTokenAt:function(r,d){return Tn(this,r,d)},getLineTokens:function(r,d){return Tn(this,lt(r),d,!0)},getTokenTypeAt:function(r){r=b(this.doc,r);var d=ot(this,St(this.doc,r.line)),k=0,X=(d.length-1)/2,Z=r.ch,$;if(Z==0)$=d[2];else for(;;){var ne=k+X>>1;if((ne?d[ne*2-1]:0)>=Z)X=ne;else if(d[ne*2+1]<Z)k=ne+1;else{$=d[ne*2+2];break}}var Ce=$?$.indexOf("overlay "):-1;return Ce<0?$:Ce==0?null:$.slice(0,Ce-1)},getModeAt:function(r){var d=this.doc.mode;return d.innerMode?e.innerMode(d,this.getTokenAt(r).state).mode:d},getHelper:function(r,d){return this.getHelpers(r,d)[0]},getHelpers:function(r,d){var k=[];if(!i.hasOwnProperty(d))return k;var X=i[d],Z=this.getModeAt(r);if(typeof Z[d]=="string")X[Z[d]]&&k.push(X[Z[d]]);else if(Z[d])for(var $=0;$<Z[d].length;$++){var ne=X[Z[d][$]];ne&&k.push(ne)}else Z.helperType&&X[Z.helperType]?k.push(X[Z.helperType]):X[Z.name]&&k.push(X[Z.name]);for(var Ce=0;Ce<X._global.length;Ce++){var Re=X._global[Ce];Re.pred(Z,this)&&pe(k,Re.val)==-1&&k.push(Re.val)}return k},getStateAfter:function(r,d){var k=this.doc;return r=G(k,r==null?k.first+k.size-1:r),Ot(this,r+1,d).state},cursorCoords:function(r,d){var k,X=this.doc.sel.primary();return r==null?k=X.head:typeof r=="object"?k=b(this.doc,r):k=r?X.from():X.to(),kr(this,k,d||"page")},charCoords:function(r,d){return qi(this,b(this.doc,r),d||"page")},coordsChar:function(r,d){return r=Ma(this,r,d||"page"),$i(this,r.left,r.top)},lineAtHeight:function(r,d){return r=Ma(this,{top:r,left:0},d||"page").top,tn(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,d,k){var X=!1,Z;if(typeof r=="number"){var $=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>$&&(r=$,X=!0),Z=St(this.doc,r)}else Z=r;return Oi(this,Z,{top:0,left:0},d||"page",k||X).top+(X?this.doc.height-Er(Z):0)},defaultTextHeight:function(){return Ut(this.display)},defaultCharWidth:function(){return me(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,d,k,X,Z){var $=this.display;r=kr(this,b(this.doc,r));var ne=r.bottom,Ce=r.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),$.sizer.appendChild(d),X=="over")ne=r.top;else if(X=="above"||X=="near"){var Re=Math.max($.wrapper.clientHeight,this.doc.height),Ye=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(X=="above"||r.bottom+d.offsetHeight>Re)&&r.top>d.offsetHeight?ne=r.top-d.offsetHeight:r.bottom+d.offsetHeight<=Re&&(ne=r.bottom),Ce+d.offsetWidth>Ye&&(Ce=Ye-d.offsetWidth)}d.style.top=ne+"px",d.style.left=d.style.right="",Z=="right"?(Ce=$.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(Z=="left"?Ce=0:Z=="middle"&&(Ce=($.sizer.clientWidth-d.offsetWidth)/2),d.style.left=Ce+"px"),k&&Js(this,{left:Ce,top:ne,right:Ce+d.offsetWidth,bottom:ne+d.offsetHeight})},triggerOnKeyDown:gr(Ms),triggerOnKeyPress:gr(_s),triggerOnKeyUp:Is,triggerOnMouseDown:gr(Ps),execCommand:function(r){if(ga.hasOwnProperty(r))return ga[r].call(null,this)},triggerElectric:gr(function(r){Ws(this,r)}),findPosH:function(r,d,k,X){var Z=1;d<0&&(Z=-1,d=-d);for(var $=b(this.doc,r),ne=0;ne<d&&!($=Mo(this.doc,$,Z,k,X),$.hitSide);++ne);return $},moveH:gr(function(r,d){var k=this;this.extendSelectionsBy(function(X){return k.display.shift||k.doc.extend||X.empty()?Mo(k.doc,X.head,r,d,k.options.rtlMoveVisually):r<0?X.from():X.to()},_e)}),deleteH:gr(function(r,d){var k=this.doc.sel,X=this.doc;k.somethingSelected()?X.replaceSelection("",null,"+delete"):ji(this,function(Z){var $=Mo(X,Z.head,r,d,!1);return r<0?{from:$,to:Z.head}:{from:Z.head,to:$}})}),findPosV:function(r,d,k,X){var Z=1,$=X;d<0&&(Z=-1,d=-d);for(var ne=b(this.doc,r),Ce=0;Ce<d;++Ce){var Re=kr(this,ne,"div");if($==null?$=Re.left:Re.left=$,ne=Gs(this,Re,Z,k),ne.hitSide)break}return ne},moveV:gr(function(r,d){var k=this,X=this.doc,Z=[],$=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(Ce){if($)return r<0?Ce.from():Ce.to();var Re=kr(k,Ce.head,"div");Ce.goalColumn!=null&&(Re.left=Ce.goalColumn),Z.push(Re.left);var Ye=Gs(k,Re,r,d);return d=="page"&&Ce==X.sel.primary()&&co(k,qi(k,Ye,"div").top-Re.top),Ye},_e),Z.length)for(var ne=0;ne<X.sel.ranges.length;ne++)X.sel.ranges[ne].goalColumn=Z[ne]}),findWordAt:function(r){var d=this.doc,k=St(d,r.line).text,X=r.ch,Z=r.ch;if(k){var $=this.getHelper(r,"wordChars");(r.sticky=="before"||Z==k.length)&&X?--X:++Z;for(var ne=k.charAt(X),Ce=Me(ne,$)?function(Re){return Me(Re,$)}:/\s/.test(ne)?function(Re){return/\s/.test(Re)}:function(Re){return!/\s/.test(Re)&&!Me(Re)};X>0&&Ce(k.charAt(X-1));)--X;for(;Z<k.length&&Ce(k.charAt(Z));)++Z}return new Dn(lt(r.line,X),lt(r.line,Z))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?C(this.display.cursorDiv,"CodeMirror-overwrite"):p(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gr(function(r,d){ta(this,r,d)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-dr(this)-this.display.barHeight,width:r.scrollWidth-dr(this)-this.display.barWidth,clientHeight:ei(this),clientWidth:si(this)}},scrollIntoView:gr(function(r,d){r==null?(r={from:this.doc.sel.primary().head,to:null},d==null&&(d=this.options.cursorScrollMargin)):typeof r=="number"?r={from:lt(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=d||0,r.from.line!=null?Zs(this,r):Bo(this,r.from,r.to,r.margin)}),setSize:gr(function(r,d){var k=this,X=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};r!=null&&(this.display.wrapper.style.width=X(r)),d!=null&&(this.display.wrapper.style.height=X(d)),this.options.lineWrapping&&Oa(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function($){if($.widgets){for(var ne=0;ne<$.widgets.length;ne++)if($.widgets[ne].noHScroll){Zt(k,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(r){return Or(this,r)},startOperation:function(){return Ci(this)},endOperation:function(){return Si(this)},refresh:gr(function(){var r=this.display.cachedTextHeight;Lt(this),this.curOp.forceUpdate=!0,bi(this),ta(this,this.doc.scrollLeft,this.doc.scrollTop),po(this.display),(r==null||Math.abs(r-Ut(this.display))>.5||this.options.lineWrapping)&&mt(this),He(this,"refresh",this)}),swapDoc:gr(function(r){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),Zo(this,r),bi(this),this.display.input.reset(),ta(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Cn(this,"swapDoc",this,d),d}),phrase:function(r){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,r)?d[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(r,d,k){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][d]=k},e.registerGlobalHelper=function(r,d,k,X){e.registerHelper(r,d,X),i[r]._global.push({pred:k,val:X})}}function Mo(e,t,i,r,d){var k=t,X=i,Z=St(e,t.line),$=d&&e.direction=="rtl"?-i:i;function ne(){var Wt=t.line+$;return Wt<e.first||Wt>=e.first+e.size?!1:(t=new lt(Wt,t.ch,t.sticky),Z=St(e,Wt))}function Ce(Wt){var kt;if(r=="codepoint"){var Vt=Z.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Vt)?kt=null:kt=new lt(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(Vt>=55296&&Vt<56320?2:1))),-i)}else d?kt=Pl(e.cm,Z,t,i):kt=Ao(Z,t,i);if(kt==null)if(!Wt&&ne())t=To(d,e.cm,Z,t.line,$);else return!1;else t=kt;return!0}if(r=="char"||r=="codepoint")Ce();else if(r=="column")Ce(!0);else if(r=="word"||r=="group")for(var Re=null,Ye=r=="group",ze=e.cm&&e.cm.getHelper(t,"wordChars"),ht=!0;!(i<0&&!Ce(!ht));ht=!1){var Et=Z.text.charAt(t.ch)||`
`,Dt=Me(Et,ze)?"w":Ye&&Et==`
`?"n":!Ye||/\s/.test(Et)?null:"p";if(Ye&&!ht&&!Dt&&(Dt="s"),Re&&Re!=Dt){i<0&&(i=1,Ce(),t.sticky="after");break}if(Dt&&(Re=Dt),i>0&&!Ce(!ht))break}var Pt=Qa(e,t,k,X,!0);return Jt(k,Pt)&&(Pt.hitSide=!0),Pt}function Gs(e,t,i,r){var d=e.doc,k=t.left,X;if(r=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(Z-.5*Ut(e.display),3);X=(i>0?t.bottom:t.top)+i*$}else r=="line"&&(X=i>0?t.bottom+3:t.top-3);for(var ne;!(ne=$i(e,k,X),!ne.outside);){if(i<0?X<=0:X>=d.height){ne.hitSide=!0;break}X+=i*5}return ne}var On=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new le,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};On.prototype.init=function(e){var t=this,i=this,r=i.cm,d=i.div=e.lineDiv;Ks(d,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function k(Z){for(var $=Z.target;$;$=$.parentNode){if($==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}we(d,"paste",function(Z){if(!k(Z)||nt(r,Z)||js(Z,r))return;U<=11&&setTimeout(Zn(r,function(){return t.updateFromDOM()}),20)}),we(d,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),we(d,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),we(d,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(d,"touchstart",function(){return i.forceCompositionEnd()}),we(d,"input",function(){t.composing||t.readFromDOMSoon()});function X(Z){if(!k(Z)||nt(r,Z))return;if(r.somethingSelected())eo({lineWise:!1,text:r.getSelections()}),Z.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var $=Hs(r);eo({lineWise:!0,text:$.text}),Z.type=="cut"&&r.operation(function(){r.setSelections($.ranges,0,Fe),r.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ne=Qr.text.join(`
`);if(Z.clipboardData.setData("Text",ne),Z.clipboardData.getData("Text")==ne){Z.preventDefault();return}}var Ce=zs(),Re=Ce.firstChild;r.display.lineSpace.insertBefore(Ce,r.display.lineSpace.firstChild),Re.value=Qr.text.join(`
`);var Ye=document.activeElement;Y(Re),setTimeout(function(){r.display.lineSpace.removeChild(Ce),Ye.focus(),Ye==d&&i.showPrimarySelection()},50)}we(d,"copy",X),we(d,"cut",X)},On.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},On.prototype.prepareSelection=function(){var e=ui(this.cm,!1);return e.focus=document.activeElement==this.div,e},On.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},On.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},On.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),d=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||d.line<t.display.viewFrom){e.removeAllRanges();return}var k=to(t,e.anchorNode,e.anchorOffset),X=to(t,e.focusNode,e.focusOffset);if(k&&!k.bad&&X&&!X.bad&&Rt(cn(k,X),r)==0&&Rt(un(k,X),d)==0)return;var Z=t.display.view,$=r.line>=t.display.viewFrom&&Vs(t,r)||{node:Z[0].measure.map[2],offset:0},ne=d.line<t.display.viewTo&&Vs(t,d);if(!ne){var Ce=Z[Z.length-1].measure,Re=Ce.maps?Ce.maps[Ce.maps.length-1]:Ce.map;ne={node:Re[Re.length-1],offset:Re[Re.length-2]-Re[Re.length-3]}}if(!$||!ne){e.removeAllRanges();return}var Ye=e.rangeCount&&e.getRangeAt(0),ze;try{ze=T($.node,$.offset,ne.offset,ne.node)}catch(ht){}ze&&(!P&&t.state.focused?(e.collapse($.node,$.offset),ze.collapsed||(e.removeAllRanges(),e.addRange(ze))):(e.removeAllRanges(),e.addRange(ze)),Ye&&e.anchorNode==null?e.addRange(Ye):P&&this.startGracePeriod()),this.rememberSelection()},On.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)},On.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},On.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},On.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return S(this.div,t)},On.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},On.prototype.blur=function(){this.div.blur()},On.prototype.getField=function(){return this.div},On.prototype.supportsTouch=function(){return!0},On.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Or(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)},On.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},On.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(a&&c&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=to(t,e.anchorNode,e.anchorOffset),r=to(t,e.focusNode,e.focusOffset);i&&r&&Or(t,function(){cr(t.doc,di(i,r),Fe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},On.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),d=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=lt(r.line-1,St(e.doc,r.line-1).length)),d.ch==St(e.doc,d.line).text.length&&d.line<e.lastLine()&&(d=lt(d.line+1,0)),r.line<t.viewFrom||d.line>t.viewTo-1)return!1;var k,X,Z;r.line==t.viewFrom||(k=Nt(e,r.line))==0?(X=Mt(t.view[0].line),Z=t.view[0].node):(X=Mt(t.view[k].line),Z=t.view[k-1].node.nextSibling);var $=Nt(e,d.line),ne,Ce;if($==t.view.length-1?(ne=t.viewTo-1,Ce=t.lineDiv.lastChild):(ne=Mt(t.view[$+1].line)-1,Ce=t.view[$+1].node.previousSibling),!Z)return!1;for(var Re=e.doc.splitLines(tu(e,Z,Ce,X,ne)),Ye=ln(e.doc,lt(X,0),lt(ne,St(e.doc,ne).text.length));Re.length>1&&Ye.length>1;)if(te(Re)==te(Ye))Re.pop(),Ye.pop(),ne--;else if(Re[0]==Ye[0])Re.shift(),Ye.shift(),X++;else break;for(var ze=0,ht=0,Et=Re[0],Dt=Ye[0],Pt=Math.min(Et.length,Dt.length);ze<Pt&&Et.charCodeAt(ze)==Dt.charCodeAt(ze);)++ze;for(var Wt=te(Re),kt=te(Ye),Vt=Math.min(Wt.length-(Re.length==1?ze:0),kt.length-(Ye.length==1?ze:0));ht<Vt&&Wt.charCodeAt(Wt.length-ht-1)==kt.charCodeAt(kt.length-ht-1);)++ht;if(Re.length==1&&Ye.length==1&&X==r.line)for(;ze&&ze>r.ch&&Wt.charCodeAt(Wt.length-ht-1)==kt.charCodeAt(kt.length-ht-1);)ze--,ht++;Re[Re.length-1]=Wt.slice(0,Wt.length-ht).replace(/^\u200b+/,""),Re[0]=Re[0].slice(ze).replace(/\u200b+$/,"");var sn=lt(X,ze),an=lt(ne,Ye.length?te(Ye).length-ht:0);if(Re.length>1||Re[0]||Rt(sn,an))return Bi(e.doc,Re,sn,an,"+input"),!0},On.prototype.ensurePolled=function(){this.forceCompositionEnd()},On.prototype.reset=function(){this.forceCompositionEnd()},On.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},On.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)},On.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Or(this.cm,function(){return Lt(e.cm)})},On.prototype.setUneditable=function(e){e.contentEditable="false"},On.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Zn(this.cm,Lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},On.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},On.prototype.onContextMenu=function(){},On.prototype.resetPosition=function(){},On.prototype.needsContentAttribute=!0;function Vs(e,t){var i=Xi(e,t.line);if(!i||i.hidden)return null;var r=St(e.doc,t.line),d=Di(i,r,t.line),k=wt(r,e.doc.direction),X="left";if(k){var Z=pt(k,t.ch);X=Z%2?"right":"left"}var $=Yi(d.map,t.ch,X);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hi(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,r,d){var k="",X=!1,Z=e.doc.lineSeparator(),$=!1;function ne(ze){return function(ht){return ht.id==ze}}function Ce(){X&&(k+=Z,$&&(k+=Z),X=$=!1)}function Re(ze){ze&&(Ce(),k+=ze)}function Ye(ze){if(ze.nodeType==1){var ht=ze.getAttribute("cm-text");if(ht){Re(ht);return}var Et=ze.getAttribute("cm-marker"),Dt;if(Et){var Pt=e.findMarks(lt(r,0),lt(d+1,0),ne(+Et));Pt.length&&(Dt=Pt[0].find(0))&&Re(ln(e.doc,Dt.from,Dt.to).join(Z));return}if(ze.getAttribute("contenteditable")=="false")return;var Wt=/^(pre|div|p|li|table|br)$/i.test(ze.nodeName);if(!/^br$/i.test(ze.nodeName)&&ze.textContent.length==0)return;Wt&&Ce();for(var kt=0;kt<ze.childNodes.length;kt++)Ye(ze.childNodes[kt]);/^(pre|p)$/i.test(ze.nodeName)&&($=!0),Wt&&(X=!0)}else ze.nodeType==3&&Re(ze.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ye(t),t==i);)t=t.nextSibling,$=!1;return k}function to(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Hi(e.clipPos(lt(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var d=0;d<e.display.view.length;d++){var k=e.display.view[d];if(k.node==r)return nu(k,t,i)}}function nu(e,t,i){var r=e.text.firstChild,d=!1;if(!t||!S(r,t))return Hi(lt(Mt(e.line),0),!0);if(t==r&&(d=!0,t=r.childNodes[i],i=0,!t)){var k=e.rest?te(e.rest):e.line;return Hi(lt(Mt(k),k.text.length),d)}var X=t.nodeType==3?t:null,Z=t;for(!X&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(X=t.firstChild,i&&(i=X.nodeValue.length));Z.parentNode!=r;)Z=Z.parentNode;var $=e.measure,ne=$.maps;function Ce(Dt,Pt,Wt){for(var kt=-1;kt<(ne?ne.length:0);kt++)for(var Vt=kt<0?$.map:ne[kt],sn=0;sn<Vt.length;sn+=3){var an=Vt[sn+2];if(an==Dt||an==Pt){var vn=Mt(kt<0?e.line:e.rest[kt]),Pn=Vt[sn]+Wt;return(Wt<0||an!=Dt)&&(Pn=Vt[sn+(Wt?1:0)]),lt(vn,Pn)}}}var Re=Ce(X,Z,i);if(Re)return Hi(Re,d);for(var Ye=Z.nextSibling,ze=X?X.nodeValue.length-i:0;Ye;Ye=Ye.nextSibling){if(Re=Ce(Ye,Ye.firstChild,0),Re)return Hi(lt(Re.line,Re.ch-ze),d);ze+=Ye.textContent.length}for(var ht=Z.previousSibling,Et=i;ht;ht=ht.previousSibling){if(Re=Ce(ht,ht.firstChild,-1),Re)return Hi(lt(Re.line,Re.ch+Et),d);Et+=ht.textContent.length}}var Kn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new le,this.hasSelection=!1,this.composing=null};Kn.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var d=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(d.style.width="0px"),we(d,"input",function(){j&&U>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),we(d,"paste",function(X){if(nt(r,X)||js(X,r))return;r.state.pasteIncoming=+new Date,i.fastPoll()});function k(X){if(nt(r,X))return;if(r.somethingSelected())eo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Z=Hs(r);eo({lineWise:!0,text:Z.text}),X.type=="cut"?r.setSelections(Z.ranges,null,Fe):(i.prevInput="",d.value=Z.text.join(`
`),Y(d))}else return;X.type=="cut"&&(r.state.cutIncoming=+new Date)}we(d,"cut",k),we(d,"copy",k),we(e.scroller,"paste",function(X){if(Gr(e,X)||nt(r,X))return;if(!d.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=X.clipboardData,d.dispatchEvent(Z)}),we(e.lineSpace,"selectstart",function(X){Gr(e,X)||re(X)}),we(d,"compositionstart",function(){var X=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:X,range:r.markText(X,r.getCursor("to"),{className:"CodeMirror-composing"})}}),we(d,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Kn.prototype.createField=function(e){this.wrapper=zs(),this.textarea=this.wrapper.firstChild},Kn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Kn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ui(e);if(e.options.moveInputWithCursor){var d=kr(e,i.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+X.top-k.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+X.left-k.left))}return r},Kn.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Kn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Y(this.textarea),j&&U>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",j&&U>=9&&(this.hasSelection=null))},Kn.prototype.getField=function(){return this.textarea},Kn.prototype.supportsTouch=function(){return!1},Kn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},Kn.prototype.blur=function(){this.textarea.blur()},Kn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Kn.prototype.receivedFocus=function(){this.slowPoll()},Kn.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()})},Kn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Kn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Xe(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=i.value;if(d==r&&!t.somethingSelected())return!1;if(j&&U>=9&&this.hasSelection===d||o&&/[\uf700-\uf7ff]/.test(d))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=d.charCodeAt(0);if(k==8203&&!r&&(r="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,Z=Math.min(r.length,d.length);X<Z&&r.charCodeAt(X)==d.charCodeAt(X);)++X;return Or(t,function(){Lo(t,d.slice(X),r.length-X,null,e.composing?"*compose":null),d.length>1e3||d.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=d,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Kn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Kn.prototype.onKeyPress=function(){j&&U>=9&&(this.hasSelection=null),this.fastPoll()},Kn.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=It(i,e),X=r.scroller.scrollTop;if(!k||g)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(k)==-1&&Zn(i,cr)(i.doc,di(k),Fe);var $=d.style.cssText,ne=t.wrapper.style.cssText,Ce=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ce.top-5)+"px; left: "+(e.clientX-Ce.left-5)+`px;
z-index: 1000; background: `+(j?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Re;_&&(Re=window.scrollY),r.input.focus(),_&&window.scrollTo(null,Re),r.input.reset(),i.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=ze,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Ye(){if(d.selectionStart!=null){var Et=i.somethingSelected(),Dt="\u200B"+(Et?d.value:"");d.value="\u21DA",d.value=Dt,t.prevInput=Et?"":"\u200B",d.selectionStart=1,d.selectionEnd=Dt.length,r.selForContextMenu=i.doc.sel}}function ze(){if(t.contextMenuPending!=ze)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ne,d.style.cssText=$,j&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=X),d.selectionStart!=null){(!j||j&&U<9)&&Ye();var Et=0,Dt=function(){r.selForContextMenu==i.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?Zn(i,ds)(i):Et++<10?r.detectingSelectAll=setTimeout(Dt,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Dt,200)}}if(j&&U>=9&&Ye(),O){Ee(e);var ht=function(){st(window,"mouseup",ht),setTimeout(ze,20)};we(window,"mouseup",ht)}else setTimeout(ze,50)},Kn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Kn.prototype.setUneditable=function(){},Kn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?F(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=I();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=Z.getValue()}var d;if(e.form&&(we(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var k=e.form;d=k.submit;try{var X=k.submit=function(){r(),k.submit=d,k.submit(),k.submit=X}}catch($){}}t.finishInit=function($){$.save=r,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,r(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var Z=Un(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return Z}function iu(e){e.off=st,e.on=we,e.wheelEventPixels=cl,e.Doc=xr,e.splitLines=qe,e.countColumn=q,e.findColumn=je,e.isWordChar=Se,e.Pass=Ge,e.signal=He,e.Line=ir,e.changeEnd=ci,e.scrollbarModel=jo,e.Pos=lt,e.cmpPos=Rt,e.modes=$e,e.mimeModes=ke,e.resolveMode=Ne,e.getMode=Ve,e.modeExtensions=tt,e.extendMode=ft,e.copyState=Ct,e.startState=qt,e.innerMode=zt,e.commands=ga,e.keyMap=ti,e.keyName=ws,e.isModifierKey=As,e.lookupKey=Fi,e.normalizeKeyMap=_l,e.StringStream=Qt,e.SharedTextMarker=fa,e.TextMarker=fi,e.LineWidget=ha,e.e_preventDefault=re,e.e_stopPropagation=ie,e.e_stop=Ee,e.addClass=C,e.contains=S,e.rmClass=p,e.keyNames=pi}Yl(Un),$l(Un);var au="iter insert remove copy getEditor constructor".split(" ");for(var no in xr.prototype)xr.prototype.hasOwnProperty(no)&&pe(au,no)<0&&(Un.prototype[no]=function(e){return function(){return e.apply(this.doc,arguments)}}(xr.prototype[no]));return be(xr),Un.inputStyles={textarea:Kn,contenteditable:On},Un.defineMode=function(e){!Un.defaults.mode&&e!="null"&&(Un.defaults.mode=e),it.apply(this,arguments)},Un.defineMIME=at,Un.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Un.defineMIME("text/plain","null"),Un.defineExtension=function(e,t){Un.prototype[e]=t},Un.defineDocExtension=function(e,t){xr.prototype[e]=t},Un.fromTextArea=ru,iu(Un),Un.version="5.58.2",Un})},W6BS:function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMuS/48P9RrA/8fZfY3B2yXQBHQpf185tBUK+SvH8uV2H/eK1/+jGfwRIBC5ks/Vq/yplq2Wqz+B/ONg5LNlrlz+Qhnot373iih+wgX/YIAivrJgjTKA9BKcYa/Uy/MnUEpD0S2AyzdKkMslZYklbwVYWZpXQSygrSVoc+4fcPzUAKtsom4xpIGiLCkMZbJGs1LkvOHPfJbrhRX5/CM/NDwJZlXiqBKlc7AEjg1aI2iVDXZpoeS9AFXlkmV1W8z+VACLE7dbMiWLE2CFADLgqig6SakCSs4jizcvAvBHMVkqxxhKkePqAs8S1mxyLUxqw6AYKLdtbMtGINpiKKUM07bc96dk9BUBykIFoNYVC/JewMkCDDh18p0so6w+GzfT+FoWC7Yl11curQpFVCoyJQsvDThP6crNdVldi0KLcwogyzJGssVrxYWXAOWzwWg84eXd92UByoK0WHEJqBCA4oC6ChstYHRJIW6lZHWQlsoYQH6rypyOLZ5Xuahx3NIi1TAvLBIcHIlUw8rfcWFLFmzhmPBUxi0NKIRdAVi5qmPAL88LrS9z/AigmHBpCcOaCIUA1BVj4ma6LCi1FkjLBZRoVRrLR9piXjhkysI2mqJxhY2lQUrDjG3iVv5k5YmgyHI1ngLPBqfUxg21nC5LbGUhHJbGUPKu8hTbUthKGcZP3Palks3fY/BECQVQLoDk0QWURYFVFuTaNudtS+Pb8mCNZcQEYmMQi8KymCSQGLJLIx7zKCFKi1uuJNZvNXxDvLBVszUtW5xSm0WL8Mh9hV0xoGFfKRItVzjYJmaFSQtHAFqVwY3i/pi7Kl2e6N9SOJaxkJk4q0CmqcZVBaGtybFY5OIaCscqKqsaUYBE6LYU08Jimi/dxrIYjudM5ynCohzCyvZaw3iCLEviqW3ntDxR1SreTDCbQ1OI65c2qZKQsY0RKlUVFoVxWcsS5DLdnHisKk6iX1iTeBOXlNgqK4kXxmTdgapAVlWKYpKLsuVYykSJictxVtKPNMq1K0saFiym8wWzKKkiSnKeDSud9i1llOe0XE3PrUTMLEmerys1zpVEYCVWIjqVS1aGEjYlJKrvKvYrAVoWGcKgxIkBYmKuurlRTuOqmkIrdCEOJ8qpyIuc/iInL7R5oAEoOVEXRv0cx8HyHBZxZAySJilplqFE8i3bGLHXqZvFlEp4qOJOKM6zrJKkUuN7Lp6t8GxxxcqIEtfCsnFNw1yViuQuxlVNbJ6AFNUuSjEUmbFWBfJEZITF6rywalW5ryyJc21czpSSy/RmErpSFIU2bJWWRRTFVcqwHPOdo3I8HbO60mVi1Y31qwqmYkN+Ox5Nl/Kv2V7t4DhWJWoSfZZFzy3whTUJCxNA4m02meVWgAWcASr31Kgk1+XJwitfl3ykDaPyWdzTiIeW9xKDBWlREkkgVmloWTdWorBIcwajiTlryZOkJClSVDRARUN0HvPut7+NuarxbD8hKqrEbcJTjDePTfiJiKy267iOu8yBot6KrgC0xWMkHiUMSiNsri2GqAoCCYETJlWU6VJcRpiTxUp6yMU1JQ7lPMJKFZvGXUXic4ijtKodxY7KIs8LFlFElC4rEbFwFsGsTzk74sbNI/70UsQDd67zyXe9mSKes3XnnVxZKK7sz8yzxcWWkWMW3mk3cB1xzyqXmtRg2LRMvMn13tItxXVFeBwJF0kfAlIqHgEoYPJSJFjyU0kugITJQlVgTYo4UVlFlmvyRFxUtNliMl2wWLqlZTuUyZxkvE/Wv8rFG2P+aq/g/yR1Um+dT53L+MyvvoUXD2esFGPO7qyhWqs8f3PGMMEsrCpQFM1miOvYOLbCtW2U5EgKE2+uFANWWamnI6AroTEKWyocAxDULClKEXsBUrEkqlm5ZxQXZLkIx7INEoYtG5NC4qxSYsthOJ+RZZp8MSUeXGF84wYv7A74q8OSZ4Yp+dadnGpYvKkW88vr8L5feQffGyo8yyU/usIDpwJ2du7gRuJyaRBRaI1rKxqdLkVekC5mzIaHnFnv4DRWsFWBrWxciTeTSKRIKAlcSTlV2hG3NwAnaVFKjFUsanItLiklmMUsTsky0dOTvk5R2DapUaXCKKhtW+xd36W/+zyH13Z5+uox3+6XXKWH17D4OTfi/tWQerLg2qjgvtNNPvbrv8K1m4c49R5Huk6jHtCY3eTcVkh9ZZtn+xnXb+4zH+9x/cJFJkf7BI7iNz78OO3tc9xc5NSEIaEsLxhNMpo1m9W2Z0SryqXiriVqnIjICIPaMJMLuKIqdhdJsgQoNQMMo4RUa0rbMbknGRxwcOUZLj73It/dnfA3U8U4Vpzq+Lxho8YOBcPpnCuJy1z5lG6Dd52Gjzx+nmf6BSvJDWppjFrZ5jj2qLs5O/6cuzZX+fZ3nuS//+GXTBz11k/R7K7yofe/lzu21om8JoeLAlvUM8lJC00YWKw0PcNelUbEVUvUKClLkf7MKKcxyDIdWEQnDJYWgac4mMdEGYz3d7n5/JNcuHCZJ/cWPD0u0Y7L2Y0G9wXgZDHXJhl7sUWSlnTXemzVYcsvOde1eeyD57kwUEROm3h0zE4zJcgXxO0dJrGibo24by0kmy/4ytf+mJuHx3RX1njiA49gez5NV+H1Nrl0nOFIzyhdia/otURxJVVonGUNqwaxLiVXSb4TIalctYrJJMlMvSe+/fyFF/iDL/1PvLCGH+3zv184Znde0Gp1eF3PYtWF/qzg4njBOLOot2qcabqc8nNCzyaKNLtzhwd26nzqo49xae+ItZpN4nWIW6tMR2N27DmBnTMPegwjm1P1jJ265vf/4IvYrsfjH3iUYPUU2XxA09J47TVujIQQi1oAnaazLCGlIKjKctWP88pFDbglwEK0o2oFnn3+Al/6+p/x7aeukRSKaf8Kd6+vMCngbCekKHN2+ykHixw3CNgRUC2bhl0yTkpuTguGqkFpe4jCvn1b87GPfYQfzBp0VETQ32WzV6OwA7LmNkk8o82Y0C4ZuqvU0hHf/PrXSCn5zQ9+AK97iv7xDVp1H0+VtFpdrs5sfNun2zzpMERdq/e3AIqWSCKXMksi8LtPP88Xv/a/+NZTV8nckE5vlWQ8ZHF4kbee7nF5EHMwzU2SXW/4nGo51FyYRQV7EfQz1whVqFLarQYbtYL1oGDdhw9/8AOo+ip7WY3RPKPXaaCm+3TtCK/WQNfXiZKYlrWg6RR8+ctfQyv40KPncbobFOni1vjEL2Ka7R6TMsCWErEs8BwIPZMt/w5AuUNZ8L3v/5D/9kd/yp8/dY1ZaRHW5IeKmhdiJxGL4R4bjYBpUrDTklbHYZzAzUXJsLDNA9qBzXrDZTVMWbczPJWT5jAvA+qBy71ntui26txz5gy9nTNE3gr9eY5da6KSEV0VmfxXNnqo6JBvfPUbaKX4yGOP0tjc4ehgn3araepbycV2HtNqNJmoJnkSUQsCVpoOlkwNbrmoFMXzOe/55L/nuVFCKwywpf6TYrdWJ2h2SKcT5jee5+c26xzNcg4XmrEWkCVrocVGqFi1clyVkOUpi8Iz8ZSqOkVjg6y+wYP+DX73n3+YZy5cZTE6IjoesNkOWNvcpLW6Req0SLyAdD6l5cQ0SPnDr3wdbdt86PwjWO0ViiTC93ziNMb1fMosMa+DhUWjXqfmO6w07R8HqEgWc9772f/M1cEY31Km0pdaUqoL16uhkgXp+AYrgccwKdgKNWtuQSiAsoJRDlOrSeT2SFtr0tNj1+u4cUJYU0S5zZnkAr/z6c8xi2BnewWdxswnxyz6+4wPbtDwLLa3t2msbuGvbZH29/jjr3wV7Xg88egjhJtnGPf3qbmeSc8iMKpIsL0ax4uSXqtJ4Dn0mnZVthkGpZBGkUYR7/7MF7g6nOJL3yWjBNfFDgLCRodiPjYJ/RdWC/L5hJG2megaU7tDFrSw7Rp23aNt2fRaHuuhzXY7pBfa3H/XFg/9k7dw/dJz2BtneXFvhvbq6DwhsApWuy08pyAeDTjcvUg02SdUDmfvOcuf/OW3cJ2Ax87/GrG3SjQfs73eIY1j07WUeY7teAwSixWpX215vsx8LNQgLpbdBESLiPd++j9ydTjDcaW6kxYILFtUyiFfLJiOD+gGAX4yZNy+h17DpRf6bPd8tkOHjW6dhqcME4WCRZwxj1LuP3c373/fO43r1ms1U8DPEs3hLGV3MKe/kM8JUvkHrk27XuNo90W+9T++SKfbpdXu8eivvYeodZpo2qfu26gix5f8kEZYtscwdel1mqau3Oh4+I6NGsZSqkFSwmgScf53/xPX+hPDoJQ7ruPg+QFOo0OnXKDGN7h7Z53NsKTVWaHpS5uSsUil77N5dnfI6TWfb//wiMZaB3824Wri8W/Pv4kHf+k9PHPtJg+tWBzqBmE559RaD6U1YehXRUSiORhF9Oea4+Njvvnl368YWVvn8fe/jwNrnWgyYLXbrCZudombx3h+jWHqGE+QY7O9BDgyAEtSA3DB+c99gWujObbkQXFyS4avVWvyxBtabDUcRrOUSVS1TtcOI06thTy1N+EX7+rx/Rsj3nhmhfF0SiMMaDnC4oI3PvB6nnjsPP3RhHbD5zD2IBkztQLy+QisOg07QzkO6w1PujrT9gyPjti7ecizL77Im99wP/vuafJkTCusUeYyJbDwSHFdj1R5rHVbpszcarumWVaTWGpRTYZiNIt55LNf4NJghGu7ph0x/ZhfpxO43FeLqXslea6o+VIO2SRFSTdUHExj1kOPZ/s59/U8vrM7YbXXppgOuZGF/Kt338tb3/M437uyyy+s+xxlLr4V0wzqFDqiXu9CnphFinpHmSbRBTXXIQzrXHnuaXScct2/h2S+T7veQBUpjhuaKYHjunhByEq3bXjZ7Mj9S9Q0LctqyFRw4dI1/sV/+K8cLyK6niKwLZM0m3aKVh5d1yJzfKJE5iZVz9Wf5ex0PK4Mc16/6nBtmnNn1zV5re471FTGPNE8/MbX8Vsf/U1GozHtekA/d3CKiKT0ydMZuRXg6oyFVrQ8mftUfZ909rWgxqXnnyXPUi6rM+hE7tEwY/6isPDLBa4XENbrZqxhpgwWPHimi5qnupQkOhsN+czv/TuSLEZJ01qYmbXpEeVGMq5r1VxKp40uJcFKV20xiXN6fsneXHNHy+IHfYsHVkue2Yuot+t48Zy9LOR33nGGdz72cf724lUe2nA50CENEiyvgU6m1MI6vjTctk3o2qSZNN/g26IZFrsXLpDGC75nvw4VjWj5MrbQxvA15vhuwFqnUc1mtAzKSt567ypqkelSW4pR/5hPfvbfEEuBbfYKSjKkMpFZSEGuLDphCH6DPNfVwMjCjCg6gc0gUWzVUo5ih9VAM4+1WV1YZIzTkrf9/Dk+8clPMZjO6dUcxri42YKs9CjSOTpo4Ocps1yKe5uiyMhKaXxdiiJl/9JFoijiyDmFThY4gWcmfalWODrFdXy2N1bJZcBVajNyfMu5VVSSlbJlwHH/iI9/4tNMU/BktKRcclVgaRtLi2UVnaAOQYM0l8FrhrJtJqliJdDsRTZ3hylPj33e0Em51M+pd3uEi0P2dIPf/qen+PWPfoKnL+/x4JrPXuYTFlMIOuTRGK/eoVbGLAqLRijViSbTOTU3QArR65dfZL6IcdbvIs1TdocF3bpPJ3RMzGWzASvr22C7ZpIn/x6+W+LUzPXgsN/nN574CEmSUtrVjo4lvaFTYDlSiSt6Gx1Cv0vhxliJTe6UlEnN7CRpw7QiLmVvopoOoF0sO2MclfzSm+/hM//y95guUtpShARtnCJmEeUoFeM1mziZJo4WeEHN7EUUSUpk73P95vfZvTYAvUa+ukGez9g7njPqF7Rd6RwKiugKi/llHMfHsnwzZG76ddTBwWGZZinD4YjPfvpzTGYzijwxsxBJxt07MlpnE1RmYbuKQG+iuhP0wEe1c+ILr8d2UhOrWldjDKu7TznaJFjbZX58Cqt2mTfd+y5+6+Nv53jyIr3mvYRunX5ymZ71MK6q4Qc+cVYwi2IaNR/PtdGpx7Xoqzx3+CeE84d54NR5IYhWo8Zf/s03+Oo3/wtrvW1Ct0PgrhA6K9TcDqV2jSAJc+rzn/98OZ1Ol/MVl7IsiOOINM0YTw4ZRJeJ9ZDpZEzQ9fGKDexmRJkVqMBn+twOyo5pNJsEYcjx8QG9h55kcel1hGcvMnvhHGrlBR66/1f55X+2zQvX/5q13r2QOQzzH/Lz7X/NYfEAvaZiePOQsrfOSnJIOwiNmz23+xccHr3AweGc8RjCIOD05lksakyjIzrBnRRimNmYXGdmHTs7pzh37pypadW1a9dKqRgODg7Y399nMhmTZZm5ecIxUTpgkR4yiQ+IFhPiLCeOZpSFB3GTXDdwdIv17hmarR4//MGT3PGL+1z/bo/em6/S/84pmg89zwPrj/COd55mMDkirNWwkx3G0QsUB2/Ba57jjq0OZTxGOS46ryYJ82jApetPcTDYJ6yt4tshtVoIuUMz7NI/HqJ1SthscMfOHZy9+y62trbwPO/WbuHf3z7TmvlcLDVmMBgwHIwYjSbMJ3Nm0ZxI5p3JjHk6RkbCgVfDsgN8ArP3N5juM5jdJD26xrOjq9TzCcfzkGYYcXrrbTz6xDs5OrrMeHzIjck+2eiA65OYdrjOPace5NzOw/hO10zW5ZDm27VDUxdLnMtwOctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},WaYH:function(et,de,N){"use strict";var ee=N("rePB"),K=N("Ff2n"),P=N("VTBJ"),z=N("1OyB"),B=N("vuIU"),M=N("JX7q"),j=N("Ji7U"),U=N("LK+K"),_=N("q1tI"),R=N("TSYQ"),c=N.n(R),g=N("sboe"),w=N("OZM5"),y=function(O){var A=O.prefixCls,p=O.level,h=O.isStart,s=O.isEnd;if(!p)return null;for(var l="".concat(A,"-indent-unit"),D=[],T=0;T<p;T+=1){var S;D.push(_.createElement("span",{key:T,className:c()(l,(S={},Object(ee.a)(S,"".concat(l,"-start"),h[T+1]),Object(ee.a)(S,"".concat(l,"-end"),s[T+1]),Object(ee.a)(S,"".concat(l,"-end-first-level"),!T&&s[0]),S))}))}return _.createElement("span",{"aria-hidden":"true",className:"".concat(A,"-indent")},D)},f=y,m=N("815F"),a="open",n="close",o="---",u=function(v){Object(j.a)(A,v);var O=Object(U.a)(A);function A(){var p;return Object(z.a)(this,A),p=O.apply(this,arguments),p.state={dragNodeHighlight:!1},p.onSelectorClick=function(h){var s=p.props.context.onNodeClick;s(h,Object(m.b)(p.props)),p.isSelectable()?p.onSelect(h):p.onCheck(h)},p.onSelectorDoubleClick=function(h){var s=p.props.context.onNodeDoubleClick;s(h,Object(m.b)(p.props))},p.onSelect=function(h){if(p.isDisabled())return;var s=p.props.context.onNodeSelect;h.preventDefault(),s(h,Object(m.b)(p.props))},p.onCheck=function(h){if(p.isDisabled())return;var s=p.props,l=s.disableCheckbox,D=s.checked,T=p.props.context.onNodeCheck;if(!p.isCheckable()||l)return;h.preventDefault();var S=!D;T(h,Object(m.b)(p.props),S)},p.onMouseEnter=function(h){var s=p.props.context.onNodeMouseEnter;s(h,Object(m.b)(p.props))},p.onMouseLeave=function(h){var s=p.props.context.onNodeMouseLeave;s(h,Object(m.b)(p.props))},p.onContextMenu=function(h){var s=p.props.context.onNodeContextMenu;s(h,Object(m.b)(p.props))},p.onDragStart=function(h){var s=p.props.context.onNodeDragStart;h.stopPropagation(),p.setState({dragNodeHighlight:!0}),s(h,Object(M.a)(p));try{h.dataTransfer.setData("text/plain","")}catch(l){}},p.onDragEnter=function(h){var s=p.props.context.onNodeDragEnter;h.preventDefault(),h.stopPropagation(),s(h,Object(M.a)(p))},p.onDragOver=function(h){var s=p.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),s(h,Object(M.a)(p))},p.onDragLeave=function(h){var s=p.props.context.onNodeDragLeave;h.stopPropagation(),s(h,Object(M.a)(p))},p.onDragEnd=function(h){var s=p.props.context.onNodeDragEnd;h.stopPropagation(),p.setState({dragNodeHighlight:!1}),s(h,Object(M.a)(p))},p.onDrop=function(h){var s=p.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),p.setState({dragNodeHighlight:!1}),s(h,Object(M.a)(p))},p.onExpand=function(h){var s=p.props.context.onNodeExpand;s(h,Object(m.b)(p.props))},p.setSelectHandle=function(h){p.selectHandle=h},p.getNodeState=function(){var h=p.props.expanded;return p.isLeaf()?null:h?a:n},p.hasChildren=function(){var h=p.props.eventKey,s=p.props.context.keyEntities,l=s[h]||{},D=l.children;return!!(D||[]).length},p.isLeaf=function(){var h=p.props,s=h.isLeaf,l=h.loaded,D=p.props.context.loadData,T=p.hasChildren();return s===!1?!1:s||!D&&!T||D&&l&&!T},p.isDisabled=function(){var h=p.props.disabled,s=p.props.context.disabled;return!!(s||h)},p.isCheckable=function(){var h=p.props.checkable,s=p.props.context.checkable;return!s||h===!1?!1:s},p.syncLoadData=function(h){var s=h.expanded,l=h.loading,D=h.loaded,T=p.props.context,S=T.loadData,I=T.onNodeLoad;if(l)return;S&&s&&!p.isLeaf()&&(!p.hasChildren()&&!D&&I(Object(m.b)(p.props)))},p.renderSwitcher=function(){var h=p.props,s=h.expanded,l=h.switcherIcon,D=p.props.context,T=D.prefixCls,S=D.switcherIcon,I=l||S;if(p.isLeaf())return _.createElement("span",{className:c()("".concat(T,"-switcher"),"".concat(T,"-switcher-noop"))},typeof I=="function"?I(Object(P.a)(Object(P.a)({},p.props),{},{isLeaf:!0})):I);var C=c()("".concat(T,"-switcher"),"".concat(T,"-switcher_").concat(s?a:n));return _.createElement("span",{onClick:p.onExpand,className:C},typeof I=="function"?I(Object(P.a)(Object(P.a)({},p.props),{},{isLeaf:!1})):I)},p.renderCheckbox=function(){var h=p.props,s=h.checked,l=h.halfChecked,D=h.disableCheckbox,T=p.props.context.prefixCls,S=p.isDisabled(),I=p.isCheckable();if(!I)return null;var C=typeof I!="boolean"?I:null;return _.createElement("span",{className:c()("".concat(T,"-checkbox"),s&&"".concat(T,"-checkbox-checked"),!s&&l&&"".concat(T,"-checkbox-indeterminate"),(S||D)&&"".concat(T,"-checkbox-disabled")),onClick:p.onCheck},C)},p.renderIcon=function(){var h=p.props.loading,s=p.props.context.prefixCls;return _.createElement("span",{className:c()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(p.getNodeState()||"docu"),h&&"".concat(s,"-icon_loading"))})},p.renderSelector=function(){var h=p.state.dragNodeHighlight,s=p.props,l=s.title,D=s.selected,T=s.icon,S=s.loading,I=s.data,C=p.props.context,W=C.prefixCls,Y=C.showIcon,H=C.icon,F=C.draggable,q=C.loadData,le=C.titleRender,pe=p.isDisabled(),Ae="".concat(W,"-node-content-wrapper"),Ge;if(Y){var Fe=T||H;Ge=Fe?_.createElement("span",{className:c()("".concat(W,"-iconEle"),"".concat(W,"-icon__customize"))},typeof Fe=="function"?Fe(p.props):Fe):p.renderIcon()}else q&&S&&(Ge=p.renderIcon());var Ue;typeof l=="function"?Ue=l(I):le?Ue=le(I):Ue=l;var _e=_.createElement("span",{className:"".concat(W,"-title")},Ue);return _.createElement("span",{ref:p.setSelectHandle,title:typeof l=="string"?l:"",className:c()("".concat(Ae),"".concat(Ae,"-").concat(p.getNodeState()||"normal"),!pe&&(D||h)&&"".concat(W,"-node-selected"),!pe&&F&&"draggable"),draggable:!pe&&F||void 0,"aria-grabbed":!pe&&F||void 0,onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onContextMenu:p.onContextMenu,onClick:p.onSelectorClick,onDoubleClick:p.onSelectorDoubleClick,onDragStart:F?p.onDragStart:void 0},Ge,_e)},p}return Object(B.a)(A,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var h=this.props.selectable,s=this.props.context.selectable;return typeof h=="boolean"?h:s}},{key:"render",value:function(){var h,s=this.props,l=s.eventKey,D=s.className,T=s.style,S=s.dragOver,I=s.dragOverGapTop,C=s.dragOverGapBottom,W=s.isLeaf,Y=s.isStart,H=s.isEnd,F=s.expanded,q=s.selected,le=s.checked,pe=s.halfChecked,Ae=s.loading,Ge=s.domRef,Fe=s.active,Ue=s.onMouseMove,_e=Object(K.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),je=this.props.context,xe=je.prefixCls,he=je.filterTreeNode,te=je.draggable,ye=je.keyEntities,ue=this.isDisabled(),Le=Object(w.f)(_e),ae=ye[l]||{},oe=ae.level,Se=H[H.length-1];return _.createElement("div",Object.assign({ref:Ge,className:c()(D,"".concat(xe,"-treenode"),(h={},Object(ee.a)(h,"".concat(xe,"-treenode-disabled"),ue),Object(ee.a)(h,"".concat(xe,"-treenode-switcher-").concat(F?"open":"close"),!W),Object(ee.a)(h,"".concat(xe,"-treenode-checkbox-checked"),le),Object(ee.a)(h,"".concat(xe,"-treenode-checkbox-indeterminate"),pe),Object(ee.a)(h,"".concat(xe,"-treenode-selected"),q),Object(ee.a)(h,"".concat(xe,"-treenode-loading"),Ae),Object(ee.a)(h,"".concat(xe,"-treenode-active"),Fe),Object(ee.a)(h,"".concat(xe,"-treenode-leaf-last"),Se),Object(ee.a)(h,"drag-over",!ue&&S),Object(ee.a)(h,"drag-over-gap-top",!ue&&I),Object(ee.a)(h,"drag-over-gap-bottom",!ue&&C),Object(ee.a)(h,"filter-node",he&&he(Object(m.b)(this.props))),h)),style:T,onDragEnter:te?this.onDragEnter:void 0,onDragOver:te?this.onDragOver:void 0,onDragLeave:te?this.onDragLeave:void 0,onDrop:te?this.onDrop:void 0,onDragEnd:te?this.onDragEnd:void 0,onMouseMove:Ue},Le),_.createElement(f,{prefixCls:xe,level:oe,isStart:Y,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),A}(_.Component),x=function(O){return _.createElement(g.a.Consumer,null,function(A){return _.createElement(u,Object.assign({},O,{context:A}))})};x.displayName="TreeNode",x.defaultProps={title:o},x.isTreeNode=1;var E=de.a=x},Xsq0:function(et,de,N){et.exports=N.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(et,de,N){"use strict";N.r(de),N.d(de,"ResizableTextArea",function(){return pe});var ee=N("wx14"),K=N("1OyB"),P=N("vuIU"),z=N("Ji7U"),B=N("LK+K"),M=N("q1tI"),j=N("VTBJ"),U=N("rePB"),_=N("Zm9Q"),R=N("Kwbf"),c=N("c+Xe"),g=N("m+aA"),w=N("bdgK"),y=new Map;function f(Fe){Fe.forEach(function(Ue){var _e,je=Ue.target;(_e=y.get(je))===null||_e===void 0||_e.forEach(function(xe){return xe(je)})})}var m=new w.default(f),a=null,n=null;function o(Fe,Ue){y.has(Fe)||(y.set(Fe,new Set),m.observe(Fe)),y.get(Fe).add(Ue)}function u(Fe,Ue){y.has(Fe)&&(y.get(Fe).delete(Ue),y.get(Fe).size||(m.unobserve(Fe),y.delete(Fe)))}var x=function(Fe){Object(z.a)(_e,Fe);var Ue=Object(B.a)(_e);function _e(){return Object(K.a)(this,_e),Ue.apply(this,arguments)}return Object(P.a)(_e,[{key:"render",value:function(){return this.props.children}}]),_e}(M.Component),E=M.createContext(null);function v(Fe){var Ue=Fe.children,_e=Fe.onBatchResize,je=M.useRef(0),xe=M.useRef([]),he=M.useContext(E),te=M.useCallback(function(ye,ue,Le){je.current+=1;var ae=je.current;xe.current.push({size:ye,element:ue,data:Le}),Promise.resolve().then(function(){ae===je.current&&(_e==null||_e(xe.current),xe.current=[])}),he==null||he(ye,ue,Le)},[_e,he]);return M.createElement(E.Provider,{value:te},Ue)}function O(Fe){var Ue=Fe.children,_e=Fe.disabled,je=M.useRef(null),xe=M.useRef(null),he=M.useContext(E),te=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ye=M.isValidElement(Ue)&&Object(c.c)(Ue),ue=ye?Ue.ref:null,Le=M.useMemo(function(){return Object(c.a)(ue,je)},[ue,je]),ae=M.useRef(Fe);ae.current=Fe;var oe=M.useCallback(function(Se){var Me=ae.current,We=Me.onResize,Ke=Me.data,Qe=Se.getBoundingClientRect(),Ze=Qe.width,yt=Qe.height,vt=Se.offsetWidth,dt=Se.offsetHeight,pt=Math.floor(Ze),At=Math.floor(yt);if(te.current.width!==pt||te.current.height!==At||te.current.offsetWidth!==vt||te.current.offsetHeight!==dt){var wt={width:pt,height:At,offsetWidth:vt,offsetHeight:dt};te.current=wt;var Oe=vt===Math.round(Ze)?Ze:vt,we=dt===Math.round(yt)?yt:dt,Je=Object(j.a)(Object(j.a)({},wt),{},{offsetWidth:Oe,offsetHeight:we});he==null||he(Je,Se,Ke),We&&Promise.resolve().then(function(){We(Je,Se)})}},[]);return M.useEffect(function(){var Se=Object(g.a)(je.current)||Object(g.a)(xe.current);return Se&&!_e&&o(Se,oe),function(){return u(Se,oe)}},[je.current,_e]),M.createElement(x,{ref:xe},ye?M.cloneElement(Ue,{ref:Le}):Ue)}var A="rc-observer-key";function p(Fe){var Ue=Fe.children,_e=Object(_.a)(Ue);return _e.map(function(je,xe){var he=(je==null?void 0:je.key)||"".concat(A,"-").concat(xe);return M.createElement(O,Object(ee.a)({},Fe,{key:he}),je)})}p.Collection=v;var h=p,s=N("bT9E"),l=N("TSYQ"),D=N.n(l),T=`
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
`,S=["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"],I={},C;function W(Fe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=Fe.getAttribute("id")||Fe.getAttribute("data-reactid")||Fe.getAttribute("name");if(Ue&&I[_e])return I[_e];var je=window.getComputedStyle(Fe),xe=je.getPropertyValue("box-sizing")||je.getPropertyValue("-moz-box-sizing")||je.getPropertyValue("-webkit-box-sizing"),he=parseFloat(je.getPropertyValue("padding-bottom"))+parseFloat(je.getPropertyValue("padding-top")),te=parseFloat(je.getPropertyValue("border-bottom-width"))+parseFloat(je.getPropertyValue("border-top-width")),ye=S.map(function(Le){return"".concat(Le,":").concat(je.getPropertyValue(Le))}).join(";"),ue={sizingStyle:ye,paddingSize:he,borderSize:te,boxSizing:xe};return Ue&&_e&&(I[_e]=ue),ue}function Y(Fe){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;C||(C=document.createElement("textarea"),C.setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),Fe.getAttribute("wrap")?C.setAttribute("wrap",Fe.getAttribute("wrap")):C.removeAttribute("wrap");var xe=W(Fe,Ue),he=xe.paddingSize,te=xe.borderSize,ye=xe.boxSizing,ue=xe.sizingStyle;C.setAttribute("style","".concat(ue,";").concat(T)),C.value=Fe.value||Fe.placeholder||"";var Le=Number.MIN_SAFE_INTEGER,ae=Number.MAX_SAFE_INTEGER,oe=C.scrollHeight,Se;if(ye==="border-box"?oe+=te:ye==="content-box"&&(oe-=he),_e!==null||je!==null){C.value=" ";var Me=C.scrollHeight-he;_e!==null&&(Le=Me*_e,ye==="border-box"&&(Le=Le+he+te),oe=Math.max(Le,oe)),je!==null&&(ae=Me*je,ye==="border-box"&&(ae=ae+he+te),Se=oe>ae?"":"hidden",oe=Math.min(ae,oe))}return{height:oe,minHeight:Le,maxHeight:ae,overflowY:Se,resize:"none"}}var H=N("Gytx"),F=N.n(H),q;(function(Fe){Fe[Fe.NONE=0]="NONE",Fe[Fe.RESIZING=1]="RESIZING",Fe[Fe.RESIZED=2]="RESIZED"})(q||(q={}));var le=function(Fe){Object(z.a)(_e,Fe);var Ue=Object(B.a)(_e);function _e(je){var xe;return Object(K.a)(this,_e),xe=Ue.call(this,je),xe.nextFrameActionId=void 0,xe.resizeFrameId=void 0,xe.textArea=void 0,xe.saveTextArea=function(he){xe.textArea=he},xe.handleResize=function(he){var te=xe.state.resizeStatus,ye=xe.props,ue=ye.autoSize,Le=ye.onResize;if(te!==q.NONE)return;typeof Le=="function"&&Le(he),ue&&xe.resizeOnNextFrame()},xe.resizeOnNextFrame=function(){cancelAnimationFrame(xe.nextFrameActionId),xe.nextFrameActionId=requestAnimationFrame(xe.resizeTextarea)},xe.resizeTextarea=function(){var he=xe.props.autoSize;if(!he||!xe.textArea)return;var te=he.minRows,ye=he.maxRows,ue=Y(xe.textArea,!1,te,ye);xe.setState({textareaStyles:ue,resizeStatus:q.RESIZING},function(){cancelAnimationFrame(xe.resizeFrameId),xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:q.RESIZED},function(){xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:q.NONE}),xe.fixFirefoxAutoScroll()})})})})},xe.renderTextArea=function(){var he=xe.props,te=he.prefixCls,ye=te===void 0?"rc-textarea":te,ue=he.autoSize,Le=he.onResize,ae=he.className,oe=he.disabled,Se=xe.state,Me=Se.textareaStyles,We=Se.resizeStatus,Ke=Object(s.a)(xe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Qe=D()(ye,ae,Object(U.a)({},"".concat(ye,"-disabled"),oe));"value"in Ke&&(Ke.value=Ke.value||"");var Ze=Object(j.a)(Object(j.a)(Object(j.a)({},xe.props.style),Me),We===q.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(h,{onResize:xe.handleResize,disabled:!(ue||Le)},M.createElement("textarea",Object(ee.a)({},Ke,{className:Qe,style:Ze,ref:xe.saveTextArea})))},xe.state={textareaStyles:{},resizeStatus:q.NONE},xe}return Object(P.a)(_e,[{key:"componentDidUpdate",value:function(xe){(xe.value!==this.props.value||!F()(xe.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 xe=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(xe,he)}}catch(te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),_e}(M.Component),pe=le,Ae=function(Fe){Object(z.a)(_e,Fe);var Ue=Object(B.a)(_e);function _e(je){var xe;Object(K.a)(this,_e),xe=Ue.call(this,je),xe.resizableTextArea=void 0,xe.focus=function(){xe.resizableTextArea.textArea.focus()},xe.saveTextArea=function(te){xe.resizableTextArea=te},xe.handleChange=function(te){var ye=xe.props.onChange;xe.setValue(te.target.value,function(){xe.resizableTextArea.resizeTextarea()}),ye&&ye(te)},xe.handleKeyDown=function(te){var ye=xe.props,ue=ye.onPressEnter,Le=ye.onKeyDown;te.keyCode===13&&ue&&ue(te),Le&&Le(te)};var he=typeof je.value=="undefined"||je.value===null?je.defaultValue:je.value;return xe.state={value:he},xe}return Object(P.a)(_e,[{key:"setValue",value:function(xe,he){"value"in this.props||this.setState({value:xe},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(pe,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(xe){return"value"in xe?{value:xe.value}:null}}]),_e}(M.Component),Ge=de.default=Ae},ZW9T:function(et,de,N){"use strict";N.d(de,"a",function(){return h});var ee=N("k1fw"),K=N("oBTY"),P=N("9og8"),z=N("miYZ"),B=N("tsqr"),M=N("rAM+"),j=N("tJVT"),U=N("PpiC"),_=N("WmNS"),R=N.n(_),c=N("q1tI"),g=N.n(c),w=N("bdgK");function y(s,l,D,T,S){var I=l.getWordUntilPosition(D),C={startLineNumber:D.lineNumber,endLineNumber:D.lineNumber,startColumn:I.startColumn,endColumn:I.endColumn},W=T.map(function(Y){return{label:Y,kind:s.languages.CompletionItemKind.Keyword,insertText:Y,insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:C}});return S.map(function(Y){W.push(Object(ee.a)(Object(ee.a)({},Y),{},{range:C}))}),W}var f=function(s){var l={label:"ifelse",kind:s.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet},D=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];s.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(C,W){var Y=y(s,C,W,D,[l]);return{suggestions:Y}}});var T=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];s.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(C,W){var Y=[{label:"print",kind:s.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=y(s,C,W,T,Y);return{suggestions:H}}});var S=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];s.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(C,W){var Y=[l,{label:"main",kind:s.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:s.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet}],H=y(s,C,W,S,Y);return{suggestions:H}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=N("fjLI"),n=N("LvDl"),o=N("+ua5");function u(s){return/^\d+$/.test(s)?"".concat(s,"px"):s}function x(){}var E=!1,v={"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",Scala:"scale"};function O(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=s;if(Array.isArray(s)){for(var D=0;D<s.length;D++){var T=v[s[D]];if(T)return T}return l[0]}return v[l]||l}var A=null,p=de.b=function(s){var l=s.width,D=l===void 0?"100%":l,T=s.height,S=T===void 0?"100%":T,I=s.value,C=s.language,W=C===void 0?"javascript":C,Y=s.style,H=Y===void 0?{}:Y,F=s.options,q=F===void 0?{}:F,le=s.overrideServices,pe=le===void 0?{}:le,Ae=s.theme,Ge=Ae===void 0?"vs-dark":Ae,Fe=s.onEditBlur,Ue=s.onSave,_e=s.autoHeight,je=_e===void 0?!1:_e,xe=s.forbidCopy,he=xe===void 0?!1:xe,te=s.onChange,ye=te===void 0?x:te,ue=s.editorDidMount,Le=ue===void 0?x:ue,ae=s.onFocus,oe=ae===void 0?x:ae,Se=s.onBreakPoint,Me=Se===void 0?x:Se,We=s.breakPointValue,Ke=We===void 0?[]:We,Qe=s.filename,Ze=Qe===void 0?"educoder.txt":Qe,yt=s.errorLine,vt=s.errorContent,dt=vt===void 0?"":vt,pt=s.highlightLine,At=s.openBreakPoint,wt=At===void 0?!1:At,Oe=Object(U.a)(s,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),we=Object(c.useRef)(),Je=Object(c.useRef)({}),st=Object(c.useRef)(),He=Object(c.useRef)(),nt=Object(c.useRef)([]),Te=Object(c.useRef)(!1),ge=Object(c.useRef)(),be=Object(c.useState)(!1),re=Object(j.a)(be,2),ie=re[0],ce=re[1];function Ee(){var Ve;return we.current&&(Ve=new w.default(function(tt){var ft=Object(M.a)(tt),Ct;try{for(ft.s();!(Ct=ft.n()).done;){var zt=Ct.value;(zt.target.offsetHeight>0||zt.target.offsetWidth>0)&&Je.current.instance.layout()}}catch(qt){ft.e(qt)}finally{ft.f()}}),Ve.observe(we.current)),Ve}function Be(){B.b.warn({content:decodeURIComponent(m),key:"monaco-editor-tip"})}var Ie=function(){var tt=Je.current.instance;if(I!=null&&tt&&ie){var ft=tt.getModel();ft&&I!==ft.getValue()&&(E=!0,ft.setValue(I),tt.layout(),E=!1)}};Object(c.useEffect)(function(){try{var Ve,tt=Je.current.instance;He.current&&clearTimeout(He.current),He.current=setTimeout(function(){Ie()},500),tt==null||((Ve=tt.updateOptions)===null||Ve===void 0)||Ve.call(tt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(I.split(/\r\n|\r|\n/g).length))+3,5)})}catch(ft){debugger}},[I,ie,Je.current]),Object(c.useEffect)(function(){try{if(yt&&Je.current&&Je.current.instance){var Ve=Je.current.instance;Ve.changeViewZones(function(ft){var Ct=document.createElement("div");Ct.style.padding="10px 20px",Ct.style.width="calc(100% - 20px)",Ct.className="my-error-line-wrp",Ct.innerHTML=dt,ft.addZone({afterLineNumber:yt||11,heightInLines:3,domNode:Ct})});var tt={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}};Ve.addOverlayWidget(tt),Ve.revealPositionInCenter({lineNumber:20,column:1})}}catch(ft){debugger}},[yt,Je.current,ie]),Object(c.useEffect)(function(){var Ve;if((Ve=Je.current)!==null&&Ve!==void 0&&Ve.instance&&ie&&wt){var tt=Je.current.instance,ft=tt.getModel();if(!ft)return;var Ct=function(){var Rt=[],Jt=[],nn=ft.getAllDecorations(),un=Object(M.a)(nn),cn;try{for(un.s();!(cn=un.n()).done;){var G=cn.value;if(G.options.className==="highlighted-line"){var b;Rt.push(G==null||((b=G.range)===null||b===void 0)?void 0:b.startLineNumber),Jt.push(G==null?void 0:G.id)}}}catch(V){un.e(V)}finally{un.f()}ft.deltaDecorations(Jt,[]);var L=ft.getLineCount();!!pt&&pt<=L&&(tt.deltaDecorations([],[{range:new A.Range(pt,1,pt,ft.getLineMaxColumn(pt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),tt.revealLineInCenter(pt))};Ct();var zt=function(){var Rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Jt=[],nn=[],un=ft.getAllDecorations(),cn=Object(M.a)(un),G;try{for(cn.s();!(G=cn.n()).done;){var b=G.value;if(b.options.linesDecorationsClassName==="breakpoints"){var L;Jt.push(b==null||((L=b.range)===null||L===void 0)?void 0:L.startLineNumber),nn.push(b==null?void 0:b.id)}}}catch(V){cn.e(V)}finally{cn.f()}if(Rt)return{lines:Jt,ids:nn};Me(Jt)},qt=function(){var lt=Object(P.a)(R.a.mark(function Rt(Jt){var nn;return R.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return nn={range:new A.Range(Jt,1,Jt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},cn.next=3,ft.deltaDecorations([],[nn]);case 3:zt();case 4:case"end":return cn.stop()}},Rt)}));return function(Jt){return lt.apply(this,arguments)}}(),Qt=function(){var lt=Object(P.a)(R.a.mark(function Rt(Jt){var nn,un,cn,G,b;return R.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:nn=[],un=tt.getLineDecorations(Jt),cn=Object(M.a)(un);try{for(cn.s();!(G=cn.n()).done;)b=G.value,b.options.linesDecorationsClassName==="breakpoints"&&nn.push(b.id)}catch(J){cn.e(J)}finally{cn.f()}return V.next=6,ft.deltaDecorations(nn,[]);case 6:zt();case 7:case"end":return V.stop()}},Rt)}));return function(Jt){return lt.apply(this,arguments)}}(),St=function(Rt){var Jt=tt.getLineDecorations(Rt),nn=Object(M.a)(Jt),un;try{for(nn.s();!(un=nn.n()).done;){var cn=un.value;if(cn.options.linesDecorationsClassName==="breakpoints")return!0}}catch(G){nn.e(G)}finally{nn.f()}return!1};if(!Object(n.isEqual)(Ke,zt(!0).lines)){ft.deltaDecorations(zt(!0).ids,[]);var ln=Ke.map(function(lt){return{range:new A.Range(lt,1,lt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});ft.deltaDecorations([],ln)}var Bt=tt.onDidChangeModelContent(function(lt){var Rt=tt.getPosition();if(Rt){var Jt=Rt.lineNumber;ft.getLineContent(Jt).trim()===""?Qt(Jt):St(Jt)&&(Qt(Jt),qt(Jt))}}),Yt=tt.onMouseDown(function(lt){var Rt,Jt,nn;if(lt.target.detail&&(Rt=lt.target)!==null&&Rt!==void 0&&(Jt=Rt.element)!==null&&Jt!==void 0&&(nn=Jt.className)!==null&&nn!==void 0&&nn.includes("line-numbers")){var un=lt.target.position.lineNumber;if(ft.getLineContent(un).trim()==="")return;St(un)?Qt(un):qt(un)}}),Mt=function(Rt){var Jt={range:new A.Range(Rt,1,Rt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};nt.current=tt.deltaDecorations(nt.current,[Jt])},tn=function(){nt.current=tt.deltaDecorations(nt.current,[])},mn=tt.onMouseMove(function(lt){var Rt,Jt,nn;if(tn(),lt.target.detail&&(Rt=lt.target)!==null&&Rt!==void 0&&(Jt=Rt.element)!==null&&Jt!==void 0&&(nn=Jt.className)!==null&&nn!==void 0&&nn.includes("line-numbers")){var un=lt.target.position.lineNumber;if(ft.getLineContent(un).trim()==="")return;Mt(un)}}),An=tt.onMouseLeave(function(){tn()});return function(){Bt.dispose(),Yt.dispose(),mn.dispose(),An.dispose()}}},[Je.current,ie,Ke,pt,wt]);function ut(){var Ve=Je.current.instance;if(Ve){var tt=Ve.getSelection(),ft=Je.current.pastePos||{},Ct=new A.Range(ft.startLineNumber||tt.endLineNumber,ft.startColumn||tt.endColumn,ft.endLineNumber||tt.endLineNumber,ft.endColumn||tt.endColumn);setTimeout(function(){Ve.executeEdits("",[{range:Ct,text:""}])},300)}}function bt(Ve){(window.navigator.platform.match("Mac")?Ve.metaKey:Ve.ctrlKey)&&Ve.keyCode==83&&(Ve.preventDefault(),Ue())}var Tt=function(){if(je&&Je.current.instance){var tt=Je.current.instance.getContentHeight();at(tt<S?S:tt)}else at(S)};function xt(Ve){var tt=document.createEvent("MouseEvents");tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ve.dispatchEvent(tt)}var gt=function(tt){var ft=tt.keyCode,Ct=tt.ctrlKey,zt=tt.metaKey,qt=tt.target,Qt=tt.type;return(Qt==="paste"||(ft===67||ft===86)&&(zt||Ct))&&qt.nodeName==="TEXTAREA"&&(Be(),tt.preventDefault()),!1};function qe(Ve,tt){var ft=window.URL||window.webkitURL||window,Ct=new Blob([tt]),zt=document.createElementNS("http://www.w3.org/1999/xhtml","a");zt.href=ft.createObjectURL(Ct),zt.download=Ve,xt(zt)}Object(c.useEffect)(function(){Tt()},[Tt]),Object(c.useEffect)(function(){we.current&&!ie&&N.e(27).then(N.t.bind(null,"M/lh",7)).then(function(Ve){try{A=Ve,Je.current.instance=A.editor.create(we.current,{value:I,language:O(W),theme:Ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},pe);var tt=Je.current.instance,ft=a.c._menuItems,Ct=Object(K.a)(ft).find(function(qt){return qt[0]._debugName=="EditorContext"});if(Le(tt,A),setTimeout(function(){Tt(),Je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){qe(Ze||"educoder.txt",tt.getValue())}}),tt.getDomNode().addEventListener("input",function(){st.current.autoFormat&&tt.getAction("editor.action.formatDocument").run()})},500),Je.current.subscription=tt.onDidChangeModelContent(function(qt){debugger;Te.current?clearTimeout(ge.current):(Tt(),ye(tt.getValue(),qt)),ge.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||f(A,O(W)),he&&(we.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",gt),window.removeEventListener("paste",gt),window.addEventListener("keydown",gt),window.addEventListener("paste",gt)),window.Monaco=A,Fe&&tt.onDidBlurEditorWidget(function(){Fe(tt.getValue())}),oe&&tt.onDidFocusEditorText(function(){oe(tt.getValue())}),he)try{window.addEventListener("paste",ut)}catch(qt){}var zt=Ee();return ce(!0),function(){var qt=Je.current.instance;qt.dispose();var Qt=qt.getModel();Qt&&Qt.dispose(),Je.current.subscription&&Je.current.subscription.dispose(),he&&window.removeEventListener("paste",ut),zt.unobserve(we.current)}}catch(qt){debugger}})},[]),Object(c.useEffect)(function(){var Ve=Je.current.instance;if(Ve&&ie)return document.addEventListener("keydown",bt,!1),function(){document.removeEventListener("keydown",bt)}},[Ue,ie]),Object(c.useEffect)(function(){var Ve=Je.current.instance;if(Ve&&ie){var tt=O(W);A.editor.setModelLanguage(Ve.getModel(),tt)}},[W,ie]),Object(c.useEffect)(function(){var Ve=Je.current.instance;Ve&&ie&&A.editor.setTheme(Ge)},[Ge,ie]),Object(c.useEffect)(function(){var Ve=Je.current.instance;st.current=q,Ve&&ie&&(Ve.updateOptions(Object(ee.a)({},q)),setTimeout(function(){Ve.getModel().updateOptions(Object(ee.a)({},q))},200))},[JSON.stringify(q),ie]),Object(c.useEffect)(function(){var Ve=Je.current.instance;Ve&&ie&&Ve.layout()},[D,S,ie]);var Xe=Object(c.useState)(u(D)),Pe=Object(j.a)(Xe,2),se=Pe[0],fe=Pe[1],$e=Object(c.useState)(u(S)),ke=Object(j.a)($e,2),it=ke[0],at=ke[1],Ne=Object(ee.a)(Object(ee.a)({},H),{},{width:se,height:it});return g.a.createElement("div",{className:"my-monaco-editor",ref:we,style:Ne})};function h(s){var l=s.width,D=l===void 0?"100%":l,T=s.height,S=T===void 0?"100%":T,I=s.original,C=s.modified,W=s.language,Y=s.options,H=Y===void 0?{}:Y,F=Object(c.useRef)(),q=Object(c.useState)(null),le=Object(j.a)(q,2),pe=le[0],Ae=le[1];function Ge(je){var xe;return F.current&&(xe=new w.default(function(he){var te=Object(M.a)(he),ye;try{for(te.s();!(ye=te.n()).done;){var ue=ye.value;(ue.target.offsetHeight>0||ue.target.offsetWidth>0)&&je.layout()}}catch(Le){te.e(Le)}finally{te.f()}}),xe.observe(F.current)),xe}Object(c.useEffect)(function(){return F.current&&N.e(27).then(N.t.bind(null,"M/lh",7)).then(function(je){A=je;var xe=A.editor.createDiffEditor(F.current,Object(ee.a)(Object(ee.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},H),{},{wordWrap:!0}));Ae(xe);var he=Ge(xe);return function(){xe.dispose();var te=xe.getModel();te&&te.dispose(),he.unobserve(F.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(c.useEffect)(function(){pe&&pe.setModel({original:A.editor.createModel(I,W),modified:A.editor.createModel(C,W)})},[I,C,W,pe]);var Fe=u(D),Ue=u(S),_e={width:Fe,height:Ue};return g.a.createElement("div",{className:"my-diff-editor",ref:F,style:_e})}},ZpRC:function(et,de,N){"use strict";function ee(c){return typeof c=="object"&&c!=null&&c.nodeType===1}function K(c,g){return(!g||c!=="hidden")&&c!=="visible"&&c!=="clip"}function P(c,g){if(c.clientHeight<c.scrollHeight||c.clientWidth<c.scrollWidth){var w=getComputedStyle(c,null);return K(w.overflowY,g)||K(w.overflowX,g)||function(y){var f=function(m){if(!m.ownerDocument||!m.ownerDocument.defaultView)return null;try{return m.ownerDocument.defaultView.frameElement}catch(a){return null}}(y);return!!f&&(f.clientHeight<y.scrollHeight||f.clientWidth<y.scrollWidth)}(c)}return!1}function z(c,g,w,y,f,m,a,n){return m<c&&a>g||m>c&&a<g?0:m<=c&&n<=w||a>=g&&n>=w?m-c-y:a>g&&n<w||m<c&&n>w?a-g+f:0}var B=function(c,g){var w=window,y=g.scrollMode,f=g.block,m=g.inline,a=g.boundary,n=g.skipOverflowHiddenElements,o=typeof a=="function"?a:function(Me){return Me!==a};if(!ee(c))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,x=[],E=c;ee(E)&&o(E);){if((E=E.parentElement)===u){x.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,n)&&x.push(E)}for(var v=w.visualViewport?w.visualViewport.width:innerWidth,O=w.visualViewport?w.visualViewport.height:innerHeight,A=window.scrollX||pageXOffset,p=window.scrollY||pageYOffset,h=c.getBoundingClientRect(),s=h.height,l=h.width,D=h.top,T=h.right,S=h.bottom,I=h.left,C=f==="start"||f==="nearest"?D:f==="end"?S:D+s/2,W=m==="center"?I+l/2:m==="end"?T:I,Y=[],H=0;H<x.length;H++){var F=x[H],q=F.getBoundingClientRect(),le=q.height,pe=q.width,Ae=q.top,Ge=q.right,Fe=q.bottom,Ue=q.left;if(y==="if-needed"&&D>=0&&I>=0&&S<=O&&T<=v&&D>=Ae&&S<=Fe&&I>=Ue&&T<=Ge)return Y;var _e=getComputedStyle(F),je=parseInt(_e.borderLeftWidth,10),xe=parseInt(_e.borderTopWidth,10),he=parseInt(_e.borderRightWidth,10),te=parseInt(_e.borderBottomWidth,10),ye=0,ue=0,Le="offsetWidth"in F?F.offsetWidth-F.clientWidth-je-he:0,ae="offsetHeight"in F?F.offsetHeight-F.clientHeight-xe-te:0;if(u===F)ye=f==="start"?C:f==="end"?C-O:f==="nearest"?z(p,p+O,O,xe,te,p+C,p+C+s,s):C-O/2,ue=m==="start"?W:m==="center"?W-v/2:m==="end"?W-v:z(A,A+v,v,je,he,A+W,A+W+l,l),ye=Math.max(0,ye+p),ue=Math.max(0,ue+A);else{ye=f==="start"?C-Ae-xe:f==="end"?C-Fe+te+ae:f==="nearest"?z(Ae,Fe,le,xe,te+ae,C,C+s,s):C-(Ae+le/2)+ae/2,ue=m==="start"?W-Ue-je:m==="center"?W-(Ue+pe/2)+Le/2:m==="end"?W-Ge+he+Le:z(Ue,Ge,pe,je,he+Le,W,W+l,l);var oe=F.scrollLeft,Se=F.scrollTop;C+=Se-(ye=Math.max(0,Math.min(Se+ye,F.scrollHeight-le+ae))),W+=oe-(ue=Math.max(0,Math.min(oe+ue,F.scrollWidth-pe+Le)))}Y.push({el:F,top:ye,left:ue})}return Y};function M(c){return c===Object(c)&&Object.keys(c).length!==0}function j(c,g){g===void 0&&(g="auto");var w="scrollBehavior"in document.body.style;c.forEach(function(y){var f=y.el,m=y.top,a=y.left;f.scroll&&w?f.scroll({top:m,left:a,behavior:g}):(f.scrollTop=m,f.scrollLeft=a)})}function U(c){return c===!1?{block:"end",inline:"nearest"}:M(c)?c:{block:"start",inline:"nearest"}}function _(c,g){var w=!c.ownerDocument.documentElement.contains(c);if(M(g)&&typeof g.behavior=="function")return g.behavior(w?[]:B(c,g));if(w)return;var y=U(g);return j(B(c,y),y.behavior)}var R=de.a=_},Zss7:function(et,de,N){var ee;(function(K){var P=/^\s+/,z=/\s+$/,B=0,M=K.round,j=K.min,U=K.max,_=K.random;function R(te,ye){if(te=te||"",ye=ye||{},te instanceof R)return te;if(!(this instanceof R))return new R(te,ye);var ue=c(te);this._originalInput=te,this._r=ue.r,this._g=ue.g,this._b=ue.b,this._a=ue.a,this._roundA=M(100*this._a)/100,this._format=ye.format||ue.format,this._gradientType=ye.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=ue.ok,this._tc_id=B++}R.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var te=this.toRgb();return(te.r*299+te.g*587+te.b*114)/1e3},getLuminance:function(){var te=this.toRgb(),ye,ue,Le,ae,oe,Se;return ye=te.r/255,ue=te.g/255,Le=te.b/255,ye<=.03928?ae=ye/12.92:ae=K.pow((ye+.055)/1.055,2.4),ue<=.03928?oe=ue/12.92:oe=K.pow((ue+.055)/1.055,2.4),Le<=.03928?Se=Le/12.92:Se=K.pow((Le+.055)/1.055,2.4),.2126*ae+.7152*oe+.0722*Se},setAlpha:function(te){return this._a=Y(te),this._roundA=M(100*this._a)/100,this},toHsv:function(){var te=f(this._r,this._g,this._b);return{h:te.h*360,s:te.s,v:te.v,a:this._a}},toHsvString:function(){var te=f(this._r,this._g,this._b),ye=M(te.h*360),ue=M(te.s*100),Le=M(te.v*100);return this._a==1?"hsv("+ye+", "+ue+"%, "+Le+"%)":"hsva("+ye+", "+ue+"%, "+Le+"%, "+this._roundA+")"},toHsl:function(){var te=w(this._r,this._g,this._b);return{h:te.h*360,s:te.s,l:te.l,a:this._a}},toHslString:function(){var te=w(this._r,this._g,this._b),ye=M(te.h*360),ue=M(te.s*100),Le=M(te.l*100);return this._a==1?"hsl("+ye+", "+ue+"%, "+Le+"%)":"hsla("+ye+", "+ue+"%, "+Le+"%, "+this._roundA+")"},toHex:function(te){return a(this._r,this._g,this._b,te)},toHexString:function(te){return"#"+this.toHex(te)},toHex8:function(te){return n(this._r,this._g,this._b,this._a,te)},toHex8String:function(te){return"#"+this.toHex8(te)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(H(this._r,255)*100)+"%",g:M(H(this._g,255)*100)+"%",b:M(H(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(H(this._r,255)*100)+"%, "+M(H(this._g,255)*100)+"%, "+M(H(this._b,255)*100)+"%)":"rgba("+M(H(this._r,255)*100)+"%, "+M(H(this._g,255)*100)+"%, "+M(H(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:C[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(te){var ye="#"+o(this._r,this._g,this._b,this._a),ue=ye,Le=this._gradientType?"GradientType = 1, ":"";if(te){var ae=R(te);ue="#"+o(ae._r,ae._g,ae._b,ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+Le+"startColorstr="+ye+",endColorstr="+ue+")"},toString:function(te){var ye=!!te;te=te||this._format;var ue=!1,Le=this._a<1&&this._a>=0,ae=!ye&&Le&&(te==="hex"||te==="hex6"||te==="hex3"||te==="hex4"||te==="hex8"||te==="name");return ae?te==="name"&&this._a===0?this.toName():this.toRgbString():(te==="rgb"&&(ue=this.toRgbString()),te==="prgb"&&(ue=this.toPercentageRgbString()),(te==="hex"||te==="hex6")&&(ue=this.toHexString()),te==="hex3"&&(ue=this.toHexString(!0)),te==="hex4"&&(ue=this.toHex8String(!0)),te==="hex8"&&(ue=this.toHex8String()),te==="name"&&(ue=this.toName()),te==="hsl"&&(ue=this.toHslString()),te==="hsv"&&(ue=this.toHsvString()),ue||this.toHexString())},clone:function(){return R(this.toString())},_applyModification:function(te,ye){var ue=te.apply(null,[this].concat([].slice.call(ye)));return this._r=ue._r,this._g=ue._g,this._b=ue._b,this.setAlpha(ue._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(A,arguments)},desaturate:function(){return this._applyModification(u,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(E,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(te,ye){return te.apply(null,[this].concat([].slice.call(ye)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(h,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(D,arguments)},triad:function(){return this._applyCombination(s,arguments)},tetrad:function(){return this._applyCombination(l,arguments)}},R.fromRatio=function(te,ye){if(typeof te=="object"){var ue={};for(var Le in te)te.hasOwnProperty(Le)&&(Le==="a"?ue[Le]=te[Le]:ue[Le]=Ge(te[Le]));te=ue}return R(te,ye)};function c(te){var ye={r:0,g:0,b:0},ue=1,Le=null,ae=null,oe=null,Se=!1,Me=!1;return typeof te=="string"&&(te=xe(te)),typeof te=="object"&&(je(te.r)&&je(te.g)&&je(te.b)?(ye=g(te.r,te.g,te.b),Se=!0,Me=String(te.r).substr(-1)==="%"?"prgb":"rgb"):je(te.h)&&je(te.s)&&je(te.v)?(Le=Ge(te.s),ae=Ge(te.v),ye=m(te.h,Le,ae),Se=!0,Me="hsv"):je(te.h)&&je(te.s)&&je(te.l)&&(Le=Ge(te.s),oe=Ge(te.l),ye=y(te.h,Le,oe),Se=!0,Me="hsl"),te.hasOwnProperty("a")&&(ue=te.a)),ue=Y(ue),{ok:Se,format:te.format||Me,r:j(255,U(ye.r,0)),g:j(255,U(ye.g,0)),b:j(255,U(ye.b,0)),a:ue}}function g(te,ye,ue){return{r:H(te,255)*255,g:H(ye,255)*255,b:H(ue,255)*255}}function w(te,ye,ue){te=H(te,255),ye=H(ye,255),ue=H(ue,255);var Le=U(te,ye,ue),ae=j(te,ye,ue),oe,Se,Me=(Le+ae)/2;if(Le==ae)oe=Se=0;else{var We=Le-ae;Se=Me>.5?We/(2-Le-ae):We/(Le+ae);switch(Le){case te:oe=(ye-ue)/We+(ye<ue?6:0);break;case ye:oe=(ue-te)/We+2;break;case ue:oe=(te-ye)/We+4;break}oe/=6}return{h:oe,s:Se,l:Me}}function y(te,ye,ue){var Le,ae,oe;te=H(te,360),ye=H(ye,100),ue=H(ue,100);function Se(Ke,Qe,Ze){return Ze<0&&(Ze+=1),Ze>1&&(Ze-=1),Ze<1/6?Ke+(Qe-Ke)*6*Ze:Ze<1/2?Qe:Ze<2/3?Ke+(Qe-Ke)*(2/3-Ze)*6:Ke}if(ye===0)Le=ae=oe=ue;else{var Me=ue<.5?ue*(1+ye):ue+ye-ue*ye,We=2*ue-Me;Le=Se(We,Me,te+1/3),ae=Se(We,Me,te),oe=Se(We,Me,te-1/3)}return{r:Le*255,g:ae*255,b:oe*255}}function f(te,ye,ue){te=H(te,255),ye=H(ye,255),ue=H(ue,255);var Le=U(te,ye,ue),ae=j(te,ye,ue),oe,Se,Me=Le,We=Le-ae;if(Se=Le===0?0:We/Le,Le==ae)oe=0;else{switch(Le){case te:oe=(ye-ue)/We+(ye<ue?6:0);break;case ye:oe=(ue-te)/We+2;break;case ue:oe=(te-ye)/We+4;break}oe/=6}return{h:oe,s:Se,v:Me}}function m(te,ye,ue){te=H(te,360)*6,ye=H(ye,100),ue=H(ue,100);var Le=K.floor(te),ae=te-Le,oe=ue*(1-ye),Se=ue*(1-ae*ye),Me=ue*(1-(1-ae)*ye),We=Le%6,Ke=[ue,Se,oe,oe,Me,ue][We],Qe=[Me,ue,ue,Se,oe,oe][We],Ze=[oe,oe,Me,ue,ue,Se][We];return{r:Ke*255,g:Qe*255,b:Ze*255}}function a(te,ye,ue,Le){var ae=[Ae(M(te).toString(16)),Ae(M(ye).toString(16)),Ae(M(ue).toString(16))];return Le&&ae[0].charAt(0)==ae[0].charAt(1)&&ae[1].charAt(0)==ae[1].charAt(1)&&ae[2].charAt(0)==ae[2].charAt(1)?ae[0].charAt(0)+ae[1].charAt(0)+ae[2].charAt(0):ae.join("")}function n(te,ye,ue,Le,ae){var oe=[Ae(M(te).toString(16)),Ae(M(ye).toString(16)),Ae(M(ue).toString(16)),Ae(Fe(Le))];return ae&&oe[0].charAt(0)==oe[0].charAt(1)&&oe[1].charAt(0)==oe[1].charAt(1)&&oe[2].charAt(0)==oe[2].charAt(1)&&oe[3].charAt(0)==oe[3].charAt(1)?oe[0].charAt(0)+oe[1].charAt(0)+oe[2].charAt(0)+oe[3].charAt(0):oe.join("")}function o(te,ye,ue,Le){var ae=[Ae(Fe(Le)),Ae(M(te).toString(16)),Ae(M(ye).toString(16)),Ae(M(ue).toString(16))];return ae.join("")}R.equals=function(te,ye){return!te||!ye?!1:R(te).toRgbString()==R(ye).toRgbString()},R.random=function(){return R.fromRatio({r:_(),g:_(),b:_()})};function u(te,ye){ye=ye===0?0:ye||10;var ue=R(te).toHsl();return ue.s-=ye/100,ue.s=F(ue.s),R(ue)}function x(te,ye){ye=ye===0?0:ye||10;var ue=R(te).toHsl();return ue.s+=ye/100,ue.s=F(ue.s),R(ue)}function E(te){return R(te).desaturate(100)}function v(te,ye){ye=ye===0?0:ye||10;var ue=R(te).toHsl();return ue.l+=ye/100,ue.l=F(ue.l),R(ue)}function O(te,ye){ye=ye===0?0:ye||10;var ue=R(te).toRgb();return ue.r=U(0,j(255,ue.r-M(255*-(ye/100)))),ue.g=U(0,j(255,ue.g-M(255*-(ye/100)))),ue.b=U(0,j(255,ue.b-M(255*-(ye/100)))),R(ue)}function A(te,ye){ye=ye===0?0:ye||10;var ue=R(te).toHsl();return ue.l-=ye/100,ue.l=F(ue.l),R(ue)}function p(te,ye){var ue=R(te).toHsl(),Le=(ue.h+ye)%360;return ue.h=Le<0?360+Le:Le,R(ue)}function h(te){var ye=R(te).toHsl();return ye.h=(ye.h+180)%360,R(ye)}function s(te){var ye=R(te).toHsl(),ue=ye.h;return[R(te),R({h:(ue+120)%360,s:ye.s,l:ye.l}),R({h:(ue+240)%360,s:ye.s,l:ye.l})]}function l(te){var ye=R(te).toHsl(),ue=ye.h;return[R(te),R({h:(ue+90)%360,s:ye.s,l:ye.l}),R({h:(ue+180)%360,s:ye.s,l:ye.l}),R({h:(ue+270)%360,s:ye.s,l:ye.l})]}function D(te){var ye=R(te).toHsl(),ue=ye.h;return[R(te),R({h:(ue+72)%360,s:ye.s,l:ye.l}),R({h:(ue+216)%360,s:ye.s,l:ye.l})]}function T(te,ye,ue){ye=ye||6,ue=ue||30;var Le=R(te).toHsl(),ae=360/ue,oe=[R(te)];for(Le.h=(Le.h-(ae*ye>>1)+720)%360;--ye;)Le.h=(Le.h+ae)%360,oe.push(R(Le));return oe}function S(te,ye){ye=ye||6;for(var ue=R(te).toHsv(),Le=ue.h,ae=ue.s,oe=ue.v,Se=[],Me=1/ye;ye--;)Se.push(R({h:Le,s:ae,v:oe})),oe=(oe+Me)%1;return Se}R.mix=function(te,ye,ue){ue=ue===0?0:ue||50;var Le=R(te).toRgb(),ae=R(ye).toRgb(),oe=ue/100,Se={r:(ae.r-Le.r)*oe+Le.r,g:(ae.g-Le.g)*oe+Le.g,b:(ae.b-Le.b)*oe+Le.b,a:(ae.a-Le.a)*oe+Le.a};return R(Se)},R.readability=function(te,ye){var ue=R(te),Le=R(ye);return(K.max(ue.getLuminance(),Le.getLuminance())+.05)/(K.min(ue.getLuminance(),Le.getLuminance())+.05)},R.isReadable=function(te,ye,ue){var Le=R.readability(te,ye),ae,oe;oe=!1,ae=he(ue);switch(ae.level+ae.size){case"AAsmall":case"AAAlarge":oe=Le>=4.5;break;case"AAlarge":oe=Le>=3;break;case"AAAsmall":oe=Le>=7;break}return oe},R.mostReadable=function(te,ye,ue){var Le=null,ae=0,oe,Se,Me,We;ue=ue||{},Se=ue.includeFallbackColors,Me=ue.level,We=ue.size;for(var Ke=0;Ke<ye.length;Ke++)oe=R.readability(te,ye[Ke]),oe>ae&&(ae=oe,Le=R(ye[Ke]));return R.isReadable(te,Le,{level:Me,size:We})||!Se?Le:(ue.includeFallbackColors=!1,R.mostReadable(te,["#fff","#000"],ue))};var I=R.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=R.hexNames=W(I);function W(te){var ye={};for(var ue in te)te.hasOwnProperty(ue)&&(ye[te[ue]]=ue);return ye}function Y(te){return te=parseFloat(te),(isNaN(te)||te<0||te>1)&&(te=1),te}function H(te,ye){le(te)&&(te="100%");var ue=pe(te);return te=j(ye,U(0,parseFloat(te))),ue&&(te=parseInt(te*ye,10)/100),K.abs(te-ye)<1e-6?1:te%ye/parseFloat(ye)}function F(te){return j(1,U(0,te))}function q(te){return parseInt(te,16)}function le(te){return typeof te=="string"&&te.indexOf(".")!=-1&&parseFloat(te)===1}function pe(te){return typeof te=="string"&&te.indexOf("%")!=-1}function Ae(te){return te.length==1?"0"+te:""+te}function Ge(te){return te<=1&&(te=te*100+"%"),te}function Fe(te){return K.round(parseFloat(te)*255).toString(16)}function Ue(te){return q(te)/255}var _e=function(){var te="[-\\+]?\\d+%?",ye="[-\\+]?\\d*\\.\\d+%?",ue="(?:"+ye+")|(?:"+te+")",Le="[\\s|\\(]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")\\s*\\)?",ae="[\\s|\\(]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")\\s*\\)?";return{CSS_UNIT:new RegExp(ue),rgb:new RegExp("rgb"+Le),rgba:new RegExp("rgba"+ae),hsl:new RegExp("hsl"+Le),hsla:new RegExp("hsla"+ae),hsv:new RegExp("hsv"+Le),hsva:new RegExp("hsva"+ae),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function je(te){return!!_e.CSS_UNIT.exec(te)}function xe(te){te=te.replace(P,"").replace(z,"").toLowerCase();var ye=!1;if(I[te])te=I[te],ye=!0;else if(te=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ue;return(ue=_e.rgb.exec(te))?{r:ue[1],g:ue[2],b:ue[3]}:(ue=_e.rgba.exec(te))?{r:ue[1],g:ue[2],b:ue[3],a:ue[4]}:(ue=_e.hsl.exec(te))?{h:ue[1],s:ue[2],l:ue[3]}:(ue=_e.hsla.exec(te))?{h:ue[1],s:ue[2],l:ue[3],a:ue[4]}:(ue=_e.hsv.exec(te))?{h:ue[1],s:ue[2],v:ue[3]}:(ue=_e.hsva.exec(te))?{h:ue[1],s:ue[2],v:ue[3],a:ue[4]}:(ue=_e.hex8.exec(te))?{r:q(ue[1]),g:q(ue[2]),b:q(ue[3]),a:Ue(ue[4]),format:ye?"name":"hex8"}:(ue=_e.hex6.exec(te))?{r:q(ue[1]),g:q(ue[2]),b:q(ue[3]),format:ye?"name":"hex"}:(ue=_e.hex4.exec(te))?{r:q(ue[1]+""+ue[1]),g:q(ue[2]+""+ue[2]),b:q(ue[3]+""+ue[3]),a:Ue(ue[4]+""+ue[4]),format:ye?"name":"hex8"}:(ue=_e.hex3.exec(te))?{r:q(ue[1]+""+ue[1]),g:q(ue[2]+""+ue[2]),b:q(ue[3]+""+ue[3]),format:ye?"name":"hex"}:!1}function he(te){var ye,ue;return te=te||{level:"AA",size:"small"},ye=(te.level||"AA").toUpperCase(),ue=(te.size||"small").toLowerCase(),ye!=="AA"&&ye!=="AAA"&&(ye="AA"),ue!=="small"&&ue!=="large"&&(ue="small"),{level:ye,size:ue}}et.exports?et.exports=R:!(ee=function(){return R}.call(de,N,de,et),ee!==void 0&&(et.exports=ee))})(Math)},bPs0:function(et,de,N){"use strict";N.d(de,"b",function(){return u});var ee=N("k1fw"),K=N("9og8"),P=N("2qtc"),z=N("kLXV"),B=N("tJVT"),M=N("PpiC"),j=N("aHsQ"),U=N("sGsY"),_=N("WmNS"),R=N.n(_),c=N("q1tI"),g=N.n(c),w=N("bntm"),y=N("V0Rq"),f=N("wd/R"),m=N.n(f),a=N("Ty5D"),n=N("9kvl"),o=U.a.Countdown,u=["fullscreenchange","msfullscreenchange","webkitfullscreenchange","mozfullscreenchange"],x=function(v){var O=v.globalSetting,A=v.loading,p=v.user,h=v.exercise,s=v.dispatch,l=Object(M.a)(v,["globalSetting","loading","user","exercise","dispatch"]),D=Object(c.useState)({}),T=Object(B.a)(D,2),S=T[0],I=T[1],C=z.a.useModal(),W=Object(B.a)(C,2),Y=W[0],H=W[1],F=Object(c.useRef)(),q=Object(c.useRef)(null),le=Object(c.useRef)(null),pe=Object(c.useState)(!0),Ae=Object(B.a)(pe,2),Ge=Ae[0],Fe=Ae[1],Ue=Object(a.h)().query,_e=Object(a.i)();Object(c.useEffect)(function(){var Me,We,Ke,Qe,Ze;if(clearTimeout(q.current),document.addEventListener(Object(w.c)(),Se,!1),window.addEventListener("blur",ae,!1),(Me=h.exerciseUserInfo)!==null&&Me!==void 0&&Me.screen_open&&Object(w.a)()&&(s({type:"globalSetting/headerFooterToggle",payload:!1}),Fe(!1)),(We=h.exerciseUserInfo)!==null&&We!==void 0&&We.screen_at&&m()().diff(m()((Ke=h.exerciseUserInfo)===null||Ke===void 0?void 0:Ke.screen_at),"seconds")>0)je();else if((Qe=h.exerciseUserInfo)!==null&&Qe!==void 0&&Qe.screen_open&&!Object(w.a)()){var yt=document.domain==="kepukehuan.educoder.net"?30:h.exerciseUserInfo.screen_sec+10+1;F.current=z.a.info({icon:null,content:g.a.createElement("div",{className:"tc font16"},"\u672C\u573A\u8003\u8BD5\u5DF2\u5F00\u542F\u9632\u5207\u5C4F\u9650\u5236\uFF0C",g.a.createElement("br",null),"\u5207\u6362\u9875\u9762 ",h.exerciseUserInfo.screen_num-h.exerciseUserInfo.used_screen_num," \u6B21\u540E\u5C06\u8FDB\u884C\u5F3A\u5236\u4EA4\u5377\uFF0C",g.a.createElement("br",null),"\u8BF7\u52FF\u5207\u5C4F\u53CA\u5237\u65B0\u9875\u9762"),okText:g.a.createElement("span",null,"\u5F00\u59CB\u8003\u8BD5\uFF08",g.a.createElement("span",{style:{display:"inline-block"}},g.a.createElement(o,{onFinish:function(){var dt;je(),(dt=F.current)===null||dt===void 0||dt.destroy()},valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+yt*1e3})),"S\uFF09"),onOk:function(){var dt;(dt=F.current)===null||dt===void 0||dt.destroy(),Fe(!1),Object(w.d)(document.body),document.getElementById("root").addEventListener("click",xe,!1)}})}return(Ze=h.exerciseUserInfo)!==null&&Ze!==void 0&&Ze.screen_open&&!Object(w.a)()||document.getElementById("root").addEventListener("click",xe,!1),function(){document.getElementById("root").removeEventListener("click",xe,!1),document.removeEventListener(Object(w.c)(),Se,!1),window.removeEventListener("blur",ae,!1),clearTimeout(q.current)}},[]),Object(c.useEffect)(function(){setTimeout(function(){h.actionTabs.removeEventListenerExitScreen&&(clearTimeout(q.current),document.getElementById("root").removeEventListener("click",xe,!1),document.removeEventListener(Object(w.c)(),Se,!1))},500),he()},[h.actionTabs]),Object(c.useEffect)(function(){setTimeout(function(){h.exerciseUserInfo.used_screen_num>h.exerciseUserInfo.screen_num?ue():!Ge},500)},[h.exerciseUserInfo]);var je=function(){var Me=Object(K.a)(R.a.mark(function We(){var Ke;return R.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return Ze.next=2,oe();case 2:Ke=Ze.sent,setTimeout(function(){var yt,vt;(yt=F.current)===null||yt===void 0||yt.destroy(),F.current=z.a.info({okText:g.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:g.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",g.a.createElement("span",{className:"c-red"},Ke.used_screen_num),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",g.a.createElement("span",{className:"c-red"},(vt=h.exerciseUserInfo)===null||vt===void 0?void 0:vt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377"),onOk:function(){var dt=Object(K.a)(R.a.mark(function At(){return R.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:Object(w.d)(document.body);case 1:case"end":return Oe.stop()}},At)}));function pt(){return dt.apply(this,arguments)}return pt}()})},1e3);case 4:case"end":return Ze.stop()}},We)}));return function(){return Me.apply(this,arguments)}}(),xe=function(We){!Object(w.a)()&&We.target.nodeName!=="A"&&We.target.nodeName!=="BUTTON"&&We.target.innerHTML!=="\u786E \u5B9A"&&(Object(w.d)(document.body),console.log("documentClick.full"))},he=function(){var Me=Object(K.a)(R.a.mark(function We(){return R.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Qe.abrupt("return",new Promise(function(){var Ze=Object(K.a)(R.a.mark(function yt(vt){var dt;return R.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,s({type:"exercise/getExerciseUserInfo",payload:Object(ee.a)({},_e)});case 2:return dt=At.sent,vt(dt==null?void 0:dt.data),At.abrupt("return",dt==null?void 0:dt.data);case 5:case"end":return At.stop()}},yt)}));return function(yt){return Ze.apply(this,arguments)}}()));case 1:case"end":return Qe.stop()}},We)}));return function(){return Me.apply(this,arguments)}}(),te=function(){var Me=Object(K.a)(R.a.mark(function We(Ke){var Qe,Ze,yt;return R.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:(Qe=F.current)===null||Qe===void 0||((Ze=Qe.destroyAll)===null||Ze===void 0)||Ze.call(Qe),F.current=z.a.info({maskClosable:!1,keyboard:!1,okText:g.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5\uFF08",g.a.createElement("span",{style:{display:"inline-block"}},g.a.createElement(o,{onFinish:oe,valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+(h.exerciseUserInfo.screen_sec+1)*1e3})),"S\uFF09"),content:g.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",g.a.createElement("span",{className:"c-red"},Ke),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",g.a.createElement("span",{className:"c-red"},(yt=h.exerciseUserInfo)===null||yt===void 0?void 0:yt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377,",g.a.createElement("span",{className:"c-red"},h.exerciseUserInfo.screen_sec),"\u79D2\u5185\u56DE\u5230",g.a.createElement("br",null),g.a.createElement("span",{style:{marginLeft:38}},"\u8003\u8BD5\u4E0D\u8BA1\u5207\u5C4F\u6B21\u6570\u3002")),onOk:function(){var pt=Object(K.a)(R.a.mark(function wt(){return R.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:clearTimeout(le.current),Object(w.d)(document.body),F.current.destroy();case 3:case"end":return we.stop()}},wt)}));function At(){return pt.apply(this,arguments)}return At}()}),le.current=setTimeout(function(){var pt;F.current.update({okText:g.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:g.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",g.a.createElement("span",{className:"c-red"},Ke+1),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",g.a.createElement("span",{className:"c-red"},(pt=h.exerciseUserInfo)===null||pt===void 0?void 0:pt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377")})},(h.exerciseUserInfo.screen_sec+1)*1e3);case 3:case"end":return dt.stop()}},We)}));return function(Ke){return Me.apply(this,arguments)}}(),ye=function(){location.href="/classrooms/".concat(_e.coursesId,"/exercise/").concat(_e.categoryId,"/detail")},ue=function(){var Me=Object(K.a)(R.a.mark(function We(){var Ke,Qe,Ze;return R.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return(Ke=F.current)===null||Ke===void 0||((Qe=Ke.destroyAll)===null||Qe===void 0)||Qe.call(Ke),vt.next=3,Object(y.Z)({categoryId:_e.categoryId,commit_method:1});case 3:Ze=vt.sent,Ze&&Le();case 5:case"end":return vt.stop()}},We)}));return function(){return Me.apply(this,arguments)}}(),Le=function(){var We,Ke;document.removeEventListener(Object(w.c)(),Se,!1),Object(w.b)(),(We=F.current)===null||We===void 0||((Ke=We.destroyAll)===null||Ke===void 0)||Ke.call(We),Y.info({content:g.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",g.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){ye()}})},ae=function(We){Object(w.a)()&&document.getElementById("iframeShixuns").style.display=="none"&&Object(w.b)()},oe=function(){var Me=Object(K.a)(R.a.mark(function We(){return R.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Qe.abrupt("return",new Promise(function(){var Ze=Object(K.a)(R.a.mark(function yt(vt){var dt,pt,At;return R.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(!((dt=h.exerciseUserInfo)!==null&&dt!==void 0&&dt.screen_at)){Oe.next=3;break}return Oe.next=3,Object(y.g)(Object(ee.a)(Object(ee.a)({},_e),{},{reset:!0}));case 3:return Oe.next=5,Object(y.Q)({id:_e.categoryId});case 5:if(pt=Oe.sent,!(pt!=null&&pt.is_commit)){Oe.next=9;break}return Le(),Oe.abrupt("return");case 9:return Oe.next=11,he();case 11:At=Oe.sent,vt(At);case 13:case"end":return Oe.stop()}},yt)}));return function(yt){return Ze.apply(this,arguments)}}()));case 1:case"end":return Qe.stop()}},We)}));return function(){return Me.apply(this,arguments)}}(),Se=function(){var Me=Object(K.a)(R.a.mark(function We(){var Ke,Qe,Ze,yt;return R.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:if(Ke=!1,console.log("fullscreen change"),!Object(w.a)()){dt.next=7;break}(Qe=h.exerciseUserInfo)!==null&&Qe!==void 0&&Qe.screen_at&&Object(y.g)(Object(ee.a)(Object(ee.a)({},_e),{},{reset:!0})),clearTimeout(q.current),dt.next=17;break;case 7:return Ke=!0,dt.next=10,Object(y.g)(Object(ee.a)({},_e));case 10:return dt.next=12,he();case 12:Ze=dt.sent,te(Ze.used_screen_num),yt=setTimeout(Object(K.a)(R.a.mark(function pt(){return R.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:case"end":return wt.stop()}},pt)})),h.exerciseUserInfo.screen_sec*1e3),window.frames.length!=parent.frames.length&&window.parent.postMessage("backExercise","*"),q.current=yt;case 17:s({type:"globalSetting/headerFooterToggle",payload:Ke});case 18:case"end":return dt.stop()}},We)}));return function(){return Me.apply(this,arguments)}}();return g.a.createElement("div",null,H)};de.a=Object(n.a)(function(E){var v=E.loading,O=E.user,A=E.exercise,p=E.globalSetting;return{globalSetting:p,user:O,exercise:A,loading:v.effects}})(x)},bT9E:function(et,de,N){"use strict";N.d(de,"a",function(){return K});var ee=N("VTBJ");function K(P,z){var B=Object(ee.a)({},P);return Array.isArray(z)&&z.forEach(function(M){delete B[M]}),B}},biw7:function(et,de,N){"use strict";var ee=N("q1tI"),K=N.n(ee),P=ee.createContext(null);de.a=P},c5Ni:function(et,de,N){},cQPA:function(et,de,N){"use strict";N.r(de);var ee=N("T2oS"),K=N("W9HT"),P=N("sPJy"),z=N("bE4q"),B=N("+L6B"),M=N("2/Rp"),j=N("14J3"),U=N("BMrR"),_=N("jCWc"),R=N("kPKH"),c=N("5Dmo"),g=N("3S7+"),w=N("sRBo"),y=N("kaz8"),f=N("7Kak"),m=N("9yH6"),a=N("MXD1"),n=N("CFYs"),o=N("miYZ"),u=N("tsqr"),x=N("2qtc"),E=N("kLXV"),v=N("k1fw"),O=N("9og8"),A=N("tJVT"),p=N("PpiC"),h=N("5NDa"),s=N("5rEg"),l=N("aHsQ"),D=N("sGsY"),T=N("WmNS"),S=N.n(T),I=N("q1tI"),C=N.n(I),W=N("Ty5D"),Y=N("55Ip"),H=N("9kvl"),F=N("gUdW"),q=N("xGfz"),le=N("jhfD"),pe=N("BlwA"),Ae=N("bPs0"),Ge=N("wd/R"),Fe=N.n(Ge),Ue=N("9GDu"),_e=N.n(Ue),je=N("1vsH"),xe=N("s8TD"),he=N("xKgJ"),te=N("bntm"),ye=N("V0Rq"),ue=N("HBuW"),Le=N("9Bee"),ae=N("Ot1p"),oe=function(Xe){var Pe,se,fe,$e,ke,it,at=Xe.item,Ne=Xe.answerData,Ve=Xe.isEducation,tt=Xe.sign,ft=Xe.onBlur,Ct=ft===void 0?function(){}:ft,zt=Object(I.useRef)(""),qt=Object(I.useState)(),Qt=Object(A.a)(qt,2),St=Qt[0],ln=Qt[1],Bt=Object(I.useState)(!1),Yt=Object(A.a)(Bt,2),Mt=Yt[0],tn=Yt[1],mn=Object(I.useState)(Ve||!1),An=Object(A.a)(mn,2),lt=An[0],Rt=An[1],Jt=Object(I.useRef)(),nn=function(){clearInterval(Jt.current),Jt.current=setInterval(function(){Mt&&Ct(zt.current)},30*1e3)},un=function(G){Ct(zt.current);var b="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(G||window.event).returnValue=b,b};return Object(I.useEffect)(function(){console.log("isFocus:",Mt),Mt?(window.addEventListener("beforeunload",un),nn()):window.removeEventListener("beforeunload",un)},[Mt]),Object(I.useEffect)(function(){ln(at==null?void 0:at.a_flag)},[at==null?void 0:at.a_flag]),Object(I.useEffect)(function(){return function(){clearInterval(Jt.current)}},[]),console.log(!at.repeat_answer&&(at==null||((Pe=at.user_answer)===null||Pe===void 0)?void 0:Pe.length)>0&&!at.israp,222),C.a.createElement("div",null,(Ne==null||((se=Ne.exercise)===null||se===void 0)?void 0:se.commit_status)===1?C.a.createElement("div",null,C.a.createElement("p",{className:"mt10 mb0"},"\u6211\u7684\u7B54\u6848\uFF1A"),C.a.createElement("div",{className:_e.a.simpleText},C.a.createElement(Le.a,{value:at==null||((fe=at.user_answer)===null||fe===void 0)?void 0:fe[0]}))):C.a.createElement("div",{className:at.user_score&&(at.user_score===at.question_score?"c-green":"c-red")},lt?C.a.createElement(ae.a,{watch:!0,isFocus:!0,defaultValue:at==null||(($e=at.user_answer)===null||$e===void 0)?void 0:$e[0],id:at==null?void 0:at.question_id,onChange:function(G){zt.current=G,tn(!0)},onBlur:function(){setTimeout(function(){Ct(zt.current)},200),clearInterval(Jt.current),tn(!1)}}):C.a.createElement("div",{onClick:function(){var G;if(!at.repeat_answer&&(at==null||((G=at.user_answer)===null||G===void 0)?void 0:G.length)>0)return;tt.current=!0,Rt(!0)}},C.a.createElement(s.a,{disabled:!at.repeat_answer&&(at==null||((ke=at.user_answer)===null||ke===void 0)?void 0:ke.length)>0&&!at.israp,size:"large",className:"current",placeholder:"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",readOnly:!0}))),(at==null?void 0:at.standard_answer)&&C.a.createElement("div",null,C.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),C.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},C.a.createElement(Le.a,{value:at==null||((it=at.standard_answer)===null||it===void 0)?void 0:it[0]}))))},Se=oe,Me=N("g9YV"),We=N("wCAj"),Ke=N("5GOC"),Qe=N("JsLm"),Ze=N("ZW9T"),yt=N("o/qq"),vt=N.n(yt),dt=function(Xe){var Pe,se,fe,$e,ke=Xe.item,it=Xe.answerData,at=Object(I.useState)([]),Ne=Object(A.a)(at,2),Ve=Ne[0],tt=Ne[1],ft=Object(I.useState)([]),Ct=Object(A.a)(ft,2),zt=Ct[0],qt=Ct[1];Object(I.useEffect)(function(){var Bt;if(!(ke!=null&&(Bt=ke.shixun_details)!==null&&Bt!==void 0&&Bt.length))return;for(var Yt=[],Mt=[],tn=0;tn<(ke==null||((mn=ke.shixun_details)===null||mn===void 0)?void 0:mn.length);tn++){for(var mn,An,lt,Rt=0;Rt<(ke==null?void 0:ke.shixun_details[tn].stage_list.length);Rt++){var Jt,nn,un,cn,G=ke==null?void 0:ke.shixun_details[tn].stage_list[Rt];Yt.push(Object(v.a)(Object(v.a)({},G),{operation:ke==null||((Jt=ke.shixun_details)===null||Jt===void 0||((nn=Jt[tn])===null||nn===void 0||((un=nn.shixun_detail)===null||un===void 0||((cn=un[0])===null||cn===void 0))))?void 0:cn.game_identifier}))}if(ke!=null&&(An=ke.shixun_details)!==null&&An!==void 0&&(lt=An[tn])!==null&&lt!==void 0&&lt.shixun_detail){var b,L,V;Mt.push(ke==null||((b=ke.shixun_details)===null||b===void 0||((L=b[tn])===null||L===void 0||((V=L.shixun_detail)===null||V===void 0)))?void 0:V[0])}}qt(Mt),tt(Yt)},[ke==null?void 0:ke.shixun_details]);var Qt=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function(Yt){return C.a.createElement("span",{className:"overflowHidden1",style:{maxWidth:"400px"},title:Yt&&Yt.length>25?Yt:""},Yt)}},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",key:"evaluate_count",align:"center",render:function(Yt,Mt){return C.a.createElement("span",null,Mt.evaluate_count?Mt.evaluate_count:C.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:function(Yt,Mt){var tn=!1;return Mt.finished_time&&it!==null&&it!==void 0&&it.exercise&&it!==null&&it!==void 0&&it.exercise_answer_user&&((it==null?void 0:it.exercise.time)===-1?tn=Fe()(it==null?void 0:it.exercise.end_time).isBefore(Mt.finished_time):tn=Fe()(it==null?void 0:it.exercise_answer_user.start_at).add(it==null?void 0:it.exercise.time,"m").isBefore(Mt.finished_time)),C.a.createElement("span",null,Mt.finished_time||C.a.createElement("span",{className:"c-grey-999"},"--"),C.a.createElement("span",{className:"c-orange-ff9 "},tn?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:function(Yt,Mt){return C.a.createElement("span",null,Mt.time_consuming||C.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:function(Yt,Mt){return C.a.createElement("span",null,Mt.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:function(Yt,Mt,tn){return Yt?C.a.createElement(Qe.a,{affix:!1,className:"mt10"},C.a.createElement(Qe.a.Link,{href:"#challenge_".concat(ke==null?void 0:ke.question_id).concat(tn),title:C.a.createElement("span",{style:{color:"#0152d9"}},"\u67E5\u770B")})):C.a.createElement("span",{className:"c-grey-999"},"--")}}],St=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(Yt,Mt){return C.a.createElement("span",null,Mt.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(Yt,Mt){return C.a.createElement("span",null,Mt.error_msg?Mt.error_msg:"--")}}],ln={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return C.a.createElement("div",{className:"mt15 mb15"},(it==null||((Pe=it.exercise)===null||Pe===void 0)?void 0:Pe.commit_status)===0&&C.a.createElement("div",null,ke.shixun.map(function(Bt,Yt){return C.a.createElement(U.a,{className:"font16",gutter:[0,20]},C.a.createElement(R.a,{flex:"1"},Bt.challenge_name," (",Bt.challenge_score,"\u5206)"),C.a.createElement(R.a,{flex:"100px",className:"tr"},Bt.answer_status===0&&C.a.createElement("span",{className:"font12 tag-style-border border-orange c-orange "},"\u672A\u5B8C\u6210"),Bt.answer_status===1&&C.a.createElement("span",{className:"font12 tag-style-border border-green c-green "},"\u5DF2\u5B8C\u6210")))})),(it==null||((se=it.exercise)===null||se===void 0)?void 0:se.commit_status)!==0||(it==null||((fe=it.exercise)===null||fe===void 0)?void 0:fe.user_exercise_status)!==0?C.a.createElement(C.a.Fragment,null,!!(Ve!=null&&Ve.length)&&C.a.createElement("div",null,C.a.createElement("p",{className:"font16 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),C.a.createElement(We.a,{columns:Qt,dataSource:Ve,pagination:!1})),!!(zt!=null&&zt.length)&&C.a.createElement("div",null,C.a.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),zt==null?void 0:zt.map(function(Bt,Yt){return C.a.createElement("div",{id:"challenge_".concat(ke==null?void 0:ke.question_id).concat(Yt),className:"mt5"},C.a.createElement("div",null,C.a.createElement("span",{className:"font16 mr15"}," \u7B2C",Bt.position,"\u5173"),C.a.createElement(Y.a,{className:"current c-black font16",to:"/tasks/".concat(Bt.game_identifier)},Bt.name)),(Bt==null?void 0:Bt.st)===0&&Bt.passed_code&&C.a.createElement("aside",{className:vt.a.shixunWrp},C.a.createElement("h2",null,"\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09",C.a.createElement("span",{className:"c-light-black"},Bt.path)),C.a.createElement(Ze.b,{height:300,language:"python",theme:"default",value:Bt.passed_code,options:ln})))}))):C.a.createElement(C.a.Fragment,null,C.a.createElement(Le.a,{className:"c-grey-999 mt20 mb20",value:ke==null?void 0:ke.question_title}),ke==null||(($e=ke.shixun)===null||$e===void 0)?void 0:$e.map(function(Bt,Yt){return C.a.createElement("p",{className:"font16 c-grey-666 mb5",key:Yt},C.a.createElement("span",{className:"mr20"},"\u7B2C",Bt==null?void 0:Bt.challenge_position,"\u5173 ",Bt==null?void 0:Bt.challenge_name),C.a.createElement("span",null,Bt==null?void 0:Bt.challenge_score,"\u5206"))})))},pt=dt,At=N("J66h"),wt=function(Xe){var Pe=Xe.item,se=Xe.answerData,fe=Object(I.useState)([]),$e=Object(A.a)(fe,2),ke=$e[0],it=$e[1];Object(I.useEffect)(function(){var Ve;if((Pe==null||((Ve=Pe.evaluate_codes)===null||Ve===void 0)?void 0:Ve.length)>0){var tt;it(Pe==null||((tt=Pe.evaluate_codes)===null||tt===void 0)?void 0:tt.map(function(ft,Ct){return{key:Ct+1,error_msg:ft!=null&&ft.error_msg?At.Base64.decode(ft==null?void 0:ft.error_msg):""}}))}else it([{key:"--",error_msg:"--"}])},[Pe==null?void 0:Pe.evaluate_codes]);var at=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(tt,ft){return C.a.createElement("span",null,ft.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(tt,ft){return C.a.createElement("span",null,ft.error_msg?ft.error_msg:"--")}}],Ne={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{className:"mt15 mb15"},C.a.createElement(Le.a,{value:Pe==null?void 0:Pe.description})),!!(Pe!=null&&Pe.user_answer.length)&&(Pe==null?void 0:Pe.passed_code)&&C.a.createElement("aside",{className:vt.a.shixunWrp},C.a.createElement("h3",null,"\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"),C.a.createElement(Ze.b,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:Pe!=null&&Pe.passed_code?At.Base64.decode(Pe==null?void 0:Pe.passed_code):"",options:Ne})))},Oe=wt,we=N("oBTY"),Je=N("m3rI"),st=s.a.TextArea,He=function(Xe){var Pe,se,fe=Xe.item,$e=Xe.answerData,ke=Xe.answerCheckData,it=ke===void 0?{}:ke,at=Xe.sign,Ne=Xe.onBlur,Ve=Ne===void 0?function(){}:Ne,tt=Object(I.useState)([]),ft=Object(A.a)(tt,2),Ct=ft[0],zt=ft[1],qt=Object(I.useRef)(!1);Object(I.useEffect)(function(){return window.addEventListener("beforeunload",Qt),function(){window.removeEventListener("beforeunload",Qt)}},[Ct,it,fe]);var Qt=function(){var St=Object(O.a)(S.a.mark(function ln(){var Bt,Yt,Mt,tn,mn,An,lt,Rt;return S.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:if(!(qt.current===!1)){nn.next=2;break}return nn.abrupt("return");case 2:if(Bt=Ct[qt.current],Yt=Bt.answer_text,Mt=Bt.choice_id,Yt.replaceAll(" ","")){nn.next=5;break}return nn.abrupt("return");case 5:if(mn={questionId:fe==null?void 0:fe.question_id,exercise_choice_id:Mt,answer_text:Yt},!((it==null?void 0:it.ip_limit)==="inner"||it.ip_bind)){nn.next=10;break}return nn.next=9,Object(xe.a)({ip_limit:it==null?void 0:it.ip_limit});case 9:tn=nn.sent;case 10:mn.ip=tn,An=Object(v.a)({},mn),lt={type:"application/json"},Rt=new Blob([JSON.stringify(An)],lt),window.navigator.sendBeacon("".concat(Je.a.API_SERVER,"/api/exercise_questions/").concat(mn.questionId,"/exercise_answers.json"),Rt);case 15:case"end":return nn.stop()}},ln)}));return function(){return St.apply(this,arguments)}}();return Object(I.useEffect)(function(){for(var St=[],ln=function(Mt){var tn,mn=(fe==null||((tn=fe.user_answer)===null||tn===void 0)?void 0:tn.find(function(An){return An.choice_id===Mt+1}))||{choice_id:Mt+1,answer_text:""};St.push(Object(v.a)({},mn))},Bt=0;Bt<(fe==null?void 0:fe.multi_count);Bt++)ln(Bt);zt(St)},[fe==null?void 0:fe.user_answer]),C.a.createElement("div",null,Ct==null?void 0:Ct.map(function(St,ln){var Bt;return C.a.createElement("div",{key:ln,className:"mt10"},C.a.createElement("span",null,"\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A",ln+1,"\uFF09:"),C.a.createElement("div",null,C.a.createElement(st,{autoSize:!0,rows:4,disabled:!fe.repeat_answer&&(fe==null||((Bt=fe.user_answer)===null||Bt===void 0)?void 0:Bt.length)>0&&!fe.israp||!!($e!=null&&$e.exercise.commit_status),value:St==null?void 0:St.answer_text,onChange:function(Mt){qt.current=ln,Ct[ln].answer_text=Mt.target.value,zt(Object(we.a)(Ct))},onFocus:function(){at.current=!0},onBlur:function(Mt){qt.current=!1,setTimeout(function(){Ve(St==null?void 0:St.answer_text,ln+1,Ct)},200)},className:"overflow_hidden ".concat(fe.user_score&&(fe.user_score===fe.question_score?"c-green":"c-red"))})))}),!!(fe!=null&&(Pe=fe.standard_answer)!==null&&Pe!==void 0&&Pe.length)&&C.a.createElement("div",null,fe==null||((se=fe.standard_answer)===null||se===void 0)?void 0:se.map(function(St,ln){return C.a.createElement("div",null,C.a.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",ln+1,"\uFF09:"),C.a.createElement("div",null,C.a.createElement(st,{autoSize:!0,disabled:!0,value:St==null?void 0:St.answer_text[0]})))})))},nt=He,Te=N("lzim"),ge=s.a.TextArea,be=function(Xe){var Pe=Xe.data;return C.a.createElement("div",{className:"tc mt80"},C.a.createElement("img",{width:"486",src:Te.n})," ",C.a.createElement("br",null),Pe.status===-1&&C.a.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),Pe.status===-2&&C.a.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",C.a.createElement("span",{className:"c-red"},Pe.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),C.a.createElement(M.a,{className:"mt40 pl20 pr20",type:"primary"},C.a.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875")))},re=be,ie=N("LvDl"),ce=D.a.Countdown,Ee=s.a.TextArea,Be=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ie={1:"\u672A\u53D1\u5E03",2:"\u5DF2\u53D1\u5E03",3:"\u5DF2\u622A\u6B62"},ut={1:_e.a.flagActive,2:_e.a.flagHalf},bt={0:"c-red-ee4",1:"c-green"},Tt=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898","\u7F16\u7A0B\u9898"],xt=function(Xe){var Pe,se,fe,$e,ke,it,at,Ne,Ve,tt,ft,Ct,zt,qt,Qt,St,ln,Bt,Yt,Mt,tn,mn,An,lt,Rt,Jt,nn,un,cn,G,b,L=Xe.globalSetting,V=Xe.loading,J=Xe.user,Q=Xe.dispatch,De=Object(p.a)(Xe,["globalSetting","loading","user","dispatch"]),ot=Object(W.i)(),Ot=Object(I.useState)({}),Ft=Object(A.a)(Ot,2),ve=Ft[0],Gt=Ft[1],en=Object(I.useState)({}),Tn=Object(A.a)(en,2),Wn=Tn[0],tr=Tn[1],Rn=Object(I.useState)({}),or=Object(A.a)(Rn,2),fr=or[0],Vn=or[1],sr=Object(I.useState)(!1),Jn=Object(A.a)(sr,2),Mr=Jn[0],Xn=Jn[1],Ir=Object(I.useState)(!0),yr=Object(A.a)(Ir,2),Tr=yr[0],Yr=yr[1],br=Object(I.useState)(!1),nr=Object(A.a)(br,2),Ur=nr[0],_r=nr[1],Fr=Object(I.useState)(!1),Sn=Object(A.a)(Fr,2),hn=Sn[0],kn=Sn[1],yn=Object(I.useState)(),Ln=Object(A.a)(yn,2),bn=Ln[0],wr=Ln[1],Bn=Object(I.useState)(0),Qn=Object(A.a)(Bn,2),zr=Qn[0],jr=Qn[1],Dr=Object(I.useState)(""),Jr=Object(A.a)(Dr,2),rr=Jr[0],Wr=Jr[1],Er=Object(I.useState)("none"),Hr=Object(A.a)(Er,2),Zr=Hr[0],ir=Hr[1],ri=Object(I.useState)(""),ii=Object(A.a)(ri,2),Xt=ii[0],on=ii[1],$t=Object(I.useState)({status:0}),dn=Object(A.a)($t,2),En=dn[0],wn=dn[1],gn=Object(I.useRef)(),xn=Object(I.useRef)(!1),Hn=Object(I.useRef)({}),fn=Object(I.useState)(0),Pr=Object(A.a)(fn,2),Ht=Pr[0],_n=Pr[1],pr=Object(I.useState)(0),lr=Object(A.a)(pr,2),Kt=lr[0],pn=lr[1],Cn=Object(I.useState)(!1),ur=Object(A.a)(Cn,2),qr=ur[0],Rr=ur[1],gi=Object(I.useState)(!1),vi=Object(A.a)(gi,2),ai=vi[0],Gi=vi[1],xa=Object(I.useState)(),Ca=Object(A.a)(xa,2),Sa=Ca[0],wi=Ca[1],Aa=Object(I.useState)(),Ta=Object(A.a)(Aa,2),oi=Ta[0],Gr=Ta[1];Object(I.useEffect)(function(){return(Object(he.c)()||Object(he.l)())&&dr(),window.addEventListener("message",yi),function(){window.removeEventListener("message",yi),window.removeEventListener("beforeunload",Da),location.pathname.indexOf("/detail")>-1&&Object(te.b)()}},[ot.categoryId,J.userInfo.login]);var yi=function(me){me.data==="backExercise"&&(ir("none"),Wr(""),dr())},wa=function(){var Ut=Object(O.a)(S.a.mark(function me(){var ct,rt,_t,mt,It,Nt,Lt,Zt,jt,rn,Mn;return S.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return In.next=2,Q({type:"exercise/getExerciseUserInfo",payload:Object(v.a)({},ot)});case 2:if(rt=In.sent,tr(Object(v.a)({},rt.data)),!((rt==null||((ct=rt.data)===null||ct===void 0)?void 0:ct.ip_limit)!=="no")){In.next=11;break}if(!((rt==null||((_t=rt.data)===null||_t===void 0)?void 0:_t.ip_limit)==="inner")){In.next=9;break}return In.next=8,Object(xe.a)({ip_limit:rt==null||((mt=rt.data)===null||mt===void 0)?void 0:mt.ip_limit});case 8:Nt=In.sent;case 9:return In.next=11,Object(je.q)({exerciseId:ot.categoryId,ip:Nt,errmsgHide:!0,ip_limit:rt==null||((It=rt.data)===null||It===void 0)?void 0:It.ip_limit}).catch(function(ui){wn(ui)});case 11:if(!((rt==null?void 0:rt.status)==0)){In.next=18;break}if(!((rt==null||((Lt=rt.data)===null||Lt===void 0)?void 0:Lt.used_screen_num)>(rt==null||((Zt=rt.data)===null||Zt===void 0)?void 0:Zt.screen_num)&&rt!==null&&rt!==void 0&&(jt=rt.data)!==null&&jt!==void 0&&jt.screen_open)){In.next=15;break}return Ri(),In.abrupt("return",!1);case 15:_r(rt==null?void 0:rt.data.check_camera),kn(rt==null||((rn=rt.data)===null||rn===void 0)?void 0:rn.screen_open),rt!=null&&(Mn=rt.data)!==null&&Mn!==void 0&&Mn.check_camera||dr();case 18:case"end":return In.stop()}},me)}));return function(){return Ut.apply(this,arguments)}}(),Da=function(me){var ct="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(me||window.event).returnValue=ct,ct},dr=function(){var Ut=Object(O.a)(S.a.mark(function me(){var ct,rt,_t,mt,It;return S.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Xn(!0),Lt.next=3,Object(ye.Y)(Object(v.a)({},ot)).catch(function(){return Xn(!1)});case 3:rt=Lt.sent,((ct=rt)===null||ct===void 0?void 0:ct.exercise)&&(rt.exercise.user_exercise_status=1),Xn(!1),rt&&(rt.exercise_types=((_t=rt)===null||_t===void 0?void 0:_t.exercise_types)||((mt=rt)===null||mt===void 0||((It=mt.exercise_scores)===null||It===void 0)?void 0:It.exercise_types),Gt(rt));case 7:case"end":return Lt.stop()}},me)}));return function(){return Ut.apply(this,arguments)}}();Object(I.useEffect)(function(){var Ut,me,ct;((Ut=ve.exercise)===null||Ut===void 0?void 0:Ut.time)===0&&Ri(),((me=ve.exercise)===null||me===void 0?void 0:me.time)&&wr(Date.now()+(ve==null||((ct=ve.exercise)===null||ct===void 0)?void 0:ct.time)*1e3*60)},[(Pe=ve.exercise)===null||Pe===void 0?void 0:Pe.time]);var si=function(){var me;(ve==null||((me=ve.exercise)===null||me===void 0)?void 0:me.exercise_status)===3?E.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",C.a.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):E.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A",C.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:function(){var ct=Object(O.a)(S.a.mark(function _t(){var mt,It;return S.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Lt.next=2,Object(ye.R)({categoryId:ot.categoryId,user_ids:[ve==null||((mt=ve.exercise_answer_user)===null||mt===void 0)?void 0:mt.user_id]});case 2:It=Lt.sent,It&&(u.b.info(It==null?void 0:It.message),ei());case 4:case"end":return Lt.stop()}},_t)}));function rt(){return ct.apply(this,arguments)}return rt}()})},ei=function(){dr()},ro=function(){var Ut=Object(O.a)(S.a.mark(function me(){var ct,rt;return S.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(ye.ab)({categoryId:ot.categoryId,commit_method:2});case 2:ct=mt.sent,(ct==null?void 0:ct.status)===0&&(E.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:C.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",C.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var It=Object(O.a)(S.a.mark(function Lt(){return S.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:ei();case 1:case"end":return jt.stop()}},Lt)}));function Nt(){return It.apply(this,arguments)}return Nt}()}),u.b.info(ct==null?void 0:ct.message)),(ct==null?void 0:ct.status)===-3&&(rt=parseInt(ct==null?void 0:ct.message),ve.exercise.time=rt,Gt(Object(v.a)({},ve)));case 5:case"end":return mt.stop()}},me)}));return function(){return Ut.apply(this,arguments)}}(),Di=function(){var Ut=Object(O.a)(S.a.mark(function me(ct){var rt;return S.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(ue.D)({id:ct.shixun_identifier});case 2:rt=mt.sent,rt!=null&&rt.game_identifier&&(Wr("/tasks/".concat(rt.game_identifier,"?type=exercises&exercisesId=").concat(ot.categoryId,"&coursesId=").concat(ot.coursesId,"&login=").concat(ot.login,"&questionId=").concat(ct.question_id)),ir("block")),(rt==null?void 0:rt.status)===-3?Object(je.o)():(rt==null?void 0:rt.status)===2?io(rt==null?void 0:rt.message,ct.question_id):(rt==null?void 0:rt.status)===3&&Vi(rt==null?void 0:rt.message);case 5:case"end":return mt.stop()}},me)}));return function(ct){return Ut.apply(this,arguments)}}(),io=function Ut(me,ct){var rt;me=(rt=me)!==null&&rt!==void 0&&rt.includes(".json")?me:"".concat(me,".json"),E.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var _t=Object(O.a)(S.a.mark(function It(){var Nt,Lt;return S.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(ye.S)({url:me});case 2:if(Nt=jt.sent,Nt){jt.next=5;break}return jt.abrupt("return");case 5:return u.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),jt.next=8,Object(ue.D)({id:Nt.shixun_identifier});case 8:if(Lt=jt.sent,!(Lt!=null&&Lt.game_identifier)){jt.next=12;break}return Di({shixun_identifier:Lt==null?void 0:Lt.game_identifier,question_id:ct}),jt.abrupt("return");case 12:(Lt==null?void 0:Lt.status)===2?Ut(Lt==null?void 0:Lt.message,ct):(Lt==null?void 0:Lt.status)===3&&Vi(Lt==null?void 0:Lt.message);case 13:case"end":return jt.stop()}},It)}));function mt(){return _t.apply(this,arguments)}return mt}()})},Vi=function(me){E.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",me,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Xi=function(me){me.redo?E.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:C.a.createElement("div",{className:"tc font16"},"\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),onOk:function(){var ct=Object(O.a)(S.a.mark(function _t(){var mt,It,Nt,Lt;return S.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(ye.S)({id:me.myshixun_identifier,url:me.url});case 2:mt=jt.sent,mt&&(It=Object(ie.cloneDeep)(ve==null?void 0:ve.exercise_question_types),Nt=It==null?void 0:It.findIndex(function(rn){return rn.question_type===5}),It[Nt].items.find(function(rn){return rn.question_id===me.question_id}).redo=!1,It[Nt].items.find(function(rn){return rn.question_id===me.question_id}).shixun_identifier=mt.shixun_identifier,ve.exercise_question_types=It,Gt(ve),Lt=Object(v.a)(Object(v.a)({},me),{},{shixun_identifier:mt.shixun_identifier}),Di(Lt));case 4:case"end":return jt.stop()}},_t)}));function rt(){return ct.apply(this,arguments)}return rt}()}):Di(me)},li=function(){var Ut=Object(O.a)(S.a.mark(function me(ct){var rt;return S.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!ct.hack_identifier){mt.next=5;break}return mt.next=3,Object(ye.X)({id:ct.hack_identifier});case 3:rt=mt.sent,(rt==null?void 0:rt.status)===0&&(Wr("/myproblems/".concat(rt.identifier,"?type=exercises&exercisesId=").concat(ot.categoryId,"&coursesId=").concat(ot.coursesId,"&login=").concat(ot.login,"&questionId=").concat(ct.question_id)),ir("block"));case 5:case"end":return mt.stop()}},me)}));return function(ct){return Ut.apply(this,arguments)}}(),mr=function(){var Ut=Object(O.a)(S.a.mark(function me(ct,rt,_t,mt){var It,Nt;return S.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(Xn(!0),ct){Zt.next=4;break}return console.error("handleSave no questionId params"),Zt.abrupt("return");case 4:return Zt.next=6,Object(ye.cb)({questionId:ct,exercise_choice_id:rt,answer_text:_t});case 6:Nt=Zt.sent,(Nt==null?void 0:Nt.status)===0&&(mt&&mt(),Vr()),Xn(!1);case 9:case"end":return Zt.stop()}},me)}));return function(ct,rt,_t,mt){return Ut.apply(this,arguments)}}(),Qi=function(){var Ut=Object(O.a)(S.a.mark(function me(ct){var rt,_t;return S.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(ye.V)({id:ot.categoryId});case 2:if(rt=It.sent,rt){It.next=5;break}return It.abrupt("return");case 5:rt.question_undo!==0||rt.oj_undo!==0?(_t="",rt.question_undo!==0&&rt.oj_undo!==0?_t="\u6709 ".concat(rt.question_undo," \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(rt.oj_undo," \u4E2A\u7F16\u7A0B\u9898"):rt.question_undo!==0&&rt.oj_undo===0?_t="\u6709 ".concat(rt.question_undo," \u9898\u672A\u5B8C\u6210"):rt.question_undo===0&&rt.oj_undo!==0&&(_t="\u6709 ".concat(rt.oj_undo," \u7F16\u7A0B\u9898\u672A\u5B8C\u6210")),E.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:C.a.createElement("div",{className:"tc font16"},_t,C.a.createElement("br",null),ct?"\u5728".concat(Fe()(rt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Nt=Object(O.a)(S.a.mark(function Zt(){return S.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:ct?ei():Ri();case 1:case"end":return rn.stop()}},Zt)}));function Lt(){return Nt.apply(this,arguments)}return Lt}()})):E.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u77E5\u9053\u5566",content:C.a.createElement("div",{className:"tc font16"},ct?"\u5728".concat(Fe()(rt.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var Nt=Object(O.a)(S.a.mark(function Zt(){return S.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:ct?ei():Ri();case 1:case"end":return rn.stop()}},Zt)}));function Lt(){return Nt.apply(this,arguments)}return Lt}()});case 6:case"end":return It.stop()}},me)}));return function(ct){return Ut.apply(this,arguments)}}(),Yi=function(me){return C.a.createElement("div",null,C.a.createElement(n.a,{strokeColor:{from:"#108ee9",to:"#87d068"},status:"active",percent:me}),C.a.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026"))},ao=function(){var me=0,ct=E.a.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:Yi(me)}),rt=setInterval(function(){me<=100?(me+=2,ct.update({content:Yi(me)})):(ct.destroy(),clearInterval(rt))},50)},Ri=function(){var Ut=Object(O.a)(S.a.mark(function me(){var ct;return S.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return ao(),_t.next=3,Object(ye.ab)({categoryId:ot.categoryId,commit_method:1});case 3:ct=_t.sent,Object(te.b)(),Q({type:"exercise/setActionTabs",payload:Object(v.a)({},{removeEventListenerExitScreen:!0})}),(ct==null?void 0:ct.status)===0&&(u.b.success(ct==null?void 0:ct.message),_r(!1),setTimeout(function(){E.a.info({title:"\u4EA4\u5377\u6210\u529F\uFF01",okText:"\u786E\u5B9A",onOk:function(){ei()}})},3e3));case 7:case"end":return _t.stop()}},me)}));return function(){return Ut.apply(this,arguments)}}(),oo=function(){var Ut=Object(O.a)(S.a.mark(function me(ct,rt,_t,mt){return S.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:mr(rt,ct,null,function(){ve.question_status.find(function(Lt){return Lt.ques_id===rt}).ques_status=ct?1:0,mt.user_answer=[],mt.user_answer.push(ct),mt.repeat_answer||(mt.israp=!0),Gt(Object(v.a)({},ve))});case 1:case"end":return Nt.stop()}},me)}));return function(ct,rt,_t,mt){return Ut.apply(this,arguments)}}(),Ra=function(){var Ut=Object(O.a)(S.a.mark(function me(ct,rt,_t,mt,It){return S.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:mr(mt.question_id,ct,null,function(){var Zt,jt,rn;mt.user_answer=[],mt.user_answer.push(ct);var Mn=It==null||((Zt=It.sub_exercise_questions)===null||Zt===void 0)?void 0:Zt.filter(function(Nn){var In;return((In=Nn.user_answer)===null||In===void 0?void 0:In.length)===0});ve.question_status.find(function(Nn){return Nn.ques_id===rt}).ques_status=(Mn==null?void 0:Mn.length)===(It==null||((jt=It.sub_exercise_questions)===null||jt===void 0)?void 0:jt.length)?0:(Mn==null?void 0:Mn.length)>0&&(Mn==null?void 0:Mn.length)<(It==null||((rn=It.sub_exercise_questions)===null||rn===void 0)?void 0:rn.length)?2:1,Gt(Object(v.a)({},ve))});case 1:case"end":return Lt.stop()}},me)}));return function(ct,rt,_t,mt,It){return Ut.apply(this,arguments)}}(),Oa=function(me,ct,rt){mr(ct,me,null,function(){rt.user_answer=me,rt.repeat_answer||(rt.israp=!0),ve.question_status.find(function(_t){return _t.ques_id===ct}).ques_status=me!=null&&me.length?1:0,Gt(Object(v.a)({},ve))})},bi=function(me,ct,rt,_t,mt){if(!me.replaceAll(" ","")){u.b.warning("\u56DE\u7B54\u4E0D\u80FD\u4E3A\u7A7A\u6216\u8005\u7EAF\u7A7A\u683C"),Vr();return}mr(rt,ct,me,function(){ve.question_status.find(function(Nt){return Nt.ques_id===rt}).ques_status=_t.every(function(Nt){return!!Nt.answer_text})?1:ve.question_status.find(function(Nt){return Nt.ques_id===rt}).ques_status=_t.some(function(Nt){return!!Nt.answer_text})?2:0;var It={choice_id:ct,answer_text:me};mt.user_answer.filter(function(Nt){return Nt.choice_id!=ct})?mt.user_answer.splice(ct-1,1,It):mt.user_answer.push(It),mt.repeat_answer||(mt.israp=!0),Gt(Object(v.a)({},ve))})},La=function(me,ct,rt){if(!me.replaceAll(" ","")){u.b.warning("\u56DE\u7B54\u4E0D\u80FD\u4E3A\u7A7A\u6216\u8005\u7EAF\u7A7A\u683C"),Vr();return}mr(ct,null,me,function(){ve.question_status.find(function(_t){return _t.ques_id===ct}).ques_status=me?1:0,rt.user_answer=[],rt.user_answer.push(me),rt.repeat_answer||(rt.israp=!0),Gt(Object(v.a)({},ve))})},Ji=function(me,ct){var rt,_t,mt,It,Nt,Lt;return C.a.createElement("div",null,C.a.createElement(m.a.Group,{disabled:!!(ve!=null&&ve.exercise.commit_status),defaultValue:me==null||((rt=me.user_answer)===null||rt===void 0)?void 0:rt[0],onChange:function(jt){return oo(jt.target.value,me==null?void 0:me.question_id,ct,me)},className:me.user_score&&"edu-radio-".concat(me.user_score===me.question_score?"green":"red")},me==null||((_t=me.question_choices)===null||_t===void 0)?void 0:_t.map(function(Zt,jt){var rn,Mn=me.question_type==2,Nn=Mn?"":"".concat(Be[jt],".");return C.a.createElement("div",{className:_e.a.answerWrap,key:jt},C.a.createElement(m.a,{disabled:!me.repeat_answer&&(me==null||((rn=me.user_answer)===null||rn===void 0)?void 0:rn.length)>0&&!me.israp,value:Zt==null?void 0:Zt.choice_id},C.a.createElement("span",{className:"mr3"},Nn),C.a.createElement(Le.a,{className:_e.a.renderHtml,value:Zt==null?void 0:Zt.choice_text})))})),Object(he.s)()&&(ve==null||((mt=ve.exercise)===null||mt===void 0)?void 0:mt.answer_open)&&((ve==null||((It=ve.exercise)===null||It===void 0)?void 0:It.exercise_status)==3||(ve==null||((Nt=ve.exercise)===null||Nt===void 0)?void 0:Nt.user_exercise_status)==1)&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",me==null||((Lt=me.standard_answer)===null||Lt===void 0)?void 0:Lt.map(function(Zt,jt){return C.a.createElement("span",null,Be[Number(Zt)-1])})))},Zi=function(me,ct,rt){var _t;return C.a.createElement("div",null,me==null||((_t=me.sub_exercise_questions)===null||_t===void 0)?void 0:_t.map(function(mt,It){var Nt,Lt,Zt,jt,rn,Mn;return C.a.createElement("div",null,C.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},C.a.createElement("span",{style:{flexShrink:0},className:"font18"},rt+1+"."+(It+1),"\uFF08\u5355\u9009\u9898\uFF09"),C.a.createElement(Le.a,{value:mt==null?void 0:mt.question_title}),C.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",mt==null?void 0:mt.question_score,"\u5206\uFF09")),C.a.createElement(m.a.Group,{disabled:!!(ve!=null&&ve.exercise.commit_status),defaultValue:mt==null||((Nt=mt.user_answer)===null||Nt===void 0)?void 0:Nt[0],onChange:function(In){return Ra(In.target.value,me==null?void 0:me.question_id,It,mt,me)},className:mt.user_score&&"edu-radio-".concat(mt.user_score===mt.question_score?"green":"red")},mt==null||((Lt=mt.question_choices)===null||Lt===void 0)?void 0:Lt.map(function(Nn,In){var ui,Ua=mt.question_type==2,Li=Ua?"":"".concat(Be[In],".");return C.a.createElement("div",{className:_e.a.answerWrap,key:In},C.a.createElement(m.a,{disabled:!mt.repeat_answer&&(mt==null||((ui=mt.user_answer)===null||ui===void 0)?void 0:ui.length)>0,value:Nn==null?void 0:Nn.choice_id},C.a.createElement("span",{className:"mr3"},Li),C.a.createElement(Le.a,{className:_e.a.renderHtml,value:Nn==null?void 0:Nn.choice_text})))})),Object(he.s)()&&(ve==null||((Zt=ve.exercise)===null||Zt===void 0)?void 0:Zt.answer_open)&&((ve==null||((jt=ve.exercise)===null||jt===void 0)?void 0:jt.exercise_status)==3||(ve==null||((rn=ve.exercise)===null||rn===void 0)?void 0:rn.user_exercise_status)==1)&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",mt==null||((Mn=mt.standard_answer)===null||Mn===void 0)?void 0:Mn.map(function(Nn,In){return C.a.createElement("span",null,Be[Number(Nn)-1])})))}))},Oi=function(me,ct){var rt,_t,mt,It;return C.a.createElement("div",null,C.a.createElement(y.a.Group,{disabled:!!(ve!=null&&ve.exercise.commit_status),defaultValue:me==null?void 0:me.user_answer,onChange:function(Lt){return Oa(Lt,me==null?void 0:me.question_id,me)},className:me.user_score&&"edu-checkbox-".concat(me.user_score===me.question_score?"green":"red")},me==null||((rt=me.question_choices)===null||rt===void 0)?void 0:rt.map(function(Nt,Lt){var Zt,jt="".concat(Be[Lt],".");return C.a.createElement("div",{className:_e.a.answerWrap},C.a.createElement(y.a,{disabled:!me.repeat_answer&&(me==null||((Zt=me.user_answer)===null||Zt===void 0)?void 0:Zt.length)>0&&!me.israp,value:Nt==null?void 0:Nt.choice_id},C.a.createElement("span",{className:"mr3"},jt),C.a.createElement(Le.a,{className:_e.a.renderHtml,value:Nt==null?void 0:Nt.choice_text})))})),Object(he.s)()&&(ve==null||((_t=ve.exercise)===null||_t===void 0)?void 0:_t.answer_open)&&(ve==null||((mt=ve.exercise)===null||mt===void 0)?void 0:mt.exercise_status)==3&&C.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",me==null||((It=me.standard_answer)===null||It===void 0)?void 0:It.map(function(Nt,Lt){return C.a.createElement("span",null,Be[Number(Nt)-1])})))},Ma=function(me,ct){return C.a.createElement(nt,{item:me,sign:xn,answerData:ve,answerCheckData:Wn,onBlur:function(_t,mt,It){return bi(_t,mt,me==null?void 0:me.question_id,It,me)}})},qi=function(me,ct){return C.a.createElement(Se,{item:me,answerData:ve,sign:xn,onBlur:function(_t){return La(_t,me==null?void 0:me.question_id,me)}})},kr=function(me,ct){return C.a.createElement(pt,{item:me,answerData:ve})},Ia=function(me,ct){return C.a.createElement(Oe,{item:me,answerData:ve})},Kr=function(me,ct,rt){var _t,mt,It=ve==null||((_t=ve.exercise_question_types)===null||_t===void 0)?void 0:_t.find(function(Nt){return Nt.question_type===ct});return C.a.createElement(C.a.Fragment,null,C.a.createElement("h1",{className:"font14 current",onClick:function(){fr[ct]=!fr[ct],Vn(Object(v.a)({},fr))}},!fr[ct]&&C.a.createElement(F.a,null),fr[ct]&&C.a.createElement(q.a,null),C.a.createElement("span",{className:"ml5 c-grey-666"},me)),C.a.createElement("ul",{className:_e.a.answerSheet,key:ct},!fr[ct]&&(It==null||((mt=It.items)===null||mt===void 0)?void 0:mt.map(function(Nt,Lt){if(Nt.question_type===ct){var Zt,jt;return C.a.createElement("li",{onClick:function(){if(xn.current){xn.current="appoint",Hn.current={oneindex:rt,twoindex:Lt};return}Ba({oneindex:rt,twoindex:Lt})},key:Lt,className:(ve==null||((Zt=ve.question_status)===null||Zt===void 0)?void 0:Zt.some(function(rn){return rn.ques_id===Nt.question_id&&(rn==null?void 0:rn.ques_status)===1}))&&_e.a.active},Lt+1,(ve==null||((jt=ve.question_status)===null||jt===void 0)?void 0:jt.some(function(rn){return rn.ques_id===Nt.question_id&&(rn==null?void 0:rn.ques_status)===2}))&&C.a.createElement("div",{style:{height:3,background:"#0152d9",position:"absolute",width:26,bottom:0}}))}}))))},$i=function(me,ct){var rt,_t,mt,It,Nt,Lt,Zt=(me==null?void 0:me.question_type)==5?me==null?void 0:me.shixun_name:me==null?void 0:me.question_title;return C.a.createElement("div",{className:_e.a.questionItem,id:"Anchor_".concat(me==null?void 0:me.question_type,"_").concat(ct)},C.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},C.a.createElement("span",{style:{flexShrink:0},className:"font18"},ct+1,"."),C.a.createElement(Le.a,{value:me==null?void 0:me.question_title}),C.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",(me==null?void 0:me.question_type)===7?"\u5171".concat(me==null||((rt=me.sub_exercise_questions)===null||rt===void 0)?void 0:rt.length,"\u5C0F\u9898\uFF0C"):"",me==null?void 0:me.question_score,"\u5206\uFF09"),!(me!=null&&me.repeat_answer)&&C.a.createElement("span",{style:{color:"#FA6400 ",marginLeft:10,fontSize:16}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"),!!(me!=null&&(_t=me.schools)!==null&&_t!==void 0&&_t.length)&&C.a.createElement(g.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},C.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(me==null?void 0:me.question_type)==0&&Ji(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==2&&Ji(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==1&&Oi(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==3&&Ma(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==4&&qi(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==5&&kr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==6&&Ia(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==7&&Zi(me,me==null?void 0:me.question_type,ct),!!(me!=null&&(mt=me.answer_comments)!==null&&mt!==void 0&&mt.length)&&C.a.createElement("div",{className:"mt30"},me==null||((It=me.answer_comments)===null||It===void 0)?void 0:It.map(function(jt,rn){var Mn,Nn;return C.a.createElement("div",null,C.a.createElement(U.a,{align:"middle",gutter:[0,10]},C.a.createElement(R.a,{flex:"50px"},C.a.createElement("img",{src:Je.a.API_SERVER+"/images/"+((Mn=jt.user)===null||Mn===void 0?void 0:Mn.image_url),width:"40",style:{borderRadius:40}})),C.a.createElement(R.a,{flex:"1"},jt.updated_at,C.a.createElement("br",null),(Nn=jt.user)===null||Nn===void 0?void 0:Nn.name),C.a.createElement(R.a,{className:"c-grey-c"},jt.shixun_chanllge_position&&C.a.createElement("span",null,"\u7B2C",jt.shixun_chanllge_position,"\u5173"),me.question_type!==4&&C.a.createElement("span",null,"\u539F\u59CB\u5F97\u5206",jt.origin_score,"\u5206 \uFF0C")," \u4FEE\u6B63\u4E3A",jt.score,"\u5206")),jt.comment&&C.a.createElement(U.a,{align:"middle",gutter:[0,10]},C.a.createElement(R.a,{flex:"50px"}),C.a.createElement(R.a,{flex:"1"},C.a.createElement(Ee,{autoSize:!0,value:jt.comment,disabled:!0}))))})),C.a.createElement("div",{className:_e.a.itemType},C.a.createElement(U.a,null,C.a.createElement(R.a,{flex:"1"}),C.a.createElement(R.a,null,(me==null?void 0:me.question_type)<3&&(me==null?void 0:me.standard_answer_show)&&C.a.createElement("span",{className:"font16 ml20"},"\u6B63\u786E\u7B54\u6848\uFF1A",me==null?void 0:me.standard_answer_show),C.a.createElement("span",{className:"font16 ml20"},(me==null?void 0:me.user_score)!==null&&(me==null?void 0:me.user_score)>=0&&C.a.createElement("span",null,C.a.createElement("span",{className:bt[Number(me==null?void 0:me.answer_status)]||"c-orange-ff9"},me==null?void 0:me.user_score)," \u5206")),(me==null?void 0:me.question_type)==5&&!((Nt=ve.exercise)!==null&&Nt!==void 0&&Nt.commit_status)&&C.a.createElement(M.a,{type:"primary",className:"font16 ml20",onClick:function(){return Xi(me)}},"\u8FDB\u5165\u7B54\u9898"),(me==null?void 0:me.question_type)==6&&!((Lt=ve.exercise)!==null&&Lt!==void 0&&Lt.commit_status)&&C.a.createElement(M.a,{type:"primary",className:"font16 ml20",onClick:function(){return li(me)}},"\u8FDB\u5165\u7B54\u9898")))))},_a=function(me,ct){return C.a.createElement(I.Fragment,null,me.question_type===0&&Kr("\u5355\u9009\u9898",0,ct),me.question_type===1&&Kr("\u591A\u9009\u9898",1,ct),me.question_type===2&&Kr("\u5224\u65AD\u9898",2,ct),me.question_type===3&&Kr("\u586B\u7A7A\u9898",3,ct),me.question_type===4&&Kr("\u7B80\u7B54\u9898",4,ct),me.question_type===5&&Kr("\u5B9E\u8BAD\u9898",5,ct),me.question_type===6&&Kr("\u7F16\u7A0B\u9898",6,ct),me.question_type===7&&Kr("\u7EC4\u5408\u9898",7,ct))},Pa=function(me){var ct=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],rt=["","\u5341","\u767E","\u5343","\u4E07"];me=parseInt(me);var _t=function(Lt){for(var Zt=Lt.toString().split("").reverse(),jt="",rn=0;rn<Zt.length;rn++)jt=(rn==0&&Zt[rn]==0||rn>0&&Zt[rn]==0&&Zt[rn-1]==0?"":ct[Zt[rn]]+(Zt[rn]==0?rt[0]:rt[rn]))+jt;return jt},mt=Math.floor(me/1e4),It=me%1e4;return It.toString().length<4&&(It="0"+It),mt?_t(mt)+"\u4E07"+_t(It):_t(me)},ea=function(){var me,ct,rt,_t,mt,It,Nt,Lt,Zt,jt,rn,Mn,Nn;return C.a.createElement(I.Fragment,{key:Ht},C.a.createElement("div",{className:"pt20"},C.a.createElement("span",{className:"font16 c-light-primary"},Pa(Ht+1),"\u3001",ve==null||((me=ve.exercise_question_types)===null||me===void 0||((ct=me[Ht])===null||ct===void 0))?void 0:ct.name),C.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",ve==null||((rt=ve.exercise_question_types)===null||rt===void 0||((_t=rt[Ht])===null||_t===void 0))?void 0:_t.count,"\u9898\uFF1B",(ve==null||((mt=ve.exercise_question_types)===null||mt===void 0||((It=mt[Ht])===null||It===void 0))?void 0:It.question_type)===7?"\u5305\u542B".concat(ve==null||((Nt=ve.exercise_question_types)===null||Nt===void 0||((Lt=Nt[Ht])===null||Lt===void 0))?void 0:Lt.sub_questions_count,"\u5C0F\u9898"):""," \u5171",ve==null||((Zt=ve.exercise_question_types)===null||Zt===void 0||((jt=Zt[Ht])===null||jt===void 0))?void 0:jt.score,"\u5206\uFF09")),C.a.createElement(I.Fragment,{key:Kt},$i(ve==null||((rn=ve.exercise_question_types)===null||rn===void 0||((Mn=rn[Ht])===null||Mn===void 0||((Nn=Mn.items)===null||Nn===void 0)))?void 0:Nn[Kt],Kt)))},ka=function(){var me;if(!ai&&(ve==null||((me=ve.exercise)===null||me===void 0)?void 0:me.user_exercise_status)===0&&Object(he.s)()){var ct,rt,_t,mt;if(!((ct=ve.exercise_question_types)!==null&&ct!==void 0&&(rt=ct[Ht])!==null&&rt!==void 0&&(_t=rt.items)!==null&&_t!==void 0&&(mt=_t[Kt])!==null&&mt!==void 0&&mt.repeat_answer)){Rr(!0),wi(1);return}}ve.exercise_question_types[Ht].items[Kt].israp=!1,Gt(Object(v.a)({},ve)),Kt===0?(Ht-=1,Kt=ve.exercise_question_types[Ht].items.length-1):Kt-=1,_n(Ht),pn(Kt)},Na=function(){var me;if(!ai&&(ve==null||((me=ve.exercise)===null||me===void 0)?void 0:me.user_exercise_status)===0&&Object(he.s)()){var ct,rt,_t,mt;if(!((ct=ve.exercise_question_types)!==null&&ct!==void 0&&(rt=ct[Ht])!==null&&rt!==void 0&&(_t=rt.items)!==null&&_t!==void 0&&(mt=_t[Kt])!==null&&mt!==void 0&&mt.repeat_answer)){Rr(!0),wi(2);return}}ve.exercise_question_types[Ht].items[Kt].israp=!1,Gt(Object(v.a)({},ve)),ve.exercise_question_types[Ht].items.length-1===Kt?(Ht=Ht+1,Kt=0):Kt=Kt+1,_n(Ht),pn(Kt)},Ba=function(me){var ct,rt=me||Hn.current;if(!ai&&(ve==null||((ct=ve.exercise)===null||ct===void 0)?void 0:ct.user_exercise_status)===0&&Object(he.s)()){var _t,mt,It,Nt;if(!((_t=ve.exercise_question_types)!==null&&_t!==void 0&&(mt=_t[Ht])!==null&&mt!==void 0&&(It=mt.items)!==null&&It!==void 0&&(Nt=It[Kt])!==null&&Nt!==void 0&&Nt.repeat_answer)){Rr(!0),wi(3),Gr(rt);return}}_n(rt==null?void 0:rt.oneindex),pn(rt==null?void 0:rt.twoindex)},Vr=function(){var me;switch(xn.current){case"prev":ka();break;case"next":Na();break;case"appoint":Ba();break;case"submit":Qi(!1);break;default:}((me=document.activeElement)===null||me===void 0?void 0:me.localName)==="textarea"?xn.current=!0:xn.current=!1,Hn.current={}};return C.a.createElement(K.a,{size:"large",spinning:Mr},hn&&C.a.createElement(Ae.a,{iframe:gn}),C.a.createElement("iframe",{style:{display:Zr},id:"iframeShixuns",className:_e.a.iframe,src:rr,ref:gn,frameBorder:"0"}),C.a.createElement("section",{className:"edu-container"},C.a.createElement("section",{className:"animated fadeIn"},C.a.createElement("aside",{className:"mt10"},L.showHeaderFooter&&ot.coursesId!=="coursesId"&&C.a.createElement(z.a,{separator:">"},C.a.createElement(z.a.Item,null,C.a.createElement(Y.a,{to:"/classrooms/".concat(ot.coursesId,"/exercise")},(se=J.userInfo)===null||se===void 0||((fe=se.course)===null||fe===void 0)?void 0:fe.course_name)),C.a.createElement(z.a.Item,null,C.a.createElement(Y.a,{to:"/classrooms/".concat(ot.coursesId,"/exercise")},"\u8BD5\u5377")),C.a.createElement(z.a.Item,null,C.a.createElement(Y.a,{to:"/classrooms/".concat(ot.coursesId,"/exercise/").concat(ot.categoryId,"/detail")},"\u8BD5\u5377\u8BE6\u60C5")),C.a.createElement(z.a.Item,null,($e=J.userInfo)===null||$e===void 0?void 0:$e.real_name)),L.showHeaderFooter&&ot.coursesId==="coursesId"&&C.a.createElement(z.a,{separator:">"},C.a.createElement(z.a.Item,null,C.a.createElement(Y.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),C.a.createElement(z.a.Item,null,(ke=J.userInfo)===null||ke===void 0?void 0:ke.real_name))),C.a.createElement("aside",{className:[_e.a.title,"mt10"].join(" ")},C.a.createElement(U.a,{style:{width:"100%"},align:"middle"},C.a.createElement(R.a,{flex:"1"},C.a.createElement("div",{className:_e.a.title},(L==null?void 0:L.showHeaderFooter)&&C.a.createElement(Y.a,{to:ot.coursesId==="coursesId"?"/paperlibrary":"/classrooms/".concat(ot.coursesId,"/exercise/").concat(ot.categoryId,"/detail")},C.a.createElement(le.a,{className:"font16 c-black"})),C.a.createElement("strong",{className:"font24 ml5"},ve==null||((it=ve.exercise)===null||it===void 0)?void 0:it.exercise_name),(ve==null||((at=ve.exercise)===null||at===void 0)?void 0:at.is_random)&&C.a.createElement("span",{className:_e.a.randomFlag},"\u968F\u673A"),C.a.createElement(je.k,{status:[je.c[99]]}))),C.a.createElement(R.a,{style:{display:"flex"}},(ve==null||((Ne=ve.user_score)===null||Ne===void 0)?void 0:Ne.length)&&C.a.createElement("div",null,"\u6A21\u62DF\u8003\u8BD5\u603B\u5F97\u5206\uFF1A",C.a.createElement("span",{className:"c-red"},ve==null?void 0:ve.user_score)," \u5206"),!!(ve!=null&&(Ve=ve.exercise)!==null&&Ve!==void 0&&Ve.time)&&!(ve!=null&&(tt=ve.exercise)!==null&&tt!==void 0&&tt.commit_status)&&C.a.createElement("aside",{className:"".concat(_e.a.countDown," ").concat(Xt)},"\u5269\u4F59\u65F6\u95F4:",C.a.createElement(ce,{value:bn,onFinish:ro})),!(ve!=null&&(ft=ve.exercise)!==null&&ft!==void 0&&ft.commit_status)&&C.a.createElement(M.a,{className:_e.a.submitButton,style:{marginLeft:20},type:"primary",onClick:function(){if(xn.current){xn.current="submit";return}Qi(!1)}},"\u4EA4\u5377"))))),En.status===0&&C.a.createElement(U.a,{className:"mt10"},C.a.createElement(R.a,{flex:Tr?"316px":"16px"},C.a.createElement("section",{style:{position:"sticky",top:0,zIndex:1}},Ur&&C.a.createElement(pe.a,{number:(ve==null||((Ct=ve.exercise)===null||Ct===void 0)?void 0:Ct.photo_count)-(ve==null||((zt=ve.exercise)===null||zt===void 0)?void 0:zt.take_photo),time:(qt=ve.exercise)===null||qt===void 0?void 0:qt.left_time,update:dr,supportCamera:function(me){me===2?(dr(),kn(Wn==null?void 0:Wn.screen_open)):me===1&&setTimeout(function(){return De.history.push("/")},3e3)}}),C.a.createElement("div",{className:"relative",style:{minHeight:236}},Tr&&C.a.createElement("aside",{className:"bg-white p16"},C.a.createElement(U.a,null,C.a.createElement(R.a,{span:8},C.a.createElement("span",{className:"font16 blod"},"\u7B54\u9898\u5361")),C.a.createElement(R.a,{span:16},C.a.createElement("div",{className:"tr",style:{display:"flex",alignItems:"center",justifyContent:"end"}},C.a.createElement("span",{className:_e.a.answerYes}),"\u5DF2\u7B54",C.a.createElement("span",{style:{width:13,height:13,display:"flex",flexDirection:"column-reverse"},className:"".concat(_e.a.answerNo," ml10")},C.a.createElement("div",{style:{height:"10%",background:"#0152d9"}})),"\u90E8\u5206\u7B54\u9898",C.a.createElement("span",{className:"".concat(_e.a.answerNo," ml10")}),"\u672A\u7B54"))),C.a.createElement("aside",{className:_e.a.answerInfo},C.a.createElement(U.a,null,C.a.createElement(C.a.Fragment,null,C.a.createElement(R.a,{span:12},"\u7B54\u9898\u8FDB\u5EA6"),C.a.createElement(R.a,{span:12,className:"tr c-blue"},ve==null||((Qt=ve.question_status)===null||Qt===void 0||((St=Qt.filter(function(Ut){return(Ut==null?void 0:Ut.ques_status)===1}))===null||St===void 0))?void 0:St.length," / ",ve==null||((ln=ve.exercise_types)===null||ln===void 0)?void 0:ln.q_counts),C.a.createElement(R.a,{span:24},C.a.createElement(n.a,{trailColor:"#c3ced2",percent:(ve==null||((Bt=ve.question_status)===null||Bt===void 0||((Yt=Bt.filter(function(Ut){return(Ut==null?void 0:Ut.ques_status)===1}))===null||Yt===void 0))?void 0:Yt.length)/(ve==null||((Mt=ve.exercise_types)===null||Mt===void 0)?void 0:Mt.q_counts)*100,showInfo:!1}))),C.a.createElement(R.a,null,C.a.createElement("span",{className:"c-grey-333"},"\u5171 ",C.a.createElement("span",{className:"c-blue-4ca"},(ve==null||((tn=ve.exercise_types)===null||tn===void 0)?void 0:tn.q_counts)||(ve==null||((mn=ve.exercise_scores)===null||mn===void 0||((An=mn.exercise_types)===null||An===void 0))?void 0:An.q_counts))," \u9898\uFF1A"),C.a.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206 ",C.a.createElement("span",{className:"c-blue-4ca"},(ve==null||((lt=ve.exercise_types)===null||lt===void 0)?void 0:lt.q_scores)||(ve==null||((Rt=ve.exercise_scores)===null||Rt===void 0||((Jt=Rt.exercise_types)===null||Jt===void 0))?void 0:Jt.q_scores))," \u5206")))),C.a.createElement(U.a,null,C.a.createElement(R.a,{flex:"1"},C.a.createElement("aside",{className:_e.a.cardList},ve==null||((nn=ve.exercise_question_types)===null||nn===void 0)?void 0:nn.map(function(Ut,me){return C.a.createElement(I.Fragment,{key:Ut.question_type},_a(Ut,me))}))))),C.a.createElement("div",{className:_e.a.fold,onClick:function(){return Yr(!Tr)}},Tr&&C.a.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"}),!Tr&&C.a.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"}))))),C.a.createElement(R.a,{flex:"1"},C.a.createElement("section",{className:[_e.a.bg,"pl30","pr30","pb30","mb50","ml20"].join(" ")},C.a.createElement("div",{style:{maxHeight:600,overflow:"hidden auto"}},ea()),C.a.createElement("div",{style:{marginTop:60,textAlign:"center",paddingRight:30}},(Ht!=0||Kt!=0)&&C.a.createElement(M.a,{className:"".concat(_e.a.submitButton," mr10"),type:"default",onClick:function(){if(xn.current){xn.current="prev";return}ka()}},"\u4E0A\u4E00\u9898"),!(Ht===(ve==null||((un=ve.exercise_question_types)===null||un===void 0)?void 0:un.length)-1&&Kt===(ve==null||((cn=ve.exercise_question_types)===null||cn===void 0||((G=cn[Ht])===null||G===void 0||((b=G.items)===null||b===void 0)))?void 0:b.length)-1)&&C.a.createElement(M.a,{className:_e.a.submitButton,type:"primary",onClick:function(){if(xn.current){xn.current="next";return}Na()}},"\u4E0B\u4E00\u9898")))),C.a.createElement(E.a,{title:"\u6CE8\u610F",visible:qr,onCancel:function(){return Rr(!1)},footer:!1},C.a.createElement("div",null,C.a.createElement("p",{style:{marginBottom:0}},"\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"),C.a.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between"}},C.a.createElement(y.a,{checked:ai,onChange:function(me){Gi(me.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),C.a.createElement("div",null,C.a.createElement(M.a,{onClick:function(){ve.exercise_question_types[Ht].items[Kt].israp?(ve.exercise_question_types[Ht].items[Kt].israp=!0,Gt(Object(v.a)({},ve))):ve.exercise_question_types[Ht].items[Kt].israp===""&&(ve.exercise_question_types[Ht].items[Kt].israp=!0,Gt(Object(v.a)({},ve)))}},"\u6211\u518D\u60F3\u60F3"),C.a.createElement(M.a,{onClick:function(){ve.exercise_question_types[Ht].items[Kt].israp=!1,Gt(Object(v.a)({},ve)),Sa===1?(Kt===0?(Ht-=1,Kt=ve.exercise_question_types[Ht].items.length-1):Kt-=1,console.log(ve.exercise_question_types[Ht].items[Kt],"-----"),_n(Ht),pn(Kt)):Sa===2?(ve.exercise_question_types[Ht].items.length-1===Kt?(Ht=Ht+1,Kt=0):Kt=Kt+1,_n(Ht),pn(Kt)):(_n(oi.oneindex),pn(oi.twoindex)),Rr(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4")))))),En.status!==0&&C.a.createElement(re,{data:En})))},gt=de.default=Object(H.a)(function(qe){var Xe=qe.loading,Pe=qe.user,se=qe.globalSetting;return{globalSetting:se,user:Pe,loading:Xe.effects}})(xt)},cRFk:function(et,de,N){et.exports=N.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(et,de,N){et.exports=N.p+"static/choose.4ad1045f.svg"},dejd:function(et,de,N){},djh8:function(et,de,N){et.exports=N.p+"static/qrCode.42927872.png"},dmUQ:function(et,de,N){"use strict";var ee=N("Ff2n"),K=N("rePB"),P=N("1OyB"),z=N("vuIU"),B=N("Ji7U"),M=N("md7G"),j=N("foSv"),U=N("q1tI"),_=N.n(U),R=N("TSYQ"),c=N.n(R),g=N("4IlW");function w(s,l){var D=Object.keys(s);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(s);l&&(T=T.filter(function(S){return Object.getOwnPropertyDescriptor(s,S).enumerable})),D.push.apply(D,T)}return D}function y(s){for(var l=1;l<arguments.length;l++){var D=arguments[l]!=null?arguments[l]:{};l%2?w(Object(D),!0).forEach(function(T){Object(K.a)(s,T,D[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(D)):w(Object(D)).forEach(function(T){Object.defineProperty(s,T,Object.getOwnPropertyDescriptor(D,T))})}return s}function f(s){var l=m();return function(){var T=Object(j.a)(s),S;if(l){var I=Object(j.a)(this).constructor;S=Reflect.construct(T,arguments,I)}else S=T.apply(this,arguments);return Object(M.a)(this,S)}}function m(){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(s){return!1}}function a(){}function n(s){s.preventDefault()}var o=function(l){return l.replace(/[^\w.-]+/g,"")},u=200,x=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,v=function(l){return l!=null},O=function(l,D){return D===l||typeof D=="number"&&typeof l=="number"&&isNaN(D)&&isNaN(l)},A=function(s){Object(B.a)(D,s);var l=f(D);function D(T){var S;Object(P.a)(this,D),S=l.call(this,T),S.onKeyDown=function(W){var Y=S.props,H=Y.onKeyDown,F=Y.onPressEnter;if(W.keyCode===g.a.UP){var q=S.getRatio(W);S.up(W,q,null),S.stop()}else if(W.keyCode===g.a.DOWN){var le=S.getRatio(W);S.down(W,le,null),S.stop()}else W.keyCode===g.a.ENTER&&F&&F(W);if(S.recordCursorPosition(),S.lastKeyCode=W.keyCode,H){for(var pe=arguments.length,Ae=new Array(pe>1?pe-1:0),Ge=1;Ge<pe;Ge++)Ae[Ge-1]=arguments[Ge];H.apply(void 0,[W].concat(Ae))}},S.onKeyUp=function(W){var Y=S.props.onKeyUp;if(S.stop(),S.recordCursorPosition(),Y){for(var H=arguments.length,F=new Array(H>1?H-1:0),q=1;q<H;q++)F[q-1]=arguments[q];Y.apply(void 0,[W].concat(F))}},S.onChange=function(W){var Y=S.props.onChange;S.state.focused&&(S.inputting=!0),S.rawInput=S.props.parser(S.getValueFromEvent(W)),S.setState({inputValue:S.rawInput}),Y(S.toNumber(S.rawInput))},S.onMouseUp=function(){var W=S.props.onMouseUp;S.recordCursorPosition(),W&&W.apply(void 0,arguments)},S.onFocus=function(){var W;S.setState({focused:!0}),(W=S.props).onFocus.apply(W,arguments)},S.onBlur=function(){var W=S.props.onBlur;S.inputting=!1,S.setState({focused:!1});var Y=S.getCurrentValidValue(S.state.inputValue),H=S.setValue(Y,a);if(W){var F=S.input.value,q=S.getInputDisplayValue({focus:!1,value:H});S.input.value=q&&Number(q),W.apply(void 0,arguments),S.input.value=F}},S.getRatio=function(W){var Y=1;return W.metaKey||W.ctrlKey?Y=.1:W.shiftKey&&(Y=10),Y},S.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},S.getPrecision=function(W){if(v(S.props.precision))return S.props.precision;var Y=String(W);if(Y.indexOf("e-")>=0)return parseInt(Y.slice(Y.indexOf("e-")+2),10);var H=0;return Y.indexOf(".")>=0&&(H=Y.length-Y.indexOf(".")-1),H},S.getInputDisplayValue=function(W){var Y=W||S.state,H=Y.focused,F=Y.inputValue,q=Y.value,le;H?le=F:le=S.toPrecisionAsStep(q),le==null&&(le="");var pe=S.formatWrapper(le);return v(S.props.decimalSeparator)&&(pe=pe.toString().replace(".",S.props.decimalSeparator)),pe},S.recordCursorPosition=function(){try{S.cursorStart=S.input.selectionStart,S.cursorEnd=S.input.selectionEnd,S.currentValue=S.input.value,S.cursorBefore=S.input.value.substring(0,S.cursorStart),S.cursorAfter=S.input.value.substring(S.cursorEnd)}catch(W){}},S.restoreByAfter=function(W){if(W===void 0)return!1;var Y=S.input.value,H=Y.lastIndexOf(W);if(H===-1)return!1;var F=S.cursorBefore.length;return S.lastKeyCode===g.a.DELETE&&S.cursorBefore.charAt(F-1)===W[0]?(S.fixCaret(F,F),!0):H+W.length===Y.length?(S.fixCaret(H,H),!0):!1},S.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(Y,H){var F=W.substring(H);return S.restoreByAfter(F)})},S.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},S.stop=function(){S.autoStepTimer&&clearTimeout(S.autoStepTimer)},S.down=function(W,Y,H){S.pressingUpOrDown=!0,S.step("down",W,Y,H)},S.up=function(W,Y,H){S.pressingUpOrDown=!0,S.step("up",W,Y,H)},S.saveInput=function(W){S.input=W};var I=T.value;I===void 0&&(I=T.defaultValue),S.state={focused:T.autoFocus};var C=S.getValidValue(S.toNumber(I));return S.state=y(y({},S.state),{},{inputValue:S.toPrecisionAsStep(C),value:C}),S}return Object(z.a)(D,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(S){var I=this.props,C=I.value,W=I.onChange,Y=I.max,H=I.min,F=this.state.focused;if(S){if(!O(S.value,C)||!O(S.max,Y)||!O(S.min,H)){var q=F?C:this.getValidValue(C),le;this.pressingUpOrDown?le=q:this.inputting?le=this.rawInput:le=this.toPrecisionAsStep(q),this.setState({value:q,inputValue:le})}var pe="value"in this.props?C:this.state.value;"max"in this.props&&S.max!==Y&&typeof pe=="number"&&pe>Y&&W&&W(Y),"min"in this.props&&S.min!==H&&typeof pe=="number"&&pe<H&&W&&W(H)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ae=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?Ae=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(Ae=this.cursorStart):Ae=this.input.value.length,this.fixCaret(Ae,Ae)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ge){}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(S){var I=S;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(S){var I=S.target.value.trim().replace(/。/g,".");return v(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(S);return isNaN(W)?S:(W<I&&(W=I),W>C&&(W=C),W)}},{key:"setValue",value:function(S,I){var C=this.props.precision,W=this.isNotCompleteNumber(parseFloat(S))?null:parseFloat(S),Y=this.state.value,H=Y===void 0?null:Y,F=this.state.inputValue,q=F===void 0?null:F,le=typeof W=="number"?W.toFixed(C):"".concat(W),pe=W!==H||le!=="".concat(q);return"value"in this.props?(q=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:q},I)):this.setState({value:W,inputValue:this.toPrecisionAsStep(S)},I),pe&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,C=this.props,W=C.precision,Y=C.step;if(v(W))return W;var H=this.getPrecision(I),F=this.getPrecision(Y),q=this.getPrecision(S);return S?Math.max(q,H+F):H+F}},{key:"getPrecisionFactor",value:function(S){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,C=this.getMaxPrecision(S,I);return Math.pow(10,C)}},{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(S){return this.props.formatter?this.props.formatter(S):S}},{key:"toPrecisionAsStep",value:function(S){if(this.isNotCompleteNumber(S)||S==="")return S;var I=Math.abs(this.getMaxPrecision(S));return isNaN(I)?S.toString():Number(S).toFixed(I)}},{key:"toNumber",value:function(S){var I=this.props.precision,C=this.state.focused,W=S&&S.length>16&&C;return this.isNotCompleteNumber(S)||W?S:v(I)?Math.round(S*Math.pow(10,I))/Math.pow(10,I):Number(S)}},{key:"upStep",value:function(S,I){var C=this.props.step,W=this.getPrecisionFactor(S,I),Y=Math.abs(this.getMaxPrecision(S,I)),H=((W*S+W*C*I)/W).toFixed(Y);return this.toNumber(H)}},{key:"downStep",value:function(S,I){var C=this.props.step,W=this.getPrecisionFactor(S,I),Y=Math.abs(this.getMaxPrecision(S,I)),H=((W*S-W*C*I)/W).toFixed(Y);return this.toNumber(H)}},{key:"step",value:function(S,I){var C=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Y=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var H=this.props;if(H.disabled)return;var F=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(F))return;var q=this["".concat(S,"Step")](F,W),le=q>H.max||q<H.min;if(q>H.max?q=H.max:q<H.min&&(q=H.min),this.setValue(q,null),this.setState({focused:!0},function(){C.pressingUpOrDown=!1}),le)return;this.autoStepTimer=setTimeout(function(){C[S](I,W,!0)},Y?u:x)}},{key:"fixCaret",value:function(S,I){if(S===void 0||I===void 0||!this.input||!this.input.value)return;try{var C=this.input.selectionStart,W=this.input.selectionEnd;(S!==C||I!==W)&&this.input.setSelectionRange(S,I)}catch(Y){}}},{key:"render",value:function(){var S,I=this.props,C=I.prefixCls,W=I.disabled,Y=I.readOnly,H=I.useTouch,F=I.autoComplete,q=I.upHandler,le=I.downHandler,pe=I.className,Ae=I.max,Ge=I.min,Fe=I.style,Ue=I.title,_e=I.onMouseEnter,je=I.onMouseLeave,xe=I.onMouseOver,he=I.onMouseOut,te=I.required,ye=I.onClick,ue=I.tabIndex,Le=I.type,ae=I.placeholder,oe=I.id,Se=I.inputMode,Me=I.pattern,We=I.step,Ke=I.maxLength,Qe=I.autoFocus,Ze=I.name,yt=I.onPaste,vt=I.onInput,dt=Object(ee.a)(I,["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"]),pt=this.state,At=pt.value,wt=pt.focused,Oe=c()(C,(S={},Object(K.a)(S,pe,!!pe),Object(K.a)(S,"".concat(C,"-disabled"),W),Object(K.a)(S,"".concat(C,"-focused"),wt),S)),we={};Object.keys(dt).forEach(function(Ee){(Ee.substr(0,5)==="data-"||Ee.substr(0,5)==="aria-"||Ee==="role")&&(we[Ee]=dt[Ee])});var Je=!Y&&!W,st=this.getInputDisplayValue(null),He=(At||At===0)&&(isNaN(At)||Number(At)>=Ae),nt=(At||At===0)&&(isNaN(At)||Number(At)<=Ge),Te=He||W||Y,ge=nt||W||Y,be=c()("".concat(C,"-handler"),"".concat(C,"-handler-up"),Object(K.a)({},"".concat(C,"-handler-up-disabled"),Te)),re=c()("".concat(C,"-handler"),"".concat(C,"-handler-down"),Object(K.a)({},"".concat(C,"-handler-down-disabled"),ge)),ie=H?{onTouchStart:Te?a:this.up,onTouchEnd:this.stop}:{onMouseDown:Te?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=H?{onTouchStart:ge?a:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return _.a.createElement("div",{className:Oe,style:Fe,title:Ue,onMouseEnter:_e,onMouseLeave:je,onMouseOver:xe,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},_.a.createElement("div",{className:"".concat(C,"-handler-wrap")},_.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":Te,className:be}),q||_.a.createElement("span",{unselectable:"on",className:"".concat(C,"-handler-up-inner"),onClick:n})),_.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:re}),le||_.a.createElement("span",{unselectable:"on",className:"".concat(C,"-handler-down-inner"),onClick:n}))),_.a.createElement("div",{className:"".concat(C,"-input-wrap")},_.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ge,"aria-valuemax":Ae,"aria-valuenow":At,required:te,type:Le,placeholder:ae,onPaste:yt,onClick:ye,onMouseUp:this.onMouseUp,className:"".concat(C,"-input"),tabIndex:ue,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Je?this.onKeyDown:a,onKeyUp:Je?this.onKeyUp:a,autoFocus:Qe,maxLength:Ke,readOnly:Y,disabled:W,max:Ae,min:Ge,step:We,name:Ze,title:Ue,id:oe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Me,inputMode:Se,onInput:vt},we))))}}]),D}(_.a.Component);A.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:o,required:!1,autoComplete:"off"};var p=A,h=de.a=p},fjLI:function(et,de,N){"use strict";N.d(de,"e",function(){return R}),N.d(de,"a",function(){return c}),N.d(de,"c",function(){return g}),N.d(de,"d",function(){return y}),N.d(de,"b",function(){return f});var ee=N("8HAY"),K=N("Cg/j"),P=N("T8No"),z=N("nnTU"),B=N("MI8n"),M=function(){var m=function(a,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var x in u)u.hasOwnProperty(x)&&(o[x]=u[x])},m(a,n)};return function(a,n){m(a,n);function o(){this.constructor=a}a.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),j=function(m,a,n,o){var u=arguments.length,x=u<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,n):o,E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(m,a,n,o);else for(var v=m.length-1;v>=0;v--)(E=m[v])&&(x=(u<3?E(x):u>3?E(a,n,x):E(a,n))||x);return u>3&&x&&Object.defineProperty(a,n,x),x},U=function(m,a){return function(n,o){a(n,o,m)}},_=function(){for(var m=0,a=0,n=arguments.length;a<n;a++)m+=arguments[a].length;for(var o=Array(m),u=0,a=0;a<n;a++)for(var x=arguments[a],E=0,v=x.length;E<v;E++,u++)o[u]=x[E];return o};function R(m){return m.command!==void 0}var c=Object(K.c)("menuService"),g=new(function(){function m(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new B.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return m.prototype.addCommand=function(a){var n=this;return this._commands.set(a.id,a),this._onDidChangeMenu.fire(0),{dispose:function(){n._commands.delete(a.id)&&n._onDidChangeMenu.fire(0)}}},m.prototype.getCommand=function(a){return this._commands.get(a)},m.prototype.getCommands=function(){var a=new Map;return this._commands.forEach(function(n,o){return a.set(o,n)}),a},m.prototype.appendMenuItem=function(a,n){var o=this,u=this._menuItems.get(a);return u?u.push(n):(u=[n],this._menuItems.set(a,u)),this._onDidChangeMenu.fire(a),{dispose:function(){var x=u.indexOf(n);x>=0&&(u.splice(x,1),o._onDidChangeMenu.fire(a))}}},m.prototype.getMenuItems=function(a){var n=(this._menuItems.get(a)||[]).slice(0);return a===0&&this._appendImplicitItems(n),n},m.prototype._appendImplicitItems=function(a){for(var n=new Set,o=a.filter(function(A){return R(A)}),u=0,x=o;u<x.length;u++){var E=x[u],v=E.command,O=E.alt;n.add(v.id),O&&n.add(O.id)}this._commands.forEach(function(A,p){n.has(p)||a.push({command:A})})},m}()),w=function(m){M(a,m);function a(n,o,u){var x=m.call(this,n,o)||this;return x._commandService=u,x}return a.prototype.run=function(){for(var n,o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return(n=this._commandService).executeCommand.apply(n,_([this.id],o))},a=j([U(2,z.b)],a),a}(ee.a),y=function(m){M(a,m);function a(n){var o=this;return typeof n.title=="string"?o=m.call(this,"",n.title,"submenu")||this:o=m.call(this,"",n.title.value,"submenu")||this,o.item=n,o}return a}(ee.a),f=function(m){M(a,m);function a(n,o,u,x,E){var v=this;return typeof n.title=="string"?v=m.call(this,n.id,n.title,E)||this:v=m.call(this,n.id,n.title.value,E)||this,v._cssClass=void 0,v._enabled=!n.precondition||x.contextMatchesRules(n.precondition),v._checked=Boolean(n.toggled&&x.contextMatchesRules(n.toggled)),v._options=u||{},v.item=n,v.alt=o?new a(o,void 0,v._options,x,E):void 0,v}return a.prototype.dispose=function(){this.alt&&this.alt.dispose(),m.prototype.dispose.call(this)},a.prototype.run=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var u=[];return this._options.arg&&(u=_(u,[this._options.arg])),this._options.shouldForwardArgs&&(u=_(u,n)),m.prototype.run.apply(this,u)},a=j([U(3,P.c),U(4,z.b)],a),a}(w)},fyJ8:function(et,de,N){"use strict";var ee=N("rePB"),K=N("VTBJ"),P=N("Ff2n"),z=N("U8pU"),B=N("q1tI"),M=N.n(B),j=N("TSYQ"),U=N.n(j),_=N("c+Xe"),R=N("sR1s");function c(m){return m&&Object(z.a)(m)==="object"&&!Array.isArray(m)&&!B.isValidElement(m)}function g(m){return typeof m=="string"?!0:Object(_.c)(m)}function w(m,a){var n,o=m.prefixCls,u=m.className,x=m.record,E=m.index,v=m.dataIndex,O=m.render,A=m.children,p=m.component,h=p===void 0?"td":p,s=m.colSpan,l=m.rowSpan,D=m.fixLeft,T=m.fixRight,S=m.firstFixLeft,I=m.lastFixLeft,C=m.firstFixRight,W=m.lastFixRight,Y=m.appendNode,H=m.additionalProps,F=H===void 0?{}:H,q=m.ellipsis,le=m.align,pe=m.rowType,Ae=m.isSticky,Ge="".concat(o,"-cell"),Fe,Ue;if(A)Ue=A;else{var _e=Object(R.b)(x,v);if(Ue=_e,O){var je=O(_e,x,E);c(je)?(Ue=je.children,Fe=je.props):Ue=je}}Object(z.a)(Ue)==="object"&&!Array.isArray(Ue)&&!B.isValidElement(Ue)&&(Ue=null),q&&(I||C)&&(Ue=B.createElement("span",{className:"".concat(Ge,"-content")},Ue));var xe=Fe||{},he=xe.colSpan,te=xe.rowSpan,ye=xe.style,ue=xe.className,Le=Object(P.a)(xe,["colSpan","rowSpan","style","className"]),ae=he!==void 0?he:s,oe=te!==void 0?te:l;if(ae===0||oe===0)return null;var Se={},Me=typeof D=="number",We=typeof T=="number";Me&&(Se.position="sticky",Se.left=D),We&&(Se.position="sticky",Se.right=T);var Ke={};le&&(Ke.textAlign=le);var Qe,Ze=q===!0?{showTitle:!0}:q;Ze&&(Ze.showTitle||pe==="header")&&(typeof Ue=="string"||typeof Ue=="number"?Qe=Ue.toString():B.isValidElement(Ue)&&typeof Ue.props.children=="string"&&(Qe=Ue.props.children));var yt=Object(K.a)(Object(K.a)(Object(K.a)({title:Qe},Le),F),{},{colSpan:ae&&ae!==1?ae:null,rowSpan:oe&&oe!==1?oe:null,className:U()(Ge,u,(n={},Object(ee.a)(n,"".concat(Ge,"-fix-left"),Me),Object(ee.a)(n,"".concat(Ge,"-fix-left-first"),S),Object(ee.a)(n,"".concat(Ge,"-fix-left-last"),I),Object(ee.a)(n,"".concat(Ge,"-fix-right"),We),Object(ee.a)(n,"".concat(Ge,"-fix-right-first"),C),Object(ee.a)(n,"".concat(Ge,"-fix-right-last"),W),Object(ee.a)(n,"".concat(Ge,"-ellipsis"),q),Object(ee.a)(n,"".concat(Ge,"-with-append"),Y),Object(ee.a)(n,"".concat(Ge,"-fix-sticky"),(Me||We)&&Ae),n),F.className,ue),style:Object(K.a)(Object(K.a)(Object(K.a)(Object(K.a)({},F.style),Ke),Se),ye),ref:g(h)?a:null});return B.createElement(h,Object.assign({},yt),Y,Ue)}var y=B.forwardRef(w);y.displayName="Cell";var f=B.memo(y,function(m,a){return a.shouldCellUpdate?!a.shouldCellUpdate(a.record,m.record):!1});de.a=f},h78n:function(et,de,N){"use strict";N.d(de,"a",function(){return S});var ee=N("q1tI"),K=N.n(ee),P=N("TSYQ"),z=N.n(P),B={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(W){var Y=W.map(function(){return Object(ee.useRef)()}),H=Object(ee.useRef)();return Object(ee.useEffect)(function(){var F=Date.now(),q=!1;Object.keys(Y).forEach(function(le){var pe=Y[le].current;if(!pe)return;q=!0;var Ae=pe.style;Ae.transitionDuration=".3s, .3s, .3s, .06s",H.current&&F-H.current<100&&(Ae.transitionDuration="0s, 0s")}),q&&(H.current=Date.now())}),[Y]};function j(){return j=Object.assign||function(C){for(var W=1;W<arguments.length;W++){var Y=arguments[W];for(var H in Y)Object.prototype.hasOwnProperty.call(Y,H)&&(C[H]=Y[H])}return C},j.apply(this,arguments)}function U(C,W){return w(C)||g(C,W)||R(C,W)||_()}function _(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(C,W){if(!C)return;if(typeof C=="string")return c(C,W);var Y=Object.prototype.toString.call(C).slice(8,-1);if(Y==="Object"&&C.constructor&&(Y=C.constructor.name),Y==="Map"||Y==="Set")return Array.from(C);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return c(C,W)}function c(C,W){(W==null||W>C.length)&&(W=C.length);for(var Y=0,H=new Array(W);Y<W;Y++)H[Y]=C[Y];return H}function g(C,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(C)))return;var Y=[],H=!0,F=!1,q=void 0;try{for(var le=C[Symbol.iterator](),pe;!(H=(pe=le.next()).done)&&!(Y.push(pe.value),W&&Y.length===W);H=!0);}catch(Ae){F=!0,q=Ae}finally{try{!H&&le.return!=null&&le.return()}finally{if(F)throw q}}return Y}function w(C){if(Array.isArray(C))return C}function y(C,W){if(C==null)return{};var Y=f(C,W),H,F;if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(C);for(F=0;F<q.length;F++){if(H=q[F],W.indexOf(H)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,H))continue;Y[H]=C[H]}}return Y}function f(C,W){if(C==null)return{};var Y={},H=Object.keys(C),F,q;for(q=0;q<H.length;q++){if(F=H[q],W.indexOf(F)>=0)continue;Y[F]=C[F]}return Y}var m=function(W){var Y=W.className,H=W.percent,F=W.prefixCls,q=W.strokeColor,le=W.strokeLinecap,pe=W.strokeWidth,Ae=W.style,Ge=W.trailColor,Fe=W.trailWidth,Ue=W.transition,_e=y(W,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete _e.gapPosition;var je=Array.isArray(H)?H:[H],xe=Array.isArray(q)?q:[q],he=M(je),te=U(he,1),ye=te[0],ue=pe/2,Le=100-pe/2,ae="M ".concat(le==="round"?ue:0,",").concat(ue,`
L `).concat(le==="round"?Le:100,",").concat(ue),oe="0 0 100 ".concat(pe),Se=0;return K.a.createElement("svg",j({className:z()("".concat(F,"-line"),Y),viewBox:oe,preserveAspectRatio:"none",style:Ae},_e),K.a.createElement("path",{className:"".concat(F,"-line-trail"),d:ae,strokeLinecap:le,stroke:Ge,strokeWidth:Fe||pe,fillOpacity:"0"}),je.map(function(Me,We){var Ke={strokeDasharray:"".concat(Me,"px, 100px"),strokeDashoffset:"-".concat(Se,"px"),transition:Ue||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Qe=xe[We]||xe[xe.length-1];return Se+=Me,K.a.createElement("path",{key:We,className:"".concat(F,"-line-path"),d:ae,strokeLinecap:le,stroke:Qe,strokeWidth:pe,fillOpacity:"0",ref:ye[We],style:Ke})}))};m.defaultProps=B;var a=m;function n(){return n=Object.assign||function(C){for(var W=1;W<arguments.length;W++){var Y=arguments[W];for(var H in Y)Object.prototype.hasOwnProperty.call(Y,H)&&(C[H]=Y[H])}return C},n.apply(this,arguments)}function o(C,W){return O(C)||v(C,W)||x(C,W)||u()}function u(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(C,W){if(!C)return;if(typeof C=="string")return E(C,W);var Y=Object.prototype.toString.call(C).slice(8,-1);if(Y==="Object"&&C.constructor&&(Y=C.constructor.name),Y==="Map"||Y==="Set")return Array.from(C);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return E(C,W)}function E(C,W){(W==null||W>C.length)&&(W=C.length);for(var Y=0,H=new Array(W);Y<W;Y++)H[Y]=C[Y];return H}function v(C,W){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(C)))return;var Y=[],H=!0,F=!1,q=void 0;try{for(var le=C[Symbol.iterator](),pe;!(H=(pe=le.next()).done)&&!(Y.push(pe.value),W&&Y.length===W);H=!0);}catch(Ae){F=!0,q=Ae}finally{try{!H&&le.return!=null&&le.return()}finally{if(F)throw q}}return Y}function O(C){if(Array.isArray(C))return C}function A(C,W){if(C==null)return{};var Y=p(C,W),H,F;if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(C);for(F=0;F<q.length;F++){if(H=q[F],W.indexOf(H)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,H))continue;Y[H]=C[H]}}return Y}function p(C,W){if(C==null)return{};var Y={},H=Object.keys(C),F,q;for(q=0;q<H.length;q++){if(F=H[q],W.indexOf(F)>=0)continue;Y[F]=C[F]}return Y}var h=0;function s(C){return+C.replace("%","")}function l(C){return Array.isArray(C)?C:[C]}function D(C,W,Y,H){var F=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,q=arguments.length>5?arguments[5]:void 0,le=50-H/2,pe=0,Ae=-le,Ge=0,Fe=-2*le;switch(q){case"left":pe=-le,Ae=0,Ge=2*le,Fe=0;break;case"right":pe=le,Ae=0,Ge=-2*le,Fe=0;break;case"bottom":Ae=le,Fe=2*le;break;default:}var Ue="M 50,50 m ".concat(pe,",").concat(Ae,`
a `).concat(le,",").concat(le," 0 1 1 ").concat(Ge,",").concat(-Fe,`
a `).concat(le,",").concat(le," 0 1 1 ").concat(-Ge,",").concat(Fe),_e=Math.PI*2*le,je={stroke:Y,strokeDasharray:"".concat(W/100*(_e-F),"px ").concat(_e,"px"),strokeDashoffset:"-".concat(F/2+C/100*(_e-F),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ue,pathStyle:je}}var T=function(W){var Y=W.prefixCls,H=W.strokeWidth,F=W.trailWidth,q=W.gapDegree,le=W.gapPosition,pe=W.trailColor,Ae=W.strokeLinecap,Ge=W.style,Fe=W.className,Ue=W.strokeColor,_e=W.percent,je=A(W,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),xe=Object(ee.useMemo)(function(){return h+=1,h},[]),he=D(0,100,pe,H,q,le),te=he.pathString,ye=he.pathStyle,ue=l(_e),Le=l(Ue),ae=Le.find(function(Ke){return Object.prototype.toString.call(Ke)==="[object Object]"}),oe=M(ue),Se=o(oe,1),Me=Se[0],We=function(){var Qe=0;return ue.map(function(Ze,yt){var vt=Le[yt]||Le[Le.length-1],dt=Object.prototype.toString.call(vt)==="[object Object]"?"url(#".concat(Y,"-gradient-").concat(xe,")"):"",pt=D(Qe,Ze,vt,H,q,le);return Qe+=Ze,K.a.createElement("path",{key:yt,className:"".concat(Y,"-circle-path"),d:pt.pathString,stroke:dt,strokeLinecap:Ae,strokeWidth:H,opacity:Ze===0?0:1,fillOpacity:"0",style:pt.pathStyle,ref:Me[yt]})})};return K.a.createElement("svg",n({className:z()("".concat(Y,"-circle"),Fe),viewBox:"0 0 100 100",style:Ge},je),ae&&K.a.createElement("defs",null,K.a.createElement("linearGradient",{id:"".concat(Y,"-gradient-").concat(xe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ae).sort(function(Ke,Qe){return s(Ke)-s(Qe)}).map(function(Ke,Qe){return K.a.createElement("stop",{key:Qe,offset:Ke,stopColor:ae[Ke]})}))),K.a.createElement("path",{className:"".concat(Y,"-circle-trail"),d:te,stroke:pe,strokeLinecap:Ae,strokeWidth:F||H,fillOpacity:"0",style:ye}),We().reverse())};T.defaultProps=B;var S=T,I={Line:a,Circle:S}},hW8S:function(et,de,N){"use strict";N.d(de,"a",function(){return z}),N.d(de,"c",function(){return B}),N.d(de,"b",function(){return M});var ee=N("VTBJ"),K=N("Ff2n"),P=N("Kwbf"),z="RC_TABLE_INTERNAL_COL_DEFINE";function B(j){var U=j.expandable,_=Object(K.a)(j,["expandable"]);return"expandable"in j?Object(ee.a)(Object(ee.a)({},_),U):_}function M(j){return Object.keys(j).reduce(function(U,_){return(_.substr(0,5)==="data-"||_.substr(0,5)==="aria-")&&(U[_]=j[_]),U},{})}},ji0R:function(et,de,N){et.exports=N.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(et,de,N){et.exports=N.p+"static/question.cb52bef9.gif"},kPYp:function(et,de){et.exports="data:image/png;base64,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"},kSUc:function(et,de,N){},l2Kq:function(et,de,N){et.exports=N.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(et,de,N){(function(ee){ee(N("VrN/"),N("1eCo"),N("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function(K,P){var z=ee.getMode(K,"text/html"),B=z.name=="null";function M(H){if(ee.findModeByName){var F=ee.findModeByName(H);F&&(H=F.mime||F.mimes[0])}var q=ee.getMode(K,H);return q.name=="null"?null:q}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 j={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var U in j)j.hasOwnProperty(U)&&P.tokenTypeOverrides[U]&&(j[U]=P.tokenTypeOverrides[U]);var _=/^([*\-_])(?:\s*\1){2,}\s*$/,R=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,g=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,w=/^ {0,3}(?:\={1,}|-{2,})\s*$/,y=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,n=" ";function o(H,F,q){return F.f=F.inline=q,q(H,F)}function u(H,F,q){return F.f=F.block=q,q(H,F)}function x(H){return!H||!/\S/.test(H.string)}function E(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 F=B;if(!F){var q=ee.innerMode(z,H.htmlState);F=q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText}F&&(H.f=s,H.block=v,H.htmlState=null)}return H.trailingSpace=0,H.trailingSpaceNewLine=!1,H.prevLine=H.thisLine,H.thisLine={stream:null},null}function v(H,F){var q=H.column()===F.indentation,le=x(F.prevLine.stream),pe=F.indentedCode,Ae=F.prevLine.hr,Ge=F.list!==!1,Fe=(F.listStack[F.listStack.length-1]||0)+3;F.indentedCode=!1;var Ue=F.indentation;if(F.indentationDiff===null&&(F.indentationDiff=F.indentation,Ge)){for(F.list=null;Ue<F.listStack[F.listStack.length-1];)F.listStack.pop(),F.listStack.length?F.indentation=F.listStack[F.listStack.length-1]:F.list=!1;F.list!==!1&&(F.indentationDiff=Ue-F.listStack[F.listStack.length-1])}var _e=!le&&!Ae&&!F.prevLine.header&&(!Ge||!pe)&&!F.prevLine.fencedCodeEnd,je=(F.list===!1||Ae||le)&&F.indentation<=Fe&&H.match(_),xe=null;if(F.indentationDiff>=4&&(pe||F.prevLine.fencedCodeEnd||F.prevLine.header||le))return H.skipToEnd(),F.indentedCode=!0,j.code;if(H.eatSpace())return null;if(q&&F.indentation<=Fe&&(xe=H.match(g))&&xe[1].length<=6)return F.quote=0,F.header=xe[1].length,F.thisLine.header=!0,P.highlightFormatting&&(F.formatting="header"),F.f=F.inline,p(F);if(F.indentation<=Fe&&H.eat(">"))return F.quote=q?1:F.quote+1,P.highlightFormatting&&(F.formatting="quote"),H.eatSpace(),p(F);if(!je&&!F.setext&&q&&F.indentation<=Fe&&(xe=H.match(R))){var he=xe[1]?"ol":"ul";return F.indentation=Ue+H.current().length,F.list=!0,F.quote=0,F.listStack.push(F.indentation),F.em=!1,F.strong=!1,F.code=!1,F.strikethrough=!1,P.taskLists&&H.match(c,!1)&&(F.taskList=!0),F.f=F.inline,P.highlightFormatting&&(F.formatting=["list","list-"+he]),p(F)}else{if(q&&F.indentation<=Fe&&(xe=H.match(f,!0)))return F.quote=0,F.fencedEndRE=new RegExp(xe[1]+"+ *$"),F.localMode=P.fencedCodeBlockHighlighting&&M(xe[2]||P.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=ee.startState(F.localMode)),F.f=F.block=A,P.highlightFormatting&&(F.formatting="code-block"),F.code=-1,p(F);if(F.setext||(!_e||!Ge)&&!F.quote&&F.list===!1&&!F.code&&!je&&!m.test(H.string)&&(xe=H.lookAhead(1))&&(xe=xe.match(w)))return F.setext?(F.header=F.setext,F.setext=0,H.skipToEnd(),P.highlightFormatting&&(F.formatting="header")):(F.header=xe[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,p(F);if(je)return H.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,j.hr;if(H.peek()==="[")return o(H,F,I)}return o(H,F,F.inline)}function O(H,F){var q=z.token(H,F.htmlState);if(!B){var le=ee.innerMode(z,F.htmlState);(le.mode.name=="xml"&&le.state.tagStart===null&&!le.state.context&&le.state.tokenize.isInText||F.md_inside&&H.current().indexOf(">")>-1)&&(F.f=s,F.block=v,F.htmlState=null)}return q}function A(H,F){var q=F.listStack[F.listStack.length-1]||0,le=F.indentation<q,pe=q+3;if(F.fencedEndRE&&F.indentation<=pe&&(le||H.match(F.fencedEndRE))){P.highlightFormatting&&(F.formatting="code-block");var Ae;return le||(Ae=p(F)),F.localMode=F.localState=null,F.block=v,F.f=s,F.fencedEndRE=null,F.code=0,F.thisLine.fencedCodeEnd=!0,le?u(H,F,F.block):Ae}else return F.localMode?F.localMode.token(H,F.localState):(H.skipToEnd(),j.code)}function p(H){var F=[];if(H.formatting){F.push(j.formatting),typeof H.formatting=="string"&&(H.formatting=[H.formatting]);for(var q=0;q<H.formatting.length;q++)F.push(j.formatting+"-"+H.formatting[q]),H.formatting[q]==="header"&&F.push(j.formatting+"-"+H.formatting[q]+"-"+H.header),H.formatting[q]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=H.quote?F.push(j.formatting+"-"+H.formatting[q]+"-"+H.quote):F.push("error"))}if(H.taskOpen)return F.push("meta"),F.length?F.join(" "):null;if(H.taskClosed)return F.push("property"),F.length?F.join(" "):null;if(H.linkHref?F.push(j.linkHref,"url"):(H.strong&&F.push(j.strong),H.em&&F.push(j.em),H.strikethrough&&F.push(j.strikethrough),H.emoji&&F.push(j.emoji),H.linkText&&F.push(j.linkText),H.code&&F.push(j.code),H.image&&F.push(j.image),H.imageAltText&&F.push(j.imageAltText,"link"),H.imageMarker&&F.push(j.imageMarker)),H.header&&F.push(j.header,j.header+"-"+H.header),H.quote&&(F.push(j.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=H.quote?F.push(j.quote+"-"+H.quote):F.push(j.quote+"-"+P.maxBlockquoteDepth)),H.list!==!1){var le=(H.listStack.length-1)%3;le?le===1?F.push(j.list2):F.push(j.list3):F.push(j.list1)}return H.trailingSpaceNewLine?F.push("trailing-space-new-line"):H.trailingSpace&&F.push("trailing-space-"+(H.trailingSpace%2?"a":"b")),F.length?F.join(" "):null}function h(H,F){return H.match(y,!0)?p(F):void 0}function s(H,F){var q=F.text(H,F);if(typeof q!="undefined")return q;if(F.list)return F.list=null,p(F);if(F.taskList){var le=H.match(c,!0)[1]===" ";return le?F.taskOpen=!0:F.taskClosed=!0,P.highlightFormatting&&(F.formatting="task"),F.taskList=!1,p(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&H.match(/^#+$/,!0))return P.highlightFormatting&&(F.formatting="header"),p(F);var pe=H.next();if(F.linkTitle){F.linkTitle=!1;var Ae=pe;pe==="("&&(Ae=")"),Ae=(Ae+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ge="^\\s*(?:[^"+Ae+"\\\\]+|\\\\\\\\|\\\\.)"+Ae;if(H.match(new RegExp(Ge),!0))return j.linkHref}if(pe==="`"){var Fe=F.formatting;P.highlightFormatting&&(F.formatting="code"),H.eatWhile("`");var Ue=H.current().length;if(F.code==0&&(!F.quote||Ue==1))return F.code=Ue,p(F);if(Ue==F.code){var _e=p(F);return F.code=0,_e}else return F.formatting=Fe,p(F)}else if(F.code)return p(F);if(pe==="\\"&&(H.next(),P.highlightFormatting)){var je=p(F),xe=j.formatting+"-escape";return je?je+" "+xe:xe}if(pe==="!"&&H.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,P.highlightFormatting&&(F.formatting="image"),p(F);if(pe==="["&&F.imageMarker&&H.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,P.highlightFormatting&&(F.formatting="image"),p(F);if(pe==="]"&&F.imageAltText){P.highlightFormatting&&(F.formatting="image");var je=p(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=D,je}if(pe==="["&&!F.image)return F.linkText&&H.match(/^.*?\]/)||(F.linkText=!0,P.highlightFormatting&&(F.formatting="link")),p(F);if(pe==="]"&&F.linkText){P.highlightFormatting&&(F.formatting="link");var je=p(F);return F.linkText=!1,F.inline=F.f=H.match(/\(.*?\)| ?\[.*?\]/,!1)?D:s,je}if(pe==="<"&&H.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=l,P.highlightFormatting&&(F.formatting="link");var je=p(F);return je?je+=" ":je="",je+j.linkInline}if(pe==="<"&&H.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=l,P.highlightFormatting&&(F.formatting="link");var je=p(F);return je?je+=" ":je="",je+j.linkEmail}if(P.xml&&pe==="<"&&H.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=H.string.indexOf(">",H.pos);if(he!=-1){var te=H.string.substring(H.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(te)&&(F.md_inside=!0)}return H.backUp(1),F.htmlState=ee.startState(z),u(H,F,O)}if(P.xml&&pe==="<"&&H.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(pe==="*"||pe==="_"){for(var ye=1,ue=H.pos==1?" ":H.string.charAt(H.pos-2);ye<3&&H.eat(pe);)ye++;var Le=H.peek()||" ",ae=!/\s/.test(Le)&&(!a.test(Le)||/\s/.test(ue)||a.test(ue)),oe=!/\s/.test(ue)&&(!a.test(ue)||/\s/.test(Le)||a.test(Le)),Se=null,Me=null;if(ye%2&&(!F.em&&ae&&(pe==="*"||!oe||a.test(ue))?Se=!0:F.em==pe&&oe&&(pe==="*"||!ae||a.test(Le))&&(Se=!1)),ye>1&&(!F.strong&&ae&&(pe==="*"||!oe||a.test(ue))?Me=!0:F.strong==pe&&oe&&(pe==="*"||!ae||a.test(Le))&&(Me=!1)),Me!=null||Se!=null){P.highlightFormatting&&(F.formatting=Se==null?"strong":Me==null?"em":"strong em"),Se===!0&&(F.em=pe),Me===!0&&(F.strong=pe);var _e=p(F);return Se===!1&&(F.em=!1),Me===!1&&(F.strong=!1),_e}}else if(pe===" "&&(H.eat("*")||H.eat("_"))){if(H.peek()===" ")return p(F);H.backUp(1)}if(P.strikethrough){if(pe==="~"&&H.eatWhile(pe)){if(F.strikethrough){P.highlightFormatting&&(F.formatting="strikethrough");var _e=p(F);return F.strikethrough=!1,_e}else if(H.match(/^[^\s]/,!1))return F.strikethrough=!0,P.highlightFormatting&&(F.formatting="strikethrough"),p(F)}else if(pe===" "&&H.match(/^~~/,!0)){if(H.peek()===" ")return p(F);H.backUp(2)}}if(P.emoji&&pe===":"&&H.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,P.highlightFormatting&&(F.formatting="emoji");var We=p(F);return F.emoji=!1,We}return pe===" "&&(H.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),p(F)}function l(H,F){var q=H.next();if(q===">"){F.f=F.inline=s,P.highlightFormatting&&(F.formatting="link");var le=p(F);return le?le+=" ":le="",le+j.linkInline}return H.match(/^[^>]+/,!0),j.linkInline}function D(H,F){if(H.eatSpace())return null;var q=H.next();return q==="("||q==="["?(F.f=F.inline=S(q==="("?")":"]"),P.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,p(F)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function S(H){return function(F,q){var le=F.next();if(le===H){q.f=q.inline=s,P.highlightFormatting&&(q.formatting="link-string");var pe=p(q);return q.linkHref=!1,pe}return F.match(T[H]),q.linkHref=!0,p(q)}}function I(H,F){return H.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=C,H.next(),P.highlightFormatting&&(F.formatting="link"),F.linkText=!0,p(F)):o(H,F,s)}function C(H,F){if(H.match(/^\]:/,!0)){F.f=F.inline=W,P.highlightFormatting&&(F.formatting="link");var q=p(F);return F.linkText=!1,q}return H.match(/^([^\]\\]|\\.)+/,!0),j.linkText}function W(H,F){return H.eatSpace()?null:(H.match(/^[^\s]+/,!0),H.peek()===void 0?F.linkTitle=!0:H.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),F.f=F.inline=s,j.linkHref+" url")}var Y={startState:function(){return{f:v,prevLine:{stream:null},thisLine:{stream:null},block:v,htmlState:null,indentation:0,inline:s,text:h,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(z,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,F){if(F.formatting=!1,H!=F.thisLine.stream){if(F.header=0,F.hr=!1,H.match(/^\s*$/,!0))return E(F),null;if(F.prevLine=F.thisLine,F.thisLine={stream:H},F.taskList=!1,F.trailingSpace=0,F.trailingSpaceNewLine=!1,!F.localState&&(F.f=F.block,F.f!=O)){var q=H.match(/^\s*/,!0)[0].replace(/\t/g,n).length;if(F.indentation=q,F.indentationDiff=null,q>0)return null}}return F.f(H,F)},innerMode:function(H){return H.block==O?{state:H.htmlState,mode:z}:H.localState?{state:H.localState,mode:H.localMode}:{state:H,mode:Y}},indent:function(H,F,q){return H.block==O&&z.indent?z.indent(H.htmlState,F,q):H.localState&&H.localMode.indent?H.localMode.indent(H.localState,F,q):ee.Pass},blankLine:E,getType:p,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Y},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},lzim:function(et,de,N){"use strict";var ee=N("E7E6"),K=N.n(ee);N.d(de,"A",function(){return K.a});var P=N("/GNS"),z=N.n(P);N.d(de,"z",function(){return z.a});var B=N("FOrL"),M=N.n(B);N.d(de,"t",function(){return M.a});var j=N("HpTS"),U=N.n(j);N.d(de,"B",function(){return U.a});var _=N("tWlo"),R=N.n(_);N.d(de,"b",function(){return R.a});var c=N("7ZXX"),g=N.n(c);N.d(de,"n",function(){return g.a});var w=N("GABl"),y=N.n(w);N.d(de,"g",function(){return y.a});var f=N("onxn"),m=N.n(f);N.d(de,"p",function(){return m.a});var a=N("nKGa"),n=N.n(a);N.d(de,"o",function(){return n.a});var o=N("4qgm"),u=N.n(o);N.d(de,"D",function(){return u.a});var x=N("JeFH"),E=N.n(x);N.d(de,"c",function(){return E.a});var v=N("ji0R"),O=N.n(v);N.d(de,"k",function(){return O.a});var A=N("W6BS"),p=N.n(A);N.d(de,"E",function(){return p.a});var h=N("kPYp"),s=N.n(h);N.d(de,"F",function(){return s.a});var l=N("nukY"),D=N.n(l),T=N("4u4S"),S=N.n(T),I=N("yslc"),C=N.n(I),W=N("l2Kq"),Y=N.n(W),H=N("RMFE"),F=N.n(H);N.d(de,"q",function(){return F.a});var q=N("TGq3"),le=N.n(q);N.d(de,"r",function(){return le.a});var pe=N("SMhR"),Ae=N.n(pe);N.d(de,"C",function(){return Ae.a});var Ge=N("8/bI"),Fe=N.n(Ge);N.d(de,"l",function(){return Fe.a});var Ue=N("JWDV"),_e=N.n(Ue);N.d(de,"e",function(){return _e.a});var je=N("Xsq0"),xe=N.n(je);N.d(de,"s",function(){return xe.a});var he=N("Ohmc"),te=N.n(he);N.d(de,"d",function(){return te.a});var ye=N("csWT"),ue=N.n(ye);N.d(de,"f",function(){return ue.a});var Le=N("7v3h"),ae=N.n(Le);N.d(de,"m",function(){return ae.a});var oe=N("cRFk"),Se=N.n(oe);N.d(de,"y",function(){return Se.a});var Me=N("kPWJ"),We=N.n(Me);N.d(de,"x",function(){return We.a});var Ke=N("qgvg"),Qe=N.n(Ke);N.d(de,"u",function(){return Qe.a});var Ze=N("FPkq"),yt=N.n(Ze);N.d(de,"w",function(){return yt.a});var vt=N("A/g1"),dt=N.n(vt);N.d(de,"h",function(){return dt.a});var pt=N("Nmxd"),At=N.n(pt);N.d(de,"i",function(){return At.a});var wt=N("5D2P"),Oe=N.n(wt);N.d(de,"j",function(){return Oe.a});var we=N("djh8"),Je=N.n(we);N.d(de,"v",function(){return Je.a});var st=N("Jq4h"),He=N.n(st);N.d(de,"a",function(){return He.a})},n6Qo:function(et,de,N){"use strict";N.d(de,"a",function(){return U});var ee=N("q1tI"),K=N("biw7"),P=N("fyJ8");function z(_){var R=_.className,c=_.index,g=_.children,w=_.colSpan,y=_.rowSpan,f=ee.useContext(K.a),m=f.prefixCls,a=f.fixedInfoList,n=a[c];return ee.createElement(P.a,Object.assign({className:R,index:c,component:"td",prefixCls:m,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:w,rowSpan:y}}}},n))}function B(_){return ee.createElement("tr",Object.assign({},_))}function M(_){var R=_.children,c=ee.useContext(K.a),g=c.prefixCls;return ee.createElement("tfoot",{className:"".concat(g,"-summary")},R)}var j=de.b=M,U={Cell:z,Row:B}},nKGa:function(et,de,N){et.exports=N.p+"static/export_exercise-template.f7655c19.png"},nnTU:function(et,de,N){"use strict";N.d(de,"b",function(){return U}),N.d(de,"a",function(){return _});var ee=N("pmY6"),K=N("746U"),P=N("Cg/j"),z=N("MI8n"),B=N("24hK"),M=N("QDVR"),j=function(){for(var R=0,c=0,g=arguments.length;c<g;c++)R+=arguments[c].length;for(var w=Array(R),y=0,c=0;c<g;c++)for(var f=arguments[c],m=0,a=f.length;m<a;m++,y++)w[y]=f[m];return w},U=Object(P.c)("commandService"),_=new(function(){function R(){this._commands=new Map,this._onDidRegisterCommand=new z.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return R.prototype.registerCommand=function(c,g){var w=this;if(!c)throw new Error("invalid command");if(typeof c=="string"){if(!g)throw new Error("invalid command");return this.registerCommand({id:c,handler:g})}if(c.description){for(var y=[],f=0,m=c.description.args;f<m.length;f++){var a=m[f];y.push(a.constraint)}var n=c.handler;c.handler=function(v){for(var O=[],A=1;A<arguments.length;A++)O[A-1]=arguments[A];return Object(K.m)(O,y),n.apply(void 0,j([v],O))}}var o=c.id,u=this._commands.get(o);u||(u=new B.a,this._commands.set(o,u));var x=u.unshift(c),E=Object(ee.h)(function(){x();var v=w._commands.get(o);(v==null?void 0:v.isEmpty())&&w._commands.delete(o)});return this._onDidRegisterCommand.fire(o),E},R.prototype.registerCommandAlias=function(c,g){return _.registerCommand(c,function(w){for(var y,f=[],m=1;m<arguments.length;m++)f[m-1]=arguments[m];return(y=w.get(U)).executeCommand.apply(y,j([g],f))})},R.prototype.getCommand=function(c){var g=this._commands.get(c);return!g||g.isEmpty()?void 0:g.iterator().next().value},R.prototype.getCommands=function(){for(var c=new Map,g=0,w=Object(M.d)(this._commands);g<w.length;g++){var y=w[g],f=this.getCommand(y);f&&c.set(y,f)}return c},R}())},nukY:function(et,de){et.exports="data:image/png;base64,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"},"o/qq":function(et,de,N){et.exports={flex_box_center:"flex_box_center___1LYHS",flex_space_between:"flex_space_between___EmHgD",flex_box_vertical_center:"flex_box_vertical_center___8y-JO",flex_box_center_end:"flex_box_center_end___2Ow7E",flex_box_column:"flex_box_column___2_dIp",shixunWrp:"shixunWrp___2zw8A"}},onxn:function(et,de){et.exports="data:image/png;base64,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"},osHv:function(et,de,N){(function(ee){ee(N("VrN/"))})(function(ee){"use strict";var K=ee.Pos;function P(a,n){return a.line-n.line||a.ch-n.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+z+"]["+B+"]*)","g");function j(a,n,o,u){this.line=n,this.ch=o,this.cm=a,this.text=a.getLine(n),this.min=u?Math.max(u.from,a.firstLine()):a.firstLine(),this.max=u?Math.min(u.to-1,a.lastLine()):a.lastLine()}function U(a,n){var o=a.cm.getTokenTypeAt(K(a.line,n));return o&&/\btag\b/.test(o)}function _(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function R(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function c(a){for(;;){var n=a.text.indexOf(">",a.ch);if(n==-1){if(_(a))continue;return}if(!U(a,n+1)){a.ch=n+1;continue}var o=a.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(a.text.slice(o+1,n));return a.ch=n+1,u?"selfClose":"regular"}}function g(a){for(;;){var n=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(n==-1){if(R(a))continue;return}if(!U(a,n+1)){a.ch=n;continue}M.lastIndex=n,a.ch=n;var o=M.exec(a.text);if(o&&o.index==n)return o}}function w(a){for(;;){M.lastIndex=a.ch;var n=M.exec(a.text);if(!n){if(_(a))continue;return}if(!U(a,n.index+1)){a.ch=n.index+1;continue}return a.ch=n.index+n[0].length,n}}function y(a){for(;;){var n=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(n==-1){if(R(a))continue;return}if(!U(a,n+1)){a.ch=n;continue}var o=a.text.lastIndexOf("/",n),u=o>-1&&!/\S/.test(a.text.slice(o+1,n));return a.ch=n+1,u?"selfClose":"regular"}}function f(a,n){for(var o=[];;){var u=w(a),x,E=a.line,v=a.ch-(u?u[0].length:0);if(!u||!(x=c(a)))return;if(x=="selfClose")continue;if(u[1]){for(var O=o.length-1;O>=0;--O)if(o[O]==u[2]){o.length=O;break}if(O<0&&(!n||n==u[2]))return{tag:u[2],from:K(E,v),to:K(a.line,a.ch)}}else o.push(u[2])}}function m(a,n){for(var o=[];;){var u=y(a);if(!u)return;if(u=="selfClose"){g(a);continue}var x=a.line,E=a.ch,v=g(a);if(!v)return;if(v[1])o.push(v[2]);else{for(var O=o.length-1;O>=0;--O)if(o[O]==v[2]){o.length=O;break}if(O<0&&(!n||n==v[2]))return{tag:v[2],from:K(a.line,a.ch),to:K(x,E)}}}}ee.registerHelper("fold","xml",function(a,n){for(var o=new j(a,n.line,0);;){var u=w(o);if(!u||o.line!=n.line)return;var x=c(o);if(!x)return;if(!u[1]&&x!="selfClose"){var E=K(o.line,o.ch),v=f(o,u[2]);return v&&P(v.from,E)>0?{from:E,to:v.from}:null}}}),ee.findMatchingTag=function(a,n,o){var u=new j(a,n.line,n.ch,o);if(u.text.indexOf(">")==-1&&u.text.indexOf("<")==-1)return;var x=c(u),E=x&&K(u.line,u.ch),v=x&&g(u);if(!x||!v||P(u,n)>0)return;var O={from:K(u.line,u.ch),to:E,tag:v[2]};return x=="selfClose"?{open:O,close:null,at:"open"}:v[1]?{open:m(u,v[2]),close:O,at:"close"}:(u=new j(a,E.line,E.ch,o),{open:O,close:f(u,v[2]),at:"open"})},ee.findEnclosingTag=function(a,n,o,u){for(var x=new j(a,n.line,n.ch,o);;){var E=m(x,u);if(!E)break;var v=new j(a,n.line,n.ch,o),O=f(v,E.tag);if(O)return{open:E,close:O}}},ee.scanForClosingTag=function(a,n,o,u){var x=new j(a,n.line,n.ch,u?{from:0,to:u}:null);return f(x,o)}})},p5ED:function(et,de,N){"use strict";var ee=N("+L6B"),K=N("2/Rp"),P=N("5Dmo"),z=N("3S7+"),B=N("k1fw"),M=N("9og8"),j=N("tJVT"),U=N("WmNS"),_=N.n(U),R=N("q1tI"),c=N.n(R),g=N("vHTk"),w=N.n(g),y=N("yEEn"),f=N("ZW9T"),m=N("1vsH"),a=N("V0Rq"),n=N("m3rI");de.a=function(o){var u,x,E,v,O,A,p=o.editOffice,h=p===void 0?"view":p,s=o.name,l=o.data,D=o.theme,T=o.type,S=o.filename,I=o.monacoEditor,C=o.className,W=o.style,Y=o.close,H=o.onClose,F=o.hasMask,q=o.disabledDownload,le=o.onImgDimensions,pe=o.otherData,Ae=Object(R.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ge=Object(j.a)(Ae,2),Fe=Ge[0],Ue=Ge[1],_e=Object(R.useState)(""),je=Object(j.a)(_e,2),xe=je[0],he=je[1],te=Object(R.useState)(),ye=Object(j.a)(te,2),ue=ye[0],Le=ye[1],ae=window.ENV==="build"?"/react/build":"",oe=location.host.startsWith("localhost")?n.a.PROXY_SERVER:n.a.API_SERVER,Se,Me=1024*1024,We=10*Me,Ke=Object(R.useRef)();(u=l)!==null&&u!==void 0&&u.startsWith("/api")&&T!=="txt"&&(l=n.a.API_SERVER+l),T==="office"&&(Se=Object(m.P)(l).filesize,Se>We&&(T="other")),S&&(I.filename=S),Object(R.useEffect)(function(){var vt,dt,pt=(vt=document.cookie)===null||vt===void 0||((dt=vt.replace(/\s/g,""))===null||dt===void 0)?void 0:dt.split(";");pt==null||pt.map(function(At){var wt=At.split("=");wt[0]==="_educoder_session"&&he(wt[1])})},[]),Object(R.useEffect)(function(){T==="office"&&Qe()},[T,l]);var Qe=function(){var vt=Object(M.a)(_.a.mark(function dt(){var pt,At,wt;return _.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return console.log("data:",l),pt=l,l.startsWith("http")||(pt=location.origin+pt),At=new URL(pt).pathname.split("/").pop(),we.next=6,Object(a.U)({attachment_id:At});case 6:wt=we.sent,Le(wt);case 8:case"end":return we.stop()}},dt)}));return function(){return vt.apply(this,arguments)}}(),Ze=function(){if(l.startsWith("http")||l.startsWith("blob:")){yt();return}Object(m.x)(S||"educoder",l,S)},yt=function(){Object(m.v)(S||"educoder",decodeURIComponent(l))};return c.a.createElement("div",{style:Object(B.a)({},W||{}),className:"".concat(F&&w.a.bgBlack," ").concat(T?w.a.wrp:"hide")},Y&&c.a.createElement("div",{className:w.a.close,ref:Ke},!!le&&c.a.createElement(z.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Ke.current}},c.a.createElement("span",{onClick:function(){H(),le()}},c.a.createElement("i",{className:"icon-yulanpizhu"}))),!q&&c.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ke.current}},c.a.createElement("span",{onClick:yt},c.a.createElement("i",{className:"icon-quxiaozhiding"}))),c.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ke.current}},c.a.createElement("span",{className:"",onClick:H},c.a.createElement("i",{className:"icon-guanbi1"})))),c.a.createElement("div",{className:"".concat(w.a[C]," ").concat(C," ").concat(w.a.monaco," ").concat(T==="txt"?"show":"hide")},T==="txt"&&c.a.createElement(f.b,I)),T==="audio"&&c.a.createElement("audio",{src:"".concat(((x=l)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((E=l)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(l),autoPlay:!0}),T==="video"&&c.a.createElement(c.a.Fragment,null,((v=l)===null||v===void 0?void 0:v.indexOf("http"))>-1?c.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):c.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),T==="office"&&ue&&c.a.createElement("iframe",{src:"".concat(ae,"/office.html?key=").concat(ue.key,"&url=").concat(oe+ue.url,"&callbackUrl=").concat(oe+ue.callbackUrl,"&fileType=").concat(ue.fileType,"&title=").concat(ue.title,"&model=").concat(h,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!q)}),(T==="xlsx"||T==="doc"||T==="pptx"||T==="docx")&&c.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(pe.key,"&url=").concat(n.a.API_SERVER+pe.url,"&callbackUrl=").concat(n.a.API_SERVER+pe.callbackUrl,"&fileType=").concat(pe.fileType,"&title=").concat(pe.title,"&model=").concat(pe.model)}),T==="html"&&c.a.createElement("iframe",{src:l+"&disposition=inline"}),T==="pdf"&&c.a.createElement("embed",{className:w.a.embed,src:l}),T==="image"&&c.a.createElement("img",{src:"".concat(((O=l)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((A=l)===null||A===void 0?void 0:A.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)}),T==="other"&&c.a.createElement("div",null,c.a.createElement(K.a,{type:"primary",size:"large",onClick:Ze},c.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),T==="download"&&c.a.createElement(K.a,{type:"primary",size:"large",onClick:Ze},c.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(et,de,N){},pmY6:function(et,de,N){"use strict";N.d(de,"g",function(){return B}),N.d(de,"f",function(){return M}),N.d(de,"e",function(){return j}),N.d(de,"h",function(){return U}),N.d(de,"b",function(){return _}),N.d(de,"a",function(){return R}),N.d(de,"d",function(){return c}),N.d(de,"c",function(){return g});var ee=!1,K="__is_disposable_tracked__";function P(w){if(!ee)return;if(w&&w!==R.None)try{w[K]=!0}catch(y){}}function z(w){if(!ee)return w;var y=new Error("Potentially leaked disposable").stack;return setTimeout(function(){w[K]||console.log(y)},3e3),w}function B(w){return typeof w.dispose=="function"&&w.dispose.length===0}function M(w){return Array.isArray(w)?(w.forEach(function(y){y&&(P(y),y.dispose())}),[]):w?(P(w),w.dispose(),w):void 0}function j(){for(var w=[],y=0;y<arguments.length;y++)w[y]=arguments[y];return w.forEach(P),z({dispose:function(){return M(w)}})}function U(w){var y=z({dispose:function(){P(y),w()}});return y}var _=function(){function w(){this._toDispose=new Set,this._isDisposed=!1}return w.prototype.dispose=function(){if(this._isDisposed)return;P(this),this._isDisposed=!0,this.clear()},w.prototype.clear=function(){this._toDispose.forEach(function(y){return y.dispose()}),this._toDispose.clear()},w.prototype.add=function(y){if(!y)return y;if(y===this)throw new Error("Cannot register a disposable on itself!");return P(y),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(y),y},w}(),R=function(){function w(){this._store=new _,z(this)}return w.prototype.dispose=function(){P(this),this._store.dispose()},w.prototype._register=function(y){if(y===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(y)},w.None=Object.freeze({dispose:function(){}}),w}(),c=function(){function w(){this._isDisposed=!1,z(this)}return Object.defineProperty(w.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(y){if(this._isDisposed||y===this._value)return;this._value&&this._value.dispose(),y&&P(y),this._value=y},enumerable:!0,configurable:!0}),w.prototype.clear=function(){this.value=void 0},w.prototype.dispose=function(){this._isDisposed=!0,P(this),this._value&&this._value.dispose(),this._value=void 0},w}(),g=function(){function w(y){this.object=y}return w.prototype.dispose=function(){},w}()},qgvg:function(et,de){et.exports="data:image/gif;base64,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"},"rAM+":function(et,de,N){"use strict";N.d(de,"a",function(){return K});var ee=N("Qw5x");function K(P,z){var B;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(B=Object(ee.a)(P))||z&&P&&typeof P.length=="number"){B&&(P=B);var M=0,j=function(){};return{s:j,n:function(){return M>=P.length?{done:!0}:{done:!1,value:P[M++]}},e:function(g){throw g},f:j}}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 U=!0,_=!1,R;return{s:function(){B=P[Symbol.iterator]()},n:function(){var g=B.next();return U=g.done,g},e:function(g){_=!0,R=g},f:function(){try{!U&&B.return!=null&&B.return()}finally{if(_)throw R}}}}},rUJ1:function(et,de){const N=/[&<>"']/,ee=/[&<>"']/g,K=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},B=A=>z[A];function M(A,p){if(p){if(N.test(A))return A.replace(ee,B)}else if(K.test(A))return A.replace(P,B);return A}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(A){return A.replace(j,(p,h)=>(h=h.toLowerCase(),h==="colon"?":":h.charAt(0)==="#"?h.charAt(1)==="x"?String.fromCharCode(parseInt(h.substring(2),16)):String.fromCharCode(+h.substring(1)):""))}const _=/(^|[^\[])\^/g;function R(A,p){A=A.source||A,p=p||"";const h={replace:(s,l)=>(l=l.source||l,l=l.replace(_,"$1"),A=A.replace(s,l),h),getRegex:()=>new RegExp(A,p)};return h}const c=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(A,p,h){if(A){let s;try{s=decodeURIComponent(U(h)).replace(c,"").toLowerCase()}catch(l){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}p&&!g.test(h)&&(h=n(p,h));try{h=encodeURI(h).replace(/%25/g,"%")}catch(s){return null}return h}const y={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(A,p){y[" "+A]||(f.test(A)?y[" "+A]=A+"/":y[" "+A]=E(A,"/",!0)),A=y[" "+A];const h=A.indexOf(":")===-1;return p.substring(0,2)==="//"?h?p:A.replace(m,"$1")+p:p.charAt(0)==="/"?h?p:A.replace(a,"$1")+p:A+p}const o={exec:function(){}};function u(A){let p=1,h,s;for(;p<arguments.length;p++){h=arguments[p];for(s in h)Object.prototype.hasOwnProperty.call(h,s)&&(A[s]=h[s])}return A}function x(A,p){const h=A.replace(/\|/g,(D,T,S)=>{let I=!1,C=T;for(;--C>=0&&S[C]==="\\";)I=!I;return I?"|":" |"}),s=h.split(/ \|/);let l=0;if(s.length>p)s.splice(p);else for(;s.length<p;)s.push("");for(;l<s.length;l++)s[l]=s[l].trim().replace(/\\\|/g,"|");return s}function E(A,p,h){const s=A.length;if(s===0)return"";let l=0;for(;l<s;){const D=A.charAt(s-l-1);if(D===p&&!h)l++;else if(D!==p&&h)l++;else break}return A.substr(0,s-l)}function v(A,p){if(A.indexOf(p[1])===-1)return-1;const h=A.length;let s=0,l=0;for(;l<h;l++)if(A[l]==="\\")l++;else if(A[l]===p[0])s++;else if(A[l]===p[1]&&(s--,s<0))return l;return-1}function O(A){A&&A.sanitize&&!A.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}et.exports={escape:M,unescape:U,edit:R,cleanUrl:w,resolveUrl:n,noopTest:o,merge:u,splitCells:x,rtrim:E,findClosingBracket:v,checkSanitizeDeprecation:O}},sR1s:function(et,de,N){"use strict";N.d(de,"b",function(){return z}),N.d(de,"a",function(){return B}),N.d(de,"c",function(){return M}),N.d(de,"d",function(){return j});var ee=N("U8pU"),K="RC_TABLE_KEY";function P(U){return U==null?[]:Array.isArray(U)?U:[U]}function z(U,_){if(!_&&typeof _!="number")return U;for(var R=P(_),c=U,g=0;g<R.length;g+=1){if(!c)return null;var w=R[g];c=c[w]}return c}function B(U){var _=[],R={};return U.forEach(function(c){for(var g=c||{},w=g.key,y=g.dataIndex,f=w||P(y).join("-")||K;R[f];)f="".concat(f,"_next");R[f]=!0,_.push(f)}),_}function M(){var U={};function _(w,y){y&&Object.keys(y).forEach(function(f){var m=y[f];m&&Object(ee.a)(m)==="object"?(w[f]=w[f]||{},_(w[f],m)):w[f]=m})}for(var R=arguments.length,c=new Array(R),g=0;g<R;g++)c[g]=arguments[g];return c.forEach(function(w){_(U,w)}),U}function j(U){return U!=null}},sboe:function(et,de,N){"use strict";N.d(de,"a",function(){return P});var ee=N("q1tI"),K=N.n(ee),P=ee.createContext(null)},t23M:function(et,de,N){"use strict";var ee=N("VTBJ"),K=N("1OyB"),P=N("vuIU"),z=N("Ji7U"),B=N("LK+K"),M=N("q1tI"),j=N.n(M),U=N("m+aA"),_=N("Zm9Q"),R=N("Kwbf"),c=N("c+Xe"),g=N("bdgK"),w="rc-observer-key",y=function(f){Object(z.a)(a,f);var m=Object(B.a)(a);function a(){var n;return Object(K.a)(this,a),n=m.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(o){var u=n.props.onResize,x=o[0].target,E=x.getBoundingClientRect(),v=E.width,O=E.height,A=x.offsetWidth,p=x.offsetHeight,h=Math.floor(v),s=Math.floor(O);if(n.state.width!==h||n.state.height!==s||n.state.offsetWidth!==A||n.state.offsetHeight!==p){var l={width:h,height:s,offsetWidth:A,offsetHeight:p};n.setState(l),u&&Promise.resolve().then(function(){u(Object(ee.a)(Object(ee.a)({},l),{},{offsetWidth:A,offsetHeight:p}))})}},n.setChildNode=function(o){n.childNode=o},n}return Object(P.a)(a,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var o=this.props.disabled;if(o){this.destroyObserver();return}var u=Object(U.a)(this.childNode||this),x=u!==this.currentElement;x&&(this.destroyObserver(),this.currentElement=u),!this.resizeObserver&&u&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(u))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var o=this.props.children,u=Object(_.a)(o);if(u.length>1)Object(R.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(u.length===0)return Object(R.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var x=u[0];if(M.isValidElement(x)&&Object(c.c)(x)){var E=x.ref;u[0]=M.cloneElement(x,{ref:Object(c.a)(E,this.setChildNode)})}return u.length===1?u[0]:u.map(function(v,O){return!M.isValidElement(v)||"key"in v&&v.key!==null?v:M.cloneElement(v,{key:"".concat(w,"-").concat(O)})})}}]),a}(M.Component);y.displayName="ResizeObserver",de.a=y},tWlo:function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVCNENBMTM0OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkVCNENBMTM1OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RUI0Q0ExMzI4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RUI0Q0ExMzM4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7p3KzkAAAFvElEQVR42sRae0ybVRQ/peVRaFce8pwgj1Je5TFsEHGbMAkzmqiJyba4hYh/LJlxiRr9Z0aNGv8xvhKTGckM2zKWmGEgU7MsPnCZIrKBjMcKY9BCBMqjjEcLtFDwHPZVC12h934f8yS/P6Dfud/5nXvvueec+8neOPEuSCAxiDJEMSITkYKIRoQJv9sREwgTogfRjGhEjIt9sUKEbhSiEvEC4mGEbJNngxGRiAzEk8L/VhGtiPOIswgrjxEBHDrxiE8Qg4hPEYYtjPclMkGXxhhCfIFI2E4CNFtvIm4hXvdYHlJIKOIVRK/wjkCpCaQjWhAfIVSwfaIS3kHvypaKwLOI64hdcP+kAPEn4jmxBI4ivkXsgPsvNBt1gg1cBI4hvkLI4f8TuWDDMdYw+owQFdh3Y6gSCnL1oNOmQnxcHAQHB8HCwiLMzM7C8KgFjD23oN9khtXVVZZhyZZhxEV/CGQhalk9r1AoYO9jxfBokQGCgoK8SBHi42LBsCsfJq1TcOnHn+F2v4llJsimIoRx3Q8le0o9/6bwdRmRxGJ8ZEQ4vHjkEORkZYBcLvdrlvL0OeBwOuDv4RF/X0Ne2Y34GrHiaw+8ishnMT4tNRmOVlVCTPQDzKfY/vJ9kJWpY1Ej217ztYnpFHyH6UjGJXH4wPOgVIZw7VAi8XRFOSjkTKv1bc8T25PACdZDan95mV9LZjNRq1Wg02lZw+tbGwnQ/L/EMooyJASSkxIliZUp7ONUCTb/S+AI2cTqOZlMJgmBcI2GVUUp2LyOAJMwxvHN04EAnqQYDrsJUDFSyKrtdC5JRmDR4eBRoxokgQjs48nn5+fnJSNgt3ONRTaXEYFHeLSXlpd5Peclk1Yrr6ohQKhhuWR6ekYSAiOWMV7VDCKg5Z0/uwTLaNnlAssYd22fTgRieTRz9dmQlpIsmgCdwuWle3nVY4mAmkczLCxUsk0cEaHhVVUH8GqOT0xKRmB6ZpZX1UkE5ng0zeYhsNntkhBgqAs2yhwR4AoBrpUVaO/oEm38nelp6B/gJnCHCNzm1f79jxaWgsRLbDY7XKj/Dlb405I+ItDDqz2/sACnTp9DEqNc+qfO1MLwyKiYCewNEPov3EK+G59k39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(et,de,N){typeof window!="undefined"&&function(K,P){et.exports=P()}(this,function(){return function(ee){var K={};function P(z){if(K[z])return K[z].exports;var B=K[z]={i:z,l:!1,exports:{}};return ee[z].call(B.exports,B,B.exports,P),B.l=!0,B.exports}return P.m=ee,P.c=K,P.d=function(z,B,M){P.o(z,B)||Object.defineProperty(z,B,{enumerable:!0,get:M})},P.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},P.t=function(z,B){if(B&1&&(z=P(z)),B&8)return z;if(B&4&&typeof z=="object"&&z&&z.__esModule)return z;var M=Object.create(null);if(P.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:z}),B&2&&typeof z!="string")for(var j in z)P.d(M,j,function(U){return z[U]}.bind(null,j));return M},P.n=function(z){var B=z&&z.__esModule?function(){return z.default}:function(){return z};return P.d(B,"a",B),B},P.o=function(z,B){return Object.prototype.hasOwnProperty.call(z,B)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,K,P){"use strict";var z=Object.prototype.hasOwnProperty,B="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(B=!1));function j(c,g,w){this.fn=c,this.context=g,this.once=w||!1}function U(c,g,w,y,f){if(typeof w!="function")throw new TypeError("The listener must be a function");var m=new j(w,y||c,f),a=B?B+g:g;return c._events[a]?c._events[a].fn?c._events[a]=[c._events[a],m]:c._events[a].push(m):(c._events[a]=m,c._eventsCount++),c}function _(c,g){--c._eventsCount===0?c._events=new M:delete c._events[g]}function R(){this._events=new M,this._eventsCount=0}R.prototype.eventNames=function(){var g=[],w,y;if(this._eventsCount===0)return g;for(y in w=this._events)z.call(w,y)&&g.push(B?y.slice(1):y);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(w)):g},R.prototype.listeners=function(g){var w=B?B+g:g,y=this._events[w];if(!y)return[];if(y.fn)return[y.fn];for(var f=0,m=y.length,a=new Array(m);f<m;f++)a[f]=y[f].fn;return a},R.prototype.listenerCount=function(g){var w=B?B+g:g,y=this._events[w];return y?y.fn?1:y.length:0},R.prototype.emit=function(g,w,y,f,m,a){var n=B?B+g:g;if(!this._events[n])return!1;var o=this._events[n],u=arguments.length,x,E;if(o.fn){o.once&&this.removeListener(g,o.fn,void 0,!0);switch(u){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,w),!0;case 3:return o.fn.call(o.context,w,y),!0;case 4:return o.fn.call(o.context,w,y,f),!0;case 5:return o.fn.call(o.context,w,y,f,m),!0;case 6:return o.fn.call(o.context,w,y,f,m,a),!0}for(E=1,x=new Array(u-1);E<u;E++)x[E-1]=arguments[E];o.fn.apply(o.context,x)}else{var v=o.length,O;for(E=0;E<v;E++){o[E].once&&this.removeListener(g,o[E].fn,void 0,!0);switch(u){case 1:o[E].fn.call(o[E].context);break;case 2:o[E].fn.call(o[E].context,w);break;case 3:o[E].fn.call(o[E].context,w,y);break;case 4:o[E].fn.call(o[E].context,w,y,f);break;default:if(!x)for(O=1,x=new Array(u-1);O<u;O++)x[O-1]=arguments[O];o[E].fn.apply(o[E].context,x)}}}return!0},R.prototype.on=function(g,w,y){return U(this,g,w,y,!1)},R.prototype.once=function(g,w,y){return U(this,g,w,y,!0)},R.prototype.removeListener=function(g,w,y,f){var m=B?B+g:g;if(!this._events[m])return this;if(!w)return _(this,m),this;var a=this._events[m];if(a.fn)a.fn===w&&(!f||a.once)&&(!y||a.context===y)&&_(this,m);else{for(var n=0,o=[],u=a.length;n<u;n++)(a[n].fn!==w||f&&!a[n].once||y&&a[n].context!==y)&&o.push(a[n]);o.length?this._events[m]=o.length===1?o[0]:o:_(this,m)}return this},R.prototype.removeAllListeners=function(g){var w;return g?(w=B?B+g:g,this._events[w]&&_(this,w)):(this._events=new M,this._eventsCount=0),this},R.prototype.off=R.prototype.removeListener,R.prototype.addListener=R.prototype.on,R.prefixed=B,R.EventEmitter=R,ee.exports=R},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,K,P){(function(z){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,_={buildAbsoluteURL:function(R,c,g){if(g=g||{},R=R.trim(),c=c.trim(),!c){if(!g.alwaysNormalize)return R;var w=_.parseURL(R);if(!w)throw new Error("Error trying to parse base URL.");return w.path=_.normalizePath(w.path),_.buildURLFromParts(w)}var y=_.parseURL(c);if(!y)throw new Error("Error trying to parse relative URL.");if(y.scheme)return g.alwaysNormalize?(y.path=_.normalizePath(y.path),_.buildURLFromParts(y)):c;var f=_.parseURL(R);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var m=M.exec(f.path);f.netLoc=m[1],f.path=m[2]}f.netLoc&&!f.path&&(f.path="/");var a={scheme:f.scheme,netLoc:y.netLoc,path:null,params:y.params,query:y.query,fragment:y.fragment};if(!y.netLoc&&(a.netLoc=f.netLoc,y.path[0]!=="/"))if(!y.path)a.path=f.path,y.params||(a.params=f.params,y.query||(a.query=f.query));else{var n=f.path,o=n.substring(0,n.lastIndexOf("/")+1)+y.path;a.path=_.normalizePath(o)}return a.path===null&&(a.path=g.alwaysNormalize?_.normalizePath(y.path):y.path),_.buildURLFromParts(a)},parseURL:function(R){var c=B.exec(R);return c?{scheme:c[1]||"",netLoc:c[2]||"",path:c[3]||"",params:c[4]||"",query:c[5]||"",fragment:c[6]||""}:null},normalizePath:function(R){for(R=R.split("").reverse().join("").replace(j,"");R.length!==(R=R.replace(U,"")).length;);return R.split("").reverse().join("")},buildURLFromParts:function(R){return R.scheme+R.netLoc+R.path+R.params+R.query+R.fragment}};ee.exports=_})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,K,P){function z(g){var w={};function y(m){if(w[m])return w[m].exports;var a=w[m]={i:m,l:!1,exports:{}};return g[m].call(a.exports,a,a.exports,y),a.l=!0,a.exports}y.m=g,y.c=w,y.i=function(m){return m},y.d=function(m,a,n){y.o(m,a)||Object.defineProperty(m,a,{configurable:!1,enumerable:!0,get:n})},y.r=function(m){Object.defineProperty(m,"__esModule",{value:!0})},y.n=function(m){var a=m&&m.__esModule?function(){return m.default}:function(){return m};return y.d(a,"a",a),a},y.o=function(m,a){return Object.prototype.hasOwnProperty.call(m,a)},y.p="/",y.oe=function(m){throw console.error(m),m};var f=y(y.s=ENTRY_MODULE);return f.default||f}var B="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function j(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(g){return!isNaN(1*g)}function _(g,w,y){var f={};f[y]=[];var m=w.toString(),a=m.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return f;for(var n=a[1],o=new RegExp("(\\\\n|\\W)"+j(n)+M,"g"),u;u=o.exec(m);){if(u[3]==="dll-reference")continue;f[y].push(u[3])}for(o=new RegExp("\\("+j(n)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+M,"g");u=o.exec(m);)g[u[2]]||(f[y].push(u[1]),g[u[2]]=P(u[1]).m),f[u[2]]=f[u[2]]||[],f[u[2]].push(u[4]);for(var x=Object.keys(f),E=0;E<x.length;E++)for(var v=0;v<f[x[E]].length;v++)U(f[x[E]][v])&&(f[x[E]][v]=1*f[x[E]][v]);return f}function R(g){var w=Object.keys(g);return w.reduce(function(y,f){return y||g[f].length>0},!1)}function c(g,w){for(var y={main:[w]},f={main:[]},m={main:{}};R(y);)for(var a=Object.keys(y),n=0;n<a.length;n++){var o=a[n],u=y[o],x=u.pop();if(m[o]=m[o]||{},m[o][x]||!g[o][x])continue;m[o][x]=!0,f[o]=f[o]||[],f[o].push(x);for(var E=_(g,g[o][x],o),v=Object.keys(E),O=0;O<v.length;O++)y[v[O]]=y[v[O]]||[],y[v[O]]=y[v[O]].concat(E[v[O]])}return f}ee.exports=function(g,w){w=w||{};var y={main:P.m},f=w.all?{main:Object.keys(y.main)}:c(y,g),m="";Object.keys(f).filter(function(x){return x!=="main"}).forEach(function(x){for(var E=0;f[x][E];)E++;f[x].push(E),y[x][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",m=m+"var "+x+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+f[x].map(function(v){return""+JSON.stringify(v)+": "+y[x][v].toString()}).join(",")+`});
`}),m=m+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+f.main.map(function(x){return""+JSON.stringify(x)+": "+y.main[x].toString()}).join(",")+"}))(self);";var a=new window.Blob([m],{type:"text/javascript"});if(w.bare)return a;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,o=n.createObjectURL(a),u=new window.Worker(o);return u.objectURL=o,u}},"./src/config.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"hlsDefaultConfig",function(){return O}),P.d(K,"mergeConfig",function(){return p}),P.d(K,"enableStreamingMode",function(){return h});var z=P("./src/controller/abr-controller.ts"),B=P("./src/controller/audio-stream-controller.ts"),M=P("./src/controller/audio-track-controller.ts"),j=P("./src/controller/subtitle-stream-controller.ts"),U=P("./src/controller/subtitle-track-controller.ts"),_=P("./src/controller/buffer-controller.ts"),R=P("./src/controller/timeline-controller.ts"),c=P("./src/controller/cap-level-controller.ts"),g=P("./src/controller/fps-controller.ts"),w=P("./src/controller/eme-controller.ts"),y=P("./src/controller/cmcd-controller.ts"),f=P("./src/utils/xhr-loader.ts"),m=P("./src/utils/fetch-loader.ts"),a=P("./src/utils/cues.ts"),n=P("./src/utils/mediakeys-helper.ts"),o=P("./src/utils/logger.ts");function u(){return u=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var D=arguments[l];for(var T in D)Object.prototype.hasOwnProperty.call(D,T)&&(s[T]=D[T])}return s},u.apply(this,arguments)}function x(s,l){var D=Object.keys(s);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(s);l&&(T=T.filter(function(S){return Object.getOwnPropertyDescriptor(s,S).enumerable})),D.push.apply(D,T)}return D}function E(s){for(var l=1;l<arguments.length;l++){var D=arguments[l]!=null?arguments[l]:{};l%2?x(Object(D),!0).forEach(function(T){v(s,T,D[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(D)):x(Object(D)).forEach(function(T){Object.defineProperty(s,T,Object.getOwnPropertyDescriptor(D,T))})}return s}function v(s,l,D){return l in s?Object.defineProperty(s,l,{value:D,enumerable:!0,configurable:!0,writable:!0}):s[l]=D,s}var O=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:f.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:z.default,bufferController:_.default,capLevelController:c.default,fpsController:g.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},A()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:U.default,timelineController:R.TimelineController,audioStreamController:B.default,audioTrackController:M.default,emeController:w.default,cmcdController:y.default});function A(){return{cueHandler:a.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 p(s,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return u({},s,l)}function h(s){var l=s.loader;if(l!==m.default&&l!==f.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var D=Object(m.fetchSupported)();D&&(s.loader=m.default,s.progressive=!0,s.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/polyfills/number.ts"),B=P("./src/utils/ewma-bandwidth-estimator.ts"),M=P("./src/events.ts"),j=P("./src/utils/buffer-helper.ts"),U=P("./src/errors.ts"),_=P("./src/types/loader.ts"),R=P("./src/utils/logger.ts");function c(y,f){for(var m=0;m<f.length;m++){var a=f[m];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function g(y,f,m){return f&&c(y.prototype,f),m&&c(y,m),y}var w=function(){function y(m){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=m;var a=m.config;this.bwEstimator=new B.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var f=y.prototype;return f.registerListeners=function(){var a=this.hls;a.on(M.Events.FRAG_LOADING,this.onFragLoading,this),a.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(M.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off(M.Events.FRAG_LOADING,this.onFragLoading,this),a.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(M.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},f.onFragLoading=function(a,n){var o=n.frag;if(o.type===_.PlaylistLevelType.MAIN&&!this.timer){var u;this.fragCurrent=o,this.partCurrent=(u=n.part)!=null?u:null,this.timer=self.setInterval(this.onCheck,100)}},f.onLevelLoaded=function(a,n){var o=this.hls.config;n.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},f._abandonRulesCheck=function(){var a=this.fragCurrent,n=this.partCurrent,o=this.hls,u=o.autoLevelEnabled,x=o.config,E=o.media;if(!a||!E)return;var v=n?n.stats:a.stats,O=n?n.duration:a.duration;if(v.aborted){R.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!u||E.paused||!E.playbackRate||!E.readyState)return;var A=performance.now()-v.loading.start,p=Math.abs(E.playbackRate);if(A<=500*O/p)return;var h=o.levels,s=o.minAutoLevel,l=h[a.level],D=v.total||Math.max(v.loaded,Math.round(O*l.maxBitrate/8)),T=Math.max(1,v.bwEstimate?v.bwEstimate/8:v.loaded*1e3/A),S=(D-v.loaded)/T,I=E.currentTime,C=(j.BufferHelper.bufferInfo(E,I,x.maxBufferHole).end-I)/p;if(C>=2*O/p||S<=C)return;var W=Number.POSITIVE_INFINITY,Y;for(Y=a.level-1;Y>s;Y--){var H=h[Y].maxBitrate;if(W=O*H/(8*.8*T),W<C)break}if(W>=S)return;var F=this.bwEstimator.getEstimate();R.logger.warn("Fragment "+a.sn+(n?" part "+n.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Y+`
Current BW estimate: `+(Object(z.isFiniteNumber)(F)?(F/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+S.toFixed(3)+` s
Estimated load time for the next fragment: `+W.toFixed(3)+` s
Time to underbuffer: `+C.toFixed(3)+" s"),o.nextLoadLevel=Y,this.bwEstimator.sample(A,v.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),o.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:n,stats:v})},f.onFragLoaded=function(a,n){var o=n.frag,u=n.part;if(o.type===_.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(o.sn)){var x=u?u.stats:o.stats,E=u?u.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var v=this.hls.levels[o.level],O=(v.loaded?v.loaded.bytes:0)+x.loaded,A=(v.loaded?v.loaded.duration:0)+E;v.loaded={bytes:O,duration:A},v.realBitrate=Math.round(8*O/A)}if(o.bitrateTest){var p={stats:x,frag:o,part:u,id:o.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,p),o.bitrateTest=!1}}},f.onFragBuffered=function(a,n){var o=n.frag,u=n.part,x=u?u.stats:o.stats;if(x.aborted)return;if(o.type!==_.PlaylistLevelType.MAIN||o.sn==="initSegment")return;var E=x.parsing.end-x.loading.start;this.bwEstimator.sample(E,x.loaded),x.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},f.onError=function(a,n){switch(n.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},f.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},f.getNextABRAutoLevel=function(){var a=this.fragCurrent,n=this.partCurrent,o=this.hls,u=o.maxAutoLevel,x=o.config,E=o.minAutoLevel,v=o.media,O=n?n.duration:a?a.duration:0,A=v?v.currentTime:0,p=v&&v.playbackRate!==0?Math.abs(v.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():x.abrEwmaDefaultEstimate,s=(j.BufferHelper.bufferInfo(v,A,x.maxBufferHole).end-A)/p,l=this.findBestLevel(h,E,u,s,x.abrBandWidthFactor,x.abrBandWidthUpFactor);if(l>=0)return l;R.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var D=O?Math.min(O,x.maxStarvationDelay):x.maxStarvationDelay,T=x.abrBandWidthFactor,S=x.abrBandWidthUpFactor;if(!s){var I=this.bitrateTestDelay;if(I){var C=O?Math.min(O,x.maxLoadingDelay):x.maxLoadingDelay;D=C-I,R.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*D)+" ms"),T=S=1}}return l=this.findBestLevel(h,E,u,s+D,T,S),Math.max(l,0)},f.findBestLevel=function(a,n,o,u,x,E){for(var v,O=this.fragCurrent,A=this.partCurrent,p=this.lastLoadedFragLevel,h=this.hls.levels,s=h[p],l=!!(s!=null&&(v=s.details)!==null&&v!==void 0&&v.live),D=s==null?void 0:s.codecSet,T=A?A.duration:O?O.duration:0,S=o;S>=n;S--){var I=h[S];if(!I||D&&I.codecSet!==D)continue;var C=I.details,W=(A?C==null?void 0:C.partTarget:C==null?void 0:C.averagetargetduration)||T,Y=void 0;S<=p?Y=x*a:Y=E*a;var H=h[S].maxBitrate,F=H*W/Y;if(R.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+S+"/"+Math.round(Y)+"/"+H+"/"+W+"/"+u+"/"+F),Y>H&&(!F||l&&!this.bitrateTestDelay||F<u))return S}return-1},g(y,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,n=this.bwEstimator;if(a!==-1&&(!n||!n.canEstimate()))return a;var o=this.getNextABRAutoLevel();return a!==-1&&(o=Math.min(a,o)),o},set:function(a){this._nextAutoLevel=a}}]),y}();K.default=w},"./src/controller/audio-stream-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/polyfills/number.ts"),B=P("./src/controller/base-stream-controller.ts"),M=P("./src/events.ts"),j=P("./src/utils/buffer-helper.ts"),U=P("./src/controller/fragment-tracker.ts"),_=P("./src/types/level.ts"),R=P("./src/types/loader.ts"),c=P("./src/loader/fragment.ts"),g=P("./src/demux/chunk-cache.ts"),w=P("./src/demux/transmuxer-interface.ts"),y=P("./src/types/transmuxer.ts"),f=P("./src/controller/fragment-finders.ts"),m=P("./src/utils/discontinuities.ts"),a=P("./src/errors.ts"),n=P("./src/utils/logger.ts");function o(){return o=Object.assign||function(O){for(var A=1;A<arguments.length;A++){var p=arguments[A];for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(O[h]=p[h])}return O},o.apply(this,arguments)}function u(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,x(O,A)}function x(O,A){return x=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},x(O,A)}var E=100,v=function(O){u(A,O);function A(h,s){var l;return l=O.call(this,h,s,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var p=A.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var s=this.hls;s.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(M.Events.ERROR,this.onError,this),s.on(M.Events.BUFFER_RESET,this.onBufferReset,this),s.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p._unregisterListeners=function(){var s=this.hls;s.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(M.Events.ERROR,this.onError,this),s.off(M.Events.BUFFER_RESET,this.onBufferReset,this),s.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p.onInitPtsFound=function(s,l){var D=l.frag,T=l.id,S=l.initPTS;if(T==="main"){var I=D.cc;this.initPTS[D.cc]=S,this.log("InitPTS for cc: "+I+" found from main: "+S),this.videoTrackCC=I,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},p.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=B.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,l>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},p.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var s,l=this.levels,D=this.trackId,T=l==null||((s=l[D])===null||s===void 0)?void 0:s.details;if(T){if(this.waitForCdnTuneIn(T))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var S,I=performance.now(),C=this.retryDate;(!C||I>=C||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var Y=W.frag,H=W.part,F=W.cache,q=W.complete;if(this.initPTS[Y.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var le=F.flush(),pe={frag:Y,part:H,payload:le,networkDetails:null};this._handleFragmentLoadProgress(pe),q&&O.prototype._handleFragmentLoadComplete.call(this,pe)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+Y.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ae=this.getLoadPosition(),Ge=j.BufferHelper.bufferInfo(this.mediaBuffer,Ae,this.config.maxBufferHole),Fe=Object(f.fragmentWithinToleranceTest)(Ge.end,this.config.maxFragLookUpTolerance,Y);Fe<0&&(n.logger.log("Waiting fragment cc ("+Y.cc+") @ "+Y.start+" cancelled because another fragment at "+Ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},p.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},p.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:s,D=l.buffered;!this.loadedmetadata&&D.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},p.doTickIdle=function(){var s,l,D=this.hls,T=this.levels,S=this.media,I=this.trackId,C=D.config;if(!T||!T[I])return;if(!S&&(this.startFragRequested||!C.startFragPrefetch))return;var W=T[I],Y=W.details;if(!Y||Y.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(Y)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,R.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,R.PlaylistLevelType.AUDIO);if(H===null)return;var F=H.len,q=this.getMaxBufferLength(),le=this.audioSwitch;if(F>=q&&!le)return;if(!le&&this._streamEnded(H,Y)){D.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var pe=Y.fragments,Ae=pe[0].start,Ge=H.end;if(le){var Fe=this.getLoadPosition();Ge=Fe,Y.PTSKnown&&Fe<Ae&&((H.end>Ae||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),S.currentTime=Ae+.05))}var Ue=this.getNextFragment(Ge,Y);if(!Ue){this.bufferFlushed=!0;return}((s=Ue.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((l=Ue.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(Ue,Y):this.loadFragment(Ue,Y,Ge)},p.getMaxBufferLength=function(){var s=O.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,R.PlaylistLevelType.MAIN);return l===null?s:Math.max(s,l.len)},p.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},p.onAudioTracksUpdated=function(s,l){var D=l.audioTracks;this.resetTransmuxer(),this.levels=D.map(function(T){return new _.Level(T)})},p.onAudioTrackSwitching=function(s,l){var D=!!l.url;this.trackId=l.id;var T=this.fragCurrent;T!=null&&T.loader&&T.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),D?this.setInterval(E):this.resetTransmuxer(),D?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},p.onLevelLoaded=function(s,l){this.mainDetails=l.details},p.onAudioTrackLoaded=function(s,l){var D,T=this.levels,S=l.details,I=l.id;if(!T){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+S.startSN+","+S.endSN+"],duration:"+S.totalduration);var C=T[I],W=0;if(S.live||(D=C.details)!==null&&D!==void 0&&D.live){var Y=this.mainDetails;if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed||!Y)return;!C.details&&S.hasProgramDateTime&&Y.hasProgramDateTime?(Object(m.alignMediaPlaylistByPDT)(S,Y),W=S.fragments[0].start):W=this.alignPlaylists(S,C.details)}C.details=S,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!S.live)&&this.setStartPosition(C.details,W),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(S)&&(this.state=B.State.IDLE),this.tick()},p._handleFragmentLoadProgress=function(s){var l,D=s.frag,T=s.part,S=s.payload,I=this.config,C=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+D.sn+" of level "+D.level+" will not be buffered");return}var Y=W[C];console.assert(Y,"Audio track is defined on fragment load progress");var H=Y.details;console.assert(H,"Audio track details are defined on fragment load progress");var F=I.defaultAudioCodec||Y.audioCodec||"mp4a.40.2",q=this.transmuxer;q||(q=this.transmuxer=new w.default(this.hls,R.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var le=this.initPTS[D.cc],pe=(l=D.initSegment)===null||l===void 0?void 0:l.data;if(le!==void 0){var Ae=!1,Ge=T?T.index:-1,Fe=Ge!==-1,Ue=new y.ChunkMetadata(D.level,D.sn,D.stats.chunkCount,S.byteLength,Ge,Fe);q.push(S,pe,F,"",D,T,H.totalduration,Ae,Ue,le)}else{n.logger.log("Unknown video PTS for cc "+D.cc+", waiting for video PTS before demuxing audio frag "+D.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+C);var _e=this.waitingData=this.waitingData||{frag:D,part:T,cache:new g.default,complete:!1},je=_e.cache;je.push(new Uint8Array(S)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},p._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,s)},p.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},p.onBufferCreated=function(s,l){var D=l.tracks.audio;D&&(this.mediaBuffer=D.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},p.onFragBuffered=function(s,l){var D=l.frag,T=l.part;if(D.type!==R.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(D)){this.warn("Fragment "+D.sn+(T?" p: "+T.index:"")+" of level "+D.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}D.sn!=="initSegment"&&(this.fragPrevious=D,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(D,T)},p.onError=function(s,l){switch(l.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.AUDIO,l);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=l.fatal?B.State.ERROR:B.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var D=!0,T=this.getFwdBufferInfo(this.mediaBuffer,R.PlaylistLevelType.AUDIO);T&&T.len>.5&&(D=!this.reduceMaxBufferLength(T.len)),D&&(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}},p.onBufferFlushed=function(s,l){var D=l.type;D===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},p._handleTransmuxComplete=function(s){var l,D="audio",T=this.hls,S=s.remuxResult,I=s.chunkMeta,C=this.getCurrentContext(I);if(!C){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var W=C.frag,Y=C.part,H=S.audio,F=S.text,q=S.id3,le=S.initSegment;if(this.fragContextChanged(W))return;if(this.state=B.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),le!=null&&le.tracks&&(this._bufferInitSegment(le.tracks,W,I),T.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:D,tracks:le.tracks})),H){var pe=H.startPTS,Ae=H.endPTS,Ge=H.startDTS,Fe=H.endDTS;Y&&(Y.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:pe,endPTS:Ae,startDTS:Ge,endDTS:Fe}),W.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,pe,Ae,Ge,Fe),this.bufferFragmentData(H,W,Y,I)}if(q!=null&&(l=q.samples)!==null&&l!==void 0&&l.length){var Ue=o({frag:W,id:D},q);T.trigger(M.Events.FRAG_PARSING_METADATA,Ue)}if(F){var _e=o({frag:W,id:D},F);T.trigger(M.Events.FRAG_PARSING_USERDATA,_e)}},p._bufferInitSegment=function(s,l,D){if(this.state!==B.State.PARSING)return;s.video&&delete s.video;var T=s.audio;if(!T)return;T.levelCodec=T.codec,T.id="audio",this.log("Init audio buffer, container:"+T.container+", codecs[parsed]=["+T.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,s);var S=T.initSegment;if(S!=null&&S.byteLength){var I={type:"audio",frag:l,part:null,chunkMeta:D,parent:l.type,data:S};this.hls.trigger(M.Events.BUFFER_APPENDING,I)}this.tick()},p.loadFragment=function(s,l,D){var T=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||T===U.FragmentState.NOT_LOADED||T===U.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):l.live&&!Object(z.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,s,l,D)))},p.completeAudioSwitch=function(){var s=this.hls,l=this.media,D=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:D})},A}(B.default);K.default=v},"./src/controller/audio-track-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts"),B=P("./src/errors.ts"),M=P("./src/controller/base-playlist-controller.ts"),j=P("./src/types/loader.ts");function U(w,y){for(var f=0;f<y.length;f++){var m=y[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(w,m.key,m)}}function _(w,y,f){return y&&U(w.prototype,y),f&&U(w,f),w}function R(w,y){w.prototype=Object.create(y.prototype),w.prototype.constructor=w,c(w,y)}function c(w,y){return c=Object.setPrototypeOf||function(m,a){return m.__proto__=a,m},c(w,y)}var g=function(w){R(y,w);function y(m){var a;return a=w.call(this,m,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var f=y.prototype;return f.registerListeners=function(){var a=this.hls;a.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(z.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var a=this.hls;a.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(z.Events.ERROR,this.onError,this)},f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,w.prototype.destroy.call(this)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},f.onManifestParsed=function(a,n){this.tracks=n.audioTracks||[]},f.onAudioTrackLoaded=function(a,n){var o=n.id,u=n.details,x=this.tracksInGroup[o];if(!x){this.warn("Invalid audio track id "+o);return}var E=x.details;x.details=n.details,this.log("audioTrack "+o+" loaded ["+u.startSN+"-"+u.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,n,E))},f.onLevelLoading=function(a,n){this.switchLevel(n.level)},f.onLevelSwitching=function(a,n){this.switchLevel(n.level)},f.switchLevel=function(a){var n=this.hls.levels[a];if(!(n!=null&&n.audioGroupIds))return;var o=n.audioGroupIds[n.urlId];if(this.groupId!==o){this.groupId=o;var u=this.tracks.filter(function(E){return!o||E.groupId===o});this.selectDefaultTrack&&!u.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=u;var x={audioTracks:u};this.log("Updating audio tracks, "+u.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,x),this.selectInitialTrack()}},f.onError=function(a,n){if(w.prototype.onError.call(this,a,n),n.fatal||!n.context)return;n.context.type===j.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},f.setAudioTrack=function(a){var n=this.tracksInGroup;if(a<0||a>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=n[this.trackId];this.log("Now switching to audio-track index "+a);var u=n[a],x=u.id,E=u.groupId,v=E===void 0?"":E,O=u.name,A=u.type,p=u.url;if(this.trackId=a,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:x,groupId:v,name:O,type:A,url:p}),u.details&&!u.details.live)return;var h=this.switchParams(u.url,o==null?void 0:o.details);this.loadPlaylist(h)},f.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,o=this.findTrackId(n)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},f.findTrackId=function(a){for(var n=this.tracksInGroup,o=0;o<n.length;o++){var u=n[o];if((!this.selectDefaultTrack||u.default)&&(!a||a===u.name))return u.id}return-1},f.loadPlaylist=function(a){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var o=n.id,u=n.groupId,x=n.url;if(a)try{x=a.addDirectives(x)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("loading audio-track playlist for id: "+o),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:x,id:o,groupId:u,deliveryDirectives:a||null})}},_(y,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),y}(M.default);K.default=g},"./src/controller/base-playlist-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return _});var z=P("./src/polyfills/number.ts"),B=P("./src/types/level.ts"),M=P("./src/controller/level-helper.ts"),j=P("./src/utils/logger.ts"),U=P("./src/errors.ts"),_=function(){function R(g,w){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,w+":"),this.warn=j.logger.warn.bind(j.logger,w+":"),this.hls=g}var c=R.prototype;return c.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},c.onError=function(w,y){y.fatal&&y.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},c.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},c.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},c.stopLoad=function(){this.canLoad=!1,this.clearTimer()},c.switchParams=function(w,y){var f=y==null?void 0:y.renditionReports;if(f)for(var m=0;m<f.length;m++){var a=f[m],n=""+a.URI;if(n===w.substr(-n.length)){var o=parseInt(a["LAST-MSN"]),u=parseInt(a["LAST-PART"]);if(y&&this.hls.config.lowLatencyMode){var x=Math.min(y.age-y.partTarget,y.targetduration);u!==void 0&&x>y.partTarget&&(u+=1)}if(Object(z.isFiniteNumber)(o))return new B.HlsUrlParameters(o,Object(z.isFiniteNumber)(u)?u:void 0,B.HlsSkip.No)}}},c.loadPlaylist=function(w){},c.shouldLoadTrack=function(w){return this.canLoad&&w&&!!w.url&&(!w.details||w.details.live)},c.playlistLoaded=function(w,y,f){var m=this,a=y.details,n=y.stats,o=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(a.advancedDateTime=Date.now()-o,a.live||f!=null&&f.live){if(a.reloaded(f),f&&this.log("live playlist "+w+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),f&&a.fragments.length>0&&Object(M.mergeDetails)(f,a),!this.canLoad||!a.live)return;var u,x=void 0,E=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var v=this.hls.config.lowLatencyMode,O=a.lastPartSn,A=a.endSN,p=a.lastPartIndex,h=p!==-1,s=O===A,l=v?0:p;h?(x=s?A+1:O,E=s?l:p+1):x=A+1;var D=a.age,T=D+a.ageHeader,S=Math.min(T-a.partTarget,a.targetduration*1.5);if(S>0){if(f&&S>f.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+f.tuneInGoal+" to: "+S+" with playlist age: "+a.age),S=0;else{var I=Math.floor(S/a.targetduration);if(x+=I,E!==void 0){var C=Math.round(S%a.targetduration/a.partTarget);E+=C}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+D.toFixed(2)+"s goal: "+S+" skip sn "+I+" to part "+E)}a.tuneInGoal=S}if(u=this.getDeliveryDirectives(a,y.deliveryDirectives,x,E),v||!s){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(a,y.deliveryDirectives,x,E);var W=Object(M.computeReloadInterval)(a,n);x!==void 0&&a.canBlockReload&&(W-=a.partTarget||1),this.log("reload live playlist "+w+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return m.loadPlaylist(u)},W)}else this.clearTimer()},c.getDeliveryDirectives=function(w,y,f,m){var a=Object(B.getSkipValue)(w,f);return y!=null&&y.skip&&w.deltaUpdateFailed&&(f=y.msn,m=y.part,a=B.HlsSkip.No),new B.HlsUrlParameters(f,m,a)},c.retryLoadingOrFail=function(w){var y=this,f=this.hls.config,m=this.retryCount<f.levelLoadingMaxRetry;if(m){var a;if(this.retryCount++,w.details.indexOf("LoadTimeOut")>-1&&(a=w.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+w.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*f.levelLoadingRetryDelay,f.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return y.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+w.details+'"')}}else this.warn('cannot recover from error "'+w.details+'"'),this.clearTimer(),w.fatal=!0;return m},R}()},"./src/controller/base-stream-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"State",function(){return A}),P.d(K,"default",function(){return p});var z=P("./src/polyfills/number.ts"),B=P("./src/task-loop.ts"),M=P("./src/controller/fragment-tracker.ts"),j=P("./src/utils/buffer-helper.ts"),U=P("./src/utils/logger.ts"),_=P("./src/events.ts"),R=P("./src/errors.ts"),c=P("./src/types/transmuxer.ts"),g=P("./src/utils/mp4-tools.ts"),w=P("./src/utils/discontinuities.ts"),y=P("./src/controller/fragment-finders.ts"),f=P("./src/controller/level-helper.ts"),m=P("./src/loader/fragment-loader.ts"),a=P("./src/crypt/decrypter.ts"),n=P("./src/utils/time-ranges.ts"),o=P("./src/types/loader.ts");function u(h,s){for(var l=0;l<s.length;l++){var D=s[l];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(h,D.key,D)}}function x(h,s,l){return s&&u(h.prototype,s),l&&u(h,l),h}function E(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function v(h,s){h.prototype=Object.create(s.prototype),h.prototype.constructor=h,O(h,s)}function O(h,s){return O=Object.setPrototypeOf||function(D,T){return D.__proto__=T,D},O(h,s)}var A={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},p=function(h){v(s,h);function s(D,T,S){var I;return I=h.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=A.STOPPED,I.media=void 0,I.mediaBuffer=void 0,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=S,I.log=U.logger.log.bind(U.logger,S+":"),I.warn=U.logger.warn.bind(U.logger,S+":"),I.hls=D,I.fragmentLoader=new m.default(D.config),I.fragmentTracker=T,I.config=D.config,I.decrypter=new a.default(D,D.config),D.on(_.Events.KEY_LOADED,I.onKeyLoaded,E(I)),I}var l=s.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(T){},l.stopLoad=function(){this.fragmentLoader.abort();var T=this.fragCurrent;T&&this.fragmentTracker.removeFragment(T),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=A.STOPPED},l._streamEnded=function(T,S){var I=this.fragCurrent,C=this.fragmentTracker;if(!S.live&&I&&I.sn===S.endSN&&!T.nextStart){var W=C.getState(I);return W===M.FragmentState.PARTIAL||W===M.FragmentState.OK}return!1},l.onMediaAttached=function(T,S){var I=this.media=this.mediaBuffer=S.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),I.addEventListener("seeking",this.onvseeking),I.addEventListener("ended",this.onvended);var C=this.config;this.levels&&C.autoStartLoad&&this.state===A.STOPPED&&this.startLoad(C.startPosition)},l.onMediaDetaching=function(){var T=this.media;T!=null&&T.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),T&&(T.removeEventListener("seeking",this.onvseeking),T.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},l.onMediaSeeking=function(){var T=this.config,S=this.fragCurrent,I=this.media,C=this.mediaBuffer,W=this.state,Y=I?I.currentTime:0,H=j.BufferHelper.bufferInfo(C||I,Y,T.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(Y)?Y.toFixed(3):Y)+", state: "+W),W===A.ENDED)this.resetLoadingState();else if(S&&!H.len){var F=T.maxFragLookUpTolerance,q=S.start-F,le=S.start+S.duration+F,pe=Y>le;(Y<q||pe)&&(pe&&S.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),S.loader.abort()),this.resetLoadingState())}I&&(this.lastCurrentTime=Y),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=Y),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(T,S){if(this.state!==A.KEY_LOADING||S.frag!==this.fragCurrent||!this.levels)return;this.state=A.IDLE;var I=this.levels[S.frag.level].details;I&&this.loadFragment(S.frag,I,S.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),h.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=A.STOPPED,this.hls.off(_.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,h.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(T,S){this.log("Loading key for "+T.sn+" of ["+S.startSN+"-"+S.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level),this.state=A.KEY_LOADING,this.fragCurrent=T,this.hls.trigger(_.Events.KEY_LOADING,{frag:T})},l.loadFragment=function(T,S,I){this._loadFragForPlayback(T,S,I)},l._loadFragForPlayback=function(T,S,I){var C=this,W=function(H){if(C.fragContextChanged(T)){C.warn("Fragment "+T.sn+(H.part?" p: "+H.part.index:"")+" of level "+T.level+" was dropped during download."),C.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,C._handleFragmentLoadProgress(H)};this._doFragLoad(T,S,I,W).then(function(Y){if(!Y)return;C.fragLoadError=0;var H=C.state;if(C.fragContextChanged(T)){(H===A.FRAG_LOADING||H===A.BACKTRACKING||!C.fragCurrent&&H===A.PARSING)&&(C.fragmentTracker.removeFragment(T),C.state=A.IDLE);return}if("payload"in Y&&(C.log("Loaded fragment "+T.sn+" of level "+T.level),C.hls.trigger(_.Events.FRAG_LOADED,Y),C.state===A.BACKTRACKING)){C.fragmentTracker.backtrack(T,Y),C.resetFragmentLoading(T);return}C._handleFragmentLoadComplete(Y)}).catch(function(Y){C.warn(Y),C.resetFragmentLoading(T)})},l.flushMainBuffer=function(T,S,I){if(I===void 0&&(I=null),!(T-S))return;var C={startOffset:T,endOffset:S,type:I};this.fragLoadError=0,this.hls.trigger(_.Events.BUFFER_FLUSHING,C)},l._loadInitSegment=function(T){var S=this;this._doFragLoad(T).then(function(I){if(!I||S.fragContextChanged(T)||!S.levels)throw new Error("init load aborted");return I}).then(function(I){var C=S.hls,W=I.payload,Y=T.decryptdata;if(W&&W.byteLength>0&&Y&&Y.key&&Y.iv&&Y.method==="AES-128"){var H=self.performance.now();return S.decrypter.webCryptoDecrypt(new Uint8Array(W),Y.key.buffer,Y.iv.buffer).then(function(F){var q=self.performance.now();return C.trigger(_.Events.FRAG_DECRYPTED,{frag:T,payload:F,stats:{tstart:H,tdecrypt:q}}),I.payload=F,I})}return I}).then(function(I){var C=S.fragCurrent,W=S.hls,Y=S.levels;if(!Y)throw new Error("init load aborted, missing levels");var H=Y[T.level].details;console.assert(H,"Level details are defined when init segment is loaded");var F=T.stats;S.state=A.IDLE,S.fragLoadError=0,T.data=new Uint8Array(I.payload),F.parsing.start=F.buffering.start=self.performance.now(),F.parsing.end=F.buffering.end=self.performance.now(),I.frag===C&&W.trigger(_.Events.FRAG_BUFFERED,{stats:F,frag:C,part:null,id:T.type}),S.tick()}).catch(function(I){S.warn(I),S.resetFragmentLoading(T)})},l.fragContextChanged=function(T){var S=this.fragCurrent;return!T||!S||T.level!==S.level||T.sn!==S.sn||T.urlId!==S.urlId},l.fragBufferedComplete=function(T,S){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+T.type+" sn: "+T.sn+(S?" part: "+S.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level+" "+n.default.toString(j.BufferHelper.getBuffered(I))),this.state=A.IDLE,this.tick()},l._handleFragmentLoadComplete=function(T){var S=this.transmuxer;if(!S)return;var I=T.frag,C=T.part,W=T.partsLoaded,Y=!W||W.length===0||W.some(function(F){return!F}),H=new c.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,C?C.index:-1,!Y);S.flush(H)},l._handleFragmentLoadProgress=function(T){},l._doFragLoad=function(T,S,I,C){var W=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(T.start,I||0),this.config.lowLatencyMode&&S){var Y=S.partList;if(Y&&C){I>T.end&&S.fragmentHint&&(T=S.fragmentHint);var H=this.getNextPart(Y,T,I);if(H>-1){var F=Y[H];return this.log("Loading part sn: "+T.sn+" p: "+F.index+" cc: "+T.cc+" of playlist ["+S.startSN+"-"+S.endSN+"] parts [0-"+H+"-"+(Y.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=A.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:T,part:Y[H],targetBufferTime:I}),this.doFragPartsLoad(T,Y,H,C).catch(function(q){return W.handleFragLoadError(q)})}else if(!T.url||this.loadedEndOfParts(Y,I))return Promise.resolve(null)}}return this.log("Loading fragment "+T.sn+" cc: "+T.cc+" "+(S?"of ["+S.startSN+"-"+S.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(I.toFixed(3))),Object(z.isFiniteNumber)(T.sn)&&!this.bitrateTest&&(this.nextLoadPosition=T.start+T.duration),this.state=A.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:T,targetBufferTime:I}),this.fragmentLoader.load(T,C).catch(function(q){return W.handleFragLoadError(q)})},l.doFragPartsLoad=function(T,S,I,C){var W=this;return new Promise(function(Y,H){var F=[],q=function le(pe){var Ae=S[pe];W.fragmentLoader.loadPart(T,Ae,C).then(function(Ge){F[Ae.index]=Ge;var Fe=Ge.part;W.hls.trigger(_.Events.FRAG_LOADED,Ge);var Ue=S[pe+1];if(Ue&&Ue.fragment===T)le(pe+1);else return Y({frag:T,part:Fe,partsLoaded:F})}).catch(H)};q(I)})},l.handleFragLoadError=function(T){var S=T.data;return S&&S.details===R.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(S.frag,S.part):this.hls.trigger(_.Events.ERROR,S),null},l._handleTransmuxerFlush=function(T){var S=this.getCurrentContext(T);if(!S||this.state!==A.PARSING){this.fragCurrent||(this.state=A.IDLE);return}var I=S.frag,C=S.part,W=S.level,Y=self.performance.now();I.stats.parsing.end=Y,C&&(C.stats.parsing.end=Y),this.updateLevelTiming(I,C,W,T.partial)},l.getCurrentContext=function(T){var S=this.levels,I=T.level,C=T.sn,W=T.part;if(!S||!S[I])return this.warn("Levels object was unset while buffering fragment "+C+" of level "+I+". The current chunk will not be buffered."),null;var Y=S[I],H=W>-1?Object(f.getPartWith)(Y,C,W):null,F=H?H.fragment:Object(f.getFragmentWithSN)(Y,C,this.fragCurrent);return F?{frag:F,part:H,level:Y}:null},l.bufferFragmentData=function(T,S,I,C){if(!T||this.state!==A.PARSING)return;var W=T.data1,Y=T.data2,H=W;if(W&&Y&&(H=Object(g.appendUint8Array)(W,Y)),!H||!H.length)return;var F={type:T.type,frag:S,part:I,chunkMeta:C,parent:S.type,data:H};this.hls.trigger(_.Events.BUFFER_APPENDING,F),T.dropped&&T.independent&&!I&&this.flushBufferGap(S)},l.flushBufferGap=function(T){var S=this.media;if(!S)return;if(!j.BufferHelper.isBuffered(S,S.currentTime)){this.flushMainBuffer(0,T.start);return}var I=S.currentTime,C=j.BufferHelper.bufferInfo(S,I,0),W=T.duration,Y=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),H=Math.max(Math.min(T.start-Y,C.end-Y),I+Y);T.start-H>Y&&this.flushMainBuffer(H,T.start)},l.getFwdBufferInfo=function(T,S){var I=this.config,C=this.getLoadPosition();if(!Object(z.isFiniteNumber)(C))return null;var W=j.BufferHelper.bufferInfo(T,C,I.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var Y=this.fragmentTracker.getBufferedFrag(C,S);if(Y&&W.nextStart<Y.end)return j.BufferHelper.bufferInfo(T,C,Math.max(W.nextStart,I.maxBufferHole))}return W},l.getMaxBufferLength=function(T){var S=this.config,I;return T?I=Math.max(8*S.maxBufferSize/T,S.maxBufferLength):I=S.maxBufferLength,Math.min(I,S.maxMaxBufferLength)},l.reduceMaxBufferLength=function(T){var S=this.config,I=T||S.maxBufferLength;return S.maxMaxBufferLength>=I?(S.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+S.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(T,S){var I,C,W=S.fragments,Y=W.length;if(!Y)return null;var H=this.config,F=W[0].start,q;if(S.live){var le=H.initialLiveManifestSize;if(Y<le)return this.warn("Not enough fragments to start playback (have: "+Y+", need: "+le+")"),null;!S.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(q=this.getInitialLiveFragment(S,W),this.startPosition=q?this.hls.liveSyncPosition||q.start:T)}else T<=F&&(q=W[0]);if(!q){var pe=H.lowLatencyMode?S.partEnd:S.fragmentEnd;q=this.getFragmentAtPosition(T,pe,S)}return(I=q)!==null&&I!==void 0&&I.initSegment&&!((C=q)!==null&&C!==void 0&&C.initSegment.data)&&!this.bitrateTest&&(q=q.initSegment),q},l.getNextPart=function(T,S,I){for(var C=-1,W=!1,Y=!0,H=0,F=T.length;H<F;H++){var q=T[H];if(Y=Y&&!q.independent,C>-1&&I<q.start)break;var le=q.loaded;!le&&(W||q.independent||Y)&&q.fragment===S&&(C=H),W=le}return C},l.loadedEndOfParts=function(T,S){var I=T[T.length-1];return I&&S>I.start&&I.loaded},l.getInitialLiveFragment=function(T,S){var I=this.fragPrevious,C=null;if(I){if(T.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),C=Object(y.findFragmentByPDT)(S,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!C){var W=I.sn+1;if(W>=T.startSN&&W<=T.endSN){var Y=S[W-T.startSN];I.cc===Y.cc&&(C=Y,this.log("Live playlist, switching playlist, load frag with next SN: "+C.sn))}C||(C=Object(y.findFragWithCC)(S,I.cc),C&&this.log("Live playlist, switching playlist, load frag with same CC: "+C.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(C=this.getFragmentAtPosition(H,this.bitrateTest?T.fragmentEnd:T.edge,T))}return C},l.getFragmentAtPosition=function(T,S,I){var C=this.config,W=this.fragPrevious,Y=I.fragments,H=I.endSN,F=I.fragmentHint,q=C.maxFragLookUpTolerance,le=!!(C.lowLatencyMode&&I.partList&&F);le&&F&&!this.bitrateTest&&(Y=Y.concat(F),H=F.sn);var pe;if(T<S){var Ae=T>S-q?0:q;pe=Object(y.findFragmentByPTS)(W,Y,T,Ae)}else pe=Y[Y.length-1];if(pe){var Ge=pe.sn-I.startSN,Fe=W&&pe.level===W.level,Ue=Y[Ge+1],_e=this.fragmentTracker.getState(pe);if(_e===M.FragmentState.BACKTRACKED){pe=null;for(var je=Ge;Y[je]&&this.fragmentTracker.getState(Y[je])===M.FragmentState.BACKTRACKED;)W?pe=Y[je--]:pe=Y[--je];pe||(pe=Ue)}else W&&pe.sn===W.sn&&!le&&(Fe&&(pe.sn<H&&this.fragmentTracker.getState(Ue)!==M.FragmentState.OK?(this.log("SN "+pe.sn+" just loaded, load next one: "+Ue.sn),pe=Ue):pe=null))}return pe},l.synchronizeToLiveEdge=function(T){var S=this.config,I=this.media;if(!I)return;var C=this.hls.liveSyncPosition,W=I.currentTime,Y=T.fragments[0].start,H=T.edge,F=W>=Y-S.maxFragLookUpTolerance&&W<=H;if(C!==null&&I.duration>C&&(W<C||!F)){var q=S.liveMaxLatencyDuration!==void 0?S.liveMaxLatencyDuration:S.liveMaxLatencyDurationCount*T.targetduration;(!F&&I.readyState<4||W<H-q)&&(this.loadedmetadata||(this.nextLoadPosition=C),I.readyState&&(this.warn("Playback: "+W.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+C.toFixed(3)),I.currentTime=C))}},l.alignPlaylists=function(T,S){var I=this.levels,C=this.levelLastLoaded,W=this.fragPrevious,Y=C!==null?I[C]:null,H=T.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var F=T.fragments[0].start,q=!S,le=T.alignedSliding&&Object(z.isFiniteNumber)(F);if(q||!le&&!F){Object(w.alignStream)(W,Y,T);var pe=T.fragments[0].start;return this.log("Live playlist sliding: "+pe.toFixed(2)+" start-sn: "+(S?S.startSN:"na")+"->"+T.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+H),pe}return F},l.waitForCdnTuneIn=function(T){var S=3;return T.live&&T.canBlockReload&&T.tuneInGoal>Math.max(T.partHoldBack,T.partTarget*S)},l.setStartPosition=function(T,S){var I=this.startPosition;if(I<S&&(I=-1),I===-1||this.lastCurrentTime===-1){var C=T.startTimeOffset;Object(z.isFiniteNumber)(C)?(I=S+C,C<0&&(I+=T.totalduration),I=Math.min(Math.max(S,I),S+T.totalduration),this.log("Start time offset "+C+" found in playlist, adjust startPosition to "+I),this.startPosition=I):T.live?I=this.hls.liveSyncPosition||S:this.startPosition=I=0,this.lastCurrentTime=I}this.nextLoadPosition=I},l.getLoadPosition=function(){var T=this.media,S=0;return this.loadedmetadata&&T?S=T.currentTime:this.nextLoadPosition&&(S=this.nextLoadPosition),S},l.handleFragLoadAborted=function(T,S){this.transmuxer&&T.sn!=="initSegment"&&T.stats.aborted&&(this.warn("Fragment "+T.sn+(S?" part"+S.index:"")+" of level "+T.level+" was aborted"),this.resetFragmentLoading(T))},l.resetFragmentLoading=function(T){(!this.fragCurrent||!this.fragContextChanged(T))&&(this.state=A.IDLE)},l.onFragmentOrKeyLoadError=function(T,S){if(S.fatal)return;var I=S.frag;if(!I||I.type!==T)return;var C=this.fragCurrent;console.assert(C&&I.sn===C.sn&&I.level===C.level&&I.urlId===C.urlId,"Frag load error must match current frag to retry");var W=this.config;if(this.fragLoadError+1<=W.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(I.level))return;var Y=Math.min(Math.pow(2,this.fragLoadError)*W.fragLoadingRetryDelay,W.fragLoadingMaxRetryTimeout);this.warn("Fragment "+I.sn+" of "+T+" "+I.level+" failed to load, retrying in "+Y+"ms"),this.retryDate=self.performance.now()+Y,this.fragLoadError++,this.state=A.FRAG_LOADING_WAITING_RETRY}else S.levelRetry?(T===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=A.IDLE):(U.logger.error(S.details+" reaches max retry, redispatch as fatal ..."),S.fatal=!0,this.hls.stopLoad(),this.state=A.ERROR)},l.afterBufferFlushed=function(T,S,I){if(!T)return;var C=j.BufferHelper.getBuffered(T);this.fragmentTracker.detectEvictedFragments(S,C,I),this.state===A.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=A.IDLE},l.resetLiveStartWhenNotLoaded=function(T){if(!this.loadedmetadata){this.startFragRequested=!1;var S=this.levels?this.levels[T].details:null;if(S!=null&&S.live)return this.startPosition=-1,this.setStartPosition(S,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(T,S,I,C){var W=this,Y=I.details;console.assert(!!Y,"level.details must be defined");var H=Object.keys(T.elementaryStreams).reduce(function(F,q){var le=T.elementaryStreams[q];if(le){var pe=le.endPTS-le.startPTS;if(pe<=0)return W.warn("Could not parse fragment "+T.sn+" "+q+" duration reliably ("+pe+") resetting transmuxer to fallback to playlist timing"),W.resetTransmuxer(),F||!1;var Ae=C?0:Object(f.updateFragPTSDTS)(Y,T,le.startPTS,le.endPTS,le.startDTS,le.endDTS);return W.hls.trigger(_.Events.LEVEL_PTS_UPDATED,{details:Y,level:I,drift:Ae,type:q,frag:T,start:le.startPTS,end:le.endPTS}),!0}return F},!1);H?(this.state=A.PARSED,this.hls.trigger(_.Events.FRAG_PARSED,{frag:T,part:S})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x(s,[{key:"state",get:function(){return this._state},set:function(T){var S=this._state;S!==T&&(this._state=T,this.log(S+"->"+T))}}]),s}(B.default)},"./src/controller/buffer-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return y});var z=P("./src/polyfills/number.ts"),B=P("./src/events.ts"),M=P("./src/utils/logger.ts"),j=P("./src/errors.ts"),U=P("./src/utils/buffer-helper.ts"),_=P("./src/utils/mediasource-helper.ts"),R=P("./src/loader/fragment.ts"),c=P("./src/controller/buffer-operation-queue.ts"),g=Object(_.getMediaSource)(),w=/([ha]vc.)(?:\.[^.,]+)+/,y=function(){function f(a){var n=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 o=n.hls,u=n.media,x=n.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),u&&(n.updateMediaElementDuration(),o.trigger(B.Events.MEDIA_ATTACHED,{media:u})),x&&x.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var m=f.prototype;return m.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},m.destroy=function(){this.unregisterListeners(),this.details=null},m.registerListeners=function(){var n=this.hls;n.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(B.Events.BUFFER_RESET,this.onBufferReset,this),n.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(B.Events.BUFFER_EOS,this.onBufferEos,this),n.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(B.Events.FRAG_PARSED,this.onFragParsed,this),n.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},m.unregisterListeners=function(){var n=this.hls;n.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(B.Events.BUFFER_RESET,this.onBufferReset,this),n.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(B.Events.BUFFER_EOS,this.onBufferEos,this),n.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(B.Events.FRAG_PARSED,this.onFragParsed,this),n.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},m._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},m.onManifestParsed=function(n,o){var u=2;(o.audio&&!o.video||!o.altAudio)&&(u=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=u,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},m.onMediaAttaching=function(n,o){var u=this.media=o.media;if(u&&g){var x=this.mediaSource=new g;x.addEventListener("sourceopen",this._onMediaSourceOpen),x.addEventListener("sourceended",this._onMediaSourceEnded),x.addEventListener("sourceclose",this._onMediaSourceClose),u.src=self.URL.createObjectURL(x),this._objectUrl=u.src}},m.onMediaDetaching=function(){var n=this.media,o=this.mediaSource,u=this._objectUrl;if(o){if(M.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(x){M.logger.warn("[buffer-controller]: onMediaDetaching: "+x.message+" while calling endOfStream")}this.onBufferReset(),o.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("sourceended",this._onMediaSourceEnded),o.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(u&&self.URL.revokeObjectURL(u),n.src===u?(n.removeAttribute("src"),n.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(B.Events.MEDIA_DETACHED,void 0)},m.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(o){var u=n.sourceBuffer[o];try{u&&(n.removeBufferListeners(o),n.mediaSource&&n.mediaSource.removeSourceBuffer(u),n.sourceBuffer[o]=void 0)}catch(x){M.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",x)}}),this._initSourceBuffer()},m.onBufferCodecs=function(n,o){var u=this,x=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(E){if(x){var v=u.tracks[E];if(v&&typeof v.buffer.changeType=="function"){var O=o[E],A=O.codec,p=O.levelCodec,h=O.container,s=(v.levelCodec||v.codec).replace(w,"$1"),l=(p||A).replace(w,"$1");if(s!==l){var D=h+";codecs="+(p||A);u.appendChangeType(E,D)}}}else u.pendingTracks[E]=o[E]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},m.appendChangeType=function(n,o){var u=this,x=this.operationQueue,E={execute:function(){var O=u.sourceBuffer[n];O&&(M.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+o),O.changeType(o)),x.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(O){M.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",O)}};x.append(E,n)},m.onBufferAppending=function(n,o){var u=this,x=this.hls,E=this.operationQueue,v=this.tracks,O=o.data,A=o.type,p=o.frag,h=o.part,s=o.chunkMeta,l=s.buffering[A],D=self.performance.now();l.start=D;var T=p.stats.buffering,S=h?h.stats.buffering:null;T.start===0&&(T.start=D),S&&S.start===0&&(S.start=D);var I=v.audio,C=A==="audio"&&s.id===1&&(I==null?void 0:I.container)==="audio/mpeg",W={execute:function(){if(l.executeStart=self.performance.now(),C){var H=u.sourceBuffer[A];if(H){var F=p.start-H.timestampOffset;Math.abs(F)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+p.start+" (delta: "+F+") sn: "+p.sn+")"),H.timestampOffset=p.start)}}u.appendExecutor(O,A)},onStart:function(){},onComplete:function(){var H=self.performance.now();l.executeEnd=l.end=H,T.first===0&&(T.first=H),S&&S.first===0&&(S.first=H);var F=u.sourceBuffer,q={};for(var le in F)q[le]=U.BufferHelper.getBuffered(F[le]);u.appendError=0,u.hls.trigger(B.Events.BUFFER_APPENDED,{type:A,frag:p,part:h,chunkMeta:s,parent:p.type,timeRanges:q})},onError:function(H){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+A+" SourceBuffer",H);var F={type:j.ErrorTypes.MEDIA_ERROR,parent:p.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=j.ErrorDetails.BUFFER_FULL_ERROR:(u.appendError++,F.details=j.ErrorDetails.BUFFER_APPEND_ERROR,u.appendError>x.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0)),x.trigger(B.Events.ERROR,F)}};E.append(W,A)},m.onBufferFlushing=function(n,o){var u=this,x=this.operationQueue,E=function(O){return{execute:u.removeExecutor.bind(u,O,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){u.hls.trigger(B.Events.BUFFER_FLUSHED,{type:O})},onError:function(p){M.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",p)}}};o.type?x.append(E(o.type),o.type):this.getSourceBufferTypes().forEach(function(v){x.append(E(v),v)})},m.onFragParsed=function(n,o){var u=this,x=o.frag,E=o.part,v=[],O=E?E.elementaryStreams:x.elementaryStreams;O[R.ElementaryStreamTypes.AUDIOVIDEO]?v.push("audiovideo"):(O[R.ElementaryStreamTypes.AUDIO]&&v.push("audio"),O[R.ElementaryStreamTypes.VIDEO]&&v.push("video"));var A=function(){var h=self.performance.now();x.stats.buffering.end=h,E&&(E.stats.buffering.end=h);var s=E?E.stats:x.stats;u.hls.trigger(B.Events.FRAG_BUFFERED,{frag:x,part:E,stats:s,id:x.type})};v.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(A,v)},m.onFragChanged=function(n,o){this.flushBackBuffer()},m.onBufferEos=function(n,o){var u=this,x=this.getSourceBufferTypes().reduce(function(E,v){var O=u.sourceBuffer[v];return(!o.type||o.type===v)&&(O&&!O.ended&&(O.ended=!0,M.logger.log("[buffer-controller]: "+v+" sourceBuffer now EOS"))),E&&!!(!O||O.ended)},!0);x&&this.blockBuffers(function(){var E=u.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},m.onLevelUpdated=function(n,o){var u=o.details;if(!u.fragments.length)return;this.details=u,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},m.flushBackBuffer=function(){var n=this.hls,o=this.details,u=this.media,x=this.sourceBuffer;if(!u||o===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var v=o.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(z.isFiniteNumber)(v)||v<0)return;var O=u.currentTime,A=o.levelTargetDuration,p=Math.max(v,A),h=Math.floor(O/A)*A-p;E.forEach(function(s){var l=x[s];if(l){var D=U.BufferHelper.getBuffered(l);D.length>0&&h>D.start(0)&&(n.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),o.live&&n.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),n.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:s}))}})},m.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,o=this.hls,u=this.media,x=this.mediaSource,E=n.fragments[0].start+n.totalduration,v=u.duration,O=Object(z.isFiniteNumber)(x.duration)?x.duration:0;n.live&&o.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(n)):(E>O&&E>v||!Object(z.isFiniteNumber)(v))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),x.duration=E)},m.updateSeekableRange=function(n){var o=this.mediaSource,u=n.fragments,x=u.length;if(x&&n.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var E=Math.max(0,u[0].start),v=Math.max(E,E+n.totalduration);o.setLiveSeekableRange(E,v)}},m.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,o=this.operationQueue,u=this.pendingTracks,x=Object.keys(u).length;if(x&&!n||x===2){this.createSourceBuffers(u),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(v){o.executeNext(v)})}},m.createSourceBuffers=function(n){var o=this.sourceBuffer,u=this.mediaSource;if(!u)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var E in n)if(!o[E]){var v=n[E];if(!v)throw Error("source buffer exists for track "+E+", however track does not");var O=v.levelCodec||v.codec,A=v.container+";codecs="+O;M.logger.log("[buffer-controller]: creating sourceBuffer("+A+")");try{var p=o[E]=u.addSourceBuffer(A),h=E;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[E]={buffer:p,codec:O,container:v.container,levelCodec:v.levelCodec,id:v.id},x++}catch(s){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:A})}}x&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},m._onSBUpdateStart=function(n){var o=this.operationQueue,u=o.current(n);u.onStart()},m._onSBUpdateEnd=function(n){var o=this.operationQueue,u=o.current(n);u.onComplete(),o.shiftAndExecuteNext(n)},m._onSBUpdateError=function(n,o){M.logger.error("[buffer-controller]: "+n+" SourceBuffer error",o),this.hls.trigger(B.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var u=this.operationQueue.current(n);u&&u.onError(o)},m.removeExecutor=function(n,o,u){var x=this.media,E=this.mediaSource,v=this.operationQueue,O=this.sourceBuffer,A=O[n];if(!x||!E||!A){M.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),v.shiftAndExecuteNext(n);return}var p=Object(z.isFiniteNumber)(x.duration)?x.duration:Infinity,h=Object(z.isFiniteNumber)(E.duration)?E.duration:Infinity,s=Math.max(0,o),l=Math.min(u,p,h);l>s?(M.logger.log("[buffer-controller]: Removing ["+s+","+l+"] from the "+n+" SourceBuffer"),console.assert(!A.updating,n+" sourceBuffer must not be updating"),A.remove(s,l)):v.shiftAndExecuteNext(n)},m.appendExecutor=function(n,o){var u=this.operationQueue,x=this.sourceBuffer,E=x[o];if(!E){M.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),u.shiftAndExecuteNext(o);return}E.ended=!1,console.assert(!E.updating,o+" sourceBuffer must not be updating"),E.appendBuffer(n)},m.blockBuffers=function(n,o){var u=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var x=this.operationQueue,E=o.map(function(v){return x.appendBlocker(v)});Promise.all(E).then(function(){n(),o.forEach(function(v){var O=u.sourceBuffer[v];(!O||!O.updating)&&x.shiftAndExecuteNext(v)})})},m.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},m.addBufferListener=function(n,o,u){var x=this.sourceBuffer[n];if(!x)return;var E=u.bind(this,n);this.listeners[n].push({event:o,listener:E}),x.addEventListener(o,E)},m.removeBufferListeners=function(n){var o=this.sourceBuffer[n];if(!o)return;this.listeners[n].forEach(function(u){o.removeEventListener(u.event,u.listener)})},f}()},"./src/controller/buffer-operation-queue.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return B});var z=P("./src/utils/logger.ts"),B=function(){function M(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var j=M.prototype;return j.append=function(_,R){var c=this.queues[R];c.push(_),c.length===1&&this.buffers[R]&&this.executeNext(R)},j.insertAbort=function(_,R){var c=this.queues[R];c.unshift(_),this.executeNext(R)},j.appendBlocker=function(_){var R,c=new Promise(function(w){R=w}),g={execute:R,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,_),c},j.executeNext=function(_){var R=this.buffers,c=this.queues,g=R[_],w=c[_];if(w.length){var y=w[0];try{y.execute()}catch(f){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),y.onError(f),(!g||!g.updating)&&(w.shift(),this.executeNext(_))}}},j.shiftAndExecuteNext=function(_){this.queues[_].shift(),this.executeNext(_)},j.current=function(_){return this.queues[_][0]},M}()},"./src/controller/cap-level-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts");function B(U,_){for(var R=0;R<_.length;R++){var c=_[R];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(U,c.key,c)}}function M(U,_,R){return _&&B(U.prototype,_),R&&B(U,R),U}var j=function(){function U(R){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=R,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var _=U.prototype;return _.setStreamController=function(c){this.streamController=c},_.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},_.registerListeners=function(){var c=this.hls;c.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.unregisterListener=function(){var c=this.hls;c.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),c.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),c.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.onFpsDropLevelCapping=function(c,g){U.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},_.onMediaAttaching=function(c,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},_.onManifestParsed=function(c,g){var w=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,w.config.capLevelToPlayerSize&&g.video&&this.startCapping()},_.onBufferCodecs=function(c,g){var w=this.hls;w.config.capLevelToPlayerSize&&g.video&&this.startCapping()},_.onMediaDetaching=function(){this.stopCapping()},_.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var c=this.hls.levels;if(c.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(c.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},_.getMaxLevel=function(c){var g=this,w=this.hls.levels;if(!w.length)return-1;var y=w.filter(function(f,m){return U.isLevelAllowed(m,g.restrictedLevels)&&m<=c});return this.clientRect=null,U.getMaxLevelByMediaSize(y,this.mediaWidth,this.mediaHeight)},_.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()},_.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},_.getDimensions=function(){if(this.clientRect)return this.clientRect;var c=this.media,g={width:0,height:0};if(c){var w=c.getBoundingClientRect();g.width=w.width,g.height=w.height,!g.width&&!g.height&&(g.width=w.right-w.left||c.width||0,g.height=w.bottom-w.top||c.height||0)}return this.clientRect=g,g},U.isLevelAllowed=function(c,g){return g===void 0&&(g=[]),g.indexOf(c)===-1},U.getMaxLevelByMediaSize=function(c,g,w){if(!c||!c.length)return-1;for(var y=function(o,u){return u?o.width!==u.width||o.height!==u.height:!0},f=c.length-1,m=0;m<c.length;m+=1){var a=c[m];if((a.width>=g||a.height>=w)&&y(a,c[m+1])){f=m;break}}return f},M(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var c=1;try{c=self.devicePixelRatio}catch(g){}return c}}]),U}();K.default=j},"./src/controller/cmcd-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return y});var z=P("./src/events.ts"),B=P("./src/types/cmcd.ts"),M=P("./src/utils/buffer-helper.ts"),j=P("./src/utils/logger.ts");function U(f,m){for(var a=0;a<m.length;a++){var n=m[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(f,n.key,n)}}function _(f,m,a){return m&&U(f.prototype,m),a&&U(f,a),f}function R(f,m){var a=typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(a)return(a=a.call(f)).next.bind(a);if(Array.isArray(f)||(a=c(f))||m&&f&&typeof f.length=="number"){a&&(f=a);var n=0;return function(){return n>=f.length?{done:!0}:{done:!1,value:f[n++]}}}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 c(f,m){if(!f)return;if(typeof f=="string")return g(f,m);var a=Object.prototype.toString.call(f).slice(8,-1);if(a==="Object"&&f.constructor&&(a=f.constructor.name),a==="Map"||a==="Set")return Array.from(f);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return g(f,m)}function g(f,m){(m==null||m>f.length)&&(m=f.length);for(var a=0,n=new Array(m);a<m;a++)n[a]=f[a];return n}function w(){return w=Object.assign||function(f){for(var m=1;m<arguments.length;m++){var a=arguments[m];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(f[n]=a[n])}return f},w.apply(this,arguments)}var y=function(){function f(a){var n=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(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(x){try{n.apply(x,{ot:B.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(E){j.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(x){try{var E=x.frag,v=n.hls.levels[E.level],O=n.getObjectType(E),A={d:E.duration*1e3,ot:O};(O===B.CMCDObjectType.VIDEO||O===B.CMCDObjectType.AUDIO||O==B.CMCDObjectType.MUXED)&&(A.br=v.bitrate/1e3,A.tb=n.getTopBandwidth(O),A.bl=n.getBufferLength(O)),n.apply(x,A)}catch(p){j.logger.warn("Could not generate segment CMCD data.",p)}},this.hls=a;var o=this.config=a.config,u=o.cmcd;u!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=u.sessionId||f.uuid(),this.cid=u.contentId,this.useHeaders=u.useHeaders===!0,this.registerListeners())}var m=f.prototype;return m.registerListeners=function(){var n=this.hls;n.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},m.unregisterListeners=function(){var n=this.hls;n.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},m.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},m.onMediaAttached=function(n,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},m.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},m.onBufferCreated=function(n,o){var u,x;this.audioBuffer=(u=o.tracks.audio)===null||u===void 0?void 0:u.buffer,this.videoBuffer=(x=o.tracks.video)===null||x===void 0?void 0:x.buffer},m.createData=function(){var n;return{v:B.CMCDVersion,sf:B.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},m.apply=function(n,o){o===void 0&&(o={}),w(o,this.createData());var u=o.ot===B.CMCDObjectType.INIT||o.ot===B.CMCDObjectType.VIDEO||o.ot===B.CMCDObjectType.MUXED;if(this.starved&&u&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var x=f.toHeaders(o);if(!Object.keys(x).length)return;n.headers||(n.headers={}),w(n.headers,x)}else{var E=f.toQuery(o);if(!E)return;n.url=f.appendQueryToUri(n.url,E)}},m.getObjectType=function(n){var o=n.type;return o==="subtitle"?B.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?B.CMCDObjectType.INIT:o==="audio"?B.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},m.getTopBandwidth=function(n){for(var o=0,u=n===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,x=R(u),E;!(E=x()).done;){var v=E.value;v.bitrate>o&&(o=v.bitrate)}return o>0?o:NaN},m.getBufferLength=function(n){var o=this.hls.media,u=n===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!u||!o)return NaN;var x=M.BufferHelper.bufferInfo(u,o.currentTime,this.config.maxBufferHole);return x.len*1e3},m.createPlaylistLoader=function(){var n=this.config.pLoader,o=this.applyPlaylistData,u=n||this.config.loader;return function(){function x(v){this.loader=void 0,this.loader=new u(v)}var E=x.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(O,A,p){o(O),this.loader.load(O,A,p)},_(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},m.createFragmentLoader=function(){var n=this.config.fLoader,o=this.applyFragmentData,u=n||this.config.loader;return function(){function x(v){this.loader=void 0,this.loader=new u(v)}var E=x.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(O,A,p){o(O),this.loader.load(O,A,p)},_(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},f.uuid=function(){var n=URL.createObjectURL(new Blob),o=n.toString();return URL.revokeObjectURL(n),o.substr(o.lastIndexOf("/")+1)},f.serialize=function(n){for(var o=[],u=function(C){return!Number.isNaN(C)&&C!=null&&C!==""&&C!==!1},x=function(C){return Math.round(C)},E=function(C){return x(C/100)*100},v=function(C){return encodeURIComponent(C)},O={br:x,d:x,bl:E,dl:E,mtp:E,nor:v,rtp:E,tb:x},A=Object.keys(n||{}).sort(),p=R(A),h;!(h=p()).done;){var s=h.value,l=n[s];if(!u(l))continue;if(s==="v"&&l===1)continue;if(s=="pr"&&l===1)continue;var D=O[s];D&&(l=D(l));var T=typeof l,S=void 0;s==="ot"||s==="sf"||s==="st"?S=s+"="+l:T==="boolean"?S=s:T==="number"?S=s+"="+l:S=s+"="+JSON.stringify(l),o.push(S)}return o.join(",")},f.toHeaders=function(n){for(var o=Object.keys(n),u={},x=["Object","Request","Session","Status"],E=[{},{},{},{}],v={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,A=o;O<A.length;O++){var p=A[O],h=v[p]!=null?v[p]:1;E[h][p]=n[p]}for(var s=0;s<E.length;s++){var l=f.serialize(E[s]);l&&(u["CMCD-"+x[s]]=l)}return u},f.toQuery=function(n){return"CMCD="+encodeURIComponent(f.serialize(n))},f.appendQueryToUri=function(n,o){if(!o)return n;var u=n.includes("?")?"&":"?";return""+n+u+o},f}()},"./src/controller/eme-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts"),B=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),j=P("./src/utils/mediakeys-helper.ts");function U(y,f){for(var m=0;m<f.length;m++){var a=f[m];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function _(y,f,m){return f&&U(y.prototype,f),m&&U(y,m),y}var R=3,c=function(f,m,a){var n={audioCapabilities:[],videoCapabilities:[]};return f.forEach(function(o){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:a.audioRobustness||""})}),m.forEach(function(o){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:a.videoRobustness||""})}),[n]},g=function(f,m,a,n){switch(f){case j.KeySystems.WIDEVINE:return c(m,a,n);default:throw new Error("Unknown key-system: "+f)}},w=function(){function y(m){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=m,this._config=m.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 f=y.prototype;return f.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},f._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},f.getLicenseServerUrl=function(a){switch(a){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},f._attemptKeySystemAccess=function(a,n,o){var u=this,x=g(a,n,o,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(a,x);this.mediaKeysPromise=E.then(function(v){return u._onMediaKeySystemAccessObtained(a,v)}),E.catch(function(v){M.logger.error('Failed to obtain key-system "'+a+'" access:',v)})},f._onMediaKeySystemAccessObtained=function(a,n){var o=this;M.logger.log('Access for key-system "'+a+'" obtained');var u={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:a};this._mediaKeysList.push(u);var x=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(E){return u.mediaKeys=E,M.logger.log('Media-keys created for key-system "'+a+'"'),o._onMediaKeysCreated(),E});return x.catch(function(E){M.logger.error("Failed to create media-keys:",E)}),x},f._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),a._onNewMediaKeySession(n.mediaKeysSession))})},f._onNewMediaKeySession=function(a){var n=this;M.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(o){n._onKeySessionMessage(a,o.message)},!1)},f._onKeySessionMessage=function(a,n){M.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(o){M.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),a.update(o)})},f.onMediaEncrypted=function(a){var n=this;if(M.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(x){if(!n._media)return;n._attemptSetMediaKeys(x),n._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(o).catch(o)},f._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},f._generateRequestWithPreferredKeySession=function(a,n){var o=this,u=this._mediaKeysList[0];if(!u){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(u.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var x=u.mediaKeysSession;if(!x){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+a+'" init data type'),u.mediaKeysSessionInitialized=!0,x.generateRequest(a,n).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(E){M.logger.error("Error generating key-session request:",E),o.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},f._createLicenseXhr=function(a,n,o){var u=new XMLHttpRequest;u.responseType="arraybuffer",u.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,u,a,n,o);var x=this._licenseXhrSetup;if(x)try{x.call(this.hls,u,a),x=void 0}catch(E){M.logger.error(E)}try{u.readyState||u.open("POST",a,!0),x&&x.call(this.hls,u,a)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return u},f._onLicenseRequestReadyStageChange=function(a,n,o,u){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var x=a.response,E=this._licenseResponseCallback;if(E)try{x=E.call(this.hls,a,n)}catch(O){M.logger.error(O)}u(x)}else{if(M.logger.error("License Request XHR failed ("+n+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>R){this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var v=R-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+v+" attempts left"),this._requestLicense(o,u)}break}},f._generateLicenseRequestChallenge=function(a,n){switch(a.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},f._requestLicense=function(a,n){M.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var u=this.getLicenseServerUrl(o.mediaKeySystemDomain),x=this._createLicenseXhr(u,a,n);M.logger.log("Sending license request to URL: "+u);var E=this._generateLicenseRequestChallenge(o,a);x.send(E)}catch(v){M.logger.error("Failure requesting DRM license: "+v),this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},f.onMediaAttached=function(a,n){if(!this._emeEnabled)return;var o=n.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},f.onMediaDetached=function(){var a=this._media,n=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},f.onManifestParsed=function(a,n){if(!this._emeEnabled)return;var o=n.levels.map(function(x){return x.audioCodec}).filter(function(x){return!!x}),u=n.levels.map(function(x){return x.videoCodec}).filter(function(x){return!!x});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,o,u)},_(y,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),y}();K.default=w},"./src/controller/fps-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts"),B=P("./src/utils/logger.ts"),M=function(){function j(_){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=_,this.registerListeners()}var U=j.prototype;return U.setStreamController=function(R){this.streamController=R},U.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(R,c){var g=this.hls.config;if(g.capLevelOnFPSDrop){var w=c.media instanceof self.HTMLVideoElement?c.media:null;this.media=w,w&&typeof w.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(R,c,g){var w=performance.now();if(c){if(this.lastTime){var y=w-this.lastTime,f=g-this.lastDroppedFrames,m=c-this.lastDecodedFrames,a=1e3*f/y,n=this.hls;if(n.trigger(z.Events.FPS_DROP,{currentDropped:f,currentDecoded:m,totalDroppedFrames:g}),a>0&&f>n.config.fpsDroppedMonitoringThreshold*m){var o=n.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=o)&&(o=o-1,n.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:n.currentLevel}),n.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=w,this.lastDroppedFrames=g,this.lastDecodedFrames=c}},U.checkFPSInterval=function(){var R=this.media;if(R)if(this.isVideoPlaybackQualityAvailable){var c=R.getVideoPlaybackQuality();this.checkFPS(R,c.totalVideoFrames,c.droppedVideoFrames)}else this.checkFPS(R,R.webkitDecodedFrameCount,R.webkitDroppedFrameCount)},j}();K.default=M},"./src/controller/fragment-finders.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"findFragmentByPDT",function(){return M}),P.d(K,"findFragmentByPTS",function(){return j}),P.d(K,"fragmentWithinToleranceTest",function(){return U}),P.d(K,"pdtWithinToleranceTest",function(){return _}),P.d(K,"findFragWithCC",function(){return R});var z=P("./src/polyfills/number.ts"),B=P("./src/utils/binary-search.ts");function M(c,g,w){if(g===null||!Array.isArray(c)||!c.length||!Object(z.isFiniteNumber)(g))return null;var y=c[0].programDateTime;if(g<(y||0))return null;var f=c[c.length-1].endProgramDateTime;if(g>=(f||0))return null;w=w||0;for(var m=0;m<c.length;++m){var a=c[m];if(_(g,w,a))return a}return null}function j(c,g,w,y){w===void 0&&(w=0),y===void 0&&(y=0);var f=null;if(c?f=g[c.sn-g[0].sn+1]||null:w===0&&g[0].start===0&&(f=g[0]),f&&U(w,y,f)===0)return f;var m=B.default.search(g,U.bind(null,w,y));return m||f}function U(c,g,w){c===void 0&&(c=0),g===void 0&&(g=0);var y=Math.min(g,w.duration+(w.deltaPTS?w.deltaPTS:0));return w.start+w.duration-y<=c?1:w.start-y>c&&w.start?-1:0}function _(c,g,w){var y=Math.min(g,w.duration+(w.deltaPTS?w.deltaPTS:0))*1e3,f=w.endProgramDateTime||0;return f-y>c}function R(c,g){return B.default.search(c,function(w){return w.cc<g?1:w.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"FragmentState",function(){return M}),P.d(K,"FragmentTracker",function(){return j});var z=P("./src/events.ts"),B=P("./src/types/loader.ts"),M;(function(R){R.NOT_LOADED="NOT_LOADED",R.BACKTRACKED="BACKTRACKED",R.APPENDING="APPENDING",R.PARTIAL="PARTIAL",R.OK="OK"})(M||(M={}));var j=function(){function R(g){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=g,this._registerListeners()}var c=R.prototype;return c._registerListeners=function(){var w=this.hls;w.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},c._unregisterListeners=function(){var w=this.hls;w.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),w.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),w.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},c.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},c.getAppendedFrag=function(w,y){if(y===B.PlaylistLevelType.MAIN){var f=this.activeFragment,m=this.activeParts;if(!f)return null;if(m)for(var a=m.length;a--;){var n=m[a],o=n?n.end:f.appendedPTS;if(n.start<=w&&o!==void 0&&w<=o)return a>9&&(this.activeParts=m.slice(a-9)),n}else if(f.start<=w&&f.appendedPTS!==void 0&&w<=f.appendedPTS)return f}return this.getBufferedFrag(w,y)},c.getBufferedFrag=function(w,y){for(var f=this.fragments,m=Object.keys(f),a=m.length;a--;){var n=f[m[a]];if((n==null?void 0:n.body.type)===y&&n.buffered){var o=n.body;if(o.start<=w&&w<=o.end)return o}}return null},c.detectEvictedFragments=function(w,y,f){var m=this;Object.keys(this.fragments).forEach(function(a){var n=m.fragments[a];if(!n)return;if(!n.buffered){n.body.type===f&&m.removeFragment(n.body);return}var o=n.range[w];if(!o)return;o.time.some(function(u){var x=!m.isTimeBuffered(u.startPTS,u.endPTS,y);return x&&m.removeFragment(n.body),x})})},c.detectPartialFragments=function(w){var y=this,f=this.timeRanges,m=w.frag,a=w.part;if(!f||m.sn==="initSegment")return;var n=_(m),o=this.fragments[n];if(!o)return;Object.keys(f).forEach(function(u){var x=m.elementaryStreams[u];if(!x)return;var E=f[u],v=a!==null||x.partial===!0;o.range[u]=y.getBufferedTimes(m,a,v,E)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},c.fragBuffered=function(w){var y=_(w),f=this.fragments[y];f&&(f.backtrack=f.loaded=null,f.buffered=!0)},c.getBufferedTimes=function(w,y,f,m){for(var a={time:[],partial:f},n=y?y.start:w.start,o=y?y.end:w.end,u=w.minEndPTS||o,x=w.maxStartPTS||n,E=0;E<m.length;E++){var v=m.start(E)-this.bufferPadding,O=m.end(E)+this.bufferPadding;if(x>=v&&u<=O){a.time.push({startPTS:Math.max(n,m.start(E)),endPTS:Math.min(o,m.end(E))});break}else if(n<O&&o>v)a.partial=!0,a.time.push({startPTS:Math.max(n,m.start(E)),endPTS:Math.min(o,m.end(E))});else if(o<=v)break}return a},c.getPartialFragment=function(w){var y=null,f,m,a,n=0,o=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach(function(x){var E=u[x];if(!E)return;U(E)&&(m=E.body.start-o,a=E.body.end+o,w>=m&&w<=a&&(f=Math.min(w-m,a-w),n<=f&&(y=E.body,n=f)))}),y},c.getState=function(w){var y=_(w),f=this.fragments[y];return f?f.buffered?U(f)?M.PARTIAL:M.OK:f.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},c.backtrack=function(w,y){var f=_(w),m=this.fragments[f];if(!m||m.backtrack)return null;var a=m.backtrack=y||m.loaded;return m.loaded=null,a},c.getBacktrackData=function(w){var y=_(w),f=this.fragments[y];if(f){var m,a=f.backtrack;if(a!=null&&(m=a.payload)!==null&&m!==void 0&&m.byteLength)return a;this.removeFragment(w)}return null},c.isTimeBuffered=function(w,y,f){for(var m,a,n=0;n<f.length;n++){if(m=f.start(n)-this.bufferPadding,a=f.end(n)+this.bufferPadding,w>=m&&y<=a)return!0;if(y<=m)return!1}return!1},c.onFragLoaded=function(w,y){var f=y.frag,m=y.part;if(f.sn==="initSegment"||f.bitrateTest||m)return;var a=_(f);this.fragments[a]={body:f,loaded:y,backtrack:null,buffered:!1,range:Object.create(null)}},c.onBufferAppended=function(w,y){var f=this,m=y.frag,a=y.part,n=y.timeRanges;if(m.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=m,a){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(a)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(u){var x=n[u];if(f.detectEvictedFragments(u,x),!a)for(var E=0;E<x.length;E++)m.appendedPTS=Math.max(x.end(E),m.appendedPTS||0)})},c.onFragBuffered=function(w,y){this.detectPartialFragments(y)},c.hasFragment=function(w){var y=_(w);return!!this.fragments[y]},c.removeFragmentsInRange=function(w,y,f){var m=this;Object.keys(this.fragments).forEach(function(a){var n=m.fragments[a];if(!n)return;if(n.buffered){var o=n.body;o.type===f&&o.start<y&&o.end>w&&m.removeFragment(o)}})},c.removeFragment=function(w){var y=_(w);w.stats.loaded=0,w.clearElementaryStreamInfo(),delete this.fragments[y]},c.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},R}();function U(R){var c,g;return R.buffered&&(((c=R.range.video)===null||c===void 0?void 0:c.partial)||((g=R.range.audio)===null||g===void 0?void 0:g.partial))}function _(R){return R.type+"_"+R.level+"_"+R.urlId+"_"+R.sn}},"./src/controller/gap-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"STALL_MINIMUM_DURATION_MS",function(){return U}),P.d(K,"MAX_START_GAP_JUMP",function(){return _}),P.d(K,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return R}),P.d(K,"SKIP_BUFFER_RANGE_START",function(){return c}),P.d(K,"default",function(){return g});var z=P("./src/utils/buffer-helper.ts"),B=P("./src/errors.ts"),M=P("./src/events.ts"),j=P("./src/utils/logger.ts"),U=250,_=2,R=.1,c=.05,g=function(){function w(f,m,a,n){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=f,this.media=m,this.fragmentTracker=a,this.hls=n}var y=w.prototype;return y.destroy=function(){this.hls=this.fragmentTracker=this.media=null},y.poll=function(m){var a=this.config,n=this.media,o=this.stalled,u=n.currentTime,x=n.seeking,E=this.seeking&&!x,v=!this.seeking&&x;if(this.seeking=x,u!==m){if(this.moved=!0,o!==null){if(this.stallReported){var O=self.performance.now()-o;j.logger.warn("playback not stuck anymore @"+u+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((v||E)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!z.BufferHelper.getBuffered(n).length)return;var A=z.BufferHelper.bufferInfo(n,u,0),p=A.len>0,h=A.nextStart||0;if(!p&&!h)return;if(x){var s=A.len>_,l=!h||h-u>_&&!this.fragmentTracker.getPartialFragment(u);if(s||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var D,T=Math.max(h,A.start||0)-u,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=S==null||((D=S.details)===null||D===void 0)?void 0:D.live,C=I?S.details.targetduration*2:_;if(T>0&&T<=C){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(o===null){this.stalled=W;return}var Y=W-o;!x&&Y>=U&&this._reportStall(A.len);var H=z.BufferHelper.bufferInfo(n,u,a.maxBufferHole);this._tryFixBufferStall(H,Y)},y._tryFixBufferStall=function(m,a){var n=this.config,o=this.fragmentTracker,u=this.media,x=u.currentTime,E=o.getPartialFragment(x);if(E){var v=this._trySkipBufferHole(E);if(v)return}m.len>n.maxBufferHole&&a>n.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},y._reportStall=function(m){var a=this.hls,n=this.media,o=this.stallReported;o||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+m+")"),a.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m}))},y._trySkipBufferHole=function(m){for(var a=this.config,n=this.hls,o=this.media,u=o.currentTime,x=0,E=z.BufferHelper.getBuffered(o),v=0;v<E.length;v++){var O=E.start(v);if(u+a.maxBufferHole>=x&&u<O){var A=Math.max(O+c,o.currentTime+R);return j.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+A),this.moved=!0,this.stalled=null,o.currentTime=A,m&&n.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+A,frag:m}),A}x=E.end(v)}return 0},y._tryNudgeBuffer=function(){var m=this.config,a=this.hls,n=this.media,o=n.currentTime,u=(this.nudgeRetry||0)+1;if(this.nudgeRetry=u,u<m.nudgeMaxRetry){var x=o+u*m.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+o+" to "+x),n.currentTime=x,a.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+m.nudgeMaxRetry+" nudges"),a.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},w}()},"./src/controller/id3-track-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts"),B=P("./src/utils/texttrack-utils.ts"),M=P("./src/demux/id3.ts"),j=.25,U=function(){function _(c){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=c,this._registerListeners()}var R=_.prototype;return R.destroy=function(){this._unregisterListeners()},R._registerListeners=function(){var g=this.hls;g.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R._unregisterListeners=function(){var g=this.hls;g.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},R.onMediaAttached=function(g,w){this.media=w.media},R.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},R.getID3Track=function(g){if(!this.media)return;for(var w=0;w<g.length;w++){var y=g[w];if(y.kind==="metadata"&&y.label==="id3")return Object(B.sendAddTrackEvent)(y,this.media),y}return this.media.addTextTrack("metadata","id3")},R.onFragParsingMetadata=function(g,w){if(!this.media)return;var y=w.frag,f=w.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var m=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<f.length;a++){var n=M.getID3Frames(f[a].data);if(n){var o=f[a].pts,u=a<f.length-1?f[a+1].pts:y.end,x=u-o;x<=0&&(u=o+j);for(var E=0;E<n.length;E++){var v=n[E];if(!M.isTimeStampFrame(v)){var O=new m(o,u,"");O.value=v,this.id3Track.addCue(O)}}}}},R.onBufferFlushing=function(g,w){var y=w.startOffset,f=w.endOffset,m=w.type;if(!m||m==="audio"){var a=this.id3Track;a&&Object(B.removeCuesInRange)(a,y,f)}},_}();K.default=U},"./src/controller/latency-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return _});var z=P("./src/errors.ts"),B=P("./src/events.ts"),M=P("./src/utils/logger.ts");function j(R,c){for(var g=0;g<c.length;g++){var w=c[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(R,w.key,w)}}function U(R,c,g){return c&&j(R.prototype,c),g&&j(R,g),R}var _=function(){function R(g){var w=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 w.timeupdate()},this.hls=g,this.config=g.config,this.registerListeners()}var c=R.prototype;return c.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},c.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},c.onMediaAttached=function(w,y){this.media=y.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},c.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},c.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},c.onLevelUpdated=function(w,y){var f=y.details;this.levelDetails=f,f.advanced&&this.timeupdate(),!f.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},c.onError=function(w,y){if(y.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},c.timeupdate=function(){var w=this.media,y=this.levelDetails;if(!w||!y)return;this.currentTime=w.currentTime;var f=this.computeLatency();if(f===null)return;this._latency=f;var m=this.config,a=m.lowLatencyMode,n=m.maxLiveSyncPlaybackRate;if(!a||n===1)return;var o=this.targetLatency;if(o===null)return;var u=f-o,x=Math.min(this.maxLatency,o+y.targetduration),E=u<x;if(y.live&&E&&u>.05&&this.forwardBufferLength>1){var v=Math.min(2,Math.max(1,n)),O=Math.round(2/(1+Math.exp(-.75*u-this.edgeStalled))*20)/20;w.playbackRate=Math.min(v,Math.max(1,O))}else w.playbackRate!==1&&w.playbackRate!==0&&(w.playbackRate=1)},c.estimateLiveEdge=function(){var w=this.levelDetails;return w===null?null:w.edge+w.age},c.computeLatency=function(){var w=this.estimateLiveEdge();return w===null?null:w-this.currentTime},U(R,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var w=this.config,y=this.levelDetails;return w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:y?w.liveMaxLatencyDurationCount*y.targetduration:0}},{key:"targetLatency",get:function(){var w=this.levelDetails;if(w===null)return null;var y=w.holdBack,f=w.partHoldBack,m=w.targetduration,a=this.config,n=a.liveSyncDuration,o=a.liveSyncDurationCount,u=a.lowLatencyMode,x=this.hls.userConfig,E=u&&f||y;(x.liveSyncDuration||x.liveSyncDurationCount||E===0)&&(E=n!==void 0?n:o*m);var v=m,O=1;return E+Math.min(this.stallCount*O,v)}},{key:"liveSyncPosition",get:function(){var w=this.estimateLiveEdge(),y=this.targetLatency,f=this.levelDetails;if(w===null||y===null||f===null)return null;var m=f.edge,a=w-y-this.edgeStalled,n=m-f.totalduration,o=m-(this.config.lowLatencyMode&&f.partTarget||f.targetduration);return Math.min(Math.max(n,a),o)}},{key:"drift",get:function(){var w=this.levelDetails;return w===null?1:w.drift}},{key:"edgeStalled",get:function(){var w=this.levelDetails;if(w===null)return 0;var y=(this.config.lowLatencyMode&&w.partTarget||w.targetduration)*3;return Math.max(w.age-y,0)}},{key:"forwardBufferLength",get:function(){var w=this.media,y=this.levelDetails;if(!w||!y)return 0;var f=w.buffered.length;return f?w.buffered.end(f-1):y.edge-this.currentTime}}]),R}()},"./src/controller/level-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return a});var z=P("./src/types/level.ts"),B=P("./src/events.ts"),M=P("./src/errors.ts"),j=P("./src/utils/codecs.ts"),U=P("./src/controller/level-helper.ts"),_=P("./src/controller/base-playlist-controller.ts"),R=P("./src/types/loader.ts");function c(){return c=Object.assign||function(n){for(var o=1;o<arguments.length;o++){var u=arguments[o];for(var x in u)Object.prototype.hasOwnProperty.call(u,x)&&(n[x]=u[x])}return n},c.apply(this,arguments)}function g(n,o){for(var u=0;u<o.length;u++){var x=o[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(n,x.key,x)}}function w(n,o,u){return o&&g(n.prototype,o),u&&g(n,u),n}function y(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,f(n,o)}function f(n,o){return f=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},f(n,o)}var m=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(n){y(o,n);function o(x){var E;return E=n.call(this,x,"[level-controller]")||this,E._levels=[],E._firstLevel=-1,E._startLevel=void 0,E.currentLevelIndex=-1,E.manualLevelIndex=-1,E.onParsedComplete=void 0,E._registerListeners(),E}var u=o.prototype;return u._registerListeners=function(){var E=this.hls;E.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(B.Events.ERROR,this.onError,this)},u._unregisterListeners=function(){var E=this.hls;E.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(B.Events.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},u.startLoad=function(){var E=this._levels;E.forEach(function(v){v.loadError=0}),n.prototype.startLoad.call(this)},u.onManifestLoaded=function(E,v){var O=[],A=[],p=[],h,s={},l,D=!1,T=!1,S=!1;if(v.levels.forEach(function(Y){var H=Y.attrs;D=D||!!(Y.width&&Y.height),T=T||!!Y.videoCodec,S=S||!!Y.audioCodec,m&&Y.audioCodec&&Y.audioCodec.indexOf("mp4a.40.34")!==-1&&(Y.audioCodec=void 0);var F=Y.bitrate+"-"+Y.attrs.RESOLUTION+"-"+Y.attrs.CODECS;l=s[F],l?l.url.push(Y.url):(l=new z.Level(Y),s[F]=l,O.push(l)),H&&(H.AUDIO&&Object(U.addGroupId)(l,"audio",H.AUDIO),H.SUBTITLES&&Object(U.addGroupId)(l,"text",H.SUBTITLES))}),(D||T)&&S&&(O=O.filter(function(Y){var H=Y.videoCodec,F=Y.width,q=Y.height;return!!H||!!(F&&q)})),O=O.filter(function(Y){var H=Y.audioCodec,F=Y.videoCodec;return(!H||Object(j.isCodecSupportedInMp4)(H,"audio"))&&(!F||Object(j.isCodecSupportedInMp4)(F,"video"))}),v.audioTracks&&(A=v.audioTracks.filter(function(Y){return!Y.audioCodec||Object(j.isCodecSupportedInMp4)(Y.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(A)),v.subtitles&&(p=v.subtitles,Object(U.assignTrackIdsByGroup)(p)),O.length>0){h=O[0].bitrate,O.sort(function(Y,H){return Y.bitrate-H.bitrate}),this._levels=O;for(var I=0;I<O.length;I++)if(O[I].bitrate===h){this._firstLevel=I,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+h);break}var C=S&&!T,W={levels:O,audioTracks:A,subtitleTracks:p,firstLevel:this._firstLevel,stats:v.stats,audio:S,video:T,altAudio:!C&&A.some(function(Y){return!!Y.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,W),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:v.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(E,v){if(n.prototype.onError.call(this,E,v),v.fatal)return;var O=v.context,A=this._levels[this.currentLevelIndex];if(O&&(O.type===R.PlaylistContextType.AUDIO_TRACK&&A.audioGroupIds&&O.groupId===A.audioGroupIds[A.urlId]||O.type===R.PlaylistContextType.SUBTITLE_TRACK&&A.textGroupIds&&O.groupId===A.textGroupIds[A.urlId])){this.redundantFailover(this.currentLevelIndex);return}var p=!1,h=!0,s;switch(v.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(v.frag){var l=this._levels[v.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=v.frag.level)):s=v.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(h=!1),s=O.level),p=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:s=v.level,p=!0;break}s!==void 0&&this.recoverLevel(v,s,p,h)},u.recoverLevel=function(E,v,O,A){var p=E.details,h=this._levels[v];if(h.loadError++,O){var s=this.retryLoadingOrFail(E);if(s)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(A){var l=h.url.length;if(l>1&&h.loadError<l)E.levelRetry=!0,this.redundantFailover(v);else if(this.manualLevelIndex===-1){var D=v===0?this._levels.length-1:v-1;this.currentLevelIndex!==D&&this._levels[D].loadError===0&&(this.warn(p+": switch to "+D),E.levelRetry=!0,this.hls.nextAutoLevel=D)}}},u.redundantFailover=function(E){var v=this._levels[E],O=v.url.length;if(O>1){var A=(v.urlId+1)%O;this.warn("Switching to redundant URL-id "+A),this._levels.forEach(function(p){p.urlId=A}),this.level=E}},u.onFragLoaded=function(E,v){var O=v.frag;if(O!==void 0&&O.type===R.PlaylistLevelType.MAIN){var A=this._levels[O.level];A!==void 0&&(A.fragmentError=0,A.loadError=0)}},u.onLevelLoaded=function(E,v){var O,A=v.level,p=v.details,h=this._levels[A];if(!h){var s;this.warn("Invalid level index "+A),(s=v.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(p.deltaUpdateFailed=!0);return}A===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0,this.retryCount=0),this.playlistLoaded(A,v,h.details)):(O=v.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(p.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(E,v){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var A=-1,p=this.hls.audioTracks[v.id].groupId,h=0;h<O.audioGroupIds.length;h++)if(O.audioGroupIds[h]===p){A=h;break}A!==O.urlId&&(O.urlId=A,this.startLoad())}},u.loadPlaylist=function(E){var v=this.currentLevelIndex,O=this._levels[v];if(this.canLoad&&O&&O.url.length>0){var A=O.urlId,p=O.url[A];if(E)try{p=E.addDirectives(p)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Attempt loading level index "+v+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+A+" "+p),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:p,level:v,id:A,deliveryDirectives:E||null})}},u.removeLevel=function(E,v){var O=function(h,s){return s!==v},A=this._levels.filter(function(p,h){return h!==E?!0:p.url.length>1&&v!==void 0?(p.url=p.url.filter(O),p.audioGroupIds&&(p.audioGroupIds=p.audioGroupIds.filter(O)),p.textGroupIds&&(p.textGroupIds=p.textGroupIds.filter(O)),p.urlId=0,!0):!1}).map(function(p,h){var s=p.details;return s!=null&&s.fragments&&s.fragments.forEach(function(l){l.level=h}),p});this._levels=A,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:A})},w(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var v,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===E&&(v=O[E])!==null&&v!==void 0&&v.details)return;if(E<0||E>=O.length){var A=E<0;if(this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:A,reason:"invalid level idx"}),A)return;E=Math.min(E,O.length-1)}this.clearTimer();var p=this.currentLevelIndex,h=O[p],s=O[E];this.log("switching to level "+E+" from "+p),this.currentLevelIndex=E;var l=c({},s,{level:E,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete l._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,l);var D=s.details;if(!D||D.live){var T=this.switchParams(s.uri,h==null?void 0:h.details);this.loadPlaylist(T)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),o}(_.default)},"./src/controller/level-helper.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"addGroupId",function(){return M}),P.d(K,"assignTrackIdsByGroup",function(){return j}),P.d(K,"updatePTS",function(){return U}),P.d(K,"updateFragPTSDTS",function(){return R}),P.d(K,"mergeDetails",function(){return c}),P.d(K,"mapPartIntersection",function(){return g}),P.d(K,"mapFragmentIntersection",function(){return w}),P.d(K,"adjustSliding",function(){return y}),P.d(K,"addSliding",function(){return f}),P.d(K,"computeReloadInterval",function(){return m}),P.d(K,"getFragmentWithSN",function(){return a}),P.d(K,"getPartWith",function(){return n});var z=P("./src/polyfills/number.ts"),B=P("./src/utils/logger.ts");function M(o,u,x){switch(u){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(x);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(x);break}}function j(o){var u={};o.forEach(function(x){var E=x.groupId||"";x.id=u[E]=u[E]||0,u[E]++})}function U(o,u,x){var E=o[u],v=o[x];_(E,v)}function _(o,u){var x=u.startPTS;if(Object(z.isFiniteNumber)(x)){var E=0,v;u.sn>o.sn?(E=x-o.start,v=o):(E=o.start-x,v=u),v.duration!==E&&(v.duration=E)}else if(u.sn>o.sn){var O=o.cc===u.cc;O&&o.minEndPTS?u.start=o.start+(o.minEndPTS-o.start):u.start=o.start+o.duration}else u.start=Math.max(o.start-u.duration,0)}function R(o,u,x,E,v,O){var A=E-x;A<=0&&(B.logger.warn("Fragment should have a positive duration",u),E=x+u.duration,O=v+u.duration);var p=x,h=E,s=u.startPTS,l=u.endPTS;if(Object(z.isFiniteNumber)(s)){var D=Math.abs(s-x);Object(z.isFiniteNumber)(u.deltaPTS)?u.deltaPTS=Math.max(D,u.deltaPTS):u.deltaPTS=D,p=Math.max(x,s),x=Math.min(x,s),v=Math.min(v,u.startDTS),h=Math.min(E,l),E=Math.max(E,l),O=Math.max(O,u.endDTS)}u.duration=E-x;var T=x-u.start;u.appendedPTS=E,u.start=u.startPTS=x,u.maxStartPTS=p,u.startDTS=v,u.endPTS=E,u.minEndPTS=h,u.endDTS=O;var S=u.sn;if(!o||S<o.startSN||S>o.endSN)return 0;var I,C=S-o.startSN,W=o.fragments;for(W[C]=u,I=C;I>0;I--)_(W[I],W[I-1]);for(I=C;I<W.length-1;I++)_(W[I],W[I+1]);return o.fragmentHint&&_(W[W.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,T}function c(o,u){for(var x=null,E=o.fragments,v=E.length-1;v>=0;v--){var O=E[v].initSegment;if(O){x=O;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var A=0,p;if(w(o,u,function(I,C){I.relurl&&(A=I.cc-C.cc),Object(z.isFiniteNumber)(I.startPTS)&&Object(z.isFiniteNumber)(I.endPTS)&&(C.start=C.startPTS=I.startPTS,C.startDTS=I.startDTS,C.appendedPTS=I.appendedPTS,C.maxStartPTS=I.maxStartPTS,C.endPTS=I.endPTS,C.endDTS=I.endDTS,C.minEndPTS=I.minEndPTS,C.duration=I.endPTS-I.startPTS,C.duration&&(p=C),u.PTSKnown=u.alignedSliding=!0),C.elementaryStreams=I.elementaryStreams,C.loader=I.loader,C.stats=I.stats,C.urlId=I.urlId,I.initSegment&&(C.initSegment=I.initSegment,x=I.initSegment)}),x){var h=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments;h.forEach(function(I){var C;(!I.initSegment||I.initSegment.relurl===((C=x)===null||C===void 0?void 0:C.relurl))&&(I.initSegment=x)})}if(u.skippedSegments&&(u.deltaUpdateFailed=u.fragments.some(function(I){return!I}),u.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=u.skippedSegments;s--;)u.fragments.shift();u.startSN=u.fragments[0].sn,u.startCC=u.fragments[0].cc}var l=u.fragments;if(A){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var D=0;D<l.length;D++)l[D].cc+=A}u.skippedSegments&&(u.startCC=u.fragments[0].cc),g(o.partList,u.partList,function(I,C){C.elementaryStreams=I.elementaryStreams,C.stats=I.stats}),p?R(u,p,p.startPTS,p.endPTS,p.startDTS,p.endDTS):y(o,u),l.length&&(u.totalduration=u.edge-l[0].start),u.driftStartTime=o.driftStartTime,u.driftStart=o.driftStart;var T=u.advancedDateTime;if(u.advanced&&T){var S=u.edge;u.driftStart||(u.driftStartTime=T,u.driftStart=S),u.driftEndTime=T,u.driftEnd=S}else u.driftEndTime=o.driftEndTime,u.driftEnd=o.driftEnd,u.advancedDateTime=o.advancedDateTime}function g(o,u,x){if(o&&u)for(var E=0,v=0,O=o.length;v<=O;v++){var A=o[v],p=u[v+E];A&&p&&A.index===p.index&&A.fragment.sn===p.fragment.sn?x(A,p):E--}}function w(o,u,x){for(var E=u.skippedSegments,v=Math.max(o.startSN,u.startSN)-u.startSN,O=(o.fragmentHint?1:0)+(E?u.endSN:Math.min(o.endSN,u.endSN))-u.startSN,A=u.startSN-o.startSN,p=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,h=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,s=v;s<=O;s++){var l=h[A+s],D=p[s];E&&!D&&s<E&&(D=u.fragments[s]=l),l&&D&&x(l,D)}}function y(o,u){var x=u.startSN+u.skippedSegments-o.startSN,E=o.fragments;if(x<0||x>=E.length)return;f(u,E[x].start)}function f(o,u){if(u){for(var x=o.fragments,E=o.skippedSegments;E<x.length;E++)x[E].start+=u;o.fragmentHint&&(o.fragmentHint.start+=u)}}function m(o,u){var x=1e3*o.levelTargetDuration,E=x/2,v=o.age,O=v>0&&v<x*3,A=u.loading.end-u.loading.start,p,h=o.availabilityDelay;if(o.updated===!1)if(O){var s=333*o.misses;p=Math.max(Math.min(E,A*2),s),o.availabilityDelay=(o.availabilityDelay||0)+p}else p=E;else O?(h=Math.min(h||x/2,v),o.availabilityDelay=h,p=h+x-v):p=x-A;return Math.round(p)}function a(o,u,x){if(!o||!o.details)return null;var E=o.details,v=E.fragments[u-E.startSN];return v||(v=E.fragmentHint,v&&v.sn===u?v:u<E.startSN&&x&&x.sn===u?x:null)}function n(o,u,x){if(!o||!o.details)return null;var E=o.details.partList;if(E)for(var v=E.length;v--;){var O=E[v];if(O.index===x&&O.fragment.sn===u)return O}return null}},"./src/controller/stream-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return E});var z=P("./src/polyfills/number.ts"),B=P("./src/controller/base-stream-controller.ts"),M=P("./src/is-supported.ts"),j=P("./src/events.ts"),U=P("./src/utils/buffer-helper.ts"),_=P("./src/controller/fragment-tracker.ts"),R=P("./src/types/loader.ts"),c=P("./src/loader/fragment.ts"),g=P("./src/demux/transmuxer-interface.ts"),w=P("./src/types/transmuxer.ts"),y=P("./src/controller/gap-controller.ts"),f=P("./src/errors.ts"),m=P("./src/utils/logger.ts");function a(v,O){for(var A=0;A<O.length;A++){var p=O[A];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}function n(v,O,A){return O&&a(v.prototype,O),A&&a(v,A),v}function o(v,O){v.prototype=Object.create(O.prototype),v.prototype.constructor=v,u(v,O)}function u(v,O){return u=Object.setPrototypeOf||function(p,h){return p.__proto__=h,p},u(v,O)}var x=100,E=function(v){o(O,v);function O(p,h){var s;return s=v.call(this,p,h,"[stream-controller]")||this,s.audioCodecSwap=!1,s.gapController=null,s.level=-1,s._forceStartLoad=!1,s.altAudio=!1,s.audioOnly=!1,s.fragPlaying=null,s.onvplaying=null,s.onvseeked=null,s.fragLastKbps=0,s.stalled=!1,s.couldBacktrack=!1,s.audioCodecSwitch=!1,s.videoBuffer=null,s._registerListeners(),s}var A=O.prototype;return A._registerListeners=function(){var h=this.hls;h.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(j.Events.ERROR,this.onError,this),h.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A._unregisterListeners=function(){var h=this.hls;h.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(j.Events.ERROR,this.onError,this),h.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},A.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},A.startLoad=function(h){if(this.levels){var s=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(x),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var D=l.startLevel;D===-1&&(l.config.testBandwidth?(D=0,this.bitrateTest=!0):D=l.nextAutoLevel),this.level=l.nextLoadLevel=D,this.loadedmetadata=!1}s>0&&h===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),h=s),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},A.stopLoad=function(){this._forceStartLoad=!1,v.prototype.stopLoad.call(this)},A.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var h,s=this.levels,l=this.level,D=s==null||((h=s[l])===null||h===void 0)?void 0:h.details;if(D&&(!D.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(D))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var T,S=self.performance.now(),I=this.retryDate;(!I||S>=I||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},A.onTickEnd=function(){v.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},A.doTickIdle=function(){var h,s,l=this.hls,D=this.levelLastLoaded,T=this.levels,S=this.media,I=l.config,C=l.nextLoadLevel;if(D===null||!S&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!T||!T[C])return;var W=T[C];this.level=l.nextLoadLevel=C;var Y=W.details;if(!Y||this.state===B.State.WAITING_LEVEL||Y.live&&this.levelLastLoaded!==C){this.state=B.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:S,R.PlaylistLevelType.MAIN);if(H===null)return;var F=H.len,q=this.getMaxBufferLength(W.maxBitrate);if(F>=q)return;if(this._streamEnded(H,Y)){var le={};this.altAudio&&(le.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,le),this.state=B.State.ENDED;return}var pe=H.end,Ae=this.getNextFragment(pe,Y);if(this.couldBacktrack&&!this.fragPrevious&&Ae&&Ae.sn!=="initSegment"){var Ge=Ae.sn-Y.startSN;Ge>1&&(Ae=Y.fragments[Ge-1],this.fragmentTracker.removeFragment(Ae))}if(Ae&&this.fragmentTracker.getState(Ae)===_.FragmentState.OK&&this.nextLoadPosition>pe){var Fe=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(S,Fe,R.PlaylistLevelType.MAIN),Ae=this.getNextFragment(this.nextLoadPosition,Y)}if(!Ae)return;Ae.initSegment&&!Ae.initSegment.data&&!this.bitrateTest&&(Ae=Ae.initSegment),((h=Ae.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((s=Ae.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(Ae,Y):this.loadFragment(Ae,Y,pe)},A.loadFragment=function(h,s,l){var D,T=this.fragmentTracker.getState(h);if(this.fragCurrent=h,T===_.FragmentState.BACKTRACKED){var S=this.fragmentTracker.getBacktrackData(h);if(S){this._handleFragmentLoadProgress(S),this._handleFragmentLoadComplete(S);return}else T=_.FragmentState.NOT_LOADED}T===_.FragmentState.NOT_LOADED||T===_.FragmentState.PARTIAL?h.sn==="initSegment"?this._loadInitSegment(h):this.bitrateTest?(h.bitrateTest=!0,this.log("Fragment "+h.sn+" of level "+h.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(h)):(this.startFragRequested=!0,v.prototype.loadFragment.call(this,h,s,l)):T===_.FragmentState.APPENDING?this.reduceMaxBufferLength(h.duration)&&this.fragmentTracker.removeFragment(h):((D=this.media)===null||D===void 0?void 0:D.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},A.getAppendedFrag=function(h){var s=this.fragmentTracker.getAppendedFrag(h,R.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},A.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,R.PlaylistLevelType.MAIN)},A.followingBufferedFrag=function(h){return h?this.getBufferedFrag(h.end+.5):null},A.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},A.nextLevelSwitch=function(){var h=this.levels,s=this.media;if(s!=null&&s.readyState){var l,D=this.getAppendedFrag(s.currentTime);if(D&&D.start>1&&this.flushMainBuffer(0,D.start-1),!s.paused&&h){var T=this.hls.nextLoadLevel,S=h[T],I=this.fragLastKbps;I&&this.fragCurrent?l=this.fragCurrent.duration*S.maxBitrate/(1e3*I)+1:l=0}else l=0;var C=this.getBufferedFrag(s.currentTime+l);if(C){var W=this.followingBufferedFrag(C);if(W){this.abortCurrentFrag();var Y=W.maxStartPTS?W.maxStartPTS:W.start,H=W.duration,F=Math.max(C.end,Y+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},A.abortCurrentFrag=function(){var h=this.fragCurrent;this.fragCurrent=null,h!=null&&h.loader&&h.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},A.flushMainBuffer=function(h,s){v.prototype.flushMainBuffer.call(this,h,s,this.altAudio?"video":null)},A.onMediaAttached=function(h,s){v.prototype.onMediaAttached.call(this,h,s);var l=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new y.default(this.config,l,this.fragmentTracker,this.hls)},A.onMediaDetaching=function(){var h=this.media;h&&(h.removeEventListener("playing",this.onvplaying),h.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),v.prototype.onMediaDetaching.call(this)},A.onMediaPlaying=function(){this.tick()},A.onMediaSeeked=function(){var h=this.media,s=h?h.currentTime:null;Object(z.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},A.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},A.onManifestParsed=function(h,s){var l=!1,D=!1,T;s.levels.forEach(function(S){T=S.audioCodec,T&&(T.indexOf("mp4a.40.2")!==-1&&(l=!0),T.indexOf("mp4a.40.5")!==-1&&(D=!0))}),this.audioCodecSwitch=l&&D&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},A.onLevelLoading=function(h,s){var l=this.levels;if(!l||this.state!==B.State.IDLE)return;var D=l[s.level];(!D.details||D.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(D.details))&&(this.state=B.State.WAITING_LEVEL)},A.onLevelLoaded=function(h,s){var l,D=this.levels,T=s.level,S=s.details,I=S.totalduration;if(!D){this.warn("Levels were reset while loading level "+T);return}this.log("Level "+T+" loaded ["+S.startSN+","+S.endSN+"], cc ["+S.startCC+", "+S.endCC+"] duration:"+I);var C=this.fragCurrent;C&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(C.level!==s.level&&C.loader&&(this.state=B.State.IDLE,C.loader.abort()));var W=D[T],Y=0;if(S.live||(l=W.details)!==null&&l!==void 0&&l.live){if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed)return;Y=this.alignPlaylists(S,W.details)}if(W.details=S,this.levelLastLoaded=T,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:S,level:T}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(S))return;this.state=B.State.IDLE}this.startFragRequested?S.live&&this.synchronizeToLiveEdge(S):this.setStartPosition(S,Y),this.tick()},A._handleFragmentLoadProgress=function(h){var s,l=h.frag,D=h.part,T=h.payload,S=this.levels;if(!S){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var I=S[l.level],C=I.details;if(!C){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var W=I.videoCodec,Y=C.PTSKnown||!C.live,H=(s=l.initSegment)===null||s===void 0?void 0:s.data,F=this._getAudioCodec(I),q=this.transmuxer=this.transmuxer||new g.default(this.hls,R.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),le=D?D.index:-1,pe=le!==-1,Ae=new w.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,T.byteLength,le,pe),Ge=this.initPTS[l.cc];q.push(T,H,F,W,l,D,C.totalduration,Y,Ae,Ge)},A.onAudioTrackSwitching=function(h,s){var l=this.altAudio,D=!!s.url,T=s.id;if(!D){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var S=this.fragCurrent;S!=null&&S.loader&&(this.log("Switching to main audio track, cancel main fragment load"),S.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;l&&I.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:T})}},A.onAudioTrackSwitched=function(h,s){var l=s.id,D=!!this.hls.audioTracks[l].url;if(D){var T=this.videoBuffer;T&&this.mediaBuffer!==T&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=T)}this.altAudio=D,this.tick()},A.onBufferCreated=function(h,s){var l=s.tracks,D,T,S=!1;for(var I in l){var C=l[I];if(C.id==="main"){if(T=I,D=C,I==="video"){var W=l[I];W&&(this.videoBuffer=W.buffer)}}else S=!0}S&&D?(this.log("Alternate track found, use "+T+".buffered to schedule main fragment loading"),this.mediaBuffer=D.buffer):this.mediaBuffer=this.media},A.onFragBuffered=function(h,s){var l=s.frag,D=s.part;if(l&&l.type!==R.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(D?" p: "+D.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var T=D?D.stats:l.stats;this.fragLastKbps=Math.round(8*T.total/(T.buffering.end-T.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,D)},A.onError=function(h,s){switch(s.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(R.PlaylistLevelType.MAIN,s);break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=B.State.ERROR):!s.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var l=!0,D=this.getFwdBufferInfo(this.media,R.PlaylistLevelType.MAIN);D&&D.len>.5&&(l=!this.reduceMaxBufferLength(D.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},A.checkBuffer=function(){var h=this.media,s=this.gapController;if(!h||!s||!h.readyState)return;var l=U.BufferHelper.getBuffered(h);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=h.currentTime},A.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},A.onBufferFlushed=function(h,s){var l=s.type;if(l!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var D=(l===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(D,l,R.PlaylistLevelType.MAIN)}},A.onLevelsUpdated=function(h,s){this.levels=s.levels},A.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},A.seekToStartPos=function(){var h=this.media,s=h.currentTime,l=this.startPosition;if(l>=0&&s<l){if(h.seeking){m.logger.log("could not seek to "+l+", already seeking at "+s);return}var D=U.BufferHelper.getBuffered(h),T=D.length?D.start(0):0,S=T-l;S>0&&(S<this.config.maxBufferHole||S<this.config.maxFragLookUpTolerance)&&(m.logger.log("adjusting start position by "+S+" to match buffer start"),l+=S,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+s),h.currentTime=l}},A._getAudioCodec=function(h){var s=this.config.defaultAudioCodec||h.audioCodec;return this.audioCodecSwap&&s&&(this.log("Swapping audio codec"),s.indexOf("mp4a.40.5")!==-1?s="mp4a.40.2":s="mp4a.40.5"),s},A._loadBitrateTestFrag=function(h){var s=this;this._doFragLoad(h).then(function(l){var D=s.hls;if(!l||D.nextLoadLevel||s.fragContextChanged(h))return;s.fragLoadError=0,s.state=B.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var T=h.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),D.trigger(j.Events.FRAG_LOADED,l)})},A._handleTransmuxComplete=function(h){var s,l="main",D=this.hls,T=h.remuxResult,S=h.chunkMeta,I=this.getCurrentContext(S);if(!I){this.warn("The loading context changed while buffering fragment "+S.sn+" of level "+S.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(S.level);return}var C=I.frag,W=I.part,Y=I.level,H=T.video,F=T.text,q=T.id3,le=T.initSegment,pe=this.altAudio?void 0:T.audio;if(this.fragContextChanged(C))return;if(this.state=B.State.PARSING,le){le.tracks&&(this._bufferInitSegment(Y,le.tracks,C,S),D.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:C,id:l,tracks:le.tracks}));var Ae=le.initPTS,Ge=le.timescale;Object(z.isFiniteNumber)(Ae)&&(this.initPTS[C.cc]=Ae,D.trigger(j.Events.INIT_PTS_FOUND,{frag:C,id:l,initPTS:Ae,timescale:Ge}))}if(H&&T.independent!==!1){if(Y.details){var Fe=H.startPTS,Ue=H.endPTS,_e=H.startDTS,je=H.endDTS;if(W)W.elementaryStreams[H.type]={startPTS:Fe,endPTS:Ue,startDTS:_e,endDTS:je};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var xe=this.getLoadPosition()+this.config.maxBufferHole;if(xe<Fe){this.backtrack(C);return}C.setElementaryStreamInfo(H.type,C.start,Ue,C.start,je,!0)}C.setElementaryStreamInfo(H.type,Fe,Ue,_e,je),this.bufferFragmentData(H,C,W,S)}}else if(T.independent===!1){this.backtrack(C);return}if(pe){var he=pe.startPTS,te=pe.endPTS,ye=pe.startDTS,ue=pe.endDTS;W&&(W.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:he,endPTS:te,startDTS:ye,endDTS:ue}),C.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,he,te,ye,ue),this.bufferFragmentData(pe,C,W,S)}if(q!=null&&(s=q.samples)!==null&&s!==void 0&&s.length){var Le={frag:C,id:l,samples:q.samples};D.trigger(j.Events.FRAG_PARSING_METADATA,Le)}if(F){var ae={frag:C,id:l,samples:F.samples};D.trigger(j.Events.FRAG_PARSING_USERDATA,ae)}},A._bufferInitSegment=function(h,s,l,D){var T=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var S=s.audio,I=s.video,C=s.audiovideo;if(S){var W=h.audioCodec,Y=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(W&&(W.indexOf("mp4a.40.5")!==-1?W="mp4a.40.2":W="mp4a.40.5"),S.metadata.channelCount!==1&&Y.indexOf("firefox")===-1&&(W="mp4a.40.5")),Y.indexOf("android")!==-1&&S.container!=="audio/mpeg"&&(W="mp4a.40.2",this.log("Android: force audio codec to "+W)),h.audioCodec&&h.audioCodec!==W&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+W+'"'),S.levelCodec=W,S.id="main",this.log("Init audio buffer, container:"+S.container+", codecs[selected/level/parsed]=["+(W||"")+"/"+(h.audioCodec||"")+"/"+S.codec+"]")}I&&(I.levelCodec=h.videoCodec,I.id="main",this.log("Init video buffer, container:"+I.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+I.codec+"]")),C&&this.log("Init audiovideo buffer, container:"+C.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+C.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(H){var F=s[H],q=F.initSegment;q!=null&&q.byteLength&&T.hls.trigger(j.Events.BUFFER_APPENDING,{type:H,data:q,frag:l,part:null,chunkMeta:D,parent:l.type})}),this.tick()},A.backtrack=function(h){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(h);var s=this.fragmentTracker.backtrack(h);this.fragPrevious=null,this.nextLoadPosition=h.start,s?this.resetFragmentLoading(h):this.state=B.State.BACKTRACKING},A.checkFragmentChanged=function(){var h=this.media,s=null;if(h&&h.readyState>1&&h.seeking===!1){var l=h.currentTime;if(U.BufferHelper.isBuffered(h,l)?s=this.getAppendedFrag(l):U.BufferHelper.isBuffered(h,l+.1)&&(s=this.getAppendedFrag(l+.1)),s){var D=this.fragPlaying,T=s.level;(!D||s.sn!==D.sn||D.level!==T||s.urlId!==D.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:s}),(!D||D.level!==T)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:T}),this.fragPlaying=s)}}},n(O,[{key:"nextLevel",get:function(){var h=this.nextBufferedFrag;return h?h.level:-1}},{key:"currentLevel",get:function(){var h=this.media;if(h){var s=this.getAppendedFrag(h.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var h=this.media;if(h){var s=this.getAppendedFrag(h.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"SubtitleStreamController",function(){return o});var z=P("./src/events.ts"),B=P("./src/utils/logger.ts"),M=P("./src/utils/buffer-helper.ts"),j=P("./src/controller/fragment-finders.ts"),U=P("./src/utils/discontinuities.ts"),_=P("./src/controller/level-helper.ts"),R=P("./src/controller/fragment-tracker.ts"),c=P("./src/controller/base-stream-controller.ts"),g=P("./src/types/loader.ts"),w=P("./src/types/level.ts");function y(u,x){for(var E=0;E<x.length;E++){var v=x[E];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,v.key,v)}}function f(u,x,E){return x&&y(u.prototype,x),E&&y(u,E),u}function m(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,a(u,x)}function a(u,x){return a=Object.setPrototypeOf||function(v,O){return v.__proto__=O,v},a(u,x)}var n=500,o=function(u){m(x,u);function x(v,O){var A;return A=u.call(this,v,O,"[subtitle-stream-controller]")||this,A.levels=[],A.currentTrackId=-1,A.tracksBuffered=[],A.mainDetails=null,A._registerListeners(),A}var E=x.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var O=this.hls;O.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(z.Events.ERROR,this.onError,this),O.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var O=this.hls;O.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(z.Events.ERROR,this.onError,this),O.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=c.State.IDLE,this.setInterval(n),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(O,A){this.mainDetails=A.details},E.onSubtitleFragProcessed=function(O,A){var p=A.frag,h=A.success;if(this.fragPrevious=p,this.state=c.State.IDLE,!h)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var l,D=p.start,T=0;T<s.length;T++)if(D>=s[T].start&&D<=s[T].end){l=s[T];break}var S=p.start+p.duration;l?l.end=S:(l={start:D,end:S},s.push(l)),this.fragmentTracker.fragBuffered(p)},E.onBufferFlushing=function(O,A){var p=A.startOffset,h=A.endOffset;if(p===0&&h!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,l=this.levels;if(!l.length||!l[s]||!l[s].details)return;var D=l[s].details,T=D.targetduration,S=h-T;if(S<=0)return;A.endOffsetSubtitles=Math.max(0,S),this.tracksBuffered.forEach(function(I){for(var C=0;C<I.length;){if(I[C].end<=S){I.shift();continue}else if(I[C].start<S)I[C].start=S;else break;C++}}),this.fragmentTracker.removeFragmentsInRange(p,S,g.PlaylistLevelType.SUBTITLE)}},E.onError=function(O,A){var p,h=A.frag;if(!h||h.type!==g.PlaylistLevelType.SUBTITLE)return;(p=this.fragCurrent)!==null&&p!==void 0&&p.loader&&this.fragCurrent.loader.abort(),this.state=c.State.IDLE},E.onSubtitleTracksUpdated=function(O,A){var p=this,h=A.subtitleTracks;this.tracksBuffered=[],this.levels=h.map(function(s){return new w.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){p.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(O,A){if(this.currentTrackId=A.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var p=this.levels[this.currentTrackId];p!=null&&p.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,p&&this.setInterval(n)},E.onSubtitleTrackLoaded=function(O,A){var p,h=A.details,s=A.id,l=this.currentTrackId,D=this.levels;if(!D.length)return;var T=D[l];if(s>=D.length||s!==l||!T)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,h.live||(p=T.details)!==null&&p!==void 0&&p.live){var S=this.mainDetails;if(h.deltaUpdateFailed||!S)return;var I=S.fragments[0];if(!T.details)h.hasProgramDateTime&&S.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(h,S):I&&Object(_.addSliding)(h,I.start);else{var C=this.alignPlaylists(h,T.details);C===0&&I&&Object(_.addSliding)(h,I.start)}}if(T.details=h,this.levelLastLoaded=s,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE){var W=Object(j.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),T.details=void 0)}},E._handleFragmentLoadComplete=function(O){var A=O.frag,p=O.payload,h=A.decryptdata,s=this.hls;if(this.fragContextChanged(A))return;if(p&&p.byteLength>0&&h&&h.key&&h.iv&&h.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(p),h.key.buffer,h.iv.buffer).then(function(D){var T=performance.now();s.trigger(z.Events.FRAG_DECRYPTED,{frag:A,payload:D,stats:{tstart:l,tdecrypt:T}})})}},E.doTick=function(){if(!this.media){this.state=c.State.IDLE;return}if(this.state===c.State.IDLE){var O,A=this.currentTrackId,p=this.levels;if(!p.length||!p[A]||!p[A].details)return;var h=p[A].details,s=h.targetduration,l=this.config,D=this.media,T=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,D.currentTime-s,l.maxBufferHole),S=T.end,I=T.len,C=this.getMaxBufferLength()+s;if(I>C)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var W=h.fragments,Y=W.length,H=h.edge,F,q=this.fragPrevious;if(S<H){var le=l.maxFragLookUpTolerance;q&&h.hasProgramDateTime&&(F=Object(j.findFragmentByPDT)(W,q.endProgramDateTime,le)),F||(F=Object(j.findFragmentByPTS)(q,W,S,le),!F&&q&&q.start<W[0].start&&(F=W[0]))}else F=W[Y-1];(O=F)!==null&&O!==void 0&&O.encrypted?(B.logger.log("Loading key for "+F.sn),this.state=c.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:F})):F&&this.fragmentTracker.getState(F)===R.FragmentState.NOT_LOADED&&this.loadFragment(F,h,S)}},E.loadFragment=function(O,A,p){this.fragCurrent=O,u.prototype.loadFragment.call(this,O,A,p)},f(x,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),x}(c.default)},"./src/controller/subtitle-track-controller.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/events.ts"),B=P("./src/utils/texttrack-utils.ts"),M=P("./src/controller/base-playlist-controller.ts"),j=P("./src/types/loader.ts");function U(y,f){for(var m=0;m<f.length;m++){var a=f[m];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(y,a.key,a)}}function _(y,f,m){return f&&U(y.prototype,f),m&&U(y,m),y}function R(y,f){y.prototype=Object.create(f.prototype),y.prototype.constructor=y,c(y,f)}function c(y,f){return c=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},c(y,f)}var g=function(y){R(f,y);function f(a){var n;return n=y.call(this,a,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var m=f.prototype;return m.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,y.prototype.destroy.call(this)},m.registerListeners=function(){var n=this.hls;n.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(z.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){var n=this.hls;n.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(z.Events.ERROR,this.onError,this)},m.onMediaAttached=function(n,o){if(this.media=o.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)},m.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},m.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 n=w(this.media.textTracks);n.forEach(function(o){Object(B.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},m.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},m.onManifestParsed=function(n,o){this.tracks=o.subtitleTracks},m.onSubtitleTrackLoaded=function(n,o){var u=o.id,x=o.details,E=this.trackId,v=this.tracksInGroup[E];if(!v){this.warn("Invalid subtitle track id "+u);return}var O=v.details;v.details=o.details,this.log("subtitle track "+u+" loaded ["+x.startSN+"-"+x.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,o,O))},m.onLevelLoading=function(n,o){this.switchLevel(o.level)},m.onLevelSwitching=function(n,o){this.switchLevel(o.level)},m.switchLevel=function(n){var o=this.hls.levels[n];if(!(o!=null&&o.textGroupIds))return;var u=o.textGroupIds[o.urlId];if(this.groupId!==u){var x=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(A){return!u||A.groupId===u});this.tracksInGroup=E;var v=this.findTrackId(x==null?void 0:x.name)||this.findTrackId();this.groupId=u;var O={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,O),v!==-1&&this.setSubtitleTrack(v,x)}},m.findTrackId=function(n){for(var o=this.tracksInGroup,u=0;u<o.length;u++){var x=o[u];if((!this.selectDefaultTrack||x.default)&&(!n||n===x.name))return x.id}return-1},m.onError=function(n,o){if(y.prototype.onError.call(this,n,o),o.fatal||!o.context)return;o.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},m.loadPlaylist=function(n){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var u=o.id,x=o.groupId,E=o.url;if(n)try{E=n.addDirectives(E)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Loading subtitle playlist for id "+u),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:E,id:u,groupId:x,deliveryDirectives:n||null})}},m.toggleTrackModes=function(n){var o=this,u=this.media,x=this.subtitleDisplay,E=this.trackId;if(!u)return;var v=w(u.textTracks),O=v.filter(function(h){return h.groupId===o.groupId});if(n===-1)[].slice.call(v).forEach(function(h){h.mode="disabled"});else{var A=O[E];A&&(A.mode="disabled")}var p=O[n];p&&(p.mode=x?"showing":"hidden")},m.setSubtitleTrack=function(n,o){var u,x=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(u=x[n])!==null&&u!==void 0&&u.details)||n<-1||n>=x.length)return;this.clearTimer();var E=x[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,E){var v=E.id,O=E.groupId,A=O===void 0?"":O,p=E.name,h=E.type,s=E.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:v,groupId:A,name:p,type:h,url:s});var l=this.switchParams(E.url,o==null?void 0:o.details);this.loadPlaylist(l)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:n})},m.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,o=w(this.media.textTracks),u=0;u<o.length;u++)if(o[u].mode==="hidden")n=u;else if(o[u].mode==="showing"){n=u;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},_(f,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,o)}}]),f}(M.default);function w(y){for(var f=[],m=0;m<y.length;m++){var a=y[m];a.kind==="subtitles"&&a.label&&f.push(y[m])}return f}K.default=g},"./src/controller/timeline-controller.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"TimelineController",function(){return w});var z=P("./src/polyfills/number.ts"),B=P("./src/events.ts"),M=P("./src/utils/cea-608-parser.ts"),j=P("./src/utils/output-filter.ts"),U=P("./src/utils/webvtt-parser.ts"),_=P("./src/utils/texttrack-utils.ts"),R=P("./src/utils/imsc1-ttml-parser.ts"),c=P("./src/types/loader.ts"),g=P("./src/utils/logger.ts"),w=function(){function a(o){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=m(),this.captionsProperties=void 0,this.hls=o,this.config=o.config,this.Cues=o.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 u=new j.default(this,"textTrack1"),x=new j.default(this,"textTrack2"),E=new j.default(this,"textTrack3"),v=new j.default(this,"textTrack4");this.cea608Parser1=new M.default(1,u,x),this.cea608Parser2=new M.default(3,E,v)}o.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(B.Events.FRAG_LOADING,this.onFragLoading,this),o.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=a.prototype;return n.destroy=function(){var u=this.hls;u.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.off(B.Events.FRAG_LOADING,this.onFragLoading,this),u.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(u,x,E,v,O){for(var A=!1,p=O.length;p--;){var h=O[p],s=f(h[0],h[1],x,E);if(s>=0&&(h[0]=Math.min(h[0],x),h[1]=Math.max(h[1],E),A=!0,s/(E-x)>.5))return}if(A||O.push([x,E]),this.config.renderTextTracksNatively){var l=this.captionsTracks[u];this.Cues.newCue(l,x,E,v)}else{var D=this.Cues.newCue(null,x,E,v);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:D,track:u})}},n.onInitPtsFound=function(u,x){var E=this,v=x.frag,O=x.id,A=x.initPTS,p=x.timescale,h=this.unparsedVttFrags;O==="main"&&(this.initPTS[v.cc]=A,this.timescale[v.cc]=p),h.length&&(this.unparsedVttFrags=[],h.forEach(function(s){E.onFragLoaded(B.Events.FRAG_LOADED,s)}))},n.getExistingTrack=function(u){var x=this.media;if(x)for(var E=0;E<x.textTracks.length;E++){var v=x.textTracks[E];if(v[u])return v}return null},n.createCaptionsTrack=function(u){this.config.renderTextTracksNatively?this.createNativeTrack(u):this.createNonNativeTrack(u)},n.createNativeTrack=function(u){if(this.captionsTracks[u])return;var x=this.captionsProperties,E=this.captionsTracks,v=this.media,O=x[u],A=O.label,p=O.languageCode,h=this.getExistingTrack(u);if(h)E[u]=h,Object(_.clearCurrentCues)(E[u]),Object(_.sendAddTrackEvent)(E[u],v);else{var s=this.createTextTrack("captions",A,p);s&&(s[u]=!0,E[u]=s)}},n.createNonNativeTrack=function(u){if(this.nonNativeCaptionsTracks[u])return;var x=this.captionsProperties[u];if(!x)return;var E=x.label,v={_id:u,label:E,kind:"captions",default:x.media?!!x.media.default:!1,closedCaptions:x.media};this.nonNativeCaptionsTracks[u]=v,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[v]})},n.createTextTrack=function(u,x,E){var v=this.media;return v?v.addTextTrack(u,x,E):void 0},n.onMediaAttaching=function(u,x){this.media=x.media,this._cleanTracks()},n.onMediaDetaching=function(){var u=this.captionsTracks;Object.keys(u).forEach(function(x){Object(_.clearCurrentCues)(u[x]),delete u[x]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=m(),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())},n._cleanTracks=function(){var u=this.media;if(!u)return;var x=u.textTracks;if(x)for(var E=0;E<x.length;E++)Object(_.clearCurrentCues)(x[E])},n.onSubtitleTracksUpdated=function(u,x){var E=this;this.textTracks=[];var v=x.subtitleTracks||[],O=v.some(function(s){return s.textCodec===R.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var A=this.tracks&&v&&this.tracks.length===v.length;if(this.tracks=v||[],this.config.renderTextTracksNatively){var p=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,l){var D;if(l<p.length){for(var T=null,S=0;S<p.length;S++)if(y(p[S],s)){T=p[S];break}T&&(D=T)}D?Object(_.clearCurrentCues)(D):(D=E.createTextTrack("subtitles",s.name,s.lang),D&&(D.mode="disabled")),D&&(D.groupId=s.groupId,E.textTracks.push(D))})}else if(!A&&this.tracks&&this.tracks.length){var h=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}},n.onManifestLoaded=function(u,x){var E=this;this.config.enableCEA708Captions&&x.captions&&x.captions.forEach(function(v){var O=/(?:CC|SERVICE)([1-4])/.exec(v.instreamId);if(!O)return;var A="textTrack"+O[1],p=E.captionsProperties[A];if(!p)return;p.label=v.name,v.lang&&(p.languageCode=v.lang),p.media=v})},n.onFragLoading=function(u,x){var E=this.cea608Parser1,v=this.cea608Parser2,O=this.lastSn,A=this.lastPartIndex;if(!this.enabled||!(E&&v))return;if(x.frag.type===c.PlaylistLevelType.MAIN){var p,h,s=x.frag.sn,l=(p=x==null||((h=x.part)===null||h===void 0)?void 0:h.index)!=null?p:-1;s===O+1||s===O&&l===A+1||(E.reset(),v.reset()),this.lastSn=s,this.lastPartIndex=l}},n.onFragLoaded=function(u,x){var E=x.frag,v=x.payload,O=this.initPTS,A=this.unparsedVttFrags;if(E.type===c.PlaylistLevelType.SUBTITLE)if(v.byteLength){if(!Object(z.isFiniteNumber)(O[E.cc])){A.push(x),O.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var p=E.decryptdata;if(p==null||p.key==null||p.method!=="AES-128"){var h=this.tracks[E.level],s=this.vttCCs;s[E.cc]||(s[E.cc]={start:E.start,prevCC:this.prevCC,new:!0},this.prevCC=E.cc),h&&h.textCodec===R.IMSC1_CODEC?this._parseIMSC1(E,v):this._parseVTTs(E,v,s)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(u,x){var E=this,v=this.hls;Object(R.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(O){E._appendCues(O,u.level),v.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(O){g.logger.log("Failed to parse IMSC1: "+O),v.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:O})})},n._parseVTTs=function(u,x,E){var v=this,O=this.hls;Object(U.parseWebVTT)(x,this.initPTS[u.cc],this.timescale[u.cc],E,u.cc,u.start,function(A){v._appendCues(A,u.level),O.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:u})},function(A){v._fallbackToIMSC1(u,x),g.logger.log("Failed to parse VTT cue: "+A),O.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:u,error:A})})},n._fallbackToIMSC1=function(u,x){var E=this,v=this.tracks[u.level];v.textCodec||Object(R.parseIMSC1)(x,this.initPTS[u.cc],this.timescale[u.cc],function(){v.textCodec=R.IMSC1_CODEC,E._parseIMSC1(u,x)},function(){v.textCodec="wvtt"})},n._appendCues=function(u,x){var E=this.hls;if(this.config.renderTextTracksNatively){var v=this.textTracks[x];if(v.mode==="disabled")return;u.forEach(function(p){return Object(_.addCueToTrack)(v,p)})}else{var O=this.tracks[x],A=O.default?"default":"subtitles"+x;E.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:u,track:A})}},n.onFragDecrypted=function(u,x){var E=x.frag;if(E.type===c.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(x);return}this.onFragLoaded(B.Events.FRAG_LOADED,x)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(u,x){var E=this.cea608Parser1,v=this.cea608Parser2;if(!this.enabled||!(E&&v))return;for(var O=0;O<x.samples.length;O++){var A=x.samples[O].bytes;if(A){var p=this.extractCea608Data(A);E.addData(x.samples[O].pts,p[0]),v.addData(x.samples[O].pts,p[1])}}},n.onBufferFlushing=function(u,x){var E=x.startOffset,v=x.endOffset,O=x.endOffsetSubtitles,A=x.type,p=this.media;if(!p||p.currentTime<v)return;if(!A||A==="video"){var h=this.captionsTracks;Object.keys(h).forEach(function(l){return Object(_.removeCuesInRange)(h[l],E,v)})}if(this.config.renderTextTracksNatively&&(E===0&&O!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(l){return Object(_.removeCuesInRange)(s[l],E,O)})}},n.extractCea608Data=function(u){for(var x=u[0]&31,E=2,v=[[],[]],O=0;O<x;O++){var A=u[E++],p=127&u[E++],h=127&u[E++],s=(4&A)!==0,l=3&A;if(p===0&&h===0)continue;s&&((l===0||l===1)&&(v[l].push(p),v[l].push(h)))}return v},a}();function y(a,n){return a&&a.label===n.name&&!(a.textTrack1||a.textTrack2)}function f(a,n,o,u){return Math.min(n,u)-Math.max(a,o)}function m(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return z});var z=function(){function B(j,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=U}var M=B.prototype;return M.decrypt=function(U,_){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},_,U)},B}()},"./src/crypt/aes-decryptor.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"removePadding",function(){return B}),P.d(K,"default",function(){return M});var z=P("./src/utils/typed-array.ts");function B(j){var U=j.byteLength,_=U&&new DataView(j.buffer).getUint8(U-1);return _?Object(z.sliceUint8)(j,0,U-_):j}var M=function(){function j(){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 U=j.prototype;return U.uint8ArrayToUint32Array_=function(R){for(var c=new DataView(R),g=new Uint32Array(4),w=0;w<4;w++)g[w]=c.getUint32(w*4);return g},U.initTable=function(){var R=this.sBox,c=this.invSBox,g=this.subMix,w=g[0],y=g[1],f=g[2],m=g[3],a=this.invSubMix,n=a[0],o=a[1],u=a[2],x=a[3],E=new Uint32Array(256),v=0,O=0,A=0;for(A=0;A<256;A++)A<128?E[A]=A<<1:E[A]=A<<1^283;for(A=0;A<256;A++){var p=O^O<<1^O<<2^O<<3^O<<4;p=p>>>8^p&255^99,R[v]=p,c[p]=v;var h=E[v],s=E[h],l=E[s],D=E[p]*257^p*16843008;w[v]=D<<24|D>>>8,y[v]=D<<16|D>>>16,f[v]=D<<8|D>>>24,m[v]=D,D=l*16843009^s*65537^h*257^v*16843008,n[p]=D<<24|D>>>8,o[p]=D<<16|D>>>16,u[p]=D<<8|D>>>24,x[p]=D,v?(v=h^E[E[E[l^h]]],O^=E[E[O]]):v=O=1}},U.expandKey=function(R){for(var c=this.uint8ArrayToUint32Array_(R),g=!0,w=0;w<c.length&&g;)g=c[w]===this.key[w],w++;if(g)return;this.key=c;var y=this.keySize=c.length;if(y!==4&&y!==6&&y!==8)throw new Error("Invalid aes key size="+y);var f=this.ksRows=(y+6+1)*4,m,a,n=this.keySchedule=new Uint32Array(f),o=this.invKeySchedule=new Uint32Array(f),u=this.sBox,x=this.rcon,E=this.invSubMix,v=E[0],O=E[1],A=E[2],p=E[3],h,s;for(m=0;m<f;m++){if(m<y){h=n[m]=c[m];continue}s=h,m%y===0?(s=s<<8|s>>>24,s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255],s^=x[m/y|0]<<24):y>6&&m%y===4&&(s=u[s>>>24]<<24|u[s>>>16&255]<<16|u[s>>>8&255]<<8|u[s&255]),n[m]=h=(n[m-y]^s)>>>0}for(a=0;a<f;a++)m=f-a,a&3?s=n[m]:s=n[m-4],a<4||m<=4?o[a]=s:o[a]=v[u[s>>>24]]^O[u[s>>>16&255]]^A[u[s>>>8&255]]^p[u[s&255]],o[a]=o[a]>>>0},U.networkToHostOrderSwap=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},U.decrypt=function(R,c,g){for(var w=this.keySize+6,y=this.invKeySchedule,f=this.invSBox,m=this.invSubMix,a=m[0],n=m[1],o=m[2],u=m[3],x=this.uint8ArrayToUint32Array_(g),E=x[0],v=x[1],O=x[2],A=x[3],p=new Int32Array(R),h=new Int32Array(p.length),s,l,D,T,S,I,C,W,Y,H,F,q,le,pe,Ae=this.networkToHostOrderSwap;c<p.length;){for(Y=Ae(p[c]),H=Ae(p[c+1]),F=Ae(p[c+2]),q=Ae(p[c+3]),S=Y^y[0],I=q^y[1],C=F^y[2],W=H^y[3],le=4,pe=1;pe<w;pe++)s=a[S>>>24]^n[I>>16&255]^o[C>>8&255]^u[W&255]^y[le],l=a[I>>>24]^n[C>>16&255]^o[W>>8&255]^u[S&255]^y[le+1],D=a[C>>>24]^n[W>>16&255]^o[S>>8&255]^u[I&255]^y[le+2],T=a[W>>>24]^n[S>>16&255]^o[I>>8&255]^u[C&255]^y[le+3],S=s,I=l,C=D,W=T,le=le+4;s=f[S>>>24]<<24^f[I>>16&255]<<16^f[C>>8&255]<<8^f[W&255]^y[le],l=f[I>>>24]<<24^f[C>>16&255]<<16^f[W>>8&255]<<8^f[S&255]^y[le+1],D=f[C>>>24]<<24^f[W>>16&255]<<16^f[S>>8&255]<<8^f[I&255]^y[le+2],T=f[W>>>24]<<24^f[S>>16&255]<<16^f[I>>8&255]<<8^f[C&255]^y[le+3],h[c]=Ae(s^E),h[c+1]=Ae(T^v),h[c+2]=Ae(D^O),h[c+3]=Ae(l^A),E=Y,v=H,O=F,A=q,c=c+4}return h.buffer},j}()},"./src/crypt/decrypter.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return c});var z=P("./src/crypt/aes-crypto.ts"),B=P("./src/crypt/fast-aes-key.ts"),M=P("./src/crypt/aes-decryptor.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/mp4-tools.ts"),_=P("./src/utils/typed-array.ts"),R=16,c=function(){function g(y,f,m){var a=m===void 0?{}:m,n=a.removePKCS7Padding,o=n===void 0?!0:n;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=y,this.config=f,this.removePKCS7Padding=o,o)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(x){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var w=g.prototype;return w.destroy=function(){this.observer=null},w.isSync=function(){return this.config.enableSoftwareAES},w.flush=function(){var f=this.currentResult;if(!f){this.reset();return}var m=new Uint8Array(f);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(m):m},w.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},w.decrypt=function(f,m,a,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(f),m,a);var o=this.flush();o&&n(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(f),m,a).then(n)},w.softwareDecrypt=function(f,m,a){var n=this.currentIV,o=this.currentResult,u=this.remainderData;this.logOnce("JS AES decrypt"),u&&(f=Object(U.appendUint8Array)(u,f),this.remainderData=null);var x=this.getValidChunk(f);if(!x.length)return null;n&&(a=n);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new M.default),E.expandKey(m);var v=o;return this.currentResult=E.decrypt(x.buffer,0,a),this.currentIV=Object(_.sliceUint8)(x,-16).buffer,v||null},w.webCryptoDecrypt=function(f,m,a){var n=this,o=this.subtle;return(this.key!==m||!this.fastAesKey)&&(this.key=m,this.fastAesKey=new B.default(o,m)),this.fastAesKey.expandKey().then(function(u){if(!o)return Promise.reject(new Error("web crypto not initialized"));var x=new z.default(o,a);return x.decrypt(f.buffer,u)}).catch(function(u){return n.onWebCryptoError(u,f,m,a)})},w.onWebCryptoError=function(f,m,a,n){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",f),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(m,a,n)},w.getValidChunk=function(f){var m=f,a=f.length-f.length%R;return a!==f.length&&(m=Object(_.sliceUint8)(f,0,a),this.remainderData=Object(_.sliceUint8)(f,a)),m},w.logOnce=function(f){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+f),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return z});var z=function(){function B(j,U){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=U}var M=B.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/demux/base-audio-demuxer.ts"),B=P("./src/demux/adts.ts"),M=P("./src/utils/logger.ts"),j=P("./src/demux/id3.ts");function U(c,g){c.prototype=Object.create(g.prototype),c.prototype.constructor=c,_(c,g)}function _(c,g){return _=Object.setPrototypeOf||function(y,f){return y.__proto__=f,y},_(c,g)}var R=function(c){U(g,c);function g(y,f){var m;return m=c.call(this)||this,m.observer=void 0,m.config=void 0,m.observer=y,m.config=f,m}var w=g.prototype;return w.resetInitSegment=function(f,m,a){c.prototype.resetInitSegment.call(this,f,m,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},g.probe=function(f){if(!f)return!1;for(var m=j.getID3Data(f,0)||[],a=m.length,n=f.length;a<n;a++)if(B.probe(f,a))return M.logger.log("ADTS sync word found !"),!0;return!1},w.canParse=function(f,m){return B.canParse(f,m)},w.appendFrame=function(f,m,a){B.initTrackConfig(f,this.observer,m,a,f.manifestCodec);var n=B.appendFrame(f,m,a,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},g}(z.default);R.minProbeByteLength=9,K.default=R},"./src/demux/adts.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"getAudioConfig",function(){return j}),P.d(K,"isHeaderPattern",function(){return U}),P.d(K,"getHeaderLength",function(){return _}),P.d(K,"getFullFrameLength",function(){return R}),P.d(K,"canGetFrameLength",function(){return c}),P.d(K,"isHeader",function(){return g}),P.d(K,"canParse",function(){return w}),P.d(K,"probe",function(){return y}),P.d(K,"initTrackConfig",function(){return f}),P.d(K,"getFrameDuration",function(){return m}),P.d(K,"parseFrameHeader",function(){return a}),P.d(K,"appendFrame",function(){return n});var z=P("./src/utils/logger.ts"),B=P("./src/errors.ts"),M=P("./src/events.ts");function j(o,u,x,E){var v,O,A,p,h=navigator.userAgent.toLowerCase(),s=E,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];v=((u[x+2]&192)>>>6)+1;var D=(u[x+2]&60)>>>2;if(D>l.length-1){o.trigger(M.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+D});return}return A=(u[x+2]&1)<<2,A|=(u[x+3]&192)>>>6,z.logger.log("manifest codec:"+E+", ADTS type:"+v+", samplingIndex:"+D),/firefox/i.test(h)?D>=6?(v=5,p=new Array(4),O=D-3):(v=2,p=new Array(2),O=D):h.indexOf("android")!==-1?(v=2,p=new Array(2),O=D):(v=5,p=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&D>=6?O=D-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(D>=6&&A===1||/vivaldi/i.test(h))||!E&&A===1)&&(v=2,p=new Array(2)),O=D)),p[0]=v<<3,p[0]|=(D&14)>>1,p[1]|=(D&1)<<7,p[1]|=A<<3,v===5&&(p[1]|=(O&14)>>1,p[2]=(O&1)<<7,p[2]|=2<<2,p[3]=0),{config:p,samplerate:l[D],channelCount:A,codec:"mp4a.40."+v,manifestCodec:s}}function U(o,u){return o[u]===255&&(o[u+1]&246)===240}function _(o,u){return o[u+1]&1?7:9}function R(o,u){return(o[u+3]&3)<<11|o[u+4]<<3|(o[u+5]&224)>>>5}function c(o,u){return u+5<o.length}function g(o,u){return u+1<o.length&&U(o,u)}function w(o,u){return c(o,u)&&U(o,u)&&R(o,u)<=o.length-u}function y(o,u){if(g(o,u)){var x=_(o,u);if(u+x>=o.length)return!1;var E=R(o,u);if(E<=x)return!1;var v=u+E;return v===o.length||g(o,v)}return!1}function f(o,u,x,E,v){if(!o.samplerate){var O=j(u,x,E,v);if(!O)return;o.config=O.config,o.samplerate=O.samplerate,o.channelCount=O.channelCount,o.codec=O.codec,o.manifestCodec=O.manifestCodec,z.logger.log("parsed codec:"+o.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function m(o){return 1024*9e4/o}function a(o,u,x,E,v){var O=_(o,u),A=R(o,u);if(A-=O,A>0){var p=x+E*v;return{headerLength:O,frameLength:A,stamp:p}}}function n(o,u,x,E,v){var O=m(o.samplerate),A=a(u,x,E,v,O);if(A){var p=A.frameLength,h=A.headerLength,s=A.stamp,l=h+p,D=Math.max(0,x+l-u.length),T;D?(T=new Uint8Array(l-h),T.set(u.subarray(x+h,u.length),0)):T=u.subarray(x+h,x+l);var S={unit:T,pts:s};return D||o.samples.push(S),{sample:S,length:l,missing:D}}}},"./src/demux/base-audio-demuxer.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"initPTSFn",function(){return R});var z=P("./src/polyfills/number.ts"),B=P("./src/demux/id3.ts"),M=P("./src/demux/dummy-demuxed-track.ts"),j=P("./src/utils/mp4-tools.ts"),U=P("./src/utils/typed-array.ts"),_=function(){function c(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=c.prototype;return g.resetInitSegment=function(y,f,m){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(y,f){return!1},g.appendFrame=function(y,f,m){},g.demux=function(y,f){this.cachedData&&(y=Object(j.appendUint8Array)(this.cachedData,y),this.cachedData=null);var m=B.getID3Data(y,0),a=m?m.length:0,n,o,u=this._audioTrack,x=this._id3Track,E=m?B.getTimeStamp(m):void 0,v=y.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=R(E,f)),m&&m.length>0&&x.samples.push({pts:this.initPTS,dts:this.initPTS,data:m}),o=this.initPTS;a<v;){if(this.canParse(y,a)){var O=this.appendFrame(u,y,a);O?(this.frameIndex++,o=O.sample.pts,a+=O.length,n=a):a=v}else B.canParse(y,a)?(m=B.getID3Data(y,a),x.samples.push({pts:o,dts:o,data:m}),a+=m.length,n=a):a++;if(a===v&&n!==v){var A=Object(U.sliceUint8)(y,n);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,A):this.cachedData=A}}return{audioTrack:u,avcTrack:Object(M.dummyTrack)(),id3Track:x,textTrack:Object(M.dummyTrack)()}},g.demuxSampleAes=function(y,f,m){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(y){var f=this.cachedData;return f&&(this.cachedData=null,this.demux(f,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},g.destroy=function(){},c}(),R=function(g,w){return Object(z.isFiniteNumber)(g)?g*90:w*9e4};K.default=_},"./src/demux/chunk-cache.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return z});var z=function(){function M(){this.chunks=[],this.dataLength=0}var j=M.prototype;return j.push=function(_){this.chunks.push(_),this.dataLength+=_.length},j.flush=function(){var _=this.chunks,R=this.dataLength,c;if(_.length)_.length===1?c=_[0]:c=B(_,R);else return new Uint8Array(0);return this.reset(),c},j.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function B(M,j){for(var U=new Uint8Array(j),_=0,R=0;R<M.length;R++){var c=M[R];U.set(c,_),_+=c.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/utils/logger.ts"),B=function(){function M(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var j=M.prototype;return j.loadWord=function(){var _=this.data,R=this.bytesAvailable,c=_.byteLength-R,g=new Uint8Array(4),w=Math.min(4,R);if(w===0)throw new Error("no bytes available");g.set(_.subarray(c,c+w)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=w*8,this.bytesAvailable-=w},j.skipBits=function(_){var R;this.bitsAvailable>_?(this.word<<=_,this.bitsAvailable-=_):(_-=this.bitsAvailable,R=_>>3,_-=R>>3,this.bytesAvailable-=R,this.loadWord(),this.word<<=_,this.bitsAvailable-=_)},j.readBits=function(_){var R=Math.min(this.bitsAvailable,_),c=this.word>>>32-R;return _>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=R,this.bitsAvailable>0?this.word<<=R:this.bytesAvailable>0&&this.loadWord(),R=_-R,R>0&&this.bitsAvailable?c<<R|this.readBits(R):c},j.skipLZ=function(){var _;for(_=0;_<this.bitsAvailable;++_)if((this.word&2147483648>>>_)!==0)return this.word<<=_,this.bitsAvailable-=_,_;return this.loadWord(),_+this.skipLZ()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var _=this.skipLZ();return this.readBits(_+1)-1},j.readEG=function(){var _=this.readUEG();return 1&_?1+_>>>1:-1*(_>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(_){for(var R=8,c=8,g,w=0;w<_;w++)c!==0&&(g=this.readEG(),c=(R+g+256)%256),R=c===0?R:c},j.readSPS=function(){var _=0,R=0,c=0,g=0,w,y,f,m=this.readUByte.bind(this),a=this.readBits.bind(this),n=this.readUEG.bind(this),o=this.readBoolean.bind(this),u=this.skipBits.bind(this),x=this.skipEG.bind(this),E=this.skipUEG.bind(this),v=this.skipScalingList.bind(this);m();var O=m();if(a(5),u(3),m(),E(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var A=n();if(A===3&&u(1),E(),E(),u(1),o())for(y=A!==3?8:12,f=0;f<y;f++)o()&&(f<6?v(16):v(64))}E();var p=n();if(p===0)n();else if(p===1)for(u(1),x(),x(),w=n(),f=0;f<w;f++)x();E(),u(1);var h=n(),s=n(),l=a(1);l===0&&u(1),u(1),o()&&(_=n(),R=n(),c=n(),g=n());var D=[1,1];if(o()&&o()){var T=m();switch(T){case 1:D=[1,1];break;case 2:D=[12,11];break;case 3:D=[10,11];break;case 4:D=[16,11];break;case 5:D=[40,33];break;case 6:D=[24,11];break;case 7:D=[20,11];break;case 8:D=[32,11];break;case 9:D=[80,33];break;case 10:D=[18,11];break;case 11:D=[15,11];break;case 12:D=[64,33];break;case 13:D=[160,99];break;case 14:D=[4,3];break;case 15:D=[3,2];break;case 16:D=[2,1];break;case 255:{D=[m()<<8|m(),m()<<8|m()];break}}}return{width:Math.ceil((h+1)*16-_*2-R*2),height:(2-l)*(s+1)*16-(l?2:4)*(c+g),pixelRatio:D}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();K.default=B},"./src/demux/id3.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"isHeader",function(){return z}),P.d(K,"isFooter",function(){return B}),P.d(K,"getID3Data",function(){return M}),P.d(K,"canParse",function(){return U}),P.d(K,"getTimeStamp",function(){return _}),P.d(K,"isTimeStampFrame",function(){return R}),P.d(K,"getID3Frames",function(){return g}),P.d(K,"decodeFrame",function(){return w}),P.d(K,"utf8ArrayToStr",function(){return n}),P.d(K,"testables",function(){return o});var z=function(v,O){return O+10<=v.length&&(v[O]===73&&v[O+1]===68&&v[O+2]===51&&(v[O+3]<255&&v[O+4]<255&&(v[O+6]<128&&v[O+7]<128&&v[O+8]<128&&v[O+9]<128)))},B=function(v,O){return O+10<=v.length&&(v[O]===51&&v[O+1]===68&&v[O+2]===73&&(v[O+3]<255&&v[O+4]<255&&(v[O+6]<128&&v[O+7]<128&&v[O+8]<128&&v[O+9]<128)))},M=function(v,O){for(var A=O,p=0;z(v,O);){p+=10;var h=j(v,O+6);p+=h,B(v,O+10)&&(p+=10),O+=p}return p>0?v.subarray(A,A+p):void 0},j=function(v,O){var A=0;return A=(v[O]&127)<<21,A|=(v[O+1]&127)<<14,A|=(v[O+2]&127)<<7,A|=v[O+3]&127,A},U=function(v,O){return z(v,O)&&j(v,O+6)+10<=v.length-O},_=function(v){for(var O=g(v),A=0;A<O.length;A++){var p=O[A];if(R(p))return a(p)}return},R=function(v){return v&&v.key==="PRIV"&&v.info==="com.apple.streaming.transportStreamTimestamp"},c=function(v){var O=String.fromCharCode(v[0],v[1],v[2],v[3]),A=j(v,4),p=10;return{type:O,size:A,data:v.subarray(p,p+A)}},g=function(v){for(var O=0,A=[];z(v,O);){var p=j(v,O+6);O+=10;for(var h=O+p;O+8<h;){var s=c(v.subarray(O)),l=w(s);l&&A.push(l),O+=s.size+10}B(v,O)&&(O+=10)}return A},w=function(v){return v.type==="PRIV"?y(v):v.type[0]==="W"?m(v):f(v)},y=function(v){if(v.size<2)return;var O=n(v.data,!0),A=new Uint8Array(v.data.subarray(O.length+1));return{key:v.type,info:O,data:A.buffer}},f=function(v){if(v.size<2)return;if(v.type==="TXXX"){var O=1,A=n(v.data.subarray(O),!0);O+=A.length+1;var p=n(v.data.subarray(O));return{key:v.type,info:A,data:p}}var h=n(v.data.subarray(1));return{key:v.type,data:h}},m=function(v){if(v.type==="WXXX"){if(v.size<2)return;var O=1,A=n(v.data.subarray(O),!0);O+=A.length+1;var p=n(v.data.subarray(O));return{key:v.type,info:A,data:p}}var h=n(v.data);return{key:v.type,data:h}},a=function(v){if(v.data.byteLength===8){var O=new Uint8Array(v.data),A=O[3]&1,p=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return p/=45,A&&(p+=4772185884e-2),Math.round(p)}return},n=function(v,O){O===void 0&&(O=!1);var A=x();if(A){var p=A.decode(v);if(O){var h=p.indexOf("\0");return h!==-1?p.substring(0,h):p}return p.replace(/\0/g,"")}for(var s=v.length,l,D,T,S="",I=0;I<s;){if(l=v[I++],l===0&&O)return S;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:S+=String.fromCharCode(l);break;case 12:case 13:D=v[I++],S+=String.fromCharCode((l&31)<<6|D&63);break;case 14:D=v[I++],T=v[I++],S+=String.fromCharCode((l&15)<<12|(D&63)<<6|(T&63)<<0);break;default:}}return S},o={decodeTextFrame:f},u;function x(){return!u&&typeof self.TextDecoder!="undefined"&&(u=new self.TextDecoder("utf-8")),u}},"./src/demux/mp3demuxer.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/demux/base-audio-demuxer.ts"),B=P("./src/demux/id3.ts"),M=P("./src/utils/logger.ts"),j=P("./src/demux/mpegaudio.ts");function U(c,g){c.prototype=Object.create(g.prototype),c.prototype.constructor=c,_(c,g)}function _(c,g){return _=Object.setPrototypeOf||function(y,f){return y.__proto__=f,y},_(c,g)}var R=function(c){U(g,c);function g(){return c.apply(this,arguments)||this}var w=g.prototype;return w.resetInitSegment=function(f,m,a){c.prototype.resetInitSegment.call(this,f,m,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:f,duration:a,inputTimeScale:9e4,dropped:0}},g.probe=function(f){if(!f)return!1;for(var m=B.getID3Data(f,0)||[],a=m.length,n=f.length;a<n;a++)if(j.probe(f,a))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},w.canParse=function(f,m){return j.canParse(f,m)},w.appendFrame=function(f,m,a){return this.initPTS===null?void 0:j.appendFrame(f,m,a,this.initPTS,this.frameIndex)},g}(z.default);R.minProbeByteLength=4,K.default=R},"./src/demux/mp4demuxer.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/utils/mp4-tools.ts"),B=P("./src/demux/dummy-demuxed-track.ts"),M=function(){function j(_,R){this.remainderData=null,this.config=void 0,this.config=R}var U=j.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},j.probe=function(R){return Object(z.findBox)({data:R,start:0,end:Math.min(R.length,16384)},["moof"]).length>0},U.demux=function(R){var c=R,g=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(c=Object(z.appendUint8Array)(this.remainderData,R));var w=Object(z.segmentValidRange)(c);this.remainderData=w.remainder,g.samples=w.valid||new Uint8Array}else g.samples=c;return{audioTrack:Object(B.dummyTrack)(),avcTrack:g,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},U.flush=function(){var R=Object(B.dummyTrack)();return R.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:R,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},U.demuxSampleAes=function(R,c,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},j}();M.minProbeByteLength=1024,K.default=M},"./src/demux/mpegaudio.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"appendFrame",function(){return _}),P.d(K,"parseHeader",function(){return R}),P.d(K,"isHeaderPattern",function(){return c}),P.d(K,"isHeader",function(){return g}),P.d(K,"canParse",function(){return w}),P.d(K,"probe",function(){return y});var z=null,B=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function _(f,m,a,n,o){if(a+24>m.length)return;var u=R(m,a);if(u&&a+u.frameLength<=m.length){var x=u.samplesPerFrame*9e4/u.sampleRate,E=n+o*x,v={unit:m.subarray(a,a+u.frameLength),pts:E,dts:E};return f.config=[],f.channelCount=u.channelCount,f.samplerate=u.sampleRate,f.samples.push(v),{sample:v,length:u.frameLength,missing:0}}}function R(f,m){var a=f[m+1]>>3&3,n=f[m+1]>>1&3,o=f[m+2]>>4&15,u=f[m+2]>>2&3;if(a!==1&&o!==0&&o!==15&&u!==3){var x=f[m+2]>>1&1,E=f[m+3]>>6,v=a===3?3-n:n===3?3:4,O=B[v*14+o-1]*1e3,A=a===3?0:a===2?1:2,p=M[A*3+u],h=E===3?1:2,s=j[a][n],l=U[n],D=s*8*l,T=Math.floor(s*O/p+x)*l;if(z===null){var S=navigator.userAgent||"",I=S.match(/Chrome\/(\d+)/i);z=I?parseInt(I[1]):0}var C=!!z&&z<=87;return C&&n===2&&O>=224e3&&E===0&&(f[m+3]=f[m+3]|128),{sampleRate:p,channelCount:h,frameLength:T,samplesPerFrame:D}}}function c(f,m){return f[m]===255&&(f[m+1]&224)===224&&(f[m+1]&6)!==0}function g(f,m){return m+1<f.length&&c(f,m)}function w(f,m){var a=4;return c(f,m)&&a<=f.length-m}function y(f,m){if(m+1<f.length&&c(f,m)){var a=4,n=R(f,m),o=a;n!=null&&n.frameLength&&(o=n.frameLength);var u=m+o;return u===f.length||g(f,u)}return!1}},"./src/demux/sample-aes.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/crypt/decrypter.ts"),B=P("./src/demux/tsdemuxer.ts"),M=function(){function j(_,R,c){this.keyData=void 0,this.decrypter=void 0,this.keyData=c,this.decrypter=new z.default(_,R,{removePKCS7Padding:!1})}var U=j.prototype;return U.decryptBuffer=function(R,c){this.decrypter.decrypt(R,this.keyData.key.buffer,this.keyData.iv.buffer,c)},U.decryptAacSample=function(R,c,g,w){var y=R[c].unit,f=y.subarray(16,y.length-y.length%16),m=f.buffer.slice(f.byteOffset,f.byteOffset+f.length),a=this;this.decryptBuffer(m,function(n){var o=new Uint8Array(n);y.set(o,16),w||a.decryptAacSamples(R,c+1,g)})},U.decryptAacSamples=function(R,c,g){for(;;c++){if(c>=R.length){g();return}if(R[c].unit.length<32)continue;var w=this.decrypter.isSync();if(this.decryptAacSample(R,c,g,w),!w)return}},U.getAvcEncryptedData=function(R){for(var c=Math.floor((R.length-48)/160)*16+16,g=new Int8Array(c),w=0,y=32;y<=R.length-16;y+=160,w+=16)g.set(R.subarray(y,y+16),w);return g},U.getAvcDecryptedUnit=function(R,c){for(var g=new Uint8Array(c),w=0,y=32;y<=R.length-16;y+=160,w+=16)R.set(g.subarray(w,w+16),y);return R},U.decryptAvcSample=function(R,c,g,w,y,f){var m=Object(B.discardEPB)(y.data),a=this.getAvcEncryptedData(m),n=this;this.decryptBuffer(a.buffer,function(o){y.data=n.getAvcDecryptedUnit(m,o),f||n.decryptAvcSamples(R,c,g+1,w)})},U.decryptAvcSamples=function(R,c,g,w){if(R instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;c++,g=0){if(c>=R.length){w();return}for(var y=R[c].units;!(g>=y.length);g++){var f=y[g];if(f.data.length<=48||f.type!==1&&f.type!==5)continue;var m=this.decrypter.isSync();if(this.decryptAvcSample(R,c,g,w,f,m),!m)return}}},j}();K.default=M},"./src/demux/transmuxer-interface.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return y});var z=P("./node_modules/webworkify-webpack/index.js"),B=P.n(z),M=P("./src/events.ts"),j=P("./src/demux/transmuxer.ts"),U=P("./src/utils/logger.ts"),_=P("./src/errors.ts"),R=P("./src/utils/mediasource-helper.ts"),c=P("./node_modules/eventemitter3/index.js"),g=P.n(c),w=Object(R.getMediaSource)()||{isTypeSupported:function(){return!1}},y=function(){function f(a,n,o,u){var x=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=a,this.id=n,this.onTransmuxComplete=o,this.onFlush=u;var E=a.config,v=function(s,l){l=l||{},l.frag=x.frag,l.id=x.id,a.trigger(s,l)};this.observer=new c.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,v),this.observer.on(M.Events.ERROR,v);var O={mp4:w.isTypeSupported("video/mp4"),mpeg:w.isTypeSupported("audio/mpeg"),mp3:w.isTypeSupported('audio/mp4; codecs="mp3"')},A=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var p;try{p=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),p.addEventListener("message",this.onwmsg),p.onerror=function(h){a.trigger(M.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(h.message+" ("+h.filename+":"+h.lineno+")")})},p.postMessage({cmd:"init",typeSupported:O,vendor:A,id:n,config:JSON.stringify(E)})}catch(h){U.logger.warn("Error in worker:",h),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),p&&self.URL.revokeObjectURL(p.objectURL),this.transmuxer=new j.default(this.observer,O,E,A,n),this.worker=null}}else this.transmuxer=new j.default(this.observer,O,E,A,n)}var m=f.prototype;return m.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.observer=null},m.push=function(n,o,u,x,E,v,O,A,p,h){var s=this;p.transmuxing.start=self.performance.now();var l=this.transmuxer,D=this.worker,T=v?v.start:E.start,S=E.decryptdata,I=this.frag,C=!(I&&E.cc===I.cc),W=!(I&&p.level===I.level),Y=I?p.sn-I.sn:-1,H=this.part?p.part-this.part.index:1,F=!W&&(Y===1||Y===0&&H===1),q=self.performance.now();(W||Y||E.stats.parsing.start===0)&&(E.stats.parsing.start=q),v&&(H||!F)&&(v.stats.parsing.start=q);var le=new j.TransmuxState(C,F,A,W,T);if(!F||C){U.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+p.sn+" p: "+p.part+" level: "+p.level+" id: "+p.id+`
discontinuity: `+C+`
trackSwitch: `+W+`
contiguous: `+F+`
accurateTimeOffset: `+A+`
timeOffset: `+T);var pe=new j.TransmuxConfig(u,x,o,O,h);this.configureTransmuxer(pe)}if(this.frag=E,this.part=v,D)D.postMessage({cmd:"demux",data:n,decryptdata:S,chunkMeta:p,state:le},n instanceof ArrayBuffer?[n]:[]);else if(l){var Ae=l.push(n,S,p,le);Object(j.isPromise)(Ae)?Ae.then(function(Ge){s.handleTransmuxComplete(Ge)}):this.handleTransmuxComplete(Ae)}},m.flush=function(n){var o=this;n.transmuxing.start=self.performance.now();var u=this.transmuxer,x=this.worker;if(x)x.postMessage({cmd:"flush",chunkMeta:n});else if(u){var E=u.flush(n);Object(j.isPromise)(E)?E.then(function(v){o.handleFlushResult(v,n)}):this.handleFlushResult(E,n)}},m.handleFlushResult=function(n,o){var u=this;n.forEach(function(x){u.handleTransmuxComplete(x)}),this.onFlush(o)},m.onWorkerMessage=function(n){var o=n.data,u=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,u.trigger(o.event,o.data);break}}},m.configureTransmuxer=function(n){var o=this.worker,u=this.transmuxer;o?o.postMessage({cmd:"configure",config:n}):u&&u.configure(n)},m.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},f}()},"./src/demux/transmuxer-worker.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return _});var z=P("./src/demux/transmuxer.ts"),B=P("./src/events.ts"),M=P("./src/utils/logger.ts"),j=P("./node_modules/eventemitter3/index.js"),U=P.n(j);function _(y){var f=new j.EventEmitter,m=function(n,o){y.postMessage({event:n,data:o})};f.on(B.Events.FRAG_DECRYPTED,m),f.on(B.Events.ERROR,m),y.addEventListener("message",function(a){var n=a.data;switch(n.cmd){case"init":{var o=JSON.parse(n.config);y.transmuxer=new z.default(f,n.typeSupported,o,n.vendor,n.id),Object(M.enableLogs)(o.debug),m("init",null);break}case"configure":{y.transmuxer.configure(n.config);break}case"demux":{var u=y.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(z.isPromise)(u)?u.then(function(v){R(y,v)}):R(y,u);break}case"flush":{var x=n.chunkMeta,E=y.transmuxer.flush(x);Object(z.isPromise)(E)?E.then(function(v){g(y,v,x)}):g(y,E,x);break}default:break}})}function R(y,f){if(w(f.remuxResult))return;var m=[],a=f.remuxResult,n=a.audio,o=a.video;n&&c(m,n),o&&c(m,o),y.postMessage({event:"transmuxComplete",data:f},m)}function c(y,f){f.data1&&y.push(f.data1.buffer),f.data2&&y.push(f.data2.buffer)}function g(y,f,m){f.forEach(function(a){R(y,a)}),y.postMessage({event:"flush",data:m})}function w(y){return!y.audio&&!y.video&&!y.text&&!y.id3&&!y.initSegment}},"./src/demux/transmuxer.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return o}),P.d(K,"isPromise",function(){return E}),P.d(K,"TransmuxConfig",function(){return v}),P.d(K,"TransmuxState",function(){return O});var z=P("./src/events.ts"),B=P("./src/errors.ts"),M=P("./src/crypt/decrypter.ts"),j=P("./src/demux/aacdemuxer.ts"),U=P("./src/demux/mp4demuxer.ts"),_=P("./src/demux/tsdemuxer.ts"),R=P("./src/demux/mp3demuxer.ts"),c=P("./src/remux/mp4-remuxer.ts"),g=P("./src/remux/passthrough-remuxer.ts"),w=P("./src/demux/chunk-cache.ts"),y=P("./src/utils/mp4-tools.ts"),f=P("./src/utils/logger.ts"),m;try{m=self.performance.now.bind(self.performance)}catch(A){f.logger.debug("Unable to use Performance API on this environment"),m=self.Date.now}var a=[{demux:_.default,remux:c.default},{demux:U.default,remux:g.default},{demux:j.default,remux:c.default},{demux:R.default,remux:c.default}],n=1024;a.forEach(function(A){var p=A.demux;n=Math.max(n,p.minProbeByteLength)});var o=function(){function A(h,s,l,D,T){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 w.default,this.observer=h,this.typeSupported=s,this.config=l,this.vendor=D,this.id=T}var p=A.prototype;return p.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},p.push=function(s,l,D,T){var S=this,I=D.transmuxing;I.executeStart=m();var C=new Uint8Array(s),W=this.cache,Y=this.config,H=this.currentTransmuxState,F=this.transmuxConfig;T&&(this.currentTransmuxState=T);var q=u(C,l);if(q&&q.method==="AES-128"){var le=this.getDecrypter();if(Y.enableSoftwareAES){var pe=le.softwareDecrypt(C,q.key.buffer,q.iv.buffer);if(!pe)return I.executeEnd=m(),x(D);C=new Uint8Array(pe)}else return this.decryptionPromise=le.webCryptoDecrypt(C,q.key.buffer,q.iv.buffer).then(function(Se){var Me=S.push(Se,null,D);return S.decryptionPromise=null,Me}),this.decryptionPromise}var Ae=T||H,Ge=Ae.contiguous,Fe=Ae.discontinuity,Ue=Ae.trackSwitch,_e=Ae.accurateTimeOffset,je=Ae.timeOffset,xe=F.audioCodec,he=F.videoCodec,te=F.defaultInitPts,ye=F.duration,ue=F.initSegmentData;if((Fe||Ue)&&this.resetInitSegment(ue,xe,he,ye),Fe&&this.resetInitialTimestamp(te),Ge||this.resetContiguity(),this.needsProbing(C,Fe,Ue)){if(W.dataLength){var Le=W.flush();C=Object(y.appendUint8Array)(Le,C)}this.configureTransmuxer(C,F)}var ae=this.transmux(C,q,je,_e,D),oe=this.currentTransmuxState;return oe.contiguous=!0,oe.discontinuity=!1,oe.trackSwitch=!1,I.executeEnd=m(),ae},p.flush=function(s){var l=this,D=s.transmuxing;D.executeStart=m();var T=this.decrypter,S=this.cache,I=this.currentTransmuxState,C=this.decryptionPromise;if(C)return C.then(function(){return l.flush(s)});var W=[],Y=I.timeOffset;if(T){var H=T.flush();H&&W.push(this.push(H,null,s))}var F=S.dataLength;S.reset();var q=this.demuxer,le=this.remuxer;if(!q||!le)return F>=n&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),D.executeEnd=m(),[x(s)];var pe=q.flush(Y);return E(pe)?pe.then(function(Ae){return l.flushRemux(W,Ae,s),W}):(this.flushRemux(W,pe,s),W)},p.flushRemux=function(s,l,D){var T=l.audioTrack,S=l.avcTrack,I=l.id3Track,C=l.textTrack,W=this.currentTransmuxState,Y=W.accurateTimeOffset,H=W.timeOffset;f.logger.log("[transmuxer.ts]: Flushed fragment "+D.sn+(D.part>-1?" p: "+D.part:"")+" of level "+D.level);var F=this.remuxer.remux(T,S,I,C,H,Y,!0,this.id);s.push({remuxResult:F,chunkMeta:D}),D.transmuxing.executeEnd=m()},p.resetInitialTimestamp=function(s){var l=this.demuxer,D=this.remuxer;if(!l||!D)return;l.resetTimeStamp(s),D.resetTimeStamp(s)},p.resetContiguity=function(){var s=this.demuxer,l=this.remuxer;if(!s||!l)return;s.resetContiguity(),l.resetNextTimestamp()},p.resetInitSegment=function(s,l,D,T){var S=this.demuxer,I=this.remuxer;if(!S||!I)return;S.resetInitSegment(l,D,T),I.resetInitSegment(s,l,D)},p.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},p.transmux=function(s,l,D,T,S){var I;return l&&l.method==="SAMPLE-AES"?I=this.transmuxSampleAes(s,l,D,T,S):I=this.transmuxUnencrypted(s,D,T,S),I},p.transmuxUnencrypted=function(s,l,D,T){var S=this.demuxer.demux(s,l,!1,!this.config.progressive),I=S.audioTrack,C=S.avcTrack,W=S.id3Track,Y=S.textTrack,H=this.remuxer.remux(I,C,W,Y,l,D,!1,this.id);return{remuxResult:H,chunkMeta:T}},p.transmuxSampleAes=function(s,l,D,T,S){var I=this;return this.demuxer.demuxSampleAes(s,l,D).then(function(C){var W=I.remuxer.remux(C.audioTrack,C.avcTrack,C.id3Track,C.textTrack,D,T,!1,I.id);return{remuxResult:W,chunkMeta:S}})},p.configureTransmuxer=function(s,l){for(var D=this.config,T=this.observer,S=this.typeSupported,I=this.vendor,C=l.audioCodec,W=l.defaultInitPts,Y=l.duration,H=l.initSegmentData,F=l.videoCodec,q,le=0,pe=a.length;le<pe;le++)if(a[le].demux.probe(s)){q=a[le];break}q||(f.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),q={demux:U.default,remux:g.default});var Ae=this.demuxer,Ge=this.remuxer,Fe=q.remux,Ue=q.demux;(!Ge||!(Ge instanceof Fe))&&(this.remuxer=new Fe(T,D,S,I)),(!Ae||!(Ae instanceof Ue))&&(this.demuxer=new Ue(T,D,S),this.probe=Ue.probe),this.resetInitSegment(H,C,F,Y),this.resetInitialTimestamp(W)},p.needsProbing=function(s,l,D){return!this.demuxer||!this.remuxer||l||D},p.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new M.default(this.observer,this.config)),s},A}();function u(A,p){var h=null;return A.byteLength>0&&p!=null&&p.key!=null&&p.iv!==null&&p.method!=null&&(h=p),h}var x=function(p){return{remuxResult:{},chunkMeta:p}};function E(A){return"then"in A&&A.then instanceof Function}var v=function(p,h,s,l,D){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=p,this.videoCodec=h,this.initSegmentData=s,this.duration=l,this.defaultInitPts=D},O=function(p,h,s,l,D){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=p,this.contiguous=h,this.accurateTimeOffset=s,this.trackSwitch=l,this.timeOffset=D}},"./src/demux/tsdemuxer.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"discardEPB",function(){return x});var z=P("./src/demux/adts.ts"),B=P("./src/demux/mpegaudio.ts"),M=P("./src/demux/exp-golomb.ts"),j=P("./src/demux/id3.ts"),U=P("./src/demux/sample-aes.ts"),_=P("./src/events.ts"),R=P("./src/utils/mp4-tools.ts"),c=P("./src/utils/logger.ts"),g=P("./src/errors.ts"),w={video:1,audio:2,id3:3,text:4},y=function(){function E(O,A,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=O,this.config=A,this.typeSupported=p}E.probe=function(A){var p=E.syncOffset(A);return p<0?!1:(p&&c.logger.warn("MPEG2-TS detected but first sync word found @ offset "+p+", junk ahead ?"),!0)},E.syncOffset=function(A){for(var p=Math.min(1e3,A.length-3*188),h=0;h<p;){if(A[h]===71&&A[h+188]===71&&A[h+2*188]===71)return h;h++}return-1},E.createTrack=function(A,p){return{container:A==="video"||A==="audio"?"video/mp2t":void 0,type:A,id:w[A],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:A==="audio"?p:void 0}};var v=E.prototype;return v.resetInitSegment=function(A,p,h){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",h),this._audioTrack=E.createTrack("audio",h),this._id3Track=E.createTrack("id3",h),this._txtTrack=E.createTrack("text",h),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=A,this.videoCodec=p,this._duration=h},v.resetTimeStamp=function(){},v.resetContiguity=function(){var A=this._audioTrack,p=this._avcTrack,h=this._id3Track;A&&(A.pesData=null),p&&(p.pesData=null),h&&(h.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},v.demux=function(A,p,h,s){h===void 0&&(h=!1),s===void 0&&(s=!1),h||(this.sampleAes=null);var l,D=this._avcTrack,T=this._audioTrack,S=this._id3Track,I=D.pid,C=D.pesData,W=T.pid,Y=S.pid,H=T.pesData,F=S.pesData,q=!1,le=this.pmtParsed,pe=this._pmtId,Ae=A.length;if(this.remainderData&&(A=Object(R.appendUint8Array)(this.remainderData,A),Ae=A.length,this.remainderData=null),Ae<188&&!s)return this.remainderData=A,{audioTrack:T,avcTrack:D,id3Track:S,textTrack:this._txtTrack};var Ge=Math.max(0,E.syncOffset(A));Ae-=(Ae+Ge)%188,Ae<A.byteLength&&!s&&(this.remainderData=new Uint8Array(A.buffer,Ae,A.buffer.byteLength-Ae));for(var Fe=Ge;Fe<Ae;Fe+=188)if(A[Fe]===71){var Ue=!!(A[Fe+1]&64),_e=((A[Fe+1]&31)<<8)+A[Fe+2],je=(A[Fe+3]&48)>>4,xe=void 0;if(je>1){if(xe=Fe+5+A[Fe+4],xe===Fe+188)continue}else xe=Fe+4;switch(_e){case I:Ue&&(C&&(l=n(C))&&this.parseAVCPES(l,!1),C={data:[],size:0}),C&&(C.data.push(A.subarray(xe,Fe+188)),C.size+=Fe+188-xe);break;case W:Ue&&(H&&(l=n(H))&&(T.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),H={data:[],size:0}),H&&(H.data.push(A.subarray(xe,Fe+188)),H.size+=Fe+188-xe);break;case Y:Ue&&(F&&(l=n(F))&&this.parseID3PES(l),F={data:[],size:0}),F&&(F.data.push(A.subarray(xe,Fe+188)),F.size+=Fe+188-xe);break;case 0:Ue&&(xe+=A[xe]+1),pe=this._pmtId=m(A,xe);break;case pe:{Ue&&(xe+=A[xe]+1);var he=a(A,xe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);I=he.avc,I>0&&(D.pid=I),W=he.audio,W>0&&(T.pid=W,T.isAAC=he.isAAC),Y=he.id3,Y>0&&(S.pid=Y),q&&!le&&(c.logger.log("reparse from beginning"),q=!1,Fe=Ge-188),le=this.pmtParsed=!0;break}case 17:case 8191:break;default:q=!0;break}}else this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});D.pesData=C,T.pesData=H,S.pesData=F;var te={audioTrack:T,avcTrack:D,id3Track:S,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(te),te},v.flush=function(){var A=this.remainderData;this.remainderData=null;var p;return A?p=this.demux(A,-1,!1,!0):p={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},v.extractRemainingSamples=function(A){var p=A.audioTrack,h=A.avcTrack,s=A.id3Track,l=h.pesData,D=p.pesData,T=s.pesData,S;l&&(S=n(l))?(this.parseAVCPES(S,!0),h.pesData=null):h.pesData=l,D&&(S=n(D))?(p.isAAC?this.parseAACPES(S):this.parseMPEGPES(S),p.pesData=null):(D!=null&&D.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=D),T&&(S=n(T))?(this.parseID3PES(S),s.pesData=null):s.pesData=T},v.demuxSampleAes=function(A,p,h){var s=this.demux(A,h,!0,!this.config.progressive),l=this.sampleAes=new U.default(this.observer,this.config,p);return this.decrypt(s,l)},v.decrypt=function(A,p){return new Promise(function(h){var s=A.audioTrack,l=A.avcTrack;s.samples&&s.isAAC?p.decryptAacSamples(s.samples,0,function(){l.samples?p.decryptAvcSamples(l.samples,0,0,function(){h(A)}):h(A)}):l.samples&&p.decryptAvcSamples(l.samples,0,0,function(){h(A)})})},v.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},v.parseAVCPES=function(A,p){var h=this,s=this._avcTrack,l=this.parseAVCNALu(A.data),D=!1,T=this.avcSample,S,I=!1;A.data=null,T&&l.length&&!s.audFound&&(o(T,s),T=this.avcSample=f(!1,A.pts,A.dts,"")),l.forEach(function(C){switch(C.type){case 1:{S=!0,T||(T=h.avcSample=f(!0,A.pts,A.dts,"")),D&&(T.debug+="NDR "),T.frame=!0;var W=C.data;if(I&&W.length>4){var Y=new M.default(W).readSliceType();(Y===2||Y===4||Y===7||Y===9)&&(T.key=!0)}break}case 5:S=!0,T||(T=h.avcSample=f(!0,A.pts,A.dts,"")),D&&(T.debug+="IDR "),T.key=!0,T.frame=!0;break;case 6:{S=!0,D&&T&&(T.debug+="SEI ");var H=new M.default(x(C.data));H.readUByte();for(var F=0,q=0,le=!1,pe=0;!le&&H.bytesAvailable>1;){F=0;do pe=H.readUByte(),F+=pe;while(pe===255);q=0;do pe=H.readUByte(),q+=pe;while(pe===255);if(F===4&&H.bytesAvailable!==0){le=!0;var Ae=H.readUByte();if(Ae===181){var Ge=H.readUShort();if(Ge===49){var Fe=H.readUInt();if(Fe===1195456820){var Ue=H.readUByte();if(Ue===3){for(var _e=H.readUByte(),je=H.readUByte(),xe=31&_e,he=[_e,je],te=0;te<xe;te++)he.push(H.readUByte()),he.push(H.readUByte()),he.push(H.readUByte());u(h._txtTrack.samples,{type:3,pts:A.pts,bytes:he})}}}}}else if(F===5&&H.bytesAvailable!==0){if(le=!0,q>16){for(var ye=[],ue=0;ue<16;ue++)ye.push(H.readUByte().toString(16)),(ue===3||ue===5||ue===7||ue===9)&&ye.push("-");for(var Le=q-16,ae=new Uint8Array(Le),oe=0;oe<Le;oe++)ae[oe]=H.readUByte();u(h._txtTrack.samples,{pts:A.pts,payloadType:F,uuid:ye.join(""),userData:Object(j.utf8ArrayToStr)(ae),userDataBytes:ae})}}else if(q<H.bytesAvailable)for(var Se=0;Se<q;Se++)H.readUByte()}break}case 7:if(S=!0,I=!0,D&&T&&(T.debug+="SPS "),!s.sps){var Me=new M.default(C.data),We=Me.readSPS();s.width=We.width,s.height=We.height,s.pixelRatio=We.pixelRatio,s.sps=[C.data],s.duration=h._duration;for(var Ke=C.data.subarray(1,4),Qe="avc1.",Ze=0;Ze<3;Ze++){var yt=Ke[Ze].toString(16);yt.length<2&&(yt="0"+yt),Qe+=yt}s.codec=Qe}break;case 8:S=!0,D&&T&&(T.debug+="PPS "),s.pps||(s.pps=[C.data]);break;case 9:S=!1,s.audFound=!0,T&&o(T,s),T=h.avcSample=f(!1,A.pts,A.dts,D?"AUD ":"");break;case 12:S=!1;break;default:S=!1,T&&(T.debug+="unknown NAL "+C.type+" ");break}if(T&&S){var vt=T.units;vt.push(C)}}),p&&T&&(o(T,s),this.avcSample=null)},v.getLastNalUnit=function(){var A,p=this.avcSample,h;if(!p||p.units.length===0){var s=this._avcTrack.samples;p=s[s.length-1]}if((A=p)!==null&&A!==void 0&&A.units){var l=p.units;h=l[l.length-1]}return h},v.parseAVCNALu=function(A){var p=A.byteLength,h=this._avcTrack,s=h.naluState||0,l=s,D=[],T=0,S,I,C,W=-1,Y=0;for(s===-1&&(W=0,Y=A[0]&31,s=0,T=1);T<p;){if(S=A[T++],!s){s=S?0:1;continue}if(s===1){s=S?0:2;continue}if(!S)s=3;else if(S===1){if(W>=0){var H={data:A.subarray(W,T-s-1),type:Y};D.push(H)}else{var F=this.getLastNalUnit();if(F&&(l&&T<=4-l&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-l))),I=T-s-1,I>0)){var q=new Uint8Array(F.data.byteLength+I);q.set(F.data,0),q.set(A.subarray(0,I),F.data.byteLength),F.data=q,F.state=0}}T<p?(C=A[T]&31,W=T,Y=C,s=0):s=-1}else s=0}if(W>=0&&s>=0){var le={data:A.subarray(W,p),type:Y,state:s};D.push(le)}if(D.length===0){var pe=this.getLastNalUnit();if(pe){var Ae=new Uint8Array(pe.data.byteLength+A.byteLength);Ae.set(pe.data,0),Ae.set(A,pe.data.byteLength),pe.data=Ae}}return h.naluState=s,D},v.parseAACPES=function(A){var p=0,h=this._audioTrack,s=this.aacOverFlow,l=A.data;if(s){this.aacOverFlow=null;var D=s.sample.unit.byteLength,T=Math.min(s.missing,D),S=D-T;s.sample.unit.set(l.subarray(0,T),S),h.samples.push(s.sample),p=s.missing}var I,C;for(I=p,C=l.length;I<C-1&&!z.isHeader(l,I);I++);if(I!==p){var W,Y;if(I<C-1?(W="AAC PES did not start with ADTS header,offset:"+I,Y=!1):(W="no ADTS header found in AAC PES",Y=!0),c.logger.warn("parsing error:"+W),this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:Y,reason:W}),Y)return}z.initTrackConfig(h,this.observer,l,I,this.audioCodec);var H;if(A.pts!==void 0)H=A.pts;else if(s){var F=z.getFrameDuration(h.samplerate);H=s.sample.pts+F}else{c.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var q=0;I<C;)if(z.isHeader(l,I)){if(I+5<C){var le=z.appendFrame(h,l,I,H,q);if(le)if(le.missing)this.aacOverFlow=le;else{I+=le.length,q++;continue}}break}else I++},v.parseMPEGPES=function(A){var p=A.data,h=p.length,s=0,l=0,D=A.pts;if(D===void 0){c.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<h;)if(B.isHeader(p,l)){var T=B.appendFrame(this._audioTrack,p,l,D,s);if(T)l+=T.length,s++;else break}else l++},v.parseID3PES=function(A){if(A.pts===void 0){c.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(A)},E}();y.minProbeByteLength=188;function f(E,v,O,A){return{key:E,frame:!1,pts:v,dts:O,units:[],debug:A,length:0}}function m(E,v){return(E[v+10]&31)<<8|E[v+11]}function a(E,v,O,A){var p={audio:-1,avc:-1,id3:-1,isAAC:!0},h=(E[v+1]&15)<<8|E[v+2],s=v+3+h-4,l=(E[v+10]&15)<<8|E[v+11];for(v+=12+l;v<s;){var D=(E[v+1]&31)<<8|E[v+2];switch(E[v]){case 207:if(!A){c.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:p.audio===-1&&(p.audio=D);break;case 21:p.id3===-1&&(p.id3=D);break;case 219:if(!A){c.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:p.avc===-1&&(p.avc=D);break;case 3:case 4:O?p.audio===-1&&(p.audio=D,p.isAAC=!1):c.logger.log("MPEG audio found, not supported in this browser");break;case 36:c.logger.warn("Unsupported HEVC stream type found");break;default:break}v+=((E[v+3]&15)<<8|E[v+4])+5}return p}function n(E){var v=0,O,A,p,h,s,l=E.data;if(!E||E.size===0)return null;for(;l[0].length<19&&l.length>1;){var D=new Uint8Array(l[0].length+l[1].length);D.set(l[0]),D.set(l[1],l[0].length),l[0]=D,l.splice(1,1)}O=l[0];var T=(O[0]<<16)+(O[1]<<8)+O[2];if(T===1){if(A=(O[4]<<8)+O[5],A&&A>E.size-6)return null;var S=O[7];S&192&&(h=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,S&64?(s=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,h-s>60*9e4&&(c.logger.warn(Math.round((h-s)/9e4)+"s delta between PTS and DTS, align them"),h=s)):s=h),p=O[8];var I=p+9;if(E.size<=I)return null;E.size-=I;for(var C=new Uint8Array(E.size),W=0,Y=l.length;W<Y;W++){O=l[W];var H=O.byteLength;if(I)if(I>H){I-=H;continue}else O=O.subarray(I),H-=I,I=0;C.set(O,v),v+=H}return A&&(A-=p+3),{data:C,pts:h,dts:s,len:A}}return null}function o(E,v){if(E.units.length&&E.frame){if(E.pts===void 0){var O=v.samples,A=O.length;if(A){var p=O[A-1];E.pts=p.pts,E.dts=p.dts}else{v.dropped++;return}}v.samples.push(E)}E.debug.length&&c.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function u(E,v){var O=E.length;if(O>0){if(v.pts>=E[O-1].pts)E.push(v);else for(var A=O-1;A>=0;A--)if(v.pts<E[A].pts){E.splice(A,0,v);break}}else E.push(v)}function x(E){for(var v=E.byteLength,O=[],A=1;A<v-2;)E[A]===0&&E[A+1]===0&&E[A+2]===3?(O.push(A+2),A+=2):A++;if(O.length===0)return E;var p=v-O.length,h=new Uint8Array(p),s=0;for(A=0;A<p;s++,A++)s===O[0]&&(s++,O.shift()),h[A]=E[s];return h}K.default=y},"./src/errors.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"ErrorTypes",function(){return z}),P.d(K,"ErrorDetails",function(){return B});var z;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(z||(z={}));var B;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"Events",function(){return z});var z;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return E});var z=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(z),M=P("./src/loader/playlist-loader.ts"),j=P("./src/loader/key-loader.ts"),U=P("./src/controller/id3-track-controller.ts"),_=P("./src/controller/latency-controller.ts"),R=P("./src/controller/level-controller.ts"),c=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/stream-controller.ts"),w=P("./src/is-supported.ts"),y=P("./src/utils/logger.ts"),f=P("./src/config.ts"),m=P("./node_modules/eventemitter3/index.js"),a=P.n(m),n=P("./src/events.ts"),o=P("./src/errors.ts");function u(v,O){for(var A=0;A<O.length;A++){var p=O[A];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(v,p.key,p)}}function x(v,O,A){return O&&u(v.prototype,O),A&&u(v,A),v}var E=function(){v.isSupported=function(){return Object(w.isSupported)()};function v(A){A===void 0&&(A={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new m.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 p=this.config=Object(f.mergeConfig)(v.DefaultConfig,A);this.userConfig=A,Object(y.enableLogs)(p.debug),this._autoLevelCapping=-1,p.progressive&&Object(f.enableStreamingMode)(p);var h=p.abrController,s=p.bufferController,l=p.capLevelController,D=p.fpsController,T=this.abrController=new h(this),S=this.bufferController=new s(this),I=this.capLevelController=new l(this),C=new D(this),W=new M.default(this),Y=new j.default(this),H=new U.default(this),F=this.levelController=new R.default(this),q=new c.FragmentTracker(this),le=this.streamController=new g.default(this,q);I.setStreamController(le),C.setStreamController(le);var pe=[F,le];this.networkControllers=pe;var Ae=[W,Y,T,S,I,C,H,q];this.audioTrackController=this.createController(p.audioTrackController,null,pe),this.createController(p.audioStreamController,q,pe),this.subtitleTrackController=this.createController(p.subtitleTrackController,null,pe),this.createController(p.subtitleStreamController,q,pe),this.createController(p.timelineController,null,Ae),this.emeController=this.createController(p.emeController,null,Ae),this.cmcdController=this.createController(p.cmcdController,null,Ae),this.latencyController=this.createController(_.default,null,Ae),this.coreComponents=Ae}var O=v.prototype;return O.createController=function(p,h,s){if(p){var l=h?new p(this,h):new p(this);return s&&s.push(l),l}return null},O.on=function(p,h,s){s===void 0&&(s=this),this._emitter.on(p,h,s)},O.once=function(p,h,s){s===void 0&&(s=this),this._emitter.once(p,h,s)},O.removeAllListeners=function(p){this._emitter.removeAllListeners(p)},O.off=function(p,h,s,l){s===void 0&&(s=this),this._emitter.off(p,h,s,l)},O.listeners=function(p){return this._emitter.listeners(p)},O.emit=function(p,h,s){return this._emitter.emit(p,h,s)},O.trigger=function(p,h){if(this.config.debug)return this.emit(p,p,h);try{return this.emit(p,p,h)}catch(s){y.logger.error("An internal error happened while handling event "+p+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(n.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:p,error:s})}return!1},O.listenerCount=function(p){return this._emitter.listenerCount(p)},O.destroy=function(){y.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(p){return p.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(p){return p.destroy()}),this.coreComponents.length=0},O.attachMedia=function(p){y.logger.log("attachMedia"),this._media=p,this.trigger(n.Events.MEDIA_ATTACHING,{media:p})},O.detachMedia=function(){y.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(p){this.stopLoad();var h=this.media,s=this.url,l=this.url=z.buildAbsoluteURL(self.location.href,p,{alwaysNormalize:!0});y.logger.log("loadSource:"+l),h&&s&&s!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(h)),this.trigger(n.Events.MANIFEST_LOADING,{url:p})},O.startLoad=function(p){p===void 0&&(p=-1),y.logger.log("startLoad("+p+")"),this.networkControllers.forEach(function(h){h.startLoad(p)})},O.stopLoad=function(){y.logger.log("stopLoad"),this.networkControllers.forEach(function(p){p.stopLoad()})},O.swapAudioCodec=function(){y.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){y.logger.log("recoverMediaError");var p=this._media;this.detachMedia(),p&&this.attachMedia(p)},O.removeLevel=function(p,h){h===void 0&&(h=0),this.levelController.removeLevel(p,h)},x(v,[{key:"levels",get:function(){var p=this.levelController.levels;return p||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(p){y.logger.log("set currentLevel:"+p),this.loadLevel=p,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(p){y.logger.log("set nextLevel:"+p),this.levelController.manualLevel=p,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(p){y.logger.log("set loadLevel:"+p),this.levelController.manualLevel=p}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(p){this.levelController.nextLoadLevel=p}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(p){y.logger.log("set firstLevel:"+p),this.levelController.firstLevel=p}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(p){y.logger.log("set startLevel:"+p),p!==-1&&(p=Math.max(p,this.minAutoLevel)),this.levelController.startLevel=p}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(p){var h=!!p;h!==this.config.capLevelToPlayerSize&&(h?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=h)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(p){this._autoLevelCapping!==p&&(y.logger.log("set autoLevelCapping:"+p),this._autoLevelCapping=p)}},{key:"bandwidthEstimate",get:function(){var p=this.abrController.bwEstimator;return p?p.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var p=this.levels,h=this.config.minAutoBitrate;if(!p)return 0;for(var s=p.length,l=0;l<s;l++)if(p[l].maxBitrate>h)return l;return 0}},{key:"maxAutoLevel",get:function(){var p=this.levels,h=this.autoLevelCapping,s;return h===-1&&p&&p.length?s=p.length-1:s=h,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(p){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,p)}},{key:"audioTracks",get:function(){var p=this.audioTrackController;return p?p.audioTracks:[]}},{key:"audioTrack",get:function(){var p=this.audioTrackController;return p?p.audioTrack:-1},set:function(p){var h=this.audioTrackController;h&&(h.audioTrack=p)}},{key:"subtitleTracks",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTrack:-1},set:function(p){var h=this.subtitleTrackController;h&&(h.subtitleTrack=p)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var p=this.subtitleTrackController;return p?p.subtitleDisplay:!1},set:function(p){var h=this.subtitleTrackController;h&&(h.subtitleDisplay=p)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(p){this.config.lowLatencyMode=p}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return n.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return v.defaultConfig?v.defaultConfig:f.hlsDefaultConfig},set:function(p){v.defaultConfig=p}}]),v}();E.defaultConfig=void 0},"./src/is-supported.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"isSupported",function(){return M}),P.d(K,"changeTypeSupported",function(){return j});var z=P("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var U=Object(z.getMediaSource)();if(!U)return!1;var _=B(),R=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),c=!_||_.prototype&&typeof _.prototype.appendBuffer=="function"&&typeof _.prototype.remove=="function";return!!R&&!!c}function j(){var U,_=B();return typeof(_==null||((U=_.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return y}),P.d(K,"LoadError",function(){return m});var z=P("./src/polyfills/number.ts"),B=P("./src/errors.ts");function M(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,c(a,n)}function j(a){var n=typeof Map=="function"?new Map:void 0;return j=function(u){if(u===null||!R(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(u))return n.get(u);n.set(u,x)}function x(){return U(u,arguments,g(this).constructor)}return x.prototype=Object.create(u.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),c(x,u)},j(a)}function U(a,n,o){return _()?U=Reflect.construct:U=function(x,E,v){var O=[null];O.push.apply(O,E);var A=Function.bind.apply(x,O),p=new A;return v&&c(p,v.prototype),p},U.apply(null,arguments)}function _(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function R(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function c(a,n){return c=Object.setPrototypeOf||function(u,x){return u.__proto__=x,u},c(a,n)}function g(a){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(a)}var w=Math.pow(2,17),y=function(){function a(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var n=a.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(u,x){var E=this,v=u.url;if(!v)return Promise.reject(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,networkDetails:null},"Fragment does not have a "+(v?"part list":"url")));this.abort();var O=this.config,A=O.fLoader,p=O.loader;return new Promise(function(h,s){E.loader&&E.loader.destroy();var l=E.loader=u.loader=A?new A(O):new p(O),D=f(u),T={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:w};u.stats=l.stats,l.load(D,T,{onSuccess:function(I,C,W,Y){E.resetLoader(u,l),h({frag:u,part:null,payload:I.data,networkDetails:Y})},onError:function(I,C,W){E.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,response:I,networkDetails:W}))},onAbort:function(I,C,W){E.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,networkDetails:W}))},onTimeout:function(I,C,W){E.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,networkDetails:W}))},onProgress:function(I,C,W,Y){x&&x({frag:u,part:null,payload:W,networkDetails:Y})}})})},n.loadPart=function(u,x,E){var v=this;this.abort();var O=this.config,A=O.fLoader,p=O.loader;return new Promise(function(h,s){v.loader&&v.loader.destroy();var l=v.loader=u.loader=A?new A(O):new p(O),D=f(u,x),T={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:w};x.stats=l.stats,l.load(D,T,{onSuccess:function(I,C,W,Y){v.resetLoader(u,l),v.updateStatsFromPart(u,x);var H={frag:u,part:x,payload:I.data,networkDetails:Y};E(H),h(H)},onError:function(I,C,W){v.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:u,part:x,response:I,networkDetails:W}))},onAbort:function(I,C,W){u.stats.aborted=x.stats.aborted,v.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:u,part:x,networkDetails:W}))},onTimeout:function(I,C,W){v.resetLoader(u,l),s(new m({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:u,part:x,networkDetails:W}))}})})},n.updateStatsFromPart=function(u,x){var E=u.stats,v=x.stats,O=v.total;if(E.loaded+=v.loaded,O){var A=Math.round(u.duration/x.duration),p=Math.min(Math.round(E.loaded/O),A),h=A-p,s=h*Math.round(E.loaded/p);E.total=E.loaded+s}else E.total=Math.max(E.loaded,E.total);var l=E.loading,D=v.loading;l.start?l.first+=D.first-D.start:(l.start=D.start,l.first=D.first),l.end=D.end},n.resetLoader=function(u,x){u.loader=null,this.loader===x&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),x.destroy()},a}();function f(a,n){n===void 0&&(n=null);var o=n||a,u={frag:a,part:n,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},x=o.byteRangeStartOffset,E=o.byteRangeEndOffset;return Object(z.isFiniteNumber)(x)&&Object(z.isFiniteNumber)(E)&&(u.rangeStart=x,u.rangeEnd=E),u}var m=function(a){M(n,a);function n(o){for(var u,x=arguments.length,E=new Array(x>1?x-1:0),v=1;v<x;v++)E[v-1]=arguments[v];return u=a.call.apply(a,[this].concat(E))||this,u.data=void 0,u.data=o,u}return n}(j(Error))},"./src/loader/fragment.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"ElementaryStreamTypes",function(){return y}),P.d(K,"BaseSegment",function(){return f}),P.d(K,"Fragment",function(){return m}),P.d(K,"Part",function(){return a});var z=P("./src/polyfills/number.ts"),B=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(B),j=P("./src/utils/logger.ts"),U=P("./src/loader/level-key.ts"),_=P("./src/loader/load-stats.ts");function R(n,o){n.prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o)}function c(n,o){return c=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},c(n,o)}function g(n,o){for(var u=0;u<o.length;u++){var x=o[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(n,x.key,x)}}function w(n,o,u){return o&&g(n.prototype,o),u&&g(n,u),n}var y;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(y||(y={}));var f=function(){function n(u){var x;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(x={},x[y.AUDIO]=null,x[y.VIDEO]=null,x[y.AUDIOVIDEO]=null,x),this.baseurl=u}var o=n.prototype;return o.setByteRange=function(x,E){var v=x.split("@",2),O=[];v.length===1?O[0]=E?E.byteRangeEndOffset:0:O[0]=parseInt(v[1]),O[1]=parseInt(v[0])+O[0],this._byteRange=O},w(n,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(x){this._url=x}}]),n}(),m=function(n){R(o,n);function o(x,E){var v;return v=n.call(this,E)||this,v._decryptdata=null,v.rawProgramDateTime=null,v.programDateTime=null,v.tagList=[],v.duration=0,v.sn=0,v.levelkey=void 0,v.type=void 0,v.loader=null,v.level=-1,v.cc=0,v.startPTS=void 0,v.endPTS=void 0,v.appendedPTS=void 0,v.startDTS=void 0,v.endDTS=void 0,v.start=0,v.deltaPTS=void 0,v.maxStartPTS=void 0,v.minEndPTS=void 0,v.stats=new _.LoadStats,v.urlId=0,v.data=void 0,v.bitrateTest=!1,v.title=null,v.initSegment=null,v.type=x,v}var u=o.prototype;return u.createInitializationVector=function(E){for(var v=new Uint8Array(16),O=12;O<16;O++)v[O]=E>>8*(15-O)&255;return v},u.setDecryptDataFromLevelKey=function(E,v){var O=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(O=U.LevelKey.fromURI(E.uri),O.method=E.method,O.iv=this.createInitializationVector(v),O.keyFormat="identity"),O},u.setElementaryStreamInfo=function(E,v,O,A,p,h){h===void 0&&(h=!1);var s=this.elementaryStreams,l=s[E];if(!l){s[E]={startPTS:v,endPTS:O,startDTS:A,endDTS:p,partial:h};return}l.startPTS=Math.min(l.startPTS,v),l.endPTS=Math.max(l.endPTS,O),l.startDTS=Math.min(l.startDTS,A),l.endDTS=Math.max(l.endDTS,p)},u.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[y.AUDIO]=null,E[y.VIDEO]=null,E[y.AUDIOVIDEO]=null},w(o,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&j.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var E=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),o}(f),a=function(n){R(o,n);function o(u,x,E,v,O){var A;A=n.call(this,E)||this,A.fragOffset=0,A.duration=0,A.gap=!1,A.independent=!1,A.relurl=void 0,A.fragment=void 0,A.index=void 0,A.stats=new _.LoadStats,A.duration=u.decimalFloatingPoint("DURATION"),A.gap=u.bool("GAP"),A.independent=u.bool("INDEPENDENT"),A.relurl=u.enumeratedString("URI"),A.fragment=x,A.index=v;var p=u.enumeratedString("BYTERANGE");return p&&A.setByteRange(p,O),O&&(A.fragOffset=O.fragOffset+O.duration),A}return w(o,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var x=this.elementaryStreams;return!!(x.audio||x.video||x.audiovideo)}}]),o}(f)},"./src/loader/key-loader.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return j});var z=P("./src/events.ts"),B=P("./src/errors.ts"),M=P("./src/utils/logger.ts"),j=function(){function U(R){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=R,this._registerListeners()}var _=U.prototype;return _._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},_._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},_.destroy=function(){this._unregisterListeners();for(var c in this.loaders){var g=this.loaders[c];g&&g.destroy()}this.loaders={}},_.onKeyLoading=function(c,g){var w=g.frag,y=w.type,f=this.loaders[y];if(!w.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var m=w.decryptdata.uri;if(m!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(f&&(M.logger.warn("abort previous key loader for type:"+y),f.abort()),!m){M.logger.warn("key uri is falsy");return}var n=a.loader,o=w.loader=this.loaders[y]=new n(a);this.decrypturl=m,this.decryptkey=null;var u={url:m,frag:w,responseType:"arraybuffer"},x={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(u,x,E)}else this.decryptkey&&(w.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:w}))},_.loadsuccess=function(c,g,w){var y=w.frag;if(!y.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=y.decryptdata.key=new Uint8Array(c.data),y.loader=null,delete this.loaders[y.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:y})},_.loaderror=function(c,g){var w=g.frag,y=w.loader;y&&y.abort(),delete this.loaders[w.type],this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:w,response:c})},_.loadtimeout=function(c,g){var w=g.frag,y=w.loader;y&&y.abort(),delete this.loaders[w.type],this.hls.trigger(z.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:w})},U}()},"./src/loader/level-details.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"LevelDetails",function(){return U});var z=P("./src/polyfills/number.ts");function B(_,R){for(var c=0;c<R.length;c++){var g=R[c];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}function M(_,R,c){return R&&B(_.prototype,R),c&&B(_,c),_}var j=10,U=function(){function _(c){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=c}var R=_.prototype;return R.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var w=this.lastPartSn-g.lastPartSn,y=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!y||!!w,this.advanced=this.endSN>g.endSN||w>0||w===0&&y>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},M(_,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var w=this.driftEnd-this.driftStart;return w*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),_}()},"./src/loader/level-key.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"LevelKey",function(){return U});var z=P("./node_modules/url-toolkit/src/url-toolkit.js"),B=P.n(z);function M(_,R){for(var c=0;c<R.length;c++){var g=R[c];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}function j(_,R,c){return R&&M(_.prototype,R),c&&M(_,c),_}var U=function(){_.fromURL=function(c,g){return new _(c,g)},_.fromURI=function(c){return new _(c)};function _(R,c){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,c?this._uri=Object(z.buildAbsoluteURL)(R,c,{alwaysNormalize:!0}):this._uri=R}return j(_,[{key:"uri",get:function(){return this._uri}}]),_}()},"./src/loader/load-stats.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"LoadStats",function(){return z});var z=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,K,P){"use strict";P.r(K),P.d(K,"default",function(){return o});var z=P("./src/polyfills/number.ts"),B=P("./node_modules/url-toolkit/src/url-toolkit.js"),M=P.n(B),j=P("./src/loader/fragment.ts"),U=P("./src/loader/level-details.ts"),_=P("./src/loader/level-key.ts"),R=P("./src/utils/attr-list.ts"),c=P("./src/utils/logger.ts"),g=P("./src/utils/codecs.ts"),w=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,y=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),m=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("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function n(O){var A,p;return a.test((A=(p=B.parseURL(O))===null||p===void 0?void 0:p.path)!=null?A:"")}var o=function(){function O(){}return O.findGroup=function(p,h){for(var s=0;s<p.length;s++){var l=p[s];if(l.id===h)return l}},O.convertAVC1ToAVCOTI=function(p){var h=p.split(".");if(h.length>2){var s=h.shift()+".";return s+=parseInt(h.shift()).toString(16),s+=("000"+parseInt(h.shift()).toString(16)).substr(-4),s}return p},O.resolve=function(p,h){return B.buildAbsoluteURL(h,p,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(p,h){var s=[],l={},D=!1;w.lastIndex=0;for(var T;(T=w.exec(p))!=null;)if(T[1]){var S=new R.AttrList(T[1]),I={attrs:S,bitrate:S.decimalInteger("AVERAGE-BANDWIDTH")||S.decimalInteger("BANDWIDTH"),name:S.NAME,url:O.resolve(T[2],h)},C=S.decimalResolution("RESOLUTION");C&&(I.width=C.width,I.height=C.height),u((S.CODECS||"").split(/[ ,]+/).filter(function(Y){return Y}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=O.convertAVC1ToAVCOTI(I.videoCodec)),s.push(I)}else if(T[3]){var W=new R.AttrList(T[3]);W["DATA-ID"]&&(D=!0,l[W["DATA-ID"]]=W)}return{levels:s,sessionData:D?l:null}},O.parseMasterPlaylistMedia=function(p,h,s,l){l===void 0&&(l=[]);var D,T=[],S=0;for(y.lastIndex=0;(D=y.exec(p))!==null;){var I=new R.AttrList(D[1]);if(I.TYPE===s){var C={attrs:I,bitrate:0,id:S++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:s,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?O.resolve(I.URI,h):""};if(l.length){var W=O.findGroup(l,C.groupId)||l[0];x(C,W,"audioCodec"),x(C,W,"textCodec")}T.push(C)}}return T},O.parseLevelPlaylist=function(p,h,s,l,D){var T=new U.LevelDetails(h),S=T.fragments,I=null,C=0,W=0,Y=0,H=0,F=null,q=new j.Fragment(l,h),le,pe,Ae,Ge=-1,Fe=!1;for(f.lastIndex=0,T.m3u8=p;(le=f.exec(p))!==null;){Fe&&(Fe=!1,q=new j.Fragment(l,h),q.start=Y,q.sn=C,q.cc=H,q.level=s,I&&(q.initSegment=I,q.rawProgramDateTime=I.rawProgramDateTime));var Ue=le[1];if(Ue){q.duration=parseFloat(Ue);var _e=(" "+le[2]).slice(1);q.title=_e||null,q.tagList.push(_e?["INF",Ue,_e]:["INF",Ue])}else if(le[3])Object(z.isFiniteNumber)(q.duration)&&(q.start=Y,Ae&&(q.levelkey=Ae),q.sn=C,q.level=s,q.cc=H,q.urlId=D,S.push(q),q.relurl=(" "+le[3]).slice(1),v(q,F),F=q,Y+=q.duration,C++,W=0,Fe=!0);else if(le[4]){var je=(" "+le[4]).slice(1);F?q.setByteRange(je,F):q.setByteRange(je)}else if(le[5])q.rawProgramDateTime=(" "+le[5]).slice(1),q.tagList.push(["PROGRAM-DATE-TIME",q.rawProgramDateTime]),Ge===-1&&(Ge=S.length);else{if(le=le[0].match(m),!le){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(pe=1;pe<le.length&&!(typeof le[pe]!="undefined");pe++);var xe=(" "+le[pe]).slice(1),he=(" "+le[pe+1]).slice(1),te=le[pe+2]?(" "+le[pe+2]).slice(1):"";switch(xe){case"PLAYLIST-TYPE":T.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":C=T.startSN=parseInt(he);break;case"SKIP":{var ye=new R.AttrList(he),ue=ye.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(ue)){T.skippedSegments=ue;for(var Le=ue;Le--;)S.unshift(null);C+=ue}var ae=ye.enumeratedString("RECENTLY-REMOVED-DATERANGES");ae&&(T.recentlyRemovedDateranges=ae.split(" "));break}case"TARGETDURATION":T.targetduration=parseFloat(he);break;case"VERSION":T.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":T.live=!1;break;case"#":(he||te)&&q.tagList.push(te?[he,te]:[he]);break;case"DIS":H++;case"GAP":q.tagList.push([xe]);break;case"BITRATE":q.tagList.push([xe,he]);break;case"DISCONTINUITY-SEQ":H=parseInt(he);break;case"KEY":{var oe,Se=new R.AttrList(he),Me=Se.enumeratedString("METHOD"),We=Se.URI,Ke=Se.hexadecimalInteger("IV"),Qe=Se.enumeratedString("KEYFORMATVERSIONS"),Ze=Se.enumeratedString("KEYID"),yt=(oe=Se.enumeratedString("KEYFORMAT"))!=null?oe:"identity",vt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(vt.indexOf(yt)>-1){c.logger.warn("Keyformat "+yt+" is not supported from the manifest");continue}else if(yt!=="identity")continue;Me&&(Ae=_.LevelKey.fromURL(h,We),We&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Me)>=0&&(Ae.method=Me,Ae.keyFormat=yt,Ze&&(Ae.keyID=Ze),Qe&&(Ae.keyFormatVersions=Qe),Ae.iv=Ke));break}case"START":{var dt=new R.AttrList(he),pt=dt.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(pt)&&(T.startTimeOffset=pt);break}case"MAP":{var At=new R.AttrList(he);q.relurl=At.URI,At.BYTERANGE&&q.setByteRange(At.BYTERANGE),q.level=s,q.sn="initSegment",Ae&&(q.levelkey=Ae),q.initSegment=null,I=q,Fe=!0;break}case"SERVER-CONTROL":{var wt=new R.AttrList(he);T.canBlockReload=wt.bool("CAN-BLOCK-RELOAD"),T.canSkipUntil=wt.optionalFloat("CAN-SKIP-UNTIL",0),T.canSkipDateRanges=T.canSkipUntil>0&&wt.bool("CAN-SKIP-DATERANGES"),T.partHoldBack=wt.optionalFloat("PART-HOLD-BACK",0),T.holdBack=wt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Oe=new R.AttrList(he);T.partTarget=Oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var we=T.partList;we||(we=T.partList=[]);var Je=W>0?we[we.length-1]:void 0,st=W++,He=new j.Part(new R.AttrList(he),q,h,st,Je);we.push(He),q.duration+=He.duration;break}case"PRELOAD-HINT":{var nt=new R.AttrList(he);T.preloadHint=nt;break}case"RENDITION-REPORT":{var Te=new R.AttrList(he);T.renditionReports=T.renditionReports||[],T.renditionReports.push(Te);break}default:c.logger.warn("line parsed but not handled: "+le);break}}}F&&!F.relurl?(S.pop(),Y-=F.duration,T.partList&&(T.fragmentHint=F)):T.partList&&(v(q,F),q.cc=H,T.fragmentHint=q);var ge=S.length,be=S[0],re=S[ge-1];if(Y+=T.skippedSegments*T.targetduration,Y>0&&ge&&re){T.averagetargetduration=Y/ge;var ie=re.sn;T.endSN=ie!=="initSegment"?ie:0,be&&(T.startCC=be.cc,be.initSegment||T.fragments.every(function(ce){return ce.relurl&&n(ce.relurl)})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),q=new j.Fragment(l,h),q.relurl=re.relurl,q.level=s,q.sn="initSegment",be.initSegment=q,T.needSidxRanges=!0))}else T.endSN=0,T.startCC=0;return T.fragmentHint&&(Y+=T.fragmentHint.duration),T.totalduration=Y,T.endCC=H,Ge>0&&E(S,Ge),T},O}();function u(O,A){["video","audio","text"].forEach(function(p){var h=O.filter(function(l){return Object(g.isCodecType)(l,p)});if(h.length){var s=h.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});A[p+"Codec"]=s.length>0?s[0]:h[0],O=O.filter(function(l){return h.indexOf(l)===-1})}}),A.unknownCodecs=O}function x(O,A,p){var h=A[p];h&&(O[p]=h)}function E(O,A){for(var p=O[A],h=A;h--;){var s=O[h];if(!s)return;s.programDateTime=p.programDateTime-s.duration*1e3,p=s}}function v(O,A){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):A!=null&&A.programDateTime&&(O.programDateTime=A.endProgramDateTime),Object(z.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/polyfills/number.ts"),B=P("./src/events.ts"),M=P("./src/errors.ts"),j=P("./src/utils/logger.ts"),U=P("./src/utils/mp4-tools.ts"),_=P("./src/loader/m3u8-parser.ts"),R=P("./src/types/loader.ts"),c=P("./src/utils/attr-list.ts");function g(f){var m=f.type;switch(m){case R.PlaylistContextType.AUDIO_TRACK:return R.PlaylistLevelType.AUDIO;case R.PlaylistContextType.SUBTITLE_TRACK:return R.PlaylistLevelType.SUBTITLE;default:return R.PlaylistLevelType.MAIN}}function w(f,m){var a=f.url;return(a===void 0||a.indexOf("data:")===0)&&(a=m.url),a}var y=function(){function f(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var m=f.prototype;return m.registerListeners=function(){var n=this.hls;n.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.unregisterListeners=function(){var n=this.hls;n.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},m.createInternalLoader=function(n){var o=this.hls.config,u=o.pLoader,x=o.loader,E=u||x,v=new E(o);return n.loader=v,this.loaders[n.type]=v,v},m.getInternalLoader=function(n){return this.loaders[n.type]},m.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},m.destroyInternalLoaders=function(){for(var n in this.loaders){var o=this.loaders[n];o&&o.destroy(),this.resetInternalLoader(n)}},m.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},m.onManifestLoading=function(n,o){var u=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:R.PlaylistContextType.MANIFEST,url:u,deliveryDirectives:null})},m.onLevelLoading=function(n,o){var u=o.id,x=o.level,E=o.url,v=o.deliveryDirectives;this.load({id:u,groupId:null,level:x,responseType:"text",type:R.PlaylistContextType.LEVEL,url:E,deliveryDirectives:v})},m.onAudioTrackLoading=function(n,o){var u=o.id,x=o.groupId,E=o.url,v=o.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:R.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:v})},m.onSubtitleTrackLoading=function(n,o){var u=o.id,x=o.groupId,E=o.url,v=o.deliveryDirectives;this.load({id:u,groupId:x,level:null,responseType:"text",type:R.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:v})},m.load=function(n){var o,u=this.hls.config,x=this.getInternalLoader(n);if(x){var E=x.context;if(E&&E.url===n.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),x.abort()}var v,O,A,p;switch(n.type){case R.PlaylistContextType.MANIFEST:v=u.manifestLoadingMaxRetry,O=u.manifestLoadingTimeOut,A=u.manifestLoadingRetryDelay,p=u.manifestLoadingMaxRetryTimeout;break;case R.PlaylistContextType.LEVEL:case R.PlaylistContextType.AUDIO_TRACK:case R.PlaylistContextType.SUBTITLE_TRACK:v=0,O=u.levelLoadingTimeOut;break;default:v=u.levelLoadingMaxRetry,O=u.levelLoadingTimeOut,A=u.levelLoadingRetryDelay,p=u.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(n),(o=n.deliveryDirectives)!==null&&o!==void 0&&o.part){var h;if(n.type===R.PlaylistContextType.LEVEL&&n.level!==null?h=this.hls.levels[n.level].details:n.type===R.PlaylistContextType.AUDIO_TRACK&&n.id!==null?h=this.hls.audioTracks[n.id].details:n.type===R.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(h=this.hls.subtitleTracks[n.id].details),h){var s=h.partTarget,l=h.targetduration;s&&l&&(O=Math.min(Math.max(s*3,l*.8)*1e3,O))}}var D={timeout:O,maxRetry:v,retryDelay:A,maxRetryDelay:p,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(n,D,T)},m.loadsuccess=function(n,o,u,x){if(x===void 0&&(x=null),u.isSidxRequest){this.handleSidxRequest(n,u),this.handlePlaylistLoaded(n,o,u,x);return}this.resetInternalLoader(u.type);var E=n.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,u,"no EXTM3U delimiter",x);return}o.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,o,u,x):this.handleMasterPlaylist(n,o,u,x)},m.loaderror=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!1,n)},m.loadtimeout=function(n,o,u){u===void 0&&(u=null),this.handleNetworkError(o,u,!0)},m.handleMasterPlaylist=function(n,o,u,x){var E=this.hls,v=n.data,O=w(n,u),A=_.default.parseMasterPlaylist(v,O),p=A.levels,h=A.sessionData;if(!p.length){this.handleManifestParsingError(n,u,"no level found in manifest",x);return}var s=p.map(function(C){return{id:C.attrs.AUDIO,audioCodec:C.audioCodec}}),l=p.map(function(C){return{id:C.attrs.SUBTITLES,textCodec:C.textCodec}}),D=_.default.parseMasterPlaylistMedia(v,O,"AUDIO",s),T=_.default.parseMasterPlaylistMedia(v,O,"SUBTITLES",l),S=_.default.parseMasterPlaylistMedia(v,O,"CLOSED-CAPTIONS");if(D.length){var I=D.some(function(C){return!C.url});!I&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),D.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))}E.trigger(B.Events.MANIFEST_LOADED,{levels:p,audioTracks:D,subtitles:T,captions:S,url:O,stats:o,networkDetails:x,sessionData:h})},m.handleTrackOrLevelPlaylist=function(n,o,u,x){var E=this.hls,v=u.id,O=u.level,A=u.type,p=w(n,u),h=Object(z.isFiniteNumber)(v)?v:0,s=Object(z.isFiniteNumber)(O)?O:h,l=g(u),D=_.default.parseLevelPlaylist(n.data,p,s,l,h);if(!D.fragments.length){E.trigger(B.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:p,reason:"no fragments found in level",level:typeof u.level=="number"?u.level:void 0});return}if(A===R.PlaylistContextType.MANIFEST){var T={attrs:new c.AttrList({}),bitrate:0,details:D,name:"",url:p};E.trigger(B.Events.MANIFEST_LOADED,{levels:[T],audioTracks:[],url:p,stats:o,networkDetails:x,sessionData:null})}if(o.parsing.end=performance.now(),D.needSidxRanges){var S,I=(S=D.fragments[0].initSegment)===null||S===void 0?void 0:S.url;this.load({url:I,isSidxRequest:!0,type:A,level:O,levelDetails:D,id:v,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}u.levelDetails=D,this.handlePlaylistLoaded(n,o,u,x)},m.handleSidxRequest=function(n,o){var u=Object(U.parseSegmentIndex)(new Uint8Array(n.data));if(!u)return;var x=u.references,E=o.levelDetails;x.forEach(function(v,O){var A=v.info,p=E.fragments[O];p.byteRange.length===0&&p.setByteRange(String(1+A.end-A.start)+"@"+String(A.start)),p.initSegment&&p.initSegment.setByteRange(String(u.moovEndOffset)+"@0")})},m.handleManifestParsingError=function(n,o,u,x){this.hls.trigger(B.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===R.PlaylistContextType.MANIFEST,url:n.url,reason:u,response:n,context:o,networkDetails:x})},m.handleNetworkError=function(n,o,u,x){u===void 0&&(u=!1),j.logger.warn("[playlist-loader]: A network "+(u?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var E=M.ErrorDetails.UNKNOWN,v=!1,O=this.getInternalLoader(n);switch(n.type){case R.PlaylistContextType.MANIFEST:E=u?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,v=!0;break;case R.PlaylistContextType.LEVEL:E=u?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,v=!1;break;case R.PlaylistContextType.AUDIO_TRACK:E=u?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,v=!1;break;case R.PlaylistContextType.SUBTITLE_TRACK:E=u?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,v=!1;break}O&&this.resetInternalLoader(n.type);var A={type:M.ErrorTypes.NETWORK_ERROR,details:E,fatal:v,url:n.url,loader:O,context:n,networkDetails:o};x&&(A.response=x),this.hls.trigger(B.Events.ERROR,A)},m.handlePlaylistLoaded=function(n,o,u,x){var E=u.type,v=u.level,O=u.id,A=u.groupId,p=u.loader,h=u.levelDetails,s=u.deliveryDirectives;if(!(h!=null&&h.targetduration)){this.handleManifestParsingError(n,u,"invalid target duration",x);return}if(!p)return;h.live&&(p.getCacheAge&&(h.ageHeader=p.getCacheAge()||0),(!p.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0));switch(E){case R.PlaylistContextType.MANIFEST:case R.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:h,level:v||0,id:O||0,stats:o,networkDetails:x,deliveryDirectives:s});break;case R.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:h,id:O||0,groupId:A||"",stats:o,networkDetails:x,deliveryDirectives:s});break;case R.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:h,id:O||0,groupId:A||"",stats:o,networkDetails:x,deliveryDirectives:s});break}},f}();K.default=y},"./src/polyfills/number.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"isFiniteNumber",function(){return z}),P.d(K,"MAX_SAFE_INTEGER",function(){return B});var z=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,K,P){"use strict";P.r(K);var z=function(){function B(){}return B.getSilentFrame=function(j,U){switch(j){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(U===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(U===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},B}();K.default=z},"./src/remux/mp4-generator.ts":function(ee,K,P){"use strict";P.r(K);var z=Math.pow(2,32)-1,B=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in M.types)M.types.hasOwnProperty(U)&&(M.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var _=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]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:_,audio:R};var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=g,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var w=new Uint8Array([105,115,111,109]),y=new Uint8Array([97,118,99,49]),f=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,w,f,w,y),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,c))},M.box=function(U){for(var _=8,R=arguments.length,c=new Array(R>1?R-1:0),g=1;g<R;g++)c[g-1]=arguments[g];for(var w=c.length,y=w;w--;)_+=c[w].byteLength;var f=new Uint8Array(_);for(f[0]=_>>24&255,f[1]=_>>16&255,f[2]=_>>8&255,f[3]=_&255,f.set(U,4),w=0,_=8;w<y;w++)f.set(c[w],_),_+=c[w].byteLength;return f},M.hdlr=function(U){return M.box(M.types.hdlr,M.HDLR_TYPES[U])},M.mdat=function(U){return M.box(M.types.mdat,U)},M.mdhd=function(U,_){_*=U;var R=Math.floor(_/(z+1)),c=Math.floor(_%(z+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,R>>24,R>>16&255,R>>8&255,R&255,c>>24,c>>16&255,c>>8&255,c&255,85,196,0,0]))},M.mdia=function(U){return M.box(M.types.mdia,M.mdhd(U.timescale,U.duration),M.hdlr(U.type),M.minf(U))},M.mfhd=function(U){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},M.minf=function(U){return U.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(U)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(U))},M.moof=function(U,_,R){return M.box(M.types.moof,M.mfhd(U),M.traf(R,_))},M.moov=function(U){for(var _=U.length,R=[];_--;)R[_]=M.trak(U[_]);return M.box.apply(null,[M.types.moov,M.mvhd(U[0].timescale,U[0].duration)].concat(R).concat(M.mvex(U)))},M.mvex=function(U){for(var _=U.length,R=[];_--;)R[_]=M.trex(U[_]);return M.box.apply(null,[M.types.mvex].concat(R))},M.mvhd=function(U,_){_*=U;var R=Math.floor(_/(z+1)),c=Math.floor(_%(z+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,R>>24,R>>16&255,R>>8&255,R&255,c>>24,c>>16&255,c>>8&255,c&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,g)},M.sdtp=function(U){var _=U.samples||[],R=new Uint8Array(4+_.length),c,g;for(c=0;c<_.length;c++)g=_[c].flags,R[c+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return M.box(M.types.sdtp,R)},M.stbl=function(U){return M.box(M.types.stbl,M.stsd(U),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(U){var _=[],R=[],c,g,w;for(c=0;c<U.sps.length;c++)g=U.sps[c],w=g.byteLength,_.push(w>>>8&255),_.push(w&255),_=_.concat(Array.prototype.slice.call(g));for(c=0;c<U.pps.length;c++)g=U.pps[c],w=g.byteLength,R.push(w>>>8&255),R.push(w&255),R=R.concat(Array.prototype.slice.call(g));var y=M.box(M.types.avcC,new Uint8Array([1,_[3],_[4],_[5],252|3,224|U.sps.length].concat(_).concat([U.pps.length]).concat(R))),f=U.width,m=U.height,a=U.pixelRatio[0],n=U.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,f>>8&255,f&255,m>>8&255,m&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]),y,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,n>>24,n>>16&255,n>>8&255,n&255])))},M.esds=function(U){var _=U.config.length;return new Uint8Array([0,0,0,0,3,23+_,0,1,0,4,15+_,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([_]).concat(U.config).concat([6,1,2]))},M.mp4a=function(U){var _=U.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]),M.box(M.types.esds,M.esds(U)))},M.mp3=function(U){var _=U.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]))},M.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(U)):M.box(M.types.stsd,M.STSD,M.mp4a(U)):M.box(M.types.stsd,M.STSD,M.avc1(U))},M.tkhd=function(U){var _=U.id,R=U.duration*U.timescale,c=U.width,g=U.height,w=Math.floor(R/(z+1)),y=Math.floor(R%(z+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,_>>24&255,_>>16&255,_>>8&255,_&255,0,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,y>>24,y>>16&255,y>>8&255,y&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,c>>8&255,c&255,0,0,g>>8&255,g&255,0,0]))},M.traf=function(U,_){var R=M.sdtp(U),c=U.id,g=Math.floor(_/(z+1)),w=Math.floor(_%(z+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,w>>24,w>>16&255,w>>8&255,w&255])),M.trun(U,R.length+16+20+8+16+8+8),R)},M.trak=function(U){return U.duration=U.duration||4294967295,M.box(M.types.trak,M.tkhd(U),M.mdia(U))},M.trex=function(U){var _=U.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(U,_){var R=U.samples||[],c=R.length,g=12+16*c,w=new Uint8Array(g),y,f,m,a,n,o;for(_+=8+g,w.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,c&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255],0),y=0;y<c;y++)f=R[y],m=f.duration,a=f.size,n=f.flags,o=f.cts,w.set([m>>>24&255,m>>>16&255,m>>>8&255,m&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*y);return M.box(M.types.trun,w)},M.initSegment=function(U){M.types||M.init();var _=M.moov(U),R=new Uint8Array(M.FTYP.byteLength+_.byteLength);return R.set(M.FTYP),R.set(_,M.FTYP.byteLength),R},M}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,K.default=B},"./src/remux/mp4-remuxer.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return o}),P.d(K,"normalizePts",function(){return u});var z=P("./src/polyfills/number.ts"),B=P("./src/remux/aac-helper.ts"),M=P("./src/remux/mp4-generator.ts"),j=P("./src/events.ts"),U=P("./src/errors.ts"),_=P("./src/utils/logger.ts"),R=P("./src/types/loader.ts"),c=P("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(O){for(var A=1;A<arguments.length;A++){var p=arguments[A];for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(O[h]=p[h])}return O},g.apply(this,arguments)}var w=10*1e3,y=1024,f=1152,m=null,a=null,n=!1,o=function(){function O(p,h,s,l){if(l===void 0&&(l=""),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=p,this.config=h,this.typeSupported=s,this.ISGenerated=!1,m===null){var D=navigator.userAgent||"",T=D.match(/Chrome\/(\d+)/i);m=T?parseInt(T[1]):0}if(a===null){var S=navigator.userAgent.match(/Safari\/(\d+)/i);a=S?parseInt(S[1]):0}n=!!m&&m<75||!!a&&a<600}var A=O.prototype;return A.destroy=function(){},A.resetTimeStamp=function(h){_.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=h},A.resetNextTimestamp=function(){_.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},A.resetInitSegment=function(){_.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},A.getVideoStartPts=function(h){var s=!1,l=h.reduce(function(D,T){var S=T.pts-D;return S<-4294967296?(s=!0,u(D,T.pts)):S>0?D:T.pts},h[0].pts);return s&&_.logger.debug("PTS rollover detected"),l},A.remux=function(h,s,l,D,T,S,I,C){var W,Y,H,F,q,le,pe=T,Ae=T,Ge=h.pid>-1,Fe=s.pid>-1,Ue=s.samples.length,_e=h.samples.length>0,je=Ue>1,xe=(!Ge||_e)&&(!Fe||je)||this.ISGenerated||I;if(xe){this.ISGenerated||(H=this.generateIS(h,s,T));var he=this.isVideoContiguous,te=-1;if(je&&(te=x(s.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(le=!0,te>0){_.logger.warn("[mp4-remuxer]: Dropped "+te+" out of "+Ue+" video samples due to a missing keyframe");var ye=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(te),s.dropped+=te,Ae+=(s.samples[0].pts-ye)/(s.timescale||9e4)}else te===-1&&(_.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ue+" video samples"),le=!1);if(this.ISGenerated){if(_e&&je){var ue=this.getVideoStartPts(s.samples),Le=u(h.samples[0].pts,ue)-ue,ae=Le/s.inputTimeScale;pe+=Math.max(0,ae),Ae+=Math.max(0,-ae)}if(_e){if(h.samplerate||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(h,s,T)),Y=this.remuxAudio(h,pe,this.isAudioContiguous,S,Fe||je||C===R.PlaylistLevelType.AUDIO?Ae:void 0),je){var oe=Y?Y.endPTS-Y.startPTS:0;s.inputTimeScale||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(h,s,T)),W=this.remuxVideo(s,Ae,he,oe)}}else je&&(W=this.remuxVideo(s,Ae,he,0));W&&(W.firstKeyFrame=te,W.independent=te!==-1)}}return this.ISGenerated&&(l.samples.length&&(q=this.remuxID3(l,T)),D.samples.length&&(F=this.remuxText(D,T))),{audio:Y,video:W,initSegment:H,independent:le,text:F,id3:q}},A.generateIS=function(h,s,l){var D=h.samples,T=s.samples,S=this.typeSupported,I={},C=!Object(z.isFiniteNumber)(this._initPTS),W="audio/mp4",Y,H,F;if(C&&(Y=H=Infinity),h.config&&D.length&&(h.timescale=h.samplerate,h.isAAC||(S.mpeg?(W="audio/mpeg",h.codec=""):S.mp3&&(h.codec="mp3")),I.audio={id:"audio",container:W,codec:h.codec,initSegment:!h.isAAC&&S.mpeg?new Uint8Array(0):M.default.initSegment([h]),metadata:{channelCount:h.channelCount}},C&&(F=h.inputTimeScale,Y=H=D[0].pts-Math.round(F*l))),s.sps&&s.pps&&T.length&&(s.timescale=s.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:M.default.initSegment([s]),metadata:{width:s.width,height:s.height}},C)){F=s.inputTimeScale;var q=this.getVideoStartPts(T),le=Math.round(F*l);H=Math.min(H,u(T[0].dts,q)-le),Y=Math.min(Y,q-le)}if(Object.keys(I).length)return this.ISGenerated=!0,C&&(this._initPTS=Y,this._initDTS=H),{tracks:I,initPTS:Y,timescale:F}},A.remuxVideo=function(h,s,l,D){var T=h.inputTimeScale,S=h.samples,I=[],C=S.length,W=this._initPTS,Y=this.nextAvcDts,H=8,F,q,le,pe=Number.POSITIVE_INFINITY,Ae=Number.NEGATIVE_INFINITY,Ge=0,Fe=!1;if(!l||Y===null){var Ue=s*T,_e=S[0].pts-u(S[0].dts,S[0].pts);Y=Ue-_e}for(var je=0;je<C;je++){var xe=S[je];if(xe.pts=u(xe.pts-W,Y),xe.dts=u(xe.dts-W,Y),xe.dts>xe.pts){var he=9e4*.2;Ge=Math.max(Math.min(Ge,xe.pts-xe.dts),-1*he)}xe.dts<S[je>0?je-1:je].dts&&(Fe=!0)}Fe&&S.sort(function(gt,qe){var Xe=gt.dts-qe.dts,Pe=gt.pts-qe.pts;return Xe||Pe}),q=S[0].dts,le=S[S.length-1].dts;var te=Math.round((le-q)/(C-1));if(Ge<0){if(Ge<te*-2){_.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-te,!0)+" ms");for(var ye=Ge,ue=0;ue<C;ue++)S[ue].dts=ye=Math.max(ye,S[ue].pts-te),S[ue].pts=Math.max(ye,S[ue].pts)}else{_.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(c.toMsFromMpegTsClock)(Ge,!0)+" ms to overcome this issue");for(var Le=0;Le<C;Le++)S[Le].dts=S[Le].dts+Ge}q=S[0].dts}if(l){var ae=q-Y,oe=ae>te,Se=ae<-1;if(oe||Se){oe?_.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(ae,!0)+" ms ("+ae+"dts) hole between fragments detected, filling it"):_.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-ae,!0)+" ms ("+ae+"dts) overlapping between fragments detected"),q=Y;var Me=S[0].pts-ae;S[0].dts=q,S[0].pts=Me,_.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(Me,!0)+"/"+Object(c.toMsFromMpegTsClock)(q,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(ae,!0)+" ms")}}n&&(q=Math.max(0,q));for(var We=0,Ke=0,Qe=0;Qe<C;Qe++){for(var Ze=S[Qe],yt=Ze.units,vt=yt.length,dt=0,pt=0;pt<vt;pt++)dt+=yt[pt].data.length;Ke+=dt,We+=vt,Ze.length=dt,Ze.dts=Math.max(Ze.dts,q),Ze.pts=Math.max(Ze.pts,Ze.dts,0),pe=Math.min(Ze.pts,pe),Ae=Math.max(Ze.pts,Ae)}le=S[C-1].dts;var At=Ke+4*We+8,wt;try{wt=new Uint8Array(At)}catch(gt){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:At,reason:"fail allocating video mdat "+At});return}var Oe=new DataView(wt.buffer);Oe.setUint32(0,At),wt.set(M.default.types.mdat,4);for(var we=0;we<C;we++){for(var Je=S[we],st=Je.units,He=0,nt=0,Te=st.length;nt<Te;nt++){var ge=st[nt],be=ge.data,re=ge.data.byteLength;Oe.setUint32(H,re),H+=4,wt.set(be,H),H+=re,He+=4+re}if(we<C-1)F=S[we+1].dts-Je.dts;else{var ie=this.config,ce=Je.dts-S[we>0?we-1:we].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ee=Math.floor(ie.maxBufferHole*T),Be=(D?pe+D*T:this.nextAudioPts)-Je.pts;Be>Ee?(F=Be-ce,F<0&&(F=ce),_.logger.log("[mp4-remuxer]: It is approximately "+Be/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=ce}else F=ce}var Ie=Math.round(Je.pts-Je.dts);I.push(new E(Je.key,F,He,Ie))}if(I.length&&m&&m<70){var ut=I[0].flags;ut.dependsOn=2,ut.isNonSync=0}console.assert(F!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Y=le+F,this.isVideoContiguous=!0;var bt=M.default.moof(h.sequenceNumber++,q,g({},h,{samples:I})),Tt="video",xt={data1:bt,data2:wt,startPTS:pe/T,endPTS:(Ae+F)/T,startDTS:q/T,endDTS:Y/T,type:Tt,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(wt.length,"MDAT length must not be zero"),xt},A.remuxAudio=function(h,s,l,D,T){var S=h.inputTimeScale,I=h.samplerate?h.samplerate:S,C=S/I,W=h.isAAC?y:f,Y=W*C,H=this._initPTS,F=!h.isAAC&&this.typeSupported.mpeg,q=[],le=h.samples,pe=F?0:8,Ae=this.nextAudioPts||-1,Ge=s*S;if(this.isAudioContiguous=l=l||le.length&&Ae>0&&(D&&Math.abs(Ge-Ae)<9e3||Math.abs(u(le[0].pts-H,Ge)-Ae)<20*Y),le.forEach(function(be){be.pts=u(be.pts-H,Ge)}),!l||Ae<0){if(le=le.filter(function(be){return be.pts>=0}),!le.length)return;T===0?Ae=0:D?Ae=Math.max(0,Ge):Ae=le[0].pts}if(h.isAAC)for(var Fe=T!==void 0,Ue=this.config.maxAudioFramesDrift,_e=0,je=Ae;_e<le.length;_e++){var xe=le[_e],he=xe.pts,te=he-je,ye=Math.abs(1e3*te/S);if(te<=-Ue*Y&&Fe)_e===0&&(_.logger.warn("Audio frame @ "+(he/S).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*te/S)+" ms."),this.nextAudioPts=Ae=je=he);else if(te>=Ue*Y&&ye<w&&Fe){var ue=Math.round(te/Y);je=he-ue*Y,je<0&&(ue--,je+=Y),_e===0&&(this.nextAudioPts=Ae=je),_.logger.warn("[mp4-remuxer]: Injecting "+ue+" audio frame @ "+(je/S).toFixed(3)+"s due to "+Math.round(1e3*te/S)+" ms gap.");for(var Le=0;Le<ue;Le++){var ae=Math.max(je,0),oe=B.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);oe||(_.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),oe=xe.unit.subarray()),le.splice(_e,0,{unit:oe,pts:ae}),je+=Y,_e++}}xe.pts=je,je+=Y}for(var Se=null,Me=null,We,Ke=0,Qe=le.length;Qe--;)Ke+=le[Qe].unit.byteLength;for(var Ze=0,yt=le.length;Ze<yt;Ze++){var vt=le[Ze],dt=vt.unit,pt=vt.pts;if(Me!==null){var At=q[Ze-1];At.duration=Math.round((pt-Me)/C)}else if(l&&h.isAAC&&(pt=Ae),Se=pt,Ke>0){Ke+=pe;try{We=new Uint8Array(Ke)}catch(be){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ke,reason:"fail allocating audio mdat "+Ke});return}if(!F){var wt=new DataView(We.buffer);wt.setUint32(0,Ke),We.set(M.default.types.mdat,4)}}else return;We.set(dt,pe);var Oe=dt.byteLength;pe+=Oe,q.push(new E(!0,W,Oe,0)),Me=pt}var we=q.length;if(!we)return;var Je=q[q.length-1];this.nextAudioPts=Ae=Me+C*Je.duration;var st=F?new Uint8Array(0):M.default.moof(h.sequenceNumber++,Se/C,g({},h,{samples:q}));h.samples=[];var He=Se/S,nt=Ae/S,Te="audio",ge={data1:st,data2:We,startPTS:He,endPTS:nt,startDTS:He,endDTS:nt,type:Te,hasAudio:!0,hasVideo:!1,nb:we};return this.isAudioContiguous=!0,console.assert(We.length,"MDAT length must not be zero"),ge},A.remuxEmptyAudio=function(h,s,l,D){var T=h.inputTimeScale,S=h.samplerate?h.samplerate:T,I=T/S,C=this.nextAudioPts,W=(C!==null?C:D.startDTS*T)+this._initDTS,Y=D.endDTS*T+this._initDTS,H=I*y,F=Math.ceil((Y-W)/H),q=B.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(_.logger.warn("[mp4-remuxer]: remux empty Audio"),!q){_.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var le=[],pe=0;pe<F;pe++){var Ae=W+pe*H;le.push({unit:q,pts:Ae,dts:Ae})}return h.samples=le,this.remuxAudio(h,s,l,!1)},A.remuxID3=function(h,s){var l=h.samples.length;if(!l)return;for(var D=h.inputTimeScale,T=this._initPTS,S=this._initDTS,I=0;I<l;I++){var C=h.samples[I];C.pts=u(C.pts-T,s*D)/D,C.dts=u(C.dts-S,s*D)/D}var W=h.samples;return h.samples=[],{samples:W}},A.remuxText=function(h,s){var l=h.samples.length;if(!l)return;for(var D=h.inputTimeScale,T=this._initPTS,S=0;S<l;S++){var I=h.samples[S];I.pts=u(I.pts-T,s*D)/D}h.samples.sort(function(W,Y){return W.pts-Y.pts});var C=h.samples;return h.samples=[],{samples:C}},O}();function u(O,A){var p;if(A===null)return O;for(A<O?p=-8589934592:p=8589934592;Math.abs(O-A)>4294967296;)O+=p;return O}function x(O){for(var A=0;A<O.length;A++)if(O[A].key)return A;return-1}var E=function(A,p,h,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=p,this.size=h,this.cts=s,this.flags=new v(A)},v=function(A){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=A?2:1,this.isNonSync=A?0:1}},"./src/remux/passthrough-remuxer.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/polyfills/number.ts"),B=P("./src/utils/mp4-tools.ts"),M=P("./src/loader/fragment.ts"),j=P("./src/utils/logger.ts"),U=function(){function c(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var g=c.prototype;return g.destroy=function(){},g.resetTimeStamp=function(y){this.initPTS=y,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(y,f,m){this.audioCodec=f,this.videoCodec=m,this.generateInitSegment(y),this.emitInitSegment=!0},g.generateInitSegment=function(y){var f=this.audioCodec,m=this.videoCodec;if(!y||!y.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(B.parseInitSegment)(y);f||(f=R(a.audio,M.ElementaryStreamTypes.AUDIO)),m||(m=R(a.video,M.ElementaryStreamTypes.VIDEO));var n={};a.audio&&a.video?n.audiovideo={container:"video/mp4",codec:f+","+m,initSegment:y,id:"main"}:a.audio?n.audio={container:"audio/mp4",codec:f,initSegment:y,id:"audio"}:a.video?n.video={container:"video/mp4",codec:m,initSegment:y,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},g.remux=function(y,f,m,a,n){var o=this.initPTS,u=this.lastEndDTS,x={audio:void 0,video:void 0,text:a,id3:m,initSegment:void 0};Object(z.isFiniteNumber)(u)||(u=this.lastEndDTS=n||0);var E=f.samples;if(!E||!E.length)return x;var v={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(E),O=this.initData),!O||!O.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),x;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(o)||(this.initPTS=v.initPTS=o=_(O,E,u));var A=Object(B.getDuration)(E,O),p=u,h=A+p;Object(B.offsetStartDTS)(O,E,o),A>0?this.lastEndDTS=h:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!O.audio,l=!!O.video,D="";s&&(D+="audio"),l&&(D+="video");var T={data1:E,startPTS:p,startDTS:p,endPTS:h,endDTS:h,type:D,hasAudio:s,hasVideo:l,nb:1,dropped:0};return x.audio=T.type==="audio"?T:void 0,x.video=T.type!=="audio"?T:void 0,x.text=a,x.id3=m,x.initSegment=v,x},c}(),_=function(g,w,y){return Object(B.getStartDTS)(g,w)-y};function R(c,g){var w=c==null?void 0:c.codec;return w&&w.length>4?w:w==="hvc1"?"hvc1.1.c.L120.90":w==="av01"?"av01.0.04M.08":w==="avc1"||g===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}K.default=U},"./src/task-loop.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return z});var z=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=B.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},B}()},"./src/types/cmcd.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"CMCDVersion",function(){return z}),P.d(K,"CMCDObjectType",function(){return B}),P.d(K,"CMCDStreamingFormat",function(){return M}),P.d(K,"CMCDStreamType",function(){return j});var z=1,B;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(B||(B={}));var M;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(M||(M={}));var j;(function(U){U.VOD="v",U.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"HlsSkip",function(){return M}),P.d(K,"getSkipValue",function(){return j}),P.d(K,"HlsUrlParameters",function(){return U}),P.d(K,"Level",function(){return _});function z(R,c){for(var g=0;g<c.length;g++){var w=c[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(R,w.key,w)}}function B(R,c,g){return c&&z(R.prototype,c),g&&z(R,g),R}var M;(function(R){R.No="",R.Yes="YES",R.v2="v2"})(M||(M={}));function j(R,c){var g=R.canSkipUntil,w=R.canSkipDateRanges,y=R.endSN,f=c!==void 0?c-y:0;return g&&f<g?w?M.v2:M.Yes:M.No}var U=function(){function R(g,w,y){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=w,this.skip=y}var c=R.prototype;return c.addDirectives=function(w){var y=new self.URL(w);return this.msn!==void 0&&y.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&y.searchParams.set("_HLS_part",this.part.toString()),this.skip&&y.searchParams.set("_HLS_skip",this.skip),y.toString()},R}(),_=function(){function R(c){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=[c.url],this.attrs=c.attrs,this.bitrate=c.bitrate,c.details&&(this.details=c.details),this.id=c.id||0,this.name=c.name,this.width=c.width||0,this.height=c.height||0,this.audioCodec=c.audioCodec,this.videoCodec=c.videoCodec,this.unknownCodecs=c.unknownCodecs,this.codecSet=[c.videoCodec,c.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return B(R,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(g){var w=g%this.url.length;this._urlId!==w&&(this.details=void 0,this._urlId=w)}}]),R}()},"./src/types/loader.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"PlaylistContextType",function(){return z}),P.d(K,"PlaylistLevelType",function(){return B});var z;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var B;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"ChunkMetadata",function(){return z});var z=function(j,U,_,R,c,g){R===void 0&&(R=0),c===void 0&&(c=-1),g===void 0&&(g=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=j,this.sn=U,this.id=_,this.size=R,this.part=c,this.partial=g};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"AttrList",function(){return M});var z=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function j(_){typeof _=="string"&&(_=j.parseAttrList(_));for(var R in _)_.hasOwnProperty(R)&&(this[R]=_[R])}var U=j.prototype;return U.decimalInteger=function(R){var c=parseInt(this[R],10);return c>Number.MAX_SAFE_INTEGER?Infinity:c},U.hexadecimalInteger=function(R){if(this[R]){var c=(this[R]||"0x").slice(2);c=(c.length&1?"0":"")+c;for(var g=new Uint8Array(c.length/2),w=0;w<c.length/2;w++)g[w]=parseInt(c.slice(w*2,w*2+2),16);return g}else return null},U.hexadecimalIntegerAsNumber=function(R){var c=parseInt(this[R],16);return c>Number.MAX_SAFE_INTEGER?Infinity:c},U.decimalFloatingPoint=function(R){return parseFloat(this[R])},U.optionalFloat=function(R,c){var g=this[R];return g?parseFloat(g):c},U.enumeratedString=function(R){return this[R]},U.bool=function(R){return this[R]==="YES"},U.decimalResolution=function(R){var c=z.exec(this[R]);return c===null?void 0:{width:parseInt(c[1],10),height:parseInt(c[2],10)}},j.parseAttrList=function(R){var c,g={},w='"';for(B.lastIndex=0;(c=B.exec(R))!==null;){var y=c[2];y.indexOf(w)===0&&y.lastIndexOf(w)===y.length-1&&(y=y.slice(1,-1)),g[c[1]]=y}return g},j}()},"./src/utils/binary-search.ts":function(ee,K,P){"use strict";P.r(K);var z={search:function(M,j){for(var U=0,_=M.length-1,R=null,c=null;U<=_;){R=(U+_)/2|0,c=M[R];var g=j(c);if(g>0)U=R+1;else if(g<0)_=R-1;else return c}return null}};K.default=z},"./src/utils/buffer-helper.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"BufferHelper",function(){return M});var z=P("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function j(){}return j.isBuffered=function(_,R){try{if(_){for(var c=j.getBuffered(_),g=0;g<c.length;g++)if(R>=c.start(g)&&R<=c.end(g))return!0}}catch(w){}return!1},j.bufferInfo=function(_,R,c){try{if(_){var g=j.getBuffered(_),w=[],y;for(y=0;y<g.length;y++)w.push({start:g.start(y),end:g.end(y)});return this.bufferedInfo(w,R,c)}}catch(f){}return{len:0,start:R,end:R,nextStart:void 0}},j.bufferedInfo=function(_,R,c){R=Math.max(0,R),_.sort(function(v,O){var A=v.start-O.start;return A||O.end-v.end});var g=[];if(c)for(var w=0;w<_.length;w++){var y=g.length;if(y){var f=g[y-1].end;_[w].start-f<c?_[w].end>f&&(g[y-1].end=_[w].end):g.push(_[w])}else g.push(_[w])}else g=_;for(var m=0,a,n=R,o=R,u=0;u<g.length;u++){var x=g[u].start,E=g[u].end;if(R+c>=x&&R<E)n=x,o=E,m=o-R;else if(R+c<x){a=x;break}}return{len:m,start:n||0,end:o||0,nextStart:a}},j.getBuffered=function(_){try{return _.buffered}catch(R){return z.logger.log("failed to get media.buffered",R),B}},j}()},"./src/utils/cea-608-parser.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"Row",function(){return o}),P.d(K,"CaptionScreen",function(){return u});var z=P("./src/utils/logger.ts"),B={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(h){var s=h;return B.hasOwnProperty(h)&&(s=B[h]),String.fromCharCode(s)},j=15,U=100,_={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},R={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},w=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],y;(function(p){p[p.ERROR=0]="ERROR",p[p.TEXT=1]="TEXT",p[p.WARNING=2]="WARNING",p[p.INFO=2]="INFO",p[p.DEBUG=3]="DEBUG",p[p.DATA=3]="DATA"})(y||(y={}));var f=function(){function p(){this.time=null,this.verboseLevel=y.ERROR}var h=p.prototype;return h.log=function(l,D){this.verboseLevel>=l&&z.logger.log(this.time+" ["+l+"] "+D)},p}(),m=function(h){for(var s=[],l=0;l<h.length;l++)s.push(h[l].toString(16));return s},a=function(){function p(s,l,D,T,S){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=s||"white",this.underline=l||!1,this.italics=D||!1,this.background=T||"black",this.flash=S||!1}var h=p.prototype;return h.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},h.setStyles=function(l){for(var D=["foreground","underline","italics","background","flash"],T=0;T<D.length;T++){var S=D[T];l.hasOwnProperty(S)&&(this[S]=l[S])}},h.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},h.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},h.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},h.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},p}(),n=function(){function p(s,l,D,T,S,I){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new a(l,D,T,S,I)}var h=p.prototype;return h.reset=function(){this.uchar=" ",this.penState.reset()},h.setChar=function(l,D){this.uchar=l,this.penState.copy(D)},h.setPenState=function(l){this.penState.copy(l)},h.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},h.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},h.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},p}(),o=function(){function p(s){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<U;l++)this.chars.push(new n);this.logger=s,this.pos=0,this.currPenState=new a}var h=p.prototype;return h.equals=function(l){for(var D=!0,T=0;T<U;T++)if(!this.chars[T].equals(l.chars[T])){D=!1;break}return D},h.copy=function(l){for(var D=0;D<U;D++)this.chars[D].copy(l.chars[D])},h.isEmpty=function(){for(var l=!0,D=0;D<U;D++)if(!this.chars[D].isEmpty()){l=!1;break}return l},h.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(y.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(y.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},h.moveCursor=function(l){var D=this.pos+l;if(l>1)for(var T=this.pos+1;T<D+1;T++)this.chars[T].setPenState(this.currPenState);this.setCursor(D)},h.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},h.insertChar=function(l){l>=144&&this.backSpace();var D=M(l);if(this.pos>=U){this.logger.log(y.ERROR,"Cannot insert "+l.toString(16)+" ("+D+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(D,this.currPenState),this.moveCursor(1)},h.clearFromPos=function(l){var D;for(D=l;D<U;D++)this.chars[D].reset()},h.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},h.clearToEndOfRow=function(){this.clearFromPos(this.pos)},h.getTextString=function(){for(var l=[],D=!0,T=0;T<U;T++){var S=this.chars[T].uchar;S!==" "&&(D=!1),l.push(S)}return D?"":l.join("")},h.setPenStyles=function(l){this.currPenState.setStyles(l);var D=this.chars[this.pos];D.setPenState(this.currPenState)},p}(),u=function(){function p(s){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<j;l++)this.rows.push(new o(s));this.logger=s,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=p.prototype;return h.reset=function(){for(var l=0;l<j;l++)this.rows[l].clear();this.currRow=j-1},h.equals=function(l){for(var D=!0,T=0;T<j;T++)if(!this.rows[T].equals(l.rows[T])){D=!1;break}return D},h.copy=function(l){for(var D=0;D<j;D++)this.rows[D].copy(l.rows[D])},h.isEmpty=function(){for(var l=!0,D=0;D<j;D++)if(!this.rows[D].isEmpty()){l=!1;break}return l},h.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},h.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},h.insertChar=function(l){var D=this.rows[this.currRow];D.insertChar(l)},h.setPen=function(l){var D=this.rows[this.currRow];D.setPenStyles(l)},h.moveCursor=function(l){var D=this.rows[this.currRow];D.moveCursor(l)},h.setCursor=function(l){this.logger.log(y.INFO,"setCursor: "+l);var D=this.rows[this.currRow];D.setCursor(l)},h.setPAC=function(l){this.logger.log(y.INFO,"pacData = "+JSON.stringify(l));var D=l.row-1;if(this.nrRollUpRows&&D<this.nrRollUpRows-1&&(D=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==D){for(var T=0;T<j;T++)this.rows[T].clear();var S=this.currRow+1-this.nrRollUpRows,I=this.lastOutputScreen;if(I){var C=I.rows[S].cueStartTime,W=this.logger.time;if(C&&W!==null&&C<W)for(var Y=0;Y<this.nrRollUpRows;Y++)this.rows[D-this.nrRollUpRows+Y+1].copy(I.rows[S+Y])}}this.currRow=D;var H=this.rows[this.currRow];if(l.indent!==null){var F=l.indent,q=Math.max(F-1,0);H.setCursor(l.indent),l.color=H.chars[q].penState.foreground}var le={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(le)},h.setBkgData=function(l){this.logger.log(y.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},h.setRollUpRows=function(l){this.nrRollUpRows=l},h.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(y.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(y.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,D=this.rows.splice(l,1)[0];D.clear(),this.rows.splice(this.currRow,0,D),this.logger.log(y.INFO,"Rolling up")},h.getDisplayText=function(l){l=l||!1;for(var D=[],T="",S=-1,I=0;I<j;I++){var C=this.rows[I].getTextString();C&&(S=I+1,l?D.push("Row "+S+": '"+C+"'"):D.push(C.trim()))}return D.length>0&&(l?T="["+D.join(" | ")+"]":T=D.join(`
`)),T},h.getTextAndFormat=function(){return this.rows},p}(),x=function(){function p(s,l,D){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=s,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new u(D),this.nonDisplayedMemory=new u(D),this.lastOutputScreen=new u(D),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=D}var h=p.prototype;return h.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},h.getHandler=function(){return this.outputFilter},h.setHandler=function(l){this.outputFilter=l},h.setPAC=function(l){this.writeScreen.setPAC(l)},h.setBkgData=function(l){this.writeScreen.setBkgData(l)},h.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(y.INFO,"MODE="+l),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=l},h.insertChars=function(l){for(var D=0;D<l.length;D++)this.writeScreen.insertChar(l[D]);var T=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(y.INFO,T+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(y.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},h.ccRCL=function(){this.logger.log(y.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},h.ccBS=function(){if(this.logger.log(y.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},h.ccAOF=function(){},h.ccAON=function(){},h.ccDER=function(){this.logger.log(y.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},h.ccRU=function(l){this.logger.log(y.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},h.ccFON=function(){this.logger.log(y.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},h.ccRDC=function(){this.logger.log(y.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},h.ccTR=function(){this.logger.log(y.INFO,"TR"),this.setMode("MODE_TEXT")},h.ccRTD=function(){this.logger.log(y.INFO,"RTD"),this.setMode("MODE_TEXT")},h.ccEDM=function(){this.logger.log(y.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},h.ccCR=function(){this.logger.log(y.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},h.ccENM=function(){this.logger.log(y.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},h.ccEOC=function(){if(this.logger.log(y.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(y.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},h.ccTO=function(l){this.logger.log(y.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},h.ccMIDROW=function(l){var D={flash:!1};if(D.underline=l%2===1,D.italics=l>=46,D.italics)D.foreground="white";else{var T=Math.floor(l/2)-16,S=["white","green","blue","cyan","red","yellow","magenta"];D.foreground=S[T]}this.logger.log(y.INFO,"MIDROW: "+JSON.stringify(D)),this.writeScreen.setPen(D)},h.outputDataUpdate=function(l){l===void 0&&(l=!1);var D=this.logger.time;if(D===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=D:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,D,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:D),this.lastOutputScreen.copy(this.displayedMemory))},h.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},p}(),E=function(){function p(s,l,D){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var T=new f;this.channels=[null,new x(s,l,T),new x(s+1,D,T)],this.cmdHistory=A(),this.logger=T}var h=p.prototype;return h.getHandler=function(l){return this.channels[l].getHandler()},h.setHandler=function(l,D){this.channels[l].setHandler(D)},h.addData=function(l,D){var T,S,I,C=!1;this.logger.time=l;for(var W=0;W<D.length;W+=2){if(S=D[W]&127,I=D[W+1]&127,S===0&&I===0)continue;if(this.logger.log(y.DATA,"["+m([D[W],D[W+1]])+"] -> ("+m([S,I])+")"),T=this.parseCmd(S,I),T||(T=this.parseMidrow(S,I)),T||(T=this.parsePAC(S,I)),T||(T=this.parseBackgroundAttributes(S,I)),!T&&(C=this.parseChars(S,I),C)){var Y=this.currentChannel;if(Y&&Y>0){var H=this.channels[Y];H.insertChars(C)}else this.logger.log(y.WARNING,"No channel found yet. TEXT-MODE?")}!T&&!C&&this.logger.log(y.WARNING,"Couldn't parse cleaned data "+m([S,I])+" orig: "+m([D[W],D[W+1]]))}},h.parseCmd=function(l,D){var T=this.cmdHistory,S=(l===20||l===28||l===21||l===29)&&D>=32&&D<=47,I=(l===23||l===31)&&D>=33&&D<=35;if(!(S||I))return!1;if(O(l,D,T))return v(null,null,T),this.logger.log(y.DEBUG,"Repeated command ("+m([l,D])+") is dropped"),!0;var C=l===20||l===21||l===23?1:2,W=this.channels[C];return l===20||l===21||l===28||l===29?D===32?W.ccRCL():D===33?W.ccBS():D===34?W.ccAOF():D===35?W.ccAON():D===36?W.ccDER():D===37?W.ccRU(2):D===38?W.ccRU(3):D===39?W.ccRU(4):D===40?W.ccFON():D===41?W.ccRDC():D===42?W.ccTR():D===43?W.ccRTD():D===44?W.ccEDM():D===45?W.ccCR():D===46?W.ccENM():D===47&&W.ccEOC():W.ccTO(D-32),v(l,D,T),this.currentChannel=C,!0},h.parseMidrow=function(l,D){var T=0;if((l===17||l===25)&&D>=32&&D<=47){if(l===17?T=1:T=2,T!==this.currentChannel)return this.logger.log(y.ERROR,"Mismatch channel in midrow parsing"),!1;var S=this.channels[T];return S?(S.ccMIDROW(D),this.logger.log(y.DEBUG,"MIDROW ("+m([l,D])+")"),!0):!1}return!1},h.parsePAC=function(l,D){var T,S=this.cmdHistory,I=(l>=17&&l<=23||l>=25&&l<=31)&&D>=64&&D<=127,C=(l===16||l===24)&&D>=64&&D<=95;if(!(I||C))return!1;if(O(l,D,S))return v(null,null,S),!0;var W=l<=23?1:2;D>=64&&D<=95?T=W===1?_[l]:c[l]:T=W===1?R[l]:g[l];var Y=this.channels[W];return Y?(Y.setPAC(this.interpretPAC(T,D)),v(l,D,S),this.currentChannel=W,!0):!1},h.interpretPAC=function(l,D){var T,S={color:null,italics:!1,indent:null,underline:!1,row:l};return D>95?T=D-96:T=D-64,S.underline=(T&1)===1,T<=13?S.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(T/2)]:T<=15?(S.italics=!0,S.color="white"):S.indent=Math.floor((T-16)/2)*4,S},h.parseChars=function(l,D){var T,S=null,I=null;if(l>=25?(T=2,I=l-8):(T=1,I=l),I>=17&&I<=19){var C;I===17?C=D+80:I===18?C=D+112:C=D+144,this.logger.log(y.INFO,"Special char '"+M(C)+"' in channel "+T),S=[C]}else l>=32&&l<=127&&(S=D===0?[l]:[l,D]);if(S){var W=m(S);this.logger.log(y.DEBUG,"Char codes = "+W.join(",")),v(l,D,this.cmdHistory)}return S},h.parseBackgroundAttributes=function(l,D){var T=(l===16||l===24)&&D>=32&&D<=47,S=(l===23||l===31)&&D>=45&&D<=47;if(!(T||S))return!1;var I,C={};l===16||l===24?(I=Math.floor((D-32)/2),C.background=w[I],D%2===1&&(C.background=C.background+"_semi")):D===45?C.background="transparent":(C.foreground="black",D===47&&(C.underline=!0));var W=l<=23?1:2,Y=this.channels[W];return Y.setBkgData(C),v(l,D,this.cmdHistory),!0},h.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var D=this.channels[l];D&&D.reset()}this.cmdHistory=A()},h.cueSplitAtTime=function(l){for(var D=0;D<this.channels.length;D++){var T=this.channels[D];T&&T.cueSplitAtTime(l)}},p}();function v(p,h,s){s.a=p,s.b=h}function O(p,h,s){return s.a===p&&s.b===h}function A(){return{a:null,b:null}}K.default=E},"./src/utils/codecs.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"isCodecType",function(){return B}),P.d(K,"isCodecSupportedInMp4",function(){return M});var z={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function B(j,U){var _=z[U];return!!_&&_[j.slice(0,4)]===!0}function M(j,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/utils/vttparser.ts"),B=P("./src/utils/webvtt-parser.ts"),M=P("./src/utils/texttrack-utils.ts"),j=/\s/,U={newCue:function(R,c,g,w){for(var y=[],f,m,a,n,o,u=self.VTTCue||self.TextTrackCue,x=0;x<w.rows.length;x++)if(f=w.rows[x],a=!0,n=0,o="",!f.isEmpty()){for(var E=0;E<f.chars.length;E++)j.test(f.chars[E].uchar)&&a?n++:(o+=f.chars[E].uchar,a=!1);f.cueStartTime=c,c===g&&(g+=1e-4),n>=16?n--:n++;var v=Object(z.fixLineBreaks)(o.trim()),O=Object(B.generateCueId)(c,g,v);(!R||!R.cues||!R.cues.getCueById(O))&&(m=new u(c,g,v),m.id=O,m.line=x+1,m.align="left",m.position=10+Math.min(80,Math.floor(n*8/32)*10),y.push(m))}return R&&y.length&&(y.sort(function(A,p){return A.line==="auto"||p.line==="auto"?0:A.line>8&&p.line>8?p.line-A.line:A.line-p.line}),y.forEach(function(A){return Object(M.addCueToTrack)(R,A)})),y}};K.default=U},"./src/utils/discontinuities.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"findFirstFragWithCC",function(){return j}),P.d(K,"shouldAlignOnDiscontinuities",function(){return U}),P.d(K,"findDiscontinuousReferenceFrag",function(){return _}),P.d(K,"adjustSlidingStart",function(){return c}),P.d(K,"alignStream",function(){return g}),P.d(K,"alignPDT",function(){return y}),P.d(K,"alignFragmentByPDTDelta",function(){return f}),P.d(K,"alignMediaPlaylistByPDT",function(){return m});var z=P("./src/polyfills/number.ts"),B=P("./src/utils/logger.ts"),M=P("./src/controller/level-helper.ts");function j(a,n){for(var o=null,u=0,x=a.length;u<x;u++){var E=a[u];if(E&&E.cc===n){o=E;break}}return o}function U(a,n,o){return!!(n.details&&(o.endCC>o.startCC||a&&a.cc<o.startCC))}function _(a,n){var o=a.fragments,u=n.fragments;if(!u.length||!o.length){B.logger.log("No fragments to align");return}var x=j(o,u[0].cc);if(!x||x&&!x.startPTS){B.logger.log("No frag in previous level to align on");return}return x}function R(a,n){if(a){var o=a.start+n;a.start=a.startPTS=o,a.endPTS=o+a.duration}}function c(a,n){for(var o=n.fragments,u=0,x=o.length;u<x;u++)R(o[u],a);n.fragmentHint&&R(n.fragmentHint,a),n.alignedSliding=!0}function g(a,n,o){if(!n)return;w(a,o,n),!o.alignedSliding&&n.details&&y(o,n.details),!o.alignedSliding&&n.details&&!o.skippedSegments&&Object(M.adjustSliding)(n.details,o)}function w(a,n,o){if(U(a,o,n)){var u=_(o.details,n);u&&Object(z.isFiniteNumber)(u.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),c(u.start,n))}}function y(a,n){if(!n.fragments.length||!a.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,u=a.fragments[0].programDateTime,x=(u-o)/1e3+n.fragments[0].start;x&&Object(z.isFiniteNumber)(x)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(u-o)+"ms, sliding:"+x.toFixed(3)+" "+a.url+" "),c(x,a))}function f(a,n){var o=a.programDateTime;if(!o)return;var u=(o-n)/1e3;a.start=a.startPTS=u,a.endPTS=u+a.duration}function m(a,n){if(!n.fragments.length||!a.hasProgramDateTime||!n.hasProgramDateTime)return;var o=n.fragments[0].programDateTime,u=n.fragments[0].start,x=o-u*1e3;a.fragments.forEach(function(E){f(E,x)}),a.fragmentHint&&f(a.fragmentHint,x),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/utils/ewma.ts"),B=function(){function M(U,_,R){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=R,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(U),this.fast_=new z.default(_)}var j=M.prototype;return j.update=function(_,R){var c=this.slow_,g=this.fast_;this.slow_.halfLife!==_&&(this.slow_=new z.default(_,c.getEstimate(),c.getTotalWeight())),this.fast_.halfLife!==R&&(this.fast_=new z.default(R,g.getEstimate(),g.getTotalWeight()))},j.sample=function(_,R){_=Math.max(_,this.minDelayMs_);var c=8*R,g=_/1e3,w=c/g;this.fast_.sample(g,w),this.slow_.sample(g,w)},j.canEstimate=function(){var _=this.fast_;return _&&_.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},M}();K.default=B},"./src/utils/ewma.ts":function(ee,K,P){"use strict";P.r(K);var z=function(){function B(j,U,_){U===void 0&&(U=0),_===void 0&&(_=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=U,this.totalWeight_=_}var M=B.prototype;return M.sample=function(U,_){var R=Math.pow(this.alpha_,U);this.estimate_=_*(1-R)+R*this.estimate_,this.totalWeight_+=U},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},B}();K.default=z},"./src/utils/fetch-loader.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"fetchSupported",function(){return f});var z=P("./src/polyfills/number.ts"),B=P("./src/loader/load-stats.ts"),M=P("./src/demux/chunk-cache.ts");function j(u,x){u.prototype=Object.create(x.prototype),u.prototype.constructor=u,g(u,x)}function U(u){var x=typeof Map=="function"?new Map:void 0;return U=function(v){if(v===null||!c(v))return v;if(typeof v!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x!="undefined"){if(x.has(v))return x.get(v);x.set(v,O)}function O(){return _(v,arguments,w(this).constructor)}return O.prototype=Object.create(v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g(O,v)},U(u)}function _(u,x,E){return R()?_=Reflect.construct:_=function(O,A,p){var h=[null];h.push.apply(h,A);var s=Function.bind.apply(O,h),l=new s;return p&&g(l,p.prototype),l},_.apply(null,arguments)}function R(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(u){return!1}}function c(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function g(u,x){return g=Object.setPrototypeOf||function(v,O){return v.__proto__=O,v},g(u,x)}function w(u){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},w(u)}function y(){return y=Object.assign||function(u){for(var x=1;x<arguments.length;x++){var E=arguments[x];for(var v in E)Object.prototype.hasOwnProperty.call(E,v)&&(u[v]=E[v])}return u},y.apply(this,arguments)}function f(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(u){}return!1}var m=function(){function u(E){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=E.fetchSetup||n,this.controller=new self.AbortController,this.stats=new B.LoadStats}var x=u.prototype;return x.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},x.abortInternal=function(){var v=this.response;(!v||!v.ok)&&(this.stats.aborted=!0,this.controller.abort())},x.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},x.load=function(v,O,A){var p=this,h=this.stats;if(h.loading.start)throw new Error("Loader can only be used once.");h.loading.start=self.performance.now();var s=a(v,this.controller.signal),l=A.onProgress,D=v.responseType==="arraybuffer",T=D?"byteLength":"length";this.context=v,this.config=O,this.callbacks=A,this.request=this.fetchSetup(v,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){p.abortInternal(),A.onTimeout(h,v,p.response)},O.timeout),self.fetch(this.request).then(function(S){if(p.response=p.loader=S,!S.ok){var I=S.status,C=S.statusText;throw new o(C||"fetch, bad network response",I,S)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(S.headers.get("Content-Length")||"0"),l&&Object(z.isFiniteNumber)(O.highWaterMark)?p.loadProgressively(S,h,v,O.highWaterMark,l):D?S.arrayBuffer():S.text()}).then(function(S){var I=p.response;self.clearTimeout(p.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=S[T];var C={url:I.url,data:S};l&&!Object(z.isFiniteNumber)(O.highWaterMark)&&l(h,v,S,I),A.onSuccess(C,h,v,I)}).catch(function(S){if(self.clearTimeout(p.requestTimeout),h.aborted)return;var I=S.code||0;A.onError({code:I,text:S.message},v,S.details)})},x.getCacheAge=function(){var v=null;if(this.response){var O=this.response.headers.get("age");v=O?parseFloat(O):null}return v},x.loadProgressively=function(v,O,A,p,h){p===void 0&&(p=0);var s=new M.default,l=v.body.getReader(),D=function T(){return l.read().then(function(S){if(S.done)return s.dataLength&&h(O,A,s.flush(),v),Promise.resolve(new ArrayBuffer(0));var I=S.value,C=I.length;return O.loaded+=C,C<p||s.dataLength?(s.push(I),s.dataLength>=p&&h(O,A,s.flush(),v)):h(O,A,I,v),T()}).catch(function(){return Promise.reject()})};return D()},u}();function a(u,x){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:x,headers:new self.Headers(y({},u.headers))};return u.rangeEnd&&E.headers.set("Range","bytes="+u.rangeStart+"-"+String(u.rangeEnd-1)),E}function n(u,x){return new self.Request(u.url,x)}var o=function(u){j(x,u);function x(E,v,O){var A;return A=u.call(this,E)||this,A.code=void 0,A.details=void 0,A.code=v,A.details=O,A}return x}(U(Error));K.default=m},"./src/utils/imsc1-ttml-parser.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"IMSC1_CODEC",function(){return c}),P.d(K,"parseIMSC1",function(){return f});var z=P("./src/utils/mp4-tools.ts"),B=P("./src/utils/vttparser.ts"),M=P("./src/utils/vttcue.ts"),j=P("./src/demux/id3.ts"),U=P("./src/utils/timescale-conversion.ts"),_=P("./src/utils/webvtt-parser.ts");function R(){return R=Object.assign||function(p){for(var h=1;h<arguments.length;h++){var s=arguments[h];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(p[l]=s[l])}return p},R.apply(this,arguments)}var c="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,w=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,y={left:"start",center:"center",right:"end",start:"start",end:"end"};function f(p,h,s,l,D){var T=Object(z.findBox)(new Uint8Array(p),["mdat"]);if(T.length===0){D(new Error("Could not parse IMSC1 mdat"));return}var S=T[0],I=Object(j.utf8ArrayToStr)(new Uint8Array(p,S.start,S.end-S.start)),C=Object(U.toTimescaleFromScale)(h,1,s);try{l(m(I,C))}catch(W){D(W)}}function m(p,h){var s=new DOMParser,l=s.parseFromString(p,"text/xml"),D=l.getElementsByTagName("tt")[0];if(!D)throw new Error("Invalid ttml");var T={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},S=Object.keys(T).reduce(function(H,F){return H[F]=D.getAttribute("ttp:"+F)||T[F],H},{}),I=D.getAttribute("xml:space")!=="preserve",C=n(a(D,"styling","style")),W=n(a(D,"layout","region")),Y=a(D,"body","[begin]");return[].map.call(Y,function(H){var F=o(H,I);if(!F||!H.hasAttribute("begin"))return null;var q=v(H.getAttribute("begin"),S),le=v(H.getAttribute("dur"),S),pe=v(H.getAttribute("end"),S);if(q===null)throw E(H);if(pe===null){if(le===null)throw E(H);pe=q+le}var Ae=new M.default(q-h,pe-h,F);Ae.id=Object(_.generateCueId)(Ae.startTime,Ae.endTime,Ae.text);var Ge=W[H.getAttribute("region")],Fe=C[H.getAttribute("style")];Ae.position=10,Ae.size=80;var Ue=u(Ge,Fe),_e=Ue.textAlign;if(_e){var je=y[_e];je&&(Ae.lineAlign=je),Ae.align=_e}return R(Ae,Ue),Ae}).filter(function(H){return H!==null})}function a(p,h,s){var l=p.getElementsByTagName(h)[0];return l?[].slice.call(l.querySelectorAll(s)):[]}function n(p){return p.reduce(function(h,s){var l=s.getAttribute("xml:id");return l&&(h[l]=s),h},{})}function o(p,h){return[].slice.call(p.childNodes).reduce(function(s,l,D){var T;return l.nodeName==="br"&&D?s+`
`:(T=l.childNodes)!==null&&T!==void 0&&T.length?o(l,h):h?s+l.textContent.trim().replace(/\s+/g," "):s+l.textContent},"")}function u(p,h){var s="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(D,T){var S=x(h,s,T)||x(p,s,T);return S&&(D[T]=S),D},{})}function x(p,h,s){return p.hasAttributeNS(h,s)?p.getAttributeNS(h,s):null}function E(p){return new Error("Could not parse ttml timestamp "+p)}function v(p,h){if(!p)return null;var s=Object(B.parseTimeStamp)(p);return s===null&&(g.test(p)?s=O(p,h):w.test(p)&&(s=A(p,h))),s}function O(p,h){var s=g.exec(p),l=(s[4]|0)+(s[5]|0)/h.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+l/h.frameRate}function A(p,h){var s=w.exec(p),l=Number(s[1]),D=s[2];switch(D){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/h.frameRate;case"t":return l/h.tickRate}return l}},"./src/utils/logger.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"enableLogs",function(){return _}),P.d(K,"logger",function(){return R});var z=function(){},B={trace:z,debug:z,log:z,warn:z,info:z,error:z},M=B;function j(c){var g=self.console[c];return g?g.bind(self.console,"["+c+"] >"):z}function U(c){for(var g=arguments.length,w=new Array(g>1?g-1:0),y=1;y<g;y++)w[y-1]=arguments[y];w.forEach(function(f){M[f]=c[f]?c[f].bind(c):j(f)})}function _(c){if(self.console&&c===!0||typeof c=="object"){U(c,"debug","log","info","warn","error");try{M.log()}catch(g){M=B}}else M=B}var R=M},"./src/utils/mediakeys-helper.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"KeySystems",function(){return z}),P.d(K,"requestMediaKeySystemAccess",function(){return B});var z;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(z||(z={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"bin2str",function(){return U}),P.d(K,"readUint16",function(){return _}),P.d(K,"readUint32",function(){return R}),P.d(K,"writeUint32",function(){return c}),P.d(K,"findBox",function(){return g}),P.d(K,"parseSegmentIndex",function(){return w}),P.d(K,"parseInitSegment",function(){return y}),P.d(K,"getStartDTS",function(){return f}),P.d(K,"getDuration",function(){return m}),P.d(K,"computeRawDurationFromSamples",function(){return a}),P.d(K,"offsetStartDTS",function(){return n}),P.d(K,"segmentValidRange",function(){return o}),P.d(K,"appendUint8Array",function(){return u});var z=P("./src/utils/typed-array.ts"),B=P("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,j=[].push;function U(x){return String.fromCharCode.apply(null,x)}function _(x,E){"data"in x&&(E+=x.start,x=x.data);var v=x[E]<<8|x[E+1];return v<0?65536+v:v}function R(x,E){"data"in x&&(E+=x.start,x=x.data);var v=x[E]<<24|x[E+1]<<16|x[E+2]<<8|x[E+3];return v<0?4294967296+v:v}function c(x,E,v){"data"in x&&(E+=x.start,x=x.data),x[E]=v>>24,x[E+1]=v>>16&255,x[E+2]=v>>8&255,x[E+3]=v&255}function g(x,E){var v=[];if(!E.length)return v;var O,A,p;"data"in x?(O=x.data,A=x.start,p=x.end):(O=x,A=0,p=O.byteLength);for(var h=A;h<p;){var s=R(O,h),l=U(O.subarray(h+4,h+8)),D=s>1?h+s:p;if(l===E[0])if(E.length===1)v.push({data:O,start:h+8,end:D});else{var T=g({data:O,start:h+8,end:D},E.slice(1));T.length&&j.apply(v,T)}h=D}return v}function w(x){var E=g(x,["moov"]),v=E[0],O=v?v.end:null,A=g(x,["sidx"]);if(!A||!A[0])return null;var p=[],h=A[0],s=h.data[0],l=s===0?8:16,D=R(h,l);l+=4;var T=0,S=0;s===0?l+=8:l+=16,l+=2;var I=h.end+S,C=_(h,l);l+=2;for(var W=0;W<C;W++){var Y=l,H=R(h,Y);Y+=4;var F=H&2147483647,q=(H&2147483648)>>>31;if(q===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var le=R(h,Y);Y+=4,p.push({referenceSize:F,subsegmentDuration:le,info:{duration:le/D,start:I,end:I+F-1}}),I+=F,Y+=4,l=Y}return{earliestPresentationTime:T,timescale:D,version:s,referencesCount:C,references:p,moovEndOffset:O}}function y(x){for(var E=[],v=g(x,["moov","trak"]),O=0;O<v.length;O++){var A=v[O],p=g(A,["tkhd"])[0];if(p){var h=p.data[p.start],s=h===0?12:20,l=R(p,s),D=g(A,["mdia","mdhd"])[0];if(D){h=D.data[D.start],s=h===0?12:20;var T=R(D,s),S=g(A,["mdia","hdlr"])[0];if(S){var I=U(S.data.subarray(S.start+8,S.start+12)),C={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[I];if(C){var W=g(A,["mdia","minf","stbl","stsd"])[0],Y=void 0;W&&(Y=U(W.data.subarray(W.start+12,W.start+16))),E[l]={timescale:T,type:C},E[C]={timescale:T,id:l,codec:Y}}}}}}var H=g(x,["moov","mvex","trex"]);return H.forEach(function(F){var q=R(F,4),le=E[q];le&&(le.default={duration:R(F,12),flags:R(F,20)})}),E}function f(x,E){return g(E,["moof","traf"]).reduce(function(v,O){var A=g(O,["tfdt"])[0],p=A.data[A.start],h=g(O,["tfhd"]).reduce(function(s,l){var D=R(l,4),T=x[D];if(T){var S=R(A,4);p===1&&(S*=Math.pow(2,32),S+=R(A,8));var I=T.timescale||9e4,C=S/I;if(isFinite(C)&&(s===null||C<s))return C}return s},null);return h!==null&&isFinite(h)&&(v===null||h<v)?h:v},null)||0}function m(x,E){for(var v=0,O=0,A=0,p=g(x,["moof","traf"]),h=0;h<p.length;h++){var s=p[h],l=g(s,["tfhd"])[0],D=R(l,4),T=E[D];if(!T)continue;var S=T.default,I=R(l,0)|(S==null?void 0:S.flags),C=S==null?void 0:S.duration;I&8&&(I&2?C=R(l,12):C=R(l,8));for(var W=T.timescale||9e4,Y=g(s,["trun"]),H=0;H<Y.length;H++){if(C){var F=R(Y[H],4);v=C*F}else v=a(Y[H]);T.type===B.ElementaryStreamTypes.VIDEO?O+=v/W:T.type===B.ElementaryStreamTypes.AUDIO&&(A+=v/W)}}if(O===0&&A===0){var q=w(x);if(q!=null&&q.references)return q.references.reduce(function(le,pe){return le+pe.info.duration||0},0)}return O||A}function a(x){var E=R(x,0),v=8;E&1&&(v+=4),E&4&&(v+=4);for(var O=0,A=R(x,4),p=0;p<A;p++){if(E&256){var h=R(x,v);O+=h,v+=4}E&512&&(v+=4),E&1024&&(v+=4),E&2048&&(v+=4)}return O}function n(x,E,v){g(E,["moof","traf"]).forEach(function(O){g(O,["tfhd"]).forEach(function(A){var p=R(A,4),h=x[p];if(!h)return;var s=h.timescale||9e4;g(O,["tfdt"]).forEach(function(l){var D=l.data[l.start],T=R(l,4);if(D===0)c(l,4,T-v*s);else{T*=Math.pow(2,32),T+=R(l,8),T-=v*s,T=Math.max(T,0);var S=Math.floor(T/(M+1)),I=Math.floor(T%(M+1));c(l,4,S),c(l,8,I)}})})})}function o(x){var E={valid:null,remainder:null},v=g(x,["moof"]);if(v){if(v.length<2)return E.remainder=x,E}else return E;var O=v[v.length-1];return E.valid=Object(z.sliceUint8)(x,0,O.start-8),E.remainder=Object(z.sliceUint8)(x,O.start-8),E}function u(x,E){var v=new Uint8Array(x.length+E.length);return v.set(x),v.set(E,x.length),v}},"./src/utils/output-filter.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"default",function(){return z});var z=function(){function B(j,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=U}var M=B.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(U,_,R){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=_,this.screen=R,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"sendAddTrackEvent",function(){return B}),P.d(K,"addCueToTrack",function(){return M}),P.d(K,"clearCurrentCues",function(){return j}),P.d(K,"removeCuesInRange",function(){return U}),P.d(K,"getCuesInRange",function(){return R});var z=P("./src/utils/logger.ts");function B(c,g){var w;try{w=new Event("addtrack")}catch(y){w=document.createEvent("Event"),w.initEvent("addtrack",!1,!1)}w.track=c,g.dispatchEvent(w)}function M(c,g){var w=c.mode;if(w==="disabled"&&(c.mode="hidden"),c.cues&&!c.cues.getCueById(g.id))try{if(c.addCue(g),!c.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(f){z.logger.debug("[texttrack-utils]: "+f);var y=new self.TextTrackCue(g.startTime,g.endTime,g.text);y.id=g.id,c.addCue(y)}w==="disabled"&&(c.mode=w)}function j(c){var g=c.mode;if(g==="disabled"&&(c.mode="hidden"),c.cues)for(var w=c.cues.length;w--;)c.removeCue(c.cues[w]);g==="disabled"&&(c.mode=g)}function U(c,g,w){var y=c.mode;if(y==="disabled"&&(c.mode="hidden"),c.cues&&c.cues.length>0)for(var f=R(c.cues,g,w),m=0;m<f.length;m++)c.removeCue(f[m]);y==="disabled"&&(c.mode=y)}function _(c,g){if(g<c[0].startTime)return 0;var w=c.length-1;if(g>c[w].endTime)return-1;for(var y=0,f=w;y<=f;){var m=Math.floor((f+y)/2);if(g<c[m].startTime)f=m-1;else if(g>c[m].startTime&&y<w)y=m+1;else return m}return c[y].startTime-g<g-c[f].startTime?y:f}function R(c,g,w){var y=[],f=_(c,g);if(f>-1)for(var m=f,a=c.length;m<a;m++){var n=c[m];if(n.startTime>=g&&n.endTime<=w)y.push(n);else if(n.startTime>w)return y}return y}},"./src/utils/time-ranges.ts":function(ee,K,P){"use strict";P.r(K);var z={toString:function(M){for(var j="",U=M.length,_=0;_<U;_++)j+="["+M.start(_).toFixed(3)+","+M.end(_).toFixed(3)+"]";return j}};K.default=z},"./src/utils/timescale-conversion.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"toTimescaleFromBase",function(){return B}),P.d(K,"toTimescaleFromScale",function(){return M}),P.d(K,"toMsFromMpegTsClock",function(){return j}),P.d(K,"toMpegTsClockFromTimescale",function(){return U});var z=9e4;function B(_,R,c,g){c===void 0&&(c=1),g===void 0&&(g=!1);var w=_*R*c;return g?Math.round(w):w}function M(_,R,c,g){return c===void 0&&(c=1),g===void 0&&(g=!1),B(_,R,1/c,g)}function j(_,R){return R===void 0&&(R=!1),B(_,1e3,1/z,R)}function U(_,R){return R===void 0&&(R=1),B(_,z,1/R)}},"./src/utils/typed-array.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"sliceUint8",function(){return z});function z(B,M,j){return Uint8Array.prototype.slice?B.slice(M,j):new Uint8Array(Array.prototype.slice.call(B,M,j))}},"./src/utils/vttcue.ts":function(ee,K,P){"use strict";P.r(K),K.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],B=["start","middle","end","left","right"];function M(c,g){if(typeof g!="string")return!1;if(!Array.isArray(c))return!1;var w=g.toLowerCase();return~c.indexOf(w)?w:!1}function j(c){return M(z,c)}function U(c){return M(B,c)}function _(c){for(var g=arguments.length,w=new Array(g>1?g-1:0),y=1;y<g;y++)w[y-1]=arguments[y];for(var f=1;f<arguments.length;f++){var m=arguments[f];for(var a in m)c[a]=m[a]}return c}function R(c,g,w){var y=this,f={enumerable:!0};y.hasBeenReset=!1;var m="",a=!1,n=c,o=g,u=w,x=null,E="",v=!0,O="auto",A="start",p=50,h="middle",s=50,l="middle";Object.defineProperty(y,"id",_({},f,{get:function(){return m},set:function(T){m=""+T}})),Object.defineProperty(y,"pauseOnExit",_({},f,{get:function(){return a},set:function(T){a=!!T}})),Object.defineProperty(y,"startTime",_({},f,{get:function(){return n},set:function(T){if(typeof T!="number")throw new TypeError("Start time must be set to a number.");n=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"endTime",_({},f,{get:function(){return o},set:function(T){if(typeof T!="number")throw new TypeError("End time must be set to a number.");o=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"text",_({},f,{get:function(){return u},set:function(T){u=""+T,this.hasBeenReset=!0}})),Object.defineProperty(y,"region",_({},f,{get:function(){return x},set:function(T){x=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"vertical",_({},f,{get:function(){return E},set:function(T){var S=j(T);if(S===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=S,this.hasBeenReset=!0}})),Object.defineProperty(y,"snapToLines",_({},f,{get:function(){return v},set:function(T){v=!!T,this.hasBeenReset=!0}})),Object.defineProperty(y,"line",_({},f,{get:function(){return O},set:function(T){if(typeof T!="number"&&T!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"lineAlign",_({},f,{get:function(){return A},set:function(T){var S=U(T);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");A=S,this.hasBeenReset=!0}})),Object.defineProperty(y,"position",_({},f,{get:function(){return p},set:function(T){if(T<0||T>100)throw new Error("Position must be between 0 and 100.");p=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"positionAlign",_({},f,{get:function(){return h},set:function(T){var S=U(T);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");h=S,this.hasBeenReset=!0}})),Object.defineProperty(y,"size",_({},f,{get:function(){return s},set:function(T){if(T<0||T>100)throw new Error("Size must be between 0 and 100.");s=T,this.hasBeenReset=!0}})),Object.defineProperty(y,"align",_({},f,{get:function(){return l},set:function(T){var S=U(T);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");l=S,this.hasBeenReset=!0}})),y.displayState=void 0}return R.prototype.getCueAsHTML=function(){var c=self.WebVTT;return c.convertCueToDOMTree(self,this.text)},R}()},"./src/utils/vttparser.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"parseTimeStamp",function(){return M}),P.d(K,"fixLineBreaks",function(){return g}),P.d(K,"VTTParser",function(){return w});var z=P("./src/utils/vttcue.ts"),B=function(){function y(){}var f=y.prototype;return f.decode=function(a,n){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},y}();function M(y){function f(a,n,o,u){return(a|0)*3600+(n|0)*60+(o|0)+parseFloat(u||0)}var m=y.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return m?parseFloat(m[2])>59?f(m[2],m[3],0,m[4]):f(m[1],m[2],m[3],m[4]):null}var j=function(){function y(){this.values=Object.create(null)}var f=y.prototype;return f.set=function(a,n){!this.get(a)&&n!==""&&(this.values[a]=n)},f.get=function(a,n,o){return o?this.has(a)?this.values[a]:n[o]:this.has(a)?this.values[a]:n},f.has=function(a){return a in this.values},f.alt=function(a,n,o){for(var u=0;u<o.length;++u)if(n===o[u]){this.set(a,n);break}},f.integer=function(a,n){/^-?\d+$/.test(n)&&this.set(a,parseInt(n,10))},f.percent=function(a,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var o=parseFloat(n);if(o>=0&&o<=100)return this.set(a,o),!0}return!1},y}();function U(y,f,m,a){var n=a?y.split(a):[y];for(var o in n){if(typeof n[o]!="string")continue;var u=n[o].split(m);if(u.length!==2)continue;var x=u[0],E=u[1];f(x,E)}}var _=new z.default(0,0,""),R=_.align==="middle"?"middle":"center";function c(y,f,m){var a=y;function n(){var x=M(y);if(x===null)throw new Error("Malformed timestamp: "+a);return y=y.replace(/^[^\sa-zA-Z-]+/,""),x}function o(x,E){var v=new j;U(x,function(p,h){var s;switch(p){case"region":for(var l=m.length-1;l>=0;l--)if(m[l].id===h){v.set(p,m[l].region);break}break;case"vertical":v.alt(p,h,["rl","lr"]);break;case"line":s=h.split(","),v.integer(p,s[0]),v.percent(p,s[0])&&v.set("snapToLines",!1),v.alt(p,s[0],["auto"]),s.length===2&&v.alt("lineAlign",s[1],["start",R,"end"]);break;case"position":s=h.split(","),v.percent(p,s[0]),s.length===2&&v.alt("positionAlign",s[1],["start",R,"end","line-left","line-right","auto"]);break;case"size":v.percent(p,h);break;case"align":v.alt(p,h,["start",R,"end","left","right"]);break}},/:/,/\s/),E.region=v.get("region",null),E.vertical=v.get("vertical","");var O=v.get("line","auto");O==="auto"&&_.line===-1&&(O=-1),E.line=O,E.lineAlign=v.get("lineAlign","start"),E.snapToLines=v.get("snapToLines",!0),E.size=v.get("size",100),E.align=v.get("align",R);var A=v.get("position","auto");A==="auto"&&_.position===50&&(A=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=A}function u(){y=y.replace(/^\s+/,"")}if(u(),f.startTime=n(),u(),y.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);y=y.substr(3),u(),f.endTime=n(),u(),o(y,f)}function g(y){return y.replace(/<br(?: \/)?>/gi,`
`)}var w=function(){function y(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var f=y.prototype;return f.parse=function(a){var n=this;a&&(n.buffer+=n.decoder.decode(a,{stream:!0}));function o(){var A=n.buffer,p=0;for(A=g(A);p<A.length&&A[p]!=="\r"&&A[p]!==`
`;)++p;var h=A.substr(0,p);return A[p]==="\r"&&++p,A[p]===`
`&&++p,n.buffer=A.substr(p),h}function u(A){U(A,function(p,h){},/:/)}try{var x="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;x=o();var E=x.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var v=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;v?v=!1:x=o();switch(n.state){case"HEADER":/:/.test(x)?u(x):x||(n.state="ID");continue;case"NOTE":x||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(x)){n.state="NOTE";break}if(!x)continue;if(n.cue=new z.default(0,0,""),n.state="CUE",x.indexOf("-->")===-1){n.cue.id=x;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{c(x,n.cue,n.regionList)}catch(A){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var O=x.indexOf("-->")!==-1;if(!x||O&&(v=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
`),n.cue.text+=x}continue;case"BADCUE":x||(n.state="ID")}}}catch(A){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},f.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){a.onparsingerror&&a.onparsingerror(n)}return a.onflush&&a.onflush(),this},y}()},"./src/utils/webvtt-parser.ts":function(ee,K,P){"use strict";P.r(K),P.d(K,"generateCueId",function(){return w}),P.d(K,"parseWebVTT",function(){return f});var z=P("./src/polyfills/number.ts"),B=P("./src/utils/vttparser.ts"),M=P("./src/demux/id3.ts"),j=P("./src/utils/timescale-conversion.ts"),U=P("./src/remux/mp4-remuxer.ts"),_=/\r\n|\n\r|\n|\r/g,R=function(a,n,o){return o===void 0&&(o=0),a.substr(o,n.length)===n},c=function(a){var n=parseInt(a.substr(-3)),o=parseInt(a.substr(-6,2)),u=parseInt(a.substr(-9,2)),x=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(n)||!Object(z.isFiniteNumber)(o)||!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return n+=1e3*o,n+=60*1e3*u,n+=60*60*1e3*x,n},g=function(a){for(var n=5381,o=a.length;o;)n=n*33^a.charCodeAt(--o);return(n>>>0).toString()};function w(m,a,n){return g(m.toString())+g(a.toString())+g(n)}var y=function(a,n,o){var u=a[n],x=a[u.prevCC];if(!x||!x.new&&u.new){a.ccOffset=a.presentationOffset=u.start,u.new=!1;return}for(;(E=x)!==null&&E!==void 0&&E.new;){var E;a.ccOffset+=u.start-x.start,u.new=!1,u=x,x=a[u.prevCC]}a.presentationOffset=o};function f(m,a,n,o,u,x,E,v){var O=new B.VTTParser,A=Object(M.utf8ArrayToStr)(new Uint8Array(m)).trim().replace(_,`
`).split(`
`),p=[],h=Object(j.toMpegTsClockFromTimescale)(a,n),s="00:00.000",l=0,D=0,T,S=!0,I=!1;O.oncue=function(C){var W=o[u],Y=o.ccOffset,H=(l-h)/9e4;if(W!=null&&W.new&&(D!==void 0?Y=o.ccOffset=W.start:y(o,u,H)),H&&(Y=H-o.presentationOffset),I){var F=C.endTime-C.startTime,q=Object(U.normalizePts)((C.startTime+Y-D)*9e4,x*9e4)/9e4;C.startTime=q,C.endTime=q+F}var le=C.text.trim();C.text=decodeURIComponent(encodeURIComponent(le)),C.id||(C.id=w(C.startTime,C.endTime,le)),C.endTime>0&&p.push(C)},O.onparsingerror=function(C){T=C},O.onflush=function(){if(T){v(T);return}E(p)},A.forEach(function(C){if(S)if(R(C,"X-TIMESTAMP-MAP=")){S=!1,I=!0,C.substr(16).split(",").forEach(function(W){R(W,"LOCAL:")?s=W.substr(6):R(W,"MPEGTS:")&&(l=parseInt(W.substr(7)))});try{D=c(s)/1e3}catch(W){I=!1,T=W}return}else C===""&&(S=!1);O.parse(C+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(ee,K,P){"use strict";P.r(K);var z=P("./src/utils/logger.ts"),B=P("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,j=function(){function U(R){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=R?R.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var _=U.prototype;return _.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},_.abortInternal=function(){var c=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),c&&(c.onreadystatechange=null,c.onprogress=null,c.readyState!==4&&(this.stats.aborted=!0,c.abort()))},_.abort=function(){var c;this.abortInternal(),(c=this.callbacks)!==null&&c!==void 0&&c.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},_.load=function(c,g,w){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=c,this.config=g,this.callbacks=w,this.retryDelay=g.retryDelay,this.loadInternal()},_.loadInternal=function(){var c=this.config,g=this.context;if(!c)return;var w=this.loader=new self.XMLHttpRequest,y=this.stats;y.loading.first=0,y.loaded=0;var f=this.xhrSetup;try{if(f)try{f(w,g.url)}catch(n){w.open("GET",g.url,!0),f(w,g.url)}w.readyState||w.open("GET",g.url,!0);var m=this.context.headers;if(m)for(var a in m)w.setRequestHeader(a,m[a])}catch(n){this.callbacks.onError({code:w.status,text:n.message},g,w);return}g.rangeEnd&&w.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),w.onreadystatechange=this.readystatechange.bind(this),w.onprogress=this.loadprogress.bind(this),w.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout),w.send()},_.readystatechange=function(){var c=this.context,g=this.loader,w=this.stats;if(!c||!g)return;var y=g.readyState,f=this.config;if(w.aborted)return;if(y>=2)if(self.clearTimeout(this.requestTimeout),w.loading.first===0&&(w.loading.first=Math.max(self.performance.now(),w.loading.start)),y===4){g.onreadystatechange=null,g.onprogress=null;var m=g.status;if(m>=200&&m<300){w.loading.end=Math.max(self.performance.now(),w.loading.first);var a,n;if(c.responseType==="arraybuffer"?(a=g.response,n=a.byteLength):(a=g.responseText,n=a.length),w.loaded=w.total=n,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(w,c,a,g),!this.callbacks)return;var u={url:g.responseURL,data:a};this.callbacks.onSuccess(u,w,c,g)}else w.retry>=f.maxRetry||m>=400&&m<499?(z.logger.error(m+" while loading "+c.url),this.callbacks.onError({code:m,text:g.statusText},c,g)):(z.logger.warn(m+" while loading "+c.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,f.maxRetryDelay),w.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout)},_.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var c=this.callbacks;c&&(this.abortInternal(),c.onTimeout(this.stats,this.context,this.loader))},_.loadprogress=function(c){var g=this.stats;g.loaded=c.loaded,c.lengthComputable&&(g.total=c.total)},_.getCacheAge=function(){var c=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");c=g?parseFloat(g):null}return c},U}();K.default=j}}).default})},vHTk:function(et,de,N){et.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(et,de,N){"use strict";N.d(de,"a",function(){return dt});var ee=N("rePB"),K=N("VTBJ"),P=N("KQm4"),z=N("U8pU"),B=N("ODXe"),M=N("q1tI"),j=N("TSYQ"),U=N.n(j),_=N("Gytx"),R=N.n(_),c=N("Kwbf"),g=N("t23M"),w=N("qx4F"),y=N("6eGT"),f=N("IBYe"),m=N("Ff2n"),a=N("c+Xe"),n=N("fyJ8"),o=N("biw7");function u(Oe,we,Je,st,He){var nt=Je[Oe]||{},Te=Je[we]||{},ge,be;nt.fixed==="left"?ge=st.left[Oe]:Te.fixed==="right"&&(be=st.right[we]);var re=!1,ie=!1,ce=!1,Ee=!1,Be=Je[we+1],Ie=Je[Oe-1];if(He==="rtl"){if(ge!==void 0){var ut=Ie&&Ie.fixed==="left";Ee=!ut}else if(be!==void 0){var bt=Be&&Be.fixed==="right";ce=!bt}}else if(ge!==void 0){var Tt=Be&&Be.fixed==="left";re=!Tt}else if(be!==void 0){var xt=Ie&&Ie.fixed==="right";ie=!xt}return{fixLeft:ge,fixRight:be,lastFixLeft:re,firstFixRight:ie,lastFixRight:ce,firstFixLeft:Ee,isSticky:st.isSticky}}var x=N("sR1s");function E(Oe){var we=Oe.cells,Je=Oe.stickyOffsets,st=Oe.flattenColumns,He=Oe.rowComponent,nt=Oe.cellComponent,Te=Oe.onHeaderRow,ge=Oe.index,be=M.useContext(o.a),re=be.prefixCls,ie=be.direction,ce;Te&&(ce=Te(we.map(function(Be){return Be.column}),ge));var Ee=Object(x.a)(we.map(function(Be){return Be.column}));return M.createElement(He,Object.assign({},ce),we.map(function(Be,Ie){var ut=Be.column,bt=u(Be.colStart,Be.colEnd,st,Je,ie),Tt;return ut&&ut.onHeaderCell&&(Tt=Be.column.onHeaderCell(ut)),M.createElement(n.a,Object.assign({},Be,{ellipsis:ut.ellipsis,align:ut.align,component:nt,prefixCls:re,key:Ee[Ie]},bt,{additionalProps:Tt,rowType:"header"}))}))}E.displayName="HeaderRow";var v=E;function O(Oe){var we=[];function Je(Te,ge){var be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;we[be]=we[be]||[];var re=ge,ie=Te.filter(Boolean).map(function(ce){var Ee={key:ce.key,className:ce.className||"",children:ce.title,column:ce,colStart:re},Be=1,Ie=ce.children;return Ie&&Ie.length>0&&(Be=Je(Ie,re,be+1).reduce(function(ut,bt){return ut+bt},0),Ee.hasSubColumns=!0),"colSpan"in ce&&(Be=ce.colSpan),"rowSpan"in ce&&(Ee.rowSpan=ce.rowSpan),Ee.colSpan=Be,Ee.colEnd=Ee.colStart+Be-1,we[be].push(Ee),re+=Be,Be});return ie}Je(Oe,0);for(var st=we.length,He=function(ge){we[ge].forEach(function(be){!("rowSpan"in be)&&!be.hasSubColumns&&(be.rowSpan=st-ge)})},nt=0;nt<st;nt+=1)He(nt);return we}function A(Oe){var we=Oe.stickyOffsets,Je=Oe.columns,st=Oe.flattenColumns,He=Oe.onHeaderRow,nt=M.useContext(o.a),Te=nt.prefixCls,ge=nt.getComponent,be=M.useMemo(function(){return O(Je)},[Je]),re=ge(["header","wrapper"],"thead"),ie=ge(["header","row"],"tr"),ce=ge(["header","cell"],"th");return M.createElement(re,{className:"".concat(Te,"-thead")},be.map(function(Ee,Be){var Ie=M.createElement(v,{key:Be,flattenColumns:st,cells:Ee,stickyOffsets:we,rowComponent:ie,cellComponent:ce,onHeaderRow:He,index:Be});return Ie}))}var p=A,h=N("hW8S");function s(Oe){for(var we=Oe.colWidths,Je=Oe.columns,st=Oe.columCount,He=[],nt=st||Je.length,Te=!1,ge=nt-1;ge>=0;ge-=1){var be=we[ge],re=Je&&Je[ge],ie=re&&re[h.a];(be||ie||Te)&&(He.unshift(M.createElement("col",Object.assign({key:ge,style:{width:be,minWidth:be}},ie))),Te=!0)}return M.createElement("colgroup",null,He)}var l=s;function D(Oe,we){return Object(M.useMemo)(function(){for(var Je=[],st=0;st<we;st+=1){var He=Oe[st];if(He!==void 0)Je[st]=He;else return null}return Je},[Oe.join("_"),we])}var T=M.forwardRef(function(Oe,we){var Je=Oe.noData,st=Oe.columns,He=Oe.flattenColumns,nt=Oe.colWidths,Te=Oe.columCount,ge=Oe.stickyOffsets,be=Oe.direction,re=Oe.fixHeader,ie=Oe.offsetHeader,ce=Oe.stickyClassName,Ee=Oe.onScroll,Be=Object(m.a)(Oe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ie=M.useContext(o.a),ut=Ie.prefixCls,bt=Ie.scrollbarSize,Tt=Ie.isSticky,xt=Tt&&!re?0:bt,gt=M.useRef(null),qe=M.useCallback(function(it){Object(a.b)(we,it),Object(a.b)(gt,it)},[]);M.useEffect(function(){var it;function at(Ne){var Ve=Ne.currentTarget,tt=Ne.deltaX;tt&&(Ee({currentTarget:Ve,scrollLeft:Ve.scrollLeft+tt}),Ne.preventDefault())}return(it=gt.current)===null||it===void 0||it.addEventListener("wheel",at),function(){var Ne;(Ne=gt.current)===null||Ne===void 0||Ne.removeEventListener("wheel",at)}},[]);var Xe=He[He.length-1],Pe={fixed:Xe?Xe.fixed:null,onHeaderCell:function(){return{className:"".concat(ut,"-cell-scrollbar")}}},se=Object(M.useMemo)(function(){return xt?[].concat(Object(P.a)(st),[Pe]):st},[xt,st]),fe=Object(M.useMemo)(function(){return xt?[].concat(Object(P.a)(He),[Pe]):He},[xt,He]),$e=Object(M.useMemo)(function(){var it=ge.right,at=ge.left;return Object(K.a)(Object(K.a)({},ge),{},{left:be==="rtl"?[].concat(Object(P.a)(at.map(function(Ne){return Ne+xt})),[0]):at,right:be==="rtl"?it:[].concat(Object(P.a)(it.map(function(Ne){return Ne+xt})),[0]),isSticky:Tt})},[xt,ge,Tt]),ke=D(nt,Te);return M.createElement("div",{style:Object(K.a)({overflow:"hidden"},Tt?{top:ie}:{}),ref:qe,className:U()("".concat(ut,"-header"),Object(ee.a)({},ce,!!ce))},M.createElement("table",{style:{tableLayout:"fixed",visibility:Je||ke?null:"hidden"}},M.createElement(l,{colWidths:ke?[].concat(Object(P.a)(ke),[xt]):[],columCount:Te+1,columns:fe}),M.createElement(p,Object.assign({},Be,{stickyOffsets:$e,columns:se,flattenColumns:fe}))))});T.displayName="FixedHeader";var S=T,I=M.createContext(null),C=I;function W(Oe){var we=Oe.prefixCls,Je=Oe.children,st=Oe.component,He=Oe.cellComponent,nt=Oe.fixHeader,Te=Oe.fixColumn,ge=Oe.horizonScroll,be=Oe.className,re=Oe.expanded,ie=Oe.componentWidth,ce=Oe.colSpan,Ee=M.useContext(o.a),Be=Ee.scrollbarSize;return M.useMemo(function(){var Ie=Je;return Te&&(Ie=M.createElement("div",{style:{width:ie-(nt?Be:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(we,"-expanded-row-fixed")},Ie)),M.createElement(st,{className:be,style:{display:re?null:"none"}},M.createElement(n.a,{component:He,prefixCls:we,colSpan:ce},Ie))},[Je,st,nt,ge,be,re,ie,ce,Be])}var Y=W;function H(Oe){var we=Oe.className,Je=Oe.style,st=Oe.record,He=Oe.index,nt=Oe.rowKey,Te=Oe.getRowKey,ge=Oe.rowExpandable,be=Oe.expandedKeys,re=Oe.onRow,ie=Oe.indent,ce=ie===void 0?0:ie,Ee=Oe.rowComponent,Be=Oe.cellComponent,Ie=Oe.childrenColumnName,ut=M.useContext(o.a),bt=ut.prefixCls,Tt=ut.fixedInfoList,xt=M.useContext(C),gt=xt.fixHeader,qe=xt.fixColumn,Xe=xt.horizonScroll,Pe=xt.componentWidth,se=xt.flattenColumns,fe=xt.expandableType,$e=xt.expandRowByClick,ke=xt.onTriggerExpand,it=xt.rowClassName,at=xt.expandedRowClassName,Ne=xt.indentSize,Ve=xt.expandIcon,tt=xt.expandedRowRender,ft=xt.expandIconColumnIndex,Ct=M.useState(!1),zt=Object(B.a)(Ct,2),qt=zt[0],Qt=zt[1],St=be&&be.has(Oe.recordKey);M.useEffect(function(){St&&Qt(!0)},[St]);var ln=fe==="row"&&(!ge||ge(st)),Bt=fe==="nest",Yt=Ie&&st&&st[Ie],Mt=ln||Bt,tn;re&&(tn=re(st,He));var mn=function(b){if($e&&Mt&&ke(st,b),tn&&tn.onClick){for(var L,V=arguments.length,J=new Array(V>1?V-1:0),Q=1;Q<V;Q++)J[Q-1]=arguments[Q];(L=tn).onClick.apply(L,[b].concat(J))}},An;typeof it=="string"?An=it:typeof it=="function"&&(An=it(st,He,ce));var lt=Object(x.a)(se),Rt=M.createElement(Ee,Object.assign({},tn,{"data-row-key":nt,className:U()(we,"".concat(bt,"-row"),"".concat(bt,"-row-level-").concat(ce),An,tn&&tn.className),style:Object(K.a)(Object(K.a)({},Je),tn?tn.style:null),onClick:mn}),se.map(function(G,b){var L=G.render,V=G.dataIndex,J=G.className,Q=lt[b],De=Tt[b],ot;b===(ft||0)&&Bt&&(ot=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(Ne*ce,"px")},className:"".concat(bt,"-row-indent indent-level-").concat(ce)}),Ve({prefixCls:bt,expanded:St,expandable:Yt,record:st,onExpand:ke})));var Ot;return G.onCell&&(Ot=G.onCell(st,He)),M.createElement(n.a,Object.assign({className:J,ellipsis:G.ellipsis,align:G.align,component:Be,prefixCls:bt,key:Q,record:st,index:He,dataIndex:V,render:L,shouldCellUpdate:G.shouldCellUpdate},De,{appendNode:ot,additionalProps:Ot}))})),Jt;if(ln&&(qt||St)){var nn=tt(st,He,ce+1,St),un=at&&at(st,He,ce);Jt=M.createElement(Y,{expanded:St,className:U()("".concat(bt,"-expanded-row"),"".concat(bt,"-expanded-row-level-").concat(ce+1),un),prefixCls:bt,fixHeader:gt,fixColumn:qe,horizonScroll:Xe,component:Ee,componentWidth:Pe,cellComponent:Be,colSpan:se.length},nn)}var cn;return Yt&&St&&(cn=(st[Ie]||[]).map(function(G,b){var L=Te(G,b);return M.createElement(H,Object.assign({},Oe,{key:L,rowKey:L,record:G,recordKey:L,index:b,indent:ce+1}))})),M.createElement(M.Fragment,null,Rt,Jt,cn)}H.displayName="BodyRow";var F=H,q=M.createContext(null),le=q;function pe(Oe){var we=Oe.columnKey,Je=Oe.onColumnResize,st=M.useRef();return M.useEffect(function(){st.current&&Je(we,st.current.offsetWidth)},[]),M.createElement(g.a,{onResize:function(nt){var Te=nt.offsetWidth;Je(we,Te)}},M.createElement("td",{ref:st,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ae(Oe){var we=Oe.data,Je=Oe.getRowKey,st=Oe.measureColumnWidth,He=Oe.expandedKeys,nt=Oe.onRow,Te=Oe.rowExpandable,ge=Oe.emptyNode,be=Oe.childrenColumnName,re=M.useContext(le),ie=re.onColumnResize,ce=M.useContext(o.a),Ee=ce.prefixCls,Be=ce.getComponent,Ie=M.useContext(C),ut=Ie.fixHeader,bt=Ie.horizonScroll,Tt=Ie.flattenColumns,xt=Ie.componentWidth;return M.useMemo(function(){var gt=Be(["body","wrapper"],"tbody"),qe=Be(["body","row"],"tr"),Xe=Be(["body","cell"],"td"),Pe;we.length?Pe=we.map(function(fe,$e){var ke=Je(fe,$e);return M.createElement(F,{key:ke,rowKey:ke,record:fe,recordKey:ke,index:$e,rowComponent:qe,cellComponent:Xe,expandedKeys:He,onRow:nt,getRowKey:Je,rowExpandable:Te,childrenColumnName:be})}):Pe=M.createElement(Y,{expanded:!0,className:"".concat(Ee,"-placeholder"),prefixCls:Ee,fixHeader:ut,fixColumn:bt,horizonScroll:bt,component:qe,componentWidth:xt,cellComponent:Xe,colSpan:Tt.length},ge);var se=Object(x.a)(Tt);return M.createElement(gt,{className:"".concat(Ee,"-tbody")},st&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(Ee,"-measure-row"),style:{height:0}},se.map(function(fe){return M.createElement(pe,{key:fe,columnKey:fe,onColumnResize:ie})})),Pe)},[we,Ee,nt,st,He,Je,Be,xt,ge,Tt])}var Ge=M.memo(Ae);Ge.displayName="Body";var Fe=Ge,Ue=N("wRmb"),_e=N("xEkU"),je=N.n(_e);function xe(Oe){var we=Object(M.useRef)(Oe),Je=Object(M.useState)({}),st=Object(B.a)(Je,2),He=st[1],nt=Object(M.useRef)(null),Te=Object(M.useRef)([]);function ge(be){nt.current===null&&(Te.current=[],nt.current=je()(function(){Te.current.forEach(function(re){we.current=re(we.current)}),nt.current=null,He({})})),Te.current.push(be)}return Object(M.useEffect)(function(){return function(){je.a.cancel(nt.current)}},[]),[we.current,ge]}function he(Oe){var we=Object(M.useRef)(Oe),Je=Object(M.useRef)(null);function st(){window.clearTimeout(Je.current)}function He(Te){we.current=Te,st(),Je.current=window.setTimeout(function(){we.current=null,Je.current=null},100)}function nt(){return we.current}return Object(M.useEffect)(function(){return st},[]),[He,nt]}function te(Oe,we,Je){var st=Object(M.useMemo)(function(){for(var He=[],nt=[],Te=0,ge=0,be=0;be<we;be+=1)if(Je==="rtl"){nt[be]=ge,ge+=Oe[be]||0;var re=we-be-1;He[re]=Te,Te+=Oe[re]||0}else{He[be]=Te,Te+=Oe[be]||0;var ie=we-be-1;nt[ie]=ge,ge+=Oe[ie]||0}return{left:He,right:nt}},[Oe,we,Je]);return st}var ye=te;function ue(Oe){var we=Oe.className,Je=Oe.children;return M.createElement("div",{className:we},Je)}var Le=ue,ae=N("n6Qo");function oe(Oe){var we,Je=Oe.prefixCls,st=Oe.record,He=Oe.onExpand,nt=Oe.expanded,Te=Oe.expandable,ge="".concat(Je,"-row-expand-icon");if(!Te)return M.createElement("span",{className:U()(ge,"".concat(Je,"-row-spaced"))});var be=function(ie){He(st,ie),ie.stopPropagation()};return M.createElement("span",{className:U()(ge,(we={},Object(ee.a)(we,"".concat(Je,"-row-expanded"),nt),Object(ee.a)(we,"".concat(Je,"-row-collapsed"),!nt),we)),onClick:be})}function Se(Oe,we,Je){var st=[];function He(nt){(nt||[]).forEach(function(Te,ge){st.push(we(Te,ge)),He(Te[Je])})}return He(Oe),st}var Me=N("zT1h"),We=N("y0+3"),Ke=function(we,Je){var st,He,nt=we.scrollBodyRef,Te=we.onScroll,ge=we.offsetScroll,be=M.useContext(o.a),re=be.prefixCls,ie=((st=nt.current)===null||st===void 0?void 0:st.scrollWidth)||0,ce=((He=nt.current)===null||He===void 0?void 0:He.clientWidth)||0,Ee=ie&&ce*(ce/ie),Be=M.useRef(),Ie=xe({scrollLeft:0,isHiddenScrollBar:!1}),ut=Object(B.a)(Ie,2),bt=ut[0],Tt=ut[1],xt=M.useRef({delta:0,x:0}),gt=M.useState(!1),qe=Object(B.a)(gt,2),Xe=qe[0],Pe=qe[1],se=function(){Pe(!1)},fe=function(Ne){Ne.persist(),xt.current.delta=Ne.pageX-bt.scrollLeft,xt.current.x=0,Pe(!0),Ne.preventDefault()},$e=function(Ne){var Ve,tt=Ne||((Ve=window)===null||Ve===void 0?void 0:Ve.event),ft=tt.buttons;if(!Xe||ft===0){Xe&&Pe(!1);return}var Ct=xt.current.x+Ne.pageX-xt.current.x-xt.current.delta;Ct<=0&&(Ct=0),Ct+Ee>=ce&&(Ct=ce-Ee),Te({scrollLeft:Ct/ce*(ie+2)}),xt.current.x=Ne.pageX},ke=function(){var Ne=Object(We.b)(nt.current).top,Ve=Ne+nt.current.offsetHeight,tt=document.documentElement.scrollTop+window.innerHeight;Ve-Object(w.a)()<=tt||Ne>=tt-ge?Tt(function(ft){return Object(K.a)(Object(K.a)({},ft),{},{isHiddenScrollBar:!0})}):Tt(function(ft){return Object(K.a)(Object(K.a)({},ft),{},{isHiddenScrollBar:!1})})},it=function(Ne){Tt(function(Ve){return Object(K.a)(Object(K.a)({},Ve),{},{scrollLeft:Ne/ie*ce||0})})};return M.useImperativeHandle(Je,function(){return{setScrollLeft:it}}),M.useEffect(function(){var at=Object(Me.a)(document.body,"mouseup",se,!1),Ne=Object(Me.a)(document.body,"mousemove",$e,!1);return ke(),function(){at.remove(),Ne.remove()}},[Ee,Xe]),M.useEffect(function(){var at=Object(Me.a)(window,"scroll",ke,!1),Ne=Object(Me.a)(window,"resize",ke,!1);return function(){at.remove(),Ne.remove()}},[]),M.useEffect(function(){bt.isHiddenScrollBar||Tt(function(at){var Ne,Ve;return Object(K.a)(Object(K.a)({},at),{},{scrollLeft:nt.current.scrollLeft/((Ne=nt.current)===null||Ne===void 0?void 0:Ne.scrollWidth)*((Ve=nt.current)===null||Ve===void 0?void 0:Ve.clientWidth)})})},[bt.isHiddenScrollBar]),ie<=ce||!Ee||bt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(w.a)(),width:ce,bottom:ge},className:"".concat(re,"-sticky-scroll")},M.createElement("div",{onMouseDown:fe,ref:Be,className:U()("".concat(re,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(re,"-sticky-scroll-bar-active"),Xe)),style:{width:"".concat(Ee,"px"),transform:"translate3d(".concat(bt.scrollLeft,"px, 0, 0)")}}))},Qe=M.forwardRef(Ke);function Ze(Oe,we){return M.useMemo(function(){var Je=!!Oe;return{isSticky:Je,stickyClassName:Je?"".concat(we,"-sticky-header"):"",offsetHeader:Object(z.a)(Oe)==="object"&&Oe.offsetHeader||0,offsetScroll:Object(z.a)(Oe)==="object"&&Oe.offsetScroll||0}},[Oe,we])}var yt=[],vt={},dt="rc-table-internal-hook",pt=M.memo(function(Oe){var we=Oe.children;return we},function(Oe,we){return R()(Oe.props,we.props)?Oe.pingLeft!==we.pingLeft||Oe.pingRight!==we.pingRight:!1});function At(Oe){var we,Je=Oe.prefixCls,st=Oe.className,He=Oe.rowClassName,nt=Oe.style,Te=Oe.data,ge=Oe.rowKey,be=Oe.scroll,re=Oe.tableLayout,ie=Oe.direction,ce=Oe.title,Ee=Oe.footer,Be=Oe.summary,Ie=Oe.id,ut=Oe.showHeader,bt=Oe.components,Tt=Oe.emptyText,xt=Oe.onRow,gt=Oe.onHeaderRow,qe=Oe.internalHooks,Xe=Oe.transformColumns,Pe=Oe.internalRefs,se=Oe.sticky,fe=Te||yt,$e=!!fe.length,ke=M.useState(0),it=Object(B.a)(ke,2),at=it[0],Ne=it[1];M.useEffect(function(){Ne(Object(w.a)())});var Ve=M.useMemo(function(){return Object(x.c)(bt,{})},[bt]),tt=M.useCallback(function(Kt,pn){return Object(x.b)(Ve,Kt)||pn},[Ve]),ft=M.useMemo(function(){return typeof ge=="function"?ge:function(Kt){var pn=Kt&&Kt[ge];return pn}},[ge]),Ct=Object(h.c)(Oe),zt=Ct.expandIcon,qt=Ct.expandedRowKeys,Qt=Ct.defaultExpandedRowKeys,St=Ct.defaultExpandAllRows,ln=Ct.expandedRowRender,Bt=Ct.onExpand,Yt=Ct.onExpandedRowsChange,Mt=Ct.expandRowByClick,tn=Ct.rowExpandable,mn=Ct.expandIconColumnIndex,An=Ct.expandedRowClassName,lt=Ct.childrenColumnName,Rt=Ct.indentSize,Jt=zt||oe,nn=lt||"children",un=M.useMemo(function(){return ln?"row":Oe.expandable&&qe===dt&&Oe.expandable.__PARENT_RENDER_ICON__||fe.some(function(Kt){return Kt&&Object(z.a)(Kt)==="object"&&Kt[nn]})?"nest":!1},[!!ln,fe]),cn=M.useState(function(){return Qt||(St?Se(fe,ft,nn):[])}),G=Object(B.a)(cn,2),b=G[0],L=G[1],V=M.useMemo(function(){return new Set(qt||b||[])},[qt,b]),J=M.useCallback(function(Kt){var pn=ft(Kt,fe.indexOf(Kt)),Cn,ur=V.has(pn);ur?(V.delete(pn),Cn=Object(P.a)(V)):Cn=[].concat(Object(P.a)(V),[pn]),L(Cn),Bt&&Bt(!ur,Kt),Yt&&Yt(Cn)},[ft,V,fe,Bt,Yt]),Q=M.useState(0),De=Object(B.a)(Q,2),ot=De[0],Ot=De[1],Ft=Object(Ue.b)(Object(K.a)(Object(K.a)(Object(K.a)({},Oe),Ct),{},{expandable:!!ln,expandedKeys:V,getRowKey:ft,onTriggerExpand:J,expandIcon:Jt,expandIconColumnIndex:mn,direction:ie}),qe===dt?Xe:null),ve=Object(B.a)(Ft,2),Gt=ve[0],en=ve[1],Tn=M.useMemo(function(){return{columns:Gt,flattenColumns:en}},[Gt,en]),Wn=M.useRef(),tr=M.useRef(),Rn=M.useRef(),or=M.useState(!1),fr=Object(B.a)(or,2),Vn=fr[0],sr=fr[1],Jn=M.useState(!1),Mr=Object(B.a)(Jn,2),Xn=Mr[0],Ir=Mr[1],yr=xe(new Map),Tr=Object(B.a)(yr,2),Yr=Tr[0],br=Tr[1],nr=Object(x.a)(en),Ur=nr.map(function(Kt){return Yr.get(Kt)}),_r=M.useMemo(function(){return Ur},[Ur.join("_")]),Fr=ye(_r,en.length,ie),Sn=be&&Object(x.d)(be.y),hn=be&&Object(x.d)(be.x),kn=hn&&en.some(function(Kt){var pn=Kt.fixed;return pn}),yn=M.useRef(),Ln=Ze(se,Je),bn=Ln.isSticky,wr=Ln.offsetHeader,Bn=Ln.offsetScroll,Qn=Ln.stickyClassName,zr,jr,Dr;Sn&&(jr={overflowY:"scroll",maxHeight:be.y}),hn&&(zr={overflowX:"auto"},Sn||(jr={overflowY:"hidden"}),Dr={width:be.x===!0?"auto":be.x,minWidth:"100%"});var Jr=M.useCallback(function(Kt,pn){br(function(Cn){var ur=new Map(Cn);return ur.set(Kt,pn),ur})},[]),rr=he(null),Wr=Object(B.a)(rr,2),Er=Wr[0],Hr=Wr[1];function Zr(Kt,pn){if(!pn)return;typeof pn=="function"?pn(Kt):pn.scrollLeft!==Kt&&(pn.scrollLeft=Kt)}var ir=function(pn){var Cn=pn.currentTarget,ur=pn.scrollLeft,qr=typeof ur=="number"?ur:Cn.scrollLeft,Rr=Cn||vt;if(!Hr()||Hr()===Rr){var gi;Er(Rr),Zr(qr,tr.current),Zr(qr,Rn.current),Zr(qr,(gi=yn.current)===null||gi===void 0?void 0:gi.setScrollLeft)}if(Cn){var vi=Cn.scrollWidth,ai=Cn.clientWidth;sr(qr>0),Ir(qr<vi-ai)}},ri=function(){Rn.current&&ir({currentTarget:Rn.current})},ii=function(pn){var Cn=pn.width;ri(),Ot(Wn.current?Wn.current.offsetWidth:Cn)};M.useEffect(function(){return ri},[]),M.useEffect(function(){hn&&ri()},[hn]),M.useEffect(function(){qe===dt&&Pe&&(Pe.body.current=Rn.current)});var Xt=tt(["table"],"table"),on=M.useMemo(function(){return re||(kn?be.x==="max-content"?"auto":"fixed":Sn||en.some(function(Kt){var pn=Kt.ellipsis;return pn})?"fixed":"auto")},[Sn,kn,en,re]),$t,dn={colWidths:_r,columCount:en.length,stickyOffsets:Fr,onHeaderRow:gt,fixHeader:Sn},En=M.useMemo(function(){return $e?null:typeof Tt=="function"?Tt():Tt},[$e,Tt]),wn=M.createElement(Fe,{data:fe,measureColumnWidth:Sn||hn||bn,expandedKeys:V,rowExpandable:tn,getRowKey:ft,onRow:xt,emptyNode:En,childrenColumnName:nn}),gn=M.createElement(l,{colWidths:en.map(function(Kt){var pn=Kt.width;return pn}),columns:en}),xn=Be&&M.createElement(ae.b,null,Be(fe)),Hn=tt(["body"]);if(Sn||bn){var fn;typeof Hn=="function"?(fn=Hn(fe,{scrollbarSize:at,ref:Rn,onScroll:ir}),dn.colWidths=en.map(function(Kt,pn){var Cn=Kt.width,ur=pn===Gt.length-1?Cn-at:Cn;return typeof ur=="number"&&!Number.isNaN(ur)?ur:(Object(c.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):fn=M.createElement("div",{style:Object(K.a)(Object(K.a)({},zr),jr),onScroll:ir,ref:Rn,className:U()("".concat(Je,"-body"))},M.createElement(Xt,{style:Object(K.a)(Object(K.a)({},Dr),{},{tableLayout:on})},gn,wn,xn),bn&&M.createElement(Qe,{ref:yn,offsetScroll:Bn,scrollBodyRef:Rn,onScroll:ir})),$t=M.createElement(M.Fragment,null,ut!==!1&&M.createElement(S,Object.assign({noData:!fe.length},dn,Tn,{direction:ie,offsetHeader:wr,stickyClassName:Qn,ref:tr,onScroll:ir})),fn)}else $t=M.createElement("div",{style:Object(K.a)(Object(K.a)({},zr),jr),className:U()("".concat(Je,"-content")),onScroll:ir,ref:Rn},M.createElement(Xt,{style:Object(K.a)(Object(K.a)({},Dr),{},{tableLayout:on})},gn,ut!==!1&&M.createElement(p,Object.assign({},dn,Tn)),wn,xn));var Pr=Object(h.b)(Oe),Ht=M.createElement("div",Object.assign({className:U()(Je,st,(we={},Object(ee.a)(we,"".concat(Je,"-rtl"),ie==="rtl"),Object(ee.a)(we,"".concat(Je,"-ping-left"),Vn),Object(ee.a)(we,"".concat(Je,"-ping-right"),Xn),Object(ee.a)(we,"".concat(Je,"-layout-fixed"),re==="fixed"),Object(ee.a)(we,"".concat(Je,"-fixed-header"),Sn),Object(ee.a)(we,"".concat(Je,"-fixed-column"),kn),Object(ee.a)(we,"".concat(Je,"-scroll-horizontal"),hn),Object(ee.a)(we,"".concat(Je,"-has-fix-left"),en[0]&&en[0].fixed),Object(ee.a)(we,"".concat(Je,"-has-fix-right"),en[en.length-1]&&en[en.length-1].fixed==="right"),we)),style:nt,id:Ie,ref:Wn},Pr),M.createElement(pt,{pingLeft:Vn,pingRight:Xn,props:Object(K.a)(Object(K.a)({},Oe),{},{stickyOffsets:Fr,mergedExpandedKeys:V})},ce&&M.createElement(Le,{className:"".concat(Je,"-title")},ce(fe)),M.createElement("div",{className:"".concat(Je,"-container")},$t),Ee&&M.createElement(Le,{className:"".concat(Je,"-footer")},Ee(fe))));hn&&(Ht=M.createElement(g.a,{onResize:ii},Ht));var _n=M.useMemo(function(){return{prefixCls:Je,getComponent:tt,scrollbarSize:at,direction:ie,fixedInfoList:en.map(function(Kt,pn){return u(pn,pn,en,Fr,ie)}),isSticky:bn}},[Je,tt,at,ie,en,Fr,ie,bn]),pr=M.useMemo(function(){return Object(K.a)(Object(K.a)({},Tn),{},{tableLayout:on,rowClassName:He,expandedRowClassName:An,componentWidth:ot,fixHeader:Sn,fixColumn:kn,horizonScroll:hn,expandIcon:Jt,expandableType:un,expandRowByClick:Mt,expandedRowRender:ln,onTriggerExpand:J,expandIconColumnIndex:mn,indentSize:Rt})},[Tn,on,He,An,ot,Sn,kn,hn,Jt,un,Mt,ln,J,mn,Rt]),lr=M.useMemo(function(){return{onColumnResize:Jr}},[Jr]);return M.createElement(o.a.Provider,{value:_n},M.createElement(C.Provider,{value:pr},M.createElement(le.Provider,{value:lr},Ht)))}At.Column=f.a,At.ColumnGroup=y.a,At.Summary=ae.a,At.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var wt=de.b=At},wRmb:function(et,de,N){"use strict";N.d(de,"a",function(){return R});var ee=N("rePB"),K=N("KQm4"),P=N("VTBJ"),z=N("Ff2n"),B=N("q1tI"),M=N.n(B),j=N("Kwbf"),U=N("Zm9Q"),_=N("hW8S");function R(f){return Object(U.a)(f).filter(function(m){return B.isValidElement(m)}).map(function(m){var a=m.key,n=m.props,o=n.children,u=Object(z.a)(n,["children"]),x=Object(P.a)({key:a},u);return o&&(x.children=R(o)),x})}function c(f){return f.reduce(function(m,a){var n=a.fixed,o=n===!0?"left":n,u=a.children;return u&&u.length>0?[].concat(Object(K.a)(m),Object(K.a)(c(u).map(function(x){return Object(P.a)({fixed:o},x)}))):[].concat(Object(K.a)(m),[Object(P.a)(Object(P.a)({},a),{},{fixed:o})])},[])}function g(f){for(var m=!0,a=0;a<f.length;a+=1){var n=f[a];if(m&&n.fixed!=="left")m=!1;else if(!m&&n.fixed==="left"){Object(j.a)(!1,"Index ".concat(a-1," of `columns` missing `fixed='left'` prop."));break}}for(var o=!0,u=f.length-1;u>=0;u-=1){var x=f[u];if(o&&x.fixed!=="right")o=!1;else if(!o&&x.fixed==="right"){Object(j.a)(!1,"Index ".concat(u+1," of `columns` missing `fixed='right'` prop."));break}}}function w(f){return f.map(function(m){var a=m.fixed,n=Object(z.a)(m,["fixed"]),o=a;return a==="left"?o="right":a==="right"&&(o="left"),Object(P.a)({fixed:o},n)})}function y(f,m){var a=f.prefixCls,n=f.columns,o=f.children,u=f.expandable,x=f.expandedKeys,E=f.getRowKey,v=f.onTriggerExpand,O=f.expandIcon,A=f.rowExpandable,p=f.expandIconColumnIndex,h=f.direction,s=f.expandRowByClick,l=B.useMemo(function(){return n||R(o)},[n,o]),D=B.useMemo(function(){if(u){var I,C=p||0,W=l[C],Y=(I={},Object(ee.a)(I,_.a,{className:"".concat(a,"-expand-icon-col")}),Object(ee.a)(I,"title",""),Object(ee.a)(I,"fixed",W?W.fixed:null),Object(ee.a)(I,"className","".concat(a,"-row-expand-icon-cell")),Object(ee.a)(I,"render",function(q,le,pe){var Ae=E(le,pe),Ge=x.has(Ae),Fe=A?A(le):!0,Ue=O({prefixCls:a,expanded:Ge,expandable:Fe,record:le,onExpand:v});return s?B.createElement("span",{onClick:function(je){return je.stopPropagation()}},Ue):Ue}),I),H=l.slice();return C>=0&&H.splice(C,0,Y),H}return l},[u,l,E,x,O,h]),T=B.useMemo(function(){var I=D;return m&&(I=m(I)),I.length||(I=[{render:function(){return null}}]),I},[m,D,h]),S=B.useMemo(function(){return h==="rtl"?w(c(T)):c(T)},[T,h]);return[T,S]}de.b=y},"y0+3":function(et,de,N){"use strict";N.d(de,"a",function(){return c}),N.d(de,"b",function(){return w});var ee=/margin|padding|width|height|max|min|offset/,K={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function z(y){return y.nodeType===1?y.ownerDocument.defaultView.getComputedStyle(y,null):{}}function B(y,f,m){if(f=f.toLowerCase(),m==="auto"){if(f==="height")return y.offsetHeight;if(f==="width")return y.offsetWidth}return f in K||(K[f]=ee.test(f)),K[f]?parseFloat(m)||0:m}function M(y,f){var m=arguments.length,a=z(y);return f=P[f]?"cssFloat"in y.style?"cssFloat":"styleFloat":f,m===1?a:B(y,f,a[f]||y.style[f])}function j(y,f,m){var a=arguments.length;if(f=P[f]?"cssFloat"in y.style?"cssFloat":"styleFloat":f,a===3)return typeof m=="number"&&ee.test(f)&&(m="".concat(m,"px")),y.style[f]=m,m;for(var n in f)f.hasOwnProperty(n)&&j(y,n,f[n]);return z(y)}function U(y){return y===document.body?document.documentElement.clientWidth:y.offsetWidth}function _(y){return y===document.body?window.innerHeight||document.documentElement.clientHeight:y.offsetHeight}function R(){var y=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),f=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:y,height:f}}function c(){var y=document.documentElement.clientWidth,f=window.innerHeight||document.documentElement.clientHeight;return{width:y,height:f}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function w(y){var f=y.getBoundingClientRect(),m=document.documentElement;return{left:f.left+(window.pageXOffset||m.scrollLeft)-(m.clientLeft||document.body.clientLeft||0),top:f.top+(window.pageYOffset||m.scrollTop)-(m.clientTop||document.body.clientTop||0)}}},yslc:function(et,de){et.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bwUhoa2YB4dNT1CHIzkoEkZzDYrrLtvkCeU0aBsULTw7WntRbtARoQrGbWHtBVw/Vpaggq9t1Rh9F7qwOM0ZA45fDgJp7PmJ0i4hCegU3AabjAc9qmF24r14JeXP+MZ4GEN+/69NmVvD0rGn8zThWYghF7XE7JFN+0wL0x5BQfVZLL60D1XE5JUNfxTqEZqC/C7Zgumeh96EvvqMP6ppNpvSCTM/ZxbAz222lousqGtIAnZkPIMETThmndmM1y/scGvB30KfFNcPH7YbLbRjwokVWHJ5v/CzltMgWq112z5HGXgQnDdVeFW2cSEmdFcU6nUfgpBJPrPsBwPhqmCsSM/EA9E3CtaXXPoJk09+4XIk9qfQrwuKhaFLNiLVodh7tQS3HX0HpB735Lj+WNTOu0Ojl0yViC/6u88MMqG7opDkaWCo2AJCBvnMtB8MqMFhQdoIPNPmDsH6+vIijCxegjrwDmvzl9BV4LAtYwr+FJEBEzHj1iML8EvVqYY2MKFL3/nSTV2sbTuWGw2jaReAbtI3VxqLuQkDMC91mGBsXXkhRhUvFcQeBBViNWENlcxocxdeSBqInRXHMLpkmU3lfbRtsbnjk8KzdgdetvlmKDVdBZ1COEuvJA/F7KSBwsfPnVyLdy9Suq6lOLUWafULXbGITYTHwZrzYos1yc9GdE8oPJDdHnXcHhCS7En2lsgzJ2kw8pLvA094YaG5teIoBoRnYFunqT43J6koz+E8mX6jLGz7KJ6KtxzvpwvQJ/5Y5XN9nhp4NLo7empTPcqepIlsaOcHF/fgnMnoUbmi6nNYUZbvUd7mzCT9iG5tfcHMvjDzOwFybYhsTmQe1PVGygPClOGzsl+F3P4UOl0jrGyfiWFRljXCBjptKlnqtbfGA3hNsixLfwyZsf4N3bO6zCDgCrTkP6FTpAbdQyBYA0JUgQbcUXvoiEsFaU26hHvwUvJgbK84ihHHF9sU6RvWDlszpgjPEgr/biNYI19jM3FJ0kRgY4dJoGVo+rxMj3ElnzasDai/flBkZ3xeZoDJyXpBCv6sQj9XZ4TBjbswUhWC/uEWP/qeqyWgmFylm0KTkRIUBWUKnTKj180AIfOl6KjmtiHVYnRB6gg8l3Cn0Pz/lO7CtFNfwtzoT2HtdRMwIvom6KtOo8/h+TafSYnZKnT6h2a/5rCvR+wcfUm7sciK66tgoVMG87PfBfCslJ3WHLZeTByEl1Pux8byA3iw+GObKsVsGD0U1Q2fpj8uuDOt0ySrsYmxt+Dj9DHCrxNPrMD/6n3p/sDHhO4PVhvbJKvU0O9bBxCLq6MFUhgX5LBWOlVwtqv5r5RhyEkcgE8v/4LME595LXQ6HUoPimniDWnsS6dz9uHFi4V1gtWb4wtNtL2rywtsTDCh+8Kop2UL8yJgNn4Hgl6eFpEqHz23Yez+qkNzruaUH7QdhSfjbxWmG8+eWuu10B1VTH3p2zOm4O6IDFw0XUW3Q6/jnKkCAyM64dv6ub8v+McUL8Oqcj0Tej0D/l2M2vfUbzNTUcPvBSFtfelEsWW9FfoX7bPwaMzNmHtuK2af3SKp0F9NHir46GkaXbwUn5cbhJ/bqMNwW/h1biF2CI7D22kjhHxTT67GqbpymzI/V57EadMVJvQWETqttDC3B8zm70FIpNvelDAD3YRpnGa0uVvwqFhHdDrnzoztbZNneFQ3pAfHClv0P1X9YfMZ9TOPiukhPFtYuhtmO2/JS2e+Qhlf3QSBBirBl06/KWj61ngYg+0OjHkCu/Fisctv83C4ptRtMTZ1cUuRxBn0ugdByHqJrYoyNytxAOamDGsQ+oTYvlicPlaUDVeZ6W7pSbtRlrrsVrUfj/ujujYU/eTyzxh/YrnoehsLvetvr+FQzQW3NpjQ3VIkcYb8nH8D/PMSWxVlzl7o9Oz1hLhbGmwkayIxPLobCCH4+NK+Ji6/RE2E4BKk6aOLe5t8PuvMJlw2VzXYS9VEYVPHSeipTROemQkPNacCE7qobvM6c/PO0WkzC3SZMBPbgyNeN9/7gvZCt7f0z6T7hKkNPedyz7GFTSoS4168MSQJX3V8Cu2CYwQ7b5zfgdSgKDwe21sSoYudurANI+9141lJQ3YfEO6HQLiN5ErodIe05MYXhYNVT5xYicWXf/JJ6COiumFth4m4aq7BpJOrsLJMD+sGixQjulihe9ZZ3uVS7s6olS+9LhEg+wPl1TGuhP5A1A3Y0GESKvla0ANajq6RiRnRqddnb+dpGFvyiXCbiKaWFPrB6nNYXe/lcSZnsYe6Hoq6Cd21KQrfGSWLgmA4Qu+V3uXdOCF9KWdCp/7tbzOexoCITlh2aT+y/ljhsHIxQqcGgjm1zcZUSwqdHQGQXk8Wi/qchSC85QRUgCRnQl/UdiQmx/cXFqF3HX0PuyqLJRG6vZGWEPro6B7opU2Dofo0lrs5Siv2rMuo6JvRW9sWBdVnmhxzCIQu9/9i1KB7CjyxvVkcAMgdCb3xhYi/nlqP+aXfOW2p2BE9EIQuhnaxQhdjuyXy+lfollAY2wMxAq/14oV18RSvDsPxG2YLdzgXXPge00+vc9kfTOgtIVfv6/Sf0C3b/T8H4i2jJ+P64d20RxCi0qCGN2FMyTKsu1KEx2J6CrudI4uXurwKR+lmQvdedC1R0j9CP7IgBFdL6Pd+v5YA5arO+anDMSPBEjKyzFyFGLVWuE73t7NbMO/8dtAtek8uP3QLScJH9aEq7jz6nkdlGrerJeboYvqCTV08YSs/m17HmeBJ1ubMMy6mFz5pP06ocvaZzZh3fhueib8d76Q9DI7jsPzyr5hz9mscqXV/bsTXdvsqdHo5e//1M4RmeOpHF9NmJnR3bOl100DI2+6yNffnnYPb4Jfrn0eEOgTvl+7G1FNrGppA/wDoOZcgTi08O1pTiiM1F3DWZASNk0JHeHq7nm7b09v99H4//Z+O/nQbX8OpoIZKKB/CqaFVBWFdeRHWXil0CtNTodPIBF1DE1HF16GSr0MVqQM9M5OXPAQT4/oJ4TKSi/6Bi+ZKSSllQndFJ339ixnfBOJbp3dkTBXiqNDNkt6H56PaLvxbL20q5iQNAT2xSEd3X9PQ3z/AV8ZDkgj9SvdXEKpyfHHEemHD1/bal2dCd8YoDXFRCxpTLSAj6/YMTRVu7tAYLs584xRatCoUPbSp6BqSiFi1FtHqUISpgqHmOGHUpiM4PSKg4jjQf87S9FNf4oqLC8WejujU/u5Of2lyRp1e1th85SDevLDTL3ERmdAd9ezpvDCcr9gFkJ5SjyxS2qMiLndwRlzKOjy1Ra/RxWvChdtF9pF67W3QIwR0Z7VxKjdX++0SNa2HXgAZG2O5DLai7FeUSjw18pQnqfL5/h1NW6LXLQch0h3mlgods8MYqGfAd6EbcmaC519jjDIGApkB34Sen3sfOPPm1hKgKJA7grXNvwx4L/SiWZ1gMu1jb5P2bwcx69Iw4J3QaegKk5G+uyhgI+ZKQw+zIhcGxAudEA56Hd1tscRaYIkx0AoYEC90vW4OCMlrBdhYExkDDQyIE7oQHZesDfSXcrH+ZQzYM+C50Atm3gBeiLLVrIGHWJcxBqRgwDOhH8+LQXnFPoB0lqJSZoMx0NwMuBc6yVPBULERhAxt7sax+hgDUjHgXuiG7LngMUuqCpkdxkBLMOBa6AW60TCTlS3RMFYnY0BKBpwLnUa9NZl3B/LLtqQkgtmSNwOOhX7whXjU1NKz5e4DdcubH4ZOJgw0Fbrl7c9fg5B7ZYKRwWAMOLgio89+CwTTGTeMATkxYDui63OyQPglcgLIsDAGKAPXhF6YfQvM3HeBENKZdQ1jQGoGLEIvmJ0EvnZ/c79ES2owzB5jwBkDHGhIZ/2R7QC5g9HEGJArAxzyde8D5Gm5AmS4GAO2c3TGB2OgFTLALR1KA6e5SByvUpEp7s+6tELwrMnKYcCl0DmYVOCyzOM3L2dCV44mZInUhdBrVFCPMmdt3MCmLrLsemWBcih0DlfVBMNNWVu2WdlgI7qydCE7tE2FzpVpVOqhdZkbaJSKhsSELruuVxYgG6FzOK+Bekjd+I16exaY0JWlC9mhbRA6h5PBCBpUM369w1jdTOiy63plAaoX+rEQNTewetzmEmfomdCVpQvZoeWWDi3UctrBlePXnHHpTZcdcgZIUQxErnk43vjI2ovuQP8faDGikjbF4FsAAAAASUVORK5CYII="}}]);