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.
377 lines
1.1 MiB
377 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[173,3,5,7,8,20],{"+NIl":function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){"use strict";Q.defineMode("stex",function(H,M){"use strict";function W(p,h){p.cmdState.push(h)}function N(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function A(p){var h=p.cmdState.pop();h&&h.closeBracket()}function F(p){for(var h=p.cmdState,f=h.length-1;f>=0;f--){var n=h[f];if(n.name=="DEFAULT")continue;return n}return{styleIdentifier:function(){return null}}}function U(p,h,f){return function(){this.name=p,this.bracketNo=0,this.style=h,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var S={};S.importmodule=U("importmodule","tag",["string","builtin"]),S.documentclass=U("documentclass","tag",["","atom"]),S.usepackage=U("usepackage","tag",["atom"]),S.begin=U("begin","tag",["atom"]),S.end=U("end","tag",["atom"]),S.label=U("label","tag",["atom"]),S.ref=U("ref","tag",["atom"]),S.eqref=U("eqref","tag",["atom"]),S.cite=U("cite","tag",["atom"]),S.bibitem=U("bibitem","tag",["atom"]),S.Bibitem=U("Bibitem","tag",["atom"]),S.RBibitem=U("RBibitem","tag",["atom"]),S.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(p,h){p.f=h}function d(p,h){var f;if(p.match(/^\\[a-zA-Z@]+/)){var n=p.current().slice(1);return f=S.hasOwnProperty(n)?S[n]:S.DEFAULT,f=new f,W(h,f),L(h,C),f.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return L(h,function(o,l){return v(o,l,"\\]")}),"keyword";if(p.match("\\("))return L(h,function(o,l){return v(o,l,"\\)")}),"keyword";if(p.match("$$"))return L(h,function(o,l){return v(o,l,"$$")}),"keyword";if(p.match("$"))return L(h,function(o,l){return v(o,l,"$")}),"keyword";var r=p.next();if(r=="%")return p.skipToEnd(),"comment";if(r=="}"||r=="]"){if(f=N(h),f)f.closeBracket(r),L(h,C);else return"error";return"bracket"}else return r=="{"||r=="["?(f=S.DEFAULT,f=new f,W(h,f),"bracket"):/\d/.test(r)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),f=F(h),f.name=="begin"&&(f.argument=p.current()),f.styleIdentifier())}function v(p,h,f){if(p.eatSpace())return null;if(f&&p.match(f))return L(h,d),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var n=p.next();return n=="{"||n=="}"||n=="["||n=="]"||n=="("||n==")"?"bracket":n=="%"?(p.skipToEnd(),"comment"):"error"}function C(p,h){var f=p.peek(),n;return f=="{"||f=="["?(n=N(h),n.openBracket(f),p.eat(f),L(h,d),"bracket"):/[ \t\r]/.test(f)?(p.eat(f),null):(L(h,d),A(h),d(p,h))}return{startState:function(){var p=M.inMathMode?function(h,f){return v(h,f)}:d;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,h){return h.f(p,h)},blankLine:function(p){p.f=d,p.cmdState.length=0},lineComment:"%"}}),Q.defineMIME("text/x-stex","stex"),Q.defineMIME("text/x-latex","stex")})},"+k/U":function(Ye,se,k){Ye.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Ye,se,k){},"/cxE":function(Ye,se,k){"use strict";k.d(se,"e",function(){return M}),k.d(se,"f",function(){return W}),k.d(se,"g",function(){return N}),k.d(se,"d",function(){return F}),k.d(se,"a",function(){return U}),k.d(se,"b",function(){return S}),k.d(se,"c",function(){return L});var Q=function(){function d(){this.listeners=[],this.unexpectedErrorHandler=function(v){setTimeout(function(){throw v.stack?new Error(v.message+`
|
|
|
|
`+v.stack):v},0)}}return d.prototype.emit=function(v){this.listeners.forEach(function(C){C(v)})},d.prototype.onUnexpectedError=function(v){this.unexpectedErrorHandler(v),this.emit(v)},d.prototype.onUnexpectedExternalError=function(v){this.unexpectedErrorHandler(v)},d}(),H=new Q;function M(d){F(d)||H.onUnexpectedError(d);return}function W(d){F(d)||H.onUnexpectedExternalError(d);return}function N(d){if(d instanceof Error){var v=d.name,C=d.message,p=d.stacktrace||d.stack;return{$isError:!0,name:v,message:C,stack:p}}return d}var A="Canceled";function F(d){return d instanceof Error&&d.name===A&&d.message===A}function U(){var d=new Error(A);return d.name=d.message,d}function S(d){return d?new Error("Illegal argument: "+d):new Error("Illegal argument")}function L(d){return d?new Error("Illegal state: "+d):new Error("Illegal state")}},"07cG":function(Ye,se,k){Ye.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){Q.defineOption("placeholder","",function(U,S,L){var d=L&&L!=Q.Init;if(S&&!d)U.on("blur",N),U.on("change",A),U.on("swapDoc",A),Q.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){W(U)}),A(U);else if(!S&&d){U.off("blur",N),U.off("change",A),U.off("swapDoc",A),Q.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),H(U);var v=U.getWrapperElement();v.className=v.className.replace(" CodeMirror-empty","")}S&&!U.hasFocus()&&N(U)});function H(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function M(U){H(U);var S=U.state.placeholder=document.createElement("pre");S.style.cssText="height: 0; overflow: visible",S.style.direction=U.getOption("direction"),S.className="CodeMirror-placeholder CodeMirror-line-like";var L=U.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),S.appendChild(L),U.display.lineSpace.insertBefore(S,U.display.lineSpace.firstChild)}function W(U){setTimeout(function(){var S=!1,L=U.getInputField();L.nodeName=="TEXTAREA"?S=!L.value:U.lineCount()==1&&(S=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),S?M(U):H(U)},20)}function N(U){F(U)&&M(U)}function A(U){var S=U.getWrapperElement(),L=F(U);S.className=S.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?M(U):H(U)}function F(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){"use strict";var H={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Q.defineMode("xml",function(W,N){var A=W.indentUnit,F={},U=N.htmlMode?H:M;for(var S in U)F[S]=U[S];for(var S in N)F[S]=N[S];var L,d;function v(u,_){function T(j){return _.tokenize=j,j(u,_)}var w=u.next();if(w=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?T(h("atom","]]>")):null:u.match("--")?T(h("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),T(f(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),_.tokenize=h("meta","?>"),"meta"):(L=u.eat("/")?"closeTag":"openTag",_.tokenize=C,"tag bracket");if(w=="&"){var P;return u.eat("#")?u.eat("x")?P=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):P=u.eatWhile(/[\d]/)&&u.eat(";"):P=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),P?"atom":"error"}else return u.eatWhile(/[^&<]/),null}v.isInText=!0;function C(u,_){var T=u.next();if(T==">"||T=="/"&&u.eat(">"))return _.tokenize=v,L=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return L="equals",null;if(T=="<"){_.tokenize=v,_.state=l,_.tagName=_.tagStart=null;var w=_.tokenize(u,_);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(T)?(_.tokenize=p(T),_.stringStartCol=u.column(),_.tokenize(u,_)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(u){var _=function(T,w){for(;!T.eol();)if(T.next()==u){w.tokenize=C;break}return"string"};return _.isInAttribute=!0,_}function h(u,_){return function(T,w){for(;!T.eol();){if(T.match(_)){w.tokenize=v;break}T.next()}return u}}function f(u){return function(_,T){for(var w;(w=_.next())!=null;){if(w=="<")return T.tokenize=f(u+1),T.tokenize(_,T);if(w==">")if(u==1){T.tokenize=v;break}else return T.tokenize=f(u-1),T.tokenize(_,T)}return"meta"}}function n(u,_,T){this.prev=u.context,this.tagName=_,this.indent=u.indented,this.startOfLine=T,(F.doNotIndent.hasOwnProperty(_)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function r(u){u.context&&(u.context=u.context.prev)}function o(u,_){for(var T;;){if(!u.context)return;if(T=u.context.tagName,!F.contextGrabbers.hasOwnProperty(T)||!F.contextGrabbers[T].hasOwnProperty(_))return;r(u)}}function l(u,_,T){return u=="openTag"?(T.tagStart=_.column(),x):u=="closeTag"?E:l}function x(u,_,T){return u=="word"?(T.tagName=_.current(),d="tag",O):F.allowMissingTagName&&u=="endTag"?(d="tag bracket",O(u,_,T)):(d="error",x)}function E(u,_,T){if(u=="word"){var w=_.current();return T.context&&T.context.tagName!=w&&F.implicitlyClosed.hasOwnProperty(T.context.tagName)&&r(T),T.context&&T.context.tagName==w||F.matchClosing===!1?(d="tag",y):(d="tag error",R)}else return F.allowMissingTagName&&u=="endTag"?(d="tag bracket",y(u,_,T)):(d="error",R)}function y(u,_,T){return u!="endTag"?(d="error",y):(r(T),l)}function R(u,_,T){return d="error",y(u,_,T)}function O(u,_,T){if(u=="word")return d="attribute",g;if(u=="endTag"||u=="selfcloseTag"){var w=T.tagName,P=T.tagStart;return T.tagName=T.tagStart=null,u=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(w)?o(T,w):(o(T,w),T.context=new n(T,w,P==T.indented)),l}return d="error",O}function g(u,_,T){return u=="equals"?m:(F.allowMissing||(d="error"),O(u,_,T))}function m(u,_,T){return u=="string"?s:u=="word"&&F.allowUnquoted?(d="string",O):(d="error",O(u,_,T))}function s(u,_,T){return u=="string"?s:O(u,_,T)}return{startState:function(u){var _={tokenize:v,state:l,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(_.baseIndent=u),_},token:function(u,_){if(!_.tagName&&u.sol()&&(_.indented=u.indentation()),u.eatSpace())return null;L=null;var T=_.tokenize(u,_);return(T||L)&&T!="comment"&&(d=null,_.state=_.state(L||T,u,_),d&&(T=d=="error"?T+" error":d)),T},indent:function(u,_,T){var w=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+A;if(w&&w.noIndent)return Q.Pass;if(u.tokenize!=C&&u.tokenize!=v)return T?T.match(/^(\s*)/)[0].length:0;if(u.tagName)return F.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+A*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var P=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(P&&P[1])for(;w;)if(w.tagName==P[2]){w=w.prev;break}else if(F.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(P)for(;w;){var j=F.contextGrabbers[w.tagName];if(j&&j.hasOwnProperty(P[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+A:u.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(u){u.state==m&&(u.state=O)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var _=[],T=u.context;T;T=T.prev)T.tagName&&_.push(T.tagName);return _.reverse()}}}),Q.defineMIME("text/xml","xml"),Q.defineMIME("application/xml","xml"),Q.mimeModes.hasOwnProperty("text/html")||Q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ye,se,k){"use strict";k.d(se,"d",function(){return Tt}),k.d(se,"b",function(){return De}),k.d(se,"c",function(){return Qe}),k.d(se,"a",function(){return xt});var Q=k("VTBJ"),H=k("1OyB"),M=k("vuIU"),W=k("JX7q"),N=k("Ji7U"),A=k("LK+K"),F=k("q1tI"),U=k("I8Z2"),S=k("BGR+"),L=k("wx14"),d=k("rePB"),v=k("4IlW"),C=k("2GS6"),p=k("Gytx"),h=k.n(p),f=k("TSYQ"),n=k.n(f),r=k("U8pU"),o=k("ODXe"),l=/iPhone/i,x=/iPod/i,E=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,O=/\bAndroid(?:.+)SD4930UR\b/i,g=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,m=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,u=/BlackBerry/i,_=/BB10/i,T=/Opera Mini/i,w=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function j(ut,$e){return ut.test($e)}function K(ut){var $e=ut||(typeof navigator!="undefined"?navigator.userAgent:""),Ve=$e.split("[FBAN");if(typeof Ve[1]!="undefined"){var Ne=Ve,oe=Object(o.a)(Ne,1);$e=oe[0]}if(Ve=$e.split("Twitter"),typeof Ve[1]!="undefined"){var ve=Ve,He=Object(o.a)(ve,1);$e=He[0]}var je={apple:{phone:j(l,$e)&&!j(m,$e),ipod:j(x,$e),tablet:!j(l,$e)&&j(E,$e)&&!j(m,$e),device:(j(l,$e)||j(x,$e)||j(E,$e))&&!j(m,$e)},amazon:{phone:j(O,$e),tablet:!j(O,$e)&&j(g,$e),device:j(O,$e)||j(g,$e)},android:{phone:!j(m,$e)&&j(O,$e)||!j(m,$e)&&j(y,$e),tablet:!j(m,$e)&&!j(O,$e)&&!j(y,$e)&&(j(g,$e)||j(R,$e)),device:!j(m,$e)&&(j(O,$e)||j(g,$e)||j(y,$e)||j(R,$e))||j(/\bokhttp\b/i,$e)},windows:{phone:j(m,$e),tablet:j(s,$e),device:j(m,$e)||j(s,$e)},other:{blackberry:j(u,$e),blackberry10:j(_,$e),opera:j(T,$e),firefox:j(P,$e),chrome:j(w,$e),device:j(u,$e)||j(_,$e)||j(T,$e)||j(P,$e)||j(w,$e)},any:null,phone:null,tablet:null};return je.any=je.apple.device||je.android.device||je.windows.device||je.other.device,je.phone=je.apple.phone||je.android.phone||je.windows.phone,je.tablet=je.apple.tablet||je.android.tablet||je.windows.tablet,je}var Z=Object(Q.a)(Object(Q.a)({},K()),{},{isMobile:K}),G=Z;function B(){}function $(ut,$e,Ve){var Ne=$e||"";return ut.key||"".concat(Ne,"item_").concat(Ve)}function ne(ut){return"".concat(ut,"-menu-")}function ae(ut,$e){var Ve=-1;F.Children.forEach(ut,function(Ne){Ve+=1,Ne&&Ne.type&&Ne.type.isMenuItemGroup?F.Children.forEach(Ne.props.children,function(oe){Ve+=1,$e(oe,Ve)}):$e(Ne,Ve)})}function fe(ut,$e,Ve){if(!ut||Ve.find)return;F.Children.forEach(ut,function(Ne){if(Ne){var oe=Ne.type;if(!oe||!(oe.isSubMenu||oe.isMenuItem||oe.isMenuItemGroup))return;$e.indexOf(Ne.key)!==-1?Ve.find=!0:Ne.props.children&&fe(Ne.props.children,$e,Ve)}})}var _e=["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"],Se=function($e){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=$e&&typeof $e.getBoundingClientRect=="function"&&$e.getBoundingClientRect().width;if(Ne){if(Ve){var oe=getComputedStyle($e),ve=oe.marginLeft,He=oe.marginRight;Ne+=+ve.replace("px","")+ +He.replace("px","")}Ne=+Ne.toFixed(6)}return Ne||0},we=function($e,Ve,Ne){$e&&Object(r.a)($e.style)==="object"&&($e.style[Ve]=Ne)},Me=function(){return G.any},Le=k("KQm4"),ge=k("Ff2n"),ue=k("i8i4"),ke=k("bdgK"),lt=k("uciX"),ot=k("8XRh"),st={adjustX:1,adjustY:1},ce={topLeft:{points:["bl","tl"],overflow:st,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:st,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:st,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:st,offset:[4,0]}},pe={topLeft:{points:["bl","tl"],overflow:st,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:st,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:st,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:st,offset:[4,0]}},Oe=ce,ze=0,qe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Je=function($e,Ve,Ne){var oe=ne(Ve),ve=$e.getState();$e.setState({defaultActiveFirst:Object(Q.a)(Object(Q.a)({},ve.defaultActiveFirst),{},Object(d.a)({},oe,Ne))})},rt=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(Ne){var oe;Object(H.a)(this,Ve),oe=$e.call(this,Ne),oe.onDestroy=function(Re){oe.props.onDestroy(Re)},oe.onKeyDown=function(Re){var Ge=Re.keyCode,Ue=oe.menuInstance,mt=oe.props,wt=mt.isOpen,qt=mt.store;if(Ge===v.a.ENTER)return oe.onTitleClick(Re),Je(qt,oe.props.eventKey,!0),!0;if(Ge===v.a.RIGHT)return wt?Ue.onKeyDown(Re):(oe.triggerOpenChange(!0),Je(qt,oe.props.eventKey,!0)),!0;if(Ge===v.a.LEFT){var en;if(wt)en=Ue.onKeyDown(Re);else return;return en||(oe.triggerOpenChange(!1),en=!0),en}return wt&&(Ge===v.a.UP||Ge===v.a.DOWN)?Ue.onKeyDown(Re):void 0},oe.onOpenChange=function(Re){oe.props.onOpenChange(Re)},oe.onPopupVisibleChange=function(Re){oe.triggerOpenChange(Re,Re?"mouseenter":"mouseleave")},oe.onMouseEnter=function(Re){var Ge=oe.props,Ue=Ge.eventKey,mt=Ge.onMouseEnter,wt=Ge.store;Je(wt,oe.props.eventKey,!1),mt({key:Ue,domEvent:Re})},oe.onMouseLeave=function(Re){var Ge=oe.props,Ue=Ge.parentMenu,mt=Ge.eventKey,wt=Ge.onMouseLeave;Ue.subMenuInstance=Object(W.a)(oe),wt({key:mt,domEvent:Re})},oe.onTitleMouseEnter=function(Re){var Ge=oe.props,Ue=Ge.eventKey,mt=Ge.onItemHover,wt=Ge.onTitleMouseEnter;mt({key:Ue,hover:!0}),wt({key:Ue,domEvent:Re})},oe.onTitleMouseLeave=function(Re){var Ge=oe.props,Ue=Ge.parentMenu,mt=Ge.eventKey,wt=Ge.onItemHover,qt=Ge.onTitleMouseLeave;Ue.subMenuInstance=Object(W.a)(oe),wt({key:mt,hover:!1}),qt({key:mt,domEvent:Re})},oe.onTitleClick=function(Re){var Ge=Object(W.a)(oe),Ue=Ge.props;if(Ue.onTitleClick({key:Ue.eventKey,domEvent:Re}),Ue.triggerSubMenuAction==="hover")return;oe.triggerOpenChange(!Ue.isOpen,"click"),Je(Ue.store,oe.props.eventKey,!1)},oe.onSubMenuClick=function(Re){typeof oe.props.onClick=="function"&&oe.props.onClick(oe.addKeyPath(Re))},oe.onSelect=function(Re){oe.props.onSelect(Re)},oe.onDeselect=function(Re){oe.props.onDeselect(Re)},oe.getPrefixCls=function(){return"".concat(oe.props.rootPrefixCls,"-submenu")},oe.getActiveClassName=function(){return"".concat(oe.getPrefixCls(),"-active")},oe.getDisabledClassName=function(){return"".concat(oe.getPrefixCls(),"-disabled")},oe.getSelectedClassName=function(){return"".concat(oe.getPrefixCls(),"-selected")},oe.getOpenClassName=function(){return"".concat(oe.props.rootPrefixCls,"-submenu-open")},oe.saveMenuInstance=function(Re){oe.menuInstance=Re},oe.addKeyPath=function(Re){return Object(Q.a)(Object(Q.a)({},Re),{},{keyPath:(Re.keyPath||[]).concat(oe.props.eventKey)})},oe.triggerOpenChange=function(Re,Ge){var Ue=oe.props.eventKey,mt=function(){oe.onOpenChange({key:Ue,item:Object(W.a)(oe),trigger:Ge,open:Re})};Ge==="mouseenter"?oe.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},oe.isChildrenSelected=function(){var Re={find:!1};return fe(oe.props.children,oe.props.selectedKeys,Re),Re.find},oe.isOpen=function(){return oe.props.openKeys.indexOf(oe.props.eventKey)!==-1},oe.adjustWidth=function(){if(!oe.subMenuTitle||!oe.menuInstance)return;var Re=ue.findDOMNode(oe.menuInstance);if(Re.offsetWidth>=oe.subMenuTitle.offsetWidth)return;Re.style.minWidth="".concat(oe.subMenuTitle.offsetWidth,"px")},oe.saveSubMenuTitle=function(Re){oe.subMenuTitle=Re},oe.getBaseProps=function(){var Re=Object(W.a)(oe),Ge=Re.props;return{mode:Ge.mode==="horizontal"?"vertical":Ge.mode,visible:oe.props.isOpen,level:Ge.level+1,inlineIndent:Ge.inlineIndent,focusable:!1,onClick:oe.onSubMenuClick,onSelect:oe.onSelect,onDeselect:oe.onDeselect,onDestroy:oe.onDestroy,selectedKeys:Ge.selectedKeys,eventKey:"".concat(Ge.eventKey,"-menu-"),openKeys:Ge.openKeys,motion:Ge.motion,onOpenChange:oe.onOpenChange,subMenuOpenDelay:Ge.subMenuOpenDelay,parentMenu:Object(W.a)(oe),subMenuCloseDelay:Ge.subMenuCloseDelay,forceSubMenuRender:Ge.forceSubMenuRender,triggerSubMenuAction:Ge.triggerSubMenuAction,builtinPlacements:Ge.builtinPlacements,defaultActiveFirst:Ge.store.getState().defaultActiveFirst[ne(Ge.eventKey)],multiple:Ge.multiple,prefixCls:Ge.rootPrefixCls,id:oe.internalMenuId,manualRef:oe.saveMenuInstance,itemIcon:Ge.itemIcon,expandIcon:Ge.expandIcon,direction:Ge.direction}},oe.getMotion=function(Re,Ge){var Ue=Object(W.a)(oe),mt=Ue.haveRendered,wt=oe.props,qt=wt.motion,en=wt.rootPrefixCls,Vt=Object(Q.a)(Object(Q.a)({},qt),{},{leavedClassName:"".concat(en,"-hidden"),removeOnLeave:!1,motionAppear:mt||!Ge||Re!=="inline"});return Vt};var ve=Ne.store,He=Ne.eventKey,je=ve.getState(),pt=je.defaultActiveFirst;oe.isRootMenu=!1;var gt=!1;return pt&&(gt=pt[He]),Je(ve,He,gt),oe}return Object(M.a)(Ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var oe=this,ve=this.props,He=ve.mode,je=ve.parentMenu,pt=ve.manualRef;if(pt&&pt(this),He!=="horizontal"||!je.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return oe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var oe=this.props,ve=oe.onDestroy,He=oe.eventKey;ve&&ve(He),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(oe){var ve=this,He=this.getBaseProps(),je=this.getMotion(He.mode,He.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||He.visible||He.forceSubMenuRender,!this.haveOpened)return F.createElement("div",null);var pt=He.direction;return F.createElement(ot.default,Object.assign({visible:He.visible},je),function(gt){var Re=gt.className,Ge=gt.style,Ue=n()("".concat(He.prefixCls,"-sub"),Re,Object(d.a)({},"".concat(He.prefixCls,"-rtl"),pt==="rtl"));return F.createElement(be,Object.assign({},He,{id:ve.internalMenuId,className:Ue,style:Ge}),oe)})}},{key:"render",value:function(){var oe,ve=Object(Q.a)({},this.props),He=ve.isOpen,je=this.getPrefixCls(),pt=ve.mode==="inline",gt=n()(je,"".concat(je,"-").concat(ve.mode),(oe={},Object(d.a)(oe,ve.className,!!ve.className),Object(d.a)(oe,this.getOpenClassName(),He),Object(d.a)(oe,this.getActiveClassName(),ve.active||He&&!pt),Object(d.a)(oe,this.getDisabledClassName(),ve.disabled),Object(d.a)(oe,this.getSelectedClassName(),this.isChildrenSelected()),oe));this.internalMenuId||(ve.eventKey?this.internalMenuId="".concat(ve.eventKey,"$Menu"):(ze+=1,this.internalMenuId="$__$".concat(ze,"$Menu")));var Re={},Ge={},Ue={};ve.disabled||(Re={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ge={onClick:this.onTitleClick},Ue={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var mt={},wt=ve.direction;pt&&(wt==="rtl"?mt.paddingRight=ve.inlineIndent*ve.level:mt.paddingLeft=ve.inlineIndent*ve.level);var qt={};this.props.isOpen&&(qt={"aria-owns":this.internalMenuId});var en=null;ve.mode!=="horizontal"&&(en=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(en=F.createElement(this.props.expandIcon,Object(Q.a)({},this.props))));var Vt=F.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:mt,className:"".concat(je,"-title"),role:"button"},Ue,Ge,{"aria-expanded":He},qt,{"aria-haspopup":"true",title:typeof ve.title=="string"?ve.title:void 0}),ve.title,en||F.createElement("i",{className:"".concat(je,"-arrow")})),Dt=this.renderChildren(ve.children),Ke=ve.parentMenu.isRootMenu?ve.parentMenu.props.getPopupContainer:function(Ut){return Ut.parentNode},Ct=qe[ve.mode],Bt=ve.popupOffset?{offset:ve.popupOffset}:{},It=ve.mode==="inline"?"":ve.popupClassName;It+=wt==="rtl"?" ".concat(je,"-rtl"):"";var Zt=ve.disabled,nn=ve.triggerSubMenuAction,an=ve.subMenuOpenDelay,We=ve.forceSubMenuRender,nt=ve.subMenuCloseDelay,Kt=ve.builtinPlacements;_e.forEach(function(Ut){return delete ve[Ut]}),delete ve.onClick;var kt=wt==="rtl"?Object.assign({},pe,Kt):Object.assign({},ce,Kt);return delete ve.direction,F.createElement("li",Object.assign({},ve,Re,{className:gt,role:"menuitem"}),pt&&Vt,pt&&Dt,!pt&&F.createElement(lt.a,{prefixCls:je,popupClassName:n()("".concat(je,"-popup"),It),getPopupContainer:Ke,builtinPlacements:kt,popupPlacement:Ct,popupVisible:He,popupAlign:Bt,popup:Dt,action:Zt?[]:[nn],mouseEnterDelay:an,mouseLeaveDelay:nt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:We},Vt))}}]),Ve}(F.Component);rt.defaultProps={onMouseEnter:B,onMouseLeave:B,onTitleMouseEnter:B,onTitleMouseLeave:B,onTitleClick:B,manualRef:B,mode:"vertical",title:""};var tt=Object(U.b)(function(ut,$e){var Ve=ut.openKeys,Ne=ut.activeKey,oe=ut.selectedKeys,ve=$e.eventKey,He=$e.subMenuKey;return{isOpen:Ve.indexOf(ve)>-1,active:Ne[He]===ve,selectedKeys:oe}})(rt);tt.isSubMenu=!0;var Tt=tt,bt="menuitem-overflowed",Et=.5,yt=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(){var Ne;return Object(H.a)(this,Ve),Ne=$e.apply(this,arguments),Ne.resizeObserver=null,Ne.mutationObserver=null,Ne.originalTotalWidth=0,Ne.overflowedItems=[],Ne.menuItemSizes=[],Ne.cancelFrameId=null,Ne.state={lastVisibleIndex:void 0},Ne.getMenuItemNodes=function(){var oe=Ne.props.prefixCls,ve=ue.findDOMNode(Object(W.a)(Ne));return ve?[].slice.call(ve.children).filter(function(He){return He.className.split(" ").indexOf("".concat(oe,"-overflowed-submenu"))<0}):[]},Ne.getOverflowedSubMenuItem=function(oe,ve,He){var je=Ne.props,pt=je.overflowedIndicator,gt=je.level,Re=je.mode,Ge=je.prefixCls,Ue=je.theme;if(gt!==1||Re!=="horizontal")return null;var mt=Ne.props.children[0],wt=mt.props,qt=wt.children,en=wt.title,Vt=wt.style,Dt=Object(ge.a)(wt,["children","title","style"]),Ke=Object(Q.a)({},Vt),Ct="".concat(oe,"-overflowed-indicator"),Bt="".concat(oe,"-overflowed-indicator");ve.length===0&&He!==!0?Ke=Object(Q.a)(Object(Q.a)({},Ke),{},{display:"none"}):He&&(Ke=Object(Q.a)(Object(Q.a)({},Ke),{},{visibility:"hidden",position:"absolute"}),Ct="".concat(Ct,"-placeholder"),Bt="".concat(Bt,"-placeholder"));var It=Ue?"".concat(Ge,"-").concat(Ue):"",Zt={};return _e.forEach(function(nn){Dt[nn]!==void 0&&(Zt[nn]=Dt[nn])}),F.createElement(Tt,Object.assign({title:pt,className:"".concat(Ge,"-overflowed-submenu"),popupClassName:It},Zt,{key:Ct,eventKey:Bt,disabled:!1,style:Ke}),ve)},Ne.setChildrenWidthAndResize=function(){if(Ne.props.mode!=="horizontal")return;var oe=ue.findDOMNode(Object(W.a)(Ne));if(!oe)return;var ve=oe.children;if(!ve||ve.length===0)return;var He=oe.children[ve.length-1];we(He,"display","inline-block");var je=Ne.getMenuItemNodes(),pt=je.filter(function(gt){return gt.className.split(" ").indexOf(bt)>=0});pt.forEach(function(gt){we(gt,"display","inline-block")}),Ne.menuItemSizes=je.map(function(gt){return Se(gt,!0)}),pt.forEach(function(gt){we(gt,"display","none")}),Ne.overflowedIndicatorWidth=Se(oe.children[oe.children.length-1],!0),Ne.originalTotalWidth=Ne.menuItemSizes.reduce(function(gt,Re){return gt+Re},0),Ne.handleResize(),we(He,"display","none")},Ne.handleResize=function(){if(Ne.props.mode!=="horizontal")return;var oe=ue.findDOMNode(Object(W.a)(Ne));if(!oe)return;var ve=Se(oe);Ne.overflowedItems=[];var He=0,je;Ne.originalTotalWidth>ve+Et&&(je=-1,Ne.menuItemSizes.forEach(function(pt){He+=pt,He+Ne.overflowedIndicatorWidth<=ve&&(je+=1)})),Ne.setState({lastVisibleIndex:je})},Ne}return Object(M.a)(Ve,[{key:"componentDidMount",value:function(){var oe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ve=ue.findDOMNode(this);if(!ve)return;this.resizeObserver=new ke.default(function(He){He.forEach(function(){var je=oe.cancelFrameId;cancelAnimationFrame(je),oe.cancelFrameId=requestAnimationFrame(oe.setChildrenWidthAndResize)})}),[].slice.call(ve.children).concat(ve).forEach(function(He){oe.resizeObserver.observe(He)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){oe.resizeObserver.disconnect(),[].slice.call(ve.children).concat(ve).forEach(function(He){oe.resizeObserver.observe(He)}),oe.setChildrenWidthAndResize()}),this.mutationObserver.observe(ve,{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(oe){var ve=this,He=this.state.lastVisibleIndex;return(oe||[]).reduce(function(je,pt,gt){var Re=pt;if(ve.props.mode==="horizontal"){var Ge=ve.getOverflowedSubMenuItem(pt.props.eventKey,[]);He!==void 0&&ve.props.className.indexOf("".concat(ve.props.prefixCls,"-root"))!==-1&&(gt>He&&(Re=F.cloneElement(pt,{style:{display:"none"},eventKey:"".concat(pt.props.eventKey,"-hidden"),className:"".concat(bt)})),gt===He+1&&(ve.overflowedItems=oe.slice(He+1).map(function(mt){return F.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),Ge=ve.getOverflowedSubMenuItem(pt.props.eventKey,ve.overflowedItems)));var Ue=[].concat(Object(Le.a)(je),[Ge,Re]);return gt===oe.length-1&&Ue.push(ve.getOverflowedSubMenuItem(pt.props.eventKey,[],!0)),Ue}return[].concat(Object(Le.a)(je),[Re])},[])}},{key:"render",value:function(){var oe=this.props,ve=oe.visible,He=oe.prefixCls,je=oe.overflowedIndicator,pt=oe.mode,gt=oe.level,Re=oe.tag,Ge=oe.children,Ue=oe.theme,mt=Object(ge.a)(oe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),wt=Re;return F.createElement(wt,Object.assign({},mt),this.renderChildren(Ge))}}]),Ve}(F.Component);yt.defaultProps={tag:"div",className:""};var Ot=yt;function At(ut){return ut.length?ut.every(function($e){return!!$e.props.disabled}):!0}function Ae(ut,$e,Ve){var Ne=ut.getState();ut.setState({activeKey:Object(Q.a)(Object(Q.a)({},Ne.activeKey),{},Object(d.a)({},$e,Ve))})}function xe(ut){return ut.eventKey||"0-menu-"}function Be(ut,$e){var Ve=$e,Ne=ut.children,oe=ut.eventKey;if(Ve){var ve;if(ae(Ne,function(He,je){He&&He.props&&!He.props.disabled&&Ve===$(He,oe,je)&&(ve=!0)}),ve)return Ve}return Ve=null,ut.defaultActiveFirst&&ae(Ne,function(He,je){!Ve&&He&&!He.props.disabled&&(Ve=$(He,oe,je))}),Ve}function Ze(ut){if(ut){var $e=this.instanceArray.indexOf(ut);$e!==-1?this.instanceArray[$e]=ut:this.instanceArray.push(ut)}}var Pe=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(Ne){var oe;return Object(H.a)(this,Ve),oe=$e.call(this,Ne),oe.onKeyDown=function(ve,He){var je=ve.keyCode,pt;if(oe.getFlatInstanceArray().forEach(function(Re){Re&&Re.props.active&&Re.onKeyDown&&(pt=Re.onKeyDown(ve))}),pt)return 1;var gt=null;return(je===v.a.UP||je===v.a.DOWN)&&(gt=oe.step(je===v.a.UP?-1:1)),gt?(ve.preventDefault(),Ae(oe.props.store,xe(oe.props),gt.props.eventKey),typeof He=="function"&&He(gt),1):void 0},oe.onItemHover=function(ve){var He=ve.key,je=ve.hover;Ae(oe.props.store,xe(oe.props),je?He:null)},oe.onDeselect=function(ve){oe.props.onDeselect(ve)},oe.onSelect=function(ve){oe.props.onSelect(ve)},oe.onClick=function(ve){oe.props.onClick(ve)},oe.onOpenChange=function(ve){oe.props.onOpenChange(ve)},oe.onDestroy=function(ve){oe.props.onDestroy(ve)},oe.getFlatInstanceArray=function(){return oe.instanceArray},oe.step=function(ve){var He=oe.getFlatInstanceArray(),je=oe.props.store.getState().activeKey[xe(oe.props)],pt=He.length;if(!pt)return null;ve<0&&(He=He.concat().reverse());var gt=-1;if(He.every(function(mt,wt){return mt&&mt.props.eventKey===je?(gt=wt,!1):!0}),!oe.props.defaultActiveFirst&>!==-1&&At(He.slice(gt,pt-1)))return;var Re=(gt+1)%pt,Ge=Re;do{var Ue=He[Ge];if(!Ue||Ue.props.disabled)Ge=(Ge+1)%pt;else return Ue}while(Ge!==Re);return null},oe.renderCommonMenuItem=function(ve,He,je){var pt=oe.props.store.getState(),gt=Object(W.a)(oe),Re=gt.props,Ge=$(ve,Re.eventKey,He),Ue=ve.props;if(!Ue||typeof ve.type=="string")return ve;var mt=Ge===pt.activeKey,wt=Object(Q.a)(Object(Q.a)({mode:Ue.mode||Re.mode,level:Re.level,inlineIndent:Re.inlineIndent,renderMenuItem:oe.renderMenuItem,rootPrefixCls:Re.prefixCls,index:He,parentMenu:Re.parentMenu,manualRef:Ue.disabled?void 0:Object(C.a)(ve.ref,Ze.bind(Object(W.a)(oe))),eventKey:Ge,active:!Ue.disabled&&mt,multiple:Re.multiple,onClick:function(en){(Ue.onClick||B)(en),oe.onClick(en)},onItemHover:oe.onItemHover,motion:Re.motion,subMenuOpenDelay:Re.subMenuOpenDelay,subMenuCloseDelay:Re.subMenuCloseDelay,forceSubMenuRender:Re.forceSubMenuRender,onOpenChange:oe.onOpenChange,onDeselect:oe.onDeselect,onSelect:oe.onSelect,builtinPlacements:Re.builtinPlacements,itemIcon:Ue.itemIcon||oe.props.itemIcon,expandIcon:Ue.expandIcon||oe.props.expandIcon},je),{},{direction:Re.direction});return(Re.mode==="inline"||Me())&&(wt.triggerSubMenuAction="click"),F.cloneElement(ve,wt)},oe.renderMenuItem=function(ve,He,je){if(!ve)return null;var pt=oe.props.store.getState(),gt={openKeys:pt.openKeys,selectedKeys:pt.selectedKeys,triggerSubMenuAction:oe.props.triggerSubMenuAction,subMenuKey:je};return oe.renderCommonMenuItem(ve,He,gt)},Ne.store.setState({activeKey:Object(Q.a)(Object(Q.a)({},Ne.store.getState().activeKey),{},Object(d.a)({},Ne.eventKey,Be(Ne,Ne.activeKey)))}),oe.instanceArray=[],oe}return Object(M.a)(Ve,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(oe){return this.props.visible||oe.visible||this.props.className!==oe.className||!h()(this.props.style,oe.style)}},{key:"componentDidUpdate",value:function(oe){var ve=this.props,He="activeKey"in ve?ve.activeKey:ve.store.getState().activeKey[xe(ve)],je=Be(ve,He);if(je!==He)Ae(ve.store,xe(ve),je);else if("activeKey"in oe){var pt=Be(oe,oe.activeKey);je!==pt&&Ae(ve.store,xe(ve),je)}}},{key:"render",value:function(){var oe=this,ve=Object(L.a)({},this.props);this.instanceArray=[];var He=n()(ve.prefixCls,ve.className,"".concat(ve.prefixCls,"-").concat(ve.mode)),je={className:He,role:ve.role||"menu"};ve.id&&(je.id=ve.id),ve.focusable&&(je.tabIndex=0,je.onKeyDown=this.onKeyDown);var pt=ve.prefixCls,gt=ve.eventKey,Re=ve.visible,Ge=ve.level,Ue=ve.mode,mt=ve.overflowedIndicator,wt=ve.theme;return _e.forEach(function(qt){return delete ve[qt]}),delete ve.onClick,F.createElement(Ot,Object.assign({},ve,{prefixCls:pt,mode:Ue,tag:"ul",level:Ge,theme:wt,visible:Re,overflowedIndicator:mt},je),F.Children.map(ve.children,function(qt,en){return oe.renderMenuItem(qt,en,gt||"0-menu-")}))}}]),Ve}(F.Component);Pe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:B};var Xe=Object(U.b)()(Pe),be=Xe,de=k("Kwbf");function he(ut,$e,Ve){var Ne=ut.prefixCls,oe=ut.motion,ve=ut.defaultMotions,He=ve===void 0?{}:ve,je=ut.openAnimation,pt=ut.openTransitionName,gt=$e.switchingModeFromInline;if(oe)return oe;if(Object(r.a)(je)==="object"&&je)Object(de.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof je=="string")return{motionName:"".concat(Ne,"-open-").concat(je)};if(pt)return{motionName:pt};var Re=He[Ve];return Re||(gt?null:He.other)}var re=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(Ne){var oe;Object(H.a)(this,Ve),oe=$e.call(this,Ne),oe.inlineOpenKeys=[],oe.onSelect=function(je){var pt=Object(W.a)(oe),gt=pt.props;if(gt.selectable){var Re=oe.store.getState(),Ge=Re.selectedKeys,Ue=je.key;gt.multiple?Ge=Ge.concat([Ue]):Ge=[Ue],"selectedKeys"in gt||oe.store.setState({selectedKeys:Ge}),gt.onSelect(Object(Q.a)(Object(Q.a)({},je),{},{selectedKeys:Ge}))}},oe.onClick=function(je){var pt=oe.getRealMenuMode(),gt=Object(W.a)(oe),Re=gt.store,Ge=gt.props.onOpenChange;pt!=="inline"&&!("openKeys"in oe.props)&&(Re.setState({openKeys:[]}),Ge([])),oe.props.onClick(je)},oe.onKeyDown=function(je,pt){oe.innerMenu.getWrappedInstance().onKeyDown(je,pt)},oe.onOpenChange=function(je){var pt=Object(W.a)(oe),gt=pt.props,Re=oe.store.getState().openKeys.concat(),Ge=!1,Ue=function(wt){var qt=!1;if(wt.open)qt=Re.indexOf(wt.key)===-1,qt&&Re.push(wt.key);else{var en=Re.indexOf(wt.key);qt=en!==-1,qt&&Re.splice(en,1)}Ge=Ge||qt};Array.isArray(je)?je.forEach(Ue):Ue(je),Ge&&("openKeys"in oe.props||oe.store.setState({openKeys:Re}),gt.onOpenChange(Re))},oe.onDeselect=function(je){var pt=Object(W.a)(oe),gt=pt.props;if(gt.selectable){var Re=oe.store.getState().selectedKeys.concat(),Ge=je.key,Ue=Re.indexOf(Ge);Ue!==-1&&Re.splice(Ue,1),"selectedKeys"in gt||oe.store.setState({selectedKeys:Re}),gt.onDeselect(Object(Q.a)(Object(Q.a)({},je),{},{selectedKeys:Re}))}},oe.onMouseEnter=function(je){oe.restoreModeVerticalFromInline();var pt=oe.props.onMouseEnter;pt&&pt(je)},oe.onTransitionEnd=function(je){var pt=je.propertyName==="width"&&je.target===je.currentTarget,gt=je.target.className,Re=Object.prototype.toString.call(gt)==="[object SVGAnimatedString]"?gt.animVal:gt,Ge=je.propertyName==="font-size"&&Re.indexOf("anticon")>=0;(pt||Ge)&&oe.restoreModeVerticalFromInline()},oe.setInnerMenu=function(je){oe.innerMenu=je},oe.isRootMenu=!0;var ve=Ne.defaultSelectedKeys,He=Ne.defaultOpenKeys;return"selectedKeys"in Ne&&(ve=Ne.selectedKeys||[]),"openKeys"in Ne&&(He=Ne.openKeys||[]),oe.store=Object(U.c)({selectedKeys:ve,openKeys:He,activeKey:{"0-menu-":Be(Ne,Ne.activeKey)}}),oe.state={switchingModeFromInline:!1},oe}return Object(M.a)(Ve,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(oe){this.updateOpentKeysWhenSwitchMode(oe),this.updateMiniStore();var ve=this.props,He=ve.siderCollapsed,je=ve.inlineCollapsed,pt=ve.onOpenChange;(!oe.inlineCollapsed&&je||!oe.siderCollapsed&&He)&&pt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(oe){var ve=this.props,He=this.store,je=this.inlineOpenKeys,pt=He.getState(),gt={};oe.mode==="inline"&&ve.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ve||((ve.inlineCollapsed&&!oe.inlineCollapsed||ve.siderCollapsed&&!oe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=pt.openKeys.concat(),gt.openKeys=[]),(!ve.inlineCollapsed&&oe.inlineCollapsed||!ve.siderCollapsed&&oe.siderCollapsed)&&(gt.openKeys=je,this.inlineOpenKeys=[])),Object.keys(gt).length&&He.setState(gt)}},{key:"updateMenuDisplay",value:function(){var oe=this.props.collapsedWidth,ve=this.store,He=this.prevOpenKeys,je=this.getInlineCollapsed()&&(oe===0||oe==="0"||oe==="0px");je?(this.prevOpenKeys=ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):He&&(this.store.setState({openKeys:He}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var oe=this.props.mode,ve=this.state.switchingModeFromInline,He=this.getInlineCollapsed();return ve&&He?"inline":He?"vertical":oe}},{key:"getInlineCollapsed",value:function(){var oe=this.props,ve=oe.inlineCollapsed,He=oe.siderCollapsed;return He!==void 0?He:ve}},{key:"restoreModeVerticalFromInline",value:function(){var oe=this.state.switchingModeFromInline;oe&&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 oe=Object(Q.a)({},Object(S.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ve=this.getRealMenuMode();return oe.className+=" ".concat(oe.prefixCls,"-root"),oe.direction==="rtl"&&(oe.className+=" ".concat(oe.prefixCls,"-rtl")),oe=Object(Q.a)(Object(Q.a)({},oe),{},{mode:ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:he(this.props,this.state,ve)}),delete oe.openAnimation,delete oe.openTransitionName,F.createElement(U.a,{store:this.store},F.createElement(be,Object.assign({},oe,{ref:this.setInnerMenu}),this.props.children))}}]),Ve}(F.Component);re.defaultProps={selectable:!0,onClick:B,onSelect:B,onOpenChange:B,onDeselect:B,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:F.createElement("span",null,"\xB7\xB7\xB7")};var ie=re,le=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(){var Ne;return Object(H.a)(this,Ve),Ne=$e.apply(this,arguments),Ne.onKeyDown=function(oe){var ve=oe.keyCode;return ve===v.a.ENTER?(Ne.onClick(oe),!0):void 0},Ne.onMouseLeave=function(oe){var ve=Ne.props,He=ve.eventKey,je=ve.onItemHover,pt=ve.onMouseLeave;je({key:He,hover:!1}),pt({key:He,domEvent:oe})},Ne.onMouseEnter=function(oe){var ve=Ne.props,He=ve.eventKey,je=ve.onItemHover,pt=ve.onMouseEnter;je({key:He,hover:!0}),pt({key:He,domEvent:oe})},Ne.onClick=function(oe){var ve=Ne.props,He=ve.eventKey,je=ve.multiple,pt=ve.onClick,gt=ve.onSelect,Re=ve.onDeselect,Ge=ve.isSelected,Ue={key:He,keyPath:[He],item:Object(W.a)(Ne),domEvent:oe};pt(Ue),je?Ge?Re(Ue):gt(Ue):Ge||gt(Ue)},Ne.saveNode=function(oe){Ne.node=oe},Ne}return Object(M.a)(Ve,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var oe=this.props;oe.onDestroy&&oe.onDestroy(oe.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 oe,ve=Object(Q.a)({},this.props),He=n()(this.getPrefixCls(),ve.className,(oe={},Object(d.a)(oe,this.getActiveClassName(),!ve.disabled&&ve.active),Object(d.a)(oe,this.getSelectedClassName(),ve.isSelected),Object(d.a)(oe,this.getDisabledClassName(),ve.disabled),oe)),je=Object(Q.a)(Object(Q.a)({},ve.attribute),{},{title:typeof ve.title=="string"?ve.title:void 0,className:He,role:ve.role||"menuitem","aria-disabled":ve.disabled});ve.role==="option"?je=Object(Q.a)(Object(Q.a)({},je),{},{role:"option","aria-selected":ve.isSelected}):(ve.role===null||ve.role==="none")&&(je.role="none");var pt={onClick:ve.disabled?null:this.onClick,onMouseLeave:ve.disabled?null:this.onMouseLeave,onMouseEnter:ve.disabled?null:this.onMouseEnter},gt=Object(Q.a)({},ve.style);ve.mode==="inline"&&(ve.direction==="rtl"?gt.paddingRight=ve.inlineIndent*ve.level:gt.paddingLeft=ve.inlineIndent*ve.level),_e.forEach(function(Ge){return delete ve[Ge]}),delete ve.direction;var Re=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Re=F.createElement(this.props.itemIcon,this.props)),F.createElement("li",Object.assign({},Object(S.default)(ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),je,pt,{style:gt,ref:this.saveNode}),ve.children,Re)}}]),Ve}(F.Component);le.isMenuItem=!0,le.defaultProps={onSelect:B,onMouseEnter:B,onMouseLeave:B,manualRef:B};var me=Object(U.b)(function(ut,$e){var Ve=ut.activeKey,Ne=ut.selectedKeys,oe=$e.eventKey,ve=$e.subMenuKey;return{active:Ve[ve]===oe,isSelected:Ne.indexOf(oe)!==-1}})(le),De=me,Te=function(ut){Object(N.a)(Ve,ut);var $e=Object(A.a)(Ve);function Ve(){var Ne;return Object(H.a)(this,Ve),Ne=$e.apply(this,arguments),Ne.renderInnerMenuItem=function(oe){var ve=Ne.props,He=ve.renderMenuItem,je=ve.index;return He(oe,je,Ne.props.subMenuKey)},Ne}return Object(M.a)(Ve,[{key:"render",value:function(){var oe=Object(L.a)({},this.props),ve=oe.className,He=ve===void 0?"":ve,je=oe.rootPrefixCls,pt="".concat(je,"-item-group-title"),gt="".concat(je,"-item-group-list"),Re=oe.title,Ge=oe.children;return _e.forEach(function(Ue){return delete oe[Ue]}),delete oe.onClick,delete oe.direction,F.createElement("li",Object.assign({},oe,{className:"".concat(He," ").concat(je,"-item-group")}),F.createElement("div",{className:pt,title:typeof Re=="string"?Re:void 0},Re),F.createElement("ul",{className:gt},F.Children.map(Ge,this.renderInnerMenuItem)))}}]),Ve}(F.Component);Te.isMenuItemGroup=!0,Te.defaultProps={disabled:!0};var Qe=Te,ct=function($e){var Ve=$e.className,Ne=$e.rootPrefixCls,oe=$e.style;return F.createElement("li",{className:"".concat(Ve," ").concat(Ne,"-item-divider"),style:oe})};ct.defaultProps={disabled:!0,className:"",style:{}};var xt=ct,ft=se.e=ie},"24hK":function(Ye,se,k){"use strict";k.d(se,"a",function(){return M});var Q=k("JYp7"),H=function(){function W(N){this.element=N,this.next=W.Undefined,this.prev=W.Undefined}return W.Undefined=new W(void 0),W}(),M=function(){function W(){this._first=H.Undefined,this._last=H.Undefined,this._size=0}return Object.defineProperty(W.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),W.prototype.isEmpty=function(){return this._first===H.Undefined},W.prototype.clear=function(){this._first=H.Undefined,this._last=H.Undefined,this._size=0},W.prototype.unshift=function(N){return this._insert(N,!1)},W.prototype.push=function(N){return this._insert(N,!0)},W.prototype._insert=function(N,A){var F=this,U=new H(N);if(this._first===H.Undefined)this._first=U,this._last=U;else if(A){var S=this._last;this._last=U,U.prev=S,S.next=U}else{var L=this._first;this._first=U,U.next=L,L.prev=U}this._size+=1;var d=!1;return function(){d||(d=!0,F._remove(U))}},W.prototype.shift=function(){if(this._first===H.Undefined)return;var N=this._first.element;return this._remove(this._first),N},W.prototype.pop=function(){if(this._last===H.Undefined)return;var N=this._last.element;return this._remove(this._last),N},W.prototype._remove=function(N){if(N.prev!==H.Undefined&&N.next!==H.Undefined){var A=N.prev;A.next=N.next,N.next.prev=A}else N.prev===H.Undefined&&N.next===H.Undefined?(this._first=H.Undefined,this._last=H.Undefined):N.next===H.Undefined?(this._last=this._last.prev,this._last.next=H.Undefined):N.prev===H.Undefined&&(this._first=this._first.next,this._first.prev=H.Undefined);this._size-=1},W.prototype.iterator=function(){var N,A=this._first;return{next:function(){return A===H.Undefined?Q.c:(N?N.value=A.element:N={done:!1,value:A.element},A=A.next,N)}}},W.prototype.toArray=function(){for(var N=[],A=this._first;A!==H.Undefined;A=A.next)N.push(A.element);return N},W}()},"55Ip":function(Ye,se,k){"use strict";k.d(se,"a",function(){return o}),k.d(se,"b",function(){return O});var Q=k("Ty5D"),H=k("dI71"),M=k("q1tI"),W=k.n(M),N=k("YS25"),A=k("17x9"),F=k.n(A),U=k("wx14"),S=k("zLVn"),L=k("9R94"),d=function(m){Object(H.a)(s,m);function s(){for(var _,T=arguments.length,w=new Array(T),P=0;P<T;P++)w[P]=arguments[P];return _=m.call.apply(m,[this].concat(w))||this,_.history=Object(N.a)(_.props),_}var u=s.prototype;return u.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},s}(W.a.Component),v=function(m){Object(H.a)(s,m);function s(){for(var _,T=arguments.length,w=new Array(T),P=0;P<T;P++)w[P]=arguments[P];return _=m.call.apply(m,[this].concat(w))||this,_.history=Object(N.b)(_.props),_}var u=s.prototype;return u.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},s}(W.a.Component),C=function(s,u){return typeof s=="function"?s(u):s},p=function(s,u){return typeof s=="string"?Object(N.c)(s,null,null,u):s},h=function(s){return s},f=W.a.forwardRef;typeof f=="undefined"&&(f=h);function n(m){return!!(m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)}var r=f(function(m,s){var u=m.innerRef,_=m.navigate,T=m.onClick,w=Object(S.a)(m,["innerRef","navigate","onClick"]),P=w.target,j=Object(U.a)({},w,{onClick:function(Z){try{T&&T(Z)}catch(G){throw Z.preventDefault(),G}!Z.defaultPrevented&&Z.button===0&&(!P||P==="_self")&&!n(Z)&&(Z.preventDefault(),_())}});return h!==f?j.ref=s||u:j.ref=u,W.a.createElement("a",j)}),o=f(function(m,s){var u=m.component,_=u===void 0?r:u,T=m.replace,w=m.to,P=m.innerRef,j=Object(S.a)(m,["component","replace","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(K){K||Object(L.a)(!1);var Z=K.history,G=p(C(w,K.location),K.location),B=G?Z.createHref(G):"",$=Object(U.a)({},j,{href:B,navigate:function(){var ae=C(w,K.location),fe=T?Z.replace:Z.push;fe(ae)}});return h!==f?$.ref=s||P:$.innerRef=P,W.a.createElement(_,$)})});if(!1)var l,x;var E=function(s){return s},y=W.a.forwardRef;typeof y=="undefined"&&(y=E);function R(){for(var m=arguments.length,s=new Array(m),u=0;u<m;u++)s[u]=arguments[u];return s.filter(function(_){return _}).join(" ")}var O=y(function(m,s){var u=m["aria-current"],_=u===void 0?"page":u,T=m.activeClassName,w=T===void 0?"active":T,P=m.activeStyle,j=m.className,K=m.exact,Z=m.isActive,G=m.location,B=m.sensitive,$=m.strict,ne=m.style,ae=m.to,fe=m.innerRef,_e=Object(S.a)(m,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(Se){Se||Object(L.a)(!1);var we=G||Se.location,Me=p(C(ae,we),we),Le=Me.pathname,ge=Le&&Le.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ge?Object(Q.f)(we.pathname,{path:ge,exact:K,sensitive:B,strict:$}):null,ke=!!(Z?Z(ue,we):ue),lt=ke?R(j,w):j,ot=ke?Object(U.a)({},ne,{},P):ne,st=Object(U.a)({"aria-current":ke&&_||null,className:lt,style:ot,to:Me},_e);return E!==y?st.ref=s||fe:st.innerRef=fe,W.a.createElement(o,st)})});if(!1)var g},"5nXd":function(Ye,se,k){var Q=k("MFOe"),H=Q.slice,M=Q.pluck,W=Q.each,N=Q.bind,A=Q.create,F=Q.isList,U=Q.isFunction,S=Q.isObject;Ye.exports={createStore:v};var L={version:"2.0.12",enabled:!1,get:function(C,p){var h=this.storage.read(this._namespacePrefix+C);return this._deserialize(h,p)},set:function(C,p){return p===void 0?this.remove(C):(this.storage.write(this._namespacePrefix+C,this._serialize(p)),p)},remove:function(C){this.storage.remove(this._namespacePrefix+C)},each:function(C){var p=this;this.storage.each(function(h,f){C.call(p,p._deserialize(h),(f||"").replace(p._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(C){return this._namespacePrefix=="__storejs_"+C+"_"},createStore:function(){return v.apply(this,arguments)},addPlugin:function(C){this._addPlugin(C)},namespace:function(C){return v(this.storage,this.plugins,C)}};function d(){var C=typeof console=="undefined"?null:console;if(!C)return;var p=C.warn?C.warn:C.log;p.apply(C,arguments)}function v(C,p,h){h||(h=""),C&&!F(C)&&(C=[C]),p&&!F(p)&&(p=[p]);var f=h?"__storejs_"+h+"_":"",n=h?new RegExp("^"+f):null,r=/^[a-zA-Z0-9_\-]*$/;if(!r.test(h))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var o={_namespacePrefix:f,_namespaceRegexp:n,_testStorage:function(x){try{var E="__storejs__test__";x.write(E,E);var y=x.read(E)===E;return x.remove(E),y}catch(R){return!1}},_assignPluginFnProp:function(x,E){var y=this[E];this[E]=function(){var O=H(arguments,0),g=this;function m(){return y?(W(arguments,function(u,_){O[_]=u}),y.apply(g,O)):void 0}var s=[m].concat(O);return x.apply(g,s)}},_serialize:function(x){return JSON.stringify(x)},_deserialize:function(x,E){if(!x)return E;var y="";try{y=JSON.parse(x)}catch(R){y=x}return y!==void 0?y:E},_addStorage:function(x){if(this.enabled)return;this._testStorage(x)&&(this.storage=x,this.enabled=!0)},_addPlugin:function(x){var E=this;if(F(x)){W(x,function(O){E._addPlugin(O)});return}var y=M(this.plugins,function(O){return x===O});if(y)return;if(this.plugins.push(x),!U(x))throw new Error("Plugins must be function values that return objects");var R=x.call(this);if(!S(R))throw new Error("Plugins must return an object of function properties");W(R,function(O,g){if(!U(O))throw new Error("Bad plugin property: "+g+" from plugin "+x.name+". Plugins should only return functions.");E._assignPluginFnProp(O,g)})},addStorage:function(x){d("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(x)}},l=A(o,L,{plugins:[]});return l.raw={},W(l,function(x,E){U(x)&&(l.raw[E]=N(l,x))}),W(C,function(x){l._addStorage(x)}),W(p,function(x){l._addPlugin(x)}),l}},"6+eU":function(Ye,se,k){"use strict";k.d(se,"a",function(){return y});var Q=k("wx14"),H=k("rePB"),M=k("VTBJ"),W=k("1OyB"),N=k("vuIU"),A=k("Ji7U"),F=k("LK+K"),U=k("q1tI"),S=k.n(U),L=k("TSYQ"),d=k.n(L),v=function(O){var g,m="".concat(O.rootPrefixCls,"-item"),s=d()(m,"".concat(m,"-").concat(O.page),(g={},Object(H.a)(g,"".concat(m,"-active"),O.active),Object(H.a)(g,O.className,!!O.className),Object(H.a)(g,"".concat(m,"-disabled"),!O.page),g)),u=function(){O.onClick(O.page)},_=function(w){O.onKeyPress(w,O.onClick,O.page)};return S.a.createElement("li",{title:O.showTitle?O.page:null,className:s,onClick:u,onKeyPress:_,tabIndex:"0"},O.itemRender(O.page,"page",S.a.createElement("a",{rel:"nofollow"},O.page)))},C=v,p={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},h=function(R){Object(A.a)(g,R);var O=Object(F.a)(g);function g(){var m;Object(W.a)(this,g);for(var s=arguments.length,u=new Array(s),_=0;_<s;_++)u[_]=arguments[_];return m=O.call.apply(O,[this].concat(u)),m.state={goInputText:""},m.buildOptionText=function(T){return"".concat(T," ").concat(m.props.locale.items_per_page)},m.changeSize=function(T){m.props.changeSize(Number(T))},m.handleChange=function(T){m.setState({goInputText:T.target.value})},m.handleBlur=function(T){var w=m.props,P=w.goButton,j=w.quickGo,K=w.rootPrefixCls,Z=m.state.goInputText;if(P||Z==="")return;if(T.relatedTarget&&(T.relatedTarget.className.indexOf("".concat(K,"-prev"))>=0||T.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;m.setState({goInputText:""}),j(m.getValidValue())},m.go=function(T){var w=m.state.goInputText;if(w==="")return;(T.keyCode===p.ENTER||T.type==="click")&&(m.setState({goInputText:""}),m.props.quickGo(m.getValidValue()))},m}return Object(N.a)(g,[{key:"getValidValue",value:function(){var s=this.state,u=s.goInputText,_=s.current;return!u||isNaN(u)?_:Number(u)}},{key:"getPageSizeOptions",value:function(){var s=this.props,u=s.pageSize,_=s.pageSizeOptions;return _.some(function(T){return T.toString()===u.toString()})?_:_.concat([u.toString()]).sort(function(T,w){var P=isNaN(Number(T))?0:Number(T),j=isNaN(Number(w))?0:Number(w);return P-j})}},{key:"render",value:function(){var s=this,u=this.props,_=u.pageSize,T=u.locale,w=u.rootPrefixCls,P=u.changeSize,j=u.quickGo,K=u.goButton,Z=u.selectComponentClass,G=u.buildOptionText,B=u.selectPrefixCls,$=u.disabled,ne=this.state.goInputText,ae="".concat(w,"-options"),fe=Z,_e=null,Se=null,we=null;if(!P&&!j)return null;var Me=this.getPageSizeOptions();if(P&&fe){var Le=Me.map(function(ge,ue){return S.a.createElement(fe.Option,{key:ue,value:ge.toString()},(G||s.buildOptionText)(ge))});_e=S.a.createElement(fe,{disabled:$,prefixCls:B,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||Me[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Le)}return j&&(K&&(we=typeof K=="boolean"?S.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(ae,"-quick-jumper-button")},T.jump_to_confirm):S.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),Se=S.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},T.jump_to,S.a.createElement("input",{disabled:$,type:"text",value:ne,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,we)),S.a.createElement("li",{className:"".concat(ae)},_e,Se)}}]),g}(S.a.Component);h.defaultProps={pageSizeOptions:["10","20","50","100"]};var f=h,n=k("N2Kk");function r(){}function o(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function l(R,O,g){return g}function x(R,O,g){var m=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/m)+1}var E=function(R){Object(A.a)(g,R);var O=Object(F.a)(g);function g(m){var s;Object(W.a)(this,g),s=O.call(this,m),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(P,j){var K=s.props.prefixCls,Z=P||S.a.createElement("button",{type:"button","aria-label":j,className:"".concat(K,"-item-link")});return typeof P=="function"&&(Z=S.a.createElement(P,Object(M.a)({},s.props))),Z},s.savePaginationNode=function(P){s.paginationNode=P},s.isValid=function(P){return o(P)&&P!==s.state.current},s.shouldDisplayQuickJumper=function(){var P=s.props,j=P.showQuickJumper,K=P.pageSize,Z=P.total;return Z<=K?!1:j},s.handleKeyDown=function(P){(P.keyCode===p.ARROW_UP||P.keyCode===p.ARROW_DOWN)&&P.preventDefault()},s.handleKeyUp=function(P){var j=s.getValidValue(P),K=s.state.currentInputValue;j!==K&&s.setState({currentInputValue:j}),P.keyCode===p.ENTER?s.handleChange(j):P.keyCode===p.ARROW_UP?s.handleChange(j-1):P.keyCode===p.ARROW_DOWN&&s.handleChange(j+1)},s.changePageSize=function(P){var j=s.state.current,K=x(P,s.state,s.props);j=j>K?K:j,K===0&&(j=s.state.current),typeof P=="number"&&("pageSize"in s.props||s.setState({pageSize:P}),"current"in s.props||s.setState({current:j,currentInputValue:j})),s.props.onShowSizeChange(j,P),"onChange"in s.props&&s.props.onChange&&s.props.onChange(j,P)},s.handleChange=function(P){var j=s.props.disabled,K=P;if(s.isValid(K)&&!j){var Z=x(void 0,s.state,s.props);K>Z?K=Z:K<1&&(K=1),"current"in s.props||s.setState({current:K,currentInputValue:K});var G=s.state.pageSize;return s.props.onChange(K,G),K}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(P,j){if(P.key==="Enter"||P.charCode===13){for(var K=arguments.length,Z=new Array(K>2?K-2:0),G=2;G<K;G++)Z[G-2]=arguments[G];j.apply(void 0,Z)}},s.runIfEnterPrev=function(P){s.runIfEnter(P,s.prev)},s.runIfEnterNext=function(P){s.runIfEnter(P,s.next)},s.runIfEnterJumpPrev=function(P){s.runIfEnter(P,s.jumpPrev)},s.runIfEnterJumpNext=function(P){s.runIfEnter(P,s.jumpNext)},s.handleGoTO=function(P){(P.keyCode===p.ENTER||P.type==="click")&&s.handleChange(s.state.currentInputValue)};var u=m.onChange!==r,_="current"in m;_&&!u&&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=m.defaultCurrent;"current"in m&&(T=m.current);var w=m.defaultPageSize;return"pageSize"in m&&(w=m.pageSize),T=Math.min(T,x(w,void 0,m)),s.state={current:T,currentInputValue:T,pageSize:w},s}return Object(N.a)(g,[{key:"componentDidUpdate",value:function(s,u){var _=this.props.prefixCls;if(u.current!==this.state.current&&this.paginationNode){var T=this.paginationNode.querySelector(".".concat(_,"-item-").concat(u.current));T&&document.activeElement===T&&T.blur()}}},{key:"getValidValue",value:function(s){var u=s.target.value,_=x(void 0,this.state,this.props),T=this.state.currentInputValue,w;return u===""?w=u:isNaN(Number(u))?w=T:u>=_?w=_:w=Number(u),w}},{key:"getShowSizeChanger",value:function(){var s=this.props,u=s.showSizeChanger,_=s.total,T=s.totalBoundaryShowSizeChanger;return typeof u!="undefined"?u:_>T}},{key:"renderPrev",value:function(s){var u=this.props,_=u.prevIcon,T=u.itemRender,w=T(s,"prev",this.getItemIcon(_,"prev page")),P=!this.hasPrev();return Object(U.isValidElement)(w)?Object(U.cloneElement)(w,{disabled:P}):w}},{key:"renderNext",value:function(s){var u=this.props,_=u.nextIcon,T=u.itemRender,w=T(s,"next",this.getItemIcon(_,"next page")),P=!this.hasNext();return Object(U.isValidElement)(w)?Object(U.cloneElement)(w,{disabled:P}):w}},{key:"render",value:function(){var s=this,u=this.props,_=u.prefixCls,T=u.className,w=u.style,P=u.disabled,j=u.hideOnSinglePage,K=u.total,Z=u.locale,G=u.showQuickJumper,B=u.showLessItems,$=u.showTitle,ne=u.showTotal,ae=u.simple,fe=u.itemRender,_e=u.showPrevNextJumpers,Se=u.jumpPrevIcon,we=u.jumpNextIcon,Me=u.selectComponentClass,Le=u.selectPrefixCls,ge=u.pageSizeOptions,ue=this.state,ke=ue.current,lt=ue.pageSize,ot=ue.currentInputValue;if(j===!0&&K<=lt)return null;var st=x(void 0,this.state,this.props),ce=[],pe=null,Oe=null,ze=null,qe=null,Je=null,rt=G&&G.goButton,tt=B?1:2,Tt=ke-1>0?ke-1:0,bt=ke+1<st?ke+1:st,Et=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(ae)return rt&&(typeof rt=="boolean"?Je=S.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Z.jump_to_confirm):Je=S.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},rt),Je=S.a.createElement("li",{title:$?"".concat(Z.jump_to).concat(ke,"/").concat(st):null,className:"".concat(_,"-simple-pager")},Je)),S.a.createElement("ul",Object(Q.a)({className:d()(_,"".concat(_,"-simple"),Object(H.a)({},"".concat(_,"-disabled"),P),T),style:w,ref:this.savePaginationNode},Et),S.a.createElement("li",{title:$?Z.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:d()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Tt)),S.a.createElement("li",{title:$?"".concat(ke,"/").concat(st):null,className:"".concat(_,"-simple-pager")},S.a.createElement("input",{type:"text",value:ot,disabled:P,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),S.a.createElement("span",{className:"".concat(_,"-slash")},"/"),st),S.a.createElement("li",{title:$?Z.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:d()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(bt)),Je);if(st<=3+tt*2){var yt={locale:Z,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:$,itemRender:fe};st||ce.push(S.a.createElement(C,Object(Q.a)({},yt,{key:"noPager",page:st,className:"".concat(_,"-disabled")})));for(var Ot=1;Ot<=st;Ot+=1){var At=ke===Ot;ce.push(S.a.createElement(C,Object(Q.a)({},yt,{key:Ot,page:Ot,active:At})))}}else{var Ae=B?Z.prev_3:Z.prev_5,xe=B?Z.next_3:Z.next_5;_e&&(pe=S.a.createElement("li",{title:$?Ae:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:d()("".concat(_,"-jump-prev"),Object(H.a)({},"".concat(_,"-jump-prev-custom-icon"),!!Se))},fe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Se,"prev page"))),Oe=S.a.createElement("li",{title:$?xe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:d()("".concat(_,"-jump-next"),Object(H.a)({},"".concat(_,"-jump-next-custom-icon"),!!we))},fe(this.getJumpNextPage(),"jump-next",this.getItemIcon(we,"next page")))),qe=S.a.createElement(C,{locale:Z,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:st,page:st,active:!1,showTitle:$,itemRender:fe}),ze=S.a.createElement(C,{locale:Z,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:$,itemRender:fe});var Be=Math.max(1,ke-tt),Ze=Math.min(ke+tt,st);ke-1<=tt&&(Ze=1+tt*2),st-ke<=tt&&(Be=st-tt*2);for(var Pe=Be;Pe<=Ze;Pe+=1){var Xe=ke===Pe;ce.push(S.a.createElement(C,{locale:Z,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Pe,page:Pe,active:Xe,showTitle:$,itemRender:fe}))}ke-1>=tt*2&&ke!==1+2&&(ce[0]=Object(U.cloneElement)(ce[0],{className:"".concat(_,"-item-after-jump-prev")}),ce.unshift(pe)),st-ke>=tt*2&&ke!==st-2&&(ce[ce.length-1]=Object(U.cloneElement)(ce[ce.length-1],{className:"".concat(_,"-item-before-jump-next")}),ce.push(Oe)),Be!==1&&ce.unshift(ze),Ze!==st&&ce.push(qe)}var be=null;ne&&(be=S.a.createElement("li",{className:"".concat(_,"-total-text")},ne(K,[K===0?0:(ke-1)*lt+1,ke*lt>K?K:ke*lt])));var de=!this.hasPrev()||!st,he=!this.hasNext()||!st;return S.a.createElement("ul",Object(Q.a)({className:d()(_,T,Object(H.a)({},"".concat(_,"-disabled"),P)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},Et),be,S.a.createElement("li",{title:$?Z.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:d()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),de)),"aria-disabled":de},this.renderPrev(Tt)),ce,S.a.createElement("li",{title:$?Z.next_page:null,onClick:this.next,tabIndex:he?null:0,onKeyPress:this.runIfEnterNext,className:d()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),he)),"aria-disabled":he},this.renderNext(bt)),S.a.createElement(f,{disabled:P,locale:Z,rootPrefixCls:_,selectComponentClass:Me,selectPrefixCls:Le,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ke,pageSize:lt,pageSizeOptions:ge,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:rt}))}}],[{key:"getDerivedStateFromProps",value:function(s,u){var _={};if("current"in s&&(_.current=s.current,s.current!==u.current&&(_.currentInputValue=_.current)),"pageSize"in s&&s.pageSize!==u.pageSize){var T=u.current,w=x(s.pageSize,u,s);T=T>w?w:T,"current"in s||(_.current=T,_.currentInputValue=T),_.pageSize=s.pageSize}return _}}]),g}(S.a.Component);E.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:n.a,style:{},itemRender:l,totalBoundaryShowSizeChanger:50};var y=E},"6RRn":function(Ye,se,k){"use strict";var Q=k("wCXF"),H=k("n6Qo");k.d(se,"b",function(){return H.a});var M=k("IBYe"),W=k("6eGT"),N=k("hW8S");k.d(se,"a",function(){return N.a}),se.c=Q.b},"6eGT":function(Ye,se,k){"use strict";function Q(H){return null}se.a=Q},"746U":function(Ye,se,k){"use strict";k.d(se,"d",function(){return H}),k.d(se,"j",function(){return M}),k.d(se,"i",function(){return W}),k.d(se,"h",function(){return N}),k.d(se,"e",function(){return A}),k.d(se,"k",function(){return F}),k.d(se,"l",function(){return U}),k.d(se,"a",function(){return S}),k.d(se,"f",function(){return d}),k.d(se,"g",function(){return v}),k.d(se,"m",function(){return C}),k.d(se,"c",function(){return f}),k.d(se,"b",function(){return n}),k.d(se,"n",function(){return r}),k.d(se,"o",function(){return o});var Q={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function H(l){return Array.isArray?Array.isArray(l):!!(l&&typeof l.length===Q.number&&l.constructor===Array)}function M(l){return typeof l===Q.string||l instanceof String}function W(l){return typeof l===Q.object&&l!==null&&!Array.isArray(l)&&!(l instanceof RegExp)&&!(l instanceof Date)}function N(l){return(typeof l===Q.number||l instanceof Number)&&!isNaN(l)}function A(l){return l===!0||l===!1}function F(l){return typeof l===Q.undefined}function U(l){return F(l)||l===null}function S(l,x){if(!l)throw new Error(x?"Unexpected type, expected '"+x+"'":"Unexpected type")}var L=Object.prototype.hasOwnProperty;function d(l){if(!W(l))return!1;for(var x in l)if(L.call(l,x))return!1;return!0}function v(l){return typeof l===Q.function}function C(l,x){for(var E=Math.min(l.length,x.length),y=0;y<E;y++)p(l[y],x[y])}function p(l,x){if(M(x)){if(typeof l!==x)throw new Error("argument does not match constraint: typeof "+x)}else if(v(x)){try{if(l instanceof x)return}catch(E){}if(!U(l)&&l.constructor===x)return;if(x.length===1&&x.call(void 0,l)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function h(l){for(var x=[],E=Object.getPrototypeOf(l);Object.prototype!==E;)x=x.concat(Object.getOwnPropertyNames(E)),E=Object.getPrototypeOf(E);return x}function f(l){for(var x=[],E=0,y=h(l);E<y.length;E++){var R=y[E];typeof l[R]=="function"&&x.push(R)}return x}function n(l,x){for(var E=function(m){return function(){var s=Array.prototype.slice.call(arguments,0);return x(m,s)}},y={},R=0,O=l;R<O.length;R++){var g=O[R];y[g]=E(g)}return y}function r(l){return l===null?void 0:l}function o(l){return typeof l=="undefined"?null:l}},"7Cbv":function(Ye,se,k){"use strict";var Q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),H=new Uint8Array(16);function M(){if(!Q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(H)}var W=/^(?:[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 N(C){return typeof C=="string"&&W.test(C)}for(var A=N,F=[],U=0;U<256;++U)F.push((U+256).toString(16).substr(1));function S(C){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=(F[C[p+0]]+F[C[p+1]]+F[C[p+2]]+F[C[p+3]]+"-"+F[C[p+4]]+F[C[p+5]]+"-"+F[C[p+6]]+F[C[p+7]]+"-"+F[C[p+8]]+F[C[p+9]]+"-"+F[C[p+10]]+F[C[p+11]]+F[C[p+12]]+F[C[p+13]]+F[C[p+14]]+F[C[p+15]]).toLowerCase();if(!A(h))throw TypeError("Stringified UUID is invalid");return h}var L=S;function d(C,p,h){C=C||{};var f=C.random||(C.rng||M)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,p){h=h||0;for(var n=0;n<16;++n)p[h+n]=f[n];return p}return L(f)}var v=se.a=d},"7ahc":function(Ye,se,k){"use strict";k.d(se,"a",function(){return x});var Q=k("k1fw"),H=k("0Owb"),M=k("+L6B"),W=k("2/Rp"),N=k("y8nQ"),A=k("Vl3Y"),F=k("tJVT"),U=k("OaEy"),S=k("2fM7"),L=k("q1tI"),d=k.n(L),v=k("VrN/"),C=k.n(v),p=k("p77/"),h=k.n(p),f=k("c5Ni"),n=k.n(f),r=S.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},l={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"]};se.b=function(E){var y=E.callback,R=E.onCancel,O=Object(L.useState)("python"),g=Object(F.a)(O,2),m=g[0],s=g[1];function u(T){s(l[T][1])}function _(T){y(T)}return d.a.createElement(A.a,Object(H.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),d.a.createElement(A.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(S.a,{onChange:u},Object.keys(l).map(function(T){return d.a.createElement(r,{key:T,value:T},l[T][0])}))),d.a.createElement(A.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(x,{mode:m})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(W.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function x(E){var y=E.value,R=E.onChange,O=E.mode,g=E.options,m=g===void 0?{}:g,s=Object(L.useRef)(),u=Object(L.useState)(),_=Object(F.a)(u,2),T=_[0],w=_[1];return Object(L.useEffect)(function(){if(T){function P(j){var K=j.getValue();R&&R(K)}return T.on("change",P),function(){T.off("change",P)}}},[T,R]),Object(L.useEffect)(function(){T&&T.setOption("mode",O)},[T,O]),Object(L.useEffect)(function(){T&&((y!==T.getValue()||y==="")&&setTimeout(function(){T.setValue(y||" ")},300))},[T,y]),Object(L.useEffect)(function(){if(s.current&&!T){var P=C.a.fromTextArea(s.current,Object(Q.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},m));w(P)}},[s.current,T]),d.a.createElement("div",{className:"my-codemirror-container"},d.a.createElement("textarea",{ref:s}))}},"7ixt":function(Ye,se,k){"use strict";k.d(se,"a",function(){return M});var Q={adjustX:1,adjustY:1},H=[0,0],M={left:{points:["cr","cl"],overflow:Q,offset:[-4,0],targetOffset:H},right:{points:["cl","cr"],overflow:Q,offset:[4,0],targetOffset:H},top:{points:["bc","tc"],overflow:Q,offset:[0,-4],targetOffset:H},bottom:{points:["tc","bc"],overflow:Q,offset:[0,4],targetOffset:H},topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-4],targetOffset:H},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0],targetOffset:H},topRight:{points:["br","tr"],overflow:Q,offset:[0,-4],targetOffset:H},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0],targetOffset:H},bottomRight:{points:["tr","br"],overflow:Q,offset:[0,4],targetOffset:H},rightBottom:{points:["bl","br"],overflow:Q,offset:[4,0],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,4],targetOffset:H},leftBottom:{points:["br","bl"],overflow:Q,offset:[-4,0],targetOffset:H}},W=M},"815F":function(Ye,se,k){"use strict";k.d(se,"e",function(){return F}),k.d(se,"c",function(){return S}),k.d(se,"d",function(){return L}),k.d(se,"a",function(){return v}),k.d(se,"f",function(){return C}),k.d(se,"b",function(){return p});var Q=k("KQm4"),H=k("VTBJ"),M=k("Ff2n"),W=k("Zm9Q"),N=k("Kwbf"),A=k("OZM5");function F(h,f){return h!=null?h:f}function U(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=new Map;function n(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(l){var x=l.key,E=l.children;Object(N.a)(x!=null,"Tree node must have a certain key: [".concat(o).concat(x,"]"));var y=String(x);Object(N.a)(!f.has(y)||x===null||x===void 0,"Same 'key' exist in the Tree: ".concat(y)),f.set(y,!0),n(E,"".concat(o).concat(y," > "))})}n(h)}function S(h){function f(n){var r=Object(W.a)(n);return r.map(function(o){if(!Object(A.i)(o))return Object(N.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var l=o.key,x=o.props,E=x.children,y=Object(M.a)(x,["children"]),R=Object(H.a)({key:l},y),O=f(E);return O.length&&(R.children=O),R}).filter(function(o){return o})}return f(h)}function L(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=new Set(f===!0?[]:f),r=[];function o(l){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return l.map(function(E,y){var R=Object(A.h)(x?x.pos:"0",y),O=F(E.key,R),g=Object(H.a)(Object(H.a)({},E),{},{parent:x,pos:R,children:null,data:E,isStart:[].concat(Object(Q.a)(x?x.isStart:[]),[y===0]),isEnd:[].concat(Object(Q.a)(x?x.isEnd:[]),[y===l.length-1])});return r.push(g),f===!0||n.has(O)?g.children=o(E.children||[],g):g.children=[],g})}return o(h),r}function d(h,f,n){var r;n?typeof n=="string"?r=function(x){return x[n]}:typeof n=="function"&&(r=function(x){return n(x)}):r=function(x,E){return F(x.key,E)};function o(l,x,E){var y=l?l.children:h,R=l?Object(A.h)(E.pos,x):"0";if(l){var O=r(l,R),g={node:l,index:x,pos:R,key:O,parentPos:E.node?E.pos:null,level:E.level+1};f(g)}y&&y.forEach(function(m,s){o(m,s,{node:l,pos:R,level:E?E.level+1:-1})})}o(null)}function v(h){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=f.initWrapper,r=f.processEntity,o=f.onProcessFinished,l=arguments.length>2?arguments[2]:void 0,x={},E={},y={posEntities:x,keyEntities:E};return n&&(y=n(y)||y),d(h,function(R){var O=R.node,g=R.index,m=R.pos,s=R.key,u=R.parentPos,_=R.level,T={node:O,index:g,key:s,pos:m,level:_},w=F(s,m);x[m]=T,E[w]=T,T.parent=x[u],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),r&&r(T,y)},l),o&&o(y),y}function C(h,f){var n=f.expandedKeys,r=f.selectedKeys,o=f.loadedKeys,l=f.loadingKeys,x=f.checkedKeys,E=f.halfCheckedKeys,y=f.dragOverNodeKey,R=f.dropPosition,O=f.keyEntities,g=O[h],m={eventKey:h,expanded:n.indexOf(h)!==-1,selected:r.indexOf(h)!==-1,loaded:o.indexOf(h)!==-1,loading:l.indexOf(h)!==-1,checked:x.indexOf(h)!==-1,halfChecked:E.indexOf(h)!==-1,pos:String(g?g.pos:""),dragOver:y===h&&R===0,dragOverGapTop:y===h&&R===-1,dragOverGapBottom:y===h&&R===1};return m}function p(h){var f=h.data,n=h.expanded,r=h.selected,o=h.checked,l=h.loaded,x=h.loading,E=h.halfChecked,y=h.dragOver,R=h.dragOverGapTop,O=h.dragOverGapBottom,g=h.pos,m=h.active,s=Object(H.a)(Object(H.a)({},f),{},{expanded:n,selected:r,checked:o,loaded:l,loading:x,halfChecked:E,dragOver:y,dragOverGapTop:R,dragOverGapBottom:O,pos:g,active:m});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(N.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),h}}),s}},"8EBN":function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){"use strict";Q.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 H=0;H<Q.modeInfo.length;H++){var M=Q.modeInfo[H];M.mimes&&(M.mime=M.mimes[0])}Q.findModeByMIME=function(W){W=W.toLowerCase();for(var N=0;N<Q.modeInfo.length;N++){var A=Q.modeInfo[N];if(A.mime==W)return A;if(A.mimes){for(var F=0;F<A.mimes.length;F++)if(A.mimes[F]==W)return A}}if(/\+xml$/.test(W))return Q.findModeByMIME("application/xml");if(/\+json$/.test(W))return Q.findModeByMIME("application/json")},Q.findModeByExtension=function(W){W=W.toLowerCase();for(var N=0;N<Q.modeInfo.length;N++){var A=Q.modeInfo[N];if(A.ext){for(var F=0;F<A.ext.length;F++)if(A.ext[F]==W)return A}}},Q.findModeByFileName=function(W){for(var N=0;N<Q.modeInfo.length;N++){var A=Q.modeInfo[N];if(A.file&&A.file.test(W))return A}var F=W.lastIndexOf("."),U=F>-1&&W.substring(F+1,W.length);if(U)return Q.findModeByExtension(U)},Q.findModeByName=function(W){W=W.toLowerCase();for(var N=0;N<Q.modeInfo.length;N++){var A=Q.modeInfo[N];if(A.name.toLowerCase()==W)return A;if(A.alias){for(var F=0;F<A.alias.length;F++)if(A.alias[F].toLowerCase()==W)return A}}}})},"8HAY":function(Ye,se,k){"use strict";k.d(se,"a",function(){return A}),k.d(se,"b",function(){return F});var Q=k("pmY6"),H=k("MI8n"),M=function(){var U=function(S,L){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,v){d.__proto__=v}||function(d,v){for(var C in v)v.hasOwnProperty(C)&&(d[C]=v[C])},U(S,L)};return function(S,L){U(S,L);function d(){this.constructor=S}S.prototype=L===null?Object.create(L):(d.prototype=L.prototype,new d)}}(),W=function(U,S,L,d){function v(C){return C instanceof L?C:new L(function(p){p(C)})}return new(L||(L=Promise))(function(C,p){function h(r){try{n(d.next(r))}catch(o){p(o)}}function f(r){try{n(d.throw(r))}catch(o){p(o)}}function n(r){r.done?C(r.value):v(r.value).then(h,f)}n((d=d.apply(U,S||[])).next())})},N=function(U,S){var L={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},d,v,C,p;return p={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function h(n){return function(r){return f([n,r])}}function f(n){if(d)throw new TypeError("Generator is already executing.");for(;L;)try{if(d=1,v&&(C=n[0]&2?v.return:n[0]?v.throw||((C=v.return)&&C.call(v),0):v.next)&&!(C=C.call(v,n[1])).done)return C;(v=0,C)&&(n=[n[0]&2,C.value]);switch(n[0]){case 0:case 1:C=n;break;case 4:return L.label++,{value:n[1],done:!1};case 5:L.label++,v=n[1],n=[0];continue;case 7:n=L.ops.pop(),L.trys.pop();continue;default:if(!(C=L.trys,C=C.length>0&&C[C.length-1])&&(n[0]===6||n[0]===2)){L=0;continue}if(n[0]===3&&(!C||n[1]>C[0]&&n[1]<C[3])){L.label=n[1];break}if(n[0]===6&&L.label<C[1]){L.label=C[1],C=n;break}if(C&&L.label<C[2]){L.label=C[2],L.ops.push(n);break}C[2]&&L.ops.pop(),L.trys.pop();continue}n=S.call(U,L)}catch(r){n=[6,r],v=0}finally{d=C=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}},A=function(U){M(S,U);function S(L,d,v,C,p){d===void 0&&(d=""),v===void 0&&(v=""),C===void 0&&(C=!0);var h=U.call(this)||this;return h._onDidChange=h._register(new H.a),h.onDidChange=h._onDidChange.event,h._enabled=!0,h._checked=!1,h._id=L,h._label=d,h._cssClass=v,h._enabled=C,h._actionCallback=p,h}return Object.defineProperty(S.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"label",{get:function(){return this._label},set:function(L){this._setLabel(L)},enumerable:!0,configurable:!0}),S.prototype._setLabel=function(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))},Object.defineProperty(S.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(L){this._setTooltip(L)},enumerable:!0,configurable:!0}),S.prototype._setTooltip=function(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))},Object.defineProperty(S.prototype,"class",{get:function(){return this._cssClass},set:function(L){this._setClass(L)},enumerable:!0,configurable:!0}),S.prototype._setClass=function(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))},Object.defineProperty(S.prototype,"enabled",{get:function(){return this._enabled},set:function(L){this._setEnabled(L)},enumerable:!0,configurable:!0}),S.prototype._setEnabled=function(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))},Object.defineProperty(S.prototype,"checked",{get:function(){return this._checked},set:function(L){this._setChecked(L)},enumerable:!0,configurable:!0}),S.prototype._setChecked=function(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))},S.prototype.run=function(L,d){return this._actionCallback?this._actionCallback(L):Promise.resolve(!0)},S}(Q.a),F=function(U){M(S,U);function S(){var L=U!==null&&U.apply(this,arguments)||this;return L._onDidBeforeRun=L._register(new H.a),L.onDidBeforeRun=L._onDidBeforeRun.event,L._onDidRun=L._register(new H.a),L.onDidRun=L._onDidRun.event,L}return S.prototype.run=function(L,d){return W(this,void 0,void 0,function(){var v,C;return N(this,function(p){switch(p.label){case 0:if(!L.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:L}),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.runAction(L,d)];case 2:return v=p.sent(),this._onDidRun.fire({action:L,result:v}),[3,4];case 3:return C=p.sent(),this._onDidRun.fire({action:L,error:C}),[3,4];case 4:return[2]}})})},S.prototype.runAction=function(L,d){var v=d?L.run(d):L.run();return Promise.resolve(v)},S}(Q.a)},"8hTe":function(Ye,se,k){Ye.exports={button:"button___1wy9m"}},"9Bee":function(Ye,se,k){"use strict";var Q=k("DYRE"),H=k("zeV3"),M=k("+L6B"),W=k("2/Rp"),N=k("k1fw"),A=k("9og8"),F=k("tJVT"),U=k("WmNS"),S=k.n(U),L=k("q1tI"),d=k.n(L),v=k("vg9a"),C=k("DlQD"),p=k.n(C),h=k("rUJ1");function f(z,b){var D=z.match(/^(\s+)(?:```)/);if(D===null)return b;var V=D[1];return b.split(`
|
|
`).map(function(J){var X=J.match(/^\s+/);if(X===null)return J;var Ee=Object(F.a)(X,1),et=Ee[0];return et.length>=V.length?J.slice(V.length):J}).join(`
|
|
`)}var n=[],r=["<ul>"],o=new p.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){n.length=0,r=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(z,b,D,V){if(b>=z.length||z[b].level<=D)return b;var J=z[b];V.push("<li><a href='#"+J.anchor+"'>"+J.text+"</a>"),b++;var X=[];return b=y(z,b,J.level,X),X.length>0&&(V.push("<ul>"),X.forEach(function(Ee){V.push(Ee)}),V.push("</ul>")),V.push("</li>"),b=y(z,b,D,V),b}function R(){return y(n,0,0,r),r.push("</ul>"),r.join("")}var O={heading:function(b){var D=l.exec(b);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},fences:function(b){var D=this.rules.block.fences.exec(b);if(D){var V=D[0],J=f(V,D[3]||""),X=D[2]?D[2].trim():D[2];if(["latex","katex","math"].indexOf(X)>=0){var Ee=s(),et=J;J=Ee,u[Ee]={type:"block",expression:et}}return{type:"code",raw:V,lang:X,text:J}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,m=0,s=function(){return"__special_katext_id_".concat(m++,"__")},u={};function _(){return u}function T(){m=0,u={}}function w(z){return z=z.replace(g,function(b,D){var V=s();return u[V]={type:"inline",expression:D},V}),z}var P=o.listitem;o.listitem=function(z){return P(w(z))};var j=o.paragraph;o.paragraph=function(z){return j(w(z))};var K=o.tablecell;o.tablecell=function(z,b){return K(w(z),b)},o.code=function(z,b,D){var V=(b||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(z,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(b,'">').concat(D?z:Object(h.escape)(z,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(D?z:Object(h.escape)(z,!0))+"</code></pre>"},o.heading=function(z,b,D){var V=this.options.headerPrefix+D.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return n.push({anchor:V,level:b,text:z}),"<h"+b+' id="'+V+'">'+z+"</h"+b+">"},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:O,renderer:o});var Z=p.a,G=k("SJMd"),B=k("ulZh"),$=k.n(B),ne=k("m3rI"),ae=k("Oy/b"),fe=k("p5ED"),_e=k("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Se=function(z,b){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,V){D.__proto__=V}||function(D,V){for(var J in V)Object.prototype.hasOwnProperty.call(V,J)&&(D[J]=V[J])})(z,b)};function we(z,b){function D(){this.constructor=z}Se(z,b),z.prototype=b===null?Object.create(b):(D.prototype=b.prototype,new D)}function Me(z,b,D,V){return new(D||(D=Promise))(function(J,X){function Ee(Rt){try{vt(V.next(Rt))}catch(at){X(at)}}function et(Rt){try{vt(V.throw(Rt))}catch(at){X(at)}}function vt(Rt){var at;Rt.done?J(Rt.value):(at=Rt.value,at instanceof D?at:new D(function(zt){zt(at)})).then(Ee,et)}vt((V=V.apply(z,b||[])).next())})}function Le(z,b){var D,V,J,X,Ee={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return X={next:et(0),throw:et(1),return:et(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function et(vt){return function(Rt){return function(at){if(D)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(D=1,V&&(J=2&at[0]?V.return:at[0]?V.throw||((J=V.return)&&J.call(V),0):V.next)&&!(J=J.call(V,at[1])).done)return J;switch(V=0,J&&(at=[2&at[0],J.value]),at[0]){case 0:case 1:J=at;break;case 4:return Ee.label++,{value:at[1],done:!1};case 5:Ee.label++,V=at[1],at=[0];continue;case 7:at=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(J=Ee.trys,(J=J.length>0&&J[J.length-1])||at[0]!==6&&at[0]!==2)){Ee=0;continue}if(at[0]===3&&(!J||at[1]>J[0]&&at[1]<J[3])){Ee.label=at[1];break}if(at[0]===6&&Ee.label<J[1]){Ee.label=J[1],J=at;break}if(J&&Ee.label<J[2]){Ee.label=J[2],Ee.ops.push(at);break}J[2]&&Ee.ops.pop(),Ee.trys.pop();continue}at=b.call(z,Ee)}catch(zt){at=[6,zt],V=0}finally{D=J=0}if(5&at[0])throw at[1];return{value:at[0]?at[1]:void 0,done:!0}}([vt,Rt])}}}function ge(){for(var z=0,b=0,D=arguments.length;b<D;b++)z+=arguments[b].length;var V=Array(z),J=0;for(b=0;b<D;b++)for(var X=arguments[b],Ee=0,et=X.length;Ee<et;Ee++,J++)V[J]=X[Ee];return V}var ue=function(){function z(){}return z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},z.setAttributes=function(b,D){for(var V=0,J=D;V<J.length;V++){var X=J[V],Ee=X[0],et=X[1];b.setAttribute(Ee,et)}},z.createRect=function(b,D,V){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",b.toString()),J.setAttribute("height",D.toString()),V&&z.setAttributes(J,V),J},z.createLine=function(b,D,V,J,X){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",b.toString()),Ee.setAttribute("y1",D.toString()),Ee.setAttribute("x2",V.toString()),Ee.setAttribute("y2",J.toString()),X&&z.setAttributes(Ee,X),Ee},z.createPolygon=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",b),D&&z.setAttributes(V,D),V},z.createCircle=function(b,D){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()),D&&z.setAttributes(V,D),V},z.createEllipse=function(b,D,V){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(b/2).toString()),J.setAttribute("cy",(D/2).toString()),J.setAttribute("rx",(b/2).toString()),J.setAttribute("ry",(D/2).toString()),V&&z.setAttributes(J,V),J},z.createGroup=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return b&&z.setAttributes(D,b),D},z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},z.createMarker=function(b,D,V,J,X,Ee,et){var vt=document.createElementNS("http://www.w3.org/2000/svg","marker");return z.setAttributes(vt,[["id",b],["orient",D],["markerWidth",V.toString()],["markerHeight",J.toString()],["refX",X.toString()],["refY",Ee.toString()]]),vt.appendChild(et),vt},z.createText=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),b&&z.setAttributes(D,b),D},z.createTSpan=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=b,D&&z.setAttributes(V,D),V},z.createImage=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return b&&z.setAttributes(D,b),D},z.createPoint=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=b,V.y=D,V},z.createPath=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",b),D&&z.setAttributes(V,D),V},z}(),ke=function(){function z(){}return z.addKey=function(b){z.key=b},Object.defineProperty(z,"isLicensed",{get:function(){return!!z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(z.key)},enumerable:!1,configurable:!0}),z}(),lt=function(){function z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return z.prototype.rasterize=function(b,D,V){var J=this;return new Promise(function(X){var Ee=V!==void 0?V:document.createElement("canvas");b===null&&(J.markersOnly=!0,J.naturalSize=!1);var et=document.createElementNS("http://www.w3.org/2000/svg","svg");et.setAttribute("xmlns","http://www.w3.org/2000/svg"),et.setAttribute("width",D.width.baseVal.valueAsString),et.setAttribute("height",D.height.baseVal.valueAsString),et.setAttribute("viewBox","0 0 "+D.viewBox.baseVal.width.toString()+" "+D.viewBox.baseVal.height.toString()),et.innerHTML=D.innerHTML,J.naturalSize===!0?(et.width.baseVal.value=b.naturalWidth,et.height.baseVal.value=b.naturalHeight):J.width!==void 0&&J.height!==void 0&&(et.width.baseVal.value=J.width,et.height.baseVal.value=J.height),Ee.width=et.width.baseVal.value,Ee.height=et.height.baseVal.value;var vt=et.outerHTML,Rt=Ee.getContext("2d");J.markersOnly!==!0&&Rt.drawImage(b,0,0,Ee.width,Ee.height);var at=window.URL,zt=new Image(Ee.width,Ee.height);zt.setAttribute("crossOrigin","anonymous");var Wt=new Blob([vt],{type:"image/svg+xml"}),yn=at.createObjectURL(Wt);zt.onload=function(){Rt.drawImage(zt,0,0),at.revokeObjectURL(yn);var Un=Ee.toDataURL(J.imageType,J.imageQuality);X(Un)},zt.src=yn})},z}(),ot=function(){},st=function(){function z(b){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+b+"_"}return Object.defineProperty(z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),z.prototype.addClass=function(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},z.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)},z.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 ce("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ce("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ce("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new pe("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new pe("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},z.prototype.removeStyleSheet=function(){var b;this.styleSheet&&(((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},z}(),ce=function(z,b){this.selector=z,this.style=b},pe=function(z,b){this.localName=z,this.style=b},Oe=function(){function z(b,D,V,J,X){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=b,this.displayMode=D,this.markerItems=V,this.uiStyleSettings=J,this.styles=X,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return z.prototype.show=function(b){var D=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(X){var Ee=document.createElement("div");Ee.className=""+D.toolbarButtonStyleClass.name,Ee.setAttribute("data-type-name",X.typeName),Ee.innerHTML=X.icon,Ee.addEventListener("click",function(){D.markerToolbarButtonClicked(Ee,X)}),D.buttons.push(Ee),D.markerButtons.push(Ee)}),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()},z.prototype.addButtonClickListener=function(b){this.buttonClickListeners.push(b)},z.prototype.removeButtonClickListener=function(b){this.buttonClickListeners.indexOf(b)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(b),1)},z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},z.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 D=0;D<this.markerButtons.length;D++)D<b||D===b&&this.markerButtons.length-1===b?this.markerButtonBlock.appendChild(this.markerButtons[D]):(D===b&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[D]))}},z.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},z.prototype.resetButtonStyles=function(){var b=this;this.buttons.forEach(function(D){D.className=D.className.replace(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name,"").trim(),D.className=D.className.replace(b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?b.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:b.toolbarActiveButtonStyleColorsClass.name,"").trim(),D.className+=" "+(b.uiStyleSettings.toolbarButtonStyleColorsClassName?b.uiStyleSettings.toolbarButtonStyleColorsClassName:b.toolbarButtonStyleColorsClass.name)})},z.prototype.addActionButton=function(b,D,V){var J=this,X=document.createElement("div");switch(X.className=""+this.toolbarButtonStyleClass.name,X.innerHTML=D,X.setAttribute("data-action",V),X.addEventListener("click",function(){J.actionToolbarButtonClicked(X,V)}),V){case"select":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":X.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":X.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":X.style.fill=this.uiStyleSettings.closeButtonColor}b.appendChild(X),this.buttons.push(X)},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new pe("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 pe("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pe("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new pe("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 pe("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var b=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pe("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 pe("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pe("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ce("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ce("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},z.prototype.markerToolbarButtonClicked=function(b,D){this.setActiveButton(b),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},z.prototype.actionToolbarButtonClicked=function(b,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},z.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)},z.prototype.setActiveMarkerButton=function(b){var D=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===b});D&&this.setActiveButton(D)},z.prototype.setCurrentMarker=function(b){var D=this;this.currentMarker=b,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){D.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},z}(),ze=function(){function z(b,D,V,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=b,this.displayMode=D,this.uiStyleSettings=V,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return z.prototype.addStyles=function(){var b;this.toolboxStyleClass=this.styles.addClass(new pe("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 pe("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new pe("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new pe("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new pe("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 pe("toolbox-panel-row_colors",`
|
|
background-color: `+((b=this.uiStyleSettings.toolboxBackgroundColor)!==null&&b!==void 0?b:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new pe("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
padding: `+D+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new pe("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new pe("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new ce("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ce("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},z.prototype.show=function(b){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=b,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},z.prototype.setPanelButtons=function(b){var D,V,J=this;this.panels=b,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((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(X){var Ee;X.uiStyleSettings=J.uiStyleSettings;var et=document.createElement("div");et.className=J.toolboxButtonStyleClass.name+" "+((Ee=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:J.toolboxButtonStyleColorsClass.name),et.innerHTML=X.icon,et.title=X.title,et.addEventListener("click",function(){J.panelButtonClick(X)}),J.panelButtons.push(et),J.buttonRow.appendChild(et)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},z.prototype.panelButtonClick=function(b){var D=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(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,Ee){var et,vt;X.className=D.toolboxButtonStyleClass.name+" "+(Ee===V?""+((et=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&et!==void 0?et:D.toolboxActiveButtonStyleColorsClass.name):""+((vt=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&vt!==void 0?vt:D.toolboxButtonStyleColorsClass.name))})},z}(),qe=function(z,b){this.title=z,this.icon=b},Je=function(z){function b(D,V,J,X){var Ee=z.call(this,D,X||'<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 Ee.colors=[],Ee.addTransparent=!1,Ee.colorBoxes=[],Ee.colors=V,Ee.currentColor=J,Ee.setCurrentColor=Ee.setCurrentColor.bind(Ee),Ee.getColorBox=Ee.getColorBox.bind(Ee),Ee}return we(b,z),b.prototype.getUi=function(){var D=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(J){var X=D.getColorBox(J);V.appendChild(X),D.colorBoxes.push(X)}),V},b.prototype.getColorBox=function(D){var V=this,J=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-J,Ee=document.createElement("div");Ee.style.display="inline-block",Ee.style.boxSizing="content-box",Ee.style.width=X-2+"px",Ee.style.height=X-2+"px",Ee.style.padding="1px",Ee.style.marginRight="2px",Ee.style.marginBottom="2px",Ee.style.borderWidth="2px",Ee.style.borderStyle="solid",Ee.style.borderRadius=(X+2)/2+"px",Ee.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ee.addEventListener("click",function(){V.setCurrentColor(D,Ee)});var et=document.createElement("div");return et.style.display="inline-block",et.style.width=X-2+"px",et.style.height=X-2+"px",et.style.backgroundColor=D,et.style.borderRadius=X/2+"px",D==="transparent"&&(et.style.fill=this.uiStyleSettings.toolboxAccentColor,et.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>`),Ee.appendChild(et),Ee},b.prototype.setCurrentColor=function(D,V){var J=this;this.currentColor=D,this.colorBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},b}(qe),rt=function(){function z(b,D,V){this._state="new",this._isSelected=!1,this._container=b,this._overlayContainer=D,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(b){return!1},Object.defineProperty(z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},z.prototype.pointerDown=function(b,D){},z.prototype.dblClick=function(b,D){},z.prototype.manipulate=function(b){},z.prototype.pointerUp=function(b){this.stateChanged()},z.prototype.dispose=function(){},z.prototype.addMarkerVisualToContainer=function(b){this.container.childNodes.length>0?this.container.insertBefore(b,this.container.childNodes[0]):this.container.appendChild(b)},z.prototype.getState=function(){return{typeName:z.typeName,state:this.state,notes:this.notes}},z.prototype.restoreState=function(b){this._state=b.state,this.notes=b.notes},z.prototype.scale=function(b,D){},z.prototype.colorChanged=function(b){this.onColorChanged&&this.onColorChanged(b),this.stateChanged()},z.prototype.fillColorChanged=function(b){this.onFillColorChanged&&this.onFillColorChanged(b),this.stateChanged()},z.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)}},z.typeName="MarkerBase",z}(),tt=function(){function z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return z.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},z}(),Tt=function(){function z(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(b){return b===this.visual||b===this.visual.childNodes[0]||b===this.visual.childNodes[1]},z}(),bt=function(){function z(){}return z.toITransformMatrix=function(b){return{a:b.a,b:b.b,c:b.c,d:b.d,e:b.e,f:b.f}},z.toSVGMatrix=function(b,D){return b.a=D.a,b.b=D.b,b.c=D.c,b.d=D.d,b.e=D.e,b.f=D.f,b},z}(),Et=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.left=0,X.top=0,X.width=0,X.height=0,X.defaultSize={x:50,y:20},X.offsetX=0,X.offsetY=0,X.rotationAngle=0,X.CB_DISTANCE=10,X._suppressMarkerCreateEvent=!1,X.container.transform.baseVal.appendItem(ue.createTransform()),X.setupControlBox(),X}return we(b,z),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(D){this._visual=D;var V=ue.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(D){return!!z.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},b.prototype.pointerDown=function(D,V){z.prototype.pointerDown.call(this,D,V),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(D);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 X=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=X.x-this.width/2,this.top=X.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ee=this.container.transform.baseVal.getItem(0);Ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},b.prototype.pointerUp=function(D){var V=this.state;z.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},b.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},b.prototype.manipulate=function(D){var V=this.unrotatePoint(D);this.state==="creating"?this.resize(D):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(D)},b.prototype.resize=function(D){var V=this.manipulationStartLeft,J=this.manipulationStartWidth,X=this.manipulationStartTop,Ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+D.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+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+D.y-this.manipulationStartY,Ee=this.manipulationStartHeight+this.manipulationStartTop-X;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ee=this.manipulationStartHeight+D.y-this.manipulationStartY}J>=0?(this.left=V,this.width=J):(this.left=V+J,this.width=-J),Ee>=0?(this.top=X,this.height=Ee):(this.top=X+Ee,this.height=-Ee),this.setSize()},b.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},b.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var V=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},b.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},b.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var V=this.container.getCTM(),J=ue.createPoint(D.x,D.y);return{x:(J=J.matrixTransform(V)).x,y:J.y}},b.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var V=this.container.getCTM();V=V.inverse();var J=ue.createPoint(D.x,D.y);return{x:(J=J.matrixTransform(V)).x,y:J.y}},b.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var D=ue.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 tt,this.addControlGrips(),this.controlBox.style.display="none"},b.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},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 D=new Tt;return D.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(D.visual),D},b.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,V=-D/2,J=V,X=(this.width+this.CB_DISTANCE)/2-D/2,Ee=(this.height+this.CB_DISTANCE)/2-D/2,et=this.height+this.CB_DISTANCE-D/2,vt=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,V,J),this.positionGrip(this.controlGrips.topCenter.visual,X,J),this.positionGrip(this.controlGrips.topRight.visual,vt,J),this.positionGrip(this.controlGrips.centerLeft.visual,V,Ee),this.positionGrip(this.controlGrips.centerRight.visual,vt,Ee),this.positionGrip(this.controlGrips.bottomLeft.visual,V,et),this.positionGrip(this.controlGrips.bottomCenter.visual,X,et),this.positionGrip(this.controlGrips.bottomRight.visual,vt,et),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,J-3*this.CB_DISTANCE)},b.prototype.positionGrip=function(D,V,J){var X=D.transform.baseVal.getItem(0);X.setTranslate(V,J),D.transform.baseVal.replaceItem(X,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:bt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:bt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},z.prototype.getState.call(this))},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D);var V=D;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(bt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(bt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,V);var J=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:J.x*D,y:J.y*V});this.left=X.x,this.top=X.y,this.width=this.width*D,this.height=this.height*V,this.adjustControlBox()},b}(rt),yt=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.createVisual=X.createVisual.bind(X),X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.visual)},b.prototype.createVisual=function(){this.visual=ue.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(D,V){z.prototype.pointerDown.call(this,D,V),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},b.prototype.manipulate=function(D){z.prototype.manipulate.call(this,D)},b.prototype.resize=function(D){z.prototype.resize.call(this,D),this.setSize()},b.prototype.setSize=function(){z.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(D){z.prototype.pointerUp.call(this,D),this.setSize()},b.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},b.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},b.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ue.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},z.prototype.getState.call(this))},b.prototype.restoreState=function(D){var V=D;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),z.prototype.restoreState.call(this,D),this.setSize()},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,V),this.setSize()},b.title="Rectangle marker",b}(Et),Ot=function(z){function b(D,V,J,X){var Ee=z.call(this,D,X||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ee.widths=[],Ee.widthBoxes=[],Ee.widths=V,Ee.currentWidth=J,Ee.setCurrentWidth=Ee.setCurrentWidth.bind(Ee),Ee}return we(b,z),b.prototype.getUi=function(){var D=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.flexGrow="2",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){D.setCurrentWidth(J,X)}),V.appendChild(X);var Ee=document.createElement("div");Ee.innerText=J.toString(),Ee.style.marginRight="5px",X.appendChild(Ee);var et=document.createElement("div");et.style.minHeight="20px",et.style.flexGrow="2",et.style.display="flex",et.style.alignItems="center";var vt=document.createElement("hr");vt.style.minWidth="20px",vt.style.border="0px",vt.style.borderTop=J+"px solid "+D.uiStyleSettings.toolboxColor,vt.style.flexGrow="2",et.appendChild(vt),X.appendChild(et),D.widthBoxes.push(X)}),V},b.prototype.setCurrentWidth=function(D,V){var J=this;this.currentWidth=D,this.widthBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},b}(qe),At=function(z){function b(D,V,J,X){var Ee=z.call(this,D,X||'<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 Ee.styles=[],Ee.styleBoxes=[],Ee.styles=V,Ee.currentStyle=J,Ee.setCurrentStyle=Ee.setCurrentStyle.bind(Ee),Ee}return we(b,z),b.prototype.getUi=function(){var D=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/D.styles.length-5+"%",X.style.borderColor=J===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){D.setCurrentStyle(J,X)}),V.appendChild(X);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.overflow="hidden";var et=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+D.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(J!==""?'stroke-dasharray="'+J+'"':"")+` />
|
|
</svg>`;Ee.innerHTML=et,X.appendChild(Ee),D.styleBoxes.push(X)}),V},b.prototype.setCurrentStyle=function(D,V){var J=this;this.currentStyle=D,this.styleBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},b}(qe),Ae=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new Je("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new Ot("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new At("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return we(b,z),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var D=z.prototype.getState.call(this);return D.typeName=b.typeName,D},b.typeName="FrameMarker",b.title="Frame marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',b}(yt),xe=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},Be=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.x1=0,X.y1=0,X.x2=0,X.y2=0,X.defaultLength=50,X.manipulationStartX=0,X.manipulationStartY=0,X.manipulationStartX1=0,X.manipulationStartY1=0,X.manipulationStartX2=0,X.manipulationStartY2=0,X.setupControlBox(),X}return we(b,z),b.prototype.ownsTarget=function(D){return!!z.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},b.prototype.pointerDown=function(D,V){z.prototype.pointerDown.call(this,D,V),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(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(D){var V=this.state;z.prototype.pointerUp.call(this,D),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(D),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},b.prototype.adjustVisual=function(){},b.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},b.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},b.prototype.select=function(){z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},b.prototype.deselect=function(){z.prototype.deselect.call(this),this.controlBox.style.display="none"},b.prototype.setupControlBox=function(){this.controlBox=ue.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 D=new Tt;return D.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(D.visual),D},b.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},b.prototype.positionGrip=function(D,V,J){var X=D.transform.baseVal.getItem(0);X.setTranslate(V,J),D.transform.baseVal.replaceItem(X,0)},b.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},z.prototype.getState.call(this))},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D);var V=D;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,V),this.x1=this.x1*D,this.y1=this.y1*V,this.x2=this.x2*D,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},b}(rt),Ze=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new Je("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new Ot("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new At("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},b.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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(D,V){z.prototype.pointerDown.call(this,D,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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},b.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},b.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,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 D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D);var V=D;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}(Be),Pe=function(z){function b(D,V,J,X){var Ee=z.call(this,D,X||'<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 Ee.fonts=[],Ee.fontBoxes=[],Ee.fonts=V,Ee.currentFont=J,Ee.setCurrentFont=Ee.setCurrentFont.bind(Ee),Ee}return we(b,z),b.prototype.getUi=function(){var D=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(J){var X=document.createElement("div");X.style.display="inline-block",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/D.fonts.length-5+"%",X.style.borderColor=J===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){D.setCurrentFont(J,X)}),V.appendChild(X);var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.fontFamily=J,Ee.style.overflow="hidden";var et=document.createElement("div");et.style.whiteSpace="nowrap",et.style.overflow="hidden",et.style.textOverflow="ellipsis",et.innerHTML="The quick brown fox jumps over the lazy dog",Ee.appendChild(et),X.appendChild(Ee),D.fontBoxes.push(X)}),V},b.prototype.setCurrentFont=function(D,V){var J=this;this.currentFont=D,this.fontBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},b}(qe),Xe=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=J.defaultColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setColor=X.setColor.bind(X),X.setFont=X.setFont.bind(X),X.renderText=X.renderText.bind(X),X.sizeText=X.sizeText.bind(X),X.textEditDivClicked=X.textEditDivClicked.bind(X),X.showTextEditor=X.showTextEditor.bind(X),X.setSize=X.setSize.bind(X),X.positionTextEditor=X.positionTextEditor.bind(X),X.colorPanel=new Je("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new Pe("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return we(b,z),b.prototype.ownsTarget=function(D){if(z.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(J){J===D&&(V=!0)}),V},b.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},b.prototype.pointerDown=function(D,V){z.prototype.pointerDown.call(this,D,V),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},b.prototype.renderText=function(){var D=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(V){D.textElement.appendChild(ue.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},b.prototype.getTextScale=function(){var D=this.textElement.getBBox(),V=1;if(D.width>0&&D.height>0){var J=(1*this.width-this.width*this.padding*2/100)/D.width,X=(1*this.height-this.height*this.padding*2/100)/D.height;V=Math.min(J,X)}return V},b.prototype.getTextPosition=function(D){var V=this.textElement.getBBox(),J=0,X=0;return V.width>0&&V.height>0&&(J=(this.width-V.width*D)/2,X=this.height/2-V.height*D/2),{x:J,y:X}},b.prototype.sizeText=function(){var D=this.textElement.getBBox(),V=this.getTextScale(),J=this.getTextPosition(V);J.y-=D.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(D){z.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},b.prototype.resize=function(D){z.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},b.prototype.setSize=function(){z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},b.prototype.pointerUp=function(D){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),z.prototype.pointerUp.call(this,D),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},b.prototype.showTextEditor=function(){var D=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&V>.9;)V-=.1,D.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"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(J)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},b.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),X={x:J.width*D,y:J.height*D};V.x-=X.x/2,V.y-=X.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*D,12)+"px",this.textElement.style.display="none"}},b.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},b.prototype.select=function(){z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},b.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),z.prototype.deselect.call(this)},b.prototype.dblClick=function(D,V){z.prototype.dblClick.call(this,D,V),this.showTextEditor()},b.prototype.setColor=function(D){this.textElement&&ue.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},b.prototype.setFont=function(D){this.textElement&&ue.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,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 D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){var V=D;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),z.prototype.restoreState.call(this,D),this.setSize()},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,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}(Et),be=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=J.defaultColor,X.lineWidth=J.defaultStrokeWidth,X.pixelRatio=J.freehandPixelRatio,X.setColor=X.setColor.bind(X),X.addCanvas=X.addCanvas.bind(X),X.finishCreation=X.finishCreation.bind(X),X.setLineWidth=X.setLineWidth.bind(X),X.colorPanel=new Je("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new Ot("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},b.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var D=ue.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},b.prototype.pointerDown=function(D,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(D.x,D.y),this.drawing=!0):z.prototype.pointerDown.call(this,D,V)},b.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):z.prototype.manipulate.call(this,D)},b.prototype.resize=function(D){z.prototype.resize.call(this,D),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},b.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):z.prototype.pointerUp.call(this,D)},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(),z.prototype.select.call(this)},b.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),z.prototype.deselect.call(this)},b.prototype.finishCreation=function(){for(var D=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],X=V[1],Ee=V[2],et=V[3],vt=!1,Rt=0;Rt<this.canvasElement.height;Rt++)for(var at=0;at<this.canvasElement.width;at++)D.data[Rt*this.canvasElement.width*4+4*at+3]>0&&(vt=!0,Rt<X&&(X=Rt),at<J&&(J=at),Rt>et&&(et=Rt),at>Ee&&(Ee=at));if(vt){this.left=J/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(Ee-J)/this.pixelRatio,this.height=(et-X)/this.pixelRatio;var zt=document.createElement("canvas");zt.width=Ee-J,zt.height=et-X,zt.getContext("2d").putImageData(this.canvasContext.getImageData(J,X,Ee-J,et-X),0,0),this.drawingImgUrl=zt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},b.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},b.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},b.prototype.setLineWidth=function(D){this.lineWidth=D},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 D=Object.assign({drawingImgUrl:this.drawingImgUrl},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){this.createVisual(),z.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,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}(Et),de=function(z){function b(D,V,J){var X=z.call(this,D,J||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return X.typeBoxes=[],X.currentType=V,X.setCurrentType=X.setCurrentType.bind(X),X}return we(b,z),b.prototype.getUi=function(){var D=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var J=function(et){var vt="both";switch(et){case 0:vt="both";break;case 1:vt="start";break;case 2:vt="end";break;case 3:vt="none"}var Rt=document.createElement("div");if(Rt.style.display="flex",Rt.style.flexGrow="2",Rt.style.alignItems="center",Rt.style.justifyContent="space-between",Rt.style.padding="5px",Rt.style.borderWidth="2px",Rt.style.borderStyle="solid",Rt.style.borderColor=vt===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",Rt.addEventListener("click",function(){D.setCurrentType(vt,Rt)}),V.appendChild(Rt),vt==="both"||vt==="start"){var at=document.createElement("div");at.style.display="flex",at.style.alignItems="center",at.style.minHeight="20px",at.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,at.style.marginLeft="5px",Rt.appendChild(at)}var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.style.flexGrow="2";var Wt=document.createElement("hr");if(Wt.style.minWidth="20px",Wt.style.border="0px",Wt.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),Wt.style.flexGrow="2",zt.appendChild(Wt),Rt.appendChild(zt),vt==="both"||vt==="end"){var yn=document.createElement("div");yn.style.display="flex",yn.style.alignItems="center",yn.style.minHeight="20px",yn.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,yn.style.marginRight="5px",Rt.appendChild(yn)}X.typeBoxes.push(Rt)},X=this,Ee=0;Ee<4;Ee++)J(Ee);return V},b.prototype.setCurrentType=function(D,V){var J=this;this.currentType=D,this.typeBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},b}(qe),he=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.arrowType="end",X.arrowBaseHeight=10,X.arrowBaseWidth=10,X.getArrowPoints=X.getArrowPoints.bind(X),X.setArrowType=X.setArrowType.bind(X),X.arrowTypePanel=new de("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},b.prototype.getArrowPoints=function(D,V){var J=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return D-J/2+","+(V+X/2)+" "+D+","+(V-X/2)+" "+(D+J/2)+","+(V+X/2)},b.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},b.prototype.pointerDown=function(D,V){z.prototype.pointerDown.call(this,D,V),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},b.prototype.setArrowType=function(D){this.arrowType=D,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 D=Object.assign({arrowType:this.arrowType},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D);var V=D;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}(Ze),re=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.fillColor=J.defaultFillColor,X.strokeWidth=0,X.fillPanel=new Je("Color",J.defaultColorSet,J.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return we(b,z),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var D=z.prototype.getState.call(this);return D.typeName=b.typeName,D},b.typeName="CoverMarker",b.title="Cover marker",b.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',b}(yt),ie=function(z){function b(D,V,J,X){var Ee=z.call(this,D,X||'<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 Ee.opacities=[],Ee.opacityBoxes=[],Ee.opacities=V,Ee.currentOpacity=J,Ee.setCurrentOpacity=Ee.setCurrentOpacity.bind(Ee),Ee}return we(b,z),b.prototype.getUi=function(){var D=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 X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="center",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){D.setCurrentOpacity(J,X)}),V.appendChild(X);var Ee=document.createElement("div");Ee.innerText=100*J+"%",X.appendChild(Ee),D.opacityBoxes.push(X)}),V},b.prototype.setCurrentOpacity=function(D,V){var J=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===V?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},b}(qe),le=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=J.defaultHighlightColor,X.strokeWidth=0,X.opacity=J.defaultHighlightOpacity,X.fillPanel=new Je("Color",J.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return we(b,z),b.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ue.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 D=z.prototype.getState.call(this);return D.typeName=b.typeName,D},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),me='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',De=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.bgColor="transparent",X.tipPosition={x:0,y:0},X.tipBase1Position={x:0,y:0},X.tipBase2Position={x:0,y:0},X.tipMoving=!1,X.color=J.defaultStrokeColor,X.bgColor=J.defaultFillColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setBgColor=X.setBgColor.bind(X),X.getTipPoints=X.getTipPoints.bind(X),X.positionTip=X.positionTip.bind(X),X.setTipPoints=X.setTipPoints.bind(X),X.colorPanel=new Je("Text color",J.defaultColorSet,X.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>'),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new Je("Fill color",J.defaultColorSet,X.bgColor,me),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new Pe("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new Tt,X.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return we(b,z),b.prototype.ownsTarget=function(D){return z.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},b.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},b.prototype.pointerDown=function(D,V){this.state==="new"&&z.prototype.pointerDown.call(this,D,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):z.prototype.pointerDown.call(this,D,V)},b.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,z.prototype.pointerUp.call(this,D);else{var V=this.state==="creating";z.prototype.pointerUp.call(this,D),this.setTipPoints(V),this.positionTip()}},b.prototype.manipulate=function(D){if(this.tipMoving){var V=this.unrotatePoint(D);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else z.prototype.manipulate.call(this,D)},b.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",D]]),ue.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},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(D){D===void 0&&(D=!1);var V=Math.min(this.height/2,15),J=this.height/5;D&&(this.tipPosition={x:V+J/2,y:this.height+20});var X=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?X<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?X<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?X<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}):X<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(D){z.prototype.resize.call(this,D),this.positionTip()},b.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var D=this.tipGrip.visual.transform.baseVal.getItem(0);D.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(D,0)},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),b.prototype.select=function(){this.positionTip(),z.prototype.select.call(this)},b.prototype.getState=function(){var D=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){var V=D;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,z.prototype.restoreState.call(this,D),this.createTip(),this.setTipPoints()},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,V),this.tipPosition={x:this.tipPosition.x*D,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}(Xe),Te=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.fillColor=J.defaultFillColor,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.setOpacity=X.setOpacity.bind(X),X.createVisual=X.createVisual.bind(X),X.strokePanel=new Je("Line color",ge(J.defaultColorSet,["transparent"]),J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.fillPanel=new Je("Fill color",ge(J.defaultColorSet,["transparent"]),X.fillColor,me),X.fillPanel.onColorChanged=X.setFillColor,X.strokeWidthPanel=new Ot("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new At("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X.opacityPanel=new ie("Opacity",J.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.visual)},b.prototype.createVisual=function(){this.visual=ue.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(D,V){z.prototype.pointerDown.call(this,D,V),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},b.prototype.manipulate=function(D){z.prototype.manipulate.call(this,D)},b.prototype.resize=function(D){z.prototype.resize.call(this,D),this.setSize()},b.prototype.setSize=function(){z.prototype.setSize.call(this),ue.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(D){z.prototype.pointerUp.call(this,D),this.setSize()},b.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},b.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(D),this.stateChanged()},b.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},b.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},b.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ue.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 D=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){var V=D;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),z.prototype.restoreState.call(this,D),this.setSize()},b.prototype.scale=function(D,V){z.prototype.scale.call(this,D,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}(Et),Qe=function(z){function b(D,V,J){return z.call(this,D,V,J)||this}return we(b,z),Object.defineProperty(b.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.tip1&&D!==this.tip2)},b.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},b.prototype.pointerDown=function(D,V){z.prototype.pointerDown.call(this,D,V),this.state==="creating"&&this.createTips()},b.prototype.adjustVisual=function(){if(z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(D+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 D=z.prototype.getState.call(this);return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D),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}(Ze),ct=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.strokePanel.colors=J.defaultColorSet,X.fillColor="transparent",X}return we(b,z),Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var D=z.prototype.getState.call(this);return D.typeName=b.typeName,D},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}(Te),xt=function(){function z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),z.prototype.addUndoStep=function(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))},z.prototype.replaceLastUndoStep=function(b){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=b)},z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},z.prototype.undo=function(){if(this.undoStack.length>1){var b=this.undoStack.pop();return b!==void 0&&this.redoStack.push(b),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},z}(),ft=function(z){function b(D,V,J){var X=z.call(this,D,V,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.curveX=0,X.curveY=0,X.manipulationStartCurveX=0,X.manipulationStartCurveY=0,X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.positionGrips=X.positionGrips.bind(X),X.addControlGrips=X.addControlGrips.bind(X),X.adjustVisual=X.adjustVisual.bind(X),X.setupControlBox=X.setupControlBox.bind(X),X.resize=X.resize.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new Je("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new Ot("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new At("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return we(b,z),b.prototype.ownsTarget=function(D){return!(!z.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},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=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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(D,V){z.prototype.pointerDown.call(this,D,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(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()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},b.prototype.setupControlBox=function(){z.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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,z.prototype.addControlGrips.call(this)},b.prototype.positionGrips=function(){z.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},b.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),z.prototype.manipulate.call(this,D)},b.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),z.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},b.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},b.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},b.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},b.prototype.scale=function(D,V){this.curveX=this.curveX*D,this.curveY=this.curveY*V,z.prototype.scale.call(this,D,V)},Object.defineProperty(b.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),b.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},z.prototype.getState.call(this));return D.typeName=b.typeName,D},b.prototype.restoreState=function(D){z.prototype.restoreState.call(this,D);var V=D;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}(Be),ut=function(){function z(b,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=b,this.cancelable=D}return Object.defineProperty(z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),z.prototype.preventDefault=function(){this._defaultPrevented=!0},z}(),$e=function(z){function b(D,V,J){var X=z.call(this,D,!1)||this;return X.dataUrl=V,X.state=J,X}return we(b,z),b}(ut),Ve=function(z){function b(D,V,J){J===void 0&&(J=!1);var X=z.call(this,D,J)||this;return X.marker=V,X}return we(b,z),b}(ut),Ne=function(){function z(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return z.prototype.addEventListener=function(b,D){this[b].push(D)},z.prototype.removeEventListener=function(b,D){var V=this[b].indexOf(D);V>-1&&this[b].splice(V,1)},z}(),oe=function(){function z(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 xe,this._isOpen=!1,this.undoRedoManager=new xt,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 Ne,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=z.instanceCounter++,this.styles=new st(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(z.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ae,be,he,Xe,ct,Te,le,De,Qe,re,Ze,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ae,be,he,Xe,Te,le,De]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ae,be,he,Xe,le]},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(b){var D=this;this._availableMarkerTypes.splice(0),b.forEach(function(V){if(typeof V=="string"){var J=D.ALL_MARKER_TYPES.find(function(X){return X.typeName===V});J!==void 0&&D._availableMarkerTypes.push(J)}else D._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},z.prototype.show=function(){var b=this;this.styles.styleSheetRoot===void 0&&ot.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ot.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new ut(b))})},z.prototype.render=function(){return Me(this,void 0,void 0,function(){var b;return Le(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(b=new lt).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 D.sent(),[4,b.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},z.prototype.close=function(b){var D=this;if(b===void 0&&(b=!1),this.isOpen){var V=!1;b||this.eventListeners.beforeclose.forEach(function(J){var X=new ut(D,!0);J(X),X.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 ut(D))}),this.detachEvents(),this._isOpen=!1)}},z.prototype.addMarkersToToolbar=function(){for(var b,D=[],V=0;V<arguments.length;V++)D[V]=arguments[V];(b=this._availableMarkerTypes).push.apply(b,D)},z.prototype.addRenderEventListener=function(b){this.addEventListener("render",function(D){b(D.dataUrl,D.state)})},z.prototype.removeRenderEventListener=function(b){},z.prototype.addCloseEventListener=function(b){this.addEventListener("close",function(){b()})},z.prototype.removeCloseEventListener=function(b){},z.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))},z.prototype.onPopupTargetResize=function(){var b=1*this.target.clientWidth/this.target.clientHeight,D=this.editorCanvas.clientWidth/b>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*b:this.editorCanvas.clientWidth,V=D<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/b;this.resize(D,V)},z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},z.prototype.resize=function(b,D){this._isResizing=!0;var V=b/this.imageWidth,J=D/this.imageHeight;this.imageWidth=Math.round(b),this.imageHeight=Math.round(D),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(V,J),this._isResizing=!1},z.prototype.scaleMarkers=function(b,D){var V,J=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(b,D):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(X){X!==J._currentMarker&&X.scale(b,D)}),V!==void 0&&this.setCurrentMarker(V)},z.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},z.prototype.setTopLeft=function(){var b=this.editingTarget.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=b.left-D.left,this.top=b.top-D.top},z.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},z.prototype.addDefs=function(){for(var b,D=[],V=0;V<arguments.length;V++)D[V]=arguments[V];this.defs=ue.createDefs(),this.addDefsToImage(),(b=this.defs).append.apply(b,D)},z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},z.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},z.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},z.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var 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()},z.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var 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 Oe(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 ze(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.removeMarker=function(b){this.markerImage.removeChild(b.container),this.markers.indexOf(b)>-1&&this.markers.splice(this.markers.indexOf(b),1),b.dispose()},z.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},z.prototype.toolbarButtonClicked=function(b,D){if(b==="marker"&&D!==void 0)this.createNewMarker(D);else if(b==="action")switch(D){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},z.prototype.deleteSelectedMarker=function(){var b=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var X=new Ve(b,b._currentMarker,!0);J(X),X.defaultPrevented&&(D=!0)}),!D){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 Ve(b,V))})}}},z.prototype.clear=function(){var b=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ee){var et=new Ve(b,void 0,!0);Ee(et),et.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var V=function(Ee){var et=J.markers[Ee];J.setCurrentMarker(J.markers[Ee]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(vt){return vt(new Ve(b,et))})},J=this,X=this.markers.length-1;X>=0;X--)V(X);this.addUndoStep()}},Object.defineProperty(z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),z.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))},z.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},z.prototype.addUndoStep=function(){var b=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===D.width&&V.height===D.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),J<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(X){return X(new ut(b))})}else this.undoRedoManager.replaceLastUndoStep(D),this.eventListeners.statechange.forEach(function(X){return X(new ut(b))})}},z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},z.prototype.undoStep=function(){var b=this,D=this.undoRedoManager.undo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new ut(b))}))},z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},z.prototype.redoStep=function(){var b=this,D=this.undoRedoManager.redo();D!==void 0&&(this.restoreState(D),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new ut(b))}))},z.prototype.stepZoom=function(){var b=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=b<this.zoomSteps.length-1?this.zoomSteps[b+1]:this.zoomSteps[0]},z.prototype.panTo=function(b){this.contentDiv.scrollBy({left:this.prevPanPoint.x-b.x,top:this.prevPanPoint.y-b.y}),this.prevPanPoint=b},z.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var b,D,V=this;return Le(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return b=J.sent(),D=this.getState(),this.eventListeners.render.forEach(function(X){return X(new $e(V,b,D))}),this.close(!0),[2]}})})},z.prototype.getState=function(b){b===!0&&this.setCurrentMarker();var D={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return D.markers.push(V.getState())}),D},z.prototype.restoreState=function(b){var D=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);b.markers.forEach(function(V){var J=D._availableMarkerTypes.find(function(Ee){return Ee.typeName===V.typeName});if(J!==void 0){var X=D.addNewMarker(J);X.restoreState(V),D.markers.push(X)}}),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 ut(D))})},z.prototype.addNewMarker=function(b){var D=ue.createGroup();return this.markerImage.appendChild(D),new b(D,this.overlayContainer,this.settings)},z.prototype.createNewMarker=function(b){var D,V=this;(D=typeof b=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===b}):b)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(D),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(D.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(J){return J(new Ve(V,V._currentMarker))}))},z.prototype.markerCreated=function(b){var D=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(b),this.setCurrentMarker(b),b instanceof be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new Ve(D,D._currentMarker))})},z.prototype.colorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=b,this.settings.defaultStrokeColor=b)},z.prototype.fillColorChanged=function(b){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=b)},z.prototype.markerStateChanged=function(b){var D=this;this.eventListeners.markerchange.forEach(function(V){return V(new Ve(D,b))})},z.prototype.setCurrentMarker=function(b){var D=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 Ve(D,D._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 Ve(D,D._currentMarker))}))},z.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 D=this.markers.find(function(V){return V.ownsTarget(b.target)});D!==void 0?(this.setCurrentMarker(D),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))},z.prototype.onDblClick=function(b){if(this._isFocused||this.focus(),this.mode==="select"){var D=this.markers.find(function(V){return V.ownsTarget(b.target)});D!==void 0&&D!==this._currentMarker&&this.setCurrentMarker(D),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(b.clientX,b.clientY),b.target):this.setCurrentMarker()}},z.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}))},z.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()},z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},z.prototype.onKeyUp=function(b){this._currentMarker===void 0||this.notesArea!==void 0||b.key!=="Delete"&&b.key!=="Backspace"||this.deleteSelectedMarker()},z.prototype.clientToLocalCoordinates=function(b,D){var V=this.markerImage.getBoundingClientRect();return{x:(b-V.left)/this.zoomLevel,y:(D-V.top)/this.zoomLevel}},z.prototype.onWindowResize=function(){this.positionUI()},z.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()},z.prototype.addLicenseKey=function(b){ke.addKey(b)},z.prototype.addEventListener=function(b,D){this.eventListeners.addEventListener(b,D)},z.prototype.removeEventListener=function(b,D){this.eventListeners.removeEventListener(b,D)},z.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(z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),z.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(D){return D(new ut(b))}))},z.prototype.blur=function(){var b=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new ut(b))}))},z.instanceCounter=0,z}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ve=function(z,b){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,V){D.__proto__=V}||function(D,V){for(var J in V)Object.prototype.hasOwnProperty.call(V,J)&&(D[J]=V[J])})(z,b)};function He(z,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function D(){this.constructor=z}ve(z,b),z.prototype=b===null?Object.create(b):(D.prototype=b.prototype,new D)}function je(z,b,D,V){return new(D||(D=Promise))(function(J,X){function Ee(Rt){try{vt(V.next(Rt))}catch(at){X(at)}}function et(Rt){try{vt(V.throw(Rt))}catch(at){X(at)}}function vt(Rt){var at;Rt.done?J(Rt.value):(at=Rt.value,at instanceof D?at:new D(function(zt){zt(at)})).then(Ee,et)}vt((V=V.apply(z,b||[])).next())})}function pt(z,b){var D,V,J,X,Ee={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return X={next:et(0),throw:et(1),return:et(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function et(vt){return function(Rt){return function(at){if(D)throw new TypeError("Generator is already executing.");for(;Ee;)try{if(D=1,V&&(J=2&at[0]?V.return:at[0]?V.throw||((J=V.return)&&J.call(V),0):V.next)&&!(J=J.call(V,at[1])).done)return J;switch(V=0,J&&(at=[2&at[0],J.value]),at[0]){case 0:case 1:J=at;break;case 4:return Ee.label++,{value:at[1],done:!1};case 5:Ee.label++,V=at[1],at=[0];continue;case 7:at=Ee.ops.pop(),Ee.trys.pop();continue;default:if(!(J=Ee.trys,(J=J.length>0&&J[J.length-1])||at[0]!==6&&at[0]!==2)){Ee=0;continue}if(at[0]===3&&(!J||at[1]>J[0]&&at[1]<J[3])){Ee.label=at[1];break}if(at[0]===6&&Ee.label<J[1]){Ee.label=J[1],J=at;break}if(J&&Ee.label<J[2]){Ee.label=J[2],Ee.ops.push(at);break}J[2]&&Ee.ops.pop(),Ee.trys.pop();continue}at=b.call(z,Ee)}catch(zt){at=[6,zt],V=0}finally{D=J=0}if(5&at[0])throw at[1];return{value:at[0]?at[1]:void 0,done:!0}}([vt,Rt])}}}var gt=function(){function z(){}return z.addKey=function(b){z.key=b},Object.defineProperty(z,"isLicensed",{get:function(){return!!z.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(z.key)},enumerable:!1,configurable:!0}),z}(),Re=function(){function z(){}return z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},z.setAttributes=function(b,D){for(var V=0,J=D;V<J.length;V++){var X=J[V],Ee=X[0],et=X[1];b.setAttribute(Ee,et)}},z.createRect=function(b,D,V){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",b.toString()),J.setAttribute("height",D.toString()),V&&z.setAttributes(J,V),J},z.createLine=function(b,D,V,J,X){var Ee=document.createElementNS("http://www.w3.org/2000/svg","line");return Ee.setAttribute("x1",b.toString()),Ee.setAttribute("y1",D.toString()),Ee.setAttribute("x2",V.toString()),Ee.setAttribute("y2",J.toString()),X&&z.setAttributes(Ee,X),Ee},z.createPolygon=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",b),D&&z.setAttributes(V,D),V},z.createCircle=function(b,D){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()),D&&z.setAttributes(V,D),V},z.createEllipse=function(b,D,V){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(b/2).toString()),J.setAttribute("cy",(D/2).toString()),J.setAttribute("rx",(b/2).toString()),J.setAttribute("ry",(D/2).toString()),V&&z.setAttributes(J,V),J},z.createGroup=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","g");return b&&z.setAttributes(D,b),D},z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},z.createMarker=function(b,D,V,J,X,Ee,et){var vt=document.createElementNS("http://www.w3.org/2000/svg","marker");return z.setAttributes(vt,[["id",b],["orient",D],["markerWidth",V.toString()],["markerHeight",J.toString()],["refX",X.toString()],["refY",Ee.toString()]]),vt.appendChild(et),vt},z.createText=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","text");return D.setAttribute("x","0"),D.setAttribute("y","0"),b&&z.setAttributes(D,b),D},z.createTSpan=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=b,D&&z.setAttributes(V,D),V},z.createImage=function(b){var D=document.createElementNS("http://www.w3.org/2000/svg","image");return b&&z.setAttributes(D,b),D},z.createPoint=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=b,V.y=D,V},z.createPath=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",b),D&&z.setAttributes(V,D),V},z.createElement=function(b,D){var V=document.createElementNS("http://www.w3.org/2000/svg",b);return D&&z.setAttributes(V,D),V},z.getHollowRectanglePath=function(b,D,V,J,X,Ee,et,vt){return"M"+b+","+D+"V"+(D+J)+"H"+(b+V)+"V"+D+"H"+X+"V"+Ee+"H"+(X+et)+"V"+(Ee+vt)+"H"+X+"V"+D+"Z"},z}(),Ge=function(){function z(b){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+b+"_"}return Object.defineProperty(z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),z.prototype.addClass=function(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},z.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)},z.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 Ue("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new mt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new mt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},z.prototype.removeStyleSheet=function(){var b;this.styleSheet&&(((b=this.styleSheetRoot)!==null&&b!==void 0?b:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},z}(),Ue=function(z,b){this.selector=z,this.style=b},mt=function(z,b){this.localName=z,this.style=b},wt=function(){function z(){this.blocks=[],this.display=""}return z.prototype.addButtonBlock=function(b){b.className=this.blockClassName,b.buttonClassName=this.buttonClassName,b.buttonColorsClassName=this.buttonColorsClassName,b.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(b)},z.prototype.addElementBlock=function(b){b.className===void 0&&(b.className=this.blockClassName),this.blocks.push(b)},z.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(D){return b.appendChild(D.getUI())}),b},z}(),qt=function(){function z(){}return z.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},z}(),en=function(z){function b(){var D=z!==null&&z.apply(this,arguments)||this;return D.buttons=[],D}return He(b,z),b.prototype.addButton=function(D){D.className=this.buttonClassName,D.colorsClassName=this.buttonColorsClassName,D.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(D)},b.prototype.getUI=function(){var D=z.prototype.getUI.call(this);return this.buttons.forEach(function(V){return D.appendChild(V.getUI())}),D},b}(qt),Vt=function(){function z(b,D){this._isActive=!1,this._isHidden=!1,this._icon=b,this.title=D,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(z.prototype,"icon",{get:function(){return this._icon},set:function(b){this._icon=b,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isActive",{get:function(){return this._isActive},set:function(b){this._isActive=b,this.adjustClassName()},enumerable:!1,configurable:!0}),z.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},z.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},z.prototype.hide=function(){this._isHidden=!0},z}(),Dt=function(z){function b(){var D=z!==null&&z.apply(this,arguments)||this;return D.elements=[],D}return He(b,z),b.prototype.addElement=function(D){this.elements.push(D)},b.prototype.getUI=function(){var D=z.prototype.getUI.call(this);return this.elements.forEach(function(V){return D.appendChild(V)}),D},b}(qt),Ke=function(){function z(b,D){this.horizontal=b,this.vertical=D}return Object.defineProperty(z.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),z.prototype.getVerticalLength=function(b){return b/this.ratio},z.prototype.getHorizontalLength=function(b){return b*this.ratio},z}(),Ct=function(){function z(){}return z.getIcon=function(b,D){if(b>0&&D>0){var V=new Ke(b,D),J=V.ratio>=1?20:V.getHorizontalLength(20),X=V.ratio<1?20:V.getVerticalLength(20),Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ee);var et=Re.createDefs();Ee.appendChild(et);var vt=Re.createElement("clipPath",[["id","text-bg-clip"]]);et.appendChild(vt);var Rt=Re.createPath(Re.getHollowRectanglePath((24-J)/2,(24-X)/2,J,X,(24-J)/2+2,(24-X)/2+2,J-4,X-4));Ee.appendChild(Rt);var at=Re.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);at.appendChild(Re.createTSpan(b+":"+D)),Ee.appendChild(at);var zt=at.getBBox();Re.setAttributes(at,[["x",((24-zt.width)/2).toString()],["y",((24-zt.height)/2-zt.y).toString()]]);var Wt=Re.createPath(Re.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(zt.width))/2,(24-Math.ceil(zt.height))/2,Math.ceil(zt.width),Math.ceil(zt.height)));return vt.appendChild(Wt),Re.setAttributes(Rt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ee),Ee.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},z}(),Bt=function(z){function b(D,V,J){var X=z.call(this,D,V)||this;return X.isDropdownOpen=!1,X.onClick=X.dropdownButtonClicked,X.dropdownButtons=J,X}return He(b,z),b.prototype.setupDropdown=function(){var D=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=D.className,V.colorsClassName=D.colorsClassName,D.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}(Vt),It=function(){function z(b,D){this.GRIP_SIZE=10,this.color=b,this.fillColor=D,this.visual=Re.createGroup(),this.visual.appendChild(Re.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Re.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return z.prototype.ownsTarget=function(b){return b===this.visual||b===this.visual.childNodes[0]||b===this.visual.childNodes[1]},z.prototype.setCenter=function(b,D){this.visual.childNodes.forEach(function(V){return Re.setAttributes(V,[["cx",b.toString()],["cy",D.toString()]])})},z}(),Zt=function(){function z(b,D,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=D,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(z.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(z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(b){this._isGridVisible=b,this.gridContainer&&Re.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(b){this._zoomFactor=b,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),z.prototype.open=function(){var b=this;this.cropShadeElement=Re.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Re.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var D=0;D<this.numberOfGridLines;D++)this.horizontalGridLines.push(Re.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Re.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=Re.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},z.prototype.setCropRectangle=function(b){this.cropRect=b;var D=Object.assign({},this.cropRect);this.zoomFactor!==1&&(D.width=this.cropRect.width*this.zoomFactor,D.height=this.cropRect.height*this.zoomFactor,D.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-D.width/2,D.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-D.height/2),Re.setAttributes(this.cropRectElement,[["x",D.x.toString()],["y",D.y.toString()],["width",D.width.toString()],["height",D.height.toString()]]);var V=D.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(X,Ee){var et=D.y+V*(Ee+1);Re.setAttributes(X,[["x1",""+D.x],["y1",""+et],["x2",""+(D.x+D.width)],["y2",""+et]])});var J=D.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(X,Ee){var et=D.x+J*(Ee+1);Re.setAttributes(X,[["x1",""+et],["y1",""+D.y],["x2",""+et],["y2",""+(D.y+D.height)]])}),Re.setAttributes(this.cropShadeElement,[["d",Re.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,D.x,D.y,D.width,D.height)]]),this.topLeftGrip.setCenter(D.x,D.y),this.topRightGrip.setCenter(D.x+D.width,D.y),this.bottomLeftGrip.setCenter(D.x,D.y+D.height),this.bottomRightGrip.setCenter(D.x+D.width,D.y+D.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},z.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},z.prototype.clientToLocalCoordinates=function(b,D){var V=this.container.getBoundingClientRect();return{x:b-V.left+this.margin,y:D-V.top+this.margin}},z.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)},z.prototype.onPointerMove=function(b){if(this.isMoving)this.move(this.clientToLocalCoordinates(b.clientX,b.clientY));else if(this.activeGrip){var D=this.clientToLocalCoordinates(b.clientX,b.clientY);this.resize(D)}b.preventDefault()},z.prototype.onPointerUp=function(b){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(b.pointerId)},z.prototype.move=function(b){var D=b.x-this.previousPoint.x,V=b.y-this.previousPoint.y;this.zoomFactor!==1&&(D=-D/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+D),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=b},z.prototype.resize=function(b){var D=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:D.x+V<this.margin&&(V=this.margin-D.x),D.x+=V,D.width=this.cropRect.x+this.cropRect.width-D.x;break;case this.bottomRightGrip:case this.topRightGrip:D.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-D.width),D.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(D.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),D.height=this.aspectRatio.getVerticalLength(D.width)):(D.y+=J,D.height=this.cropRect.y+this.cropRect.height-D.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?D.height=this.aspectRatio.getVerticalLength(D.width):D.height+=J}D.width<10&&(D.x=this.cropRect.x,D.width=10),D.height<10&&(D.y=this.cropRect.y,D.height=10),this.previousPoint=b,D.x>=this.margin&&D.y>=this.margin&&D.x-this.margin+D.width<=this.canvasWidth&&D.y-this.margin+D.height<=this.canvasHeight&&(this.cropRect=D,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},z.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,D=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=D-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},z.prototype.getRescaledRect=function(b,D,V,J,X,Ee){var et=V/b,vt=J/D;return{x:(X.x-Ee)*et+Ee,y:(X.y-Ee)*vt+Ee,width:X.width*et,height:X.height*vt}},z.prototype.scaleCanvas=function(b,D){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,b,D,this.cropRect,this.margin);this.canvasWidth=b,this.canvasHeight=D,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},z}(),nn=function(){function z(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(z.prototype,"angle",{get:function(){return this._angle},set:function(b){this._angle=b,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),z.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},z.prototype.onPointerDown=function(b){this.controlContainer.setPointerCapture(b.pointerId),this.isDragging=!0,this.previousPoint={x:b.clientX,y:b.clientY}},z.prototype.onPointerMove=function(b){this.isDragging&&(this.onAngleChange&&this.onAngleChange((b.clientX-this.previousPoint.x)/5),this.previousPoint.x=b.clientX)},z.prototype.onPointerUp=function(b){this.isDragging&&this.onAngleChange&&this.onAngleChange((b.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(b.pointerId)},z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var b=this.angleLabelText.getBBox();Re.setAttributes(this.angleLabelElement,[["x",((this.width-b.width)/2).toString()],["y",(this.height/2).toString()]])}},z.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)}},z.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 D="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;D+="h4v"+-J+"h1v"+J}D+="v1H0Z",this.scaleShape=Re.createPath(D);var X=Re.createTransform();this.scaleShape.transform.baseVal.appendItem(X),b.appendChild(this.scaleShape),this.angleLabelElement=Re.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Re.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ee=Re.createTSpan("");return Ee.innerHTML="°",this.angleLabelElement.appendChild(Ee),b.appendChild(this.angleLabelElement),document.body.removeChild(b),b},z}(),an=function(){function z(){this.naturalSize=!1,this.imageType="image/png"}return z.prototype.rasterize=function(b,D,V,J,X,Ee,et){var vt=this;return new Promise(function(Rt){var at=document.createElement("canvas");at.width=b.width.baseVal.value-2*J,at.height=b.height.baseVal.value-2*J;var zt=1,Wt=1;vt.naturalSize===!0?(zt=D.naturalWidth/(b.width.baseVal.value-2*J)/Ee,Wt=D.naturalHeight/(b.height.baseVal.value-2*J)/et,at.width=D.naturalWidth/Ee,at.height=D.naturalHeight/et):vt.width!==void 0&&vt.height!==void 0&&(zt=vt.width/V.width,Wt=vt.height/V.height,at.width*=zt,at.height*=Wt);var yn=at.getContext("2d");yn.translate(at.width/2,at.height/2),yn.rotate(X*Math.PI/180),yn.scale(Ee,et),yn.translate(-at.width/2,-at.height/2),yn.drawImage(D,0,0,at.width,at.height);var Un=document.createElement("canvas");Un.width=V.width*zt,Un.height=V.height*Wt,Un.getContext("2d").putImageData(yn.getImageData((V.x-J)*zt,(V.y-J)*Wt,V.width*zt,V.height*Wt),0,0),Rt(Un.toDataURL(vt.imageType,vt.imageQuality))})},z}(),We=function(){function z(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=z.instanceCounter++,this.styles=new Ge(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(z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(b){this._zoomToCropEnabled=b,b?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(z.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(z.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(z.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(z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"aspectRatio",{get:function(){var b;return(b=this._aspectRatio)!==null&&b!==void 0?b:this.aspectRatios[0]},set:function(b){this._aspectRatio=b},enumerable:!1,configurable:!0}),z.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},z.prototype.show=function(){this.showUI(),this.open()},z.prototype.close=function(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(D){return D()}),this._isOpen=!1)},z.prototype.addRenderEventListener=function(b){this.renderEventListeners.push(b)},z.prototype.removeRenderEventListener=function(b){this.renderEventListeners.indexOf(b)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(b),1)},z.prototype.addCloseEventListener=function(b){this.closeEventListeners.push(b)},z.prototype.removeCloseEventListener=function(b){this.closeEventListeners.indexOf(b)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(b),1)},z.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))},z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var b=1*this.target.clientWidth/this.target.clientHeight,D=this.contentDiv.clientWidth/b>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*b:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=D+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/b;this.resize(D,V)}},z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},z.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Re.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},z.prototype.resize=function(b,D){this.imageWidth=Math.round(b),this.imageHeight=Math.round(D),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},z.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 D=b.toDataURL();Re.setAttributes(this.editingTarget,[["href",D]]),this.setEditingTargetSize()},z.prototype.setTopLeft=function(){var b=this.target.getBoundingClientRect(),D=this.editorCanvas.getBoundingClientRect();this.left=b.left-D.left-this.CANVAS_MARGIN,this.top=b.top-D.top-this.CANVAS_MARGIN},z.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Re.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Re.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Re.createGroup(),this.editingTargetRotationScaleContainer=Re.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var b=Re.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(b);var D=Re.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(D),this.editingTargetContainer=Re.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},z.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},z.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Re.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Zt(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},z.prototype.zoomToCrop=function(){if(this.cropRect){var b=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,D=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=b+"px "+D+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-b+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-D+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},z.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},z.prototype.cropRectChanged=function(b){this.cropRect=b,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},z.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},z.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},z.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var b=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,D=this.target.offsetTop>b+this.CANVAS_MARGIN?this.target.offsetTop-(b+this.CANVAS_MARGIN):0;this.coverDiv.style.top=D+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},z.prototype.addTopToolbar=function(){var b=this;this.topToolbar=new wt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var D=new en;D.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(D);var V=[];this.aspectRatios.forEach(function(Wt){var yn=new Vt(Ct.getIcon(Wt.horizontal,Wt.vertical),Wt.horizontal===0&&Wt.vertical===0?"FREE":Wt.horizontal+":"+Wt.vertical);yn.onClick=function(){return b.ratioButtonClicked(Wt)},V.push(yn)}),this.aspectRatioButton=new Bt(Ct.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,D.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new Vt('<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},D.addButton(J);var X=new Vt('<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(X.isActive=this.zoomToCropEnabled,X.onClick=function(){b.zoomToCropEnabled=!b.zoomToCropEnabled,X.isActive=b.zoomToCropEnabled},D.addButton(X),!gt.isLicensed){var Ee=new Dt;this.topToolbar.addElementBlock(Ee);var et=document.createElement("div");et.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var vt=document.createElement("a");vt.style.color="currentColor",vt.href="https://markerjs.com/products/cropro",vt.target="_blank",vt.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>',et.appendChild(vt),Ee.addElement(et)}var Rt=new en;Rt.minWidth=3*this.toolbarHeight+"px",Rt.contentAlign="end",this.topToolbar.addButtonBlock(Rt);var at=new Vt('<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");at.onClick=this.startRenderAndClose,Rt.addButton(at),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(at.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var zt=new Vt('<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");zt.onClick=this.close,Rt.addButton(zt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(zt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},z.prototype.addBottomToolbar=function(){var b=this;this.bottomToolbar=new wt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var D=new en;D.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(D);var V=new Vt('<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,D.addButton(V);var J=new Vt('<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,D.addButton(J);var X=new Dt;X.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(X),this.straightener=new nn("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(Rt){b.rotateBy(Rt),b.straightener.angle=b.rotationAngle},X.addElement(this.straightener.getUI());var Ee=new en;Ee.minWidth=2*this.toolbarHeight+"px",Ee.contentAlign="end",this.bottomToolbar.addButtonBlock(Ee);var et=new Vt('<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");et.onClick=this.flipHorizontallyButtonClicked,Ee.addButton(et);var vt=new Vt('<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");vt.onClick=this.flipVerticallyButtonClicked,Ee.addButton(vt)},z.prototype.ratioButtonClicked=function(b){this.aspectRatio=b,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ct.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ke(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},z.prototype.restoreState=function(b){if(b){var D=this.cropLayer.getRescaledRect(b.width,b.height,this.imageWidth,this.imageHeight,b.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(D),this.cropRectChanged(D),this.flippedHorizontally=b.flippedHorizontally,this.flippedVertically=b.flippedVertically,this.applyFlip(),this.rotationAngle=b.rotationAngle,this.applyRotation()}},z.prototype.clientToLocalCoordinates=function(b,D){var V=this.cropImage.getBoundingClientRect();return{x:b-V.left,y:D-V.top}},z.prototype.onWindowResize=function(){this.positionUI()},z.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()},z.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)},z.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)},z.prototype.rotateTo=function(b){b=(b=b>180?b-360:b)<=-180?b+360:b,this.rotationAngle=b,this.applyRotation()},z.prototype.rotateBy=function(b){this.rotateTo((this.rotationAngle+b)%360)},z.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 D=this.editingTargetRotationContainer.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(D,0);var 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},z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},z.prototype.startRenderAndClose=function(){return je(this,void 0,void 0,function(){var b,D;return pt(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return b=V.sent(),D=this.getState(),this.renderEventListeners.forEach(function(J){return J(b,D)}),this.close(!0),[2]}})})},z.prototype.render=function(){return je(this,void 0,void 0,function(){var b;return pt(this,function(D){switch(D.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(),Re.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 D.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,D.sent()]}})})},z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new mt("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 mt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new mt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var b=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new mt("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 mt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new mt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ue("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new mt("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 mt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new mt("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 mt("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 mt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},z.instanceCounter=0,z}(),nt=k("8hTe"),Kt=k.n(nt),kt=/<pre[^>]*>/g;function Ut(z){var b=document.createElement("div");return b.innerHTML=z,b.childNodes.length===0?"":b.childNodes[0].nodeValue}var _t=se.a=function(z){var b=z.value,D=b===void 0?"":b,V=z.edit,J=V===void 0?!1:V,X=z.className,Ee=z.showTextOnly,et=z.showLines,vt=z.replaces,Rt=z.zoomImg,at=z.hasMask,zt=z.style,Wt=zt===void 0?{}:zt,yn=z.stylesPrev,Un=yn===void 0?{}:yn,hn=String(D),tn=Object(L.useRef)(),An=Object(L.useRef)(),Mn=Object(L.useState)(""),pn=Object(F.a)(Mn,2),Cn=pn[0],bn=pn[1],$n=Object(L.useState)("office"),jn=Object(F.a)($n,2),pr=jn[0],Sn=jn[1],wr=function(){var on=new We(An.current);on.displayMode="popup",on.addRenderEventListener(function(){var Dn=Object(A.a)(S.a.mark(function mn(On){var ln;return S.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return tn.current.style.display="none",Pn.next=3,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On}});case 3:ln=Pn.sent,ln!=null&&ln.id&&vt(An.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ln==null?void 0:ln.id,"?type=").concat(ln.content_type));case 5:case"end":return Pn.stop()}},mn)}));return function(mn){return Dn.apply(this,arguments)}}()),on.show()},xn=function(){var on=new oe(An.current);on.settings.displayMode="popup",on.addEventListener("render",function(){var Dn=Object(A.a)(S.a.mark(function mn(On){var ln;return S.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(tn.current.style.display="none",!An.current){Pn.next=6;break}return Pn.next=4,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On.dataUrl}});case 4:ln=Pn.sent,ln!=null&&ln.id&&vt(An.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(ln==null?void 0:ln.id,"?type=").concat(ln.content_type));case 6:case"end":return Pn.stop()}},mn)}));return function(mn){return Dn.apply(this,arguments)}}()),on.show(),window.markerArea=on},tr=Object(L.useMemo)(function(){try{var vn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,on=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Dn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;hn=hn.replace(vn,"("+ne.a.API_SERVER+"/api/attachments/").replace(on,'"'+ne.a.API_SERVER+"/api/attachments/").replace(Dn,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),hn=hn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(gr){}var mn=Z(hn),On=_();if(hn.match(/\[TOC\]/)&&(mn=mn.replace("<p>[TOC]</p>",R()),x()),mn=mn.replace(/(__special_katext_id_\d+__)/g,function(gr,Pn){var Hn=On[Pn],Or=Hn.type,xr=Hn.expression;return Object(ae.renderToString)(Ut(xr)||"",{displayMode:Or==="block",throwOnError:!1,output:"html"})}),mn=mn.replace(/▁/g,"\u2581\u2581\u2581"),T(),Ee){var ln=document.createElement("div");return ln.innerHTML=mn,ln.innerText}return setTimeout(function(){return Ar()},500),mn},[hn]),nr=Object(L.useRef)();E.WebkitLineClamp=et,et&&(Wt=Object(N.a)(Object(N.a)({},Wt),E));function mr(vn){var on=vn.target;if(on.tagName.toUpperCase()==="IMG"){if(Rt){var Dn=on.getAttribute("src");bn(Dn),Sn("image")}}else if(on.tagName.toUpperCase()==="A"){var mn=on.getAttribute("href");if(mn.indexOf("office")>-1)vn.preventDefault(),bn(mn),Sn("office");else if(mn.indexOf("application/pdf")>-1)vn.preventDefault(),bn(mn),Sn("pdf");else if(mn.indexOf("type=text")>-1)vn.preventDefault(),bn(mn),Sn("html");else if(mn.startsWith("#")){vn.preventDefault();var On=document.getElementById(mn.replace("#",""));On&&On.scrollIntoView(!0)}}}var Ar=function(){var on,Dn=(on=nr.current)===null||on===void 0?void 0:on.querySelectorAll("video");Dn==null||Dn.forEach(function(mn){if(mn.oncontextmenu=function(){return!1},mn.src.indexOf(".m3u8")>-1&&!mn.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var On=new $.a;On.loadSource(mn.src),On.attachMedia(mn)}}})};Object(L.useEffect)(function(){if(nr.current&&tr&&(tr.match(kt)&&window.PR.prettyPrint()),nr.current)return nr.current.addEventListener("click",mr),function(){nr.current.removeEventListener("click",mr),T(),x()}},[tr,nr.current,mr]);var ar=function(on){if(!J)return;on.target.nodeName==="IMG"?(tn.current.style.display="flex",tn.current.style.width=on.target.clientWidth+"px",tn.current.style.height=on.target.clientHeight+"px",tn.current.style.top=on.target.offsetTop+"px",tn.current.style.left=on.target.offsetLeft+"px",An.current.src=on.target.getAttribute("src")):tn.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:nr,style:Object(N.a)({},Wt),className:"".concat(X||""," markdown-body ").concat(Kt.a.mdBody),onMouseOver:ar,dangerouslySetInnerHTML:{__html:tr}}),d.a.createElement("div",{ref:tn,className:Kt.a.button},d.a.createElement(H.a,null,d.a.createElement(W.a,{onClick:function(){return wr()}},"\u88C1\u526A"),d.a.createElement(W.a,{onClick:function(){return xn()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:An,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.a.createElement(fe.a,{close:!0,data:Cn,hasMask:at,type:Cn!=null&&Cn.length?pr:"",style:Object(N.a)({},Un),onClose:function(){return bn("")}}))}},"9VGf":function(Ye,se,k){"use strict";k.d(se,"a",function(){return M});var Q=k("q1tI"),H=k.n(Q);function M(W,N){var A=Object(Q.useRef)();Object(Q.useEffect)(function(){A.current=W}),Object(Q.useEffect)(function(){function F(){A.current()}if(N!==null){var U=setInterval(F,N);return function(){return clearInterval(U)}}},[N])}},AMnG:function(Ye,se,k){"use strict";var Q=k("miYZ"),H=k("tsqr"),M=k("tJVT"),W=k("q1tI"),N=k.n(W),A=k("nWbc"),F=k.n(A),U=k("Ot1p");se.a=function(S){var L=S.id,d=S.activeDiscussIndex,v=S.onReplyDiscuss,C=Object(W.useState)(""),p=Object(M.a)(C,2),h=p[0],f=p[1];function n(o){f(o)}function r(){if(!h){H.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}v(L,h),f("")}return N.a.createElement("div",{key:L,className:"discuss-item-editor",style:{display:d===L?"block":"none",width:"100%"}},N.a.createElement(U.a,{miniToolbar:!0,startInit:d===L,defaultValue:h,id:L,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:n}),N.a.createElement("a",{onClick:r,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Ye,se,k){"use strict";k.d(se,"a",function(){return A});var Q=k("MNnm"),H="rc-util-key";function M(F){if(F.attachTo)return F.attachTo;var U=document.querySelector("head");return U||document.body}function W(F){var U,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Q.a)())return null;var L=document.createElement("style");if((U=S.csp)===null||U===void 0?void 0:U.nonce){var d;L.nonce=(d=S.csp)===null||d===void 0?void 0:d.nonce}L.innerHTML=F;var v=M(S),C=v.firstChild;return S.prepend&&v.prepend?v.prepend(L):S.prepend&&C?v.insertBefore(L,C):v.appendChild(L),L}var N=new Map;function A(F,U){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=M(S);if(!N.has(L)){var d=W("",S),v=d.parentNode;N.set(L,v),v.removeChild(d)}var C=Array.from(N.get(L).children).find(function(r){return r.tagName==="STYLE"&&r[H]===U});if(C){var p,h;if(((p=S.csp)===null||p===void 0?void 0:p.nonce)&&C.nonce!==((h=S.csp)===null||h===void 0?void 0:h.nonce)){var f;C.nonce=(f=S.csp)===null||f===void 0?void 0:f.nonce}return C.innerHTML!==F&&(C.innerHTML=F),C}var n=W(F,S);return n[H]=U,n}},Bd2K:function(Ye,se,k){(function(Q){Q(k("VrN/"),k("osHv"))})(function(Q){Q.defineOption("autoCloseTags",!1,function(S,L,d){if(d!=Q.Init&&d&&S.removeKeyMap("autoCloseTags"),!L)return;var v={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(v["'/'"]=function(C){return A(C)}),(typeof L!="object"||L.whenOpening!==!1)&&(v["'>'"]=function(C){return W(C)}),S.addKeyMap(v)});var H=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 W(S){if(S.getOption("disableInput"))return Q.Pass;for(var L=S.listSelections(),d=[],v=S.getOption("autoCloseTags"),C=0;C<L.length;C++){if(!L[C].empty())return Q.Pass;var p=L[C].head,h=S.getTokenAt(p),f=Q.innerMode(S.getMode(),h.state),n=f.state,r=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(n),o=r&&r.name;if(!o)return Q.Pass;var l=f.mode.configuration=="html",x=typeof v=="object"&&v.dontCloseTags||l&&H,E=typeof v=="object"&&v.indentTags||l&&M;h.end>p.ch&&(o=o.slice(0,o.length-h.end+p.ch));var y=o.toLowerCase();if(!o||h.type=="string"&&(h.end!=p.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||h.string.length==1)||h.type=="tag"&&r.close||h.string.indexOf("/")==p.ch-h.start-1||x&&F(x,y)>-1||U(S,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(n)||[],o,p,!0))return Q.Pass;var R=typeof v=="object"&&v.emptyTags;if(R&&F(R,o)>-1){d[C]={text:"/>",newPos:Q.Pos(p.line,p.ch+2)};continue}var O=E&&F(E,y)>-1;d[C]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+o+">",newPos:O?Q.Pos(p.line+1,0):Q.Pos(p.line,p.ch+1)}}for(var g=typeof v=="object"&&v.dontIndentOnAutoClose,C=L.length-1;C>=0;C--){var m=d[C];S.replaceRange(m.text,L[C].head,L[C].anchor,"+insert");var s=S.listSelections().slice(0);s[C]={head:m.newPos,anchor:m.newPos},S.setSelections(s),!g&&m.indent&&(S.indentLine(m.newPos.line,null,!0),S.indentLine(m.newPos.line+1,null,!0))}}function N(S,L){for(var d=S.listSelections(),v=[],C=L?"/":"</",p=S.getOption("autoCloseTags"),h=typeof p=="object"&&p.dontIndentOnSlash,f=0;f<d.length;f++){if(!d[f].empty())return Q.Pass;var n=d[f].head,r=S.getTokenAt(n),o=Q.innerMode(S.getMode(),r.state),l=o.state;if(L&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=n.ch-1))return Q.Pass;var x,E=o.mode.name!="xml"&&S.getMode().name=="htmlmixed";if(E&&o.mode.name=="javascript")x=C+"script";else if(E&&o.mode.name=="css")x=C+"style";else{var y=o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(l);if(!y||y.length&&U(S,y,y[y.length-1],n))return Q.Pass;x=C+y[y.length-1]}S.getLine(n.line).charAt(r.end)!=">"&&(x+=">"),v[f]=x}if(S.replaceSelections(v),d=S.listSelections(),!h)for(var f=0;f<d.length;f++)(f==d.length-1||d[f].head.line<d[f+1].head.line)&&S.indentLine(d[f].head.line)}function A(S){return S.getOption("disableInput")?Q.Pass:N(S,!0)}Q.commands.closeTag=function(S){return N(S)};function F(S,L){if(S.indexOf)return S.indexOf(L);for(var d=0,v=S.length;d<v;++d)if(S[d]==L)return d;return-1}function U(S,L,d,v,C){if(!Q.scanForClosingTag)return!1;var p=Math.min(S.lastLine()+1,v.line+500),h=Q.scanForClosingTag(S,v,null,p);if(!h||h.tag!=d)return!1;for(var f=C?1:0,n=L.length-1;n>=0&&L[n]==d;n--)++f;v=h.to;for(var n=1;n<f;n++){var r=Q.scanForClosingTag(S,v,null,p);if(!r||r.tag!=d)return!1;v=r.to}return!0}})},BdwD:function(Ye,se,k){"use strict";var Q=k("+L6B"),H=k("2/Rp"),M=k("0Owb"),W=k("k1fw"),N=k("q1tI"),A=k.n(N),F=k("FOrL"),U=k.n(F),S=function(d){var v=d.buttonProps,C=v===void 0?{}:v,p=d.styles,h=p===void 0?{}:p,f=d.customText,n=d.ButtonText,r=d.ButtonClick,o=d.Buttonclass,l=d.ButtonTwo;return A.a.createElement("section",{className:"tc animated fadeIn",style:Object(W.a)(Object(W.a)({},{color:"#999",margin:"200px auto"}),h)},A.a.createElement("img",{src:U.a}),A.a.createElement("p",{className:"mt20 font14"},f||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),n&&A.a.createElement(H.a,Object(M.a)({className:o,onClick:r},C),n),l&&l)};se.a=S},BjJ7:function(Ye,se,k){"use strict";k.d(se,"d",function(){return H}),k.d(se,"c",function(){return M}),k.d(se,"e",function(){return W}),k.d(se,"b",function(){return N}),k.d(se,"a",function(){return F});var Q=k("m3rI");function H(U){var S=!0;if(U.length>0){for(var L=0;L<U.length;L++)if(U[L].compile_success==0||!U[L].compile_success){S=!1;break}}else S=!1;return S}function M(U){for(var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],d=0;d<U.length;d++){var v=U[d],C=S?"".concat(S,"/").concat(v.name):"".concat(v.name);L.push({title:v.name,isLeaf:!(v.type==="tree"),key:C})}return L}function W(U,S,L){for(var d=0;d<U.length;d++){var v=U[d];if(v.key===S){v.children=L;break}v.children&&W(v.children,S,L)}return U}function N(U,S,L){var d;return function(){var v=this,C=arguments,p=function(){d=null,L||U.apply(v,C)},h=L&&!d;clearTimeout(d),d=setTimeout(p,S),h&&U.apply(v,C)}}var A=!0,F=Q.a.API_SERVER},"C+DQ":function(Ye,se,k){},"C/vA":function(Ye,se,k){"use strict";k.d(se,"a",function(){return Q});function Q(H){var M=this,W=!1,N;return function(){return W||(W=!0,N=H.apply(M,arguments)),N}}},"Cg/j":function(Ye,se,k){"use strict";k.d(se,"b",function(){return Q}),k.d(se,"a",function(){return H}),k.d(se,"c",function(){return W}),k.d(se,"d",function(){return N});var Q;(function(A){A.serviceIds=new Map,A.DI_TARGET="$di$target",A.DI_DEPENDENCIES="$di$dependencies";function F(U){return U[A.DI_DEPENDENCIES]||[]}A.getServiceDependencies=F})(Q||(Q={}));var H=W("instantiationService");function M(A,F,U,S){F[Q.DI_TARGET]===F?F[Q.DI_DEPENDENCIES].push({id:A,index:U,optional:S}):(F[Q.DI_DEPENDENCIES]=[{id:A,index:U,optional:S}],F[Q.DI_TARGET]=F)}function W(A){if(Q.serviceIds.has(A))return Q.serviceIds.get(A);var F=function(U,S,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(F,U,L,!1)};return F.toString=function(){return A},Q.serviceIds.set(A,F),F}function N(A){return function(F,U,S){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(A,F,S,!0)}}},CrYA:function(Ye,se,k){var Q=k("MFOe"),H=Q.Global;Ye.exports={name:"sessionStorage",read:W,write:N,each:A,remove:F,clearAll:U};function M(){return H.sessionStorage}function W(S){return M().getItem(S)}function N(S,L){return M().setItem(S,L)}function A(S){for(var L=M().length-1;L>=0;L--){var d=M().key(L);S(W(d),d)}}function F(S){return M().removeItem(S)}function U(){return M().clear()}},DlQD:function(Ye,se,k){(function(Q,H){Ye.exports=H()})(this,function(){"use strict";function Q(be,de){for(var he=0;he<de.length;he++){var re=de[he];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(be,re.key,re)}}function H(be,de,he){return de&&Q(be.prototype,de),he&&Q(be,he),be}function M(be,de){if(!be)return;if(typeof be=="string")return W(be,de);var he=Object.prototype.toString.call(be).slice(8,-1);if(he==="Object"&&be.constructor&&(he=be.constructor.name),he==="Map"||he==="Set")return Array.from(be);if(he==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(he))return W(be,de)}function W(be,de){(de==null||de>be.length)&&(de=be.length);for(var he=0,re=new Array(de);he<de;he++)re[he]=be[he];return re}function N(be,de){var he;if(typeof Symbol=="undefined"||be[Symbol.iterator]==null){if(Array.isArray(be)||(he=M(be))||de&&be&&typeof be.length=="number"){he&&(be=he);var re=0;return function(){return re>=be.length?{done:!0}:{done:!1,value:be[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 he=be[Symbol.iterator](),he.next.bind(he)}function A(be,de){return de={exports:{}},be(de,de.exports),de.exports}var F=A(function(be){function de(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function he(re){be.exports.defaults=re}be.exports={defaults:de(),getDefaults:de,changeDefaults:he}}),U=F.defaults,S=F.getDefaults,L=F.changeDefaults,d=/[&<>"']/,v=/[&<>"']/g,C=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(de){return h[de]};function n(be,de){if(de){if(d.test(be))return be.replace(v,f)}else if(C.test(be))return be.replace(p,f);return be}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(be){return be.replace(r,function(de,he){return he=he.toLowerCase(),he==="colon"?":":he.charAt(0)==="#"?he.charAt(1)==="x"?String.fromCharCode(parseInt(he.substring(2),16)):String.fromCharCode(+he.substring(1)):""})}var l=/(^|[^\[])\^/g;function x(be,de){be=be.source||be,de=de||"";var he={replace:function(ie,le){return le=le.source||le,le=le.replace(l,"$1"),be=be.replace(ie,le),he},getRegex:function(){return new RegExp(be,de)}};return he}var E=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(be,de,he){if(be){var re;try{re=decodeURIComponent(o(he)).replace(E,"").toLowerCase()}catch(ie){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}de&&!y.test(he)&&(he=u(de,he));try{he=encodeURI(he).replace(/%25/g,"%")}catch(ie){return null}return he}var O={},g=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(be,de){O[" "+be]||(g.test(be)?O[" "+be]=be+"/":O[" "+be]=P(be,"/",!0)),be=O[" "+be];var he=be.indexOf(":")===-1;return de.substring(0,2)==="//"?he?de:be.replace(m,"$1")+de:de.charAt(0)==="/"?he?de:be.replace(s,"$1")+de:be+de}var _={exec:function(){}};function T(be){for(var de=1,he,re;de<arguments.length;de++){he=arguments[de];for(re in he)Object.prototype.hasOwnProperty.call(he,re)&&(be[re]=he[re])}return be}function w(be,de){var he=be.replace(/\|/g,function(le,me,De){for(var Te=!1,Qe=me;--Qe>=0&&De[Qe]==="\\";)Te=!Te;return Te?"|":" |"}),re=he.split(/ \|/),ie=0;if(re.length>de)re.splice(de);else for(;re.length<de;)re.push("");for(;ie<re.length;ie++)re[ie]=re[ie].trim().replace(/\\\|/g,"|");return re}function P(be,de,he){var re=be.length;if(re===0)return"";for(var ie=0;ie<re;){var le=be.charAt(re-ie-1);if(le===de&&!he)ie++;else if(le!==de&&he)ie++;else break}return be.substr(0,re-ie)}function j(be,de){if(be.indexOf(de[1])===-1)return-1;for(var he=be.length,re=0,ie=0;ie<he;ie++)if(be[ie]==="\\")ie++;else if(be[ie]===de[0])re++;else if(be[ie]===de[1]&&(re--,re<0))return ie;return-1}function K(be){be&&be.sanitize&&!be.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Z={escape:n,unescape:o,edit:x,cleanUrl:R,resolveUrl:u,noopTest:_,merge:T,splitCells:w,rtrim:P,findClosingBracket:j,checkSanitizeDeprecation:K},G=F.defaults,B=Z.rtrim,$=Z.splitCells,ne=Z.escape,ae=Z.findClosingBracket;function fe(be,de,he){var re=de.href,ie=de.title?ne(de.title):null,le=be[1].replace(/\\([\[\]])/g,"$1");return be[0].charAt(0)!=="!"?{type:"link",raw:he,href:re,title:ie,text:le}:{type:"image",raw:he,href:re,title:ie,text:ne(le)}}function _e(be,de){var he=be.match(/^(\s+)(?:```)/);if(he===null)return de;var re=he[1];return de.split(`
|
|
`).map(function(ie){var le=ie.match(/^\s+/);if(le===null)return ie;var me=le[0];return me.length>=re.length?ie.slice(re.length):ie}).join(`
|
|
`)}var Se=function(){function be(he){this.options=he||G}var de=be.prototype;return de.space=function(re){var ie=this.rules.block.newline.exec(re);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},de.code=function(re,ie){var le=this.rules.block.code.exec(re);if(le){var me=ie[ie.length-1];if(me&&me.type==="paragraph")return{raw:le[0],text:le[0].trimRight()};var De=le[0].replace(/^ {4}/gm,"");return{type:"code",raw:le[0],codeBlockStyle:"indented",text:this.options.pedantic?De:B(De,`
|
|
`)}}},de.fences=function(re){var ie=this.rules.block.fences.exec(re);if(ie){var le=ie[0],me=_e(le,ie[3]||"");return{type:"code",raw:le,lang:ie[2]?ie[2].trim():ie[2],text:me}}},de.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]}},de.nptable=function(re){var ie=this.rules.block.nptable.exec(re);if(ie){var le={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(le.header.length===le.align.length){var me=le.align.length,De;for(De=0;De<me;De++)/^ *-+: *$/.test(le.align[De])?le.align[De]="right":/^ *:-+: *$/.test(le.align[De])?le.align[De]="center":/^ *:-+ *$/.test(le.align[De])?le.align[De]="left":le.align[De]=null;for(me=le.cells.length,De=0;De<me;De++)le.cells[De]=$(le.cells[De],le.header.length);return le}}},de.hr=function(re){var ie=this.rules.block.hr.exec(re);if(ie)return{type:"hr",raw:ie[0]}},de.blockquote=function(re){var ie=this.rules.block.blockquote.exec(re);if(ie){var le=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:le}}},de.list=function(re){var ie=this.rules.block.list.exec(re);if(ie){for(var le=ie[0],me=ie[2],De=me.length>1,Te=me[me.length-1]===")",Qe={type:"list",raw:le,ordered:De,start:De?+me.slice(0,-1):"",loose:!1,items:[]},ct=ie[0].match(this.rules.block.item),xt=!1,ft,ut,$e,Ve,Ne,oe,ve,He=ct.length,je=0;je<He;je++)ft=ct[je],le=ft,ut=ft.length,ft=ft.replace(/^ *([*+-]|\d+[.)]) */,""),~ft.indexOf(`
|
|
`)&&(ut-=ft.length,ft=this.options.pedantic?ft.replace(/^ {1,4}/gm,""):ft.replace(new RegExp("^ {1,"+ut+"}","gm"),"")),je!==He-1&&($e=this.rules.block.bullet.exec(ct[je+1])[0],(De?$e.length===1||!Te&&$e[$e.length-1]===")":$e.length>1||this.options.smartLists&&$e!==me)&&(Ve=ct.slice(je+1).join(`
|
|
`),Qe.raw=Qe.raw.substring(0,Qe.raw.length-Ve.length),je=He-1)),Ne=xt||/\n\n(?!\s*$)/.test(ft),je!==He-1&&(xt=ft.charAt(ft.length-1)===`
|
|
`,Ne||(Ne=xt)),Ne&&(Qe.loose=!0),oe=/^\[[ xX]\] /.test(ft),ve=void 0,oe&&(ve=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Qe.items.push({type:"list_item",raw:le,task:oe,checked:ve,loose:Ne,text:ft});return Qe}},de.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]):ne(ie[0]):ie[0]}},de.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 le=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:le,raw:ie[0],href:ie[2],title:ie[3]}}},de.table=function(re){var ie=this.rules.block.table.exec(re);if(ie){var le={type:"table",header:$(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(le.header.length===le.align.length){le.raw=ie[0];var me=le.align.length,De;for(De=0;De<me;De++)/^ *-+: *$/.test(le.align[De])?le.align[De]="right":/^ *:-+: *$/.test(le.align[De])?le.align[De]="center":/^ *:-+ *$/.test(le.align[De])?le.align[De]="left":le.align[De]=null;for(me=le.cells.length,De=0;De<me;De++)le.cells[De]=$(le.cells[De].replace(/^ *\| *| *\| *$/g,""),le.header.length);return le}}},de.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]}},de.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]}},de.text=function(re,ie){var le=this.rules.block.text.exec(re);if(le){var me=ie[ie.length-1];return me&&me.type==="text"?{raw:le[0],text:le[0]}:{type:"text",raw:le[0],text:le[0]}}},de.escape=function(re){var ie=this.rules.inline.escape.exec(re);if(ie)return{type:"escape",raw:ie[0],text:ne(ie[1])}},de.tag=function(re,ie,le){var me=this.rules.inline.tag.exec(re);if(me)return!ie&&/^<a /i.test(me[0])?ie=!0:ie&&/^<\/a>/i.test(me[0])&&(ie=!1),!le&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?le=!0:le&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(le=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:ie,inRawBlock:le,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):ne(me[0]):me[0]}},de.link=function(re){var ie=this.rules.inline.link.exec(re);if(ie){var le=ae(ie[2],"()");if(le>-1){var me=ie[0].indexOf("!")===0?5:4,De=me+ie[1].length+le;ie[2]=ie[2].substring(0,le),ie[0]=ie[0].substring(0,De).trim(),ie[3]=""}var Te=ie[2],Qe="";if(this.options.pedantic){var ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Te);ct?(Te=ct[1],Qe=ct[3]):Qe=""}else Qe=ie[3]?ie[3].slice(1,-1):"";Te=Te.trim().replace(/^<([\s\S]*)>$/,"$1");var xt=fe(ie,{href:Te&&Te.replace(this.rules.inline._escapes,"$1"),title:Qe&&Qe.replace(this.rules.inline._escapes,"$1")},ie[0]);return xt}},de.reflink=function(re,ie){var le;if((le=this.rules.inline.reflink.exec(re))||(le=this.rules.inline.nolink.exec(re))){var me=(le[2]||le[1]).replace(/\s+/g," ");if(me=ie[me.toLowerCase()],!me||!me.href){var De=le[0].charAt(0);return{type:"text",raw:De,text:De}}var Te=fe(le,me,le[0]);return Te}},de.strong=function(re,ie,le){le===void 0&&(le="");var me=this.rules.inline.strong.start.exec(re);if(me&&(!me[1]||me[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*re.length);var De=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var Te;(me=De.exec(ie))!=null;)if(Te=this.rules.inline.strong.middle.exec(ie.slice(0,me.index+3)),Te)return{type:"strong",raw:re.slice(0,Te[0].length),text:re.slice(2,Te[0].length-2)}}},de.em=function(re,ie,le){le===void 0&&(le="");var me=this.rules.inline.em.start.exec(re);if(me&&(!me[1]||me[1]&&(le===""||this.rules.inline.punctuation.exec(le)))){ie=ie.slice(-1*re.length);var De=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var Te;(me=De.exec(ie))!=null;)if(Te=this.rules.inline.em.middle.exec(ie.slice(0,me.index+2)),Te)return{type:"em",raw:re.slice(0,Te[0].length),text:re.slice(1,Te[0].length-1)}}},de.codespan=function(re){var ie=this.rules.inline.code.exec(re);if(ie){var le=ie[2].replace(/\n/g," "),me=/[^ ]/.test(le),De=le.startsWith(" ")&&le.endsWith(" ");return me&&De&&(le=le.substring(1,le.length-1)),le=ne(le,!0),{type:"codespan",raw:ie[0],text:le}}},de.br=function(re){var ie=this.rules.inline.br.exec(re);if(ie)return{type:"br",raw:ie[0]}},de.del=function(re){var ie=this.rules.inline.del.exec(re);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},de.autolink=function(re,ie){var le=this.rules.inline.autolink.exec(re);if(le){var me,De;return le[2]==="@"?(me=ne(this.options.mangle?ie(le[1]):le[1]),De="mailto:"+me):(me=ne(le[1]),De=me),{type:"link",raw:le[0],text:me,href:De,tokens:[{type:"text",raw:me,text:me}]}}},de.url=function(re,ie){var le;if(le=this.rules.inline.url.exec(re)){var me,De;if(le[2]==="@")me=ne(this.options.mangle?ie(le[0]):le[0]),De="mailto:"+me;else{var Te;do Te=le[0],le[0]=this.rules.inline._backpedal.exec(le[0])[0];while(Te!==le[0]);me=ne(le[0]),le[1]==="www."?De="http://"+me:De=me}return{type:"link",raw:le[0],text:me,href:De,tokens:[{type:"text",raw:me,text:me}]}}},de.inlineText=function(re,ie,le){var me=this.rules.inline.text.exec(re);if(me){var De;return ie?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):ne(me[0]):me[0]:De=ne(this.options.smartypants?le(me[0]):me[0]),{type:"text",raw:me[0],text:De}}},be}(),we=Z.noopTest,Me=Z.edit,Le=Z.merge,ge={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:we,table:we,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Me(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Me(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Me(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=/<!--(?!-?>)[\s\S]*?-->/,ge.html=Me(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Me(ge._paragraph).replace("hr",ge.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",ge._tag).getRegex(),ge.blockquote=Me(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Le({},ge),ge.gfm=Le({},ge.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*|$)"}),ge.gfm.nptable=Me(ge.gfm.nptable).replace("hr",ge.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",ge._tag).getRegex(),ge.gfm.table=Me(ge.gfm.table).replace("hr",ge.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",ge._tag).getRegex(),ge.pedantic=Le({},ge.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._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:we,paragraph:Me(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:we,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:we,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Me(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Me(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Me(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Me(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Me(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Me(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Me(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Me(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Me(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Me(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Me(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=Me(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Me(ue.tag).replace("comment",ge._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Me(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Me(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Me(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Le({},ue),ue.pedantic=Le({},ue.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:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Le({},ue.normal,{escape:Me(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Me(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Le({},ue.gfm,{br:Me(ue.br).replace("{2,}","*").getRegex(),text:Me(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ke={block:ge,inline:ue},lt=F.defaults,ot=ke.block,st=ke.inline;function ce(be){return be.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 pe(be){var de="",he,re,ie=be.length;for(he=0;he<ie;he++)re=be.charCodeAt(he),Math.random()>.5&&(re="x"+re.toString(16)),de+="&#"+re+";";return de}var Oe=function(){function be(he){this.tokens=[],this.tokens.links=Object.create(null),this.options=he||lt,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:ot.normal,inline:st.normal};this.options.pedantic?(re.block=ot.pedantic,re.inline=st.pedantic):this.options.gfm&&(re.block=ot.gfm,this.options.breaks?re.inline=st.breaks:re.inline=st.gfm),this.tokenizer.rules=re}be.lex=function(re,ie){var le=new be(ie);return le.lex(re)};var de=be.prototype;return de.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},de.blockTokens=function(re,ie,le){ie===void 0&&(ie=[]),le===void 0&&(le=!0),re=re.replace(/^ +$/gm,"");for(var me,De,Te,Qe;re;){if(me=this.tokenizer.space(re)){re=re.substring(me.raw.length),me.type&&ie.push(me);continue}if(me=this.tokenizer.code(re,ie)){re=re.substring(me.raw.length),me.type?ie.push(me):(Qe=ie[ie.length-1],Qe.raw+=`
|
|
`+me.raw,Qe.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.heading(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.nptable(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.hr(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.blockquote(re)){re=re.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],le),ie.push(me);continue}if(me=this.tokenizer.list(re)){for(re=re.substring(me.raw.length),Te=me.items.length,De=0;De<Te;De++)me.items[De].tokens=this.blockTokens(me.items[De].text,[],!1);ie.push(me);continue}if(me=this.tokenizer.html(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(le&&(me=this.tokenizer.def(re))){re=re.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.lheading(re)){re=re.substring(me.raw.length),ie.push(me);continue}if(le&&(me=this.tokenizer.paragraph(re))){re=re.substring(me.raw.length),ie.push(me);continue}if(me=this.tokenizer.text(re,ie)){re=re.substring(me.raw.length),me.type?ie.push(me):(Qe=ie[ie.length-1],Qe.raw+=`
|
|
`+me.raw,Qe.text+=`
|
|
`+me.text);continue}if(re){var ct="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ct);break}else throw new Error(ct)}}return ie},de.inline=function(re){var ie,le,me,De,Te,Qe,ct=re.length;for(ie=0;ie<ct;ie++){Qe=re[ie];switch(Qe.type){case"paragraph":case"text":case"heading":{Qe.tokens=[],this.inlineTokens(Qe.text,Qe.tokens);break}case"table":{for(Qe.tokens={header:[],cells:[]},De=Qe.header.length,le=0;le<De;le++)Qe.tokens.header[le]=[],this.inlineTokens(Qe.header[le],Qe.tokens.header[le]);for(De=Qe.cells.length,le=0;le<De;le++)for(Te=Qe.cells[le],Qe.tokens.cells[le]=[],me=0;me<Te.length;me++)Qe.tokens.cells[le][me]=[],this.inlineTokens(Te[me],Qe.tokens.cells[le][me]);break}case"blockquote":{this.inline(Qe.tokens);break}case"list":{for(De=Qe.items.length,le=0;le<De;le++)this.inline(Qe.items[le].tokens);break}}}return re},de.inlineTokens=function(re,ie,le,me,De){ie===void 0&&(ie=[]),le===void 0&&(le=!1),me===void 0&&(me=!1),De===void 0&&(De="");var Te,Qe=re,ct;if(this.tokens.links){var xt=Object.keys(this.tokens.links);if(xt.length>0)for(;(ct=this.tokenizer.rules.inline.reflinkSearch.exec(Qe))!=null;)xt.includes(ct[0].slice(ct[0].lastIndexOf("[")+1,-1))&&(Qe=Qe.slice(0,ct.index)+"["+"a".repeat(ct[0].length-2)+"]"+Qe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ct=this.tokenizer.rules.inline.blockSkip.exec(Qe))!=null;)Qe=Qe.slice(0,ct.index)+"["+"a".repeat(ct[0].length-2)+"]"+Qe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Te=this.tokenizer.escape(re)){re=re.substring(Te.raw.length),ie.push(Te);continue}if(Te=this.tokenizer.tag(re,le,me)){re=re.substring(Te.raw.length),le=Te.inLink,me=Te.inRawBlock,ie.push(Te);continue}if(Te=this.tokenizer.link(re)){re=re.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,me)),ie.push(Te);continue}if(Te=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,me)),ie.push(Te);continue}if(Te=this.tokenizer.strong(re,Qe,De)){re=re.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],le,me),ie.push(Te);continue}if(Te=this.tokenizer.em(re,Qe,De)){re=re.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],le,me),ie.push(Te);continue}if(Te=this.tokenizer.codespan(re)){re=re.substring(Te.raw.length),ie.push(Te);continue}if(Te=this.tokenizer.br(re)){re=re.substring(Te.raw.length),ie.push(Te);continue}if(Te=this.tokenizer.del(re)){re=re.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],le,me),ie.push(Te);continue}if(Te=this.tokenizer.autolink(re,pe)){re=re.substring(Te.raw.length),ie.push(Te);continue}if(!le&&(Te=this.tokenizer.url(re,pe))){re=re.substring(Te.raw.length),ie.push(Te);continue}if(Te=this.tokenizer.inlineText(re,me,ce)){re=re.substring(Te.raw.length),De=Te.raw.slice(-1),ie.push(Te);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ie},H(be,null,[{key:"rules",get:function(){return{block:ot,inline:st}}}]),be}(),ze=F.defaults,qe=Z.cleanUrl,Je=Z.escape,rt=function(){function be(he){this.options=he||ze}var de=be.prototype;return de.code=function(re,ie,le){var me=(ie||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(re,me);De!=null&&De!==re&&(le=!0,re=De)}return me?'<pre><code class="'+this.options.langPrefix+Je(me,!0)+'">'+(le?re:Je(re,!0))+`</code></pre>
|
|
`:"<pre><code>"+(le?re:Je(re,!0))+`</code></pre>
|
|
`},de.blockquote=function(re){return`<blockquote>
|
|
`+re+`</blockquote>
|
|
`},de.html=function(re){return re},de.heading=function(re,ie,le,me){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+me.slug(le)+'">'+re+"</h"+ie+`>
|
|
`:"<h"+ie+">"+re+"</h"+ie+`>
|
|
`},de.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},de.list=function(re,ie,le){var me=ie?"ol":"ul",De=ie&&le!==1?' start="'+le+'"':"";return"<"+me+De+`>
|
|
`+re+"</"+me+`>
|
|
`},de.listitem=function(re){return"<li>"+re+`</li>
|
|
`},de.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},de.paragraph=function(re){return"<p>"+re+`</p>
|
|
`},de.table=function(re,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+re+`</thead>
|
|
`+ie+`</table>
|
|
`},de.tablerow=function(re){return`<tr>
|
|
`+re+`</tr>
|
|
`},de.tablecell=function(re,ie){var le=ie.header?"th":"td",me=ie.align?"<"+le+' align="'+ie.align+'">':"<"+le+">";return me+re+"</"+le+`>
|
|
`},de.strong=function(re){return"<strong>"+re+"</strong>"},de.em=function(re){return"<em>"+re+"</em>"},de.codespan=function(re){return"<code>"+re+"</code>"},de.br=function(){return this.options.xhtml?"<br/>":"<br>"},de.del=function(re){return"<del>"+re+"</del>"},de.link=function(re,ie,le){if(re=qe(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var me='<a href="'+Je(re)+'"';return ie&&(me+=' title="'+ie+'"'),me+=">"+le+"</a>",me},de.image=function(re,ie,le){if(re=qe(this.options.sanitize,this.options.baseUrl,re),re===null)return le;var me='<img src="'+re+'" alt="'+le+'"';return ie&&(me+=' title="'+ie+'"'),me+=this.options.xhtml?"/>":">",me},de.text=function(re){return re},be}(),tt=function(){function be(){}var de=be.prototype;return de.strong=function(re){return re},de.em=function(re){return re},de.codespan=function(re){return re},de.del=function(re){return re},de.html=function(re){return re},de.text=function(re){return re},de.link=function(re,ie,le){return""+le},de.image=function(re,ie,le){return""+le},de.br=function(){return""},be}(),Tt=function(){function be(){this.seen={}}var de=be.prototype;return de.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 le=ie;do this.seen[le]++,ie=le+"-"+this.seen[le];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},be}(),bt=F.defaults,Et=Z.unescape,yt=function(){function be(he){this.options=he||bt,this.options.renderer=this.options.renderer||new rt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new Tt}be.parse=function(re,ie){var le=new be(ie);return le.parse(re)};var de=be.prototype;return de.parse=function(re,ie){ie===void 0&&(ie=!0);var le="",me,De,Te,Qe,ct,xt,ft,ut,$e,Ve,Ne,oe,ve,He,je,pt,gt,Re,Ge=re.length;for(me=0;me<Ge;me++){Ve=re[me];switch(Ve.type){case"space":continue;case"hr":{le+=this.renderer.hr();continue}case"heading":{le+=this.renderer.heading(this.parseInline(Ve.tokens),Ve.depth,Et(this.parseInline(Ve.tokens,this.textRenderer)),this.slugger);continue}case"code":{le+=this.renderer.code(Ve.text,Ve.lang,Ve.escaped);continue}case"table":{for(ut="",ft="",Qe=Ve.header.length,De=0;De<Qe;De++)ft+=this.renderer.tablecell(this.parseInline(Ve.tokens.header[De]),{header:!0,align:Ve.align[De]});for(ut+=this.renderer.tablerow(ft),$e="",Qe=Ve.cells.length,De=0;De<Qe;De++){for(xt=Ve.tokens.cells[De],ft="",ct=xt.length,Te=0;Te<ct;Te++)ft+=this.renderer.tablecell(this.parseInline(xt[Te]),{header:!1,align:Ve.align[Te]});$e+=this.renderer.tablerow(ft)}le+=this.renderer.table(ut,$e);continue}case"blockquote":{$e=this.parse(Ve.tokens),le+=this.renderer.blockquote($e);continue}case"list":{for(Ne=Ve.ordered,oe=Ve.start,ve=Ve.loose,Qe=Ve.items.length,$e="",De=0;De<Qe;De++)je=Ve.items[De],pt=je.checked,gt=je.task,He="",je.task&&(Re=this.renderer.checkbox(pt),ve?je.tokens.length>0&&je.tokens[0].type==="text"?(je.tokens[0].text=Re+" "+je.tokens[0].text,je.tokens[0].tokens&&je.tokens[0].tokens.length>0&&je.tokens[0].tokens[0].type==="text"&&(je.tokens[0].tokens[0].text=Re+" "+je.tokens[0].tokens[0].text)):je.tokens.unshift({type:"text",text:Re}):He+=Re),He+=this.parse(je.tokens,ve),$e+=this.renderer.listitem(He,gt,pt);le+=this.renderer.list($e,Ne,oe);continue}case"html":{le+=this.renderer.html(Ve.text);continue}case"paragraph":{le+=this.renderer.paragraph(this.parseInline(Ve.tokens));continue}case"text":{for($e=Ve.tokens?this.parseInline(Ve.tokens):Ve.text;me+1<Ge&&re[me+1].type==="text";)Ve=re[++me],$e+=`
|
|
`+(Ve.tokens?this.parseInline(Ve.tokens):Ve.text);le+=ie?this.renderer.paragraph($e):$e;continue}default:{var Ue='Token with "'+Ve.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return le},de.parseInline=function(re,ie){ie=ie||this.renderer;var le="",me,De,Te=re.length;for(me=0;me<Te;me++){De=re[me];switch(De.type){case"escape":{le+=ie.text(De.text);break}case"html":{le+=ie.html(De.text);break}case"link":{le+=ie.link(De.href,De.title,this.parseInline(De.tokens,ie));break}case"image":{le+=ie.image(De.href,De.title,De.text);break}case"strong":{le+=ie.strong(this.parseInline(De.tokens,ie));break}case"em":{le+=ie.em(this.parseInline(De.tokens,ie));break}case"codespan":{le+=ie.codespan(De.text);break}case"br":{le+=ie.br();break}case"del":{le+=ie.del(this.parseInline(De.tokens,ie));break}case"text":{le+=ie.text(De.text);break}default:{var Qe='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(Qe);return}else throw new Error(Qe)}}}return le},be}(),Ot=Z.merge,At=Z.checkSanitizeDeprecation,Ae=Z.escape,xe=F.getDefaults,Be=F.changeDefaults,Ze=F.defaults;function Pe(be,de,he){if(typeof be=="undefined"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof de=="function"&&(he=de,de=null),de=Ot({},Pe.defaults,de||{}),At(de),he){var re=de.highlight,ie;try{ie=Oe.lex(be,de)}catch(Te){return he(Te)}var le=function(Qe){var ct;if(!Qe)try{ct=yt.parse(ie,de)}catch(xt){Qe=xt}return de.highlight=re,Qe?he(Qe):he(null,ct)};if(!re||re.length<3)return le();if(delete de.highlight,!ie.length)return le();var me=0;Pe.walkTokens(ie,function(Te){Te.type==="code"&&(me++,setTimeout(function(){re(Te.text,Te.lang,function(Qe,ct){if(Qe)return le(Qe);ct!=null&&ct!==Te.text&&(Te.text=ct,Te.escaped=!0),me--,me===0&&le()})},0))}),me===0&&le();return}try{var De=Oe.lex(be,de);return de.walkTokens&&Pe.walkTokens(De,de.walkTokens),yt.parse(De,de)}catch(Te){if(Te.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,de.silent)return"<p>An error occurred:</p><pre>"+Ae(Te.message+"",!0)+"</pre>";throw Te}}Pe.options=Pe.setOptions=function(be){return Ot(Pe.defaults,be),Be(Pe.defaults),Pe},Pe.getDefaults=xe,Pe.defaults=Ze,Pe.use=function(be){var de=Ot({},be);if(be.renderer&&function(){var re=Pe.defaults.renderer||new rt,ie=function(De){var Te=re[De];re[De]=function(){for(var Qe=arguments.length,ct=new Array(Qe),xt=0;xt<Qe;xt++)ct[xt]=arguments[xt];var ft=be.renderer[De].apply(re,ct);return ft===!1&&(ft=Te.apply(re,ct)),ft}};for(var le in be.renderer)ie(le);de.renderer=re}(),be.tokenizer&&function(){var re=Pe.defaults.tokenizer||new Se,ie=function(De){var Te=re[De];re[De]=function(){for(var Qe=arguments.length,ct=new Array(Qe),xt=0;xt<Qe;xt++)ct[xt]=arguments[xt];var ft=be.tokenizer[De].apply(re,ct);return ft===!1&&(ft=Te.apply(re,ct)),ft}};for(var le in be.tokenizer)ie(le);de.tokenizer=re}(),be.walkTokens){var he=Pe.defaults.walkTokens;de.walkTokens=function(re){be.walkTokens(re),he&&he(re)}}Pe.setOptions(de)},Pe.walkTokens=function(be,de){for(var he=N(be),re;!(re=he()).done;){var ie=re.value;de(ie);switch(ie.type){case"table":{for(var le=N(ie.tokens.header),me;!(me=le()).done;){var De=me.value;Pe.walkTokens(De,de)}for(var Te=N(ie.tokens.cells),Qe;!(Qe=Te()).done;)for(var ct=Qe.value,xt=N(ct),ft;!(ft=xt()).done;){var ut=ft.value;Pe.walkTokens(ut,de)}break}case"list":{Pe.walkTokens(ie.items,de);break}default:ie.tokens&&Pe.walkTokens(ie.tokens,de)}}},Pe.Parser=yt,Pe.parser=yt.parse,Pe.Renderer=rt,Pe.TextRenderer=tt,Pe.Lexer=Oe,Pe.lexer=Oe.lex,Pe.Tokenizer=Se,Pe.Slugger=Tt,Pe.parse=Pe;var Xe=Pe;return Xe})},"DlR+":function(Ye,se,k){var Q=k("MFOe"),H=Q.Global,M=Q.trim;Ye.exports={name:"cookieStorage",read:N,write:F,each:A,remove:U,clearAll:S};var W=H.document;function N(d){if(!d||!L(d))return null;var v="(?:^|.*;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(W.cookie.replace(new RegExp(v),"$1"))}function A(d){for(var v=W.cookie.split(/; ?/g),C=v.length-1;C>=0;C--){if(!M(v[C]))continue;var p=v[C].split("="),h=unescape(p[0]),f=unescape(p[1]);d(f,h)}}function F(d,v){if(!d)return;W.cookie=escape(d)+"="+escape(v)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function U(d){if(!d||!L(d))return;W.cookie=escape(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function S(){A(function(d,v){U(v)})}function L(d){return new RegExp("(?:^|;\\s*)"+escape(d).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(W.cookie)}},EHPI:function(Ye,se,k){"use strict";var Q=k("bbsP"),H=k("/wGt"),M=k("tJVT"),W=k("k1fw"),N=k("q1tI"),A=k.n(N),F=k("ZW9T"),U=k("ZD9Y"),S=k("M8RZ"),L=k("bCnd"),d=k("fcyK"),v=k.n(d),C={theme:Object(L.a)("cmCodeMode","vs-dark"),fontSize:Object(L.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(L.a)("cmTabToSpace",!0)},p;(function(n){n[n.set_font_size=0]="set_font_size",n[n.set_theme=1]="set_theme",n[n.on_tab_to_space=2]="on_tab_to_space",n[n.set_show_editor_setting=3]="set_show_editor_setting"})(p||(p={}));function h(n,r){switch(r.type){case p.set_show_editor_setting:return Object(W.a)(Object(W.a)({},n),{},{showEditorSetting:r.payload});case p.set_theme:return Object(W.a)(Object(W.a)({},n),{},{theme:r.payload});case p.set_font_size:return Object(W.a)(Object(W.a)({},n),{},{fontSize:r.payload});case p.on_tab_to_space:return Object(W.a)(Object(W.a)({},n),{},{tabToSpace:r.payload});default:throw new Error}}se.a=function(n){var r=n.value,o=n.onChange,l=n.language,x=n.ActionBarRender,E=x===void 0?function(K){return A.a.createElement(f,{onShowCodeSetting:K})}:x,y=Object(N.useReducer)(h,C),R=Object(M.a)(y,2),O=R[0],g=R[1],m=O.theme,s=O.fontSize,u=O.showEditorSetting,_=O.tabToSpace,T={onFontSizeChange:function(Z){g({type:p.set_font_size,payload:Z}),Object(L.b)("cmFontSize",Z)},tabToSpace:_,cmFontSize:s,className:"oj",cmCodeMode:m,onTabToSpace:function(Z){g({type:p.on_tab_to_space,payload:Z}),Object(L.b)("cmTabToSpace",Z)},onCodeModeChange:function(Z){g({type:p.set_theme,payload:Z}),Object(L.b)("cmCodeMode",Z)}};function w(){g({type:p.set_show_editor_setting,payload:!1})}function P(){g({type:p.set_show_editor_setting,payload:!0})}var j={value:r,language:l,onChange:o,theme:m,height:"calc(100% - 56px)",options:{fontSize:s,insertSpaces:_}};return A.a.createElement(N.Fragment,null,A.a.createElement("div",{className:"code-panel-container"},E(P),A.a.createElement(F.b,j)),A.a.createElement(S.a,null,A.a.createElement(H.a,{className:"oj",title:null,placement:"right",closable:!1,visible:u,onClose:w},A.a.createElement(U.a,T))))};function f(n){var r=n.onShowCodeSetting;return A.a.createElement("div",{className:"action-bar"},A.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),A.a.createElement("a",{onClick:r},A.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=Q.Pos;Q.defineOption("autoCloseBrackets",!1,function(h,f,n){n&&n!=Q.Init&&(h.removeKeyMap(N),h.state.closeBrackets=null),f&&(A(W(f,"pairs")),h.state.closeBrackets=f,h.addKeyMap(N))});function W(h,f){return f=="pairs"&&typeof h=="string"?h:typeof h=="object"&&h[f]!=null?h[f]:H[f]}var N={Backspace:S,Enter:L};function A(h){for(var f=0;f<h.length;f++){var n=h.charAt(f),r="'"+n+"'";N[r]||(N[r]=F(n))}}A(H.pairs+"`");function F(h){return function(f){return v(f,h)}}function U(h){var f=h.state.closeBrackets;if(!f||f.override)return f;var n=h.getModeAt(h.getCursor());return n.closeBrackets||f}function S(h){var f=U(h);if(!f||h.getOption("disableInput"))return Q.Pass;for(var n=W(f,"pairs"),r=h.listSelections(),o=0;o<r.length;o++){if(!r[o].empty())return Q.Pass;var l=C(h,r[o].head);if(!l||n.indexOf(l)%2!=0)return Q.Pass}for(var o=r.length-1;o>=0;o--){var x=r[o].head;h.replaceRange("",M(x.line,x.ch-1),M(x.line,x.ch+1),"+delete")}}function L(h){var f=U(h),n=f&&W(f,"explode");if(!n||h.getOption("disableInput"))return Q.Pass;for(var r=h.listSelections(),o=0;o<r.length;o++){if(!r[o].empty())return Q.Pass;var l=C(h,r[o].head);if(!l||n.indexOf(l)%2!=0)return Q.Pass}h.operation(function(){var x=h.lineSeparator()||`
|
|
`;h.replaceSelection(x+x,null),h.execCommand("goCharLeft"),r=h.listSelections();for(var E=0;E<r.length;E++){var y=r[E].head.line;h.indentLine(y,null,!0),h.indentLine(y+1,null,!0)}})}function d(h){var f=Q.cmpPos(h.anchor,h.head)>0;return{anchor:new M(h.anchor.line,h.anchor.ch+(f?-1:1)),head:new M(h.head.line,h.head.ch+(f?1:-1))}}function v(h,f){var n=U(h);if(!n||h.getOption("disableInput"))return Q.Pass;var r=W(n,"pairs"),o=r.indexOf(f);if(o==-1)return Q.Pass;for(var l=W(n,"closeBefore"),x=W(n,"triples"),E=r.charAt(o+1)==f,y=h.listSelections(),R=o%2==0,O,g=0;g<y.length;g++){var m=y[g],s=m.head,u,_=h.getRange(s,M(s.line,s.ch+1));if(R&&!m.empty())u="surround";else if((E||!R)&&_==f)E&&p(h,s)?u="both":x.indexOf(f)>=0&&h.getRange(s,M(s.line,s.ch+3))==f+f+f?u="skipThree":u="skip";else if(E&&s.ch>1&&x.indexOf(f)>=0&&h.getRange(M(s.line,s.ch-2),s)==f+f){if(s.ch>2&&/\bstring/.test(h.getTokenTypeAt(M(s.line,s.ch-2))))return Q.Pass;u="addFour"}else if(E){var T=s.ch==0?" ":h.getRange(M(s.line,s.ch-1),s);if(!Q.isWordChar(_)&&T!=f&&!Q.isWordChar(T))u="both";else return Q.Pass}else if(R&&(_.length===0||/\s/.test(_)||l.indexOf(_)>-1))u="both";else return Q.Pass;if(!O)O=u;else if(O!=u)return Q.Pass}var w=o%2?r.charAt(o-1):f,P=o%2?f:r.charAt(o+1);h.operation(function(){if(O=="skip")h.execCommand("goCharRight");else if(O=="skipThree")for(var j=0;j<3;j++)h.execCommand("goCharRight");else if(O=="surround"){for(var K=h.getSelections(),j=0;j<K.length;j++)K[j]=w+K[j]+P;h.replaceSelections(K,"around"),K=h.listSelections().slice();for(var j=0;j<K.length;j++)K[j]=d(K[j]);h.setSelections(K)}else O=="both"?(h.replaceSelection(w+P,null),h.triggerElectric(w+P),h.execCommand("goCharLeft")):O=="addFour"&&(h.replaceSelection(w+w+w+w,"before"),h.execCommand("goCharRight"))})}function C(h,f){var n=h.getRange(M(f.line,f.ch-1),M(f.line,f.ch+1));return n.length==2?n:null}function p(h,f){var n=h.getTokenAt(M(f.line,f.ch+1));return/\bstring/.test(n.type)&&n.start==f.ch&&(f.ch==0||!/\bstring/.test(h.getTokenTypeAt(f)))}})},FOrL:function(Ye,se,k){Ye.exports=k.p+"static/nodata.a6b3f948.png"},Gytx:function(Ye,se){Ye.exports=function(Q,H,M,W){var N=M?M.call(W,Q,H):void 0;if(N!==void 0)return!!N;if(Q===H)return!0;if(typeof Q!="object"||!Q||typeof H!="object"||!H)return!1;var A=Object.keys(Q),F=Object.keys(H);if(A.length!==F.length)return!1;for(var U=Object.prototype.hasOwnProperty.bind(H),S=0;S<A.length;S++){var L=A[S];if(!U(L))return!1;var d=Q[L],v=H[L];if(N=M?M.call(W,d,v,L):void 0,N===!1||N===void 0&&d!==v)return!1}return!0}},H2Ag:function(Ye,se,k){Ye.exports={"left-panel":"left-panel___19pOi","tab-panel-body":"tab-panel-body___1Wa4B","s-navs":"s-navs___Rtxdn","bg-white":"bg-white___3Or1a",active:"active___x-fRG"}},HmJG:function(Ye,se,k){},I8Z2:function(Ye,se,k){"use strict";k.d(se,"a",function(){return W}),k.d(se,"b",function(){return C}),k.d(se,"c",function(){return h});var Q=k("q1tI"),H=function(){var f=function(n,r){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var x in l)l.hasOwnProperty(x)&&(o[x]=l[x])},f(n,r)};return function(n,r){f(n,r);function o(){this.constructor=n}n.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),M=Q.createContext(null),W=function(f){H(n,f);function n(){return f!==null&&f.apply(this,arguments)||this}return n.prototype.render=function(){return Q.createElement(M.Provider,{value:this.props.store},this.props.children)},n}(Q.Component),N=k("Gytx"),A=k.n(N),F=k("2mql"),U=k.n(F),S=function(){var f=function(n,r){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var x in l)l.hasOwnProperty(x)&&(o[x]=l[x])},f(n,r)};return function(n,r){f(n,r);function o(){this.constructor=n}n.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),L=function(){return L=Object.assign||function(f){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(f[l]=n[l])}return f},L.apply(this,arguments)};function d(f){return f.displayName||f.name||"Component"}var v=function(){return{}};function C(f,n){n===void 0&&(n={});var r=!!f,o=f||v;return function(x){var E=function(R){S(O,R);function O(g,m){var s=R.call(this,g,m)||this;return s.unsubscribe=null,s.handleChange=function(){if(!s.unsubscribe)return;var u=o(s.store.getState(),s.props);s.setState({subscribed:u})},s.store=s.context,s.state={subscribed:o(s.store.getState(),g),store:s.store,props:g},s}return O.getDerivedStateFromProps=function(g,m){return f&&f.length===2&&g!==m.props?{subscribed:o(m.store.getState(),g),props:g}:{props:g}},O.prototype.componentDidMount=function(){this.trySubscribe()},O.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},O.prototype.shouldComponentUpdate=function(g,m){return!A()(this.props,g)||!A()(this.state.subscribed,m.subscribed)},O.prototype.trySubscribe=function(){r&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},O.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},O.prototype.render=function(){var g=L(L(L({},this.props),this.state.subscribed),{store:this.store});return Q.createElement(x,L({},g,{ref:this.props.miniStoreForwardedRef}))},O.displayName="Connect("+d(x)+")",O.contextType=M,O}(Q.Component);if(n.forwardRef){var y=Q.forwardRef(function(R,O){return Q.createElement(E,L({},R,{miniStoreForwardedRef:O}))});return U()(y,x)}return U()(E,x)}}var p=function(){return p=Object.assign||function(f){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(f[l]=n[l])}return f},p.apply(this,arguments)};function h(f){var n=f,r=[];function o(E){n=p(p({},n),E);for(var y=0;y<r.length;y++)r[y]()}function l(){return n}function x(E){return r.push(E),function(){var R=r.indexOf(E);r.splice(R,1)}}return{setState:o,getState:l,subscribe:x}}},IBYe:function(Ye,se,k){"use strict";function Q(H){return null}se.a=Q},IxHN:function(Ye,se,k){"use strict";var Q=k("q1tI"),H=k.n(Q),M=k("07cG"),W=k.n(M);se.a=function(N){var A=N.message,F=N.className,U=N.children,S=N.style,L=S===void 0?{}:S;return H.a.createElement("div",{className:"".concat(W.a.idsRingWrapper," ").concat(F)},H.a.createElement("div",{className:W.a.ldsRing},H.a.createElement("div",null),H.a.createElement("div",null),H.a.createElement("div",null),H.a.createElement("div",null)),A?H.a.createElement("p",{style:L},A):null,U)}},J66h:function(Ye,se,k){(function(Q){var H,M;(function(W,N){Ye.exports=N(W)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q!="undefined"?Q:this,function(W){"use strict";W=W||{};var N=W.Base64,A="2.6.4",F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(w){for(var P={},j=0,K=w.length;j<K;j++)P[w.charAt(j)]=j;return P}(F),S=String.fromCharCode,L=function(w){if(w.length<2){var P=w.charCodeAt(0);return P<128?w:P<2048?S(192|P>>>6)+S(128|P&63):S(224|P>>>12&15)+S(128|P>>>6&63)+S(128|P&63)}else{var P=65536+(w.charCodeAt(0)-55296)*1024+(w.charCodeAt(1)-56320);return S(240|P>>>18&7)+S(128|P>>>12&63)+S(128|P>>>6&63)+S(128|P&63)}},d=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,v=function(w){return w.replace(d,L)},C=function(w){var P=[0,2,1][w.length%3],j=w.charCodeAt(0)<<16|(w.length>1?w.charCodeAt(1):0)<<8|(w.length>2?w.charCodeAt(2):0),K=[F.charAt(j>>>18),F.charAt(j>>>12&63),P>=2?"=":F.charAt(j>>>6&63),P>=1?"=":F.charAt(j&63)];return K.join("")},p=W.btoa&&typeof W.btoa=="function"?function(w){return W.btoa(w)}:function(w){if(w.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return w.replace(/[\s\S]{1,3}/g,C)},h=function(w){return p(v(String(w)))},f=function(w){return w.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},n=function(w,P){return P?f(h(w)):h(w)},r=function(w){return n(w,!0)},o;W.Uint8Array&&(o=function(w,P){for(var j="",K=0,Z=w.length;K<Z;K+=3){var G=w[K],B=w[K+1],$=w[K+2],ne=G<<16|B<<8|$;j+=F.charAt(ne>>>18)+F.charAt(ne>>>12&63)+(typeof B!="undefined"?F.charAt(ne>>>6&63):"=")+(typeof $!="undefined"?F.charAt(ne&63):"=")}return P?f(j):j});var l=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=function(w){switch(w.length){case 4:var P=(7&w.charCodeAt(0))<<18|(63&w.charCodeAt(1))<<12|(63&w.charCodeAt(2))<<6|63&w.charCodeAt(3),j=P-65536;return S((j>>>10)+55296)+S((j&1023)+56320);case 3:return S((15&w.charCodeAt(0))<<12|(63&w.charCodeAt(1))<<6|63&w.charCodeAt(2));default:return S((31&w.charCodeAt(0))<<6|63&w.charCodeAt(1))}},E=function(w){return w.replace(l,x)},y=function(w){var P=w.length,j=P%4,K=(P>0?U[w.charAt(0)]<<18:0)|(P>1?U[w.charAt(1)]<<12:0)|(P>2?U[w.charAt(2)]<<6:0)|(P>3?U[w.charAt(3)]:0),Z=[S(K>>>16),S(K>>>8&255),S(K&255)];return Z.length-=[0,0,2,1][j],Z.join("")},R=W.atob&&typeof W.atob=="function"?function(w){return W.atob(w)}:function(w){return w.replace(/\S{1,4}/g,y)},O=function(w){return R(String(w).replace(/[^A-Za-z0-9\+\/]/g,""))},g=function(w){return E(R(w))},m=function(w){return String(w).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},s=function(w){return g(m(w))},u;W.Uint8Array&&(u=function(w){return Uint8Array.from(O(m(w)),function(P){return P.charCodeAt(0)})});var _=function(){var w=W.Base64;return W.Base64=N,w};if(W.Base64={VERSION:A,atob:O,btoa:p,fromBase64:s,toBase64:n,utob:v,encode:n,encodeURI:r,btou:E,decode:s,noConflict:_,fromUint8Array:o,toUint8Array:u},typeof Object.defineProperty=="function"){var T=function(w){return{value:w,enumerable:!1,writable:!0,configurable:!0}};W.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T(function(){return s(this)})),Object.defineProperty(String.prototype,"toBase64",T(function(w){return n(this,w)})),Object.defineProperty(String.prototype,"toBase64URI",T(function(){return n(this,!0)}))}}return W.Meteor&&(Base64=W.Base64),Ye.exports?Ye.exports.Base64=W.Base64:!(H=[],M=function(){return W.Base64}.apply(se,H),M!==void 0&&(Ye.exports=M)),{Base64:W.Base64}})}).call(this,k("IyRk"))},JB8y:function(Ye,se,k){"use strict";k.d(se,"a",function(){return Q});var Q;(function(H){H[H.NOMATCH=-1]="NOMATCH",H[H.OK=0]="OK",H[H.TIMEOUT=2]="TIMEOUT",H[H.PODFAILURE=3]="PODFAILURE",H[H.COMPILEFAILURE=4]="COMPILEFAILURE",H[H.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(Q||(Q={}))},JPnl:function(Ye,se,k){"use strict";k.d(se,"a",function(){return y}),k.d(se,"c",function(){return g});var Q=k("+L6B"),H=k("2/Rp"),M=k("tJVT"),W=k("k1fw"),N=k("jrin"),A=k("5NDa"),F=k("5rEg"),U=k("q1tI"),S=k.n(U),L=k("8Skl"),d=k("y3Kf"),v=k("JB8y"),C=k("J66h"),p=k.n(C),h=k("a4uL"),f=k.n(h),n=k("IxHN"),r=k("9Bee"),o=k("1vsH"),l,x=F.a.TextArea,E={visible:!1,tabIndex:"0"},y=(l={},Object(N.a)(l,v.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(N.a)(l,v.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(N.a)(l,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(N.a)(l,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(N.a)(l,4,"\u7F16\u8BD1\u5931\u8D25"),Object(N.a)(l,5,"\u6267\u884C\u5931\u8D25"),l),R;(function(s){s[s.SET_VISIBLE=0]="SET_VISIBLE",s[s.SET_TABINDEX=1]="SET_TABINDEX"})(R||(R={}));function O(s,u){switch(u.type){case R.SET_VISIBLE:return Object(W.a)(Object(W.a)({},s),{},{visible:u.payload});case R.SET_TABINDEX:return Object(W.a)(Object(W.a)({},s),{},{tabIndex:u.payload});default:throw new Error}}function g(s){var u=s.status,_=s.error_msg,T=s.output,w=s.input,P=s.expected_output,j=s.is_file,K=s.input_file_url,Z=s.output_file_url,G=s.expected_output_file_url,B=null,$={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(u){case v.a.NOMATCH:B=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!j&&S.a.createElement(r.a,{value:w,style:$}),j&&S.a.createElement("div",{style:$},S.a.createElement("a",{onClick:function(){return Object(o.w)(K,w)}},w)),S.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!j&&S.a.createElement(r.a,{value:T&&C.Base64.decode(T)||"",style:$}),j&&S.a.createElement("div",{style:$},S.a.createElement("a",{onClick:function(){return Object(o.w)(Z,T)}},T)),S.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!j&&S.a.createElement(r.a,{value:P&&C.Base64.decode(P)||"",style:$}),j&&S.a.createElement("div",{style:$},S.a.createElement("a",{onClick:function(){return Object(o.w)(G,P)}},P)));break;case v.a.EXECUTEFAILURE:B=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&S.a.createElement(r.a,{value:w,style:$}),j&&S.a.createElement("div",{style:$},S.a.createElement("a",{onClick:function(){return Object(o.w)(K,w)}},w)),S.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),S.a.createElement("pre",{className:"error"},C.Base64.decode(_)));break;case v.a.COMPILEFAILURE:B=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&S.a.createElement(r.a,{value:w,style:$}),j&&S.a.createElement("div",{style:$},S.a.createElement("a",{onClick:function(){return Object(o.w)(K,w)}},w)),S.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),S.a.createElement("pre",{className:"error"},C.Base64.decode(_)));break;case v.a.PODFAILURE:B=S.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case v.a.TIMEOUT:B=S.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return S.a.createElement(S.a.Fragment,null," ",B," ")}function m(s){var u=s.status,_=s.error_msg,T=s.execute_time,w=s.output,P=s.input,j=s.expected_output,K=s.is_file,Z=s.input_file_url,G=s.output_file_url,B=s.expected_output_file_url,$=null;switch(u){case v.a.OK:$=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",T),S.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),S.a.createElement("pre",null,C.Base64.decode(w)));break;case v.a.NOMATCH:$=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u8F93\u5165\uFF1A",S.a.createElement("pre",null,P)),S.a.createElement("p",null,"\u8F93\u51FA\uFF1A",w&&C.Base64.decode(w)),S.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",j&&C.Base64.decode(j)));break;case v.a.EXECUTEFAILURE:$=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",S.a.createElement("pre",null,P)),S.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),S.a.createElement("pre",{className:"error"},C.Base64.decode(_)));break;case v.a.COMPILEFAILURE:$=S.a.createElement(S.a.Fragment,null,S.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",S.a.createElement("pre",null,P)),S.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),S.a.createElement("pre",{className:"error"},C.Base64.decode(_)));break;case v.a.PODFAILURE:$=S.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case v.a.TIMEOUT:$=S.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return S.a.createElement(S.a.Fragment,null," ",$," ")}se.b=function(s){var u=s.input,_=s.debuging,T=s.submitting,w=s.executingMessage,P=s.debugResult,j=s.onChangeInput,K=s.onDebugCode,Z=s.onSubmitCode,G=Object(U.useReducer)(O,E),B=Object(M.a)(G,2),$=B[0],ne=B[1],ae=$.visible,fe=$.tabIndex;function _e(Le){var ge=Le.target.id;ne({type:R.SET_TABINDEX,payload:ge})}function Se(){ne({type:R.SET_VISIBLE,payload:!ae})}var we=Object(U.useMemo)(function(){if(P){var Le=P.status;return S.a.createElement(S.a.Fragment,null,m(P))}return null},[P]);function Me(){ne({type:R.SET_VISIBLE,payload:!0}),ne({type:R.SET_TABINDEX,payload:"1"}),K()}return S.a.createElement("div",{className:"test-case-panel"},S.a.createElement("div",{className:"test-case-panel-body ".concat(ae?"active":"")},S.a.createElement("ul",{className:"s-navs"},S.a.createElement("li",null,S.a.createElement("a",{className:fe==="0"?"active":"",id:"0",onClick:_e},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),S.a.createElement("li",null,S.a.createElement("a",{className:fe==="1"?"active":"",id:"1",onClick:_e},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),S.a.createElement("div",{className:"tab-panel-body ".concat(fe==="0"?"":"hide")},S.a.createElement(x,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:u,onChange:j})),S.a.createElement("div",{className:"tab-panel-body ".concat(fe==="1"?"":"hide")},_?S.a.createElement(n.a,{message:w}):P?S.a.createElement("section",{style:{height:200}}," ",we," "):S.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),S.a.createElement("a",{className:"btn-collapse ".concat(ae?"up":""),onClick:Se},ae?S.a.createElement(L.a,null):S.a.createElement(d.a,null)),S.a.createElement("footer",{className:"footer"},S.a.createElement("span",null,"\u63A7\u5236\u53F0"),S.a.createElement("div",{className:"flex-container"},S.a.createElement(H.a,{className:"btn-green",type:"ghost",loading:_,onClick:Me},"\u8C03\u8BD5\u4EE3\u7801"),S.a.createElement(H.a,{type:"primary",loading:T,disabled:T,onClick:function(){ne({type:R.SET_VISIBLE,payload:!1}),Z()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},JYp7:function(Ye,se,k){"use strict";k.d(se,"c",function(){return H}),k.d(se,"d",function(){return M}),k.d(se,"f",function(){return N}),k.d(se,"a",function(){return A}),k.d(se,"b",function(){return F}),k.d(se,"e",function(){return U});var Q=function(){var S=function(L,d){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,C){v.__proto__=C}||function(v,C){for(var p in C)C.hasOwnProperty(p)&&(v[p]=C[p])},S(L,d)};return function(L,d){S(L,d);function v(){this.constructor=L}L.prototype=d===null?Object.create(d):(v.prototype=d.prototype,new v)}}(),H={done:!0,value:void 0},M;(function(S){var L={next:function(){return H}};function d(){return L}S.empty=d;function v(E){var y=!1;return{next:function(){return y?H:(y=!0,{done:!1,value:E})}}}S.single=v;function C(E,y,R){return y===void 0&&(y=0),R===void 0&&(R=E.length),{next:function(){return y>=R?H:{done:!1,value:E[y++]}}}}S.fromArray=C;function p(E){return{next:function(){var y=E.next();return y.done?H:{done:!1,value:y.value}}}}S.fromNativeIterator=p;function h(E){return E?Array.isArray(E)?S.fromArray(E):E:S.empty()}S.from=h;function f(E,y){return{next:function(){var R=E.next();return R.done?H:{done:!1,value:y(R.value)}}}}S.map=f;function n(E,y){return{next:function(){for(;;){var R=E.next();if(R.done)return H;if(y(R.value))return{done:!1,value:R.value}}}}}S.filter=n;function r(E,y){for(var R=E.next();!R.done;R=E.next())y(R.value)}S.forEach=r;function o(E,y){y===void 0&&(y=Number.POSITIVE_INFINITY);var R=[];if(y===0)return R;for(var O=0,g=E.next();!g.done&&!(R.push(g.value),++O>=y);g=E.next());return R}S.collect=o;function l(){for(var E=[],y=0;y<arguments.length;y++)E[y]=arguments[y];var R=0;return{next:function(){if(R>=E.length)return H;var O=E[R],g=O.next();return g.done?(R++,this.next()):g}}}S.concat=l;function x(E){return new W(E)}S.chain=x})(M||(M={}));var W=function(){function S(L){this.it=L}return S.prototype.next=function(){return this.it.next()},S}();function N(S){return Array.isArray(S)?M.fromArray(S):S||M.empty()}var A=function(){function S(L,d,v,C){d===void 0&&(d=0),v===void 0&&(v=L.length),C===void 0&&(C=d-1),this.items=L,this.start=d,this.end=v,this.index=C}return S.prototype.first=function(){return this.index=this.start,this.current()},S.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},S.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},S}(),F=function(S){Q(L,S);function L(d,v,C,p){return v===void 0&&(v=0),C===void 0&&(C=d.length),p===void 0&&(p=v-1),S.call(this,d,v,C,p)||this}return L.prototype.current=function(){return S.prototype.current.call(this)},L.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},L.prototype.first=function(){return this.index=this.start,this.current()},L.prototype.last=function(){return this.index=this.end-1,this.current()},L.prototype.parent=function(){return null},L}(A),U=function(){function S(L,d){this.iterator=L,this.fn=d}return S.prototype.next=function(){return this.fn(this.iterator.next())},S}()},LdHM:function(Ye,se,k){"use strict";k.d(se,"b",function(){return l}),k.d(se,"a",function(){return E});var Q=k("1OyB"),H=k("vuIU"),M=k("Ji7U"),W=k("LK+K"),N=k("q1tI"),A=k("rePB"),F=k("Ff2n"),U=k("ODXe"),S=k("4IlW"),L=k("bX4T"),d=k("YrtM"),v=k("TSYQ"),C=k.n(v),p=k("+nKL"),h=k("8OUc"),f=function($,ne){var ae=$.prefixCls,fe=$.id,_e=$.flattenOptions,Se=$.childrenAsData,we=$.values,Me=$.searchValue,Le=$.multiple,ge=$.defaultActiveFirstOption,ue=$.height,ke=$.itemHeight,lt=$.notFoundContent,ot=$.open,st=$.menuItemSelectedIcon,ce=$.virtual,pe=$.onSelect,Oe=$.onToggleOpen,ze=$.onActiveValue,qe=$.onScroll,Je=$.onMouseEnter,rt="".concat(ae,"-item"),tt=Object(d.a)(function(){return _e},[ot,_e],function(Xe,be){return be[0]&&Xe[1]!==be[1]}),Tt=N.useRef(null),bt=function(be){be.preventDefault()},Et=function(be){Tt.current&&Tt.current.scrollTo({index:be})},yt=function(be){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,he=tt.length,re=0;re<he;re+=1){var ie=(be+re*de+he)%he,le=tt[ie],me=le.group,De=le.data;if(!me&&!De.disabled)return ie}return-1},Ot=N.useState(function(){return yt(0)}),At=Object(U.a)(Ot,2),Ae=At[0],xe=At[1],Be=function(be){xe(be);var de=tt[be];if(!de){ze(null,-1);return}ze(de.data.value,be)};N.useEffect(function(){Be(ge!==!1?yt(0):-1)},[tt.length,Me]),N.useEffect(function(){var Xe=setTimeout(function(){if(!Le&&ot&&we.size===1){var be=Array.from(we)[0],de=tt.findIndex(function(he){var re=he.data;return re.value===be});Be(de),Et(de)}});return function(){return clearTimeout(Xe)}},[ot]);var Ze=function(be){be!==void 0&&pe(be,{selected:!we.has(be)}),Le||Oe(!1)};if(N.useImperativeHandle(ne,function(){return{onKeyDown:function(be){var de=be.which;switch(de){case S.a.UP:case S.a.DOWN:{var he=0;if(de===S.a.UP?he=-1:de===S.a.DOWN&&(he=1),he!==0){var re=yt(Ae+he,he);Et(re),Be(re)}break}case S.a.ENTER:{var ie=tt[Ae];ie&&!ie.data.disabled?Ze(ie.data.value):Ze(void 0),ot&&be.preventDefault();break}case S.a.ESC:Oe(!1)}},onKeyUp:function(){},scrollTo:function(be){Et(be)}}}),tt.length===0)return N.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(rt,"-empty"),onMouseDown:bt},lt);function Pe(Xe){var be=tt[Xe];if(!be)return null;var de=be.data||{},he=de.value,re=de.label,ie=de.children,le=Object(L.a)(de,!0),me=Se?ie:re;return be?N.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},le,{key:Xe,role:"option",id:"".concat(fe,"_list_").concat(Xe),"aria-selected":we.has(he)}),he):null}return N.createElement(N.Fragment,null,N.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Pe(Ae-1),Pe(Ae),Pe(Ae+1)),N.createElement(p.a,{itemKey:"key",ref:Tt,data:tt,height:ue,itemHeight:ke,fullHeight:!1,onMouseDown:bt,onScroll:qe,virtual:ce,onMouseEnter:Je},function(Xe,be){var de,he=Xe.group,re=Xe.groupOption,ie=Xe.data,le=ie.label,me=ie.key;if(he)return N.createElement("div",{className:C()(rt,"".concat(rt,"-group"))},le!==void 0?le:me);var De=ie.disabled,Te=ie.value,Qe=ie.title,ct=ie.children,xt=ie.style,ft=ie.className,ut=Object(F.a)(ie,["disabled","value","title","children","style","className"]),$e=we.has(Te),Ve="".concat(rt,"-option"),Ne=C()(rt,Ve,ft,(de={},Object(A.a)(de,"".concat(Ve,"-grouped"),re),Object(A.a)(de,"".concat(Ve,"-active"),Ae===be&&!De),Object(A.a)(de,"".concat(Ve,"-disabled"),De),Object(A.a)(de,"".concat(Ve,"-selected"),$e),de)),oe=Se?ct:le,ve=!st||typeof st=="function"||$e;return N.createElement("div",Object.assign({},ut,{"aria-selected":$e,className:Ne,title:Qe,onMouseMove:function(){if(Ae===be||De)return;Be(be)},onClick:function(){De||Ze(Te)},style:xt}),N.createElement("div",{className:"".concat(Ve,"-content")},oe||Te),N.isValidElement(st)||$e,ve&&N.createElement(h.a,{className:"".concat(rt,"-option-state"),customizeIcon:st,customizeIconProps:{isSelected:$e}},$e?"\u2713":null))}))},n=N.forwardRef(f);n.displayName="OptionList";var r=n,o=function(){return null};o.isSelectOption=!0;var l=o,x=function(){return null};x.isSelectOptGroup=!0;var E=x,y=k("VTBJ"),R=k("Zm9Q");function O(B){var $=B.key,ne=B.props,ae=ne.children,fe=ne.value,_e=Object(F.a)(ne,["children","value"]);return Object(y.a)({key:$,value:fe!==void 0?fe:$,children:ae},_e)}function g(B){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(B).map(function(ne,ae){if(!N.isValidElement(ne)||!ne.type)return null;var fe=ne.type.isSelectOptGroup,_e=ne.key,Se=ne.props,we=Se.children,Me=Object(F.a)(Se,["children"]);return $||!fe?O(ne):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(_e===null?ae:_e,"__"),label:_e},Me),{},{options:g(we)})}).filter(function(ne){return ne})}var m=k("2Qr1"),s=k("qNPg"),u=k("U8pU"),_=k("Kwbf"),T=k("WKfj");function w(B){var $=B.mode,ne=B.options,ae=B.children,fe=B.backfill,_e=B.allowClear,Se=B.placeholder,we=B.getInputElement,Me=B.showSearch,Le=B.onSearch,ge=B.defaultOpen,ue=B.autoFocus,ke=B.labelInValue,lt=B.value,ot=B.inputValue,st=B.optionLabelProp,ce=$==="multiple"||$==="tags",pe=Me!==void 0?Me:ce||$==="combobox",Oe=ne||g(ae);if(Object(_.a)($!=="tags"||Oe.every(function(rt){return!rt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var ze=Oe.some(function(rt){return rt.options?rt.options.some(function(tt){return typeof("value"in tt?tt.value:tt.key)=="number"}):typeof("value"in rt?rt.value:rt.key)=="number"});Object(_.a)(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)($!=="combobox"||!st,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)($==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(_.a)($==="combobox"||!we,"`getInputElement` only work with `combobox` mode."),Object(_.b)($!=="combobox"||!we||!_e||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Le&&!pe&&$!=="combobox"&&$!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ge||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),lt!=null){var qe=Object(T.d)(lt);Object(_.a)(!ke||qe.every(function(rt){return Object(u.a)(rt)==="object"&&("key"in rt||"value"in rt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!ce||Array.isArray(lt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Je=null;Object(R.a)(ae).some(function(rt){if(!N.isValidElement(rt)||!rt.type)return!1;var tt=rt.type;if(tt.isSelectOption)return!1;if(tt.isSelectOptGroup){var Tt=Object(R.a)(rt.props.children).every(function(bt){return!N.isValidElement(bt)||!rt.type||bt.type.isSelectOption?!0:(Je=bt.type,!1)});return!Tt}return Je=tt,!0}),Je&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Je.displayName||Je.name||Je,"`.")),Object(_.a)(ot===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=w,j=Object(s.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:g,flattenOptions:m.d,getLabeledValue:m.e,filterOptions:m.b,isValueDisabled:m.g,findValueOption:m.c,warningProps:P,fillOptionsWithMissingValue:m.a}),K=function(B){Object(M.a)(ne,B);var $=Object(W.a)(ne);function ne(){var ae;return Object(Q.a)(this,ne),ae=$.apply(this,arguments),ae.selectRef=N.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(H.a)(ne,[{key:"render",value:function(){return N.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),ne}(N.Component);K.Option=l,K.OptGroup=E;var Z=K,G=se.c=Z},M8RZ:function(Ye,se,k){"use strict";k.d(se,"a",function(){return S});var Q=k("fWQN"),H=k("mtLc"),M=k("yKVA"),W=k("879j"),N=k("q1tI"),A=k.n(N),F=k("i8i4"),U=k.n(F),S=function(L){Object(M.a)(v,L);var d=Object(W.a)(v);function v(C){var p;Object(Q.a)(this,v),p=d.call(this,C);var h=window.document;return p.node=h.createElement("div"),h.body.appendChild(p.node),p}return Object(H.a)(v,[{key:"render",value:function(){var p=this.props.children;return Object(F.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),v}(A.a.Component)},MFOe:function(Ye,se,k){(function(Q){var H=A(),M=F(),W=U(),N=typeof window!="undefined"?window:Q;Ye.exports={assign:H,create:M,trim:W,bind:S,slice:L,each:d,map:v,pluck:C,isList:p,isFunction:h,isObject:f,Global:N};function A(){return Object.assign?Object.assign:function(r,o,l,x){for(var E=1;E<arguments.length;E++)d(Object(arguments[E]),function(y,R){r[R]=y});return r}}function F(){if(Object.create)return function(o,l,x,E){var y=L(arguments,1);return H.apply(this,[Object.create(o)].concat(y))};{function n(){}return function(o,l,x,E){var y=L(arguments,1);return n.prototype=o,H.apply(this,[new n].concat(y))}}}function U(){return String.prototype.trim?function(r){return String.prototype.trim.call(r)}:function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function S(n,r){return function(){return r.apply(n,Array.prototype.slice.call(arguments,0))}}function L(n,r){return Array.prototype.slice.call(n,r||0)}function d(n,r){C(n,function(o,l){return r(o,l),!1})}function v(n,r){var o=p(n)?[]:{};return C(n,function(l,x){return o[x]=r(l,x),!1}),o}function C(n,r){if(p(n)){for(var o=0;o<n.length;o++)if(r(n[o],o))return n[o]}else for(var l in n)if(n.hasOwnProperty(l)&&r(n[l],l))return n[l]}function p(n){return n!=null&&typeof n!="function"&&typeof n.length=="number"}function h(n){return n&&{}.toString.call(n)==="[object Function]"}function f(n){return n&&{}.toString.call(n)==="[object Object]"}}).call(this,k("IyRk"))},MI8n:function(Ye,se,k){"use strict";k.d(se,"b",function(){return A}),k.d(se,"a",function(){return S}),k.d(se,"e",function(){return L}),k.d(se,"d",function(){return d}),k.d(se,"c",function(){return v}),k.d(se,"f",function(){return C});var Q=k("/cxE"),H=k("C/vA"),M=k("pmY6"),W=k("24hK"),N=function(){var p=function(h,f){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},p(h,f)};return function(h,f){p(h,f);function n(){this.constructor=h}h.prototype=f===null?Object.create(f):(n.prototype=f.prototype,new n)}}(),A;(function(p){p.None=function(){return M.a.None};function h(P){return function(j,K,Z){K===void 0&&(K=null);var G=!1,B;return B=P(function($){return G?void 0:(B?B.dispose():G=!0,j.call(K,$))},null,Z),G&&B.dispose(),B}}p.once=h;function f(P,j){return E(function(K,Z,G){return Z===void 0&&(Z=null),P(function(B){return K.call(Z,j(B))},null,G)})}p.map=f;function n(P,j){return E(function(K,Z,G){return Z===void 0&&(Z=null),P(function(B){j(B),K.call(Z,B)},null,G)})}p.forEach=n;function r(P,j){return E(function(K,Z,G){return Z===void 0&&(Z=null),P(function(B){return j(B)&&K.call(Z,B)},null,G)})}p.filter=r;function o(P){return P}p.signal=o;function l(){for(var P=[],j=0;j<arguments.length;j++)P[j]=arguments[j];return function(K,Z,G){return Z===void 0&&(Z=null),M.e.apply(void 0,P.map(function(B){return B(function($){return K.call(Z,$)},null,G)}))}}p.any=l;function x(P,j,K){var Z=K;return f(P,function(G){return Z=j(Z,G),Z})}p.reduce=x;function E(P){var j,K=new S({onFirstListenerAdd:function(){j=P(K.fire,K)},onLastListenerRemove:function(){j.dispose()}});return K.event}p.snapshot=E;function y(P,j,K,Z,G){K===void 0&&(K=100),Z===void 0&&(Z=!1);var B,$=void 0,ne=void 0,ae=0,fe=new S({leakWarningThreshold:G,onFirstListenerAdd:function(){B=P(function(_e){ae++,$=j($,_e),Z&&!ne&&(fe.fire($),$=void 0),clearTimeout(ne),ne=setTimeout(function(){var Se=$;$=void 0,ne=void 0,(!Z||ae>1)&&fe.fire(Se),ae=0},K)})},onLastListenerRemove:function(){B.dispose()}});return fe.event}p.debounce=y;function R(P){var j=new Date().getTime();return f(h(P),function(K){return new Date().getTime()-j})}p.stopwatch=R;function O(P){var j=!0,K;return r(P,function(Z){var G=j||Z!==K;return j=!1,K=Z,G})}p.latch=O;function g(P,j,K){j===void 0&&(j=!1),K===void 0&&(K=[]);var Z=K.slice(),G=P(function(ne){Z?Z.push(ne):$.fire(ne)}),B=function(){Z&&Z.forEach(function(ne){return $.fire(ne)}),Z=null},$=new S({onFirstListenerAdd:function(){G||(G=P(function(ne){return $.fire(ne)}))},onFirstListenerDidAdd:function(){Z&&(j?setTimeout(B):B())},onLastListenerRemove:function(){G&&G.dispose(),G=null}});return $.event}p.buffer=g;var m=function(){function P(j){this.event=j}return P.prototype.map=function(j){return new P(f(this.event,j))},P.prototype.forEach=function(j){return new P(n(this.event,j))},P.prototype.filter=function(j){return new P(r(this.event,j))},P.prototype.reduce=function(j,K){return new P(x(this.event,j,K))},P.prototype.latch=function(){return new P(O(this.event))},P.prototype.debounce=function(j,K,Z,G){return K===void 0&&(K=100),Z===void 0&&(Z=!1),new P(y(this.event,j,K,Z,G))},P.prototype.on=function(j,K,Z){return this.event(j,K,Z)},P.prototype.once=function(j,K,Z){return h(this.event)(j,K,Z)},P}();function s(P){return new m(P)}p.chain=s;function u(P,j,K){K===void 0&&(K=function(ne){return ne});var Z=function(){for(var ne=[],ae=0;ae<arguments.length;ae++)ne[ae]=arguments[ae];return $.fire(K.apply(void 0,ne))},G=function(){return P.on(j,Z)},B=function(){return P.removeListener(j,Z)},$=new S({onFirstListenerAdd:G,onLastListenerRemove:B});return $.event}p.fromNodeEventEmitter=u;function _(P,j,K){K===void 0&&(K=function(ne){return ne});var Z=function(){for(var ne=[],ae=0;ae<arguments.length;ae++)ne[ae]=arguments[ae];return $.fire(K.apply(void 0,ne))},G=function(){return P.addEventListener(j,Z)},B=function(){return P.removeEventListener(j,Z)},$=new S({onFirstListenerAdd:G,onLastListenerRemove:B});return $.event}p.fromDOMEventEmitter=_;function T(P){var j=new S,K=!1;return P.then(void 0,function(){return null}).then(function(){K?j.fire(void 0):setTimeout(function(){return j.fire(void 0)},0)}),K=!0,j.event}p.fromPromise=T;function w(P){return new Promise(function(j){return h(P)(j)})}p.toPromise=w})(A||(A={}));var F=-1,U=function(){function p(h,f){f===void 0&&(f=Math.random().toString(18).slice(2,5)),this.customThreshold=h,this.name=f,this._warnCountdown=0}return p.prototype.dispose=function(){this._stacks&&this._stacks.clear()},p.prototype.check=function(h){var f=this,n=F;if(typeof this.customThreshold=="number"&&(n=this.customThreshold),n<=0||h<n)return;this._stacks||(this._stacks=new Map);var r=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),o=this._stacks.get(r)||0;if(this._stacks.set(r,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;var l,x=0;this._stacks.forEach(function(E,y){(!l||x<E)&&(l=y,x=E)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+h+" listeners already. MOST frequent listener ("+x+"):"),console.warn(l)}return function(){var E=f._stacks.get(r)||0;f._stacks.set(r,E-1)}},p}(),S=function(){function p(h){this._disposed=!1,this._options=h,this._leakageMon=F>0?new U(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(p.prototype,"event",{get:function(){var h=this;return this._event||(this._event=function(f,n,r){h._listeners||(h._listeners=new W.a);var o=h._listeners.isEmpty();o&&h._options&&h._options.onFirstListenerAdd&&h._options.onFirstListenerAdd(h);var l=h._listeners.push(n?[f,n]:f);o&&h._options&&h._options.onFirstListenerDidAdd&&h._options.onFirstListenerDidAdd(h),h._options&&h._options.onListenerDidAdd&&h._options.onListenerDidAdd(h,f,n);var x;h._leakageMon&&(x=h._leakageMon.check(h._listeners.size));var E;return E={dispose:function(){if(x&&x(),E.dispose=p._noop,!h._disposed&&(l(),h._options&&h._options.onLastListenerRemove)){var y=h._listeners&&!h._listeners.isEmpty();y||h._options.onLastListenerRemove(h)}}},r instanceof M.b?r.add(E):Array.isArray(r)&&r.push(E),E}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(h){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new W.a);for(var f=this._listeners.iterator(),n=f.next();!n.done;n=f.next())this._deliveryQueue.push([n.value,h]);for(;this._deliveryQueue.size>0;){var r=this._deliveryQueue.shift(),o=r[0],l=r[1];try{typeof o=="function"?o.call(void 0,l):o[0].call(o[1],l)}catch(x){Object(Q.e)(x)}}}},p.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},p._noop=function(){},p}(),L=function(p){N(h,p);function h(f){var n=p.call(this,f)||this;return n._isPaused=0,n._eventQueue=new W.a,n._mergeFn=f&&f.merge,n}return h.prototype.pause=function(){this._isPaused++},h.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var f=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(f))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},h.prototype.fire=function(f){this._listeners&&(this._isPaused!==0?this._eventQueue.push(f):p.prototype.fire.call(this,f))},h}(S),d=function(){function p(){var h=this;this.hasListeners=!1,this.events=[],this.emitter=new S({onFirstListenerAdd:function(){return h.onFirstListenerAdd()},onLastListenerRemove:function(){return h.onLastListenerRemove()}})}return Object.defineProperty(p.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),p.prototype.add=function(h){var f=this,n={event:h,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);var r=function(){f.hasListeners&&f.unhook(n);var o=f.events.indexOf(n);f.events.splice(o,1)};return Object(M.h)(Object(H.a)(r))},p.prototype.onFirstListenerAdd=function(){var h=this;this.hasListeners=!0,this.events.forEach(function(f){return h.hook(f)})},p.prototype.onLastListenerRemove=function(){var h=this;this.hasListeners=!1,this.events.forEach(function(f){return h.unhook(f)})},p.prototype.hook=function(h){var f=this;h.listener=h.event(function(n){return f.emitter.fire(n)})},p.prototype.unhook=function(h){h.listener&&h.listener.dispose(),h.listener=null},p.prototype.dispose=function(){this.emitter.dispose()},p}(),v=function(){function p(){this.buffers=[]}return p.prototype.wrapEvent=function(h){var f=this;return function(n,r,o){return h(function(l){var x=f.buffers[f.buffers.length-1];x?x.push(function(){return n.call(r,l)}):n.call(r,l)},void 0,o)}},p.prototype.bufferEvents=function(h){var f=[];this.buffers.push(f);var n=h();return this.buffers.pop(),f.forEach(function(r){return r()}),n},p}(),C=function(){function p(){var h=this;this.listening=!1,this.inputEvent=A.None,this.inputEventListener=M.a.None,this.emitter=new S({onFirstListenerDidAdd:function(){h.listening=!0,h.inputEventListener=h.inputEvent(h.emitter.fire,h.emitter)},onLastListenerRemove:function(){h.listening=!1,h.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(p.prototype,"input",{set:function(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),p.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},p}()},N0LK:function(Ye,se,k){"use strict";k.d(se,"x",function(){return Q}),k.d(se,"F",function(){return H}),k.d(se,"r",function(){return W}),k.d(se,"o",function(){return N}),k.d(se,"p",function(){return A}),k.d(se,"Q",function(){return F}),k.d(se,"K",function(){return S}),k.d(se,"k",function(){return L}),k.d(se,"N",function(){return d}),k.d(se,"m",function(){return v}),k.d(se,"l",function(){return C}),k.d(se,"I",function(){return p}),k.d(se,"H",function(){return h}),k.d(se,"q",function(){return f}),k.d(se,"t",function(){return n}),k.d(se,"D",function(){return r}),k.d(se,"e",function(){return o}),k.d(se,"f",function(){return l}),k.d(se,"B",function(){return x}),k.d(se,"C",function(){return E}),k.d(se,"n",function(){return R}),k.d(se,"O",function(){return g}),k.d(se,"c",function(){return m}),k.d(se,"d",function(){return s}),k.d(se,"z",function(){return u}),k.d(se,"A",function(){return _}),k.d(se,"u",function(){return T}),k.d(se,"E",function(){return P}),k.d(se,"G",function(){return j}),k.d(se,"i",function(){return Z}),k.d(se,"g",function(){return B}),k.d(se,"v",function(){return ne}),k.d(se,"h",function(){return ae}),k.d(se,"y",function(){return fe}),k.d(se,"w",function(){return _e}),k.d(se,"a",function(){return Se}),k.d(se,"P",function(){return we}),k.d(se,"L",function(){return Me}),k.d(se,"J",function(){return Le}),k.d(se,"j",function(){return ge}),k.d(se,"M",function(){return ue}),k.d(se,"s",function(){return ke}),k.d(se,"b",function(){return lt});function Q(ce){return!ce||typeof ce!="string"?!0:ce.trim().length===0}function H(ce,pe,Oe){Oe===void 0&&(Oe="0");for(var ze=""+ce,qe=[ze],Je=ze.length;Je<pe;Je++)qe.push(Oe);return qe.reverse().join("")}var M=/{(\d+)}/g;function W(ce){for(var pe=[],Oe=1;Oe<arguments.length;Oe++)pe[Oe-1]=arguments[Oe];return pe.length===0?ce:ce.replace(M,function(ze,qe){var Je=parseInt(qe,10);return isNaN(Je)||Je<0||Je>=pe.length?ze:pe[Je]})}function N(ce){return ce.replace(/[<>&]/g,function(pe){switch(pe){case"<":return"<";case">":return">";case"&":return"&";default:return pe}})}function A(ce){return ce.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F(ce,pe){pe===void 0&&(pe=" ");var Oe=U(ce,pe);return S(Oe,pe)}function U(ce,pe){if(!ce||!pe)return ce;var Oe=pe.length;if(Oe===0||ce.length===0)return ce;for(var ze=0;ce.indexOf(pe,ze)===ze;)ze=ze+Oe;return ce.substring(ze)}function S(ce,pe){if(!ce||!pe)return ce;var Oe=pe.length,ze=ce.length;if(Oe===0||ze===0)return ce;for(var qe=ze,Je=-1;!(Je=ce.lastIndexOf(pe,qe-1),Je===-1||Je+Oe!==qe);){if(Je===0)return"";qe=Je}return ce.substring(0,qe)}function L(ce){return ce.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(ce,pe){if(ce.length<pe.length)return!1;if(ce===pe)return!0;for(var Oe=0;Oe<pe.length;Oe++)if(ce[Oe]!==pe[Oe])return!1;return!0}function v(ce,pe){var Oe=ce.length-pe.length;return Oe>0?ce.indexOf(pe,Oe)===Oe:Oe===0?ce===pe:!1}function C(ce,pe,Oe){if(Oe===void 0&&(Oe={}),!ce)throw new Error("Cannot create regex from empty string");pe||(ce=A(ce)),Oe.wholeWord&&(/\B/.test(ce.charAt(0))||(ce="\\b"+ce),/\B/.test(ce.charAt(ce.length-1))||(ce=ce+"\\b"));var ze="";return Oe.global&&(ze+="g"),Oe.matchCase||(ze+="i"),Oe.multiline&&(ze+="m"),Oe.unicode&&(ze+="u"),new RegExp(ce,ze)}function p(ce){if(ce.source==="^"||ce.source==="^$"||ce.source==="$"||ce.source==="^\\s*$")return!1;var pe=ce.exec("");return!!(pe&&ce.lastIndex===0)}function h(ce){return(ce.global?"g":"")+(ce.ignoreCase?"i":"")+(ce.multiline?"m":"")+(ce.unicode?"u":"")}function f(ce){for(var pe=0,Oe=ce.length;pe<Oe;pe++){var ze=ce.charCodeAt(pe);if(ze!==32&&ze!==9)return pe}return-1}function n(ce,pe,Oe){pe===void 0&&(pe=0),Oe===void 0&&(Oe=ce.length);for(var ze=pe;ze<Oe;ze++){var qe=ce.charCodeAt(ze);if(qe!==32&&qe!==9)return ce.substring(pe,ze)}return ce.substring(pe,Oe)}function r(ce,pe){pe===void 0&&(pe=ce.length-1);for(var Oe=pe;Oe>=0;Oe--){var ze=ce.charCodeAt(Oe);if(ze!==32&&ze!==9)return Oe}return-1}function o(ce,pe){return ce<pe?-1:ce>pe?1:0}function l(ce,pe){for(var Oe=Math.min(ce.length,pe.length),ze=0;ze<Oe;ze++){var qe=ce.charCodeAt(ze),Je=pe.charCodeAt(ze);if(qe===Je)continue;E(qe)&&(qe+=32),E(Je)&&(Je+=32);var rt=qe-Je;if(rt===0)continue;return x(qe)&&x(Je)?rt:o(ce.toLowerCase(),pe.toLowerCase())}return ce.length<pe.length?-1:ce.length>pe.length?1:0}function x(ce){return ce>=97&&ce<=122}function E(ce){return ce>=65&&ce<=90}function y(ce){return x(ce)||E(ce)}function R(ce,pe){return ce.length===pe.length&&O(ce,pe)}function O(ce,pe,Oe){Oe===void 0&&(Oe=ce.length);for(var ze=0;ze<Oe;ze++){var qe=ce.charCodeAt(ze),Je=pe.charCodeAt(ze);if(qe===Je)continue;if(y(qe)&&y(Je)){var rt=Math.abs(qe-Je);if(rt!==0&&rt!==32)return!1}else if(String.fromCharCode(qe).toLowerCase()!==String.fromCharCode(Je).toLowerCase())return!1}return!0}function g(ce,pe){var Oe=pe.length;return pe.length>ce.length?!1:O(ce,pe,Oe)}function m(ce,pe){var Oe,ze=Math.min(ce.length,pe.length);for(Oe=0;Oe<ze;Oe++)if(ce.charCodeAt(Oe)!==pe.charCodeAt(Oe))return Oe;return ze}function s(ce,pe){var Oe,ze=Math.min(ce.length,pe.length),qe=ce.length-1,Je=pe.length-1;for(Oe=0;Oe<ze;Oe++)if(ce.charCodeAt(qe-Oe)!==pe.charCodeAt(Je-Oe))return Oe;return ze}function u(ce){return 55296<=ce&&ce<=56319}function _(ce){return 56320<=ce&&ce<=57343}function T(ce,pe,Oe){var ze=ce.charCodeAt(Oe);if(u(ze)&&Oe+1<pe){var qe=ce.charCodeAt(Oe+1);if(_(qe))return(ze-55296<<10)+(qe-56320)+65536}return ze}function w(ce,pe){var Oe=ce.charCodeAt(pe-1);if(_(Oe)&&pe>1){var ze=ce.charCodeAt(pe-2);if(u(ze))return(ze-55296<<10)+(Oe-56320)+65536}return Oe}function P(ce,pe){var Oe=ot.getInstance(),ze=pe,qe=ce.length,Je=T(ce,qe,pe);pe+=Je>=65536?2:1;for(var rt=Oe.getGraphemeBreakType(Je);pe<qe;){var tt=T(ce,qe,pe),Tt=Oe.getGraphemeBreakType(tt);if(lt(rt,Tt))break;pe+=tt>=65536?2:1,rt=Tt}return pe-ze}function j(ce,pe){var Oe=ot.getInstance(),ze=pe,qe=w(ce,pe);pe-=qe>=65536?2:1;for(var Je=Oe.getGraphemeBreakType(qe);pe>0;){var rt=w(ce,pe),tt=Oe.getGraphemeBreakType(rt);if(lt(tt,Je))break;pe-=rt>=65536?2:1,Je=tt}return ze-pe}var K=/(?:[\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 Z(ce){return K.test(ce)}var G=/(?:[\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 B(ce){return G.test(ce)}var $=/^[\t\n\r\x20-\x7E]*$/;function ne(ce){return $.test(ce)}function ae(ce){for(var pe=0,Oe=ce.length;pe<Oe;pe++)if(fe(ce.charCodeAt(pe)))return!0;return!1}function fe(ce){return ce=+ce,ce>=11904&&ce<=55215||ce>=63744&&ce<=64255||ce>=65281&&ce<=65374}function _e(ce){return ce>=127462&&ce<=127487||ce>=9728&&ce<=10175||ce>=127744&&ce<=128591||ce>=128640&&ce<=128764||ce>=128992&&ce<=129003||ce>=129280&&ce<=129535||ce>=129648&&ce<=129651||ce>=129656&&ce<=129666||ce>=129680&&ce<=129685}var Se=String.fromCharCode(65279);function we(ce){return!!(ce&&ce.length>0&&ce.charCodeAt(0)===65279)}function Me(ce){return btoa(encodeURIComponent(ce))}function Le(ce,pe){for(var Oe="",ze=0;ze<pe;ze++)Oe+=ce;return Oe}function ge(ce,pe){return pe===void 0&&(pe=!1),ce?(pe&&(ce=ce.replace(/\\./g,"")),ce.toLowerCase()!==ce):!1}function ue(ce){var pe=90-65+1;return ce=ce%(2*pe),ce<pe?String.fromCharCode(97+ce):String.fromCharCode(65+ce-pe)}function ke(ce){var pe=ot.getInstance();return pe.getGraphemeBreakType(ce)}function lt(ce,pe){return ce===0?pe!==5&&pe!==7:ce===2&&pe===3?!1:ce===4||ce===2||ce===3||(pe===4||pe===2||pe===3)?!0:ce===8&&(pe===8||pe===9||pe===11||pe===12)||((ce===11||ce===9)&&(pe===9||pe===10)||((ce===12||ce===10)&&pe===10||(pe===5||pe===13||(pe===7||(ce===1||ce===13&&pe===14)))))?!1:!(ce===6&&pe===6)}var ot=function(){function ce(){this._data=st()}return ce.getInstance=function(){return ce._INSTANCE||(ce._INSTANCE=new ce),ce._INSTANCE},ce.prototype.getGraphemeBreakType=function(pe){if(pe<32)return pe===10?3:pe===13?2:4;if(pe<127)return 0;for(var Oe=this._data,ze=Oe.length/3,qe=1;qe<=ze;)if(pe<Oe[3*qe])qe=2*qe;else if(pe>Oe[3*qe+1])qe=2*qe+1;else return Oe[3*qe+2];return 0},ce._INSTANCE=null,ce}();function st(){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]")}},NvD2:function(Ye,se,k){"use strict";k.d(se,"a",function(){return A});var Q=k("Kwbf");function H(F,U){var S=new Set;return F.forEach(function(L){U.has(L)||S.add(L)}),S}function M(F){var U=F||{},S=U.disabled,L=U.disableCheckbox,d=U.checkable;return!!(S||L)||d===!1}function W(F,U,S,L){for(var d=new Set(F),v=new Set,C=0;C<=S;C+=1){var p=U.get(C)||new Set;p.forEach(function(r){var o=r.key,l=r.node,x=r.children,E=x===void 0?[]:x;d.has(o)&&!L(l)&&E.filter(function(y){return!L(y.node)}).forEach(function(y){d.add(y.key)})})}for(var h=new Set,f=S;f>=0;f-=1){var n=U.get(f)||new Set;n.forEach(function(r){var o=r.parent,l=r.node;if(L(l)||!r.parent||h.has(r.parent.key))return;if(L(r.parent.node)){h.add(o.key);return}var x=!0,E=!1;(o.children||[]).filter(function(y){return!L(y.node)}).forEach(function(y){var R=y.key,O=d.has(R);x&&!O&&(x=!1),!E&&(O||v.has(R))&&(E=!0)}),x&&d.add(o.key),E&&v.add(o.key),h.add(o.key)})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(H(v,d))}}function N(F,U,S,L,d){for(var v=new Set(F),C=new Set(U),p=0;p<=L;p+=1){var h=S.get(p)||new Set;h.forEach(function(o){var l=o.key,x=o.node,E=o.children,y=E===void 0?[]:E;!v.has(l)&&!C.has(l)&&!d(x)&&y.filter(function(R){return!d(R.node)}).forEach(function(R){v.delete(R.key)})})}C=new Set;for(var f=new Set,n=L;n>=0;n-=1){var r=S.get(n)||new Set;r.forEach(function(o){var l=o.parent,x=o.node;if(d(x)||!o.parent||f.has(o.parent.key))return;if(d(o.parent.node)){f.add(l.key);return}var E=!0,y=!1;(l.children||[]).filter(function(R){return!d(R.node)}).forEach(function(R){var O=R.key,g=v.has(O);E&&!g&&(E=!1),!y&&(g||C.has(O))&&(y=!0)}),E||v.delete(l.key),y&&C.add(l.key),f.add(l.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(H(C,v))}}function A(F,U,S,L){var d=[],v;L?v=L:v=M;var C=new Set(F.filter(function(n){var r=!!S[n];return r||d.push(n),r})),p=new Map,h=0;Object.keys(S).forEach(function(n){var r=S[n],o=r.level,l=p.get(o);l||(l=new Set,p.set(o,l)),l.add(r),h=Math.max(h,o)}),Object(Q.a)(!d.length,"Tree missing follow keys: ".concat(d.slice(0,100).map(function(n){return"'".concat(n,"'")}).join(", ")));var f;return U===!0?f=W(C,p,h,v):f=N(C,U.halfCheckedKeys,p,h,v),f}},OJz4:function(Ye,se,k){"use strict";k.d(se,"d",function(){return H}),k.d(se,"h",function(){return M}),k.d(se,"b",function(){return W}),k.d(se,"f",function(){return N}),k.d(se,"e",function(){return A}),k.d(se,"c",function(){return F}),k.d(se,"a",function(){return U}),k.d(se,"g",function(){return S}),k.d(se,"i",function(){return L}),k.d(se,"k",function(){return d}),k.d(se,"j",function(){return v});var Q=k("ErOA");function H(C){return Object(Q.c)("myproblems/".concat(C,".json"),{hidePopLogin:!0})}function M(C,p){return Object(Q.f)("myproblems/".concat(C,"/code_submit.json"),p)}function W(C,p){return Object(Q.c)("myproblems/".concat(C,"/code_debug.json"),p)}function N(C,p){return Object(Q.c)("myproblems/".concat(C,"/submit_records.json"),p)}function A(C){return Object(Q.c)("myproblems/record_detail.json",{id:C})}function F(C,p){return Object(Q.c)("myproblems/".concat(C,"/result.json"),{mode:p})}function U(C,p){return Object(Q.f)("myproblems/".concat(C,"/add_notes.json"),p)}function S(C){return Object(Q.f)("myproblems/".concat(C,"/restore_initial_code.json"))}function L(C){return Object(Q.f)("myproblems/".concat(C,"/sync_code.json"))}function d(C,p){return Object(Q.f)("myproblems/".concat(C,"/update_code.json"),p)}function v(C,p){return Object(Q.f)("discusses/".concat(C,"/plus.json"),p)}},OLES:function(Ye,se,k){"use strict";var Q=k("U8pU"),H=k("VTBJ"),M=k("Ff2n"),W=k("q1tI"),N=k("uciX"),A=k("7ixt"),F=function(C){var p=C.overlay,h=C.prefixCls,f=C.id,n=C.overlayInnerStyle;return W.createElement("div",{className:"".concat(h,"-inner"),id:f,role:"tooltip",style:n},typeof p=="function"?p():p)},U=F,S=function(C,p){var h=C.overlayClassName,f=C.trigger,n=f===void 0?["hover"]:f,r=C.mouseEnterDelay,o=r===void 0?0:r,l=C.mouseLeaveDelay,x=l===void 0?.1:l,E=C.overlayStyle,y=C.prefixCls,R=y===void 0?"rc-tooltip":y,O=C.children,g=C.onVisibleChange,m=C.afterVisibleChange,s=C.transitionName,u=C.animation,_=C.placement,T=_===void 0?"right":_,w=C.align,P=w===void 0?{}:w,j=C.destroyTooltipOnHide,K=j===void 0?!1:j,Z=C.defaultVisible,G=C.getTooltipContainer,B=C.overlayInnerStyle,$=Object(M.a)(C,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ne=Object(W.useRef)(null);Object(W.useImperativeHandle)(p,function(){return ne.current});var ae=Object(H.a)({},$);"visible"in C&&(ae.popupVisible=C.visible);var fe=function(){var Le=C.arrowContent,ge=Le===void 0?null:Le,ue=C.overlay,ke=C.id;return[W.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},ge),W.createElement(U,{key:"content",prefixCls:R,id:ke,overlay:ue,overlayInnerStyle:B})]},_e=!1,Se=!1;if(typeof K=="boolean")_e=K;else if(K&&Object(Q.a)(K)==="object"){var we=K.keepParent;_e=we===!0,Se=we===!1}return W.createElement(N.a,Object.assign({popupClassName:h,prefixCls:R,popup:fe,action:n,builtinPlacements:A.a,popupPlacement:T,ref:ne,popupAlign:P,getPopupContainer:G,onPopupVisibleChange:g,afterPopupVisibleChange:m,popupTransitionName:s,popupAnimation:u,defaultPopupVisible:Z,destroyPopupOnHide:_e,autoDestroy:Se,mouseLeaveDelay:x,popupStyle:E,mouseEnterDelay:o},ae),O)},L=Object(W.forwardRef)(S),d=se.a=L},OZM5:function(Ye,se,k){"use strict";k.d(se,"b",function(){return L}),k.d(se,"a",function(){return d}),k.d(se,"k",function(){return v}),k.d(se,"h",function(){return C}),k.d(se,"i",function(){return p}),k.d(se,"g",function(){return h}),k.d(se,"c",function(){return f}),k.d(se,"d",function(){return n}),k.d(se,"j",function(){return l}),k.d(se,"e",function(){return x}),k.d(se,"f",function(){return E});var Q=k("KQm4"),H=k("U8pU"),M=k("Ff2n"),W=k("q1tI"),N=k.n(W),A=k("Kwbf"),F=k("WaYH"),U=.25,S=2;function L(y,R){var O=y.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function d(y,R){var O=y.slice();return O.indexOf(R)===-1&&O.push(R),O}function v(y){return y.split("-")}function C(y,R){return"".concat(y,"-").concat(R)}function p(y){return y&&y.type&&y.type.isTreeNode}function h(y,R){var O=[y],g=R[y];function m(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(u){var _=u.key,T=u.children;O.push(_),m(T)})}return m(g.children),O}function f(y,R){var O=y.clientY,g=R.selectHandle.getBoundingClientRect(),m=g.top,s=g.bottom,u=g.height,_=Math.max(u*U,S);return O<=m+_?-1:O>=s-_?1:0}function n(y,R){if(!y)return;var O=R.multiple;return O?y.slice():y.length?[y[0]]:y}var r=function(R){return R};function o(y,R){if(!y)return[];var O=R||{},g=O.processProps,m=g===void 0?r:g,s=Array.isArray(y)?y:[y];return s.map(function(u){var _=u.children,T=Object(M.a)(u,["children"]),w=o(_,R);return N.a.createElement(F.a,Object.assign({},m(T)),w)})}function l(y){if(!y)return null;var R;if(Array.isArray(y))R={checkedKeys:y,halfCheckedKeys:void 0};else if(Object(H.a)(y)==="object")R={checkedKeys:y.checked||void 0,halfCheckedKeys:y.halfChecked||void 0};else return Object(A.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function x(y,R){var O=new Set;function g(m){if(O.has(m))return;var s=R[m];if(!s)return;O.add(m);var u=s.parent,_=s.node;if(_.disabled)return;u&&g(u.key)}return(y||[]).forEach(function(m){g(m)}),Object(Q.a)(O)}function E(y){var R={};return Object.keys(y).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=y[O])}),R}},Ot1p:function(Ye,se,k){"use strict";var Q=k("2qtc"),H=k("kLXV"),M=k("rAM+"),W=k("miYZ"),N=k("tsqr"),A=k("9og8"),F=k("tJVT"),U=k("jrin"),S=k("WmNS"),L=k.n(S),d=k("q1tI"),v=k.n(d),C=k("VrN/"),p=k.n(C),h=k("bdgK"),f=k("p77/"),n=k("Bd2K"),r=k("ELLl"),o=k("19Vz"),l=k("lZu9"),x=k("+NIl"),E=k("kSUc"),y=k("9Bee"),R=function(Te){var Qe=Te.value,ct=Qe===void 0?"":Qe,xt=Te.className,ft=Te.showTextOnly,ut=Te.showLines,$e=Te.style,Ve=$e===void 0?{}:$e,Ne=Object(d.useMemo)(function(){return""},[ct]);return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ne}}))},O=k("0Owb"),g=k("dejd"),m=k("C+DQ"),s=k("1vsH"),u=k("m3rI"),_=[{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(Te){var Qe=Te.onActionCallback,ct=Te.title,xt=Te.icon,ft=Te.actionName,ut=Te.className,$e=ut===void 0?"":ut,Ve=Te.children;function Ne(){Qe(ft)}return v.a.createElement("a",{title:ct,className:$e,onClick:Ne},v.a.createElement("i",{className:"md-iconfont ".concat(xt)}),Ve)}var w=function(Te){var Qe=Te.watch,ct=Te.showNullButton,xt=Te.onActionCallback,ft=Te.fullScreen,ut=Te.insertTemp,$e=Te.hidetoolBar,Ve=Te.uuid,Ne=Te.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(Ve,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var oe=[].concat(_,[{title:"".concat(Qe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Qe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return v.a.createElement("ul",{className:"markdown-toolbar-container"},!$e&&oe.map(function(ve,He){return v.a.createElement("li",{key:He},ve.actionName?v.a.createElement(T,Object(O.a)({},ve,{onActionCallback:xt})):v.a.createElement("span",{className:"v-line"}))}),ct?v.a.createElement("li",null,v.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:xt},v.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ut&&v.a.createElement("li",null,v.a.createElement(T,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ut),onActionCallback:xt},v.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),v.a.createElement("li",{className:"btn-full-screen"},v.a.createElement(T,{icon:"".concat(ft?"icon-shrink":"icon-enlarge"),title:ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:xt})))},P=k("M8RZ"),j=k("+L6B"),K=k("2/Rp"),Z=k("y8nQ"),G=k("Vl3Y"),B=k("5NDa"),$=k("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Te){var Qe=Te.callback,ct=Te.onCancel;function xt(ft){Qe(ft)}return v.a.createElement(G.a,Object(O.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:xt}),v.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},v.a.createElement($.a,null)),v.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},v.a.createElement($.a,null)),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(K.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},fe=k("7ahc"),_e=k("k1fw"),Se=k("HmJG"),we=k("BjJ7"),Me=G.a.useForm,Le={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},ue=function(Te){var Qe=Te.callback,ct=Te.onCancel,xt=Me(),ft=Object(F.a)(xt,1),ut=ft[0],$e=Object(d.useRef)();function Ve(ve){Qe(Object(_e.a)(Object(_e.a)({},ve),{},{name:$e.current}))}function Ne(ve,He){ut.setFieldsValue({src:"/api/attachments/".concat(ve.id,"?type=").concat(ve.content_type),type:He.type})}function oe(ve){var He=ve.target.files[0];$e.current=He.name,lt(He,Ne)}return v.a.createElement(G.a,Object(O.a)({form:ut},ge,{className:"upload-image-panel",onFinish:Ve}),v.a.createElement(G.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},v.a.createElement("div",{className:"flex-container"},v.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},v.a.createElement($.a,{style:Le})),v.a.createElement(ke,{onFileChange:oe}))),v.a.createElement(G.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},v.a.createElement($.a,{style:{width:264}})),v.a.createElement(G.a.Item,{style:{textAlign:"right"}},v.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(K.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))};function ke(Te){var Qe=Te.onFileChange;return v.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",v.a.createElement("input",{type:"file",onChange:Qe}))}function lt(Te,Qe){if(!Te)throw new String("\u6CA1\u6709\u6587\u4EF6");var ct=new FormData;ct.append("editormd-image-file",Te),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var xt=new window.XMLHttpRequest;xt.withCredentials=!0,xt.addEventListener("load",function(ft){Qe(JSON.parse(ft.target.responseText),Te)},!1),xt.addEventListener("error",function(ft){console.error(ft)},!1),xt.open("POST","".concat(we.a,"/api/attachments.json")),xt.send(ct)}var ot=k("giR+"),st=k("fyUT"),ce=k("7Kak"),pe=k("9yH6"),Oe=pe.a.Group,ze={margin:"0 8px"},qe=function(Te){var Qe=Te.callback,ct=Te.onCancel;function xt(ft){Qe(ft)}return v.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:xt},v.a.createElement("div",{className:"flex-container"},v.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),v.a.createElement("span",{style:ze},"\u884C\u6570"),v.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},v.a.createElement(st.a,null)),v.a.createElement("span",{style:ze},"\u5217\u6570"),v.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},v.a.createElement(st.a,null))),v.a.createElement("div",{className:"flex-container",style:{marginTop:12}},v.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),v.a.createElement(G.a.Item,{name:"align"},v.a.createElement(Oe,null,v.a.createElement(pe.a,{value:"default"},v.a.createElement("i",{className:"fa fa-align-justify"})),v.a.createElement(pe.a,{value:"left"},v.a.createElement("i",{className:"fa fa-align-left"})),v.a.createElement(pe.a,{value:"center"},v.a.createElement("i",{className:"fa fa-align-center"})),v.a.createElement(pe.a,{value:"right"},v.a.createElement("i",{className:"fa fa-align-right"}))))),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(K.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},Je=k("ErOA"),rt=k("7Cbv"),tt="link",Tt="upload-image",bt="code-block",Et="add-table",yt="------------",Ot={default:yt,left:":".concat(yt),center:":".concat(yt,":"),right:"".concat(yt,":")},At=k("9VGf"),Ae,xe;function Be(){}var Ze=0,Pe=1e4,Xe="\u2581",be=`
|
|
**\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 de(Te){return/^\d+$/.test(Te)?"".concat(Te,"px"):Te}var he=navigator.platform.toUpperCase().indexOf("MAC")>=0,re=he?"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"],le=(Ae={},Object(U.a)(Ae,re+"-B","bold"),Object(U.a)(Ae,re+"-I","italic"),Ae),me=(xe={},Object(U.a)(xe,tt,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(xe,bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(xe,Tt,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(xe,Et,"\u6DFB\u52A0\u8868\u683C"),xe),De=se.a=function(Te){var Qe=Te.defaultValue,ct=Qe===void 0?"":Qe,xt=Te.onChange,ft=Te.width,ut=ft===void 0?"100%":ft,$e=Te.height,Ve=$e===void 0?400:$e,Ne=Te.miniToolbar,oe=Ne===void 0?!1:Ne,ve=Te.isFocus,He=ve===void 0?!1:ve,je=Te.watch,pt=Te.insertTemp,gt=Te.mode,Re=gt===void 0?"markdown":gt,Ge=Te.id,Ue=Ge===void 0?"markdown-editor-id":Ge,mt=Te.showResizeBar,wt=mt===void 0?!1:mt,qt=Te.noStorage,en=qt===void 0?!1:qt,Vt=Te.showNullButton,Dt=Vt===void 0?!1:Vt,Ke=Te.hidetoolBar,Ct=Ke===void 0?!1:Ke,Bt=Te.fullScreen,It=Bt===void 0?!1:Bt,Zt=Te.onBlur,nn=Te.onCMBeforeChange,an=Te.onFullScreen,We=Te.className,nt=We===void 0?"":We,Kt=Te.disablePaste,kt=Kt===void 0?!1:Kt,Ut=Te.placeholder,_t=Ut===void 0?"":Ut,z=Te.values,b=z===void 0?"":z,D=Object(d.useState)(null),V=Object(F.a)(D,2),J=V[0],X=V[1],Ee=Object(d.useState)(ct),et=Object(F.a)(Ee,2),vt=et[0],Rt=et[1],at=Object(d.useState)(je),zt=Object(F.a)(at,2),Wt=zt[0],yn=zt[1],Un=Object(d.useState)(It),hn=Object(F.a)(Un,2),tn=hn[0],An=hn[1],Mn=Object(d.useState)(""),pn=Object(F.a)(Mn,2),Cn=pn[0],bn=pn[1],$n=Object(d.useState)(0),jn=Object(F.a)($n,2),pr=jn[0],Sn=jn[1],wr=Object(d.useState)(Ve),xn=Object(F.a)(wr,2),tr=xn[0],nr=xn[1],mr=Object(d.useState)(!1),Ar=Object(F.a)(mr,2),ar=Ar[0],vn=Ar[1],on=Object(d.useRef)(Object(rt.a)()),Dn=Object(d.useRef)(!1),mn=Object(d.useRef)(),On=Object(d.useRef)(),ln=Object(d.useRef)(),gr=Object(d.useRef)(),Pn=Object(d.useRef)(),Hn=function(){var dt=Object(A.a)(L.a.mark(function jt(){var Nt,Xt;return L.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(Je.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:on.current}});case 2:Xt=fn.sent,Xt!=null&&(Nt=Xt.attachments)!==null&&Nt!==void 0&&Nt.length&&(console.log("cm:",J,On),Xt.attachments.map(function(Lt){Lt.content_type.indexOf("image")>-1?J.replaceSelection(".concat(Lt.content_type,")")):Lt.content_type.indexOf("video")>-1?J.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Lt.content_type.indexOf("pdf")>-1?J.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):J.replaceSelection("[".concat(Lt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,")"))}));case 4:case"end":return fn.stop()}},jt)}));return function(){return dt.apply(this,arguments)}}();Object(d.useEffect)(function(){Rt(b),J==null||J.setValue(b)},[b]),Object(d.useEffect)(function(){an==null||an(tn)},[tn]),Object(d.useEffect)(function(){if(On.current){var dt=p.a.fromTextArea(On.current,{mode:Re,lineNumbers:!oe,lineWrapping:!0,value:ct,autoCloseTags:!0,autoCloseBrackets:!0});He&&dt.focus();function jt(Nt,Xt){if(kt){Xt.preventDefault();return}var Yt=Xt.clipboardData;if(Yt){var fn=Yt.types.toString(),Lt=Yt.items;if(fn==="Files"||Yt.types.indexOf("Files")>-1){if(Xt.preventDefault(),Re=="stex")return;try{var Tn,kn=Lt[1];((Tn=Lt[0])===null||Tn===void 0?void 0:Tn.kind)==="file"&&(kn=Lt[0]);var $t=kn.getAsFile(),Bn=$t.name.split(".").pop();lt($t,function(sn){if(sn.id){var dn,Kn,zn;($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("image"))>-1?dt.replaceSelection(".concat(sn.content_type,")")):($t==null||((Kn=$t.type)===null||Kn===void 0)?void 0:Kn.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,'"></video>')):($t==null||((zn=$t.type)===null||zn===void 0)?void 0:zn.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):ie.includes(Bn)?dt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):dt.replaceSelection("[".concat($t.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(sn.content_type,")"))}else(sn==null?void 0:sn.status)===401&&(document.location.href="/user/login")})}catch(sn){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",jt),dt.on("dragleave",function(Nt,Xt){ln.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(Nt,Xt){ln.current.classList.add("mouse-hover-md")}),dt.on("drop",function(Nt,Xt){ln.current.classList.add("mouse-hover-md");var Yt;if(Yt=Xt.dataTransfer.files,Yt.length>0){Xt.preventDefault(),Xt.stopPropagation();for(var fn=function(kn){var $t=Yt[kn],Bn=$t.name.split(".").pop();lt($t,function(sn){if(sn.id){var dn,Kn,zn;($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("image"))>-1?dt.replaceSelection(".concat(sn.content_type,")")):($t==null||((Kn=$t.type)===null||Kn===void 0)?void 0:Kn.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,'"></video>')):($t==null||((zn=$t.type)===null||zn===void 0)?void 0:zn.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):ie.includes(Bn)?dt.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):dt.replaceSelection("[".concat($t.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(sn.id,"?type=").concat(sn.content_type,")"))}else(sn==null?void 0:sn.status)===401&&(document.location.href="/user/login")})},Lt=0;Lt<Yt.length;Lt++)fn(Lt)}}),X(dt),function(){dt.off("paste",jt)}}},[]);var Or=Object(d.useCallback)(function(){if(ln.current)try{}catch(dt){console.log(dt,"---- to set md editor body height")}},[tr,ln,tn]);Object(d.useEffect)(function(){function dt(){var Nt=new h.default(function(Xt){var Yt=Object(M.a)(Xt),fn;try{for(Yt.s();!(fn=Yt.n()).done;){var Lt=fn.value;(Lt.target.offsetHeight>0||Lt.target.offsetWidth>0)&&(Or(),J.setSize("100%","100%"),J.refresh())}}catch(Tn){Yt.e(Tn)}finally{Yt.f()}});return Nt.observe(On.current.parentElement),Nt}if(J){var jt=dt();return function(){jt.unobserve(On.current.parentElement)}}},[J,Or]),Object(d.useEffect)(function(){if(J){for(var dt=[],jt=function(){var Lt=Xt[Nt];Yt=Object(F.a)(Lt,2);var Tn=Yt[0],kn=Yt[1],$t=Object(U.a)({},Tn,function(){xr(kn)});dt.push($t),J.addKeyMap($t)},Nt=0,Xt=Object.entries(le);Nt<Xt.length;Nt++){var Yt;jt()}return mn.current=setInterval(function(){Dn.current&&Hn()},4e3),function(){clearInterval(mn.current);var fn=Object(M.a)(dt),Lt;try{for(fn.s();!(Lt=fn.n()).done;){var Tn=Lt.value;J.removeKeyMap(Tn)}}catch(kn){fn.e(kn)}finally{fn.f()}}}},[J]),Object(d.useEffect)(function(){It!==tn&&An(It)},[It]),Object(At.a)(function(){if(!en&&pr>0){var dt=new Date().getTime(),jt=window.sessionStorage.getItem(Ue);dt>=pr+Pe&&(!jt||jt!==vt)&&(window.sessionStorage.setItem(Ue,vt),vn(!0))}},Pe),Object(d.useEffect)(function(){yn(je)},[J,je]),Object(d.useEffect)(function(){J&&(He&&J.focus())},[J,He]),Object(d.useEffect)(function(){if(Wt&&J){var dt=J.getScrollerElement();function jt(Nt){var Xt=Nt.target;if(Pn.current){var Yt=Xt.scrollTop/Xt.scrollHeight;Pn.current.scrollTop=Pn.current.scrollHeight*Yt}}return dt.addEventListener("scroll",jt),function(){dt.removeEventListener("scroll",jt)}}},[J,Wt]),Object(d.useEffect)(function(){if(J&&nn){function dt(jt,Nt){nn(jt,Nt)}return J.on("beforeChange",dt),function(){J.off("beforeChange",dt)}}},[J,nn]),Object(d.useEffect)(function(){if(J&&Zt){function dt(){Zt(J.getValue())}return J.on("blur",dt),function(){J.off("blur",dt)}}},[J,Zt]),Object(d.useEffect)(function(){if(J){function dt(jt){var Nt=jt.getValue();Rt(Nt),Sn(new Date().getTime()),jt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),xt&&xt(Nt)}return J.on("change",dt),function(){J.off("change",dt)}}},[J,xt]),Object(d.useEffect)(function(){J&&(ct==null?(J.setValue(""),Rt("")):ct!==J.getValue()&&(J.setValue(ct),Rt(ct),J.setCursor(J.lineCount(),0)))},[J,ct]);var xr=Object(d.useCallback)(function(dt){var jt=J.getCursor(),Nt=J.getSelection(),Xt=Nt.split(`
|
|
`);switch(dt){case"bold":return J.replaceSelection("**"+Nt+"**"),Nt===""&&J.setCursor(jt.line,jt.ch+2),J.focus();case"italic":return J.replaceSelection("*"+Nt+"*"),Nt===""&&J.setCursor(jt.line,jt.ch+1),J.focus();case"code":return J.replaceSelection("`"+Nt+"`"),Nt===""&&J.setCursor(jt.line,jt.ch+1),J.focus();case"inline-latex":return J.replaceSelection("`$$"+Nt+"$$`"),Nt===""&&J.setCursor(jt.line,jt.ch+3),J.focus();case"latex":return J.replaceSelection("```latex\n"+Nt+"\n```"),J.setCursor(jt.line+1,Nt.length+1),J.focus();case"line-break":return J.replaceSelection(`<br/>
|
|
`),J.focus();case"list-ul":return Nt===""?J.replaceSelection("- "+Nt):J.replaceSelection(Xt.map(function(Yt){return Yt===""?"":"- ".concat(Yt)}).join(`
|
|
`)),J.focus();case"list-ol":return Nt===""?J.replaceSelection("1. "+Nt):J.replaceSelection(Xt.map(function(Yt,fn){return Yt===""?"":"".concat(fn+1,". ").concat(Yt)}).join(`
|
|
`)),J.focus();case"add-null-ch":return Nt===""&&J.setCursor(jt.line,jt.ch+1),J.replaceSelection(Xe),J.focus();case"inster-template-1":return Nt===""&&J.setCursor(jt.line,jt.ch),J.replaceSelection(be),J.focus();case"eraser":return J.setValue(""),J.focus();case"trigger-watch":return yn(!Wt),J.focus();case"trigger-full-screen":return An(!tn),J.focus();case tt:bn(tt);return;case bt:bn(bt);return;case Tt:bn(Tt);return;case Et:bn(Et);return;default:throw new Error}},[J,Wt,tn]),vr=Object(d.useCallback)(function(dt){bn("");switch(Cn){case tt:var jt=dt.title,Nt=dt.link;return J.replaceSelection("[".concat(jt,"](").concat(Nt,")")),J.focus();case bt:var Xt=dt.language,Yt=dt.content;return J.replaceSelection(["```"+Xt,Yt,"```"].join(`
|
|
`)),J.focus();case Tt:var fn=dt.src,Lt=dt.alt,Tn=dt.name;return fn.indexOf("type=image")>-1?J.replaceSelection(".concat(fn,' "').concat(Lt||"",'" )')):fn.indexOf("type=application/pdf")>-1?J.replaceSelection('<a href="'.concat(fn,'&disposition=inline" target="_blank">').concat(Tn,"</a>")):J.replaceSelection('<a href="'.concat(fn,'" target="_blank">').concat(Tn,"</a>")),J.focus();case Et:for(var kn=dt.row,$t=dt.col,Bn=dt.align,sn=`
|
|
`,dn=0;dn<kn;dn++){for(var Kn=[],zn=[],gn=0;gn<$t;gn++)dn===1&&zn.push(Ot[Bn]),Kn.push(" ");dn===1&&(sn+="| ".concat(zn.join(" | "),` |
|
|
`)),sn+="| ".concat(Kn.join($t===1?"":" | "),` |
|
|
`)}return J.replaceSelection(sn+`
|
|
`),J.focus();default:throw new Error}},[J,Cn]),Nr=Object(d.useMemo)(function(){switch(Cn){case tt:return v.a.createElement(ae,{callback:vr,onCancel:Xn});case bt:return v.a.createElement(fe.b,{callback:vr,onCancel:Xn});case Tt:return v.a.createElement(ue,{callback:vr,onCancel:Xn});case Et:return v.a.createElement(qe,{callback:vr,onCancel:Xn});default:return null}},[Cn]);function Xn(){bn("")}Object(d.useEffect)(function(){if(gr.current){var dt=gr.current,jt=!1,Nt=0;function Xt(Lt){jt=!0,Nt=Lt.pageY}function Yt(){jt=!1}function fn(Lt){if(jt){var Tn=Lt.pageY-Nt;Tn<0&&(Tn=0),Tn>300&&(Tn=300);var kn=Ve+Tn+"px";nr(kn)}}return dt.addEventListener("mousedown",Xt),document.addEventListener("mousemove",fn),document.addEventListener("mouseup",Yt),function(){dt.removeEventListener("mousedown",Xt),document.removeEventListener("mousemove",fn),document.removeEventListener("mouseup",Yt)}}},[J,gr]),Object(d.useEffect)(function(){nr(Ve)},[Ve]);var Lr=de(ut),lr=de(tr),Cr={width:Lr,height:lr},Mr=Object(d.useMemo)(function(){if(pr){var dt=new Date(pr),jt=dt.getHours(),Nt=dt.getMinutes(),Xt=dt.getSeconds();return jt=jt<10?"0"+jt:jt,Nt=Nt<10?"0"+Nt:Nt,Xt=Xt<10?"0"+Xt:Xt,"".concat(jt,":").concat(Nt,":").concat(Xt)}return 0},[pr]);function un(){window.sessionStorage.removeItem(Ue),vn(!1),Sn(0)}function rn(){vn(!1),Sn(0),J.setValue(window.sessionStorage.getItem(Ue))}function Rn(dt,jt){var Nt=J.getValue();Nt=Nt.replace(dt,jt),Rt(Nt),J==null||J.setValue(Nt)}return v.a.createElement(d.Fragment,null,v.a.createElement("div",{className:"markdown-editor-wrapper",ref:ln},v.a.createElement("div",{className:"markdown-editor-container ".concat(nt," ").concat(Wt?"on-preview":""," ").concat(oe?"mini":""," ").concat(tn?"full-screen":""),style:Cr},v.a.createElement(w,{insertTemp:pt,watch:Wt,fullScreen:tn,showNullButton:Dt,onActionCallback:xr,hidetoolBar:Ct,uuid:on.current,setOpenPhones:function(){Dn.current=!0}}),v.a.createElement("div",{className:"markdown-editor-body"},v.a.createElement("div",{className:"codemirror-container"},v.a.createElement("textarea",{ref:On,placeholder:_t})),Wt?v.a.createElement("div",{ref:Pn,className:"preview-container"},Re==="stex"&&v.a.createElement(R,{value:vt}),Re!=="stex"&&v.a.createElement(y.a,{edit:!0,value:vt,replaces:Rn})):null))),wt?v.a.createElement("a",{ref:gr,className:"editor-resize"}):null,v.a.createElement(P.a,null,me[Cn]?v.a.createElement(H.a,{centered:!0,title:me[Cn],visible:!0,onCancel:Xn,footer:null},Nr):null))}},PD8m:function(Ye,se){Ye.exports={name:"memoryStorage",read:Q,write:H,each:M,remove:W,clearAll:N};var k={};function Q(A){return k[A]}function H(A,F){k[A]=F}function M(A){for(var F in k)k.hasOwnProperty(F)&&A(k[F],F)}function W(A){delete k[A]}function N(A){k={}}},QDVR:function(Ye,se,k){"use strict";k.d(se,"e",function(){return H}),k.d(se,"d",function(){return M}),k.d(se,"c",function(){return F}),k.d(se,"b",function(){return U}),k.d(se,"a",function(){return L});var Q=function(){var d=function(v,C){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,h){p.__proto__=h}||function(p,h){for(var f in h)h.hasOwnProperty(f)&&(p[f]=h[f])},d(v,C)};return function(v,C){d(v,C);function p(){this.constructor=v}v.prototype=C===null?Object.create(C):(p.prototype=C.prototype,new p)}}();function H(d){var v=[];return d.forEach(function(C){return v.push(C)}),v}function M(d){var v=[];return d.forEach(function(C,p){return v.push(p)}),v}var W=function(){function d(){this._value="",this._pos=0}return d.prototype.reset=function(v){return this._value=v,this._pos=0,this},d.prototype.next=function(){return this._pos+=1,this},d.prototype.hasNext=function(){return this._pos<this._value.length-1},d.prototype.cmp=function(v){var C=v.charCodeAt(0),p=this._value.charCodeAt(this._pos);return C-p},d.prototype.value=function(){return this._value[this._pos]},d}(),N=function(){function d(v){v===void 0&&(v=!0),this._splitOnBackslash=v}return d.prototype.reset=function(v){return this._value=v.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},d.prototype.hasNext=function(){return this._to<this._value.length},d.prototype.next=function(){this._from=this._to;for(var v=!0;this._to<this._value.length;this._to++){var C=this._value.charCodeAt(this._to);if(C===47||this._splitOnBackslash&&C===92)if(v)this._from++;else break;else v=!1}return this},d.prototype.cmp=function(v){for(var C=0,p=v.length,h=this._from;C<p&&h<this._to;){var f=v.charCodeAt(C)-this._value.charCodeAt(h);if(f!==0)return f;C+=1,h+=1}return p===this._to-this._from?0:C<p?-1:1},d.prototype.value=function(){return this._value.substring(this._from,this._to)},d}(),A=function(){function d(){}return d}(),F=function(){function d(v){this._iter=v}return d.forPaths=function(){return new d(new N)},d.forStrings=function(){return new d(new W)},d.prototype.clear=function(){this._root=void 0},d.prototype.set=function(v,C){var p=this._iter.reset(v),h;for(this._root||(this._root=new A,this._root.segment=p.value()),h=this._root;;){var f=p.cmp(h.segment);if(f>0)h.left||(h.left=new A,h.left.segment=p.value()),h=h.left;else if(f<0)h.right||(h.right=new A,h.right.segment=p.value()),h=h.right;else if(p.hasNext())p.next(),h.mid||(h.mid=new A,h.mid.segment=p.value()),h=h.mid;else break}var n=h.value;return h.value=C,h.key=v,n},d.prototype.get=function(v){for(var C=this._iter.reset(v),p=this._root;p;){var h=C.cmp(p.segment);if(h>0)p=p.left;else if(h<0)p=p.right;else if(C.hasNext())C.next(),p=p.mid;else break}return p?p.value:void 0},d.prototype.findSubstr=function(v){for(var C=this._iter.reset(v),p=this._root,h=void 0;p;){var f=C.cmp(p.segment);if(f>0)p=p.left;else if(f<0)p=p.right;else if(C.hasNext())C.next(),h=p.value||h,p=p.mid;else break}return p&&p.value||h},d.prototype.forEach=function(v){this._forEach(this._root,v)},d.prototype._forEach=function(v,C){v&&(this._forEach(v.left,C),v.value&&C(v.value,v.key),this._forEach(v.mid,C),this._forEach(v.right,C))},d}(),U=function(){function d(){this.map=new Map,this.ignoreCase=!1}return d.prototype.set=function(v,C){this.map.set(this.toKey(v),C)},d.prototype.get=function(v){return this.map.get(this.toKey(v))},d.prototype.toKey=function(v){var C=v.toString();return this.ignoreCase&&(C=C.toLowerCase()),C},d}(),S=function(){function d(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return d.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(d.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),d.prototype.get=function(v,C){C===void 0&&(C=0);var p=this._map.get(v);return p?(C!==0&&this.touch(p,C),p.value):void 0},d.prototype.set=function(v,C,p){p===void 0&&(p=0);var h=this._map.get(v);if(h)h.value=C,p!==0&&this.touch(h,p);else{h={key:v,value:C,next:void 0,previous:void 0};switch(p){case 0:this.addItemLast(h);break;case 1:this.addItemFirst(h);break;case 2:this.addItemLast(h);break;default:this.addItemLast(h);break}this._map.set(v,h),this._size++}},d.prototype.delete=function(v){return!!this.remove(v)},d.prototype.remove=function(v){var C=this._map.get(v);return C?(this._map.delete(v),this.removeItem(C),this._size--,C.value):void 0},d.prototype.forEach=function(v,C){for(var p=this._head;p;)C?v.bind(C)(p.value,p.key,this):v(p.value,p.key,this),p=p.next},d.prototype.trimOld=function(v){if(v>=this.size)return;if(v===0){this.clear();return}for(var C=this._head,p=this.size;C&&p>v;)this._map.delete(C.key),C=C.next,p--;this._head=C,this._size=p,C&&(C.previous=void 0)},d.prototype.addItemFirst=function(v){if(!this._head&&!this._tail)this._tail=v;else if(this._head)v.next=this._head,this._head.previous=v;else throw new Error("Invalid list");this._head=v},d.prototype.addItemLast=function(v){if(!this._head&&!this._tail)this._head=v;else if(this._tail)v.previous=this._tail,this._tail.next=v;else throw new Error("Invalid list");this._tail=v},d.prototype.removeItem=function(v){if(v===this._head&&v===this._tail)this._head=void 0,this._tail=void 0;else if(v===this._head){if(!v.next)throw new Error("Invalid list");v.next.previous=void 0,this._head=v.next}else if(v===this._tail){if(!v.previous)throw new Error("Invalid list");v.previous.next=void 0,this._tail=v.previous}else{var C=v.next,p=v.previous;if(!C||!p)throw new Error("Invalid list");C.previous=p,p.next=C}v.next=void 0,v.previous=void 0},d.prototype.touch=function(v,C){if(!this._head||!this._tail)throw new Error("Invalid list");if(C!==1&&C!==2)return;if(C===1){if(v===this._head)return;var p=v.next,h=v.previous;v===this._tail?(h.next=void 0,this._tail=h):(p.previous=h,h.next=p),v.previous=void 0,v.next=this._head,this._head.previous=v,this._head=v}else if(C===2){if(v===this._tail)return;var p=v.next,h=v.previous;v===this._head?(p.previous=void 0,this._head=p):(p.previous=h,h.next=p),v.next=void 0,v.previous=this._tail,this._tail.next=v,this._tail=v}},d.prototype.toJSON=function(){var v=[];return this.forEach(function(C,p){v.push([p,C])}),v},d}(),L=function(d){Q(v,d);function v(C,p){p===void 0&&(p=1);var h=d.call(this)||this;return h._limit=C,h._ratio=Math.min(Math.max(0,p),1),h}return v.prototype.get=function(C){return d.prototype.get.call(this,C,2)},v.prototype.peek=function(C){return d.prototype.get.call(this,C,0)},v.prototype.set=function(C,p){d.prototype.set.call(this,C,p,2),this.checkTrim()},v.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},v}(S)},QUZ3:function(Ye,se,k){"use strict";k.r(se);var Q=k("0Owb"),H=k("PpiC"),M=k("T2oS"),W=k("W9HT"),N=k("+L6B"),A=k("2/Rp"),F=k("2qtc"),U=k("kLXV"),S=k("9og8"),L=k("tJVT"),d=k("k1fw"),v=k("aHsQ"),C=k("sGsY"),p=k("WmNS"),h=k.n(p),f=k("q1tI"),n=k.n(f),r=k("Fvcw"),o=k("GIiI"),l=k("Ty5D"),x=k("55Ip"),E=k("OJz4"),y=k("V0Rq"),R=k("bntm"),O=k("cDPC"),g=k("m3rI"),m=k("RCxd"),s=k("EHPI"),u=k("S+dL"),_=k.n(u),T=k("J66h"),w=k("uMZB"),P=k.n(w),j=k("p/48"),K=k("JPnl"),Z=k("y8nQ"),G=k("Vl3Y"),B=k("5NDa"),$=k("5rEg"),ne=$.a.TextArea,ae=5e3,fe=function(Ke){var Ct=Ke.callback,Bt=Ke.onCancel,It=Ke.notes;function Zt(nn){Ct(nn)}return n.a.createElement(G.a,{className:"note-form-panel",onFinish:Zt,initialValues:{notes:It}},n.a.createElement(G.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:ae,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(ae)}]},n.a.createElement(ne,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(G.a.Item,{style:{textAlign:"right"}},n.a.createElement(A.a,{type:"ghost",onClick:Bt,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(A.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},_e=k("H2Ag"),Se=k.n(_e),we=k("DjyN"),Me=k("NUBc"),Le=k("miYZ"),ge=k("tsqr"),ue=k("g9YV"),ke=k("wCAj"),lt=k("+k/U"),ot=k.n(lt),st=k("ye1Q"),ce=k("lfch"),pe=k("JB8y"),Oe=k("1vsH"),ze=k("wd/R"),qe=k.n(ze),Je=ke.a.Column,rt=function(Ke){var Ct=Ke.submitResult,Bt=Ke.submitting,It=Ke.submitRecords,Zt=Ke.page,nn=Ke.onPageChange,an=Ke.topicId,We=Ct||{},nt=We.status,Kt=We.id,kt=We.input,Ut=We.output,_t=We.expected_output,z=We.is_file,b=We.input_file_url,D=We.output_file_url,V=We.expected_output_file_url,J=We.error_msg,X=It||{},Ee=X.records,et=X.records_count;function vt(){z?navigator.clipboard.writeText(T.Base64.decode(J)).then(function(){ge.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(T.Base64.decode(Ut)).then(function(){ge.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(W.a,{spinning:Bt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(st.a,{style:{fontSize:24},spin:!0})},Kt?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:ot.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:nt===pe.a.OK?"c-green":"c-red"},K.a[nt])),n.a.createElement("li",{className:ot.a.error},n.a.createElement("a",{onClick:vt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(ce.a,null)," ")),n.a.createElement("li",null,n.a.createElement(x.a,{to:"/myproblems/".concat(an,"/record-detail/").concat(Kt)},"\u663E\u793A\u8BE6\u60C5 >"," "))),nt!==pe.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!z&&kt,z&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Oe.w)(b,kt)}},kt)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(nt===4||nt===5)&&T.Base64.decode(J),nt!=4&&nt!=5&&(z?n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Oe.w)(D,Ut)}},Ut):T.Base64.decode(Ut))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!z&&T.Base64.decode(_t),z&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(Oe.w)(V,_t)}},_t))):null):null,(Ee==null?void 0:Ee.length)>0?n.a.createElement(ke.a,{dataSource:Ee,rowKey:"id",pagination:!1},n.a.createElement(Je,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(at,zt){return n.a.createElement("span",null," ",qe()(at).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(Je,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(at,zt){var Wt;return n.a.createElement(x.a,{className:at===0?"c-green":"c-red",to:"/myproblems/".concat(an,"/record-detail/").concat(zt.id)},(Wt=K.a[at])===null||Wt===void 0?void 0:Wt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(Je,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),n.a.createElement(Je,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),n.a.createElement(Je,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),n.a.createElement(Je,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(at,zt){return n.a.createElement(x.a,{className:"c-light-primary",to:"/myproblems/".concat(an,"/record-detail/").concat(zt.id)},"\u67E5\u770B")}})):n.a.createElement("div",{style:{height:300,width:"100%"}}),et>15?n.a.createElement(Me.a,{className:ot.a.pagination,current:Zt,pageSize:15,total:et,onChange:nn}):null)},tt=k("BdwD"),Tt=k("DYRE"),bt=k("zeV3"),Et=k("+BJd"),yt=k("mr32"),Ot=k("pPuO"),At=k.n(Ot),Ae=k("9Bee"),xe={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},Be=function(Ke){var Ct=Ke.hack,Bt=Ke.onTriggerPraise,It=Ke.toDiscuss,Zt=Ct.language,nn=Ct.difficult,an=Ct.time_limit,We=Ct.username,nt=Ct.user_path,Kt=Ct.user_praise,kt=Ct.comments_count,Ut=Ct.praises_count,_t=Ct.description,z=Ct.pass_count,b=Ct.submit_count,D=Object(l.h)(),V=xe[nn];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:At.a.info},n.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",n.a.createElement("b",null,Zt)),n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(yt.a,{color:V.color},V.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,an,"\u79D2"))),n.a.createElement(Ae.a,{value:_t,className:At.a.desc}),n.a.createElement("ul",{className:At.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(bt.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,z))),n.a.createElement("li",null,n.a.createElement(bt.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,b))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),D.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement(bt.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:It})," ",n.a.createElement("b",null,kt))," ")))},Ze=k("dhSg"),Pe=k("oBTY"),Xe=k("M8RZ"),be=k("qJ4+"),de=k("ErOA");function he(Ke,Ct){return Object(de.c)("/problems/".concat(Ke,"/comments.json?page=").concat(Ct,"&limit=10"))}function re(Ke){return Object(de.f)("/discusses/".concat(Ke,"/plus.json"),{container_type:"Discuss",type:1})}function ie(Ke,Ct,Bt){return Object(de.f)("/problems/".concat(Ke,"/comments/reply.json"),{comments:{content:Bt,parent_id:Ct}})}function le(Ke,Ct){return Object(de.f)("/problems/".concat(Ke,"/comments.json"),{comments:{content:Ct}})}function me(Ke,Ct,Bt){return Object(de.f)("/problems/".concat(Ke,"/comments/").concat(Ct,"/hidden.json"),Bt)}function De(Ke,Ct){return Object(de.b)("/problems/".concat(Ke,"/comments/").concat(Ct))}var Te=k("U7T7"),Qe=k("AMnG");function ct(Ke){var Ct=Ke.author;return n.a.createElement("a",{href:"/users/".concat(Ct.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(g.a.IMG_SERVER,"/images/").concat(Ct.image_url),width:"50"}))}function xt(Ke){var Ct=Ke.data,Bt=Ke.index,It=Ke.parentDiscussIndex,Zt=Ke.user,nn=Ke.onSetActionType,an=Ct.author,We=Ct.can_delete,nt=Ct.content,Kt=Ct.id,kt=Ct.time;function Ut(){nn({id:Kt,index:Bt,type:"delete-discuss",parentDiscussIndex:It,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var _t=Zt.admin||We||an.user_id===Zt.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(ct,{author:an}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(an.login),target:"_blank"},an.name),n.a.createElement("span",{className:"grey"},kt),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},_t?n.a.createElement("a",{onClick:Ut,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(Ae.a,{className:"discuss-content",value:nt})))}var ft=function(Ke){var Ct=Ke.user,Bt=Ke.data,It=Ke.index,Zt=Ke.onPlusDiscuss,nn=Ke.onSetActionType,an=Ke.activeDiscussIndex,We=Ke.onReplyDiscuss,nt=Ke.onSetActiveDiscussIndex,Kt=Bt.content,kt=Bt.children,Ut=Bt.hidden,_t=Bt.id,z=Bt.praise_count,b=Bt.time,D=Bt.user_praise,V=Bt.can_delete,J=Bt.author;function X(){nt(_t)}function Ee(){Zt(_t,!D,It)}function et(){nn({id:_t,index:It,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function vt(){nn({id:_t,index:It,params:{hidden:Ut?"0":"1"},type:"hidden-discuss",message:Ut?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var Rt=Ct.admin||Ct.user_id===J.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:_t},n.a.createElement(ct,{author:J}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(J.login),target:"_blank"}," ",J.name," "),n.a.createElement("span",{className:"grey"},b)),n.a.createElement(Ae.a,{className:"discuss-content",value:Kt}),kt&&kt.length>0?n.a.createElement("div",{className:"reply-discuss-container"},kt.map(function(at,zt){return n.a.createElement(xt,{key:at.id,data:at,index:zt,user:Ct,onSetActionType:nn,parentDiscussIndex:It})})):null,n.a.createElement("div",{className:"btn-group"},Rt?n.a.createElement("a",{onClick:vt,title:Ut?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Ut?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,V&&(!kt||kt.length==0)?n.a.createElement("a",{onClick:et,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:X,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:Ee,className:D?"c-orange":""},n.a.createElement("i",{className:D?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,z||""))),n.a.createElement(Qe.a,{id:_t,activeDiscussIndex:an,onReplyDiscuss:We})))},ut=k("kaH+"),$e=k("uD2n"),Ve=k.n($e),Ne=k("Ot1p"),oe=function(Ke){var Ct=Ke.user_praise,Bt=Ke.praise_count,It=Ke.praisePlus,Zt=Ke.onCreateDiscuss,nn=Ke.discuss_count,an=Object(f.useState)(!1),We=Object(L.a)(an,2),nt=We[0],Kt=We[1],kt=Object(f.useState)(""),Ut=Object(L.a)(kt,2),_t=Ut[0],z=Ut[1];function b(Ee){z(Ee)}function D(){Kt(!0)}function V(){Kt(!1)}function J(){return X.apply(this,arguments)}function X(){return X=Object(S.a)(h.a.mark(function Ee(){return h.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:Zt(_t),z(""),Kt(!1);case 3:case"end":return vt.stop()}},Ee)})),X.apply(this,arguments)}return n.a.createElement("div",{className:"".concat(Ve.a["dis-input-editor-container"]," ").concat(nt?Ve.a.active:""," ")},n.a.createElement("div",{className:nt?"hide ".concat(Ve.a["text-area"]):Ve.a["text-area"]},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:D}),n.a.createElement("a",null," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",nn," "),n.a.createElement("a",{className:"c-light-black",onClick:It,title:Ct?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(Ct?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Bt?n.a.createElement("span",null,Bt):"")),nt?n.a.createElement("div",{className:Ve.a["input-mask"],onClick:V}):null,n.a.createElement("div",{className:nt?Ve.a["md-container"]:"".concat(Ve.a["md-container"]," hide")},n.a.createElement(Ne.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:_t,height:240,onChange:b}),n.a.createElement("div",{className:Ve.a["tip-container"],onClick:V},n.a.createElement("a",{className:Ve.a["btn-send"],onClick:J}," \u53D1\u9001 "))))},ve={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},He;(function(Ke){Ke[Ke.GET_DISCUSSES=0]="GET_DISCUSSES",Ke[Ke.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Ke[Ke.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Ke[Ke.PLUS_DISCUSS=3]="PLUS_DISCUSS",Ke[Ke.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Ke[Ke.SET_PAGE=5]="SET_PAGE",Ke[Ke.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(He||(He={}));function je(Ke,Ct){switch(Ct.type){case He.SHOW_DISCUSSES_LOADING:return Object(d.a)(Object(d.a)({},Ke),{},{loading:!0});case He.GET_DISCUSSES:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case He.TOP_OR_DOWN_DISCUSS:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case He.SET_ACTION_TYPE:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case He.PLUS_DISCUSS:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case He.SET_PAGE:return Object(d.a)(Object(d.a)({},Ke),{},{page:Ct.payload});case He.ACTIVE_DISCUSS_INDEX:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);default:throw new Error}}var pt=function(Ke){var Ct=Ke.user,Bt=Ke.identifier,It=Ke.hack,Zt=Ke.onTriggerPraise,nn=Object(f.useReducer)(je,ve),an=Object(L.a)(nn,2),We=an[0],nt=an[1],Kt=We.loading,kt=We.page,Ut=We.data,_t=We.count,z=We.actionType,b=We.activeDiscussIndex,D=Object(f.useCallback)(Object(S.a)(h.a.mark(function hn(){var tn,An,Mn;return h.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return nt({type:He.SHOW_DISCUSSES_LOADING}),Cn.next=3,he(Bt,kt);case 3:tn=Cn.sent,An=tn.comments,Mn=tn.disscuss_count,nt({type:He.GET_DISCUSSES,payload:{data:An,count:Mn,loading:!1}});case 6:case"end":return Cn.stop()}},hn)})),[kt,Bt]);Object(f.useEffect)(function(){D()},[Bt,kt]);function V(hn){nt({type:He.SET_PAGE,page:hn})}function J(hn){nt({type:He.SET_ACTION_TYPE,payload:{actionType:hn}})}function X(hn){b===hn?nt({type:He.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):nt({type:He.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:hn}})}function Ee(hn,tn,An){return et.apply(this,arguments)}function et(){return et=Object(S.a)(h.a.mark(function hn(tn,An,Mn){var pn;return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.prev=0,bn.next=3,re(tn);case 3:pn=bn.sent,Ut[Mn].user_praise=An,Ut[Mn].praise_count=pn.praise_count,nt({type:He.PLUS_DISCUSS,payload:{data:Object(Pe.a)(Ut)}}),bn.next=12;break;case 9:bn.prev=9,bn.t0=bn.catch(0),console.log(bn.t0);case 12:case"end":return bn.stop()}},hn,null,[[0,9]])})),et.apply(this,arguments)}function vt(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(S.a)(h.a.mark(function hn(){var tn,An,Mn,pn,Cn,bn,$n,jn;return h.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(tn=z.id,An=z.params,Mn=z.type,pn=z.index,Cn=z.parentDiscussIndex,!(Mn==="hidden-discuss")){Sn.next=6;break}return Sn.next=4,me(Bt,tn,An);case 4:Cn?Ut[Cn].children[pn].hidden=An.hidden==1:Ut[pn].hidden=An.hidden==1,nt({type:He.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Pe.a)(Ut)}});case 6:if(!(Mn==="delete-discuss")){Sn.next=31;break}return Sn.next=9,De(Bt,tn);case 9:if(!(Cn||Cn===0)){Sn.next=22;break}bn=Ut[Cn].children,$n=bn.length-1;case 12:if(!($n>=0)){Sn.next=19;break}if(!(bn[$n].id===tn)){Sn.next=16;break}return bn.splice($n,1),Sn.abrupt("break",19);case 16:$n--,Sn.next=12;break;case 19:Ut[Cn].children=bn,Sn.next=30;break;case 22:jn=Ut.length-1;case 23:if(!(jn>=0)){Sn.next=30;break}if(!(Ut[jn].id===tn)){Sn.next=27;break}return Ut.splice(jn,1),Sn.abrupt("break",30);case 27:jn--,Sn.next=23;break;case 30:nt({type:He.SET_ACTION_TYPE,payload:{actionType:null,data:Object(Pe.a)(Ut)}});case 31:case"end":return Sn.stop()}},hn)})),Rt.apply(this,arguments)}function at(){nt({type:He.SET_ACTION_TYPE,payload:{actionType:null}})}function zt(hn,tn){return Wt.apply(this,arguments)}function Wt(){return Wt=Object(S.a)(h.a.mark(function hn(tn,An){return h.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.prev=0,pn.next=3,ie(Bt,tn,An);case 3:D(),pn.next=9;break;case 6:pn.prev=6,pn.t0=pn.catch(0),console.log(pn.t0);case 9:case"end":return pn.stop()}},hn,null,[[0,6]])})),Wt.apply(this,arguments)}function yn(hn){return Un.apply(this,arguments)}function Un(){return Un=Object(S.a)(h.a.mark(function hn(tn){return h.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return nt({type:He.SHOW_DISCUSSES_LOADING}),Mn.next=3,le(Bt,tn);case 3:D();case 4:case"end":return Mn.stop()}},hn)})),Un.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},Ut.length===0?n.a.createElement(tt.a,null):Ut.map(function(hn,tn){return n.a.createElement(ft,{onReplyDiscuss:zt,onPlusDiscuss:Ee,onSetActiveDiscussIndex:X,onSetActionType:J,data:hn,index:tn,user:Ct,activeDiscussIndex:b})}),_t>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(Me.a,{showQuickJumper:!0,onChange:V,current:kt,total:_t})):null),n.a.createElement(oe,{user_praise:It.user_praise,praise_count:It.praises_count,praisePlus:Zt,discuss_count:It.comments_count,onCreateDiscuss:yn}),n.a.createElement(Xe.a,null,n.a.createElement(U.a,{centered:!0,title:"\u63D0\u793A",visible:!!z,onOk:vt,onCancel:at},n.a.createElement("p",null,z?z.message:"")),n.a.createElement(ut.a,null)))},gt=function(Ke){var Ct=Ke.hack,Bt=Ke.onTriggerPraise,It=Ke.topicId,Zt=Ke.page,nn=Ke.onPageChange,an=Ke.user,We=Ke.submitRecords,nt=Ke.submitting,Kt=Ke.submitResult,kt=Object(f.useState)("0"),Ut=Object(L.a)(kt,2),_t=Ut[0],z=Ut[1],b=Object(l.h)();function D(J){var X=J.target.id;z(X)}Object(f.useEffect)(function(){var J=Ze.a.subscribe("to-commit-info",function(){z("1")});return J},[]);function V(){z("2")}return console.log(We,"submitRecords"),n.a.createElement("div",{className:Se.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Se.a["s-navs"],' "bg-white"')},n.a.createElement("li",null,n.a.createElement("a",{className:_t==="0"?Se.a.active:"",id:"0",onClick:D},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",null,n.a.createElement("a",{className:_t==="1"?Se.a.active:"",id:"1",onClick:D},"\u63D0\u4EA4\u8BB0\u5F55")),b.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement("a",{className:_t==="2"?Se.a.active:"",id:"2",onClick:D},"\u8BC4\u8BBA"))),n.a.createElement("div",{className:"".concat(Se.a["tab-panel-body"]," ").concat(_t==="0"?"":"hide")},n.a.createElement(Be,{hack:Ct,onTriggerPraise:Bt,toDiscuss:V})),n.a.createElement("div",{className:"".concat(Se.a["tab-panel-body"]," ").concat(_t==="1"?"":"hide")},!!(We!=null&&We.records_count)||nt?n.a.createElement(rt,{page:Zt,onPageChange:nn,topicId:It,submitting:nt,submitRecords:We,submitResult:Kt}):n.a.createElement(tt.a,null)),n.a.createElement("div",{className:"".concat(Se.a["tab-panel-body"]," ").concat(_t==="2"?"":"hide"),style:{padding:0}},n.a.createElement(pt,{user:an,identifier:Ct.identifier,hack:Ct,onTriggerPraise:Bt})))},Re=C.a.Countdown,Ge={Java:"java",C:"c",Python:"py","C++":"c"},Ue;(function(Ke){Ke[Ke.SET_LOADING=0]="SET_LOADING",Ke[Ke.GET_DATA=1]="GET_DATA",Ke[Ke.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",Ke[Ke.SET_DATA=3]="SET_DATA",Ke[Ke.SET_DEBUGING=4]="SET_DEBUGING",Ke[Ke.SET_SUBMITING=5]="SET_SUBMITING",Ke[Ke.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",Ke[Ke.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",Ke[Ke.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",Ke[Ke.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",Ke[Ke.SET_PAGE=10]="SET_PAGE"})(Ue||(Ue={}));function mt(){return new Date().getTime()}var wt={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function qt(Ke,Ct){switch(Ct.type){case Ue.GET_DATA:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case Ue.SET_DATA:return Object(d.a)(Object(d.a)({},Ke),{},{data:Ct.payload});case Ue.SET_LOADING:return Object(d.a)(Object(d.a)({},Ke),{},{loading:Ct.payload});case Ue.SET_SHOW_NOTE:return Object(d.a)(Object(d.a)({},Ke),{},{showNote:Ct.payload});case Ue.SET_DEBUGING:return Object(d.a)(Object(d.a)({},Ke),{},{debuging:Ct.payload});case Ue.SET_SUBMITING:return Object(d.a)(Object(d.a)({},Ke),{},{submitting:Ct.payload});case Ue.GET_SUBMIT_RECORDS:return Object(d.a)(Object(d.a)({},Ke),{},{submitRecords:Ct.payload});case Ue.SET_PAGE:return Object(d.a)(Object(d.a)({},Ke),{},{submitRecordPage:Ct.payload});case Ue.SET_EXECUTE_MESSAGE:return Object(d.a)(Object(d.a)({},Ke),{},{executingMessage:Ct.payload});case Ue.SET_EXECUTE_RESULT:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);case Ue.SET_SUBMIT_RESULT:return Object(d.a)(Object(d.a)({},Ke),Ct.payload);default:throw new Error}}var en=se.default=function(Ke){var Ct,Bt,It,Zt=Ke.children,nn=Object(f.useReducer)(qt,wt),an=Object(L.a)(nn,2),We=an[0],nt=an[1],Kt=Object(l.i)(),kt=Kt.id,Ut=Object(l.g)(),_t=Object(l.h)(),z=We.loading,b=We.data,D=We.debugResult,V=We.submitResult,J=We.submitRecords,X=We.submitRecordPage,Ee=We.showNote,et=We.debuging,vt=We.submitting,Rt=We.executingMessage,at=Object(f.useState)("#FFF"),zt=Object(L.a)(at,2),Wt=zt[0],yn=zt[1],Un=Object(f.useState)(null),hn=Object(L.a)(Un,2),tn=hn[0],An=hn[1],Mn=Object(f.useState)({}),pn=Object(L.a)(Mn,2),Cn=pn[0],bn=pn[1],$n=Object(f.useState)(!0),jn=Object(L.a)($n,2),pr=jn[0],Sn=jn[1],wr=b==null?void 0:b.user,xn=b==null?void 0:b.hack;Object(f.useEffect)(function(){function un(){return rn.apply(this,arguments)}function rn(){return rn=Object(S.a)(h.a.mark(function Rn(){var dt,jt,Nt,Xt,Yt,fn,Lt,Tn,kn,$t,Bn;return h.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return Sn(!0),dn.next=3,Object(E.d)(kt);case 3:if(dt=dn.sent,setTimeout(function(){Sn(!1)},800),dt.status===401?document.location.href="/user/login":(dt.hack.code=T.Base64.decode(dt.hack.code),nt({type:Ue.GET_DATA,payload:{loading:!1,data:dt}})),!(_t.query.type==="exercises")){dn.next=18;break}if(!(_t.query.coursesId=="coursesId")){dn.next=13;break}return dn.next=10,Object(y.Y)({categoryId:_t.query.exercisesId,login:_t.query.login});case 10:Yt=dn.sent,dn.next=16;break;case 13:return dn.next=15,Object(y.y)({categoryId:_t.query.exercisesId,login:_t.query.login});case 15:Yt=dn.sent;case 16:bn(Object(d.a)({},Yt)),(jt=Yt)!==null&&jt!==void 0&&jt.left_banner_id&&(Nt=Yt)!==null&&Nt!==void 0&&(Xt=Nt.exercise)!==null&&Xt!==void 0&&Xt.left_time&&(An(Date.now()+((fn=Yt)===null||fn===void 0||((Lt=fn.exercise)===null||Lt===void 0)?void 0:Lt.left_time)*1e3),setTimeout(function(){yn("red")},(((Tn=Yt)===null||Tn===void 0||((kn=Tn.exercise)===null||kn===void 0)?void 0:kn.left_time)-300>0?(($t=Yt)===null||$t===void 0||((Bn=$t.exercise)===null||Bn===void 0)?void 0:Bn.left_time)-300:0)*1e3));case 18:case"end":return dn.stop()}},Rn)})),rn.apply(this,arguments)}kt&&un()},[kt]),Object(f.useEffect)(function(){return nr(),_t.query.type==="exercises"&&(document.addEventListener(Object(R.c)(),tr),window.focus(),window.onblur=function(){Object(R.a)()&&Object(R.b)()}),function(){document.removeEventListener(Object(R.c)(),tr)}},[kt,X]);var tr=function(){window.parent.postMessage("backExercise","*")};function nr(){return mr.apply(this,arguments)}function mr(){return mr=Object(S.a)(h.a.mark(function un(){var rn;return h.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.prev=0,dt.next=3,Object(E.f)(kt,{limit:15,page:X});case 3:rn=dt.sent,nt({type:Ue.GET_SUBMIT_RECORDS,payload:rn}),dt.next=10;break;case 7:dt.prev=7,dt.t0=dt.catch(0),console.log(dt.t0);case 10:case"end":return dt.stop()}},un,null,[[0,7]])})),mr.apply(this,arguments)}function Ar(un){nt({type:Ue.SET_PAGE,payload:un})}function ar(){return vn.apply(this,arguments)}function vn(){return vn=Object(S.a)(h.a.mark(function un(){var rn;return h.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(E.k)(kt,{code:T.Base64.encode(xn.code)});case 2:return rn=dt.sent,dt.abrupt("return",rn);case 4:case"end":return dt.stop()}},un)})),vn.apply(this,arguments)}function on(){return Dn.apply(this,arguments)}function Dn(){return Dn=Object(S.a)(h.a.mark(function un(){var rn,Rn,dt,jt,Nt,Xt,Yt;return h.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(!vt){Lt.next=2;break}return Lt.abrupt("return");case 2:return nt({type:Ue.SET_SUBMITING,payload:!0}),Lt.prev=3,Ze.a.publish("to-commit-info"),Lt.next=7,ar();case 7:if(rn=Lt.sent,console.log(rn,1),!(rn.status===0)){Lt.next=23;break}return Yt=function(){return Yt=Object(S.a)(h.a.mark(function kn(){var $t,Bn,sn,dn,Kn,zn;return h.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(E.c)(kt,"submit");case 2:if($t=Jt.sent,Bn=$t.status,sn=$t.data,dn=mt(),Kn=dn-Nt>(jt+3)*1e3,Bn!==0&&!Kn&&setTimeout(Xt,1e3),!Kn){Jt.next=12;break}return U.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),nt({type:Ue.SET_SUBMITING,payload:!1}),Jt.abrupt("return");case 12:if(!(Bn===0)){Jt.next=18;break}return sn.status===2&&U.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Jt.next=16,Object(E.f)(kt,{limit:15,page:X});case 16:zn=Jt.sent,nt({type:Ue.SET_SUBMIT_RESULT,payload:Object(d.a)(Object(d.a)({},We),{},{submitResult:sn,submitting:!1,submitRecords:zn})});case 18:case"end":return Jt.stop()}},kn)})),Yt.apply(this,arguments)},Xt=function(){return Yt.apply(this,arguments)},Rn={},_t.query.type==="exercises"&&(Rn.extras={exercise_id:_t.query.exercisesId,question_id:_t.query.questionId}),Lt.next=16,Object(E.h)(kt,Rn);case 16:if(dt=Lt.sent,!(dt.status===-1)){Lt.next=20;break}return window.parent.location.href="/classrooms/".concat(_t.query.coursesId,"/exercise/").concat(_t.query.exercisesId,"/detail"),Lt.abrupt("return");case 20:jt=xn.time_limit,Nt=mt(),Xt();case 23:Lt.next=29;break;case 25:Lt.prev=25,Lt.t0=Lt.catch(3),console.log(Lt.t0),nt({type:Ue.SET_SUBMITING,payload:!1});case 29:case"end":return Lt.stop()}},un,null,[[3,25]])})),Dn.apply(this,arguments)}function mn(){return On.apply(this,arguments)}function On(){return On=Object(S.a)(h.a.mark(function un(){var rn,Rn,dt,jt,Nt,Xt,Yt;return h.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return We.debuging=!0,nt({type:Ue.SET_DEBUGING,payload:!0}),Lt.prev=2,Lt.next=5,ar();case 5:if(rn=Lt.sent,!(rn.status===0)){Lt.next=22;break}return Yt=function(){return Yt=Object(S.a)(h.a.mark(function kn(){var $t,Bn,sn,dn,Kn,zn;return h.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return Jt.next=2,Object(E.c)(kt,"debug");case 2:if($t=Jt.sent,Bn=$t.status,sn=$t.message,dn=$t.data,Kn=mt(),zn=Kn-Nt>(Rn+3)*1e3,Bn!==0&&!zn&&(nt({type:Ue.SET_EXECUTE_MESSAGE,payload:sn}),setTimeout(Xt,1e3)),!zn){Jt.next=13;break}return U.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),nt({type:Ue.SET_DEBUGING,payload:!1}),Jt.abrupt("return");case 13:Bn===0&&(nt({type:Ue.SET_DEBUGING,payload:!1}),dn.status===2&&U.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),dn.status===2&&U.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),nt({type:Ue.SET_EXECUTE_RESULT,payload:Object(d.a)(Object(d.a)({},We),{},{debugResult:dn,debuging:!1})}));case 14:case"end":return Jt.stop()}},kn)})),Yt.apply(this,arguments)},Xt=function(){return Yt.apply(this,arguments)},Rn=xn.time_limit,dt={input:encodeURIComponent(b.test_case.input)},_t.query.type==="exercises"&&(dt.exercise_id=_t.query.exercisesId),Lt.next=14,Object(E.b)(kt,dt);case 14:if(jt=Lt.sent,!(jt.status===-1)){Lt.next=18;break}return window.parent.location.href="/classrooms/".concat(_t.query.coursesId,"/exercise/").concat(_t.query.exercisesId,"/detail"),Lt.abrupt("return");case 18:Nt=mt(),Xt(),Lt.next=23;break;case 22:nt({type:Ue.SET_DEBUGING,payload:!1});case 23:Lt.next=28;break;case 25:Lt.prev=25,Lt.t0=Lt.catch(2),console.log(Lt.t0);case 28:return Lt.prev=28,Lt.finish(28);case 30:case"end":return Lt.stop()}},un,null,[[2,25,28,30]])})),On.apply(this,arguments)}function ln(un){nt({type:Ue.SET_DATA,payload:Object(d.a)(Object(d.a)({},b),{},{hack:Object(d.a)(Object(d.a)({},xn),{},{code:un})})})}function gr(un){var rn=un.target.value;nt({type:Ue.SET_DATA,payload:Object(d.a)(Object(d.a)({},b),{},{test_case:{input:rn}})})}function Pn(){return Hn.apply(this,arguments)}function Hn(){return Hn=Object(S.a)(h.a.mark(function un(){var rn;return h.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.prev=0,dt.next=3,Object(E.g)(kt);case 3:rn=dt.sent,rn.status===401?Ut.replace("/login",{from:_t.pathname}):ln(T.Base64.decode(rn.code)),dt.next=10;break;case 7:dt.prev=7,dt.t0=dt.catch(0),console.log(dt.t0);case 10:case"end":return dt.stop()}},un,null,[[0,7]])})),Hn.apply(this,arguments)}function Or(){U.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(S.a)(h.a.mark(function rn(){var Rn;return h.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(E.i)(kt);case 2:Rn=jt.sent,Rn.status===401?Ut.replace("/login",{from:_t.pathname}):ln(T.Base64.decode(Rn.code));case 4:case"end":return jt.stop()}},rn)}))()}})}function xr(){nt({type:Ue.SET_SHOW_NOTE,payload:!0})}function vr(){nt({type:Ue.SET_SHOW_NOTE,payload:!1})}function Nr(un){return Xn.apply(this,arguments)}function Xn(){return Xn=Object(S.a)(h.a.mark(function un(rn){return h.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(E.a)(kt,rn);case 2:nt({type:Ue.GET_DATA,payload:{showNote:!1,data:Object(d.a)(Object(d.a)({},b),{},{hack:Object(d.a)(Object(d.a)({},xn),{},{notes:rn.notes})})}});case 3:case"end":return dt.stop()}},un)})),Xn.apply(this,arguments)}var Lr={input:b==null||((Ct=b.test_case)===null||Ct===void 0)?void 0:Ct.input,language:xn==null?void 0:xn.language,code:xn==null?void 0:xn.code,title:"main."+Ge[xn==null?void 0:xn.language],modify_code:xn==null?void 0:xn.modify_code,notes:xn==null?void 0:xn.notes,debugResult:D,debuging:et,submitting:vt,executingMessage:Rt,onCancelNote:vr,onAddNote:Nr,showNote:Ee,onShowNote:xr,onSubmitCode:on,onChangeCode:ln,onChangeInput:gr,onDebugCode:mn,onResetCode:Pn,onSyncCode:Or,onUpdateCode:ar};function lr(){return Cr.apply(this,arguments)}function Cr(){return Cr=Object(S.a)(h.a.mark(function un(){var rn,Rn,dt;return h.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(E.j)(xn.id,{container_type:"Hack",type:1});case 2:rn=Nt.sent,Rn=rn.praise_count,dt=Object(d.a)(Object(d.a)({},b),{},{hack:Object(d.a)(Object(d.a)({},xn),{},{praises_count:Rn,user_praise:!xn.user_praise})}),nt({type:Ue.SET_DATA,payload:dt});case 6:case"end":return Nt.stop()}},un)})),Cr.apply(this,arguments)}var Mr={topicId:kt,submitResult:V,submitRecords:J,submitting:vt,page:X,onPageChange:Ar,hack:xn,user:b==null?void 0:b.user,onTriggerPraise:lr};return n.a.createElement(n.a.Fragment,null,n.a.createElement(W.a,{spinning:z,delay:500},b?n.a.createElement(n.a.Fragment,null,n.a.createElement("header",{className:P.a.header},_t.query.type!=="exercises"&&n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(g.a.IMG_SERVER,"/images/").concat(wr.image_url),alt:"user",width:30}),n.a.createElement("span",null,wr.name)),n.a.createElement("h2",null," ",xn.name," "),wr.hack_manager?n.a.createElement(x.a,{className:P.a.btn_back,to:"/problems/".concat(xn.identifier,"/edit"),style:{marginRight:10}}," ",n.a.createElement(r.a,null)," \u7F16\u8F91"):null,(Cn==null||((Bt=Cn.exercise)===null||Bt===void 0)?void 0:Bt.left_time)&&n.a.createElement(n.a.Fragment,null,n.a.createElement("span",{style:{color:Wt},className:"iconfont icon-kaoshishichang mr5"}),n.a.createElement("span",{className:"c-white mr20"},n.a.createElement(Re,{valueStyle:{color:Wt,fontSize:16,fontWeight:"normal"},title:n.a.createElement("span",{style:{color:Wt,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:tn,onFinish:Object(S.a)(h.a.mark(function un(){var rn,Rn;return h.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:return jt.next=2,Object(y.Z)({categoryId:_t.query.exercisesId,commit_method:2});case 2:rn=jt.sent,(rn==null?void 0:rn.status)===0&&(ar(),U.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:n.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",n.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Nt=Object(S.a)(h.a.mark(function Yt(){return h.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:window.parent.location.href="/classrooms/".concat(_t.query.coursesId,"/exercise/").concat(_t.query.exercisesId,"/detail");case 1:case"end":return Lt.stop()}},Yt)}));function Xt(){return Nt.apply(this,arguments)}return Xt}()})),(rn==null?void 0:rn.status)===-3&&(Rn=parseInt(rn==null?void 0:rn.message),An(Date.now()+Rn*1e3));case 5:case"end":return jt.stop()}},un)}))}))),(_t==null||((It=_t.query)===null||It===void 0)?void 0:It.type)==="exercises"?n.a.createElement(A.a,{type:"primary",onClick:function(){ar(),U.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){tr()}})}},n.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," \u8FD4\u56DE\u8BD5\u5377"):n.a.createElement(x.a,{className:P.a.btn_back,to:"/problemset"}," ",n.a.createElement(o.a,null),"\u9000\u51FA")),n.a.createElement(W.a,{size:"large",spinning:pr},n.a.createElement(O.a,{className:"my-problems",leftChild:n.a.createElement(gt,Mr),rightChild:n.a.createElement(Dt,Lr)}))):null))};function Vt(Ke){var Ct=Ke.title,Bt=Ke.modify_code,It=Ke.onSyncCode,Zt=Ke.onShowCodeSetting,nn=Ke.onResetCode,an=function(){U.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(m.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:nn})};return n.a.createElement("div",{className:"action-bar"},n.a.createElement("span",null),Bt?n.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:It},n.a.createElement("img",{src:_.a,alt:"notice"})):null,n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:an},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:Zt},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Dt(Ke){var Ct=Ke.input,Bt=Ke.showNote,It=Ke.onShowNote,Zt=Ke.notes,nn=Ke.onCancelNote,an=Ke.onAddNote,We=Ke.debugResult,nt=Ke.language,Kt=Ke.debuging,kt=Ke.submitting,Ut=Ke.executingMessage,_t=Ke.code,z=Ke.onSubmitCode,b=Ke.onDebugCode,D=Ke.onChangeCode,V=Ke.onChangeInput,J=Ke.onUpdateCode,X=Object(H.a)(Ke,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function Ee(vt){return n.a.createElement(Vt,Object(Q.a)({},X,{onShowCodeSetting:vt}))}var et={input:Ct,debugResult:We,debuging:Kt,submitting:kt,executingMessage:Ut,onDebugCode:b,onChangeCode:D,onSubmitCode:z,onChangeInput:V};return n.a.createElement("div",{className:"right-panel"},n.a.createElement(s.a,{language:nt,value:_t,onChange:D,ActionBarRender:Ee}),n.a.createElement("div",{className:"note-form-area ".concat(Bt?"active":"")},n.a.createElement(fe,{onCancel:nn,notes:Zt,callback:an})),n.a.createElement(K.b,et))}},RELg:function(Ye,se,k){var Q=k("MFOe"),H=Q.Global;Ye.exports={name:"oldIE-userDataStorage",write:F,read:U,each:S,remove:L,clearAll:d};var M="storejs",W=H.document,N=p(),A=(H.navigator?H.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function F(h,f){if(A)return;var n=C(h);N(function(r){r.setAttribute(n,f),r.save(M)})}function U(h){if(A)return;var f=C(h),n=null;return N(function(r){n=r.getAttribute(f)}),n}function S(h){N(function(f){for(var n=f.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];h(f.getAttribute(o.name),o.name)}})}function L(h){var f=C(h);N(function(n){n.removeAttribute(f),n.save(M)})}function d(){N(function(h){var f=h.XMLDocument.documentElement.attributes;h.load(M);for(var n=f.length-1;n>=0;n--)h.removeAttribute(f[n].name);h.save(M)})}var v=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function C(h){return h.replace(/^\d/,"___$&").replace(v,"___")}function p(){if(!W||!W.documentElement||!W.documentElement.addBehavior)return null;var h="script",f,n,r;try{n=new ActiveXObject("htmlfile"),n.open(),n.write("<"+h+">document.w=window</"+h+'><iframe src="/favicon.ico"></iframe>'),n.close(),f=n.w.frames[0].document,r=f.createElement("div")}catch(o){r=W.createElement("div"),f=W.body}return function(o){var l=[].slice.call(arguments,0);l.unshift(r),f.appendChild(r),r.addBehavior("#default#userData"),r.load(M),o.apply(this,l),f.removeChild(r);return}}},"S+dL":function(Ye,se){Ye.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"SA+Z":function(Ye,se,k){var Q=k("wTVA"),H=k("EbDI"),M=k("ZhPi"),W=k("wkBT");function N(A){return Q(A)||H(A)||M(A)||W()}Ye.exports=N,Ye.exports.__esModule=!0,Ye.exports.default=Ye.exports},SJMd:function(Ye,se){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var k,Q,H,M=!1,W,N;window.PR_SHOULD_USE_CONTINUATION=!0;var A,F;(function(){var U=window,S=["break,continue,do,else,for,if,return,while"],L=[S,"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"],d=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[d,"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"],C=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],h="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[d,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],n="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[S,"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=[S,"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"],l=[S,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],x=[v,p,C,f,n,r,o,l],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",R="kwd",O="com",g="typ",m="lit",s="pun",u="pln",_="tag",T="dec",w="src",P="atn",j="atv",K="nocode",Z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(pe){for(var Oe=0,ze=!1,qe=!1,Je=0,rt=pe.length;Je<rt;++Je){var tt=pe[Je];if(tt.ignoreCase)qe=!0;else if(/[a-z]/i.test(tt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ze=!0,qe=!1;break}}var Tt={b:8,t:9,n:10,v:11,f:12,r:13};function bt(Ae){var xe=Ae.charCodeAt(0);if(xe!==92)return xe;var Be=Ae.charAt(1);return xe=Tt[Be],xe||("0"<=Be&&Be<="7"?parseInt(Ae.substring(1),8):Be==="u"||Be==="x"?parseInt(Ae.substring(2),16):Ae.charCodeAt(1))}function Et(Ae){if(Ae<32)return(Ae<16?"\\x0":"\\x")+Ae.toString(16);var xe=String.fromCharCode(Ae);return xe==="\\"||xe==="-"||xe==="]"||xe==="^"?"\\"+xe:xe}function yt(Ae){var xe=Ae.substring(1,Ae.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")),Be=[],Ze=xe[0]==="^",Pe=["["];Ze&&Pe.push("^");for(var Xe=Ze?1:0,be=xe.length;Xe<be;++Xe){var de=xe[Xe];if(/\\[bdsw]/i.test(de))Pe.push(de);else{var he=bt(de),re;Xe+2<be&&xe[Xe+1]==="-"?(re=bt(xe[Xe+2]),Xe+=2):re=he,Be.push([he,re]),re<65||he>122||(re<65||he>90||Be.push([Math.max(65,he)|32,Math.min(re,90)|32]),re<97||he>122||Be.push([Math.max(97,he)&~32,Math.min(re,122)&~32]))}}Be.sort(function(De,Te){return De[0]-Te[0]||Te[1]-De[1]});for(var ie=[],le=[],Xe=0;Xe<Be.length;++Xe){var me=Be[Xe];me[0]<=le[1]+1?le[1]=Math.max(le[1],me[1]):ie.push(le=me)}for(var Xe=0;Xe<ie.length;++Xe){var me=ie[Xe];Pe.push(Et(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&Pe.push("-"),Pe.push(Et(me[1])))}return Pe.push("]"),Pe.join("")}function Ot(Ae){for(var xe=Ae.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")),Be=xe.length,Ze=[],Pe=0,Xe=0;Pe<Be;++Pe){var be=xe[Pe];if(be==="(")++Xe;else if(be.charAt(0)==="\\"){var de=+be.substring(1);de&&(de<=Xe?Ze[de]=-1:xe[Pe]=Et(de))}}for(var Pe=1;Pe<Ze.length;++Pe)Ze[Pe]===-1&&(Ze[Pe]=++Oe);for(var Pe=0,Xe=0;Pe<Be;++Pe){var be=xe[Pe];if(be==="(")++Xe,Ze[Xe]||(xe[Pe]="(?:");else if(be.charAt(0)==="\\"){var de=+be.substring(1);de&&de<=Xe&&(xe[Pe]="\\"+Ze[de])}}for(var Pe=0;Pe<Be;++Pe)xe[Pe]==="^"&&xe[Pe+1]!=="^"&&(xe[Pe]="");if(Ae.ignoreCase&&ze)for(var Pe=0;Pe<Be;++Pe){var be=xe[Pe],he=be.charAt(0);be.length>=2&&he==="["?xe[Pe]=yt(be):he!=="\\"&&(xe[Pe]=be.replace(/[a-zA-Z]/g,function(le){var me=le.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return xe.join("")}for(var At=[],Je=0,rt=pe.length;Je<rt;++Je){var tt=pe[Je];if(tt.global||tt.multiline)throw new Error(""+tt);At.push("(?:"+Ot(tt)+")")}return new RegExp(At.join("|"),qe?"gi":"g")}function B(pe,Oe){var ze=/(?:^|\s)nocode(?:\s|$)/,qe=[],Je=0,rt=[],tt=0;function Tt(bt){var Et=bt.nodeType;if(Et==1){if(ze.test(bt.className))return;for(var yt=bt.firstChild;yt;yt=yt.nextSibling)Tt(yt);var Ot=bt.nodeName.toLowerCase();(Ot==="br"||Ot==="li")&&(qe[tt]=`
|
|
`,rt[tt<<1]=Je++,rt[tt++<<1|1]=bt)}else if(Et==3||Et==4){var At=bt.nodeValue;At.length&&(Oe?At=At.replace(/\r\n?/g,`
|
|
`):At=At.replace(/[ \t\r\n]+/g," "),qe[tt]=At,rt[tt<<1]=Je,Je+=At.length,rt[tt++<<1|1]=bt)}}return Tt(pe),{sourceCode:qe.join("").replace(/\n$/,""),spans:rt}}function $(pe,Oe,ze,qe,Je){if(!ze)return;var rt={sourceNode:pe,pre:1,langExtension:null,numberLines:null,sourceCode:ze,spans:null,basePos:Oe,decorations:null};qe(rt),Je.push.apply(Je,rt.decorations)}var ne=/\S/;function ae(pe){for(var Oe=void 0,ze=pe.firstChild;ze;ze=ze.nextSibling){var qe=ze.nodeType;Oe=qe===1?Oe?pe:ze:qe===3&&ne.test(ze.nodeValue)?pe:Oe}return Oe===pe?void 0:Oe}function fe(pe,Oe){var ze={},qe;(function(){for(var tt=pe.concat(Oe),Tt=[],bt={},Et=0,yt=tt.length;Et<yt;++Et){var Ot=tt[Et],At=Ot[3];if(At)for(var Ae=At.length;--Ae>=0;)ze[At.charAt(Ae)]=Ot;var xe=Ot[1],Be=""+xe;bt.hasOwnProperty(Be)||(Tt.push(xe),bt[Be]=null)}Tt.push(/[\0-\uffff]/),qe=G(Tt)})();var Je=Oe.length,rt=function(tt){for(var Tt=tt.sourceCode,bt=tt.basePos,Et=tt.sourceNode,yt=[bt,u],Ot=0,At=Tt.match(qe)||[],Ae={},xe=0,Be=At.length;xe<Be;++xe){var Ze=At[xe],Pe=Ae[Ze],Xe=void 0,be;if(typeof Pe=="string")be=!1;else{var de=ze[Ze.charAt(0)];if(de)Xe=Ze.match(de[1]),Pe=de[0];else{for(var he=0;he<Je;++he)if(de=Oe[he],Xe=Ze.match(de[1]),Xe){Pe=de[0];break}Xe||(Pe=u)}be=Pe.length>=5&&Pe.substring(0,5)==="lang-",be&&!(Xe&&typeof Xe[1]=="string")&&(be=!1,Pe=w),be||(Ae[Ze]=Pe)}var re=Ot;if(Ot+=Ze.length,!be)yt.push(bt+re,Pe);else{var ie=Xe[1],le=Ze.indexOf(ie),me=le+ie.length;Xe[2]&&(me=Ze.length-Xe[2].length,le=me-ie.length);var De=Pe.substring(5);$(Et,bt+re,Ze.substring(0,le),rt,yt),$(Et,bt+re+le,ie,ue(De,ie),yt),$(Et,bt+re+me,Ze.substring(me),rt,yt)}}tt.decorations=yt};return rt}function _e(pe){var Oe=[],ze=[];pe.tripleQuotedStrings?Oe.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):pe.multiLineStrings?Oe.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Oe.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),pe.verbatimStrings&&ze.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=pe.hashComments;qe&&(pe.cStyleComments?(qe>1?Oe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Oe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ze.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Oe.push([O,/^#[^\r\n]*/,null,"#"])),pe.cStyleComments&&(ze.push([O,/^\/\/[^\r\n]*/,null]),ze.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Je=pe.regexLiterals;if(Je){var rt=Je>1?"":`
|
|
\r`,tt=rt?".":"[\\S\\s]",Tt="/(?=[^/*"+rt+"])(?:[^/\\x5B\\x5C"+rt+"]|\\x5C"+tt+"|\\x5B(?:[^\\x5C\\x5D"+rt+"]|\\x5C"+tt+")*(?:\\x5D|$))+/";ze.push(["lang-regex",RegExp("^"+Z+"("+Tt+")")])}var bt=pe.types;bt&&ze.push([g,bt]);var Et=(""+pe.keywords).replace(/^ | $/g,"");Et.length&&ze.push([R,new RegExp("^(?:"+Et.replace(/[\s,]+/g,"|")+")\\b"),null]),Oe.push([u,/^\s+/,null,` \r
|
|
\xA0`]);var yt="^.[^\\s\\w.$@'\"`/\\\\]*";return pe.regexLiterals&&(yt+="(?!s*/)"),ze.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[s,new RegExp(yt),null]),fe(Oe,ze)}var Se=_e({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function we(pe,Oe,ze){for(var qe=/(?:^|\s)nocode(?:\s|$)/,Je=/\r\n?|\n/,rt=pe.ownerDocument,tt=rt.createElement("li");pe.firstChild;)tt.appendChild(pe.firstChild);var Tt=[tt];function bt(xe){var Be=xe.nodeType;if(Be==1&&!qe.test(xe.className))if(xe.nodeName==="br")Et(xe),xe.parentNode&&xe.parentNode.removeChild(xe);else for(var Ze=xe.firstChild;Ze;Ze=Ze.nextSibling)bt(Ze);else if((Be==3||Be==4)&&ze){var Pe=xe.nodeValue,Xe=Pe.match(Je);if(Xe){var be=Pe.substring(0,Xe.index);xe.nodeValue=be;var de=Pe.substring(Xe.index+Xe[0].length);if(de){var he=xe.parentNode;he.insertBefore(rt.createTextNode(de),xe.nextSibling)}Et(xe),be||xe.parentNode.removeChild(xe)}}}function Et(xe){for(;!xe.nextSibling;)if(xe=xe.parentNode,!xe)return;function Be(Xe,be){var de=be?Xe.cloneNode(!1):Xe,he=Xe.parentNode;if(he){var re=Be(he,1),ie=Xe.nextSibling;re.appendChild(de);for(var le=ie;le;le=ie)ie=le.nextSibling,re.appendChild(le)}return de}for(var Ze=Be(xe.nextSibling,0),Pe;(Pe=Ze.parentNode)&&Pe.nodeType===1;)Ze=Pe;Tt.push(Ze)}for(var yt=0;yt<Tt.length;++yt)bt(Tt[yt]);Oe===(Oe|0)&&Tt[0].setAttribute("value",Oe);var Ot=rt.createElement("ol");Ot.className="linenums";for(var At=Math.max(0,Oe-1|0)||0,yt=0,Ae=Tt.length;yt<Ae;++yt)tt=Tt[yt],tt.className="L"+(yt+At)%10,tt.firstChild||tt.appendChild(rt.createTextNode("\xA0")),Ot.appendChild(tt);pe.appendChild(Ot)}function Me(pe){var Oe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Oe=Oe&&+Oe[1]<=8;var ze=/\n/g,qe=pe.sourceCode,Je=qe.length,rt=0,tt=pe.spans,Tt=tt.length,bt=0,Et=pe.decorations,yt=Et.length,Ot=0;Et[yt]=Je;var At,Ae;for(Ae=At=0;Ae<yt;)Et[Ae]!==Et[Ae+2]?(Et[At++]=Et[Ae++],Et[At++]=Et[Ae++]):Ae+=2;for(yt=At,Ae=At=0;Ae<yt;){for(var xe=Et[Ae],Be=Et[Ae+1],Ze=Ae+2;Ze+2<=yt&&Et[Ze+1]===Be;)Ze+=2;Et[At++]=xe,Et[At++]=Be,Ae=Ze}yt=Et.length=At;var Pe=pe.sourceNode,Xe="";Pe&&(Xe=Pe.style.display,Pe.style.display="none");try{for(var be=null;bt<Tt;){var de=tt[bt],he=tt[bt+2]||Je,re=Et[Ot+2]||Je,Ze=Math.min(he,re),ie=tt[bt+1],le;if(ie.nodeType!==1&&(le=qe.substring(rt,Ze))){Oe&&(le=le.replace(ze,"\r")),ie.nodeValue=le;var me=ie.ownerDocument,De=me.createElement("span");De.className=Et[Ot+1];var Te=ie.parentNode;Te.replaceChild(De,ie),De.appendChild(ie),rt<he&&(tt[bt+1]=ie=me.createTextNode(qe.substring(Ze,he)),Te.insertBefore(ie,De.nextSibling))}rt=Ze,rt>=he&&(bt+=2),rt>=re&&(Ot+=2)}}finally{Pe&&(Pe.style.display=Xe)}}var Le={};function ge(pe,Oe){for(var ze=Oe.length;--ze>=0;){var qe=Oe[ze];Le.hasOwnProperty(qe)?U.console&&console.warn("cannot override language handler %s",qe):Le[qe]=pe}}function ue(pe,Oe){return pe&&Le.hasOwnProperty(pe)||(pe=/^\s*</.test(Oe)?"default-markup":"default-code"),Le[pe]}ge(Se,["default-code"]),ge(fe([],[[u,/^[^<?]+/],[T,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\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"]),ge(fe([[u,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ge(fe([],[[j,/^[\s\S]+/]]),["uq.val"]),ge(_e({keywords:v,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),ge(_e({keywords:"null,true,false"}),["json"]),ge(_e({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),ge(_e({keywords:C,cStyleComments:!0}),["java"]),ge(_e({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ge(_e({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ge(_e({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ge(_e({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ge(_e({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ge(_e({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ge(fe([],[[y,/^[\s\S]+/]]),["regex"]);function ke(pe){var Oe=pe.langExtension;try{var ze=B(pe.sourceNode,pe.pre),qe=ze.sourceCode;pe.sourceCode=qe,pe.spans=ze.spans,pe.basePos=0,ue(Oe,qe)(pe),Me(pe)}catch(Je){U.console&&console.log(Je&&Je.stack||Je)}}function lt(pe,Oe,ze){var qe=ze||!1,Je=Oe||null,rt=document.createElement("div");rt.innerHTML="<pre>"+pe+"</pre>",rt=rt.firstChild,qe&&we(rt,qe,!0);var tt={langExtension:Je,numberLines:qe,sourceNode:rt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ke(tt),rt.innerHTML}function ot(pe,Oe){var ze=Oe||document.body,qe=ze.ownerDocument||document;function Je(de){return ze.getElementsByTagName(de)}for(var rt=[Je("pre"),Je("code"),Je("xmp")],tt=[],Tt=0;Tt<rt.length;++Tt)for(var bt=0,Et=rt[Tt].length;bt<Et;++bt)tt.push(rt[Tt][bt]);rt=null;var yt=Date;yt.now||(yt={now:function(){return+new Date}});var Ot=0,At=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ae=/\bprettyprint\b/,xe=/\bprettyprinted\b/,Be=/pre|xmp/i,Ze=/^code$/i,Pe=/^(?:pre|code|xmp)$/i,Xe={};function be(){for(var de=U.PR_SHOULD_USE_CONTINUATION?yt.now()+250:Infinity;Ot<tt.length&&yt.now()<de;Ot++){for(var he=tt[Ot],re=Xe,ie=he;ie=ie.previousSibling;){var le=ie.nodeType,me=(le===7||le===8)&&ie.nodeValue;if(me?!/^\??prettify\b/.test(me):le!==3||/\S/.test(ie.nodeValue))break;if(me){re={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function(He,je,pt){re[je]=pt});break}}var De=he.className;if((re!==Xe||Ae.test(De))&&!xe.test(De)){for(var Te=!1,Qe=he.parentNode;Qe;Qe=Qe.parentNode){var ct=Qe.tagName;if(Pe.test(ct)&&Qe.className&&Ae.test(Qe.className)){Te=!0;break}}if(!Te){he.className+=" prettyprinted";var xt=re.lang;if(!xt){xt=De.match(At);var ft;!xt&&(ft=ae(he))&&Ze.test(ft.tagName)&&(xt=ft.className.match(At)),xt&&(xt=xt[1])}var ut;if(Be.test(he.tagName))ut=1;else{var $e=he.currentStyle,Ve=qe.defaultView,Ne=$e?$e.whiteSpace:Ve&&Ve.getComputedStyle?Ve.getComputedStyle(he,null).getPropertyValue("white-space"):0;ut=Ne&&Ne.substring(0,3)==="pre"}var oe=re.linenums;(oe=oe==="true"||+oe)||(oe=De.match(/\blinenums\b(?::(\d+))?/),oe=oe?oe[1]&&oe[1].length?+oe[1]:!0:!1),oe&&we(he,oe,ut);var ve={langExtension:xt,sourceNode:he,numberLines:oe,pre:ut,sourceCode:null,basePos:null,spans:null,decorations:null};ke(ve)}}}Ot<tt.length?U.setTimeout(be,250):typeof pe=="function"&&pe()}be()}var st=U.PR={createSimpleLexer:fe,registerLangHandler:ge,sourceDecorator:_e,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:j,PR_COMMENT:O,PR_DECLARATION:T,PR_KEYWORD:R,PR_LITERAL:m,PR_NOCODE:K,PR_PLAIN:u,PR_PUNCTUATION:s,PR_SOURCE:w,PR_STRING:y,PR_TAG:_,PR_TYPE:g,prettyPrintOne:M?U.prettyPrintOne=lt:A=lt,prettyPrint:F=M?U.prettyPrint=ot:F=ot},ce=U.define;typeof ce=="function"&&ce.amd&&ce("google-code-prettify",[],function(){return st})})()},T8No:function(Ye,se,k){"use strict";k.d(se,"a",function(){return W}),k.d(se,"b",function(){return C}),k.d(se,"d",function(){return p}),k.d(se,"c",function(){return h}),k.d(se,"e",function(){return f});var Q=k("N0LK"),H=k("Cg/j"),M=function(){var n=function(r,o){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,x){l.__proto__=x}||function(l,x){for(var E in x)x.hasOwnProperty(E)&&(l[E]=x[E])},n(r,o)};return function(r,o){n(r,o);function l(){this.constructor=r}r.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}}(),W=function(){function n(){}return n.has=function(r){return A.create(r)},n.equals=function(r,o){return F.create(r,o)},n.regex=function(r,o){return L.create(r,o)},n.not=function(r){return S.create(r)},n.and=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return v.create(r)},n.or=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return C.create(r)},n.deserialize=function(r,o){return o===void 0&&(o=!1),r?this._deserializeOrExpression(r,o):void 0},n._deserializeOrExpression=function(r,o){var l=this,x=r.split("||");return C.create(x.map(function(E){return l._deserializeAndExpression(E,o)}))},n._deserializeAndExpression=function(r,o){var l=this,x=r.split("&&");return v.create(x.map(function(E){return l._deserializeOne(E,o)}))},n._deserializeOne=function(r,o){if(r=r.trim(),r.indexOf("!=")>=0){var l=r.split("!=");return U.create(l[0].trim(),this._deserializeValue(l[1],o))}if(r.indexOf("==")>=0){var l=r.split("==");return F.create(l[0].trim(),this._deserializeValue(l[1],o))}if(r.indexOf("=~")>=0){var l=r.split("=~");return L.create(l[0].trim(),this._deserializeRegexValue(l[1],o))}return/^\!\s*/.test(r)?S.create(r.substr(1).trim()):A.create(r)},n._deserializeValue=function(r,o){if(r=r.trim(),r==="true")return!0;if(r==="false")return!1;var l=/^'([^']*)'$/.exec(r);return l?l[1].trim():r},n._deserializeRegexValue=function(r,o){if(Object(Q.x)(r)){if(o)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var l=r.indexOf("/"),x=r.lastIndexOf("/");if(l===x||l<0){if(o)throw new Error("bad regexp-value '"+r+"', missing /-enclosure");return console.warn("bad regexp-value '"+r+"', missing /-enclosure"),null}var E=r.slice(l+1,x),y=r[x+1]==="i"?"i":"";try{return new RegExp(E,y)}catch(R){if(o)throw new Error("bad regexp-value '"+r+"', parse error: "+R);return console.warn("bad regexp-value '"+r+"', parse error: "+R),null}},n}();function N(n,r){var o=n.getType(),l=r.getType();if(o!==l)return o-l;switch(o){case 1:return n.cmp(r);case 2:return n.cmp(r);case 3:return n.cmp(r);case 4:return n.cmp(r);case 6:return n.cmp(r);case 7:return n.cmp(r);case 5:return n.cmp(r);default:throw new Error("Unknown ContextKeyExpr!")}}var A=function(){function n(r){this.key=r}return n.create=function(r){return new n(r)},n.prototype.getType=function(){return 1},n.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:0},n.prototype.equals=function(r){return r instanceof n?this.key===r.key:!1},n.prototype.evaluate=function(r){return!!r.getValue(this.key)},n.prototype.keys=function(){return[this.key]},n.prototype.negate=function(){return S.create(this.key)},n}(),F=function(){function n(r,o){this.key=r,this.value=o}return n.create=function(r,o){return typeof o=="boolean"?o?A.create(r):S.create(r):new n(r,o)},n.prototype.getType=function(){return 3},n.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:this.value<r.value?-1:this.value>r.value?1:0},n.prototype.equals=function(r){return r instanceof n?this.key===r.key&&this.value===r.value:!1},n.prototype.evaluate=function(r){return r.getValue(this.key)==this.value},n.prototype.keys=function(){return[this.key]},n.prototype.negate=function(){return U.create(this.key,this.value)},n}(),U=function(){function n(r,o){this.key=r,this.value=o}return n.create=function(r,o){return typeof o=="boolean"?o?S.create(r):A.create(r):new n(r,o)},n.prototype.getType=function(){return 4},n.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:this.value<r.value?-1:this.value>r.value?1:0},n.prototype.equals=function(r){return r instanceof n?this.key===r.key&&this.value===r.value:!1},n.prototype.evaluate=function(r){return r.getValue(this.key)!=this.value},n.prototype.keys=function(){return[this.key]},n.prototype.negate=function(){return F.create(this.key,this.value)},n}(),S=function(){function n(r){this.key=r}return n.create=function(r){return new n(r)},n.prototype.getType=function(){return 2},n.prototype.cmp=function(r){return this.key<r.key?-1:this.key>r.key?1:0},n.prototype.equals=function(r){return r instanceof n?this.key===r.key:!1},n.prototype.evaluate=function(r){return!r.getValue(this.key)},n.prototype.keys=function(){return[this.key]},n.prototype.negate=function(){return A.create(this.key)},n}(),L=function(){function n(r,o){this.key=r,this.regexp=o}return n.create=function(r,o){return new n(r,o)},n.prototype.getType=function(){return 6},n.prototype.cmp=function(r){if(this.key<r.key)return-1;if(this.key>r.key)return 1;var o=this.regexp?this.regexp.source:"",l=r.regexp?r.regexp.source:"";return o<l?-1:o>l?1:0},n.prototype.equals=function(r){if(r instanceof n){var o=this.regexp?this.regexp.source:"",l=r.regexp?r.regexp.source:"";return this.key===r.key&&o===l}return!1},n.prototype.evaluate=function(r){var o=r.getValue(this.key);return this.regexp?this.regexp.test(o):!1},n.prototype.keys=function(){return[this.key]},n.prototype.negate=function(){return d.create(this)},n}(),d=function(){function n(r){this._actual=r}return n.create=function(r){return new n(r)},n.prototype.getType=function(){return 7},n.prototype.cmp=function(r){return this._actual.cmp(r._actual)},n.prototype.equals=function(r){return r instanceof n?this._actual.equals(r._actual):!1},n.prototype.evaluate=function(r){return!this._actual.evaluate(r)},n.prototype.keys=function(){return this._actual.keys()},n.prototype.negate=function(){return this._actual},n}(),v=function(){function n(r){this.expr=r}return n.create=function(r){var o=n._normalizeArr(r);return o.length===0?void 0:o.length===1?o[0]:new n(o)},n.prototype.getType=function(){return 5},n.prototype.cmp=function(r){if(this.expr.length<r.expr.length)return-1;if(this.expr.length>r.expr.length)return 1;for(var o=0,l=this.expr.length;o<l;o++){var x=N(this.expr[o],r.expr[o]);if(x!==0)return x}return 0},n.prototype.equals=function(r){if(r instanceof n){if(this.expr.length!==r.expr.length)return!1;for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].equals(r.expr[o]))return!1;return!0}return!1},n.prototype.evaluate=function(r){for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].evaluate(r))return!1;return!0},n._normalizeArr=function(r){var o=[];if(r){for(var l=0,x=r.length;l<x;l++){var E=r[l];if(!E)continue;if(E instanceof n){o=o.concat(E.expr);continue}if(E instanceof C)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(N)}return o},n.prototype.keys=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var x=l[o];r.push.apply(r,x.keys())}return r},n.prototype.negate=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var x=l[o];r.push(x.negate())}return C.create(r)},n}(),C=function(){function n(r){this.expr=r}return n.create=function(r){var o=n._normalizeArr(r);return o.length===0?void 0:o.length===1?o[0]:new n(o)},n.prototype.getType=function(){return 8},n.prototype.equals=function(r){if(r instanceof n){if(this.expr.length!==r.expr.length)return!1;for(var o=0,l=this.expr.length;o<l;o++)if(!this.expr[o].equals(r.expr[o]))return!1;return!0}return!1},n.prototype.evaluate=function(r){for(var o=0,l=this.expr.length;o<l;o++)if(this.expr[o].evaluate(r))return!0;return!1},n._normalizeArr=function(r){var o=[];if(r){for(var l=0,x=r.length;l<x;l++){var E=r[l];if(!E)continue;if(E instanceof n){o=o.concat(E.expr);continue}o.push(E)}o.sort(N)}return o},n.prototype.keys=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var x=l[o];r.push.apply(r,x.keys())}return r},n.prototype.negate=function(){for(var r=[],o=0,l=this.expr;o<l.length;o++){var x=l[o];r.push(x.negate())}for(var E=function(w){return w instanceof n?w.expr:[w]};r.length>1;){for(var y=r.shift(),R=r.shift(),O=[],g=0,m=E(y);g<m.length;g++)for(var s=m[g],u=0,_=E(R);u<_.length;u++){var T=_[u];O.push(W.and(s,T))}r.unshift(W.or.apply(W,O))}return r[0]},n}(),p=function(n){M(r,n);function r(o,l){var x=n.call(this,o)||this;return x._defaultValue=l,x}return r.prototype.bindTo=function(o){return o.createKey(this.key,this._defaultValue)},r.prototype.getValue=function(o){return o.getContextKeyValue(this.key)},r.prototype.toNegated=function(){return W.not(this.key)},r}(A),h=Object(H.c)("contextKeyService"),f="setContext"},U7T7:function(Ye,se,k){},"VrN/":function(Ye,se,k){(function(Q,H){Ye.exports=H()})(this,function(){"use strict";var Q=navigator.userAgent,H=navigator.platform,M=/gecko\/\d/i.test(Q),W=/MSIE \d/.test(Q),N=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Q),A=/Edge\/(\d+)/.exec(Q),F=W||N||A,U=F&&(W?document.documentMode||6:+(A||N)[1]),S=!A&&/WebKit\//.test(Q),L=S&&/Qt\/\d+\.\d+/.test(Q),d=!A&&/Chrome\//.test(Q),v=/Opera\//.test(Q),C=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Q),h=/PhantomJS/.test(Q),f=!A&&/AppleWebKit/.test(Q)&&/Mobile\/\w+/.test(Q),n=/Android/.test(Q),r=f||n||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Q),o=f||/Mac/.test(H),l=/\bCrOS\b/.test(Q),x=/win/i.test(H),E=v&&Q.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(v=!1,S=!0);var y=o&&(L||v&&(E==null||E<12.11)),R=M||F&&U>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var a=e.className,i=O(t).exec(a);if(i){var c=a.slice(i.index+i[0].length);e.className=a.slice(0,i.index)+(c?i[1]+c:"")}};function m(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return m(e).appendChild(t)}function u(e,t,a,i){var c=document.createElement(e);if(a&&(c.className=a),i&&(c.style.cssText=i),typeof t=="string")c.appendChild(document.createTextNode(t));else if(t)for(var I=0;I<t.length;++I)c.appendChild(t[I]);return c}function _(e,t,a,i){var c=u(e,t,a,i);return c.setAttribute("role","presentation"),c}var T;document.createRange?T=function(e,t,a,i){var c=document.createRange();return c.setEnd(i||e,a),c.setStart(e,t),c}:T=function(e,t,a){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(c){return i}return i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",t),i};function w(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 P(){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 j(e,t){var a=e.className;O(t).test(a)||(e.className+=(a?" ":"")+t)}function K(e,t){for(var a=e.split(" "),i=0;i<a.length;i++)a[i]&&!O(a[i]).test(t)&&(t+=" "+a[i]);return t}var Z=function(e){e.select()};f?Z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:F&&(Z=function(e){try{e.select()}catch(t){}});function G(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,a){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(a!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function $(e,t,a,i,c){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var I=i||0,Y=c||0;;){var q=e.indexOf(" ",I);if(q<0||q>=t)return Y+(t-I);Y+=q-I,Y+=a-Y%a,I=q+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function ae(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}var fe=50,_e={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},we={origin:"*mouse"},Me={origin:"+move"};function Le(e,t,a){for(var i=0,c=0;;){var I=e.indexOf(" ",i);I==-1&&(I=e.length);var Y=I-i;if(I==e.length||c+Y>=t)return i+Math.min(Y,t-c);if(c+=I-i,c+=a-c%a,i=I+1,c>=t)return i}}var ge=[""];function ue(e){for(;ge.length<=e;)ge.push(ke(ge)+" ");return ge[e]}function ke(e){return e[e.length-1]}function lt(e,t){for(var a=[],i=0;i<e.length;i++)a[i]=t(e[i],i);return a}function ot(e,t,a){for(var i=0,c=a(t);i<e.length&&a(e[i])<=c;)i++;e.splice(i,0,t)}function st(){}function ce(e,t){var a;return Object.create?a=Object.create(e):(st.prototype=e,a=new st),t&&B(t,a),a}var pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Oe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||pe.test(e))}function ze(e,t){return t?t.source.indexOf("\\w")>-1&&Oe(e)?!0:t.test(e):Oe(e)}function qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Je=/[\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 rt(e){return e.charCodeAt(0)>=768&&Je.test(e)}function tt(e,t,a){for(;(a<0?t>0:t<e.length)&&rt(e.charAt(t));)t+=a;return t}function Tt(e,t,a){for(var i=t>a?-1:1;;){if(t==a)return t;var c=(t+a)/2,I=i<0?Math.ceil(c):Math.floor(c);if(I==t)return e(I)?t:a;e(I)?a=I:t=I+i}}function bt(e,t,a,i){if(!e)return i(t,a,"ltr",0);for(var c=!1,I=0;I<e.length;++I){var Y=e[I];(Y.from<a&&Y.to>t||t==a&&Y.to==t)&&(i(Math.max(Y.from,t),Math.min(Y.to,a),Y.level==1?"rtl":"ltr",I),c=!0)}c||i(t,a,"ltr")}var Et=null;function yt(e,t,a){var i;Et=null;for(var c=0;c<e.length;++c){var I=e[c];if(I.from<t&&I.to>t)return c;I.to==t&&(I.from!=I.to&&a=="before"?i=c:Et=c),I.from==t&&(I.from!=I.to&&a!="before"?i=c:Et=c)}return i!=null?i:Et}var Ot=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,c=/[stwN]/,I=/[LRr]/,Y=/[Lb1n]/,q=/[1n]/;function ee(te,ye,Ce){this.level=te,this.from=ye,this.to=Ce}return function(te,ye){var Ce=ye=="ltr"?"L":"R";if(te.length==0||ye=="ltr"&&!i.test(te))return!1;for(var Fe=te.length,Ie=[],it=0;it<Fe;++it)Ie.push(a(te.charCodeAt(it)));for(var ht=0,St=Ce;ht<Fe;++ht){var Mt=Ie[ht];Mt=="m"?Ie[ht]=St:St=Mt}for(var Ft=0,Pt=Ce;Ft<Fe;++Ft){var Ht=Ie[Ft];Ht=="1"&&Pt=="r"?Ie[Ft]="n":I.test(Ht)&&(Pt=Ht,Ht=="r"&&(Ie[Ft]="R"))}for(var Qt=1,Gt=Ie[0];Qt<Fe-1;++Qt){var cn=Ie[Qt];cn=="+"&&Gt=="1"&&Ie[Qt+1]=="1"?Ie[Qt]="1":cn==","&&Gt==Ie[Qt+1]&&(Gt=="1"||Gt=="n")&&(Ie[Qt]=Gt),Gt=cn}for(var Ln=0;Ln<Fe;++Ln){var Qn=Ie[Ln];if(Qn==",")Ie[Ln]="N";else if(Qn=="%"){var Nn=void 0;for(Nn=Ln+1;Nn<Fe&&Ie[Nn]=="%";++Nn);for(var Er=Ln&&Ie[Ln-1]=="!"||Nn<Fe&&Ie[Nn]=="1"?"1":"N",cr=Ln;cr<Nn;++cr)Ie[cr]=Er;Ln=Nn-1}}for(var Gn=0,hr=Ce;Gn<Fe;++Gn){var er=Ie[Gn];hr=="L"&&er=="1"?Ie[Gn]="L":I.test(er)&&(hr=er)}for(var Yn=0;Yn<Fe;++Yn)if(c.test(Ie[Yn])){var Vn=void 0;for(Vn=Yn+1;Vn<Fe&&c.test(Ie[Vn]);++Vn);for(var Fn=(Yn?Ie[Yn-1]:Ce)=="L",fr=(Vn<Fe?Ie[Vn]:Ce)=="L",xi=Fn==fr?Fn?"L":"R":Ce,$r=Yn;$r<Vn;++$r)Ie[$r]=xi;Yn=Vn-1}for(var ir=[],Ir,qn=0;qn<Fe;)if(Y.test(Ie[qn])){var qa=qn;for(++qn;qn<Fe&&Y.test(Ie[qn]);++qn);ir.push(new ee(0,qa,qn))}else{var Fr=qn,ii=ir.length,ai=ye=="rtl"?1:0;for(++qn;qn<Fe&&Ie[qn]!="L";++qn);for(var sr=Fr;sr<qn;)if(q.test(Ie[sr])){Fr<sr&&(ir.splice(ii,0,new ee(1,Fr,sr)),ii+=ai);var Ci=sr;for(++sr;sr<qn&&q.test(Ie[sr]);++sr);ir.splice(ii,0,new ee(2,Ci,sr)),ii+=ai,Fr=sr}else++sr;Fr<qn&&ir.splice(ii,0,new ee(1,Fr,qn))}return ye=="ltr"&&(ir[0].level==1&&(Ir=te.match(/^\s+/))&&(ir[0].from=Ir[0].length,ir.unshift(new ee(0,0,Ir[0].length))),ke(ir).level==1&&(Ir=te.match(/\s+$/))&&(ke(ir).to-=Ir[0].length,ir.push(new ee(0,Fe-Ir[0].length,Fe)))),ye=="rtl"?ir.reverse():ir}}();function At(e,t){var a=e.order;return a==null&&(a=e.order=Ot(e.text,t)),a}var Ae=[],xe=function(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else if(e.attachEvent)e.attachEvent("on"+t,a);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||Ae).concat(a)}};function Be(e,t){return e._handlers&&e._handlers[t]||Ae}function Ze(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else if(e.detachEvent)e.detachEvent("on"+t,a);else{var i=e._handlers,c=i&&i[t];if(c){var I=ae(c,a);I>-1&&(i[t]=c.slice(0,I).concat(c.slice(I+1)))}}}function Pe(e,t){var a=Be(e,t);if(!a.length)return;for(var i=Array.prototype.slice.call(arguments,2),c=0;c<a.length;++c)a[c].apply(null,i)}function Xe(e,t,a){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pe(e,a||t.type,e,t),le(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)ae(a,t[i])==-1&&a.push(t[i])}function de(e,t){return Be(e,t).length>0}function he(e){e.prototype.on=function(t,a){xe(this,t,a)},e.prototype.off=function(t,a){Ze(this,t,a)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function le(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function me(e){re(e),ie(e)}function De(e){return e.target||e.srcElement}function Te(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 Qe=function(){if(F&&U<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),ct;function xt(e){if(ct==null){var t=u("span","\u200B");s(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ct=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&U<8))}var a=ct?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var ft;function ut(e){if(ft!=null)return ft;var t=s(e,document.createTextNode("A\u062EA")),a=T(t,0,1).getBoundingClientRect(),i=T(t,1,2).getBoundingClientRect();return m(e),!a||a.left==a.right?!1:ft=i.right-a.right<3}var $e=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],i=e.length;t<=i;){var c=e.indexOf(`
|
|
`,t);c==-1&&(c=e.length);var I=e.slice(t,e.charAt(c-1)=="\r"?c-1:c),Y=I.indexOf("\r");Y!=-1?(a.push(I.slice(0,Y)),t+=Y+1):(a.push(I),t=c+1)}return a}:function(e){return e.split(/\r\n?|\n/)},Ve=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(a){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ne=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),oe=null;function ve(e){if(oe!=null)return oe;var t=s(e,u("span","x")),a=t.getBoundingClientRect(),i=T(t,0,1).getBoundingClientRect();return oe=Math.abs(a.left-i.left)>1}var He={},je={};function pt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),He[e]=t}function gt(e,t){je[e]=t}function Re(e){if(typeof e=="string"&&je.hasOwnProperty(e))e=je[e];else if(e&&typeof e.name=="string"&&je.hasOwnProperty(e.name)){var t=je[e.name];typeof t=="string"&&(t={name:t}),e=ce(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Re("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Re("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ge(e,t){t=Re(t);var a=He[t.name];if(!a)return Ge(e,"text/plain");var i=a(e,t);if(Ue.hasOwnProperty(t.name)){var c=Ue[t.name];for(var I in c){if(!c.hasOwnProperty(I))continue;i.hasOwnProperty(I)&&(i["_"+I]=i[I]),i[I]=c[I]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var Y in t.modeProps)i[Y]=t.modeProps[Y];return i}var Ue={};function mt(e,t){var a=Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={};B(t,a)}function wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var i in t){var c=t[i];c instanceof Array&&(c=c.concat([])),a[i]=c}return a}function qt(e,t){for(var a;e.innerMode&&!(a=e.innerMode(t),!a||a.mode==e);)t=a.state,e=a.mode;return a||{mode:e,state:t}}function en(e,t,a){return e.startState?e.startState(t,a):!0}var Vt=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.prototype.eat=function(e){var t=this.string.charAt(this.pos),a;if(typeof e=="string"?a=t==e:a=t&&(e.test?e.test(t):e(t)),a)return++this.pos,t},Vt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Vt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Vt.prototype.backUp=function(e){this.pos-=e},Vt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=$(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return $(this.string,null,this.tabSize)-(this.lineStart?$(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(e,t,a){if(typeof e=="string"){var i=function(Y){return a?Y.toLowerCase():Y},c=this.string.substr(this.pos,e.length);if(i(c)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var I=this.string.slice(this.pos).match(e);return I&&I.index>0?null:(I&&t!==!1&&(this.pos+=I[0].length),I)}},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Vt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Vt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Dt(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 a=e;!a.lines;)for(var i=0;;++i){var c=a.children[i],I=c.chunkSize();if(t<I){a=c;break}t-=I}return a.lines[t]}function Ke(e,t,a){var i=[],c=t.line;return e.iter(t.line,a.line+1,function(I){var Y=I.text;c==a.line&&(Y=Y.slice(0,a.ch)),c==t.line&&(Y=Y.slice(t.ch)),i.push(Y),++c}),i}function Ct(e,t,a){var i=[];return e.iter(t,a,function(c){i.push(c.text)}),i}function Bt(e,t){var a=t-e.height;if(a)for(var i=e;i;i=i.parent)i.height+=a}function It(e){if(e.parent==null)return null;for(var t=e.parent,a=ae(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var c=0;!(i.children[c]==t);++c)a+=i.children[c].chunkSize();return a+t.first}function Zt(e,t){var a=e.first;e:do{for(var i=0;i<e.children.length;++i){var c=e.children[i],I=c.height;if(t<I){e=c;continue e}t-=I,a+=c.chunkSize()}return a}while(!e.lines);for(var Y=0;Y<e.lines.length;++Y){var q=e.lines[Y],ee=q.height;if(t<ee)break;t-=ee}return a+Y}function nn(e,t){return t>=e.first&&t<e.first+e.size}function an(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function We(e,t,a){if(a===void 0&&(a=null),!(this instanceof We))return new We(e,t,a);this.line=e,this.ch=t,this.sticky=a}function nt(e,t){return e.line-t.line||e.ch-t.ch}function Kt(e,t){return e.sticky==t.sticky&&nt(e,t)==0}function kt(e){return We(e.line,e.ch)}function Ut(e,t){return nt(e,t)<0?t:e}function _t(e,t){return nt(e,t)<0?e:t}function z(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 We(e.first,0);var a=e.first+e.size-1;return t.line>a?We(a,Dt(e,a).text.length):D(t,Dt(e,t.line).text.length)}function D(e,t){var a=e.ch;return a==null||a>t?We(e.line,t):a<0?We(e.line,0):e}function V(e,t){for(var a=[],i=0;i<t.length;i++)a[i]=b(e,t[i]);return a}var J=function(e,t){this.state=e,this.lookAhead=t},X=function(e,t,a,i){this.state=t,this.doc=e,this.line=a,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};X.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},X.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}},X.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},X.fromSaved=function(e,t,a){return t instanceof J?new X(e,wt(e.mode,t.state),a,t.lookAhead):new X(e,wt(e.mode,t),a)},X.prototype.save=function(e){var t=e!==!1?wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new J(t,this.maxLookAhead):t};function Ee(e,t,a,i){var c=[e.state.modeGen],I={};hn(e,t.text,e.doc.mode,a,function(te,ye){return c.push(te,ye)},I,i);for(var Y=a.state,q=function(te){a.baseTokens=c;var ye=e.state.overlays[te],Ce=1,Fe=0;a.state=!0,hn(e,t.text,ye.mode,a,function(Ie,it){for(var ht=Ce;Fe<Ie;){var St=c[Ce];St>Ie&&c.splice(Ce,1,Ie,c[Ce+1],St),Ce+=2,Fe=Math.min(Ie,St)}if(!it)return;if(ye.opaque)c.splice(ht,Ce-ht,Ie,"overlay "+it),Ce=ht+2;else for(;ht<Ce;ht+=2){var Mt=c[ht+1];c[ht+1]=(Mt?Mt+" ":"")+"overlay "+it}},I),a.state=Y,a.baseTokens=null,a.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)q(ee);return{styles:c,classes:I.bgClass||I.textClass?I:null}}function et(e,t,a){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=vt(e,It(t)),c=t.text.length>e.options.maxHighlightLength&&wt(e.doc.mode,i.state),I=Ee(e,t,i);c&&(i.state=c),t.stateAfter=i.save(!c),t.styles=I.styles,I.classes?t.styleClasses=I.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vt(e,t,a){var i=e.doc,c=e.display;if(!i.mode.startState)return new X(i,!0,t);var I=tn(e,t,a),Y=I>i.first&&Dt(i,I-1).stateAfter,q=Y?X.fromSaved(i,Y,I):new X(i,en(i.mode),I);return i.iter(I,t,function(ee){Rt(e,ee.text,q);var te=q.line;ee.stateAfter=te==t-1||te%5==0||te>=c.viewFrom&&te<c.viewTo?q.save():null,q.nextLine()}),a&&(i.modeFrontier=q.line),q}function Rt(e,t,a,i){var c=e.doc.mode,I=new Vt(t,e.options.tabSize,a);for(I.start=I.pos=i||0,t==""&&at(c,a.state);!I.eol();)zt(c,I,a.state),I.start=I.pos}function at(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var a=qt(e,t);if(a.mode.blankLine)return a.mode.blankLine(a.state)}function zt(e,t,a,i){for(var c=0;c<10;c++){i&&(i[0]=qt(e,a).mode);var I=e.token(t,a);if(t.pos>t.start)return I}throw new Error("Mode "+e.name+" failed to advance stream.")}var Wt=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function yn(e,t,a,i){var c=e.doc,I=c.mode,Y;t=b(c,t);var q=Dt(c,t.line),ee=vt(e,t.line,a),te=new Vt(q.text,e.options.tabSize,ee),ye;for(i&&(ye=[]);(i||te.pos<t.ch)&&!te.eol();)te.start=te.pos,Y=zt(I,te,ee.state),i&&ye.push(new Wt(te,Y,wt(c.mode,ee.state)));return i?ye:new Wt(te,Y,ee.state)}function Un(e,t){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var i=a[1]?"bgClass":"textClass";t[i]==null?t[i]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+a[2])}return e}function hn(e,t,a,i,c,I,Y){var q=a.flattenSpans;q==null&&(q=e.options.flattenSpans);var ee=0,te=null,ye=new Vt(t,e.options.tabSize,i),Ce,Fe=e.options.addModeClass&&[null];for(t==""&&Un(at(a,i.state),I);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(q=!1,Y&&Rt(e,t,i,ye.pos),ye.pos=t.length,Ce=null):Ce=Un(zt(a,ye,i.state,Fe),I),Fe){var Ie=Fe[0].name;Ie&&(Ce="m-"+(Ce?Ie+" "+Ce:Ie))}if(!q||te!=Ce){for(;ee<ye.start;)ee=Math.min(ye.start,ee+5e3),c(ee,te);te=Ce}ye.start=ye.pos}for(;ee<ye.pos;){var it=Math.min(ye.pos,ee+5e3);c(it,te),ee=it}}function tn(e,t,a){for(var i,c,I=e.doc,Y=a?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>Y;--q){if(q<=I.first)return I.first;var ee=Dt(I,q-1),te=ee.stateAfter;if(te&&(!a||q+(te instanceof J?te.lookAhead:0)<=I.modeFrontier))return q;var ye=$(ee.text,null,e.options.tabSize);(c==null||i>ye)&&(c=q-1,i=ye)}return c}function An(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var a=e.first,i=t-1;i>a;i--){var c=Dt(e,i).stateAfter;if(c&&(!(c instanceof J)||i+c.lookAhead<t)){a=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}var Mn=!1,pn=!1;function Cn(){Mn=!0}function bn(){pn=!0}function $n(e,t,a){this.marker=e,this.from=t,this.to=a}function jn(e,t){if(e)for(var a=0;a<e.length;++a){var i=e[a];if(i.marker==t)return i}}function pr(e,t){for(var a,i=0;i<e.length;++i)e[i]!=t&&(a||(a=[])).push(e[i]);return a}function Sn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function wr(e,t,a){var i;if(e)for(var c=0;c<e.length;++c){var I=e[c],Y=I.marker,q=I.from==null||(Y.inclusiveLeft?I.from<=t:I.from<t);if(q||I.from==t&&Y.type=="bookmark"&&(!a||!I.marker.insertLeft)){var ee=I.to==null||(Y.inclusiveRight?I.to>=t:I.to>t);(i||(i=[])).push(new $n(Y,I.from,ee?null:I.to))}}return i}function xn(e,t,a){var i;if(e)for(var c=0;c<e.length;++c){var I=e[c],Y=I.marker,q=I.to==null||(Y.inclusiveRight?I.to>=t:I.to>t);if(q||I.from==t&&Y.type=="bookmark"&&(!a||I.marker.insertLeft)){var ee=I.from==null||(Y.inclusiveLeft?I.from<=t:I.from<t);(i||(i=[])).push(new $n(Y,ee?null:I.from-t,I.to==null?null:I.to-t))}}return i}function tr(e,t){if(t.full)return null;var a=nn(e,t.from.line)&&Dt(e,t.from.line).markedSpans,i=nn(e,t.to.line)&&Dt(e,t.to.line).markedSpans;if(!a&&!i)return null;var c=t.from.ch,I=t.to.ch,Y=nt(t.from,t.to)==0,q=wr(a,c,Y),ee=xn(i,I,Y),te=t.text.length==1,ye=ke(t.text).length+(te?c:0);if(q)for(var Ce=0;Ce<q.length;++Ce){var Fe=q[Ce];if(Fe.to==null){var Ie=jn(ee,Fe.marker);Ie?te&&(Fe.to=Ie.to==null?null:Ie.to+ye):Fe.to=c}}if(ee)for(var it=0;it<ee.length;++it){var ht=ee[it];if(ht.to!=null&&(ht.to+=ye),ht.from==null){var St=jn(q,ht.marker);St||(ht.from=ye,te&&(q||(q=[])).push(ht))}else ht.from+=ye,te&&(q||(q=[])).push(ht)}q&&(q=nr(q)),ee&&ee!=q&&(ee=nr(ee));var Mt=[q];if(!te){var Ft=t.text.length-2,Pt;if(Ft>0&&q)for(var Ht=0;Ht<q.length;++Ht)q[Ht].to==null&&(Pt||(Pt=[])).push(new $n(q[Ht].marker,null,null));for(var Qt=0;Qt<Ft;++Qt)Mt.push(Pt);Mt.push(ee)}return Mt}function nr(e){for(var t=0;t<e.length;++t){var a=e[t];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function mr(e,t,a){var i=null;if(e.iter(t.line,a.line+1,function(Ie){if(Ie.markedSpans)for(var it=0;it<Ie.markedSpans.length;++it){var ht=Ie.markedSpans[it].marker;ht.readOnly&&(!i||ae(i,ht)==-1)&&(i||(i=[])).push(ht)}}),!i)return null;for(var c=[{from:t,to:a}],I=0;I<i.length;++I)for(var Y=i[I],q=Y.find(0),ee=0;ee<c.length;++ee){var te=c[ee];if(nt(te.to,q.from)<0||nt(te.from,q.to)>0)continue;var ye=[ee,1],Ce=nt(te.from,q.from),Fe=nt(te.to,q.to);(Ce<0||!Y.inclusiveLeft&&!Ce)&&ye.push({from:te.from,to:q.from}),(Fe>0||!Y.inclusiveRight&&!Fe)&&ye.push({from:q.to,to:te.to}),c.splice.apply(c,ye),ee+=ye.length-3}return c}function Ar(e){var t=e.markedSpans;if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}function ar(e,t){if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.attachLine(e);e.markedSpans=t}function vn(e){return e.inclusiveLeft?-1:0}function on(e){return e.inclusiveRight?1:0}function Dn(e,t){var a=e.lines.length-t.lines.length;if(a!=0)return a;var i=e.find(),c=t.find(),I=nt(i.from,c.from)||vn(e)-vn(t);if(I)return-I;var Y=nt(i.to,c.to)||on(e)-on(t);return Y||t.id-e.id}function mn(e,t){var a=pn&&e.markedSpans,i;if(a)for(var c=void 0,I=0;I<a.length;++I)c=a[I],c.marker.collapsed&&(t?c.from:c.to)==null&&(!i||Dn(i,c.marker)<0)&&(i=c.marker);return i}function On(e){return mn(e,!0)}function ln(e){return mn(e,!1)}function gr(e,t){var a=pn&&e.markedSpans,i;if(a)for(var c=0;c<a.length;++c){var I=a[c];I.marker.collapsed&&(I.from==null||I.from<t)&&(I.to==null||I.to>t)&&(!i||Dn(i,I.marker)<0)&&(i=I.marker)}return i}function Pn(e,t,a,i,c){var I=Dt(e,t),Y=pn&&I.markedSpans;if(Y)for(var q=0;q<Y.length;++q){var ee=Y[q];if(!ee.marker.collapsed)continue;var te=ee.marker.find(0),ye=nt(te.from,a)||vn(ee.marker)-vn(c),Ce=nt(te.to,i)||on(ee.marker)-on(c);if(ye>=0&&Ce<=0||ye<=0&&Ce>=0)continue;if(ye<=0&&(ee.marker.inclusiveRight&&c.inclusiveLeft?nt(te.to,a)>=0:nt(te.to,a)>0)||ye>=0&&(ee.marker.inclusiveRight&&c.inclusiveLeft?nt(te.from,i)<=0:nt(te.from,i)<0))return!0}}function Hn(e){for(var t;t=On(e);)e=t.find(-1,!0).line;return e}function Or(e){for(var t;t=ln(e);)e=t.find(1,!0).line;return e}function xr(e){for(var t,a;t=ln(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function vr(e,t){var a=Dt(e,t),i=Hn(a);return a==i?t:It(i)}function Nr(e,t){if(t>e.lastLine())return t;var a=Dt(e,t),i;if(!Xn(e,a))return t;for(;i=ln(a);)a=i.find(1,!0).line;return It(a)+1}function Xn(e,t){var a=pn&&t.markedSpans;if(a)for(var i=void 0,c=0;c<a.length;++c){if(i=a[c],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&Lr(e,t,i))return!0}}function Lr(e,t,a){if(a.to==null){var i=a.marker.find(1,!0);return Lr(e,i.line,jn(i.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==t.text.length)return!0;for(var c=void 0,I=0;I<t.markedSpans.length;++I)if(c=t.markedSpans[I],c.marker.collapsed&&!c.marker.widgetNode&&c.from==a.to&&(c.to==null||c.to!=a.from)&&(c.marker.inclusiveLeft||a.marker.inclusiveRight)&&Lr(e,t,c))return!0}function lr(e){e=Hn(e);for(var t=0,a=e.parent,i=0;i<a.lines.length;++i){var c=a.lines[i];if(c==e)break;t+=c.height}for(var I=a.parent;I;a=I,I=a.parent)for(var Y=0;Y<I.children.length;++Y){var q=I.children[Y];if(q==a)break;t+=q.height}return t}function Cr(e){if(e.height==0)return 0;for(var t=e.text.length,a,i=e;a=On(i);){var c=a.find(0,!0);i=c.from.line,t+=c.from.ch-c.to.ch}for(i=e;a=ln(i);){var I=a.find(0,!0);t-=i.text.length-I.from.ch,i=I.to.line,t+=i.text.length-I.to.ch}return t}function Mr(e){var t=e.display,a=e.doc;t.maxLine=Dt(a,a.first),t.maxLineLength=Cr(t.maxLine),t.maxLineChanged=!0,a.iter(function(i){var c=Cr(i);c>t.maxLineLength&&(t.maxLineLength=c,t.maxLine=i)})}var un=function(e,t,a){this.text=e,ar(this,t),this.height=a?a(this):1};un.prototype.lineNo=function(){return It(this)},he(un);function rn(e,t,a,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ar(e),ar(e,a);var c=i?i(e):1;c!=e.height&&Bt(e,c)}function Rn(e){e.parent=null,Ar(e)}var dt={},jt={};function Nt(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?jt:dt;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var a=_("span",null,null,S?"padding-right: .1px":null),i={pre:_("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var c=0;c<=(t.rest?t.rest.length:0);c++){var I=c?t.rest[c-1]:t.line,Y=void 0;i.pos=0,i.addToken=fn,ut(e.display.measure)&&(Y=At(I,e.doc.direction))&&(i.addToken=Tn(i.addToken,Y)),i.map=[];var q=t!=e.display.externalMeasured&&It(I);$t(I,i,et(e,I,q)),I.styleClasses&&(I.styleClasses.bgClass&&(i.bgClass=K(I.styleClasses.bgClass,i.bgClass||"")),I.styleClasses.textClass&&(i.textClass=K(I.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(xt(e.display.measure))),c==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(S){var ee=i.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=K(i.pre.className,i.textClass||"")),i}function Yt(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function fn(e,t,a,i,c,I,Y){if(!t)return;var q=e.splitSpaces?Lt(t,e.trailingSpace):t,ee=e.cm.state.specialChars,te=!1,ye;if(!ee.test(t))e.col+=t.length,ye=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,ye),F&&U<9&&(te=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var Ce=0;;){ee.lastIndex=Ce;var Fe=ee.exec(t),Ie=Fe?Fe.index-Ce:t.length-Ce;if(Ie){var it=document.createTextNode(q.slice(Ce,Ce+Ie));F&&U<9?ye.appendChild(u("span",[it])):ye.appendChild(it),e.map.push(e.pos,e.pos+Ie,it),e.col+=Ie,e.pos+=Ie}if(!Fe)break;Ce+=Ie+1;var ht=void 0;if(Fe[0]==" "){var St=e.cm.options.tabSize,Mt=St-e.col%St;ht=ye.appendChild(u("span",ue(Mt),"cm-tab")),ht.setAttribute("role","presentation"),ht.setAttribute("cm-text"," "),e.col+=Mt}else Fe[0]=="\r"||Fe[0]==`
|
|
`?(ht=ye.appendChild(u("span",Fe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ht.setAttribute("cm-text",Fe[0]),e.col+=1):(ht=e.cm.options.specialCharPlaceholder(Fe[0]),ht.setAttribute("cm-text",Fe[0]),F&&U<9?ye.appendChild(u("span",[ht])):ye.appendChild(ht),e.col+=1);e.map.push(e.pos,e.pos+1,ht),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,a||i||c||te||I||Y){var Ft=a||"";i&&(Ft+=i),c&&(Ft+=c);var Pt=u("span",[ye],Ft,I);if(Y)for(var Ht in Y)Y.hasOwnProperty(Ht)&&Ht!="style"&&Ht!="class"&&Pt.setAttribute(Ht,Y[Ht]);return e.content.appendChild(Pt)}e.content.appendChild(ye)}function Lt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,i="",c=0;c<e.length;c++){var I=e.charAt(c);I==" "&&a&&(c==e.length-1||e.charCodeAt(c+1)==32)&&(I="\xA0"),i+=I,a=I==" "}return i}function Tn(e,t){return function(a,i,c,I,Y,q,ee){c=c?c+" cm-force-border":"cm-force-border";for(var te=a.pos,ye=te+i.length;;){for(var Ce=void 0,Fe=0;Fe<t.length&&!(Ce=t[Fe],Ce.to>te&&Ce.from<=te);Fe++);if(Ce.to>=ye)return e(a,i,c,I,Y,q,ee);e(a,i.slice(0,Ce.to-te),c,I,null,q,ee),I=null,i=i.slice(Ce.to-te),te=Ce.to}}}function kn(e,t,a,i){var c=!i&&a.widgetNode;c&&e.map.push(e.pos,e.pos+t,c),!i&&e.cm.display.input.needsContentAttribute&&(c||(c=e.content.appendChild(document.createElement("span"))),c.setAttribute("cm-marker",a.id)),c&&(e.cm.display.input.setUneditable(c),e.content.appendChild(c)),e.pos+=t,e.trailingSpace=!1}function $t(e,t,a){var i=e.markedSpans,c=e.text,I=0;if(!i){for(var Y=1;Y<a.length;Y+=2)t.addToken(t,c.slice(I,I=a[Y]),Nt(a[Y+1],t.cm.options));return}for(var q=c.length,ee=0,te=1,ye="",Ce,Fe,Ie=0,it,ht,St,Mt,Ft;;){if(Ie==ee){it=ht=St=Fe="",Ft=null,Mt=null,Ie=Infinity;for(var Pt=[],Ht=void 0,Qt=0;Qt<i.length;++Qt){var Gt=i[Qt],cn=Gt.marker;if(cn.type=="bookmark"&&Gt.from==ee&&cn.widgetNode)Pt.push(cn);else if(Gt.from<=ee&&(Gt.to==null||Gt.to>ee||cn.collapsed&&Gt.to==ee&&Gt.from==ee)){if(Gt.to!=null&&Gt.to!=ee&&Ie>Gt.to&&(Ie=Gt.to,ht=""),cn.className&&(it+=" "+cn.className),cn.css&&(Fe=(Fe?Fe+";":"")+cn.css),cn.startStyle&&Gt.from==ee&&(St+=" "+cn.startStyle),cn.endStyle&&Gt.to==Ie&&(Ht||(Ht=[])).push(cn.endStyle,Gt.to),cn.title&&((Ft||(Ft={})).title=cn.title),cn.attributes)for(var Ln in cn.attributes)(Ft||(Ft={}))[Ln]=cn.attributes[Ln];cn.collapsed&&(!Mt||Dn(Mt.marker,cn)<0)&&(Mt=Gt)}else Gt.from>ee&&Ie>Gt.from&&(Ie=Gt.from)}if(Ht)for(var Qn=0;Qn<Ht.length;Qn+=2)Ht[Qn+1]==Ie&&(ht+=" "+Ht[Qn]);if(!Mt||Mt.from==ee)for(var Nn=0;Nn<Pt.length;++Nn)kn(t,0,Pt[Nn]);if(Mt&&(Mt.from||0)==ee){if(kn(t,(Mt.to==null?q+1:Mt.to)-ee,Mt.marker,Mt.from==null),Mt.to==null)return;Mt.to==ee&&(Mt=!1)}}if(ee>=q)break;for(var Er=Math.min(q,Ie);;){if(ye){var cr=ee+ye.length;if(!Mt){var Gn=cr>Er?ye.slice(0,Er-ee):ye;t.addToken(t,Gn,Ce?Ce+it:it,St,ee+Gn.length==Ie?ht:"",Fe,Ft)}if(cr>=Er){ye=ye.slice(Er-ee),ee=Er;break}ee=cr,St=""}ye=c.slice(I,I=a[te++]),Ce=Nt(a[te++],t.cm.options)}}}function Bn(e,t,a){this.line=t,this.rest=xr(t),this.size=this.rest?It(ke(this.rest))-a+1:1,this.node=this.text=null,this.hidden=Xn(e,t)}function sn(e,t,a){for(var i=[],c,I=t;I<a;I=c){var Y=new Bn(e.doc,Dt(e.doc,I),I);c=I+Y.size,i.push(Y)}return i}var dn=null;function Kn(e){dn?dn.ops.push(e):e.ownsGroup=dn={ops:[e],delayedCallbacks:[]}}function zn(e){var t=e.delayedCallbacks,a=0;do{for(;a<t.length;a++)t[a].call(null);for(var i=0;i<e.ops.length;i++){var c=e.ops[i];if(c.cursorActivityHandlers)for(;c.cursorActivityCalled<c.cursorActivityHandlers.length;)c.cursorActivityHandlers[c.cursorActivityCalled++].call(null,c.cm)}}while(a<t.length)}function gn(e,t){var a=e.ownsGroup;if(!a)return;try{zn(a)}finally{dn=null,t(a)}}var Jt=null;function En(e,t){var a=Be(e,t);if(!a.length)return;var i=Array.prototype.slice.call(arguments,2),c;dn?c=dn.delayedCallbacks:Jt?c=Jt:(c=Jt=[],setTimeout(yr,0));for(var I=function(q){c.push(function(){return a[q].apply(null,i)})},Y=0;Y<a.length;++Y)I(Y)}function yr(){var e=Jt;Jt=null;for(var t=0;t<e.length;++t)e[t]()}function Br(e,t,a,i){for(var c=0;c<t.changes.length;c++){var I=t.changes[c];I=="text"?ga(e,t):I=="gutter"?to(e,t,a,i):I=="class"?va(e,t):I=="widget"&&Is(e,t,i)}t.changes=null}function Wr(e){return e.node==e.text&&(e.node=u("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),F&&U<8&&(e.node.style.zIndex=2)),e.node}function Si(e,t){var a=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),t.background)a?t.background.className=a:(t.background.parentNode.removeChild(t.background),t.background=null);else if(a){var i=Wr(t);t.background=i.insertBefore(u("div",null,a),i.firstChild),e.display.input.setUneditable(t.background)}}function Xi(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):Xt(e,t)}function ga(e,t){var a=t.text.className,i=Xi(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,va(e,t)):a&&(t.text.className=a)}function va(e,t){Si(e,t),t.line.wrapClass?Wr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function to(e,t,a,i){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 c=Wr(t);t.gutterBackground=u("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)}var I=t.line.gutterMarkers;if(e.options.lineNumbers||I){var Y=Wr(t),q=t.gutter=u("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),Y.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!I||!I["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(u("div",an(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),I)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var te=e.display.gutterSpecs[ee].className,ye=I.hasOwnProperty(te)&&I[te];ye&&q.appendChild(u("div",[ye],"CodeMirror-gutter-elt","left: "+i.gutterLeft[te]+"px; width: "+i.gutterWidth[te]+"px"))}}}function Is(e,t,a){t.alignable&&(t.alignable=null);for(var i=O("CodeMirror-linewidget"),c=t.node.firstChild,I=void 0;c;c=I)I=c.nextSibling,i.test(c.className)&&t.node.removeChild(c);no(e,t,a)}function Ns(e,t,a,i){var c=Xi(e,t);return t.text=t.node=c.pre,c.bgClass&&(t.bgClass=c.bgClass),c.textClass&&(t.textClass=c.textClass),va(e,t),to(e,t,a,i),no(e,t,i),t.node}function no(e,t,a){if(ro(e,t.line,t,a,!0),t.rest)for(var i=0;i<t.rest.length;i++)ro(e,t.rest[i],t,a,!1)}function ro(e,t,a,i,c){if(!t.widgets)return;for(var I=Wr(a),Y=0,q=t.widgets;Y<q.length;++Y){var ee=q[Y],te=u("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||te.setAttribute("cm-ignore-events","true"),Us(ee,te,a,i),e.display.input.setUneditable(te),c&&ee.above?I.insertBefore(te,a.gutter||a.text):I.appendChild(te),En(ee,"redraw")}}function Us(e,t,a,i){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(t);var c=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(c-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=c+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Ti(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),s(t.display.measure,u("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function Ur(e,t){for(var a=De(t);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=e.mover)return!0}function Yi(e){return e.lineSpace.offsetTop}function ya(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function io(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=s(e.measure,u("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function Pr(e){return fe-e.display.nativeBarWidth}function Jr(e){return e.display.scroller.clientWidth-Pr(e)-e.display.barWidth}function ba(e){return e.display.scroller.clientHeight-Pr(e)-e.display.barHeight}function js(e,t,a){var i=e.options.lineWrapping,c=i&&Jr(e);if(!t.measure.heights||i&&t.measure.width!=c){var I=t.measure.heights=[];if(i){t.measure.width=c;for(var Y=t.text.firstChild.getClientRects(),q=0;q<Y.length-1;q++){var ee=Y[q],te=Y[q+1];Math.abs(ee.bottom-te.bottom)>2&&I.push((ee.bottom+te.top)/2-a.top)}}I.push(a.bottom-a.top)}}function ao(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var c=0;c<e.rest.length;c++)if(It(e.rest[c])>a)return{map:e.measure.maps[c],cache:e.measure.caches[c],before:!0}}function Fs(e,t){t=Hn(t);var a=It(t),i=e.display.externalMeasured=new Bn(e.doc,t,a);i.lineN=a;var c=i.built=Xt(e,i);return i.text=c.pre,s(e.display.lineMeasure,c.pre),i}function oo(e,t,a,i){return kr(e,oi(e,t),a,i)}function Ea(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[qr(e,t)];var a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size)return a}function oi(e,t){var a=It(t),i=Ea(e,a);i&&!i.text?i=null:i&&i.changes&&(Br(e,i,a,Aa(e)),e.curOp.forceUpdate=!0),i||(i=Fs(e,t));var c=ao(i,t,a);return{line:t,view:i,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function kr(e,t,a,i,c){t.before&&(a=-1);var I=a+(i||""),Y;return t.cache.hasOwnProperty(I)?Y=t.cache[I]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(js(e,t.view,t.rect),t.hasHeights=!0),Y=Ws(e,t,a,i),Y.bogus||(t.cache[I]=Y)),{left:Y.left,right:Y.right,top:c?Y.rtop:Y.top,bottom:c?Y.rbottom:Y.bottom}}var so={left:0,right:0,top:0,bottom:0};function lo(e,t,a){for(var i,c,I,Y,q,ee,te=0;te<e.length;te+=3)if(q=e[te],ee=e[te+1],t<q?(c=0,I=1,Y="left"):t<ee?(c=t-q,I=c+1):(te==e.length-3||t==ee&&e[te+3]>t)&&(I=ee-q,c=I-1,t>=ee&&(Y="right")),c!=null){if(i=e[te+2],q==ee&&a==(i.insertLeft?"left":"right")&&(Y=a),a=="left"&&c==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)i=e[(te-=3)+2],Y="left";if(a=="right"&&c==ee-q)for(;te<e.length-3&&e[te+3]==e[te+4]&&!e[te+5].insertLeft;)i=e[(te+=3)+2],Y="right";break}return{node:i,start:c,end:I,collapse:Y,coverStart:q,coverEnd:ee}}function Bs(e,t){var a=so;if(t=="left")for(var i=0;i<e.length&&!((a=e[i]).left!=a.right);i++);else for(var c=e.length-1;c>=0&&!((a=e[c]).left!=a.right);c--);return a}function Ws(e,t,a,i){var c=lo(t.map,a,i),I=c.node,Y=c.start,q=c.end,ee=c.collapse,te;if(I.nodeType==3){for(var ye=0;ye<4;ye++){for(;Y&&rt(t.line.text.charAt(c.coverStart+Y));)--Y;for(;c.coverStart+q<c.coverEnd&&rt(t.line.text.charAt(c.coverStart+q));)++q;if(F&&U<9&&Y==0&&q==c.coverEnd-c.coverStart?te=I.parentNode.getBoundingClientRect():te=Bs(T(I,Y,q).getClientRects(),i),te.left||te.right||Y==0)break;q=Y,Y=Y-1,ee="right"}F&&U<11&&(te=Hs(e.display.measure,te))}else{Y>0&&(ee=i="right");var Ce;e.options.lineWrapping&&(Ce=I.getClientRects()).length>1?te=Ce[i=="right"?Ce.length-1:0]:te=I.getBoundingClientRect()}if(F&&U<9&&!Y&&(!te||!te.left&&!te.right)){var Fe=I.parentNode.getClientRects()[0];Fe?te={left:Fe.left,right:Fe.left+li(e.display),top:Fe.top,bottom:Fe.bottom}:te=so}for(var Ie=te.top-t.rect.top,it=te.bottom-t.rect.top,ht=(Ie+it)/2,St=t.view.measure.heights,Mt=0;Mt<St.length-1&&!(ht<St[Mt]);Mt++);var Ft=Mt?St[Mt-1]:0,Pt=St[Mt],Ht={left:(ee=="right"?te.right:te.left)-t.rect.left,right:(ee=="left"?te.left:te.right)-t.rect.left,top:Ft,bottom:Pt};return!te.left&&!te.right&&(Ht.bogus=!0),e.options.singleCursorHeightPerLine||(Ht.rtop=Ie,Ht.rbottom=it),Ht}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ve(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*i,bottom:t.bottom*i}}function uo(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 co(e){e.display.externalMeasure=null,m(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)uo(e.display.view[t])}function wi(e){co(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ho(){return d&&n?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fo(){return d&&n?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function xa(e){var t=0;if(e.widgets)for(var a=0;a<e.widgets.length;++a)e.widgets[a].above&&(t+=Ti(e.widgets[a]));return t}function $i(e,t,a,i,c){if(!c){var I=xa(t);a.top+=I,a.bottom+=I}if(i=="line")return a;i||(i="local");var Y=lr(t);if(i=="local"?Y+=Yi(e.display):Y-=e.display.viewOffset,i=="page"||i=="window"){var q=e.display.lineSpace.getBoundingClientRect();Y+=q.top+(i=="window"?0:fo());var ee=q.left+(i=="window"?0:ho());a.left+=ee,a.right+=ee}return a.top+=Y,a.bottom+=Y,a}function po(e,t,a){if(a=="div")return t;var i=t.left,c=t.top;if(a=="page")i-=ho(),c-=fo();else if(a=="local"||!a){var I=e.display.sizer.getBoundingClientRect();i+=I.left,c+=I.top}var Y=e.display.lineSpace.getBoundingClientRect();return{left:i-Y.left,top:c-Y.top}}function Ca(e,t,a,i,c){return i||(i=Dt(e.doc,t.line)),$i(e,i,oo(e,i,t.ch,c),a)}function _r(e,t,a,i,c,I){i=i||Dt(e.doc,t.line),c||(c=oi(e,i));function Y(it,ht){var St=kr(e,c,it,ht?"right":"left",I);return ht?St.left=St.right:St.right=St.left,$i(e,i,St,a)}var q=At(i,e.doc.direction),ee=t.ch,te=t.sticky;if(ee>=i.text.length?(ee=i.text.length,te="before"):ee<=0&&(ee=0,te="after"),!q)return Y(te=="before"?ee-1:ee,te=="before");function ye(it,ht,St){var Mt=q[ht],Ft=Mt.level==1;return Y(St?it-1:it,Ft!=St)}var Ce=yt(q,ee,te),Fe=Et,Ie=ye(ee,Ce,te=="before");return Fe!=null&&(Ie.other=ye(ee,Fe,te!="before")),Ie}function mo(e,t){var a=0;t=b(e.doc,t),e.options.lineWrapping||(a=li(e.display)*t.ch);var i=Dt(e.doc,t.line),c=lr(i)+Yi(e.display);return{left:a,right:a,top:c,bottom:c+i.height}}function Sa(e,t,a,i,c){var I=We(e,t,a);return I.xRel=c,i&&(I.outside=i),I}function Ta(e,t,a){var i=e.doc;if(a+=e.display.viewOffset,a<0)return Sa(i.first,0,null,-1,-1);var c=Zt(i,a),I=i.first+i.size-1;if(c>I)return Sa(i.first+i.size-1,Dt(i,I).text.length,null,1,1);t<0&&(t=0);for(var Y=Dt(i,c);;){var q=Ks(e,Y,c,t,a),ee=gr(Y,q.ch+(q.xRel>0||q.outside>0?1:0));if(!ee)return q;var te=ee.find(1);if(te.line==c)return te;Y=Dt(i,c=te.line)}}function go(e,t,a,i){i-=xa(t);var c=t.text.length,I=Tt(function(Y){return kr(e,a,Y-1).bottom<=i},c,0);return c=Tt(function(Y){return kr(e,a,Y).top>i},I,c),{begin:I,end:c}}function vo(e,t,a,i){a||(a=oi(e,t));var c=$i(e,t,kr(e,a,i),"line").top;return go(e,t,a,c)}function wa(e,t,a,i){return e.bottom<=a?!1:e.top>a?!0:(i?e.left:e.right)>t}function Ks(e,t,a,i,c){c-=lr(t);var I=oi(e,t),Y=xa(t),q=0,ee=t.text.length,te=!0,ye=At(t,e.doc.direction);if(ye){var Ce=(e.options.lineWrapping?Gs:zs)(e,t,a,I,ye,i,c);te=Ce.level!=1,q=te?Ce.from:Ce.to-1,ee=te?Ce.to:Ce.from-1}var Fe=null,Ie=null,it=Tt(function(Qt){var Gt=kr(e,I,Qt);return Gt.top+=Y,Gt.bottom+=Y,wa(Gt,i,c,!1)?(Gt.top<=c&&Gt.left<=i&&(Fe=Qt,Ie=Gt),!0):!1},q,ee),ht,St,Mt=!1;if(Ie){var Ft=i-Ie.left<Ie.right-i,Pt=Ft==te;it=Fe+(Pt?0:1),St=Pt?"after":"before",ht=Ft?Ie.left:Ie.right}else{!te&&(it==ee||it==q)&&it++,St=it==0?"after":it==t.text.length?"before":kr(e,I,it-(te?1:0)).bottom+Y<=c==te?"after":"before";var Ht=_r(e,We(a,it,St),"line",t,I);ht=Ht.left,Mt=c<Ht.top?-1:c>=Ht.bottom?1:0}return it=tt(t.text,it,1),Sa(a,it,St,Mt,i-ht)}function zs(e,t,a,i,c,I,Y){var q=Tt(function(Ce){var Fe=c[Ce],Ie=Fe.level!=1;return wa(_r(e,We(a,Ie?Fe.to:Fe.from,Ie?"before":"after"),"line",t,i),I,Y,!0)},0,c.length-1),ee=c[q];if(q>0){var te=ee.level!=1,ye=_r(e,We(a,te?ee.from:ee.to,te?"after":"before"),"line",t,i);wa(ye,I,Y,!0)&&ye.top>Y&&(ee=c[q-1])}return ee}function Gs(e,t,a,i,c,I,Y){var q=go(e,t,i,Y),ee=q.begin,te=q.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var ye=null,Ce=null,Fe=0;Fe<c.length;Fe++){var Ie=c[Fe];if(Ie.from>=te||Ie.to<=ee)continue;var it=Ie.level!=1,ht=kr(e,i,it?Math.min(te,Ie.to)-1:Math.max(ee,Ie.from)).right,St=ht<I?I-ht+1e9:ht-I;(!ye||Ce>St)&&(ye=Ie,Ce=St)}return ye||(ye=c[c.length-1]),ye.from<ee&&(ye={from:ee,to:ye.to,level:ye.level}),ye.to>te&&(ye={from:ye.from,to:te,level:ye.level}),ye}var Zr;function si(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Zr==null){Zr=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Zr.appendChild(document.createTextNode("x")),Zr.appendChild(u("br"));Zr.appendChild(document.createTextNode("x"))}s(e.measure,Zr);var a=Zr.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),m(e.measure),a||1}function li(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),a=u("pre",[t],"CodeMirror-line-like");s(e.measure,a);var i=t.getBoundingClientRect(),c=(i.right-i.left)/10;return c>2&&(e.cachedCharWidth=c),c||10}function Aa(e){for(var t=e.display,a={},i={},c=t.gutters.clientLeft,I=t.gutters.firstChild,Y=0;I;I=I.nextSibling,++Y){var q=e.display.gutterSpecs[Y].className;a[q]=I.offsetLeft+I.clientLeft+c,i[q]=I.clientWidth}return{fixedPos:Oa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Oa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function yo(e){var t=si(e.display),a=e.options.lineWrapping,i=a&&Math.max(5,e.display.scroller.clientWidth/li(e.display)-3);return function(c){if(Xn(e.doc,c))return 0;var I=0;if(c.widgets)for(var Y=0;Y<c.widgets.length;Y++)c.widgets[Y].height&&(I+=c.widgets[Y].height);return a?I+(Math.ceil(c.text.length/i)||1)*t:I+t}}function _a(e){var t=e.doc,a=yo(e);t.iter(function(i){var c=a(i);c!=i.height&&Bt(i,c)})}function Qr(e,t,a,i){var c=e.display;if(!a&&De(t).getAttribute("cm-not-content")=="true")return null;var I,Y,q=c.lineSpace.getBoundingClientRect();try{I=t.clientX-q.left,Y=t.clientY-q.top}catch(Ce){return null}var ee=Ta(e,I,Y),te;if(i&&ee.xRel>0&&(te=Dt(e.doc,ee.line).text).length==ee.ch){var ye=$(te,te.length,e.options.tabSize)-te.length;ee=We(ee.line,Math.max(0,Math.round((I-io(e.display).left)/li(e.display))-ye))}return ee}function qr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var a=e.display.view,i=0;i<a.length;i++)if(t-=a[i].size,t<0)return i}function ur(e,t,a,i){t==null&&(t=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),i||(i=0);var c=e.display;if(i&&a<c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>t)&&(c.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=c.viewTo)pn&&vr(e.doc,t)<c.viewTo&&Kr(e);else if(a<=c.viewFrom)pn&&Nr(e.doc,a+i)>c.viewFrom?Kr(e):(c.viewFrom+=i,c.viewTo+=i);else if(t<=c.viewFrom&&a>=c.viewTo)Kr(e);else if(t<=c.viewFrom){var I=Ji(e,a,a+i,1);I?(c.view=c.view.slice(I.index),c.viewFrom=I.lineN,c.viewTo+=i):Kr(e)}else if(a>=c.viewTo){var Y=Ji(e,t,t,-1);Y?(c.view=c.view.slice(0,Y.index),c.viewTo=Y.lineN):Kr(e)}else{var q=Ji(e,t,t,-1),ee=Ji(e,a,a+i,1);q&&ee?(c.view=c.view.slice(0,q.index).concat(sn(e,q.lineN,ee.lineN)).concat(c.view.slice(ee.index)),c.viewTo+=i):Kr(e)}var te=c.externalMeasured;te&&(a<te.lineN?te.lineN+=i:t<te.lineN+te.size&&(c.externalMeasured=null))}function Hr(e,t,a){e.curOp.viewChanged=!0;var i=e.display,c=e.display.externalMeasured;if(c&&t>=c.lineN&&t<c.lineN+c.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var I=i.view[qr(e,t)];if(I.node==null)return;var Y=I.changes||(I.changes=[]);ae(Y,a)==-1&&Y.push(a)}function Kr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ji(e,t,a,i){var c=qr(e,t),I,Y=e.display.view;if(!pn||a==e.doc.first+e.doc.size)return{index:c,lineN:a};for(var q=e.display.viewFrom,ee=0;ee<c;ee++)q+=Y[ee].size;if(q!=t){if(i>0){if(c==Y.length-1)return null;I=q+Y[c].size-t,c++}else I=q-t;t+=I,a+=I}for(;vr(e.doc,a)!=a;){if(c==(i<0?0:Y.length-1))return null;a+=i*Y[c-(i<0?1:0)].size,c+=i}return{index:c,lineN:a}}function Vs(e,t,a){var i=e.display,c=i.view;c.length==0||t>=i.viewTo||a<=i.viewFrom?(i.view=sn(e,t,a),i.viewFrom=t):(i.viewFrom>t?i.view=sn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(qr(e,t))),i.viewFrom=t,i.viewTo<a?i.view=i.view.concat(sn(e,i.viewTo,a)):i.viewTo>a&&(i.view=i.view.slice(0,qr(e,a)))),i.viewTo=a}function bo(e){for(var t=e.display.view,a=0,i=0;i<t.length;i++){var c=t[i];!c.hidden&&(!c.node||c.changes)&&++a}return a}function Ai(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Eo(e,t){t===void 0&&(t=!0);for(var a=e.doc,i={},c=i.cursors=document.createDocumentFragment(),I=i.selection=document.createDocumentFragment(),Y=0;Y<a.sel.ranges.length;Y++){if(!t&&Y==a.sel.primIndex)continue;var q=a.sel.ranges[Y];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var ee=q.empty();(ee||e.options.showCursorWhenSelecting)&&xo(e,q.head,c),ee||Xs(e,q,I)}return i}function xo(e,t,a){var i=_r(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),c=a.appendChild(u("div","\xA0","CodeMirror-cursor"));if(c.style.left=i.left+"px",c.style.top=i.top+"px",c.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var I=a.appendChild(u("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));I.style.display="",I.style.left=i.other.left+"px",I.style.top=i.other.top+"px",I.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Zi(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,a){var i=e.display,c=e.doc,I=document.createDocumentFragment(),Y=io(e.display),q=Y.left,ee=Math.max(i.sizerWidth,Jr(e)-i.sizer.offsetLeft)-Y.right,te=c.direction=="ltr";function ye(Pt,Ht,Qt,Gt){Ht<0&&(Ht=0),Ht=Math.round(Ht),Gt=Math.round(Gt),I.appendChild(u("div",null,"CodeMirror-selected","position: absolute; left: "+Pt+`px;
|
|
top: `+Ht+"px; width: "+(Qt==null?ee-Pt:Qt)+`px;
|
|
height: `+(Gt-Ht)+"px"))}function Ce(Pt,Ht,Qt){var Gt=Dt(c,Pt),cn=Gt.text.length,Ln,Qn;function Nn(Gn,hr){return Ca(e,We(Pt,Gn),"div",Gt,hr)}function Er(Gn,hr,er){var Yn=vo(e,Gt,null,Gn),Vn=hr=="ltr"==(er=="after")?"left":"right",Fn=er=="after"?Yn.begin:Yn.end-(/\s/.test(Gt.text.charAt(Yn.end-1))?2:1);return Nn(Fn,Vn)[Vn]}var cr=At(Gt,c.direction);return bt(cr,Ht||0,Qt==null?cn:Qt,function(Gn,hr,er,Yn){var Vn=er=="ltr",Fn=Nn(Gn,Vn?"left":"right"),fr=Nn(hr-1,Vn?"right":"left"),xi=Ht==null&&Gn==0,$r=Qt==null&&hr==cn,ir=Yn==0,Ir=!cr||Yn==cr.length-1;if(fr.top-Fn.top<=3){var qn=(te?xi:$r)&&ir,qa=(te?$r:xi)&&Ir,Fr=qn?q:(Vn?Fn:fr).left,ii=qa?ee:(Vn?fr:Fn).right;ye(Fr,Fn.top,ii-Fr,Fn.bottom)}else{var ai,sr,Ci,eo;Vn?(ai=te&&xi&&ir?q:Fn.left,sr=te?ee:Er(Gn,er,"before"),Ci=te?q:Er(hr,er,"after"),eo=te&&$r&&Ir?ee:fr.right):(ai=te?Er(Gn,er,"before"):q,sr=!te&&xi&&ir?ee:Fn.right,Ci=!te&&$r&&Ir?q:fr.left,eo=te?Er(hr,er,"after"):ee),ye(ai,Fn.top,sr-ai,Fn.bottom),Fn.bottom<fr.top&&ye(q,Fn.bottom,null,fr.top),ye(Ci,fr.top,eo-Ci,fr.bottom)}(!Ln||Zi(Fn,Ln)<0)&&(Ln=Fn),Zi(fr,Ln)<0&&(Ln=fr),(!Qn||Zi(Fn,Qn)<0)&&(Qn=Fn),Zi(fr,Qn)<0&&(Qn=fr)}),{start:Ln,end:Qn}}var Fe=t.from(),Ie=t.to();if(Fe.line==Ie.line)Ce(Fe.line,Fe.ch,Ie.ch);else{var it=Dt(c,Fe.line),ht=Dt(c,Ie.line),St=Hn(it)==Hn(ht),Mt=Ce(Fe.line,Fe.ch,St?it.text.length+1:null).end,Ft=Ce(Ie.line,St?0:null,Ie.ch).start;St&&(Mt.top<Ft.top-2?(ye(Mt.right,Mt.top,null,Mt.bottom),ye(q,Ft.top,Ft.left,Ft.bottom)):ye(Mt.right,Mt.top,Ft.left-Mt.right,Mt.bottom)),Mt.bottom<Ft.top&&ye(q,Mt.bottom,null,Ft.top)}a.appendChild(I)}function Da(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var a=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ui(e),t.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Co(e){e.state.focused||(e.display.input.focus(),Ra(e))}function So(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ui(e))},100)}function Ra(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),S&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Da(e)}function ui(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Pe(e,"blur",e,t),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Qi(e){for(var t=e.display,a=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var c=t.view[i],I=e.options.lineWrapping,Y=void 0,q=0;if(c.hidden)continue;if(F&&U<8){var ee=c.node.offsetTop+c.node.offsetHeight;Y=ee-a,a=ee}else{var te=c.node.getBoundingClientRect();Y=te.bottom-te.top,!I&&c.text.firstChild&&(q=c.text.firstChild.getBoundingClientRect().right-te.left-1)}var ye=c.line.height-Y;if((ye>.005||ye<-.005)&&(Bt(c.line,Y),To(c.line),c.rest))for(var Ce=0;Ce<c.rest.length;Ce++)To(c.rest[Ce]);if(q>e.display.sizerWidth){var Fe=Math.ceil(q/li(e.display));Fe>e.display.maxLineLength&&(e.display.maxLineLength=Fe,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}function To(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],i=a.node.parentNode;i&&(a.height=i.offsetHeight)}}function qi(e,t,a){var i=a&&a.top!=null?Math.max(0,a.top):e.scroller.scrollTop;i=Math.floor(i-Yi(e));var c=a&&a.bottom!=null?a.bottom:i+e.wrapper.clientHeight,I=Zt(t,i),Y=Zt(t,c);if(a&&a.ensure){var q=a.ensure.from.line,ee=a.ensure.to.line;q<I?(I=q,Y=Zt(t,lr(Dt(t,q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=Y&&(I=Zt(t,lr(Dt(t,ee))-e.wrapper.clientHeight),Y=ee)}return{from:I,to:Math.max(Y,I+1)}}function Ys(e,t){if(Xe(e,"scrollCursorIntoView"))return;var a=e.display,i=a.sizer.getBoundingClientRect(),c=null;if(t.top+i.top<0?c=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),c!=null&&!h){var I=u("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-a.viewOffset-Yi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Pr(e)+a.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(I),I.scrollIntoView(c),e.display.lineSpace.removeChild(I)}}function $s(e,t,a,i){i==null&&(i=0);var c;!e.options.lineWrapping&&t==a&&(t=t.ch?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,a=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var I=0;I<5;I++){var Y=!1,q=_r(e,t),ee=!a||a==t?q:_r(e,a);c={left:Math.min(q.left,ee.left),top:Math.min(q.top,ee.top)-i,right:Math.max(q.left,ee.left),bottom:Math.max(q.bottom,ee.bottom)+i};var te=La(e,c),ye=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(te.scrollTop!=null&&(_i(e,te.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(Y=!0)),te.scrollLeft!=null&&(ei(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(Y=!0)),!Y)break}return c}function Js(e,t){var a=La(e,t);a.scrollTop!=null&&_i(e,a.scrollTop),a.scrollLeft!=null&&ei(e,a.scrollLeft)}function La(e,t){var a=e.display,i=si(e.display);t.top<0&&(t.top=0);var c=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,I=ba(e),Y={};t.bottom-t.top>I&&(t.bottom=t.top+I);var q=e.doc.height+ya(a),ee=t.top<i,te=t.bottom>q-i;if(t.top<c)Y.scrollTop=ee?0:t.top;else if(t.bottom>c+I){var ye=Math.min(t.top,(te?q:t.bottom)-I);ye!=c&&(Y.scrollTop=ye)}var Ce=e.options.fixedGutter?0:a.gutters.offsetWidth,Fe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-Ce,Ie=Jr(e)-a.gutters.offsetWidth,it=t.right-t.left>Ie;return it&&(t.right=t.left+Ie),t.left<10?Y.scrollLeft=0:t.left<Fe?Y.scrollLeft=Math.max(0,t.left+Ce-(it?0:10)):t.right>Ie+Fe-3&&(Y.scrollLeft=t.right+(it?0:10)-Ie),Y}function Ma(e,t){if(t==null)return;ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function di(e){ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Oi(e,t,a){(t!=null||a!=null)&&ea(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function Zs(e,t){ea(e),e.curOp.scrollToPos=t}function ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=mo(e,t.from),i=mo(e,t.to);wo(e,a,i,t.margin)}}function wo(e,t,a,i){var c=La(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-i,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+i});Oi(e,c.scrollLeft,c.scrollTop)}function _i(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||ka(e,{top:t}),Ao(e,t,!0),M&&ka(e),Li(e,100)}function Ao(e,t,a){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!a)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ei(e,t,a,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Lo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Di(e){var t=e.display,a=t.gutters.offsetWidth,i=Math.round(e.doc.height+ya(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?a:0,docHeight:i,scrollHeight:i+Pr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var ti=function(e,t,a){this.cm=a;var i=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),c=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=c.tabIndex=-1,e(i),e(c),xe(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),xe(c,"scroll",function(){c.clientWidth&&t(c.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ti.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var c=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+c)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var I=e.viewWidth-e.barLeft-(a?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+I)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?i:0,bottom:t?i:0}},ti.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ti.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ti.prototype.zeroWidthHack=function(){var e=o&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},ti.prototype.enableZeroWidthBar=function(e,t,a){e.style.pointerEvents="auto";function i(){var c=e.getBoundingClientRect(),I=a=="vert"?document.elementFromPoint(c.right-1,(c.top+c.bottom)/2):document.elementFromPoint((c.right+c.left)/2,c.bottom-1);I!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},ti.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ri=function(){};Ri.prototype.update=function(){return{bottom:0,right:0}},Ri.prototype.setScrollLeft=function(){},Ri.prototype.setScrollTop=function(){},Ri.prototype.clear=function(){};function ci(e,t){t||(t=Di(e));var a=e.display.barWidth,i=e.display.barHeight;Oo(e,t);for(var c=0;c<4&&a!=e.display.barWidth||i!=e.display.barHeight;c++)a!=e.display.barWidth&&e.options.lineWrapping&&Qi(e),Oo(e,Di(e)),a=e.display.barWidth,i=e.display.barHeight}function Oo(e,t){var a=e.display,i=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=i.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=i.bottom)+"px",a.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=i.bottom+"px",a.scrollbarFiller.style.width=i.right+"px"):a.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=i.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var _o={native:ti,null:Ri};function Do(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _o[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),xe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?ei(e,t):_i(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function ni(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},Kn(e.curOp)}function ri(e){var t=e.curOp;t&&gn(t,function(a){for(var i=0;i<a.ops.length;i++)a.ops[i].cm.curOp=null;qs(a)})}function qs(e){for(var t=e.ops,a=0;a<t.length;a++)el(t[a]);for(var i=0;i<t.length;i++)tl(t[i]);for(var c=0;c<t.length;c++)nl(t[c]);for(var I=0;I<t.length;I++)rl(t[I]);for(var Y=0;Y<t.length;Y++)il(t[Y])}function el(e){var t=e.cm,a=t.display;ol(t),e.updateMaxLine&&Mr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ta(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Pa(e.cm,e.update)}function nl(e){var t=e.cm,a=t.display;e.updatedDisplay&&Qi(t),e.barMeasure=Di(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oo(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+Pr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-Jr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.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 a=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ci(t,e.barMeasure),e.updatedDisplay&&Na(t,e.barMeasure),e.selectionChanged&&Da(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),a&&Co(e.cm)}function il(e){var t=e.cm,a=t.display,i=t.doc;if(e.updatedDisplay&&Ro(t,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Ao(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ei(t,e.scrollLeft,!0,!0),e.scrollToPos){var c=$s(t,b(i,e.scrollToPos.from),b(i,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,c)}var I=e.maybeHiddenMarkers,Y=e.maybeUnhiddenMarkers;if(I)for(var q=0;q<I.length;++q)I[q].lines.length||Pe(I[q],"hide");if(Y)for(var ee=0;ee<Y.length;++ee)Y[ee].lines.length&&Pe(Y[ee],"unhide");a.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function br(e,t){if(e.curOp)return t();ni(e);try{return t()}finally{ri(e)}}function Jn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ni(e);try{return t.apply(e,arguments)}finally{ri(e)}}}function or(e){return function(){if(this.curOp)return e.apply(this,arguments);ni(this);try{return e.apply(this,arguments)}finally{ri(this)}}}function Zn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ni(t);try{return e.apply(this,arguments)}finally{ri(t)}}}function Li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,G(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var a=+new Date+e.options.workTime,i=vt(e,t.highlightFrontier),c=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(I){if(i.line>=e.display.viewFrom){var Y=I.styles,q=I.text.length>e.options.maxHighlightLength?wt(t.mode,i.state):null,ee=Ee(e,I,i,!0);q&&(i.state=q),I.styles=ee.styles;var te=I.styleClasses,ye=ee.classes;ye?I.styleClasses=ye:te&&(I.styleClasses=null);for(var Ce=!Y||Y.length!=I.styles.length||te!=ye&&(!te||!ye||te.bgClass!=ye.bgClass||te.textClass!=ye.textClass),Fe=0;!Ce&&Fe<Y.length;++Fe)Ce=Y[Fe]!=I.styles[Fe];Ce&&c.push(i.line),I.stateAfter=i.save(),i.nextLine()}else I.text.length<=e.options.maxHighlightLength&&Rt(e,I.text,i),I.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>a)return Li(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),c.length&&br(e,function(){for(var I=0;I<c.length;I++)Hr(e,c[I],"text")})}var ta=function(e,t,a){var i=e.display;this.viewport=t,this.visible=qi(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Jr(e),this.force=a,this.dims=Aa(e),this.events=[]};ta.prototype.signal=function(e,t){de(e,t)&&this.events.push(arguments)},ta.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pe.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=Pr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Pr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=P();if(!t||!w(e.display.lineDiv,t))return null;var a={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&w(e.display.lineDiv,i.anchorNode)&&(a.anchorNode=i.anchorNode,a.anchorOffset=i.anchorOffset,a.focusNode=i.focusNode,a.focusOffset=i.focusOffset)}return a}function ll(e){if(!e||!e.activeElt||e.activeElt==P())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),a=document.createRange();a.setEnd(e.anchorNode,e.anchorOffset),a.collapse(!1),t.removeAllRanges(),t.addRange(a),t.extend(e.focusNode,e.focusOffset)}}function Pa(e,t){var a=e.display,i=e.doc;if(t.editorIsHidden)return Kr(e),!1;if(!t.force&&t.visible.from>=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&bo(e)==0)return!1;Mo(e)&&(Kr(e),t.dims=Aa(e));var c=i.first+i.size,I=Math.max(t.visible.from-e.options.viewportMargin,i.first),Y=Math.min(c,t.visible.to+e.options.viewportMargin);a.viewFrom<I&&I-a.viewFrom<20&&(I=Math.max(i.first,a.viewFrom)),a.viewTo>Y&&a.viewTo-Y<20&&(Y=Math.min(c,a.viewTo)),pn&&(I=vr(e.doc,I),Y=Nr(e.doc,Y));var q=I!=a.viewFrom||Y!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Vs(e,I,Y),a.viewOffset=lr(Dt(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var ee=bo(e);if(!q&&ee==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var te=sl(e);return ee>4&&(a.lineDiv.style.display="none"),ul(e,a.updateLineNumbers,t.dims),ee>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,ll(te),m(a.cursorDiv),m(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,q&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,Li(e,400)),a.updateLineNumbers=null,!0}function Ro(e,t){for(var a=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Jr(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+ya(e.display)-ba(e),a.top)}),t.visible=qi(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=qi(e.display,e.doc,a));if(!Pa(e,t))break;Qi(e);var c=Di(e);Ai(e),ci(e,c),Na(e,c),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 ka(e,t){var a=new ta(e,t);if(Pa(e,a)){Qi(e),Ro(e,a);var i=Di(e);Ai(e),ci(e,i),Na(e,i),a.finish()}}function ul(e,t,a){var i=e.display,c=e.options.lineNumbers,I=i.lineDiv,Y=I.firstChild;function q(it){var ht=it.nextSibling;return S&&o&&e.display.currentWheelTarget==it?it.style.display="none":it.parentNode.removeChild(it),ht}for(var ee=i.view,te=i.viewFrom,ye=0;ye<ee.length;ye++){var Ce=ee[ye];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=I){var Fe=Ns(e,Ce,te,a);I.insertBefore(Fe,Y)}else{for(;Y!=Ce.node;)Y=q(Y);var Ie=c&&t!=null&&t<=te&&Ce.lineNumber;Ce.changes&&(ae(Ce.changes,"gutter")>-1&&(Ie=!1),Br(e,Ce,te,a)),Ie&&(m(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(an(e.options,te)))),Y=Ce.node.nextSibling}te+=Ce.size}for(;Y;)Y=q(Y)}function Ia(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Na(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+Pr(e)+"px"}function Lo(e){var t=e.display,a=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=Oa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,c=t.gutters.offsetWidth,I=i+"px",Y=0;Y<a.length;Y++)if(!a[Y].hidden){e.options.fixedGutter&&(a[Y].gutter&&(a[Y].gutter.style.left=I),a[Y].gutterBackground&&(a[Y].gutterBackground.style.left=I));var q=a[Y].alignable;if(q)for(var ee=0;ee<q.length;ee++)q[ee].style.left=I}e.options.fixedGutter&&(t.gutters.style.left=i+c+"px")}function Mo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=an(e.options,t.first+t.size-1),i=e.display;if(a.length!=i.lineNumChars){var c=i.measure.appendChild(u("div",[u("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),I=c.firstChild.offsetWidth,Y=c.offsetWidth-I;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(I,i.lineGutter.offsetWidth-Y)+1,i.lineNumWidth=i.lineNumInnerWidth+Y,i.lineNumChars=i.lineNumInnerWidth?a.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ia(e.display),!0}return!1}function Ua(e,t){for(var a=[],i=!1,c=0;c<e.length;c++){var I=e[c],Y=null;if(typeof I!="string"&&(Y=I.style,I=I.className),I=="CodeMirror-linenumbers")if(t)i=!0;else continue;a.push({className:I,style:Y})}return t&&!i&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Po(e){var t=e.gutters,a=e.gutterSpecs;m(t),e.lineGutter=null;for(var i=0;i<a.length;++i){var c=a[i],I=c.className,Y=c.style,q=t.appendChild(u("div",null,"CodeMirror-gutter "+I));Y&&(q.style.cssText=Y),I=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=a.length?"":"none",Ia(e)}function Mi(e){Po(e.display),ur(e),Lo(e)}function dl(e,t,a,i){var c=this;this.input=a,c.scrollbarFiller=u("div",null,"CodeMirror-scrollbar-filler"),c.scrollbarFiller.setAttribute("cm-not-content","true"),c.gutterFiller=u("div",null,"CodeMirror-gutter-filler"),c.gutterFiller.setAttribute("cm-not-content","true"),c.lineDiv=_("div",null,"CodeMirror-code"),c.selectionDiv=u("div",null,null,"position: relative; z-index: 1"),c.cursorDiv=u("div",null,"CodeMirror-cursors"),c.measure=u("div",null,"CodeMirror-measure"),c.lineMeasure=u("div",null,"CodeMirror-measure"),c.lineSpace=_("div",[c.measure,c.lineMeasure,c.selectionDiv,c.cursorDiv,c.lineDiv],null,"position: relative; outline: none");var I=_("div",[c.lineSpace],"CodeMirror-lines");c.mover=u("div",[I],null,"position: relative"),c.sizer=u("div",[c.mover],"CodeMirror-sizer"),c.sizerWidth=null,c.heightForcer=u("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),c.gutters=u("div",null,"CodeMirror-gutters"),c.lineGutter=null,c.scroller=u("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll"),c.scroller.setAttribute("tabIndex","-1"),c.wrapper=u("div",[c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror"),F&&U<8&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),!S&&!(M&&r)&&(c.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(c.wrapper):e(c.wrapper)),c.viewFrom=c.viewTo=t.first,c.reportedViewFrom=c.reportedViewTo=t.first,c.view=[],c.renderedView=null,c.externalMeasured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.nativeBarWidth=c.barHeight=c.barWidth=0,c.scrollbarsClipped=!1,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.alignWidgets=!1,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null,c.activeTouch=null,c.gutterSpecs=Ua(i.gutters,i.lineNumbers),Po(c),a.init(c)}var na=0,Sr=null;F?Sr=-.53:M?Sr=15:d?Sr=-.7:C&&(Sr=-1/3);function ko(e){var t=e.wheelDeltaX,a=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:t,y:a}}function cl(e){var t=ko(e);return t.x*=Sr,t.y*=Sr,t}function Io(e,t){var a=ko(t),i=a.x,c=a.y,I=e.display,Y=I.scroller,q=Y.scrollWidth>Y.clientWidth,ee=Y.scrollHeight>Y.clientHeight;if(!(i&&q||c&&ee))return;if(c&&o&&S){e:for(var te=t.target,ye=I.view;te!=Y;te=te.parentNode)for(var Ce=0;Ce<ye.length;Ce++)if(ye[Ce].node==te){e.display.currentWheelTarget=te;break e}}if(i&&!M&&!v&&Sr!=null){c&&ee&&_i(e,Math.max(0,Y.scrollTop+c*Sr)),ei(e,Math.max(0,Y.scrollLeft+i*Sr)),(!c||c&&ee)&&re(t),I.wheelStartX=null;return}if(c&&Sr!=null){var Fe=c*Sr,Ie=e.doc.scrollTop,it=Ie+I.wrapper.clientHeight;Fe<0?Ie=Math.max(0,Ie+Fe-50):it=Math.min(e.doc.height,it+Fe+50),ka(e,{top:Ie,bottom:it})}na<20&&(I.wheelStartX==null?(I.wheelStartX=Y.scrollLeft,I.wheelStartY=Y.scrollTop,I.wheelDX=i,I.wheelDY=c,setTimeout(function(){if(I.wheelStartX==null)return;var ht=Y.scrollLeft-I.wheelStartX,St=Y.scrollTop-I.wheelStartY,Mt=St&&I.wheelDY&&St/I.wheelDY||ht&&I.wheelDX&&ht/I.wheelDX;if(I.wheelStartX=I.wheelStartY=null,!Mt)return;Sr=(Sr*na+Mt)/(na+1),++na},200)):(I.wheelDX+=i,I.wheelDY+=c))}var Tr=function(e,t){this.ranges=e,this.primIndex=t};Tr.prototype.primary=function(){return this.ranges[this.primIndex]},Tr.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 a=this.ranges[t],i=e.ranges[t];if(!Kt(a.anchor,i.anchor)||!Kt(a.head,i.head))return!1}return!0},Tr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(kt(this.ranges[t].anchor),kt(this.ranges[t].head));return new Tr(e,this.primIndex)},Tr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Tr.prototype.contains=function(e,t){t||(t=e);for(var a=0;a<this.ranges.length;a++){var i=this.ranges[a];if(nt(t,i.from())>=0&&nt(e,i.to())<=0)return a}return-1};var wn=function(e,t){this.anchor=e,this.head=t};wn.prototype.from=function(){return _t(this.anchor,this.head)},wn.prototype.to=function(){return Ut(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Dr(e,t,a){var i=e&&e.options.selectionsMayTouch,c=t[a];t.sort(function(Fe,Ie){return nt(Fe.from(),Ie.from())}),a=ae(t,c);for(var I=1;I<t.length;I++){var Y=t[I],q=t[I-1],ee=nt(q.to(),Y.from());if(i&&!Y.empty()?ee>0:ee>=0){var te=_t(q.from(),Y.from()),ye=Ut(q.to(),Y.to()),Ce=q.empty()?Y.from()==Y.head:q.from()==q.head;I<=a&&--a,t.splice(--I,2,new wn(Ce?ye:te,Ce?te:ye))}}return new Tr(t,a)}function zr(e,t){return new Tr([new wn(e,t||e)],0)}function Gr(e){return e.text?We(e.from.line+e.text.length-1,ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function No(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Gr(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Gr(t).ch-t.to.ch),We(a,i)}function ja(e,t){for(var a=[],i=0;i<e.sel.ranges.length;i++){var c=e.sel.ranges[i];a.push(new wn(No(c.anchor,t),No(c.head,t)))}return Dr(e.cm,a,e.sel.primIndex)}function Uo(e,t,a){return e.line==t.line?We(a.line,e.ch-t.ch+a.ch):We(a.line+(e.line-t.line),e.ch)}function hl(e,t,a){for(var i=[],c=We(e.first,0),I=c,Y=0;Y<t.length;Y++){var q=t[Y],ee=Uo(q.from,c,I),te=Uo(Gr(q),c,I);if(c=q.to,I=te,a=="around"){var ye=e.sel.ranges[Y],Ce=nt(ye.head,ye.anchor)<0;i[Y]=new wn(Ce?te:ee,Ce?ee:te)}else i[Y]=new wn(ee,ee)}return new Tr(i,e.sel.primIndex)}function Fa(e){e.doc.mode=Ge(e.options,e.doc.modeOption),Pi(e)}function Pi(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,Li(e,100),e.state.modeGen++,e.curOp&&ur(e)}function jo(e,t){return t.from.ch==0&&t.to.ch==0&&ke(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ba(e,t,a,i){function c(Ft){return a?a[Ft]:null}function I(Ft,Pt,Ht){rn(Ft,Pt,Ht,i),En(Ft,"change",Ft,t)}function Y(Ft,Pt){for(var Ht=[],Qt=Ft;Qt<Pt;++Qt)Ht.push(new un(te[Qt],c(Qt),i));return Ht}var q=t.from,ee=t.to,te=t.text,ye=Dt(e,q.line),Ce=Dt(e,ee.line),Fe=ke(te),Ie=c(te.length-1),it=ee.line-q.line;if(t.full)e.insert(0,Y(0,te.length)),e.remove(te.length,e.size-te.length);else if(jo(e,t)){var ht=Y(0,te.length-1);I(Ce,Ce.text,Ie),it&&e.remove(q.line,it),ht.length&&e.insert(q.line,ht)}else if(ye==Ce)if(te.length==1)I(ye,ye.text.slice(0,q.ch)+Fe+ye.text.slice(ee.ch),Ie);else{var St=Y(1,te.length-1);St.push(new un(Fe+ye.text.slice(ee.ch),Ie,i)),I(ye,ye.text.slice(0,q.ch)+te[0],c(0)),e.insert(q.line+1,St)}else if(te.length==1)I(ye,ye.text.slice(0,q.ch)+te[0]+Ce.text.slice(ee.ch),c(0)),e.remove(q.line+1,it);else{I(ye,ye.text.slice(0,q.ch)+te[0],c(0)),I(Ce,Fe+Ce.text.slice(ee.ch),Ie);var Mt=Y(1,te.length-1);it>1&&e.remove(q.line+1,it-1),e.insert(q.line+1,Mt)}En(e,"change",e,t)}function Vr(e,t,a){function i(c,I,Y){if(c.linked)for(var q=0;q<c.linked.length;++q){var ee=c.linked[q];if(ee.doc==I)continue;var te=Y&&ee.sharedHist;if(a&&!te)continue;t(ee.doc,te),i(ee.doc,c,te)}}i(e,null,!0)}function Fo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,_a(e),Fa(e),Bo(e),e.options.lineWrapping||Mr(e),e.options.mode=t.modeOption,ur(e)}function Bo(e){(e.doc.direction=="rtl"?j:g)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){br(e,function(){Bo(e),ur(e)})}function ra(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 Wa(e,t){var a={from:kt(t.from),to:Gr(t),text:Ke(e,t.from,t.to)};return Ko(e,a,t.from.line,t.to.line+1),Vr(e,function(i){return Ko(i,a,t.from.line,t.to.line+1)},!0),a}function Wo(e){for(;e.length;){var t=ke(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Wo(e.done),ke(e.done);if(e.done.length&&!ke(e.done).ranges)return ke(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ke(e.done)}function Ho(e,t,a,i){var c=e.history;c.undone.length=0;var I=+new Date,Y,q;if((c.lastOp==i||c.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&c.lastModTime>I-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Y=pl(c,c.lastOp==i)))q=ke(Y.changes),nt(t.from,t.to)==0&&nt(t.from,q.to)==0?q.to=Gr(t):Y.changes.push(Wa(e,t));else{var ee=ke(c.done);for((!ee||!ee.ranges)&&ia(e.sel,c.done),Y={changes:[Wa(e,t)],generation:c.generation},c.done.push(Y);c.done.length>c.undoDepth;)c.done.shift(),c.done[0].ranges||c.done.shift()}c.done.push(a),c.generation=++c.maxGeneration,c.lastModTime=c.lastSelTime=I,c.lastOp=c.lastSelOp=i,c.lastOrigin=c.lastSelOrigin=t.origin,q||Pe(e,"historyAdded")}function ml(e,t,a,i){var c=t.charAt(0);return c=="*"||c=="+"&&a.ranges.length==i.ranges.length&&a.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,a,i){var c=e.history,I=i&&i.origin;a==c.lastSelOp||I&&c.lastSelOrigin==I&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==I||ml(e,I,ke(c.done),t))?c.done[c.done.length-1]=t:ia(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=I,c.lastSelOp=a,i&&i.clearRedo!==!1&&Wo(c.undone)}function ia(e,t){var a=ke(t);a&&a.ranges&&a.equals(e)||t.push(e)}function Ko(e,t,a,i){var c=t["spans_"+e.id],I=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,i),function(Y){Y.markedSpans&&((c||(c=t["spans_"+e.id]={}))[I]=Y.markedSpans),++I})}function vl(e){if(!e)return null;for(var t,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?t||(t=e.slice(0,a)):t&&t.push(e[a]);return t?t.length?t:null:e}function yl(e,t){var a=t["spans_"+e.id];if(!a)return null;for(var i=[],c=0;c<t.text.length;++c)i.push(vl(a[c]));return i}function zo(e,t){var a=yl(e,t),i=tr(e,t);if(!a)return i;if(!i)return a;for(var c=0;c<a.length;++c){var I=a[c],Y=i[c];if(I&&Y){e:for(var q=0;q<Y.length;++q){for(var ee=Y[q],te=0;te<I.length;++te)if(I[te].marker==ee.marker)continue e;I.push(ee)}}else Y&&(a[c]=Y)}return a}function hi(e,t,a){for(var i=[],c=0;c<e.length;++c){var I=e[c];if(I.ranges){i.push(a?Tr.prototype.deepCopy.call(I):I);continue}var Y=I.changes,q=[];i.push({changes:q});for(var ee=0;ee<Y.length;++ee){var te=Y[ee],ye=void 0;if(q.push({from:te.from,to:te.to,text:te.text}),t)for(var Ce in te)(ye=Ce.match(/^spans_(\d+)$/))&&(ae(t,Number(ye[1]))>-1&&(ke(q)[Ce]=te[Ce],delete te[Ce]))}}return i}function Ha(e,t,a,i){if(i){var c=e.anchor;if(a){var I=nt(t,c)<0;I!=nt(a,c)<0?(c=t,t=a):I!=nt(t,a)<0&&(t=a)}return new wn(c,t)}else return new wn(a||t,t)}function aa(e,t,a,i,c){c==null&&(c=e.cm&&(e.cm.display.shift||e.extend)),rr(e,new Tr([Ha(e.sel.primary(),t,a,c)],0),i)}function Go(e,t,a){for(var i=[],c=e.cm&&(e.cm.display.shift||e.extend),I=0;I<e.sel.ranges.length;I++)i[I]=Ha(e.sel.ranges[I],t[I],null,c);var Y=Dr(e.cm,i,e.sel.primIndex);rr(e,Y,a)}function Ka(e,t,a,i){var c=e.sel.ranges.slice(0);c[t]=a,rr(e,Dr(e.cm,c,e.sel.primIndex),i)}function Vo(e,t,a,i){rr(e,zr(t,a),i)}function bl(e,t,a){var i={ranges:t.ranges,update:function(c){this.ranges=[];for(var I=0;I<c.length;I++)this.ranges[I]=new wn(b(e,c[I].anchor),b(e,c[I].head))},origin:a&&a.origin};return Pe(e,"beforeSelectionChange",e,i),e.cm&&Pe(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Dr(e.cm,i.ranges,i.ranges.length-1):t}function Xo(e,t,a){var i=e.history.done,c=ke(i);c&&c.ranges?(i[i.length-1]=t,oa(e,t,a)):rr(e,t,a)}function rr(e,t,a){oa(e,t,a),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function oa(e,t,a){(de(e,"beforeSelectionChange")||e.cm&&de(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,a));var i=a&&a.bias||(nt(t.primary().head,e.sel.primary().head)<0?-1:1);Yo(e,Jo(e,t,i,!0)),!(a&&a.scroll===!1)&&e.cm&&di(e.cm)}function Yo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),En(e,"cursorActivity",e)}function $o(e){Yo(e,Jo(e,e.sel,null,!1))}function Jo(e,t,a,i){for(var c,I=0;I<t.ranges.length;I++){var Y=t.ranges[I],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[I],ee=sa(e,Y.anchor,q&&q.anchor,a,i),te=sa(e,Y.head,q&&q.head,a,i);(c||ee!=Y.anchor||te!=Y.head)&&(c||(c=t.ranges.slice(0,I)),c[I]=new wn(ee,te))}return c?Dr(e.cm,c,t.primIndex):t}function fi(e,t,a,i,c){var I=Dt(e,t.line);if(I.markedSpans)for(var Y=0;Y<I.markedSpans.length;++Y){var q=I.markedSpans[Y],ee=q.marker,te="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,ye="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((q.from==null||(te?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(ye?q.to>=t.ch:q.to>t.ch))){if(c&&(Pe(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(I.markedSpans){--Y;continue}else break;if(!ee.atomic)continue;if(a){var Ce=ee.find(i<0?1:-1),Fe=void 0;if((i<0?ye:te)&&(Ce=Zo(e,Ce,-i,Ce&&Ce.line==t.line?I:null)),Ce&&Ce.line==t.line&&(Fe=nt(Ce,a))&&(i<0?Fe<0:Fe>0))return fi(e,Ce,t,i,c)}var Ie=ee.find(i<0?-1:1);return(i<0?te:ye)&&(Ie=Zo(e,Ie,i,Ie.line==t.line?I:null)),Ie?fi(e,Ie,t,i,c):null}}return t}function sa(e,t,a,i,c){var I=i||1,Y=fi(e,t,a,I,c)||!c&&fi(e,t,a,I,!0)||fi(e,t,a,-I,c)||!c&&fi(e,t,a,-I,!0);return Y||(e.cantEdit=!0,We(e.first,0))}function Zo(e,t,a,i){return a<0&&t.ch==0?t.line>e.first?b(e,We(t.line-1)):null:a>0&&t.ch==(i||Dt(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+a)}function Qo(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),Se)}function qo(e,t,a){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return a&&(i.update=function(c,I,Y,q){c&&(i.from=b(e,c)),I&&(i.to=b(e,I)),Y&&(i.text=Y),q!==void 0&&(i.origin=q)}),Pe(e,"beforeChange",e,i),e.cm&&Pe(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function pi(e,t,a){if(e.cm){if(!e.cm.curOp)return Jn(e.cm,pi)(e,t,a);if(e.cm.state.suppressEdits)return}if((de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"))&&(t=qo(e,t,!0),!t))return;var i=Mn&&!a&&mr(e,t.from,t.to);if(i)for(var c=i.length-1;c>=0;--c)es(e,{from:i[c].from,to:i[c].to,text:c?[""]:t.text,origin:t.origin});else es(e,t)}function es(e,t){if(t.text.length==1&&t.text[0]==""&&nt(t.from,t.to)==0)return;var a=ja(e,t);Ho(e,t,a,e.cm?e.cm.curOp.id:NaN),ki(e,t,a,tr(e,t));var i=[];Vr(e,function(c,I){!I&&ae(i,c.history)==-1&&(is(c.history,t),i.push(c.history)),ki(c,t,null,tr(c,t))})}function la(e,t,a){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!a)return;for(var c=e.history,I,Y=e.sel,q=t=="undo"?c.done:c.undone,ee=t=="undo"?c.undone:c.done,te=0;te<q.length&&!(I=q[te],a?I.ranges&&!I.equals(e.sel):!I.ranges);te++);if(te==q.length)return;for(c.lastOrigin=c.lastSelOrigin=null;;)if(I=q.pop(),I.ranges){if(ia(I,ee),a&&!I.equals(e.sel)){rr(e,I,{clearRedo:!1});return}Y=I}else if(i){q.push(I);return}else break;var ye=[];ia(Y,ee),ee.push({changes:ye,generation:c.generation}),c.generation=I.generation||++c.maxGeneration;for(var Ce=de(e,"beforeChange")||e.cm&&de(e.cm,"beforeChange"),Fe=function(ht){var St=I.changes[ht];if(St.origin=t,Ce&&!qo(e,St,!1))return q.length=0,{};ye.push(Wa(e,St));var Mt=ht?ja(e,St):ke(q);ki(e,St,Mt,zo(e,St)),!ht&&e.cm&&e.cm.scrollIntoView({from:St.from,to:Gr(St)});var Ft=[];Vr(e,function(Pt,Ht){!Ht&&ae(Ft,Pt.history)==-1&&(is(Pt.history,St),Ft.push(Pt.history)),ki(Pt,St,null,zo(Pt,St))})},Ie=I.changes.length-1;Ie>=0;--Ie){var it=Fe(Ie);if(it)return it.v}}function ts(e,t){if(t==0)return;if(e.first+=t,e.sel=new Tr(lt(e.sel.ranges,function(c){return new wn(We(c.anchor.line+t,c.anchor.ch),We(c.head.line+t,c.head.ch))}),e.sel.primIndex),e.cm){ur(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,i=a.viewFrom;i<a.viewTo;i++)Hr(e.cm,i,"gutter")}}function ki(e,t,a,i){if(e.cm&&!e.cm.curOp)return Jn(e.cm,ki)(e,t,a,i);if(t.to.line<e.first){ts(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 c=t.text.length-1-(e.first-t.from.line);ts(e,c),t={from:We(e.first,0),to:We(t.to.line+c,t.to.ch),text:[ke(t.text)],origin:t.origin}}var I=e.lastLine();t.to.line>I&&(t={from:t.from,to:We(I,Dt(e,I).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ke(e,t.from,t.to),a||(a=ja(e,t)),e.cm?El(e.cm,t,i):Ba(e,t,i),oa(e,a,Se),e.cantEdit&&sa(e,We(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,a){var i=e.doc,c=e.display,I=t.from,Y=t.to,q=!1,ee=I.line;e.options.lineWrapping||(ee=It(Hn(Dt(i,I.line))),i.iter(ee,Y.line+1,function(Ie){if(Ie==c.maxLine)return q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&be(e),Ba(i,t,a,yo(e)),e.options.lineWrapping||(i.iter(ee,I.line+t.text.length,function(Ie){var it=Cr(Ie);it>c.maxLineLength&&(c.maxLine=Ie,c.maxLineLength=it,c.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),An(i,I.line),Li(e,400);var te=t.text.length-(Y.line-I.line)-1;t.full?ur(e):I.line==Y.line&&t.text.length==1&&!jo(e.doc,t)?Hr(e,I.line,"text"):ur(e,I.line,Y.line+1,te);var ye=de(e,"changes"),Ce=de(e,"change");if(Ce||ye){var Fe={from:I,to:Y,text:t.text,removed:t.removed,origin:t.origin};Ce&&En(e,"change",e,Fe),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Fe)}e.display.selForContextMenu=null}function mi(e,t,a,i,c){var I;i||(i=a),nt(i,a)<0&&(I=[i,a],a=I[0],i=I[1]),typeof t=="string"&&(t=e.splitLines(t)),pi(e,{from:a,to:i,text:t,origin:c})}function ns(e,t,a,i){a<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function rs(e,t,a,i){for(var c=0;c<e.length;++c){var I=e[c],Y=!0;if(I.ranges){I.copied||(I=e[c]=I.deepCopy(),I.copied=!0);for(var q=0;q<I.ranges.length;q++)ns(I.ranges[q].anchor,t,a,i),ns(I.ranges[q].head,t,a,i);continue}for(var ee=0;ee<I.changes.length;++ee){var te=I.changes[ee];if(a<te.from.line)te.from=We(te.from.line+i,te.from.ch),te.to=We(te.to.line+i,te.to.ch);else if(t<=te.to.line){Y=!1;break}}Y||(e.splice(0,c+1),c=0)}}function is(e,t){var a=t.from.line,i=t.to.line,c=t.text.length-(i-a)-1;rs(e.done,a,i,c),rs(e.undone,a,i,c)}function Ii(e,t,a,i){var c=t,I=t;return typeof t=="number"?I=Dt(e,z(e,t)):c=It(t),c==null?null:(i(I,c)&&e.cm&&Hr(e.cm,c,a),I)}function Ni(e){this.lines=e,this.parent=null;for(var t=0,a=0;a<e.length;++a)e[a].parent=this,t+=e[a].height;this.height=t}Ni.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var a=e,i=e+t;a<i;++a){var c=this.lines[a];this.height-=c.height,Rn(c),En(c,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,a){for(var i=e+t;e<i;++e)if(a(this.lines[e]))return!0}};function Ui(e){this.children=e;for(var t=0,a=0,i=0;i<e.length;++i){var c=e[i];t+=c.chunkSize(),a+=c.height,c.parent=this}this.size=t,this.height=a,this.parent=null}Ui.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var a=0;a<this.children.length;++a){var i=this.children[a],c=i.chunkSize();if(e<c){var I=Math.min(t,c-e),Y=i.height;if(i.removeInner(e,I),this.height-=Y-i.height,c==I&&(this.children.splice(a--,1),i.parent=null),(t-=I)==0)break;e=0}else e-=c}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ni))){var q=[];this.collapse(q),this.children=[new Ni(q)],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,a){this.size+=t.length,this.height+=a;for(var i=0;i<this.children.length;++i){var c=this.children[i],I=c.chunkSize();if(e<=I){if(c.insertInner(e,t,a),c.lines&&c.lines.length>50){for(var Y=c.lines.length%25+25,q=Y;q<c.lines.length;){var ee=new Ni(c.lines.slice(q,q+=25));c.height-=ee.height,this.children.splice(++i,0,ee),ee.parent=this}c.lines=c.lines.slice(0,Y),this.maybeSpill()}break}e-=I}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),a=new Ui(t);if(e.parent){e.size-=a.size,e.height-=a.height;var c=ae(e.parent.children,e);e.parent.children.splice(c+1,0,a)}else{var i=new Ui(e.children);i.parent=e,e.children=[i,a],e=i}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,a){for(var i=0;i<this.children.length;++i){var c=this.children[i],I=c.chunkSize();if(e<I){var Y=Math.min(t,I-e);if(c.iterN(e,Y,a))return!0;if((t-=Y)==0)break;e=0}else e-=I}}};var ji=function(e,t,a){if(a)for(var i in a)a.hasOwnProperty(i)&&(this[i]=a[i]);this.doc=e,this.node=t};ji.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,a=this.line,i=It(a);if(i==null||!t)return;for(var c=0;c<t.length;++c)t[c]==this&&t.splice(c--,1);t.length||(a.widgets=null);var I=Ti(this);Bt(a,Math.max(0,a.height-I)),e&&(br(e,function(){as(e,a,-I),Hr(e,i,"widget")}),En(e,"lineWidgetCleared",e,this,i))},ji.prototype.changed=function(){var e=this,t=this.height,a=this.doc.cm,i=this.line;this.height=null;var c=Ti(this)-t;if(!c)return;Xn(this.doc,i)||Bt(i,i.height+c),a&&br(a,function(){a.curOp.forceUpdate=!0,as(a,i,c),En(a,"lineWidgetChanged",a,e,It(i))})},he(ji);function as(e,t,a){lr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ma(e,a)}function xl(e,t,a,i){var c=new ji(e,a,i),I=e.cm;return I&&c.noHScroll&&(I.display.alignWidgets=!0),Ii(e,t,"widget",function(Y){var q=Y.widgets||(Y.widgets=[]);if(c.insertAt==null?q.push(c):q.splice(Math.min(q.length-1,Math.max(0,c.insertAt)),0,c),c.line=Y,I&&!Xn(e,Y)){var ee=lr(Y)<e.scrollTop;Bt(Y,Y.height+Ti(c)),ee&&Ma(I,c.height),I.curOp.forceUpdate=!0}return!0}),I&&En(I,"lineWidgetAdded",I,c,typeof t=="number"?t:It(t)),c}var os=0,Xr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++os};Xr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ni(e),de(this,"clear")){var a=this.find();a&&En(this,"clear",a.from,a.to)}for(var i=null,c=null,I=0;I<this.lines.length;++I){var Y=this.lines[I],q=jn(Y.markedSpans,this);e&&!this.collapsed?Hr(e,It(Y),"text"):e&&(q.to!=null&&(c=It(Y)),q.from!=null&&(i=It(Y))),Y.markedSpans=pr(Y.markedSpans,q),q.from==null&&this.collapsed&&!Xn(this.doc,Y)&&e&&Bt(Y,si(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var te=Hn(this.lines[ee]),ye=Cr(te);ye>e.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&ur(e,i,c+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&$o(e.doc)),e&&En(e,"markerCleared",e,this,i,c),t&&ri(e),this.parent&&this.parent.clear()},Xr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,i,c=0;c<this.lines.length;++c){var I=this.lines[c],Y=jn(I.markedSpans,this);if(Y.from!=null&&(a=We(t?I:It(I),Y.from),e==-1))return a;if(Y.to!=null&&(i=We(t?I:It(I),Y.to),e==1))return i}return a&&{from:a,to:i}},Xr.prototype.changed=function(){var e=this,t=this.find(-1,!0),a=this,i=this.doc.cm;if(!t||!i)return;br(i,function(){var c=t.line,I=It(t.line),Y=Ea(i,I);if(Y&&(uo(Y),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Xn(a.doc,c)&&a.height!=null){var q=a.height;a.height=null;var ee=Ti(a)-q;ee&&Bt(c,c.height+ee)}En(i,"markerChanged",i,e)})},Xr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ae(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Xr.prototype.detachLine=function(e){if(this.lines.splice(ae(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},he(Xr);function gi(e,t,a,i,c){if(i&&i.shared)return Cl(e,t,a,i,c);if(e.cm&&!e.cm.curOp)return Jn(e.cm,gi)(e,t,a,i,c);var I=new Xr(e,c),Y=nt(t,a);if(i&&B(i,I,!1),Y>0||Y==0&&I.clearWhenEmpty!==!1)return I;if(I.replacedWith&&(I.collapsed=!0,I.widgetNode=_("span",[I.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||I.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(I.widgetNode.insertLeft=!0)),I.collapsed){if(Pn(e,t.line,t,a,I)||t.line!=a.line&&Pn(e,a.line,t,a,I))throw new Error("Inserting collapsed marker partially overlapping an existing one");bn()}I.addToHistory&&Ho(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var q=t.line,ee=e.cm,te;if(e.iter(q,a.line+1,function(Ce){ee&&I.collapsed&&!ee.options.lineWrapping&&Hn(Ce)==ee.display.maxLine&&(te=!0),I.collapsed&&q!=t.line&&Bt(Ce,0),Sn(Ce,new $n(I,q==t.line?t.ch:null,q==a.line?a.ch:null)),++q}),I.collapsed&&e.iter(t.line,a.line+1,function(Ce){Xn(e,Ce)&&Bt(Ce,0)}),I.clearOnEnter&&xe(I,"beforeCursorEnter",function(){return I.clear()}),I.readOnly&&(Cn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),I.collapsed&&(I.id=++os,I.atomic=!0),ee){if(te&&(ee.curOp.updateMaxLine=!0),I.collapsed)ur(ee,t.line,a.line+1);else if(I.className||I.startStyle||I.endStyle||I.css||I.attributes||I.title)for(var ye=t.line;ye<=a.line;ye++)Hr(ee,ye,"text");I.atomic&&$o(ee.doc),En(ee,"markerAdded",ee,I)}return I}var Fi=function(e,t){this.markers=e,this.primary=t;for(var a=0;a<e.length;++a)e[a].parent=this};Fi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();En(this,"clear")},Fi.prototype.find=function(e,t){return this.primary.find(e,t)},he(Fi);function Cl(e,t,a,i,c){i=B(i),i.shared=!1;var I=[gi(e,t,a,i,c)],Y=I[0],q=i.widgetNode;return Vr(e,function(ee){q&&(i.widgetNode=q.cloneNode(!0)),I.push(gi(ee,b(ee,t),b(ee,a),i,c));for(var te=0;te<ee.linked.length;++te)if(ee.linked[te].isParent)return;Y=ke(I)}),new Fi(I,Y)}function ss(e){return e.findMarks(We(e.first,0),e.clipPos(We(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var a=0;a<t.length;a++){var i=t[a],c=i.find(),I=e.clipPos(c.from),Y=e.clipPos(c.to);if(nt(I,Y)){var q=gi(e,I,Y,i.primary,i.primary.type);i.markers.push(q),q.parent=i}}}function Tl(e){for(var t=function(i){var c=e[i],I=[c.primary.doc];Vr(c.primary.doc,function(ee){return I.push(ee)});for(var Y=0;Y<c.markers.length;Y++){var q=c.markers[Y];ae(I,q.doc)==-1&&(q.parent=null,c.markers.splice(Y--,1))}},a=0;a<e.length;a++)t(a)}var wl=0,dr=function(e,t,a,i,c){if(!(this instanceof dr))return new dr(e,t,a,i,c);a==null&&(a=0),Ui.call(this,[new Ni([new un("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var I=We(a,0);this.sel=zr(I),this.history=new ra(null),this.id=++wl,this.modeOption=t,this.lineSep=i,this.direction=c=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ba(this,{from:I,to:I,text:e}),rr(this,zr(I),Se)};dr.prototype=ce(Ui.prototype,{constructor:dr,iter:function(e,t,a){a?this.iterN(e-this.first,t-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var a=0,i=0;i<t.length;++i)a+=t[i].height;this.insertInner(e-this.first,t,a)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ct(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Zn(function(e){var t=We(this.first,0),a=this.first+this.size-1;pi(this,{from:t,to:We(a,Dt(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Oi(this.cm,0,0),rr(this,zr(t),Se)}),replaceRange:function(e,t,a,i){t=b(this,t),a=a?b(this,a):t,mi(this,e,t,a,i)},getRange:function(e,t,a){var i=Ke(this,b(this,e),b(this,t));return a===!1?i:i.join(a||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(nn(this,e))return Dt(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Dt(this,e)),Hn(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(),a;return e==null||e=="head"?a=t.head:e=="anchor"?a=t.anchor:e=="end"||e=="to"||e===!1?a=t.to():a=t.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zn(function(e,t,a){Vo(this,b(this,typeof e=="number"?We(e,t||0):e),null,a)}),setSelection:Zn(function(e,t,a){Vo(this,b(this,e),b(this,t||e),a)}),extendSelection:Zn(function(e,t,a){aa(this,b(this,e),t&&b(this,t),a)}),extendSelections:Zn(function(e,t){Go(this,V(this,e),t)}),extendSelectionsBy:Zn(function(e,t){var a=lt(this.sel.ranges,e);Go(this,V(this,a),t)}),setSelections:Zn(function(e,t,a){if(!e.length)return;for(var i=[],c=0;c<e.length;c++)i[c]=new wn(b(this,e[c].anchor),b(this,e[c].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),rr(this,Dr(this.cm,i,t),a)}),addSelection:Zn(function(e,t,a){var i=this.sel.ranges.slice(0);i.push(new wn(b(this,e),b(this,t||e))),rr(this,Dr(this.cm,i,i.length-1),a)}),getSelection:function(e){for(var t=this.sel.ranges,a,i=0;i<t.length;i++){var c=Ke(this,t[i].from(),t[i].to());a=a?a.concat(c):c}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],a=this.sel.ranges,i=0;i<a.length;i++){var c=Ke(this,a[i].from(),a[i].to());e!==!1&&(c=c.join(e||this.lineSeparator())),t[i]=c}return t},replaceSelection:function(e,t,a){for(var i=[],c=0;c<this.sel.ranges.length;c++)i[c]=e;this.replaceSelections(i,t,a||"+input")},replaceSelections:Zn(function(e,t,a){for(var i=[],c=this.sel,I=0;I<c.ranges.length;I++){var Y=c.ranges[I];i[I]={from:Y.from(),to:Y.to(),text:this.splitLines(e[I]),origin:a}}for(var q=t&&t!="end"&&hl(this,i,t),ee=i.length-1;ee>=0;ee--)pi(this,i[ee]);q?Xo(this,q):this.cm&&di(this.cm)}),undo:Zn(function(){la(this,"undo")}),redo:Zn(function(){la(this,"redo")}),undoSelection:Zn(function(){la(this,"undo",!0)}),redoSelection:Zn(function(){la(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,a=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var c=0;c<e.undone.length;c++)e.undone[c].ranges||++a;return{undo:t,redo:a}},clearHistory:function(){var e=this;this.history=new ra(this.history.maxGeneration),Vr(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:hi(this.history.done),undone:hi(this.history.undone)}},setHistory:function(e){var t=this.history=new ra(this.history.maxGeneration);t.done=hi(e.done.slice(0),null,!0),t.undone=hi(e.undone.slice(0),null,!0)},setGutterMarker:Zn(function(e,t,a){return Ii(this,e,"gutter",function(i){var c=i.gutterMarkers||(i.gutterMarkers={});return c[t]=a,!a&&qe(c)&&(i.gutterMarkers=null),!0})}),clearGutter:Zn(function(e){var t=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&Ii(t,a,"gutter",function(){return a.gutterMarkers[e]=null,qe(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!nn(this,e))return null;if(t=e,e=Dt(this,e),!e)return null}else if(t=It(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:Zn(function(e,t,a){return Ii(this,e,t=="gutter"?"gutter":"class",function(i){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[c])i[c]=a;else{if(O(a).test(i[c]))return!1;i[c]+=" "+a}return!0})}),removeLineClass:Zn(function(e,t,a){return Ii(this,e,t=="gutter"?"gutter":"class",function(i){var c=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",I=i[c];if(I)if(a==null)i[c]=null;else{var Y=I.match(O(a));if(!Y)return!1;var q=Y.index+Y[0].length;i[c]=I.slice(0,Y.index)+(!Y.index||q==I.length?"":" ")+I.slice(q)||null}else return!1;return!0})}),addLineWidget:Zn(function(e,t,a){return xl(this,e,t,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,a){return gi(this,b(this,e),b(this,t),a,a&&a.type||"range")},setBookmark:function(e,t){var a={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),gi(this,e,e,a,"bookmark")},findMarksAt:function(e){e=b(this,e);var t=[],a=Dt(this,e.line).markedSpans;if(a)for(var i=0;i<a.length;++i){var c=a[i];(c.from==null||c.from<=e.ch)&&(c.to==null||c.to>=e.ch)&&t.push(c.marker.parent||c.marker)}return t},findMarks:function(e,t,a){e=b(this,e),t=b(this,t);var i=[],c=e.line;return this.iter(e.line,t.line+1,function(I){var Y=I.markedSpans;if(Y)for(var q=0;q<Y.length;q++){var ee=Y[q];!(ee.to!=null&&c==e.line&&e.ch>=ee.to||ee.from==null&&c!=e.line||ee.from!=null&&c==t.line&&ee.from>=t.ch)&&(!a||a(ee.marker))&&i.push(ee.marker.parent||ee.marker)}++c}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var i=0;i<a.length;++i)a[i].from!=null&&e.push(a[i].marker)}),e},posFromIndex:function(e){var t,a=this.first,i=this.lineSeparator().length;return this.iter(function(c){var I=c.text.length+i;if(I>e)return t=e,!0;e-=I,++a}),b(this,We(a,t))},indexFromPos:function(e){e=b(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+a}),t},copy:function(e){var t=new dr(Ct(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,a=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<a&&(a=e.to);var i=new dr(Ct(this,t,a),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(i,ss(this)),i},unlinkDoc:function(e){if(e instanceof In&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var a=this.linked[t];if(a.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(ss(this));break}if(e.history==this.history){var i=[e.id];Vr(e,function(c){return i.push(c.id)},!0),e.history=new ra(null),e.history.done=hi(this.history.done,i),e.history.undone=hi(this.history.undone,i)}},iterLinkedDocs:function(e){Vr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$e(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Zn(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)})}),dr.prototype.eachLine=dr.prototype.iter;var ls=0;function Al(e){var t=this;if(us(t),Xe(t,e)||Ur(t.display,e))return;re(e),F&&(ls=+new Date);var a=Qr(t,e,!0),i=e.dataTransfer.files;if(!a||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var c=i.length,I=Array(c),Y=0,q=function(){++Y==c&&Jn(t,function(){a=b(t.doc,a);var Ie={from:a,to:a,text:t.doc.splitLines(I.filter(function(it){return it!=null}).join(t.doc.lineSeparator())),origin:"paste"};pi(t.doc,Ie),Xo(t.doc,zr(b(t.doc,a),b(t.doc,Gr(Ie))))})()},ee=function(Ie,it){if(t.options.allowDropFileTypes&&ae(t.options.allowDropFileTypes,Ie.type)==-1){q();return}var ht=new FileReader;ht.onerror=function(){return q()},ht.onload=function(){var St=ht.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(St)){q();return}I[it]=St,q()},ht.readAsText(Ie)},te=0;te<i.length;te++)ee(i[te],te);else{if(t.state.draggingText&&t.doc.sel.contains(a)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var Ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ce=t.listSelections()),oa(t.doc,zr(a,a)),Ce)for(var Fe=0;Fe<Ce.length;++Fe)mi(t.doc,"",Ce[Fe].anchor,Ce[Fe].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(Ie){}}}function Ol(e,t){if(F&&(!e.state.draggingText||+new Date-ls<100)){me(t);return}if(Xe(e,t)||Ur(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!C){var a=u("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),t.dataTransfer.setDragImage(a,0,0),v&&a.parentNode.removeChild(a)}}function _l(e,t){var a=Qr(e,t);if(!a)return;var i=document.createDocumentFragment();xo(e,a,i),e.display.dragCursor||(e.display.dragCursor=u("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),s(e.display.dragCursor,i)}function us(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ds(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),a=[],i=0;i<t.length;i++){var c=t[i].CodeMirror;c&&a.push(c)}a.length&&a[0].operation(function(){for(var I=0;I<a.length;I++)e(a[I])})}var cs=!1;function Dl(){if(cs)return;Rl(),cs=!0}function Rl(){var e;xe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ds(Ll)},100))}),xe(window,"blur",function(){return ds(ui)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Yr={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"},Bi=0;Bi<10;Bi++)Yr[Bi+48]=Yr[Bi+96]=String(Bi);for(var ua=65;ua<=90;ua++)Yr[ua]=String.fromCharCode(ua);for(var Wi=1;Wi<=12;Wi++)Yr[Wi+111]=Yr[Wi+63235]="F"+Wi;var jr={};jr.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"},jr.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"},jr.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"},jr.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"]},jr.default=o?jr.macDefault:jr.pcDefault;function Ml(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var a,i,c,I,Y=0;Y<t.length-1;Y++){var q=t[Y];if(/^(cmd|meta|m)$/i.test(q))I=!0;else if(/^a(lt)?$/i.test(q))a=!0;else if(/^(c|ctrl|control)$/i.test(q))i=!0;else if(/^s(hift)?$/i.test(q))c=!0;else throw new Error("Unrecognized modifier name: "+q)}return a&&(e="Alt-"+e),i&&(e="Ctrl-"+e),I&&(e="Cmd-"+e),c&&(e="Shift-"+e),e}function Pl(e){var t={};for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(i=="..."){delete e[a];continue}for(var c=lt(a.split(" "),Ml),I=0;I<c.length;I++){var Y=void 0,q=void 0;I==c.length-1?(q=c.join(" "),Y=i):(q=c.slice(0,I+1).join(" "),Y="...");var ee=t[q];if(!ee)t[q]=Y;else if(ee!=Y)throw new Error("Inconsistent bindings for "+q)}delete e[a]}for(var te in t)e[te]=t[te];return e}function vi(e,t,a,i){t=da(t);var c=t.call?t.call(e,i):t[e];if(c===!1)return"nothing";if(c==="...")return"multi";if(c!=null&&a(c))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return vi(e,t.fallthrough,a,i);for(var I=0;I<t.fallthrough.length;I++){var Y=vi(e,t.fallthrough[I],a,i);if(Y)return Y}}}function hs(e){var t=typeof e=="string"?e:Yr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function fs(e,t,a){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!a&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function ps(e,t){if(v&&e.keyCode==34&&e.char)return!1;var a=Yr[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),fs(a,e,t))}function da(e){return typeof e=="string"?jr[e]:e}function yi(e,t){for(var a=e.doc.sel.ranges,i=[],c=0;c<a.length;c++){for(var I=t(a[c]);i.length&&nt(I.from,ke(i).to)<=0;){var Y=i.pop();if(nt(Y.from,I.from)<0){I.from=Y.from;break}}i.push(I)}br(e,function(){for(var q=i.length-1;q>=0;q--)mi(e.doc,"",i[q].from,i[q].to,"+delete");di(e)})}function za(e,t,a){var i=tt(e.text,t+a,a);return i<0||i>e.text.length?null:i}function Ga(e,t,a){var i=za(e,t.ch,a);return i==null?null:new We(t.line,i,a<0?"after":"before")}function Va(e,t,a,i,c){if(e){t.doc.direction=="rtl"&&(c=-c);var I=At(a,t.doc.direction);if(I){var Y=c<0?ke(I):I[0],q=c<0==(Y.level==1),ee=q?"after":"before",te;if(Y.level>0||t.doc.direction=="rtl"){var ye=oi(t,a);te=c<0?a.text.length-1:0;var Ce=kr(t,ye,te).top;te=Tt(function(Fe){return kr(t,ye,Fe).top==Ce},c<0==(Y.level==1)?Y.from:Y.to-1,te),ee=="before"&&(te=za(a,te,1))}else te=c<0?Y.to:Y.from;return new We(i,te,ee)}}return new We(i,c<0?a.text.length:0,c<0?"before":"after")}function kl(e,t,a,i){var c=At(t,e.doc.direction);if(!c)return Ga(t,a,i);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var I=yt(c,a.ch,a.sticky),Y=c[I];if(e.doc.direction=="ltr"&&Y.level%2==0&&(i>0?Y.to>a.ch:Y.from<a.ch))return Ga(t,a,i);var q=function(Mt,Ft){return za(t,Mt instanceof We?Mt.ch:Mt,Ft)},ee,te=function(Mt){return e.options.lineWrapping?(ee=ee||oi(e,t),vo(e,t,ee,Mt)):{begin:0,end:t.text.length}},ye=te(a.sticky=="before"?q(a,-1):a.ch);if(e.doc.direction=="rtl"||Y.level==1){var Ce=Y.level==1==i<0,Fe=q(a,Ce?1:-1);if(Fe!=null&&(Ce?Fe<=Y.to&&Fe<=ye.end:Fe>=Y.from&&Fe>=ye.begin)){var Ie=Ce?"before":"after";return new We(a.line,Fe,Ie)}}var it=function(Mt,Ft,Pt){for(var Ht=function(Ln,Qn){return Qn?new We(a.line,q(Ln,1),"before"):new We(a.line,Ln,"after")};Mt>=0&&Mt<c.length;Mt+=Ft){var Qt=c[Mt],Gt=Ft>0==(Qt.level!=1),cn=Gt?Pt.begin:q(Pt.end,-1);if(Qt.from<=cn&&cn<Qt.to)return Ht(cn,Gt);if(cn=Gt?Qt.from:q(Qt.to,-1),Pt.begin<=cn&&cn<Pt.end)return Ht(cn,Gt)}},ht=it(I+i,i,ye);if(ht)return ht;var St=i>0?ye.end:q(ye.begin,-1);return St!=null&&!(i>0&&St==t.text.length)&&(ht=it(i>0?0:c.length-1,i,te(St)),ht)?ht:null}var Hi={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return yi(e,function(t){if(t.empty()){var a=Dt(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line<e.lastLine()?{from:t.head,to:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,a)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return yi(e,function(t){return{from:We(t.from().line,0),to:b(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return yi(e,function(t){return{from:We(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return yi(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return yi(e,function(t){var a=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:t.from(),to:i}})},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(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ms(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return gs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},Me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},Me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:a},"div");return i.ch<e.getLine(i.line).search(/\S/)?gs(e,t.head):i},Me)},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=[],a=e.listSelections(),i=e.options.tabSize,c=0;c<a.length;c++){var I=a[c].from(),Y=$(e.getLine(I.line),I.ch,i);t.push(ue(i-Y%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return br(e,function(){for(var t=e.listSelections(),a=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var c=t[i].head,I=Dt(e.doc,c.line).text;if(I){if(c.ch==I.length&&(c=new We(c.line,c.ch-1)),c.ch>0)c=new We(c.line,c.ch+1),e.replaceRange(I.charAt(c.ch-1)+I.charAt(c.ch-2),We(c.line,c.ch-2),c,"+transpose");else if(c.line>e.doc.first){var Y=Dt(e.doc,c.line-1).text;Y&&(c=new We(c.line,1),e.replaceRange(I.charAt(0)+e.doc.lineSeparator()+Y.charAt(Y.length-1),We(c.line-1,Y.length-1),c,"+transpose"))}}a.push(new wn(c,c))}e.setSelections(a)})},newlineAndIndent:function(e){return br(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);di(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ms(e,t){var a=Dt(e.doc,t),i=Hn(a);return i!=a&&(t=It(i)),Va(!0,e,i,t,1)}function Il(e,t){var a=Dt(e.doc,t),i=Or(a);return i!=a&&(t=It(i)),Va(!0,e,a,t,-1)}function gs(e,t){var a=ms(e,t.line),i=Dt(e.doc,a.line),c=At(i,e.doc.direction);if(!c||c[0].level==0){var I=Math.max(a.ch,i.text.search(/\S/)),Y=t.line==a.line&&t.ch<=I&&t.ch;return We(a.line,Y?0:I,a.sticky)}return a}function ca(e,t,a){if(typeof t=="string"&&(t=Hi[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,c=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),c=t(e)!=_e}finally{e.display.shift=i,e.state.suppressEdits=!1}return c}function Nl(e,t,a){for(var i=0;i<e.state.keyMaps.length;i++){var c=vi(t,e.state.keyMaps[i],a,e);if(c)return c}return e.options.extraKeys&&vi(t,e.options.extraKeys,a,e)||vi(t,e.options.keyMap,a,e)}var Ul=new ne;function Ki(e,t,a,i){var c=e.state.keySeq;if(c){if(hs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==c&&(e.state.keySeq=null,e.display.input.reset())}),vs(e,c+" "+t,a,i))return!0}return vs(e,t,a,i)}function vs(e,t,a,i){var c=Nl(e,t,i);return c=="multi"&&(e.state.keySeq=t),c=="handled"&&En(e,"keyHandled",e,t,a),(c=="handled"||c=="multi")&&(re(a),Da(e)),!!c}function ys(e,t){var a=ps(t,!0);return a?t.shiftKey&&!e.state.keySeq?Ki(e,"Shift-"+a,t,function(i){return ca(e,i,!0)})||Ki(e,a,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return ca(e,i)}):Ki(e,a,t,function(i){return ca(e,i)}):!1}function jl(e,t,a){return Ki(e,"'"+a+"'",t,function(i){return ca(e,i,!0)})}var Xa=null;function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=P(),Xe(t,e))return;F&&U<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;t.display.shift=a==16||e.shiftKey;var i=ys(t,e);v&&(Xa=i?a:null,!i&&a==88&&!Ne&&(o?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!o&&!i&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;j(t,"CodeMirror-crosshair");function a(i){(i.keyCode==18||!i.altKey)&&(g(t,"CodeMirror-crosshair"),Ze(document,"keyup",a),Ze(document,"mouseover",a))}xe(document,"keyup",a),xe(document,"mouseover",a)}function Es(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function xs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ur(t.display,e)||Xe(t,e)||e.ctrlKey&&!e.altKey||o&&e.metaKey)return;var a=e.keyCode,i=e.charCode;if(v&&a==Xa){Xa=null,re(e);return}if(v&&(!e.which||e.which<10)&&ys(t,e))return;var c=String.fromCharCode(i==null?a:i);if(c=="\b")return;if(jl(t,e,c))return;t.display.input.onKeyPress(e)}var Bl=400,Ya=function(e,t,a){this.time=e,this.pos=t,this.button=a};Ya.prototype.compare=function(e,t,a){return this.time+Bl>e&&nt(t,this.pos)==0&&a==this.button};var zi,Gi;function Wl(e,t){var a=+new Date;return Gi&&Gi.compare(a,e,t)?(zi=Gi=null,"triple"):zi&&zi.compare(a,e,t)?(Gi=new Ya(a,e,t),zi=null,"double"):(zi=new Ya(a,e,t),Gi=null,"single")}function Cs(e){var t=this,a=t.display;if(Xe(t,e)||a.activeTouch&&a.input.supportsTouch())return;if(a.input.ensurePolled(),a.shift=e.shiftKey,Ur(a,e)){S||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if($a(t,e))return;var i=Qr(t,e),c=Te(e),I=i?Wl(i,c):"single";if(window.focus(),c==1&&t.state.selectingText&&t.state.selectingText(e),i&&Hl(t,c,i,I,e))return;c==1?i?zl(t,i,I,e):De(e)==a.scroller&&re(e):c==2?(i&&aa(t.doc,i),setTimeout(function(){return a.input.focus()},20)):c==3&&(R?t.display.input.onContextMenu(e):So(t))}function Hl(e,t,a,i,c){var I="Click";return i=="double"?I="Double"+I:i=="triple"&&(I="Triple"+I),I=(t==1?"Left":t==2?"Middle":"Right")+I,Ki(e,fs(I,c),c,function(Y){if(typeof Y=="string"&&(Y=Hi[Y]),!Y)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=Y(e,a)!=_e}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,a){var i=e.getOption("configureMouse"),c=i?i(e,t,a):{};if(c.unit==null){var I=l?a.shiftKey&&a.metaKey:a.altKey;c.unit=I?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(c.extend==null||e.doc.extend)&&(c.extend=e.doc.extend||a.shiftKey),c.addNew==null&&(c.addNew=o?a.metaKey:a.ctrlKey),c.moveOnDrag==null&&(c.moveOnDrag=!(o?a.altKey:a.ctrlKey)),c}function zl(e,t,a,i){F?setTimeout(G(Co,e),0):e.curOp.focus=P();var c=Kl(e,a,i),I=e.doc.sel,Y;e.options.dragDrop&&Qe&&!e.isReadOnly()&&a=="single"&&(Y=I.contains(t))>-1&&(nt((Y=I.ranges[Y]).from(),t)<0||t.xRel>0)&&(nt(Y.to(),t)>0||t.xRel<0)?Gl(e,i,t,c):Vl(e,i,t,c)}function Gl(e,t,a,i){var c=e.display,I=!1,Y=Jn(e,function(te){S&&(c.scroller.draggable=!1),e.state.draggingText=!1,Ze(c.wrapper.ownerDocument,"mouseup",Y),Ze(c.wrapper.ownerDocument,"mousemove",q),Ze(c.scroller,"dragstart",ee),Ze(c.scroller,"drop",Y),I||(re(te),i.addNew||aa(e.doc,a,null,null,i.extend),S&&!C||F&&U==9?setTimeout(function(){c.wrapper.ownerDocument.body.focus({preventScroll:!0}),c.input.focus()},20):c.input.focus())}),q=function(te){I=I||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},ee=function(){return I=!0};S&&(c.scroller.draggable=!0),e.state.draggingText=Y,Y.copy=!i.moveOnDrag,c.scroller.dragDrop&&c.scroller.dragDrop(),xe(c.wrapper.ownerDocument,"mouseup",Y),xe(c.wrapper.ownerDocument,"mousemove",q),xe(c.scroller,"dragstart",ee),xe(c.scroller,"drop",Y),So(e),setTimeout(function(){return c.input.focus()},20)}function Ss(e,t,a){if(a=="char")return new wn(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new wn(We(t.line,0),b(e.doc,We(t.line+1,0)));var i=a(e,t);return new wn(i.from,i.to)}function Vl(e,t,a,i){var c=e.display,I=e.doc;re(t);var Y,q,ee=I.sel,te=ee.ranges;if(i.addNew&&!i.extend?(q=I.sel.contains(a),q>-1?Y=te[q]:Y=new wn(a,a)):(Y=I.sel.primary(),q=I.sel.primIndex),i.unit=="rectangle")i.addNew||(Y=new wn(a,a)),a=Qr(e,t,!0,!0),q=-1;else{var ye=Ss(e,a,i.unit);i.extend?Y=Ha(Y,ye.anchor,ye.head,i.extend):Y=ye}i.addNew?q==-1?(q=te.length,rr(I,Dr(e,te.concat([Y]),q),{scroll:!1,origin:"*mouse"})):te.length>1&&te[q].empty()&&i.unit=="char"&&!i.extend?(rr(I,Dr(e,te.slice(0,q).concat(te.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),ee=I.sel):Ka(I,q,Y,we):(q=0,rr(I,new Tr([Y],0),we),ee=I.sel);var Ce=a;function Fe(Pt){if(nt(Ce,Pt)==0)return;if(Ce=Pt,i.unit=="rectangle"){for(var Ht=[],Qt=e.options.tabSize,Gt=$(Dt(I,a.line).text,a.ch,Qt),cn=$(Dt(I,Pt.line).text,Pt.ch,Qt),Ln=Math.min(Gt,cn),Qn=Math.max(Gt,cn),Nn=Math.min(a.line,Pt.line),Er=Math.min(e.lastLine(),Math.max(a.line,Pt.line));Nn<=Er;Nn++){var cr=Dt(I,Nn).text,Gn=Le(cr,Ln,Qt);Ln==Qn?Ht.push(new wn(We(Nn,Gn),We(Nn,Gn))):cr.length>Gn&&Ht.push(new wn(We(Nn,Gn),We(Nn,Le(cr,Qn,Qt))))}Ht.length||Ht.push(new wn(a,a)),rr(I,Dr(e,ee.ranges.slice(0,q).concat(Ht),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Pt)}else{var hr=Y,er=Ss(e,Pt,i.unit),Yn=hr.anchor,Vn;nt(er.anchor,Yn)>0?(Vn=er.head,Yn=_t(hr.from(),er.anchor)):(Vn=er.anchor,Yn=Ut(hr.to(),er.head));var Fn=ee.ranges.slice(0);Fn[q]=Xl(e,new wn(b(I,Yn),Vn)),rr(I,Dr(e,Fn,q),we)}}var Ie=c.wrapper.getBoundingClientRect(),it=0;function ht(Pt){var Ht=++it,Qt=Qr(e,Pt,!0,i.unit=="rectangle");if(!Qt)return;if(nt(Qt,Ce)!=0){e.curOp.focus=P(),Fe(Qt);var Gt=qi(c,I);(Qt.line>=Gt.to||Qt.line<Gt.from)&&setTimeout(Jn(e,function(){it==Ht&&ht(Pt)}),150)}else{var cn=Pt.clientY<Ie.top?-20:Pt.clientY>Ie.bottom?20:0;cn&&setTimeout(Jn(e,function(){if(it!=Ht)return;c.scroller.scrollTop+=cn,ht(Pt)}),50)}}function St(Pt){e.state.selectingText=!1,it=Infinity,Pt&&(re(Pt),c.input.focus()),Ze(c.wrapper.ownerDocument,"mousemove",Mt),Ze(c.wrapper.ownerDocument,"mouseup",Ft),I.history.lastSelOrigin=null}var Mt=Jn(e,function(Pt){Pt.buttons===0||!Te(Pt)?St(Pt):ht(Pt)}),Ft=Jn(e,St);e.state.selectingText=Ft,xe(c.wrapper.ownerDocument,"mousemove",Mt),xe(c.wrapper.ownerDocument,"mouseup",Ft)}function Xl(e,t){var a=t.anchor,i=t.head,c=Dt(e.doc,a.line);if(nt(a,i)==0&&a.sticky==i.sticky)return t;var I=At(c);if(!I)return t;var Y=yt(I,a.ch,a.sticky),q=I[Y];if(q.from!=a.ch&&q.to!=a.ch)return t;var ee=Y+(q.from==a.ch==(q.level!=1)?0:1);if(ee==0||ee==I.length)return t;var te;if(i.line!=a.line)te=(i.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=yt(I,i.ch,i.sticky),Ce=ye-Y||(i.ch-a.ch)*(q.level==1?-1:1);ye==ee-1||ye==ee?te=Ce<0:te=Ce>0}var Fe=I[ee+(te?-1:0)],Ie=te==(Fe.level==1),it=Ie?Fe.from:Fe.to,ht=Ie?"after":"before";return a.ch==it&&a.sticky==ht?t:new wn(new We(a.line,it,ht),i)}function Ts(e,t,a,i){var c,I;if(t.touches)c=t.touches[0].clientX,I=t.touches[0].clientY;else try{c=t.clientX,I=t.clientY}catch(Fe){return!1}if(c>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&re(t);var Y=e.display,q=Y.lineDiv.getBoundingClientRect();if(I>q.bottom||!de(e,a))return le(t);I-=q.top-Y.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var te=Y.gutters.childNodes[ee];if(te&&te.getBoundingClientRect().right>=c){var ye=Zt(e.doc,I),Ce=e.display.gutterSpecs[ee];return Pe(e,a,e,ye,Ce.className,t),le(t)}}}function $a(e,t){return Ts(e,t,"gutterClick",!0)}function ws(e,t){if(Ur(e.display,t)||Yl(e,t))return;if(Xe(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return de(e,"gutterContextMenu")?Ts(e,t,"gutterContextMenu",!1):!1}function As(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wi(e)}var bi={toString:function(){return"CodeMirror.Init"}},Os={},ha={};function $l(e){var t=e.optionHandlers;function a(i,c,I,Y){e.defaults[i]=c,I&&(t[i]=Y?function(q,ee,te){te!=bi&&I(q,ee,te)}:I)}e.defineOption=a,e.Init=bi,a("value","",function(i,c){return i.setValue(c)},!0),a("mode",null,function(i,c){i.doc.modeOption=c,Fa(i)},!0),a("indentUnit",2,Fa,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(i){Pi(i),wi(i),ur(i)},!0),a("lineSeparator",null,function(i,c){if(i.doc.lineSep=c,!c)return;var I=[],Y=i.doc.first;i.doc.iter(function(ee){for(var te=0;;){var ye=ee.text.indexOf(c,te);if(ye==-1)break;te=ye+c.length,I.push(We(Y,ye))}Y++});for(var q=I.length-1;q>=0;q--)mi(i.doc,c,I[q],We(I[q].line,I[q].ch+c.length))}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,c,I){i.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),I!=bi&&i.refresh()}),a("specialCharPlaceholder",Yt,function(i){return i.refresh()},!0),a("electricChars",!0),a("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(i,c){return i.getInputField().spellcheck=c},!0),a("autocorrect",!1,function(i,c){return i.getInputField().autocorrect=c},!0),a("autocapitalize",!1,function(i,c){return i.getInputField().autocapitalize=c},!0),a("rtlMoveVisually",!x),a("wholeLineUpdateBefore",!0),a("theme","default",function(i){As(i),Mi(i)},!0),a("keyMap","default",function(i,c,I){var Y=da(c),q=I!=bi&&da(I);q&&q.detach&&q.detach(i,Y),Y.attach&&Y.attach(i,q||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,Zl,!0),a("gutters",[],function(i,c){i.display.gutterSpecs=Ua(c,i.options.lineNumbers),Mi(i)},!0),a("fixedGutter",!0,function(i,c){i.display.gutters.style.left=c?Oa(i.display)+"px":"0",i.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(i){return ci(i)},!0),a("scrollbarStyle","native",function(i){Do(i),ci(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),a("lineNumbers",!1,function(i,c){i.display.gutterSpecs=Ua(i.options.gutters,c),Mi(i)},!0),a("firstLineNumber",1,Mi,!0),a("lineNumberFormatter",function(i){return i},Mi,!0),a("showCursorWhenSelecting",!1,Ai,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(i,c){c=="nocursor"&&(ui(i),i.display.input.blur()),i.display.input.readOnlyChanged(c)}),a("screenReaderLabel",null,function(i,c){c=c===""?null:c,i.display.input.screenReaderLabelChanged(c)}),a("disableInput",!1,function(i,c){c||i.display.input.reset()},!0),a("dragDrop",!0,Jl),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,Ai,!0),a("singleCursorHeightPerLine",!0,Ai,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,Pi,!0),a("addModeClass",!1,Pi,!0),a("pollInterval",100),a("undoDepth",200,function(i,c){return i.doc.history.undoDepth=c}),a("historyEventDelay",1250),a("viewportMargin",10,function(i){return i.refresh()},!0),a("maxHighlightLength",1e4,Pi,!0),a("moveInputWithCursor",!0,function(i,c){c||i.display.input.resetPosition()}),a("tabindex",null,function(i,c){return i.display.input.getField().tabIndex=c||""}),a("autofocus",null),a("direction","ltr",function(i,c){return i.doc.setDirection(c)},!0),a("phrases",null)}function Jl(e,t,a){var i=a&&a!=bi;if(!t!=!i){var c=e.display.dragFunctions,I=t?xe:Ze;I(e.display.scroller,"dragstart",c.start),I(e.display.scroller,"dragenter",c.enter),I(e.display.scroller,"dragover",c.over),I(e.display.scroller,"dragleave",c.leave),I(e.display.scroller,"drop",c.drop)}}function Zl(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),Mr(e)),_a(e),ur(e),wi(e),setTimeout(function(){return ci(e)},100)}function In(e,t){var a=this;if(!(this instanceof In))return new In(e,t);this.options=t=t?B(t):{},B(Os,t,!1);var i=t.value;typeof i=="string"?i=new dr(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var c=new In.inputStyles[t.inputStyle](this),I=this.display=new dl(e,i,c,t);I.wrapper.CodeMirror=this,As(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Do(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ne,keySeq:null,specialChars:null},t.autofocus&&!r&&I.input.focus(),F&&U<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Ql(this),Dl(),ni(this),this.curOp.forceUpdate=!0,Fo(this,i),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Ra(a)},20):ui(this);for(var Y in ha)ha.hasOwnProperty(Y)&&ha[Y](this,t[Y],bi);Mo(this),t.finishInit&&t.finishInit(this);for(var q=0;q<Ja.length;++q)Ja[q](this);ri(this),S&&t.lineWrapping&&getComputedStyle(I.lineDiv).textRendering=="optimizelegibility"&&(I.lineDiv.style.textRendering="auto")}In.defaults=Os,In.optionHandlers=ha;function Ql(e){var t=e.display;xe(t.scroller,"mousedown",Jn(e,Cs)),F&&U<11?xe(t.scroller,"dblclick",Jn(e,function(ee){if(Xe(e,ee))return;var te=Qr(e,ee);if(!te||$a(e,ee)||Ur(e.display,ee))return;re(ee);var ye=e.findWordAt(te);aa(e.doc,ye.anchor,ye.head)})):xe(t.scroller,"dblclick",function(ee){return Xe(e,ee)||re(ee)}),xe(t.scroller,"contextmenu",function(ee){return ws(e,ee)}),xe(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||ws(e,ee)});var a,i={end:0};function c(){t.activeTouch&&(a=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function I(ee){if(ee.touches.length!=1)return!1;var te=ee.touches[0];return te.radiusX<=1&&te.radiusY<=1}function Y(ee,te){if(te.left==null)return!0;var ye=te.left-ee.left,Ce=te.top-ee.top;return ye*ye+Ce*Ce>20*20}xe(t.scroller,"touchstart",function(ee){if(!Xe(e,ee)&&!I(ee)&&!$a(e,ee)){t.input.ensurePolled(),clearTimeout(a);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-i.end<=300?i:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),xe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),xe(t.scroller,"touchend",function(ee){var te=t.activeTouch;if(te&&!Ur(t,ee)&&te.left!=null&&!te.moved&&new Date-te.start<300){var ye=e.coordsChar(t.activeTouch,"page"),Ce;!te.prev||Y(te,te.prev)?Ce=new wn(ye,ye):!te.prev.prev||Y(te,te.prev.prev)?Ce=e.findWordAt(ye):Ce=new wn(We(ye.line,0),b(e.doc,We(ye.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),re(ee)}c()}),xe(t.scroller,"touchcancel",c),xe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(_i(e,t.scroller.scrollTop),ei(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),xe(t.scroller,"mousewheel",function(ee){return Io(e,ee)}),xe(t.scroller,"DOMMouseScroll",function(ee){return Io(e,ee)}),xe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){Xe(e,ee)||me(ee)},over:function(ee){Xe(e,ee)||(_l(e,ee),me(ee))},start:function(ee){return Ol(e,ee)},drop:Jn(e,Al),leave:function(ee){Xe(e,ee)||us(e)}};var q=t.input.getField();xe(q,"keyup",function(ee){return Es.call(e,ee)}),xe(q,"keydown",Jn(e,bs)),xe(q,"keypress",Jn(e,xs)),xe(q,"focus",function(ee){return Ra(e,ee)}),xe(q,"blur",function(ee){return ui(e,ee)})}var Ja=[];In.defineInitHook=function(e){return Ja.push(e)};function Vi(e,t,a,i){var c=e.doc,I;a==null&&(a="add"),a=="smart"&&(c.mode.indent?I=vt(e,t).state:a="prev");var Y=e.options.tabSize,q=Dt(c,t),ee=$(q.text,null,Y);q.stateAfter&&(q.stateAfter=null);var te=q.text.match(/^\s*/)[0],ye;if(!i&&!/\S/.test(q.text))ye=0,a="not";else if(a=="smart"&&(ye=c.mode.indent(I,q.text.slice(te.length),q.text),ye==_e||ye>150)){if(!i)return;a="prev"}a=="prev"?t>c.first?ye=$(Dt(c,t-1).text,null,Y):ye=0:a=="add"?ye=ee+e.options.indentUnit:a=="subtract"?ye=ee-e.options.indentUnit:typeof a=="number"&&(ye=ee+a),ye=Math.max(0,ye);var Ce="",Fe=0;if(e.options.indentWithTabs)for(var Ie=Math.floor(ye/Y);Ie;--Ie)Fe+=Y,Ce+=" ";if(Fe<ye&&(Ce+=ue(ye-Fe)),Ce!=te)return mi(c,Ce,We(t,0),We(t,te.length),"+input"),q.stateAfter=null,!0;for(var it=0;it<c.sel.ranges.length;it++){var ht=c.sel.ranges[it];if(ht.head.line==t&&ht.head.ch<te.length){var St=We(t,te.length);Ka(c,it,new wn(St,St));break}}}var Rr=null;function fa(e){Rr=e}function Za(e,t,a,i,c){var I=e.doc;e.display.shift=!1,i||(i=I.sel);var Y=+new Date-200,q=c=="paste"||e.state.pasteIncoming>Y,ee=$e(t),te=null;if(q&&i.ranges.length>1)if(Rr&&Rr.text.join(`
|
|
`)==t){if(i.ranges.length%Rr.text.length==0){te=[];for(var ye=0;ye<Rr.text.length;ye++)te.push(I.splitLines(Rr.text[ye]))}}else ee.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(te=lt(ee,function(Mt){return[Mt]}));for(var Ce=e.curOp.updateInput,Fe=i.ranges.length-1;Fe>=0;Fe--){var Ie=i.ranges[Fe],it=Ie.from(),ht=Ie.to();Ie.empty()&&(a&&a>0?it=We(it.line,it.ch-a):e.state.overwrite&&!q?ht=We(ht.line,Math.min(Dt(I,ht.line).text.length,ht.ch+ke(ee).length)):q&&Rr&&Rr.lineWise&&Rr.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(it=ht=We(it.line,0)));var St={from:it,to:ht,text:te?te[Fe%te.length]:ee,origin:c||(q?"paste":e.state.cutIncoming>Y?"cut":"+input")};pi(e.doc,St),En(e,"inputRead",e,St)}t&&!q&&Ds(e,t),di(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function _s(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&br(t,function(){return Za(t,a,0,null,"paste")}),!0}function Ds(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var a=e.doc.sel,i=a.ranges.length-1;i>=0;i--){var c=a.ranges[i];if(c.head.ch>100||i&&a.ranges[i-1].head.line==c.head.line)continue;var I=e.getModeAt(c.head),Y=!1;if(I.electricChars){for(var q=0;q<I.electricChars.length;q++)if(t.indexOf(I.electricChars.charAt(q))>-1){Y=Vi(e,c.head.line,"smart");break}}else I.electricInput&&(I.electricInput.test(Dt(e.doc,c.head.line).text.slice(0,c.head.ch))&&(Y=Vi(e,c.head.line,"smart")));Y&&En(e,"electricInput",e,c.head.line)}}function Rs(e){for(var t=[],a=[],i=0;i<e.doc.sel.ranges.length;i++){var c=e.doc.sel.ranges[i].head.line,I={anchor:We(c,0),head:We(c+1,0)};a.push(I),t.push(e.getRange(I.anchor,I.head))}return{text:t,ranges:a}}function Ls(e,t,a,i){e.setAttribute("autocorrect",a?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=u("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=u("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),Ls(e),t}function ql(e){var t=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,c){var I=this.options,Y=I[i];if(I[i]==c&&i!="mode")return;I[i]=c,t.hasOwnProperty(i)&&Jn(this,t[i])(this,c,Y),Pe(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,c){this.state.keyMaps[c?"push":"unshift"](da(i))},removeKeyMap:function(i){for(var c=this.state.keyMaps,I=0;I<c.length;++I)if(c[I]==i||c[I].name==i)return c.splice(I,1),!0},addOverlay:or(function(i,c){var I=i.token?i:e.getMode(this.options,i);if(I.startState)throw new Error("Overlays may not be stateful.");ot(this.state.overlays,{mode:I,modeSpec:i,opaque:c&&c.opaque,priority:c&&c.priority||0},function(Y){return Y.priority}),this.state.modeGen++,ur(this)}),removeOverlay:or(function(i){for(var c=this.state.overlays,I=0;I<c.length;++I){var Y=c[I].modeSpec;if(Y==i||typeof i=="string"&&Y.name==i){c.splice(I,1),this.state.modeGen++,ur(this);return}}}),indentLine:or(function(i,c,I){typeof c!="string"&&typeof c!="number"&&(c==null?c=this.options.smartIndent?"smart":"prev":c=c?"add":"subtract"),nn(this.doc,i)&&Vi(this,i,c,I)}),indentSelection:or(function(i){for(var c=this.doc.sel.ranges,I=-1,Y=0;Y<c.length;Y++){var q=c[Y];if(q.empty())q.head.line>I&&(Vi(this,q.head.line,i,!0),I=q.head.line,Y==this.doc.sel.primIndex&&di(this));else{var ee=q.from(),te=q.to(),ye=Math.max(I,ee.line);I=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var Ce=ye;Ce<I;++Ce)Vi(this,Ce,i);var Fe=this.doc.sel.ranges;ee.ch==0&&c.length==Fe.length&&Fe[Y].from().ch>0&&Ka(this.doc,Y,new wn(ee,Fe[Y].to()),Se)}}}),getTokenAt:function(i,c){return yn(this,i,c)},getLineTokens:function(i,c){return yn(this,We(i),c,!0)},getTokenTypeAt:function(i){i=b(this.doc,i);var c=et(this,Dt(this.doc,i.line)),I=0,Y=(c.length-1)/2,q=i.ch,ee;if(q==0)ee=c[2];else for(;;){var te=I+Y>>1;if((te?c[te*2-1]:0)>=q)Y=te;else if(c[te*2+1]<q)I=te+1;else{ee=c[te*2+2];break}}var ye=ee?ee.indexOf("overlay "):-1;return ye<0?ee:ye==0?null:ee.slice(0,ye-1)},getModeAt:function(i){var c=this.doc.mode;return c.innerMode?e.innerMode(c,this.getTokenAt(i).state).mode:c},getHelper:function(i,c){return this.getHelpers(i,c)[0]},getHelpers:function(i,c){var I=[];if(!a.hasOwnProperty(c))return I;var Y=a[c],q=this.getModeAt(i);if(typeof q[c]=="string")Y[q[c]]&&I.push(Y[q[c]]);else if(q[c])for(var ee=0;ee<q[c].length;ee++){var te=Y[q[c][ee]];te&&I.push(te)}else q.helperType&&Y[q.helperType]?I.push(Y[q.helperType]):Y[q.name]&&I.push(Y[q.name]);for(var ye=0;ye<Y._global.length;ye++){var Ce=Y._global[ye];Ce.pred(q,this)&&ae(I,Ce.val)==-1&&I.push(Ce.val)}return I},getStateAfter:function(i,c){var I=this.doc;return i=z(I,i==null?I.first+I.size-1:i),vt(this,i+1,c).state},cursorCoords:function(i,c){var I,Y=this.doc.sel.primary();return i==null?I=Y.head:typeof i=="object"?I=b(this.doc,i):I=i?Y.from():Y.to(),_r(this,I,c||"page")},charCoords:function(i,c){return Ca(this,b(this.doc,i),c||"page")},coordsChar:function(i,c){return i=po(this,i,c||"page"),Ta(this,i.left,i.top)},lineAtHeight:function(i,c){return i=po(this,{top:i,left:0},c||"page").top,Zt(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,c,I){var Y=!1,q;if(typeof i=="number"){var ee=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>ee&&(i=ee,Y=!0),q=Dt(this.doc,i)}else q=i;return $i(this,q,{top:0,left:0},c||"page",I||Y).top+(Y?this.doc.height-lr(q):0)},defaultTextHeight:function(){return si(this.display)},defaultCharWidth:function(){return li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,c,I,Y,q){var ee=this.display;i=_r(this,b(this.doc,i));var te=i.bottom,ye=i.left;if(c.style.position="absolute",c.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(c),ee.sizer.appendChild(c),Y=="over")te=i.top;else if(Y=="above"||Y=="near"){var Ce=Math.max(ee.wrapper.clientHeight,this.doc.height),Fe=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(Y=="above"||i.bottom+c.offsetHeight>Ce)&&i.top>c.offsetHeight?te=i.top-c.offsetHeight:i.bottom+c.offsetHeight<=Ce&&(te=i.bottom),ye+c.offsetWidth>Fe&&(ye=Fe-c.offsetWidth)}c.style.top=te+"px",c.style.left=c.style.right="",q=="right"?(ye=ee.sizer.clientWidth-c.offsetWidth,c.style.right="0px"):(q=="left"?ye=0:q=="middle"&&(ye=(ee.sizer.clientWidth-c.offsetWidth)/2),c.style.left=ye+"px"),I&&Js(this,{left:ye,top:te,right:ye+c.offsetWidth,bottom:te+c.offsetHeight})},triggerOnKeyDown:or(bs),triggerOnKeyPress:or(xs),triggerOnKeyUp:Es,triggerOnMouseDown:or(Cs),execCommand:function(i){if(Hi.hasOwnProperty(i))return Hi[i].call(null,this)},triggerElectric:or(function(i){Ds(this,i)}),findPosH:function(i,c,I,Y){var q=1;c<0&&(q=-1,c=-c);for(var ee=b(this.doc,i),te=0;te<c&&!(ee=Qa(this.doc,ee,q,I,Y),ee.hitSide);++te);return ee},moveH:or(function(i,c){var I=this;this.extendSelectionsBy(function(Y){return I.display.shift||I.doc.extend||Y.empty()?Qa(I.doc,Y.head,i,c,I.options.rtlMoveVisually):i<0?Y.from():Y.to()},Me)}),deleteH:or(function(i,c){var I=this.doc.sel,Y=this.doc;I.somethingSelected()?Y.replaceSelection("",null,"+delete"):yi(this,function(q){var ee=Qa(Y,q.head,i,c,!1);return i<0?{from:ee,to:q.head}:{from:q.head,to:ee}})}),findPosV:function(i,c,I,Y){var q=1,ee=Y;c<0&&(q=-1,c=-c);for(var te=b(this.doc,i),ye=0;ye<c;++ye){var Ce=_r(this,te,"div");if(ee==null?ee=Ce.left:Ce.left=ee,te=Ps(this,Ce,q,I),te.hitSide)break}return te},moveV:or(function(i,c){var I=this,Y=this.doc,q=[],ee=!this.display.shift&&!Y.extend&&Y.sel.somethingSelected();if(Y.extendSelectionsBy(function(ye){if(ee)return i<0?ye.from():ye.to();var Ce=_r(I,ye.head,"div");ye.goalColumn!=null&&(Ce.left=ye.goalColumn),q.push(Ce.left);var Fe=Ps(I,Ce,i,c);return c=="page"&&ye==Y.sel.primary()&&Ma(I,Ca(I,Fe,"div").top-Ce.top),Fe},Me),q.length)for(var te=0;te<Y.sel.ranges.length;te++)Y.sel.ranges[te].goalColumn=q[te]}),findWordAt:function(i){var c=this.doc,I=Dt(c,i.line).text,Y=i.ch,q=i.ch;if(I){var ee=this.getHelper(i,"wordChars");(i.sticky=="before"||q==I.length)&&Y?--Y:++q;for(var te=I.charAt(Y),ye=ze(te,ee)?function(Ce){return ze(Ce,ee)}:/\s/.test(te)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!ze(Ce)};Y>0&&ye(I.charAt(Y-1));)--Y;for(;q<I.length&&ye(I.charAt(q));)++q}return new wn(We(i.line,Y),We(i.line,q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):g(this.display.cursorDiv,"CodeMirror-overwrite"),Pe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:or(function(i,c){Oi(this,i,c)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-Pr(this)-this.display.barHeight,width:i.scrollWidth-Pr(this)-this.display.barWidth,clientHeight:ba(this),clientWidth:Jr(this)}},scrollIntoView:or(function(i,c){i==null?(i={from:this.doc.sel.primary().head,to:null},c==null&&(c=this.options.cursorScrollMargin)):typeof i=="number"?i={from:We(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=c||0,i.from.line!=null?Zs(this,i):wo(this,i.from,i.to,i.margin)}),setSize:or(function(i,c){var I=this,Y=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};i!=null&&(this.display.wrapper.style.width=Y(i)),c!=null&&(this.display.wrapper.style.height=Y(c)),this.options.lineWrapping&&co(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(ee){if(ee.widgets){for(var te=0;te<ee.widgets.length;te++)if(ee.widgets[te].noHScroll){Hr(I,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(i){return br(this,i)},startOperation:function(){return ni(this)},endOperation:function(){return ri(this)},refresh:or(function(){var i=this.display.cachedTextHeight;ur(this),this.curOp.forceUpdate=!0,wi(this),Oi(this,this.doc.scrollLeft,this.doc.scrollTop),Ia(this.display),(i==null||Math.abs(i-si(this.display))>.5||this.options.lineWrapping)&&_a(this),Pe(this,"refresh",this)}),swapDoc:or(function(i){var c=this.doc;return c.cm=null,this.state.selectingText&&this.state.selectingText(),Fo(this,i),wi(this),this.display.input.reset(),Oi(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,En(this,"swapDoc",this,c),c}),phrase:function(i){var c=this.options.phrases;return c&&Object.prototype.hasOwnProperty.call(c,i)?c[i]:i},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}},he(e),e.registerHelper=function(i,c,I){a.hasOwnProperty(i)||(a[i]=e[i]={_global:[]}),a[i][c]=I},e.registerGlobalHelper=function(i,c,I,Y){e.registerHelper(i,c,Y),a[i]._global.push({pred:I,val:Y})}}function Qa(e,t,a,i,c){var I=t,Y=a,q=Dt(e,t.line),ee=c&&e.direction=="rtl"?-a:a;function te(){var Ft=t.line+ee;return Ft<e.first||Ft>=e.first+e.size?!1:(t=new We(Ft,t.ch,t.sticky),q=Dt(e,Ft))}function ye(Ft){var Pt;if(i=="codepoint"){var Ht=q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(Ht)?Pt=null:Pt=new We(t.line,Math.max(0,Math.min(q.text.length,t.ch+a*(Ht>=55296&&Ht<56320?2:1))),-a)}else c?Pt=kl(e.cm,q,t,a):Pt=Ga(q,t,a);if(Pt==null)if(!Ft&&te())t=Va(c,e.cm,q,t.line,ee);else return!1;else t=Pt;return!0}if(i=="char"||i=="codepoint")ye();else if(i=="column")ye(!0);else if(i=="word"||i=="group")for(var Ce=null,Fe=i=="group",Ie=e.cm&&e.cm.getHelper(t,"wordChars"),it=!0;!(a<0&&!ye(!it));it=!1){var ht=q.text.charAt(t.ch)||`
|
|
`,St=ze(ht,Ie)?"w":Fe&&ht==`
|
|
`?"n":!Fe||/\s/.test(ht)?null:"p";if(Fe&&!it&&!St&&(St="s"),Ce&&Ce!=St){a<0&&(a=1,ye(),t.sticky="after");break}if(St&&(Ce=St),a>0&&!ye(!it))break}var Mt=sa(e,t,I,Y,!0);return Kt(I,Mt)&&(Mt.hitSide=!0),Mt}function Ps(e,t,a,i){var c=e.doc,I=t.left,Y;if(i=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(q-.5*si(e.display),3);Y=(a>0?t.bottom:t.top)+a*ee}else i=="line"&&(Y=a>0?t.bottom+3:t.top-3);for(var te;!(te=Ta(e,I,Y),!te.outside);){if(a<0?Y<=0:Y>=c.height){te.hitSide=!0;break}Y+=a*5}return te}var _n=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_n.prototype.init=function(e){var t=this,a=this,i=a.cm,c=a.div=e.lineDiv;Ls(c,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function I(q){for(var ee=q.target;ee;ee=ee.parentNode){if(ee==c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}xe(c,"paste",function(q){if(!I(q)||Xe(i,q)||_s(q,i))return;U<=11&&setTimeout(Jn(i,function(){return t.updateFromDOM()}),20)}),xe(c,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),xe(c,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),xe(c,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),xe(c,"touchstart",function(){return a.forceCompositionEnd()}),xe(c,"input",function(){t.composing||t.readFromDOMSoon()});function Y(q){if(!I(q)||Xe(i,q))return;if(i.somethingSelected())fa({lineWise:!1,text:i.getSelections()}),q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ee=Rs(i);fa({lineWise:!0,text:ee.text}),q.type=="cut"&&i.operation(function(){i.setSelections(ee.ranges,0,Se),i.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var te=Rr.text.join(`
|
|
`);if(q.clipboardData.setData("Text",te),q.clipboardData.getData("Text")==te){q.preventDefault();return}}var ye=Ms(),Ce=ye.firstChild;i.display.lineSpace.insertBefore(ye,i.display.lineSpace.firstChild),Ce.value=Rr.text.join(`
|
|
`);var Fe=document.activeElement;Z(Ce),setTimeout(function(){i.display.lineSpace.removeChild(ye),Fe.focus(),Fe==c&&a.showPrimarySelection()},50)}xe(c,"copy",Y),xe(c,"cut",Y)},_n.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_n.prototype.prepareSelection=function(){var e=Eo(this.cm,!1);return e.focus=document.activeElement==this.div,e},_n.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},_n.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_n.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,a=t.doc.sel.primary(),i=a.from(),c=a.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||c.line<t.display.viewFrom){e.removeAllRanges();return}var I=pa(t,e.anchorNode,e.anchorOffset),Y=pa(t,e.focusNode,e.focusOffset);if(I&&!I.bad&&Y&&!Y.bad&&nt(_t(I,Y),i)==0&&nt(Ut(I,Y),c)==0)return;var q=t.display.view,ee=i.line>=t.display.viewFrom&&ks(t,i)||{node:q[0].measure.map[2],offset:0},te=c.line<t.display.viewTo&&ks(t,c);if(!te){var ye=q[q.length-1].measure,Ce=ye.maps?ye.maps[ye.maps.length-1]:ye.map;te={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!ee||!te){e.removeAllRanges();return}var Fe=e.rangeCount&&e.getRangeAt(0),Ie;try{Ie=T(ee.node,ee.offset,te.offset,te.node)}catch(it){}Ie&&(!M&&t.state.focused?(e.collapse(ee.node,ee.offset),Ie.collapsed||(e.removeAllRanges(),e.addRange(Ie))):(e.removeAllRanges(),e.addRange(Ie)),Fe&&e.anchorNode==null?e.addRange(Fe):M&&this.startGracePeriod()),this.rememberSelection()},_n.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)},_n.prototype.showMultipleSelections=function(e){s(this.cm.display.cursorDiv,e.cursors),s(this.cm.display.selectionDiv,e.selection)},_n.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},_n.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},_n.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_n.prototype.blur=function(){this.div.blur()},_n.prototype.getField=function(){return this.div},_n.prototype.supportsTouch=function(){return!0},_n.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():br(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)},_n.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},_n.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(n&&d&&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 a=pa(t,e.anchorNode,e.anchorOffset),i=pa(t,e.focusNode,e.focusOffset);a&&i&&br(t,function(){rr(t.doc,zr(a,i),Se),(a.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},_n.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,a=e.doc.sel.primary(),i=a.from(),c=a.to();if(i.ch==0&&i.line>e.firstLine()&&(i=We(i.line-1,Dt(e.doc,i.line-1).length)),c.ch==Dt(e.doc,c.line).text.length&&c.line<e.lastLine()&&(c=We(c.line+1,0)),i.line<t.viewFrom||c.line>t.viewTo-1)return!1;var I,Y,q;i.line==t.viewFrom||(I=qr(e,i.line))==0?(Y=It(t.view[0].line),q=t.view[0].node):(Y=It(t.view[I].line),q=t.view[I-1].node.nextSibling);var ee=qr(e,c.line),te,ye;if(ee==t.view.length-1?(te=t.viewTo-1,ye=t.lineDiv.lastChild):(te=It(t.view[ee+1].line)-1,ye=t.view[ee+1].node.previousSibling),!q)return!1;for(var Ce=e.doc.splitLines(tu(e,q,ye,Y,te)),Fe=Ke(e.doc,We(Y,0),We(te,Dt(e.doc,te).text.length));Ce.length>1&&Fe.length>1;)if(ke(Ce)==ke(Fe))Ce.pop(),Fe.pop(),te--;else if(Ce[0]==Fe[0])Ce.shift(),Fe.shift(),Y++;else break;for(var Ie=0,it=0,ht=Ce[0],St=Fe[0],Mt=Math.min(ht.length,St.length);Ie<Mt&&ht.charCodeAt(Ie)==St.charCodeAt(Ie);)++Ie;for(var Ft=ke(Ce),Pt=ke(Fe),Ht=Math.min(Ft.length-(Ce.length==1?Ie:0),Pt.length-(Fe.length==1?Ie:0));it<Ht&&Ft.charCodeAt(Ft.length-it-1)==Pt.charCodeAt(Pt.length-it-1);)++it;if(Ce.length==1&&Fe.length==1&&Y==i.line)for(;Ie&&Ie>i.ch&&Ft.charCodeAt(Ft.length-it-1)==Pt.charCodeAt(Pt.length-it-1);)Ie--,it++;Ce[Ce.length-1]=Ft.slice(0,Ft.length-it).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(Ie).replace(/\u200b+$/,"");var Qt=We(Y,Ie),Gt=We(te,Fe.length?ke(Fe).length-it:0);if(Ce.length>1||Ce[0]||nt(Qt,Gt))return mi(e.doc,Ce,Qt,Gt,"+input"),!0},_n.prototype.ensurePolled=function(){this.forceCompositionEnd()},_n.prototype.reset=function(){this.forceCompositionEnd()},_n.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},_n.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)},_n.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&br(this.cm,function(){return ur(e.cm)})},_n.prototype.setUneditable=function(e){e.contentEditable="false"},_n.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Jn(this.cm,Za)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},_n.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},_n.prototype.onContextMenu=function(){},_n.prototype.resetPosition=function(){},_n.prototype.needsContentAttribute=!0;function ks(e,t){var a=Ea(e,t.line);if(!a||a.hidden)return null;var i=Dt(e.doc,t.line),c=ao(a,i,t.line),I=At(i,e.doc.direction),Y="left";if(I){var q=yt(I,t.ch);Y=q%2?"right":"left"}var ee=lo(c.map,t.ch,Y);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ei(e,t){return t&&(e.bad=!0),e}function tu(e,t,a,i,c){var I="",Y=!1,q=e.doc.lineSeparator(),ee=!1;function te(Ie){return function(it){return it.id==Ie}}function ye(){Y&&(I+=q,ee&&(I+=q),Y=ee=!1)}function Ce(Ie){Ie&&(ye(),I+=Ie)}function Fe(Ie){if(Ie.nodeType==1){var it=Ie.getAttribute("cm-text");if(it){Ce(it);return}var ht=Ie.getAttribute("cm-marker"),St;if(ht){var Mt=e.findMarks(We(i,0),We(c+1,0),te(+ht));Mt.length&&(St=Mt[0].find(0))&&Ce(Ke(e.doc,St.from,St.to).join(q));return}if(Ie.getAttribute("contenteditable")=="false")return;var Ft=/^(pre|div|p|li|table|br)$/i.test(Ie.nodeName);if(!/^br$/i.test(Ie.nodeName)&&Ie.textContent.length==0)return;Ft&&ye();for(var Pt=0;Pt<Ie.childNodes.length;Pt++)Fe(Ie.childNodes[Pt]);/^(pre|p)$/i.test(Ie.nodeName)&&(ee=!0),Ft&&(Y=!0)}else Ie.nodeType==3&&Ce(Ie.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Fe(t),t==a);)t=t.nextSibling,ee=!1;return I}function pa(e,t,a){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[a],!i)return Ei(e.clipPos(We(e.display.viewTo-1)),!0);t=null,a=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var c=0;c<e.display.view.length;c++){var I=e.display.view[c];if(I.node==i)return nu(I,t,a)}}function nu(e,t,a){var i=e.text.firstChild,c=!1;if(!t||!w(i,t))return Ei(We(It(e.line),0),!0);if(t==i&&(c=!0,t=i.childNodes[a],a=0,!t)){var I=e.rest?ke(e.rest):e.line;return Ei(We(It(I),I.text.length),c)}var Y=t.nodeType==3?t:null,q=t;for(!Y&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(Y=t.firstChild,a&&(a=Y.nodeValue.length));q.parentNode!=i;)q=q.parentNode;var ee=e.measure,te=ee.maps;function ye(St,Mt,Ft){for(var Pt=-1;Pt<(te?te.length:0);Pt++)for(var Ht=Pt<0?ee.map:te[Pt],Qt=0;Qt<Ht.length;Qt+=3){var Gt=Ht[Qt+2];if(Gt==St||Gt==Mt){var cn=It(Pt<0?e.line:e.rest[Pt]),Ln=Ht[Qt]+Ft;return(Ft<0||Gt!=St)&&(Ln=Ht[Qt+(Ft?1:0)]),We(cn,Ln)}}}var Ce=ye(Y,q,a);if(Ce)return Ei(Ce,c);for(var Fe=q.nextSibling,Ie=Y?Y.nodeValue.length-a:0;Fe;Fe=Fe.nextSibling){if(Ce=ye(Fe,Fe.firstChild,0),Ce)return Ei(We(Ce.line,Ce.ch-Ie),c);Ie+=Fe.textContent.length}for(var it=q.previousSibling,ht=a;it;it=it.previousSibling){if(Ce=ye(it,it.firstChild,-1),Ce)return Ei(We(Ce.line,Ce.ch+ht),c);ht+=it.textContent.length}}var Wn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};Wn.prototype.init=function(e){var t=this,a=this,i=this.cm;this.createField(e);var c=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(c.style.width="0px"),xe(c,"input",function(){F&&U>=9&&t.hasSelection&&(t.hasSelection=null),a.poll()}),xe(c,"paste",function(Y){if(Xe(i,Y)||_s(Y,i))return;i.state.pasteIncoming=+new Date,a.fastPoll()});function I(Y){if(Xe(i,Y))return;if(i.somethingSelected())fa({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var q=Rs(i);fa({lineWise:!0,text:q.text}),Y.type=="cut"?i.setSelections(q.ranges,null,Se):(a.prevInput="",c.value=q.text.join(`
|
|
`),Z(c))}else return;Y.type=="cut"&&(i.state.cutIncoming=+new Date)}xe(c,"cut",I),xe(c,"copy",I),xe(e.scroller,"paste",function(Y){if(Ur(e,Y)||Xe(i,Y))return;if(!c.dispatchEvent){i.state.pasteIncoming=+new Date,a.focus();return}var q=new Event("paste");q.clipboardData=Y.clipboardData,c.dispatchEvent(q)}),xe(e.lineSpace,"selectstart",function(Y){Ur(e,Y)||re(Y)}),xe(c,"compositionstart",function(){var Y=i.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:Y,range:i.markText(Y,i.getCursor("to"),{className:"CodeMirror-composing"})}}),xe(c,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},Wn.prototype.createField=function(e){this.wrapper=Ms(),this.textarea=this.wrapper.firstChild},Wn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,a=e.doc,i=Eo(e);if(e.options.moveInputWithCursor){var c=_r(e,a.sel.primary().head,"div"),I=t.wrapper.getBoundingClientRect(),Y=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,c.top+Y.top-I.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,c.left+Y.left-I.left))}return i},Wn.prototype.showSelection=function(e){var t=this.cm,a=t.display;s(a.cursorDiv,e.cursors),s(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var a=t.getSelection();this.textarea.value=a,t.state.focused&&Z(this.textarea),F&&U>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",F&&U>=9&&(this.hasSelection=null))},Wn.prototype.getField=function(){return this.textarea},Wn.prototype.supportsTouch=function(){return!1},Wn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wn.prototype.blur=function(){this.textarea.blur()},Wn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wn.prototype.receivedFocus=function(){this.slowPoll()},Wn.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()})},Wn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function a(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,a)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,a)},Wn.prototype.poll=function(){var e=this,t=this.cm,a=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ve(a)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var c=a.value;if(c==i&&!t.somethingSelected())return!1;if(F&&U>=9&&this.hasSelection===c||o&&/[\uf700-\uf7ff]/.test(c))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var I=c.charCodeAt(0);if(I==8203&&!i&&(i="\u200B"),I==8666)return this.reset(),this.cm.execCommand("undo")}for(var Y=0,q=Math.min(i.length,c.length);Y<q&&i.charCodeAt(Y)==c.charCodeAt(Y);)++Y;return br(t,function(){Za(t,c.slice(Y),i.length-Y,null,e.composing?"*compose":null),c.length>1e3||c.indexOf(`
|
|
`)>-1?a.value=e.prevInput="":e.prevInput=c,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Wn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wn.prototype.onKeyPress=function(){F&&U>=9&&(this.hasSelection=null),this.fastPoll()},Wn.prototype.onContextMenu=function(e){var t=this,a=t.cm,i=a.display,c=t.textarea;t.contextMenuPending&&t.contextMenuPending();var I=Qr(a,e),Y=i.scroller.scrollTop;if(!I||v)return;var q=a.options.resetSelectionOnContextMenu;q&&a.doc.sel.contains(I)==-1&&Jn(a,rr)(a.doc,zr(I),Se);var ee=c.style.cssText,te=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",c.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.left-5)+`px;
|
|
z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;S&&(Ce=window.scrollY),i.input.focus(),S&&window.scrollTo(null,Ce),i.input.reset(),a.somethingSelected()||(c.value=t.prevInput=" "),t.contextMenuPending=Ie,i.selForContextMenu=a.doc.sel,clearTimeout(i.detectingSelectAll);function Fe(){if(c.selectionStart!=null){var ht=a.somethingSelected(),St="\u200B"+(ht?c.value:"");c.value="\u21DA",c.value=St,t.prevInput=ht?"":"\u200B",c.selectionStart=1,c.selectionEnd=St.length,i.selForContextMenu=a.doc.sel}}function Ie(){if(t.contextMenuPending!=Ie)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,c.style.cssText=ee,F&&U<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=Y),c.selectionStart!=null){(!F||F&&U<9)&&Fe();var ht=0,St=function(){i.selForContextMenu==a.doc.sel&&c.selectionStart==0&&c.selectionEnd>0&&t.prevInput=="\u200B"?Jn(a,Qo)(a):ht++<10?i.detectingSelectAll=setTimeout(St,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(St,200)}}if(F&&U>=9&&Fe(),R){me(e);var it=function(){Ze(window,"mouseup",it),setTimeout(Ie,20)};xe(window,"mouseup",it)}else setTimeout(Ie,50)},Wn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Wn.prototype.setUneditable=function(){},Wn.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?B(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 a=P();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function i(){e.value=q.getValue()}var c;if(e.form&&(xe(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var I=e.form;c=I.submit;try{var Y=I.submit=function(){i(),I.submit=c,I.submit(),I.submit=Y}}catch(ee){}}t.finishInit=function(ee){ee.save=i,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,i(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ze(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=c))}},e.style.display="none";var q=In(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return q}function iu(e){e.off=Ze,e.on=xe,e.wheelEventPixels=cl,e.Doc=dr,e.splitLines=$e,e.countColumn=$,e.findColumn=Le,e.isWordChar=Oe,e.Pass=_e,e.signal=Pe,e.Line=un,e.changeEnd=Gr,e.scrollbarModel=_o,e.Pos=We,e.cmpPos=nt,e.modes=He,e.mimeModes=je,e.resolveMode=Re,e.getMode=Ge,e.modeExtensions=Ue,e.extendMode=mt,e.copyState=wt,e.startState=en,e.innerMode=qt,e.commands=Hi,e.keyMap=jr,e.keyName=ps,e.isModifierKey=hs,e.lookupKey=vi,e.normalizeKeyMap=Pl,e.StringStream=Vt,e.SharedTextMarker=Fi,e.TextMarker=Xr,e.LineWidget=ji,e.e_preventDefault=re,e.e_stopPropagation=ie,e.e_stop=me,e.addClass=j,e.contains=w,e.rmClass=g,e.keyNames=Yr}$l(In),ql(In);var au="iter insert remove copy getEditor constructor".split(" ");for(var ma in dr.prototype)dr.prototype.hasOwnProperty(ma)&&ae(au,ma)<0&&(In.prototype[ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(dr.prototype[ma]));return he(dr),In.inputStyles={textarea:Wn,contenteditable:_n},In.defineMode=function(e){!In.defaults.mode&&e!="null"&&(In.defaults.mode=e),pt.apply(this,arguments)},In.defineMIME=gt,In.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),In.defineMIME("text/plain","null"),In.defineExtension=function(e,t){In.prototype[e]=t},In.defineDocExtension=function(e,t){dr.prototype[e]=t},In.fromTextArea=ru,iu(In),In.version="5.58.2",In})},WaYH:function(Ye,se,k){"use strict";var Q=k("rePB"),H=k("Ff2n"),M=k("VTBJ"),W=k("1OyB"),N=k("vuIU"),A=k("JX7q"),F=k("Ji7U"),U=k("LK+K"),S=k("q1tI"),L=k("TSYQ"),d=k.n(L),v=k("sboe"),C=k("OZM5"),p=function(R){var O=R.prefixCls,g=R.level,m=R.isStart,s=R.isEnd;if(!g)return null;for(var u="".concat(O,"-indent-unit"),_=[],T=0;T<g;T+=1){var w;_.push(S.createElement("span",{key:T,className:d()(u,(w={},Object(Q.a)(w,"".concat(u,"-start"),m[T+1]),Object(Q.a)(w,"".concat(u,"-end"),s[T+1]),Object(Q.a)(w,"".concat(u,"-end-first-level"),!T&&s[0]),w))}))}return S.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},_)},h=p,f=k("815F"),n="open",r="close",o="---",l=function(y){Object(F.a)(O,y);var R=Object(U.a)(O);function O(){var g;return Object(W.a)(this,O),g=R.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(m){var s=g.props.context.onNodeClick;s(m,Object(f.b)(g.props)),g.isSelectable()?g.onSelect(m):g.onCheck(m)},g.onSelectorDoubleClick=function(m){var s=g.props.context.onNodeDoubleClick;s(m,Object(f.b)(g.props))},g.onSelect=function(m){if(g.isDisabled())return;var s=g.props.context.onNodeSelect;m.preventDefault(),s(m,Object(f.b)(g.props))},g.onCheck=function(m){if(g.isDisabled())return;var s=g.props,u=s.disableCheckbox,_=s.checked,T=g.props.context.onNodeCheck;if(!g.isCheckable()||u)return;m.preventDefault();var w=!_;T(m,Object(f.b)(g.props),w)},g.onMouseEnter=function(m){var s=g.props.context.onNodeMouseEnter;s(m,Object(f.b)(g.props))},g.onMouseLeave=function(m){var s=g.props.context.onNodeMouseLeave;s(m,Object(f.b)(g.props))},g.onContextMenu=function(m){var s=g.props.context.onNodeContextMenu;s(m,Object(f.b)(g.props))},g.onDragStart=function(m){var s=g.props.context.onNodeDragStart;m.stopPropagation(),g.setState({dragNodeHighlight:!0}),s(m,Object(A.a)(g));try{m.dataTransfer.setData("text/plain","")}catch(u){}},g.onDragEnter=function(m){var s=g.props.context.onNodeDragEnter;m.preventDefault(),m.stopPropagation(),s(m,Object(A.a)(g))},g.onDragOver=function(m){var s=g.props.context.onNodeDragOver;m.preventDefault(),m.stopPropagation(),s(m,Object(A.a)(g))},g.onDragLeave=function(m){var s=g.props.context.onNodeDragLeave;m.stopPropagation(),s(m,Object(A.a)(g))},g.onDragEnd=function(m){var s=g.props.context.onNodeDragEnd;m.stopPropagation(),g.setState({dragNodeHighlight:!1}),s(m,Object(A.a)(g))},g.onDrop=function(m){var s=g.props.context.onNodeDrop;m.preventDefault(),m.stopPropagation(),g.setState({dragNodeHighlight:!1}),s(m,Object(A.a)(g))},g.onExpand=function(m){var s=g.props.context.onNodeExpand;s(m,Object(f.b)(g.props))},g.setSelectHandle=function(m){g.selectHandle=m},g.getNodeState=function(){var m=g.props.expanded;return g.isLeaf()?null:m?n:r},g.hasChildren=function(){var m=g.props.eventKey,s=g.props.context.keyEntities,u=s[m]||{},_=u.children;return!!(_||[]).length},g.isLeaf=function(){var m=g.props,s=m.isLeaf,u=m.loaded,_=g.props.context.loadData,T=g.hasChildren();return s===!1?!1:s||!_&&!T||_&&u&&!T},g.isDisabled=function(){var m=g.props.disabled,s=g.props.context.disabled;return!!(s||m)},g.isCheckable=function(){var m=g.props.checkable,s=g.props.context.checkable;return!s||m===!1?!1:s},g.syncLoadData=function(m){var s=m.expanded,u=m.loading,_=m.loaded,T=g.props.context,w=T.loadData,P=T.onNodeLoad;if(u)return;w&&s&&!g.isLeaf()&&(!g.hasChildren()&&!_&&P(Object(f.b)(g.props)))},g.renderSwitcher=function(){var m=g.props,s=m.expanded,u=m.switcherIcon,_=g.props.context,T=_.prefixCls,w=_.switcherIcon,P=u||w;if(g.isLeaf())return S.createElement("span",{className:d()("".concat(T,"-switcher"),"".concat(T,"-switcher-noop"))},typeof P=="function"?P(Object(M.a)(Object(M.a)({},g.props),{},{isLeaf:!0})):P);var j=d()("".concat(T,"-switcher"),"".concat(T,"-switcher_").concat(s?n:r));return S.createElement("span",{onClick:g.onExpand,className:j},typeof P=="function"?P(Object(M.a)(Object(M.a)({},g.props),{},{isLeaf:!1})):P)},g.renderCheckbox=function(){var m=g.props,s=m.checked,u=m.halfChecked,_=m.disableCheckbox,T=g.props.context.prefixCls,w=g.isDisabled(),P=g.isCheckable();if(!P)return null;var j=typeof P!="boolean"?P:null;return S.createElement("span",{className:d()("".concat(T,"-checkbox"),s&&"".concat(T,"-checkbox-checked"),!s&&u&&"".concat(T,"-checkbox-indeterminate"),(w||_)&&"".concat(T,"-checkbox-disabled")),onClick:g.onCheck},j)},g.renderIcon=function(){var m=g.props.loading,s=g.props.context.prefixCls;return S.createElement("span",{className:d()("".concat(s,"-iconEle"),"".concat(s,"-icon__").concat(g.getNodeState()||"docu"),m&&"".concat(s,"-icon_loading"))})},g.renderSelector=function(){var m=g.state.dragNodeHighlight,s=g.props,u=s.title,_=s.selected,T=s.icon,w=s.loading,P=s.data,j=g.props.context,K=j.prefixCls,Z=j.showIcon,G=j.icon,B=j.draggable,$=j.loadData,ne=j.titleRender,ae=g.isDisabled(),fe="".concat(K,"-node-content-wrapper"),_e;if(Z){var Se=T||G;_e=Se?S.createElement("span",{className:d()("".concat(K,"-iconEle"),"".concat(K,"-icon__customize"))},typeof Se=="function"?Se(g.props):Se):g.renderIcon()}else $&&w&&(_e=g.renderIcon());var we;typeof u=="function"?we=u(P):ne?we=ne(P):we=u;var Me=S.createElement("span",{className:"".concat(K,"-title")},we);return S.createElement("span",{ref:g.setSelectHandle,title:typeof u=="string"?u:"",className:d()("".concat(fe),"".concat(fe,"-").concat(g.getNodeState()||"normal"),!ae&&(_||m)&&"".concat(K,"-node-selected"),!ae&&B&&"draggable"),draggable:!ae&&B||void 0,"aria-grabbed":!ae&&B||void 0,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onContextMenu:g.onContextMenu,onClick:g.onSelectorClick,onDoubleClick:g.onSelectorDoubleClick,onDragStart:B?g.onDragStart:void 0},_e,Me)},g}return Object(N.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var m=this.props.selectable,s=this.props.context.selectable;return typeof m=="boolean"?m:s}},{key:"render",value:function(){var m,s=this.props,u=s.eventKey,_=s.className,T=s.style,w=s.dragOver,P=s.dragOverGapTop,j=s.dragOverGapBottom,K=s.isLeaf,Z=s.isStart,G=s.isEnd,B=s.expanded,$=s.selected,ne=s.checked,ae=s.halfChecked,fe=s.loading,_e=s.domRef,Se=s.active,we=s.onMouseMove,Me=Object(H.a)(s,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Le=this.props.context,ge=Le.prefixCls,ue=Le.filterTreeNode,ke=Le.draggable,lt=Le.keyEntities,ot=this.isDisabled(),st=Object(C.f)(Me),ce=lt[u]||{},pe=ce.level,Oe=G[G.length-1];return S.createElement("div",Object.assign({ref:_e,className:d()(_,"".concat(ge,"-treenode"),(m={},Object(Q.a)(m,"".concat(ge,"-treenode-disabled"),ot),Object(Q.a)(m,"".concat(ge,"-treenode-switcher-").concat(B?"open":"close"),!K),Object(Q.a)(m,"".concat(ge,"-treenode-checkbox-checked"),ne),Object(Q.a)(m,"".concat(ge,"-treenode-checkbox-indeterminate"),ae),Object(Q.a)(m,"".concat(ge,"-treenode-selected"),$),Object(Q.a)(m,"".concat(ge,"-treenode-loading"),fe),Object(Q.a)(m,"".concat(ge,"-treenode-active"),Se),Object(Q.a)(m,"".concat(ge,"-treenode-leaf-last"),Oe),Object(Q.a)(m,"drag-over",!ot&&w),Object(Q.a)(m,"drag-over-gap-top",!ot&&P),Object(Q.a)(m,"drag-over-gap-bottom",!ot&&j),Object(Q.a)(m,"filter-node",ue&&ue(Object(f.b)(this.props))),m)),style:T,onDragEnter:ke?this.onDragEnter:void 0,onDragOver:ke?this.onDragOver:void 0,onDragLeave:ke?this.onDragLeave:void 0,onDrop:ke?this.onDrop:void 0,onDragEnd:ke?this.onDragEnd:void 0,onMouseMove:we},st),S.createElement(h,{prefixCls:ge,level:pe,isStart:Z,isEnd:G}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(S.Component),x=function(R){return S.createElement(v.a.Consumer,null,function(O){return S.createElement(l,Object.assign({},R,{context:O}))})};x.displayName="TreeNode",x.defaultProps={title:o},x.isTreeNode=1;var E=se.a=x},XFxt:function(Ye,se,k){Ye.exports={"image-preview-container":"image-preview-container___1L8o9","image-preview":"image-preview___3YjNO","button-group":"button-group___3y9R5","preview-wrp-group":"preview-wrp-group___19bWd"}},XIdC:function(Ye,se,k){"use strict";var Q=k("rePB"),H=k("ODXe"),M=k("Ff2n"),W=k("q1tI"),N=k.n(W),A=k("TSYQ"),F=k.n(A),U=k("6cGi"),S=k("4IlW"),L=W.forwardRef(function(d,v){var C,p=d.prefixCls,h=p===void 0?"rc-switch":p,f=d.className,n=d.checked,r=d.defaultChecked,o=d.disabled,l=d.loadingIcon,x=d.checkedChildren,E=d.unCheckedChildren,y=d.onClick,R=d.onChange,O=d.onKeyDown,g=Object(M.a)(d,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),m=Object(U.a)(!1,{value:n,defaultValue:r}),s=Object(H.a)(m,2),u=s[0],_=s[1];function T(K,Z){var G=u;return o||(G=K,_(G),R==null||R(G,Z)),G}function w(K){K.which===S.a.LEFT?T(!1,K):K.which===S.a.RIGHT&&T(!0,K),O==null||O(K)}function P(K){var Z=T(!u,K);y==null||y(Z,K)}var j=F()(h,f,(C={},Object(Q.a)(C,"".concat(h,"-checked"),u),Object(Q.a)(C,"".concat(h,"-disabled"),o),C));return W.createElement("button",Object.assign({},g,{type:"button",role:"switch","aria-checked":u,disabled:o,className:j,ref:v,onKeyDown:w,onClick:P}),l,W.createElement("span",{className:"".concat(h,"-inner")},u?x:E))});L.displayName="Switch",se.a=L},Y1PL:function(Ye,se,k){"use strict";k.r(se),k.d(se,"ResizableTextArea",function(){return ae});var Q=k("wx14"),H=k("1OyB"),M=k("vuIU"),W=k("Ji7U"),N=k("LK+K"),A=k("q1tI"),F=k("VTBJ"),U=k("rePB"),S=k("Zm9Q"),L=k("Kwbf"),d=k("c+Xe"),v=k("m+aA"),C=k("bdgK"),p=new Map;function h(Se){Se.forEach(function(we){var Me,Le=we.target;(Me=p.get(Le))===null||Me===void 0||Me.forEach(function(ge){return ge(Le)})})}var f=new C.default(h),n=null,r=null;function o(Se,we){p.has(Se)||(p.set(Se,new Set),f.observe(Se)),p.get(Se).add(we)}function l(Se,we){p.has(Se)&&(p.get(Se).delete(we),p.get(Se).size||(f.unobserve(Se),p.delete(Se)))}var x=function(Se){Object(W.a)(Me,Se);var we=Object(N.a)(Me);function Me(){return Object(H.a)(this,Me),we.apply(this,arguments)}return Object(M.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(A.Component),E=A.createContext(null);function y(Se){var we=Se.children,Me=Se.onBatchResize,Le=A.useRef(0),ge=A.useRef([]),ue=A.useContext(E),ke=A.useCallback(function(lt,ot,st){Le.current+=1;var ce=Le.current;ge.current.push({size:lt,element:ot,data:st}),Promise.resolve().then(function(){ce===Le.current&&(Me==null||Me(ge.current),ge.current=[])}),ue==null||ue(lt,ot,st)},[Me,ue]);return A.createElement(E.Provider,{value:ke},we)}function R(Se){var we=Se.children,Me=Se.disabled,Le=A.useRef(null),ge=A.useRef(null),ue=A.useContext(E),ke=A.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),lt=A.isValidElement(we)&&Object(d.c)(we),ot=lt?we.ref:null,st=A.useMemo(function(){return Object(d.a)(ot,Le)},[ot,Le]),ce=A.useRef(Se);ce.current=Se;var pe=A.useCallback(function(Oe){var ze=ce.current,qe=ze.onResize,Je=ze.data,rt=Oe.getBoundingClientRect(),tt=rt.width,Tt=rt.height,bt=Oe.offsetWidth,Et=Oe.offsetHeight,yt=Math.floor(tt),Ot=Math.floor(Tt);if(ke.current.width!==yt||ke.current.height!==Ot||ke.current.offsetWidth!==bt||ke.current.offsetHeight!==Et){var At={width:yt,height:Ot,offsetWidth:bt,offsetHeight:Et};ke.current=At;var Ae=bt===Math.round(tt)?tt:bt,xe=Et===Math.round(Tt)?Tt:Et,Be=Object(F.a)(Object(F.a)({},At),{},{offsetWidth:Ae,offsetHeight:xe});ue==null||ue(Be,Oe,Je),qe&&Promise.resolve().then(function(){qe(Be,Oe)})}},[]);return A.useEffect(function(){var Oe=Object(v.a)(Le.current)||Object(v.a)(ge.current);return Oe&&!Me&&o(Oe,pe),function(){return l(Oe,pe)}},[Le.current,Me]),A.createElement(x,{ref:ge},lt?A.cloneElement(we,{ref:st}):we)}var O="rc-observer-key";function g(Se){var we=Se.children,Me=Object(S.a)(we);return Me.map(function(Le,ge){var ue=(Le==null?void 0:Le.key)||"".concat(O,"-").concat(ge);return A.createElement(R,Object(Q.a)({},Se,{key:ue}),Le)})}g.Collection=y;var m=g,s=k("bT9E"),u=k("TSYQ"),_=k.n(u),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
|
|
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],P={},j;function K(Se){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(we&&P[Me])return P[Me];var Le=window.getComputedStyle(Se),ge=Le.getPropertyValue("box-sizing")||Le.getPropertyValue("-moz-box-sizing")||Le.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Le.getPropertyValue("padding-bottom"))+parseFloat(Le.getPropertyValue("padding-top")),ke=parseFloat(Le.getPropertyValue("border-bottom-width"))+parseFloat(Le.getPropertyValue("border-top-width")),lt=w.map(function(st){return"".concat(st,":").concat(Le.getPropertyValue(st))}).join(";"),ot={sizingStyle:lt,paddingSize:ue,borderSize:ke,boxSizing:ge};return we&&Me&&(P[Me]=ot),ot}function Z(Se){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),Se.getAttribute("wrap")?j.setAttribute("wrap",Se.getAttribute("wrap")):j.removeAttribute("wrap");var ge=K(Se,we),ue=ge.paddingSize,ke=ge.borderSize,lt=ge.boxSizing,ot=ge.sizingStyle;j.setAttribute("style","".concat(ot,";").concat(T)),j.value=Se.value||Se.placeholder||"";var st=Number.MIN_SAFE_INTEGER,ce=Number.MAX_SAFE_INTEGER,pe=j.scrollHeight,Oe;if(lt==="border-box"?pe+=ke:lt==="content-box"&&(pe-=ue),Me!==null||Le!==null){j.value=" ";var ze=j.scrollHeight-ue;Me!==null&&(st=ze*Me,lt==="border-box"&&(st=st+ue+ke),pe=Math.max(st,pe)),Le!==null&&(ce=ze*Le,lt==="border-box"&&(ce=ce+ue+ke),Oe=pe>ce?"":"hidden",pe=Math.min(ce,pe))}return{height:pe,minHeight:st,maxHeight:ce,overflowY:Oe,resize:"none"}}var G=k("Gytx"),B=k.n(G),$;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})($||($={}));var ne=function(Se){Object(W.a)(Me,Se);var we=Object(N.a)(Me);function Me(Le){var ge;return Object(H.a)(this,Me),ge=we.call(this,Le),ge.nextFrameActionId=void 0,ge.resizeFrameId=void 0,ge.textArea=void 0,ge.saveTextArea=function(ue){ge.textArea=ue},ge.handleResize=function(ue){var ke=ge.state.resizeStatus,lt=ge.props,ot=lt.autoSize,st=lt.onResize;if(ke!==$.NONE)return;typeof st=="function"&&st(ue),ot&&ge.resizeOnNextFrame()},ge.resizeOnNextFrame=function(){cancelAnimationFrame(ge.nextFrameActionId),ge.nextFrameActionId=requestAnimationFrame(ge.resizeTextarea)},ge.resizeTextarea=function(){var ue=ge.props.autoSize;if(!ue||!ge.textArea)return;var ke=ue.minRows,lt=ue.maxRows,ot=Z(ge.textArea,!1,ke,lt);ge.setState({textareaStyles:ot,resizeStatus:$.RESIZING},function(){cancelAnimationFrame(ge.resizeFrameId),ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:$.RESIZED},function(){ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:$.NONE}),ge.fixFirefoxAutoScroll()})})})})},ge.renderTextArea=function(){var ue=ge.props,ke=ue.prefixCls,lt=ke===void 0?"rc-textarea":ke,ot=ue.autoSize,st=ue.onResize,ce=ue.className,pe=ue.disabled,Oe=ge.state,ze=Oe.textareaStyles,qe=Oe.resizeStatus,Je=Object(s.a)(ge.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),rt=_()(lt,ce,Object(U.a)({},"".concat(lt,"-disabled"),pe));"value"in Je&&(Je.value=Je.value||"");var tt=Object(F.a)(Object(F.a)(Object(F.a)({},ge.props.style),ze),qe===$.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return A.createElement(m,{onResize:ge.handleResize,disabled:!(ot||st)},A.createElement("textarea",Object(Q.a)({},Je,{className:rt,style:tt,ref:ge.saveTextArea})))},ge.state={textareaStyles:{},resizeStatus:$.NONE},ge}return Object(M.a)(Me,[{key:"componentDidUpdate",value:function(ge){(ge.value!==this.props.value||!B()(ge.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 ge=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ge,ue)}}catch(ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Me}(A.Component),ae=ne,fe=function(Se){Object(W.a)(Me,Se);var we=Object(N.a)(Me);function Me(Le){var ge;Object(H.a)(this,Me),ge=we.call(this,Le),ge.resizableTextArea=void 0,ge.focus=function(){ge.resizableTextArea.textArea.focus()},ge.saveTextArea=function(ke){ge.resizableTextArea=ke},ge.handleChange=function(ke){var lt=ge.props.onChange;ge.setValue(ke.target.value,function(){ge.resizableTextArea.resizeTextarea()}),lt&<(ke)},ge.handleKeyDown=function(ke){var lt=ge.props,ot=lt.onPressEnter,st=lt.onKeyDown;ke.keyCode===13&&ot&&ot(ke),st&&st(ke)};var ue=typeof Le.value=="undefined"||Le.value===null?Le.defaultValue:Le.value;return ge.state={value:ue},ge}return Object(M.a)(Me,[{key:"setValue",value:function(ge,ue){"value"in this.props||this.setState({value:ge},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return A.createElement(ae,Object(Q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ge){return"value"in ge?{value:ge.value}:null}}]),Me}(A.Component),_e=se.default=fe},ZD9Y:function(Ye,se,k){"use strict";var Q=k("BoS7"),H=k("Sdc0"),M=k("OaEy"),W=k("2fM7"),N=k("q1tI"),A=k.n(N),F=k("lOMy"),U=k.n(F),S=W.a.Option;se.a=function(L){var d=L.onFontSizeChange,v=L.cmFontSize,C=L.cmCodeMode,p=L.onCodeModeChange,h=L.onTabToSpace,f=L.className,n=f===void 0?"":f,r=L.tabToSpace,o=L.children;return A.a.createElement("div",{className:"tpi-code-setting ".concat(n)},A.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),A.a.createElement("section",null,A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),A.a.createElement(W.a,{bordered:!1,size:"small",value:C,onChange:p},A.a.createElement(S,{value:"vs"},"\u767D\u8272\u80CC\u666F"),A.a.createElement(S,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),A.a.createElement(W.a,{bordered:!1,size:"small",value:v,onChange:d},A.a.createElement(S,{value:12},"12px"),A.a.createElement(S,{value:14},"14px"),A.a.createElement(S,{value:16},"16px"),A.a.createElement(S,{value:18},"18px"),A.a.createElement(S,{value:20},"20px"),A.a.createElement(S,{value:22},"22px"))),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"Tab\u8F6C\u6362"),A.a.createElement(H.a,{checked:r,onChange:h}))),A.a.createElement("h3",null,"\u5FEB\u6377\u952E"),A.a.createElement("section",null,A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),A.a.createElement("span",null,"Ctrl + S")),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),A.a.createElement("span",null,"F1 / Alt + F1")),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),A.a.createElement("span",null,"Ctrl + ]/[")),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),A.a.createElement("span",null,"Ctrl + Shift + \\")),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),A.a.createElement("span",null,"Home")),A.a.createElement("div",{className:"file-item"},A.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),A.a.createElement("span",null,"End"))),o)}},ZW9T:function(Ye,se,k){"use strict";k.d(se,"a",function(){return m});var Q=k("k1fw"),H=k("oBTY"),M=k("9og8"),W=k("miYZ"),N=k("tsqr"),A=k("rAM+"),F=k("tJVT"),U=k("PpiC"),S=k("WmNS"),L=k.n(S),d=k("q1tI"),v=k.n(d),C=k("bdgK");function p(s,u,_,T,w){var P=u.getWordUntilPosition(_),j={startLineNumber:_.lineNumber,endLineNumber:_.lineNumber,startColumn:P.startColumn,endColumn:P.endColumn},K=T.map(function(Z){return{label:Z,kind:s.languages.CompletionItemKind.Keyword,insertText:Z,insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}});return w.map(function(Z){K.push(Object(Q.a)(Object(Q.a)({},Z),{},{range:j}))}),K}var h=function(s){var u={label:"ifelse",kind:s.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet},_=["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(j,K){var Z=p(s,j,K,_,[u]);return{suggestions:Z}}});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(j,K){var Z=[{label:"print",kind:s.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:s.languages.CompletionItemInsertTextRule.InsertAsSnippet}],G=p(s,j,K,T,Z);return{suggestions:G}}});var w=["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(j,K){var Z=[u,{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}],G=p(s,j,K,w,Z);return{suggestions:G}}})},f="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",n=k("fjLI"),r=k("LvDl"),o=k("+ua5");function l(s){return/^\d+$/.test(s)?"".concat(s,"px"):s}function x(){}var E=!1,y={"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 R(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=s;if(Array.isArray(s)){for(var _=0;_<s.length;_++){var T=y[s[_]];if(T)return T}return u[0]}return y[u]||u}var O=null,g=se.b=function(s){var u=s.width,_=u===void 0?"100%":u,T=s.height,w=T===void 0?"100%":T,P=s.value,j=s.language,K=j===void 0?"javascript":j,Z=s.style,G=Z===void 0?{}:Z,B=s.options,$=B===void 0?{}:B,ne=s.overrideServices,ae=ne===void 0?{}:ne,fe=s.theme,_e=fe===void 0?"vs-dark":fe,Se=s.onEditBlur,we=s.onSave,Me=s.autoHeight,Le=Me===void 0?!1:Me,ge=s.forbidCopy,ue=ge===void 0?!1:ge,ke=s.onChange,lt=ke===void 0?x:ke,ot=s.editorDidMount,st=ot===void 0?x:ot,ce=s.onFocus,pe=ce===void 0?x:ce,Oe=s.onBreakPoint,ze=Oe===void 0?x:Oe,qe=s.breakPointValue,Je=qe===void 0?[]:qe,rt=s.filename,tt=rt===void 0?"educoder.txt":rt,Tt=s.errorLine,bt=s.errorContent,Et=bt===void 0?"":bt,yt=s.highlightLine,Ot=s.openBreakPoint,At=Ot===void 0?!1:Ot,Ae=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"]),xe=Object(d.useRef)(),Be=Object(d.useRef)({}),Ze=Object(d.useRef)(),Pe=Object(d.useRef)(),Xe=Object(d.useRef)([]),be=Object(d.useRef)(!1),de=Object(d.useRef)(),he=Object(d.useState)(!1),re=Object(F.a)(he,2),ie=re[0],le=re[1];function me(){var Ge;return xe.current&&(Ge=new C.default(function(Ue){var mt=Object(A.a)(Ue),wt;try{for(mt.s();!(wt=mt.n()).done;){var qt=wt.value;(qt.target.offsetHeight>0||qt.target.offsetWidth>0)&&Be.current.instance.layout()}}catch(en){mt.e(en)}finally{mt.f()}}),Ge.observe(xe.current)),Ge}function De(){N.b.warn({content:decodeURIComponent(f),key:"monaco-editor-tip"})}var Te=function(){var Ue=Be.current.instance;if(P!=null&&Ue&&ie){var mt=Ue.getModel();mt&&P!==mt.getValue()&&(E=!0,mt.setValue(P),Ue.layout(),E=!1)}};Object(d.useEffect)(function(){try{var Ge,Ue=Be.current.instance;Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){Te()},500),Ue==null||((Ge=Ue.updateOptions)===null||Ge===void 0)||Ge.call(Ue,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(P.split(/\r\n|\r|\n/g).length))+3,5)})}catch(mt){debugger}},[P,ie,Be.current]),Object(d.useEffect)(function(){try{if(Tt&&Be.current&&Be.current.instance){var Ge=Be.current.instance;Ge.changeViewZones(function(mt){var wt=document.createElement("div");wt.style.padding="10px 20px",wt.style.width="calc(100% - 20px)",wt.className="my-error-line-wrp",wt.innerHTML=Et,mt.addZone({afterLineNumber:Tt||11,heightInLines:3,domNode:wt})});var Ue={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}};Ge.addOverlayWidget(Ue),Ge.revealPositionInCenter({lineNumber:20,column:1})}}catch(mt){debugger}},[Tt,Be.current,ie]),Object(d.useEffect)(function(){var Ge;if((Ge=Be.current)!==null&&Ge!==void 0&&Ge.instance&&ie&&At){var Ue=Be.current.instance,mt=Ue.getModel();if(!mt)return;var wt=function(){var nt=[],Kt=[],kt=mt.getAllDecorations(),Ut=Object(A.a)(kt),_t;try{for(Ut.s();!(_t=Ut.n()).done;){var z=_t.value;if(z.options.className==="highlighted-line"){var b;nt.push(z==null||((b=z.range)===null||b===void 0)?void 0:b.startLineNumber),Kt.push(z==null?void 0:z.id)}}}catch(V){Ut.e(V)}finally{Ut.f()}mt.deltaDecorations(Kt,[]);var D=mt.getLineCount();!!yt&&yt<=D&&(Ue.deltaDecorations([],[{range:new O.Range(yt,1,yt,mt.getLineMaxColumn(yt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ue.revealLineInCenter(yt))};wt();var qt=function(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Kt=[],kt=[],Ut=mt.getAllDecorations(),_t=Object(A.a)(Ut),z;try{for(_t.s();!(z=_t.n()).done;){var b=z.value;if(b.options.linesDecorationsClassName==="breakpoints"){var D;Kt.push(b==null||((D=b.range)===null||D===void 0)?void 0:D.startLineNumber),kt.push(b==null?void 0:b.id)}}}catch(V){_t.e(V)}finally{_t.f()}if(nt)return{lines:Kt,ids:kt};ze(Kt)},en=function(){var We=Object(M.a)(L.a.mark(function nt(Kt){var kt;return L.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return kt={range:new O.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},_t.next=3,mt.deltaDecorations([],[kt]);case 3:qt();case 4:case"end":return _t.stop()}},nt)}));return function(Kt){return We.apply(this,arguments)}}(),Vt=function(){var We=Object(M.a)(L.a.mark(function nt(Kt){var kt,Ut,_t,z,b;return L.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:kt=[],Ut=Ue.getLineDecorations(Kt),_t=Object(A.a)(Ut);try{for(_t.s();!(z=_t.n()).done;)b=z.value,b.options.linesDecorationsClassName==="breakpoints"&&kt.push(b.id)}catch(J){_t.e(J)}finally{_t.f()}return V.next=6,mt.deltaDecorations(kt,[]);case 6:qt();case 7:case"end":return V.stop()}},nt)}));return function(Kt){return We.apply(this,arguments)}}(),Dt=function(nt){var Kt=Ue.getLineDecorations(nt),kt=Object(A.a)(Kt),Ut;try{for(kt.s();!(Ut=kt.n()).done;){var _t=Ut.value;if(_t.options.linesDecorationsClassName==="breakpoints")return!0}}catch(z){kt.e(z)}finally{kt.f()}return!1};if(!Object(r.isEqual)(Je,qt(!0).lines)){mt.deltaDecorations(qt(!0).ids,[]);var Ke=Je.map(function(We){return{range:new O.Range(We,1,We,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});mt.deltaDecorations([],Ke)}var Ct=Ue.onDidChangeModelContent(function(We){var nt=Ue.getPosition();if(nt){var Kt=nt.lineNumber;mt.getLineContent(Kt).trim()===""?Vt(Kt):Dt(Kt)&&(Vt(Kt),en(Kt))}}),Bt=Ue.onMouseDown(function(We){var nt,Kt,kt;if(We.target.detail&&(nt=We.target)!==null&&nt!==void 0&&(Kt=nt.element)!==null&&Kt!==void 0&&(kt=Kt.className)!==null&&kt!==void 0&&kt.includes("line-numbers")){var Ut=We.target.position.lineNumber;if(mt.getLineContent(Ut).trim()==="")return;Dt(Ut)?Vt(Ut):en(Ut)}}),It=function(nt){var Kt={range:new O.Range(nt,1,nt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=Ue.deltaDecorations(Xe.current,[Kt])},Zt=function(){Xe.current=Ue.deltaDecorations(Xe.current,[])},nn=Ue.onMouseMove(function(We){var nt,Kt,kt;if(Zt(),We.target.detail&&(nt=We.target)!==null&&nt!==void 0&&(Kt=nt.element)!==null&&Kt!==void 0&&(kt=Kt.className)!==null&&kt!==void 0&&kt.includes("line-numbers")){var Ut=We.target.position.lineNumber;if(mt.getLineContent(Ut).trim()==="")return;It(Ut)}}),an=Ue.onMouseLeave(function(){Zt()});return function(){Ct.dispose(),Bt.dispose(),nn.dispose(),an.dispose()}}},[Be.current,ie,Je,yt,At]);function Qe(){var Ge=Be.current.instance;if(Ge){var Ue=Ge.getSelection(),mt=Be.current.pastePos||{},wt=new O.Range(mt.startLineNumber||Ue.endLineNumber,mt.startColumn||Ue.endColumn,mt.endLineNumber||Ue.endLineNumber,mt.endColumn||Ue.endColumn);setTimeout(function(){Ge.executeEdits("",[{range:wt,text:""}])},300)}}function ct(Ge){(window.navigator.platform.match("Mac")?Ge.metaKey:Ge.ctrlKey)&&Ge.keyCode==83&&(Ge.preventDefault(),we())}var xt=function(){if(Le&&Be.current.instance){var Ue=Be.current.instance.getContentHeight();gt(Ue<w?w:Ue)}else gt(w)};function ft(Ge){var Ue=document.createEvent("MouseEvents");Ue.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ge.dispatchEvent(Ue)}var ut=function(Ue){var mt=Ue.keyCode,wt=Ue.ctrlKey,qt=Ue.metaKey,en=Ue.target,Vt=Ue.type;return(Vt==="paste"||(mt===67||mt===86)&&(qt||wt))&&en.nodeName==="TEXTAREA"&&(De(),Ue.preventDefault()),!1};function $e(Ge,Ue){var mt=window.URL||window.webkitURL||window,wt=new Blob([Ue]),qt=document.createElementNS("http://www.w3.org/1999/xhtml","a");qt.href=mt.createObjectURL(wt),qt.download=Ge,ft(qt)}Object(d.useEffect)(function(){xt()},[xt]),Object(d.useEffect)(function(){xe.current&&!ie&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(Ge){try{O=Ge,Be.current.instance=O.editor.create(xe.current,{value:P,language:R(K),theme:_e,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ae);var Ue=Be.current.instance,mt=n.c._menuItems,wt=Object(H.a)(mt).find(function(en){return en[0]._debugName=="EditorContext"});if(st(Ue,O),setTimeout(function(){xt(),Be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$e(tt||"educoder.txt",Ue.getValue())}}),Ue.getDomNode().addEventListener("input",function(){Ze.current.autoFormat&&Ue.getAction("editor.action.formatDocument").run()})},500),Be.current.subscription=Ue.onDidChangeModelContent(function(en){debugger;be.current?clearTimeout(de.current):(xt(),lt(Ue.getValue(),en)),de.current=setTimeout(function(){be.current=!1},500)}),window.Monaco||h(O,R(K)),ue&&(xe.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ut),window.removeEventListener("paste",ut),window.addEventListener("keydown",ut),window.addEventListener("paste",ut)),window.Monaco=O,Se&&Ue.onDidBlurEditorWidget(function(){Se(Ue.getValue())}),pe&&Ue.onDidFocusEditorText(function(){pe(Ue.getValue())}),ue)try{window.addEventListener("paste",Qe)}catch(en){}var qt=me();return le(!0),function(){var en=Be.current.instance;en.dispose();var Vt=en.getModel();Vt&&Vt.dispose(),Be.current.subscription&&Be.current.subscription.dispose(),ue&&window.removeEventListener("paste",Qe),qt.unobserve(xe.current)}}catch(en){debugger}})},[]),Object(d.useEffect)(function(){var Ge=Be.current.instance;if(Ge&&ie)return document.addEventListener("keydown",ct,!1),function(){document.removeEventListener("keydown",ct)}},[we,ie]),Object(d.useEffect)(function(){var Ge=Be.current.instance;if(Ge&&ie){var Ue=R(K);O.editor.setModelLanguage(Ge.getModel(),Ue)}},[K,ie]),Object(d.useEffect)(function(){var Ge=Be.current.instance;Ge&&ie&&O.editor.setTheme(_e)},[_e,ie]),Object(d.useEffect)(function(){var Ge=Be.current.instance;Ze.current=$,Ge&&ie&&(Ge.updateOptions(Object(Q.a)({},$)),setTimeout(function(){Ge.getModel().updateOptions(Object(Q.a)({},$))},200))},[JSON.stringify($),ie]),Object(d.useEffect)(function(){var Ge=Be.current.instance;Ge&&ie&&Ge.layout()},[_,w,ie]);var Ve=Object(d.useState)(l(_)),Ne=Object(F.a)(Ve,2),oe=Ne[0],ve=Ne[1],He=Object(d.useState)(l(w)),je=Object(F.a)(He,2),pt=je[0],gt=je[1],Re=Object(Q.a)(Object(Q.a)({},G),{},{width:oe,height:pt});return v.a.createElement("div",{className:"my-monaco-editor",ref:xe,style:Re})};function m(s){var u=s.width,_=u===void 0?"100%":u,T=s.height,w=T===void 0?"100%":T,P=s.original,j=s.modified,K=s.language,Z=s.options,G=Z===void 0?{}:Z,B=Object(d.useRef)(),$=Object(d.useState)(null),ne=Object(F.a)($,2),ae=ne[0],fe=ne[1];function _e(Le){var ge;return B.current&&(ge=new C.default(function(ue){var ke=Object(A.a)(ue),lt;try{for(ke.s();!(lt=ke.n()).done;){var ot=lt.value;(ot.target.offsetHeight>0||ot.target.offsetWidth>0)&&Le.layout()}}catch(st){ke.e(st)}finally{ke.f()}}),ge.observe(B.current)),ge}Object(d.useEffect)(function(){return B.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(Le){O=Le;var ge=O.editor.createDiffEditor(B.current,Object(Q.a)(Object(Q.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},G),{},{wordWrap:!0}));fe(ge);var ue=_e(ge);return function(){ge.dispose();var ke=ge.getModel();ke&&ke.dispose(),ue.unobserve(B.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(d.useEffect)(function(){ae&&ae.setModel({original:O.editor.createModel(P,K),modified:O.editor.createModel(j,K)})},[P,j,K,ae]);var Se=l(_),we=l(w),Me={width:Se,height:we};return v.a.createElement("div",{className:"my-diff-editor",ref:B,style:Me})}},ZpRC:function(Ye,se,k){"use strict";function Q(d){return typeof d=="object"&&d!=null&&d.nodeType===1}function H(d,v){return(!v||d!=="hidden")&&d!=="visible"&&d!=="clip"}function M(d,v){if(d.clientHeight<d.scrollHeight||d.clientWidth<d.scrollWidth){var C=getComputedStyle(d,null);return H(C.overflowY,v)||H(C.overflowX,v)||function(p){var h=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(n){return null}}(p);return!!h&&(h.clientHeight<p.scrollHeight||h.clientWidth<p.scrollWidth)}(d)}return!1}function W(d,v,C,p,h,f,n,r){return f<d&&n>v||f>d&&n<v?0:f<=d&&r<=C||n>=v&&r>=C?f-d-p:n>v&&r<C||f<d&&r>C?n-v+h:0}var N=function(d,v){var C=window,p=v.scrollMode,h=v.block,f=v.inline,n=v.boundary,r=v.skipOverflowHiddenElements,o=typeof n=="function"?n:function(ze){return ze!==n};if(!Q(d))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,x=[],E=d;Q(E)&&o(E);){if((E=E.parentElement)===l){x.push(E);break}E!=null&&E===document.body&&M(E)&&!M(document.documentElement)||E!=null&&M(E,r)&&x.push(E)}for(var y=C.visualViewport?C.visualViewport.width:innerWidth,R=C.visualViewport?C.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,m=d.getBoundingClientRect(),s=m.height,u=m.width,_=m.top,T=m.right,w=m.bottom,P=m.left,j=h==="start"||h==="nearest"?_:h==="end"?w:_+s/2,K=f==="center"?P+u/2:f==="end"?T:P,Z=[],G=0;G<x.length;G++){var B=x[G],$=B.getBoundingClientRect(),ne=$.height,ae=$.width,fe=$.top,_e=$.right,Se=$.bottom,we=$.left;if(p==="if-needed"&&_>=0&&P>=0&&w<=R&&T<=y&&_>=fe&&w<=Se&&P>=we&&T<=_e)return Z;var Me=getComputedStyle(B),Le=parseInt(Me.borderLeftWidth,10),ge=parseInt(Me.borderTopWidth,10),ue=parseInt(Me.borderRightWidth,10),ke=parseInt(Me.borderBottomWidth,10),lt=0,ot=0,st="offsetWidth"in B?B.offsetWidth-B.clientWidth-Le-ue:0,ce="offsetHeight"in B?B.offsetHeight-B.clientHeight-ge-ke:0;if(l===B)lt=h==="start"?j:h==="end"?j-R:h==="nearest"?W(g,g+R,R,ge,ke,g+j,g+j+s,s):j-R/2,ot=f==="start"?K:f==="center"?K-y/2:f==="end"?K-y:W(O,O+y,y,Le,ue,O+K,O+K+u,u),lt=Math.max(0,lt+g),ot=Math.max(0,ot+O);else{lt=h==="start"?j-fe-ge:h==="end"?j-Se+ke+ce:h==="nearest"?W(fe,Se,ne,ge,ke+ce,j,j+s,s):j-(fe+ne/2)+ce/2,ot=f==="start"?K-we-Le:f==="center"?K-(we+ae/2)+st/2:f==="end"?K-_e+ue+st:W(we,_e,ae,Le,ue+st,K,K+u,u);var pe=B.scrollLeft,Oe=B.scrollTop;j+=Oe-(lt=Math.max(0,Math.min(Oe+lt,B.scrollHeight-ne+ce))),K+=pe-(ot=Math.max(0,Math.min(pe+ot,B.scrollWidth-ae+st)))}Z.push({el:B,top:lt,left:ot})}return Z};function A(d){return d===Object(d)&&Object.keys(d).length!==0}function F(d,v){v===void 0&&(v="auto");var C="scrollBehavior"in document.body.style;d.forEach(function(p){var h=p.el,f=p.top,n=p.left;h.scroll&&C?h.scroll({top:f,left:n,behavior:v}):(h.scrollTop=f,h.scrollLeft=n)})}function U(d){return d===!1?{block:"end",inline:"nearest"}:A(d)?d:{block:"start",inline:"nearest"}}function S(d,v){var C=!d.ownerDocument.documentElement.contains(d);if(A(v)&&typeof v.behavior=="function")return v.behavior(C?[]:N(d,v));if(C)return;var p=U(v);return F(N(d,p),p.behavior)}var L=se.a=S},a4uL:function(Ye,se,k){},bCnd:function(Ye,se,k){"use strict";k.d(se,"b",function(){return W}),k.d(se,"a",function(){return N});var Q=k("je13"),H=k.n(Q),M=!1;function W(A,F){var U=H.a.get("__ec");U||(U={}),U[A]=F,H.a.set("__ec",U)}function N(A,F){var U=H.a.get("__ec");return U?U[A]===void 0?F:U[A]:F}},bT9E:function(Ye,se,k){"use strict";k.d(se,"a",function(){return H});var Q=k("VTBJ");function H(M,W){var N=Object(Q.a)({},M);return Array.isArray(W)&&W.forEach(function(A){delete N[A]}),N}},biw7:function(Ye,se,k){"use strict";var Q=k("q1tI"),H=k.n(Q),M=Q.createContext(null);se.a=M},c5Ni:function(Ye,se,k){},cDPC:function(Ye,se,k){"use strict";var Q=k("tJVT"),H=k("q1tI"),M=k.n(H),W=k("i3hx"),N=k.n(W);se.a=function(A){var F=A.defaultX,U=F===void 0?"40%":F,S=A.leftChild,L=A.rightChild,d=A.className,v=A.hideResize,C=v===void 0?!1:v,p=Object(H.useState)(U),h=Object(Q.a)(p,2),f=h[0],n=h[1],r=Object(H.useRef)();function o(){r.current=!0}Object(H.useEffect)(function(){function E(R){r.current&&n(R.pageX)}function y(){r.current=!1}return window.addEventListener("mousemove",E),window.addEventListener("mouseup",y),function(){window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",y)}},[]);var l=typeof f=="number"&&f!==.01?"".concat(f,"px"):U,x="calc(100% - ".concat(C?"0px":"4px"," - ").concat(l,")");return M.a.createElement("div",{className:"split-panel-container ".concat(d)},M.a.createElement("section",{style:{width:l,display:f===.01?"none":""}},S),M.a.createElement("section",{className:"resize-x-bar",onMouseDown:o},M.a.createElement("a",{className:"btn-resize"},M.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},M.a.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),M.a.createElement("section",{style:{width:x}},L))}},dejd:function(Ye,se,k){},dmUQ:function(Ye,se,k){"use strict";var Q=k("Ff2n"),H=k("rePB"),M=k("1OyB"),W=k("vuIU"),N=k("Ji7U"),A=k("md7G"),F=k("foSv"),U=k("q1tI"),S=k.n(U),L=k("TSYQ"),d=k.n(L),v=k("4IlW");function C(s,u){var _=Object.keys(s);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(s);u&&(T=T.filter(function(w){return Object.getOwnPropertyDescriptor(s,w).enumerable})),_.push.apply(_,T)}return _}function p(s){for(var u=1;u<arguments.length;u++){var _=arguments[u]!=null?arguments[u]:{};u%2?C(Object(_),!0).forEach(function(T){Object(H.a)(s,T,_[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(_)):C(Object(_)).forEach(function(T){Object.defineProperty(s,T,Object.getOwnPropertyDescriptor(_,T))})}return s}function h(s){var u=f();return function(){var T=Object(F.a)(s),w;if(u){var P=Object(F.a)(this).constructor;w=Reflect.construct(T,arguments,P)}else w=T.apply(this,arguments);return Object(A.a)(this,w)}}function f(){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 n(){}function r(s){s.preventDefault()}var o=function(u){return u.replace(/[^\w.-]+/g,"")},l=200,x=600,E=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,y=function(u){return u!=null},R=function(u,_){return _===u||typeof _=="number"&&typeof u=="number"&&isNaN(_)&&isNaN(u)},O=function(s){Object(N.a)(_,s);var u=h(_);function _(T){var w;Object(M.a)(this,_),w=u.call(this,T),w.onKeyDown=function(K){var Z=w.props,G=Z.onKeyDown,B=Z.onPressEnter;if(K.keyCode===v.a.UP){var $=w.getRatio(K);w.up(K,$,null),w.stop()}else if(K.keyCode===v.a.DOWN){var ne=w.getRatio(K);w.down(K,ne,null),w.stop()}else K.keyCode===v.a.ENTER&&B&&B(K);if(w.recordCursorPosition(),w.lastKeyCode=K.keyCode,G){for(var ae=arguments.length,fe=new Array(ae>1?ae-1:0),_e=1;_e<ae;_e++)fe[_e-1]=arguments[_e];G.apply(void 0,[K].concat(fe))}},w.onKeyUp=function(K){var Z=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),Z){for(var G=arguments.length,B=new Array(G>1?G-1:0),$=1;$<G;$++)B[$-1]=arguments[$];Z.apply(void 0,[K].concat(B))}},w.onChange=function(K){var Z=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(K)),w.setState({inputValue:w.rawInput}),Z(w.toNumber(w.rawInput))},w.onMouseUp=function(){var K=w.props.onMouseUp;w.recordCursorPosition(),K&&K.apply(void 0,arguments)},w.onFocus=function(){var K;w.setState({focused:!0}),(K=w.props).onFocus.apply(K,arguments)},w.onBlur=function(){var K=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var Z=w.getCurrentValidValue(w.state.inputValue),G=w.setValue(Z,n);if(K){var B=w.input.value,$=w.getInputDisplayValue({focus:!1,value:G});w.input.value=$&&Number($),K.apply(void 0,arguments),w.input.value=B}},w.getRatio=function(K){var Z=1;return K.metaKey||K.ctrlKey?Z=.1:K.shiftKey&&(Z=10),Z},w.getFullNum=function(K){return isNaN(K)?K:/e/i.test(String(K))?Number(K).toFixed(18).replace(/\.?0+$/,""):K},w.getPrecision=function(K){if(y(w.props.precision))return w.props.precision;var Z=String(K);if(Z.indexOf("e-")>=0)return parseInt(Z.slice(Z.indexOf("e-")+2),10);var G=0;return Z.indexOf(".")>=0&&(G=Z.length-Z.indexOf(".")-1),G},w.getInputDisplayValue=function(K){var Z=K||w.state,G=Z.focused,B=Z.inputValue,$=Z.value,ne;G?ne=B:ne=w.toPrecisionAsStep($),ne==null&&(ne="");var ae=w.formatWrapper(ne);return y(w.props.decimalSeparator)&&(ae=ae.toString().replace(".",w.props.decimalSeparator)),ae},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(K){}},w.restoreByAfter=function(K){if(K===void 0)return!1;var Z=w.input.value,G=Z.lastIndexOf(K);if(G===-1)return!1;var B=w.cursorBefore.length;return w.lastKeyCode===v.a.DELETE&&w.cursorBefore.charAt(B-1)===K[0]?(w.fixCaret(B,B),!0):G+K.length===Z.length?(w.fixCaret(G,G),!0):!1},w.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(Z,G){var B=K.substring(G);return w.restoreByAfter(B)})},w.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(K,Z,G){w.pressingUpOrDown=!0,w.step("down",K,Z,G)},w.up=function(K,Z,G){w.pressingUpOrDown=!0,w.step("up",K,Z,G)},w.saveInput=function(K){w.input=K};var P=T.value;P===void 0&&(P=T.defaultValue),w.state={focused:T.autoFocus};var j=w.getValidValue(w.toNumber(P));return w.state=p(p({},w.state),{},{inputValue:w.toPrecisionAsStep(j),value:j}),w}return Object(W.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var P=this.props,j=P.value,K=P.onChange,Z=P.max,G=P.min,B=this.state.focused;if(w){if(!R(w.value,j)||!R(w.max,Z)||!R(w.min,G)){var $=B?j:this.getValidValue(j),ne;this.pressingUpOrDown?ne=$:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep($),this.setState({value:$,inputValue:ne})}var ae="value"in this.props?j:this.state.value;"max"in this.props&&w.max!==Z&&typeof ae=="number"&&ae>Z&&K&&K(Z),"min"in this.props&&w.min!==G&&typeof ae=="number"&&ae<G&&K&&K(G)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===v.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===v.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case v.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case v.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(_e){}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(w){var P=w;return P===""?P="":this.isNotCompleteNumber(parseFloat(P))?P=this.state.value:P=this.getValidValue(P),this.toNumber(P)}},{key:"getValueFromEvent",value:function(w){var P=w.target.value.trim().replace(/。/g,".");return y(this.props.decimalSeparator)&&(P=P.replace(this.props.decimalSeparator,".")),P}},{key:"getValidValue",value:function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(w);return isNaN(K)?w:(K<P&&(K=P),K>j&&(K=j),K)}},{key:"setValue",value:function(w,P){var j=this.props.precision,K=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),Z=this.state.value,G=Z===void 0?null:Z,B=this.state.inputValue,$=B===void 0?null:B,ne=typeof K=="number"?K.toFixed(j):"".concat(K),ae=K!==G||ne!=="".concat($);return"value"in this.props?($=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:$},P)):this.setState({value:K,inputValue:this.toPrecisionAsStep(w)},P),ae&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,K=j.precision,Z=j.step;if(y(K))return K;var G=this.getPrecision(P),B=this.getPrecision(Z),$=this.getPrecision(w);return w?Math.max($,G+B):G+B}},{key:"getPrecisionFactor",value:function(w){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(w,P);return Math.pow(10,j)}},{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(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var P=Math.abs(this.getMaxPrecision(w));return isNaN(P)?w.toString():Number(w).toFixed(P)}},{key:"toNumber",value:function(w){var P=this.props.precision,j=this.state.focused,K=w&&w.length>16&&j;return this.isNotCompleteNumber(w)||K?w:y(P)?Math.round(w*Math.pow(10,P))/Math.pow(10,P):Number(w)}},{key:"upStep",value:function(w,P){var j=this.props.step,K=this.getPrecisionFactor(w,P),Z=Math.abs(this.getMaxPrecision(w,P)),G=((K*w+K*j*P)/K).toFixed(Z);return this.toNumber(G)}},{key:"downStep",value:function(w,P){var j=this.props.step,K=this.getPrecisionFactor(w,P),Z=Math.abs(this.getMaxPrecision(w,P)),G=((K*w-K*j*P)/K).toFixed(Z);return this.toNumber(G)}},{key:"step",value:function(w,P){var j=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Z=arguments.length>3?arguments[3]:void 0;this.stop(),P&&(P.persist(),P.preventDefault());var G=this.props;if(G.disabled)return;var B=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(B))return;var $=this["".concat(w,"Step")](B,K),ne=$>G.max||$<G.min;if($>G.max?$=G.max:$<G.min&&($=G.min),this.setValue($,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){j[w](P,K,!0)},Z?l:x)}},{key:"fixCaret",value:function(w,P){if(w===void 0||P===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,K=this.input.selectionEnd;(w!==j||P!==K)&&this.input.setSelectionRange(w,P)}catch(Z){}}},{key:"render",value:function(){var w,P=this.props,j=P.prefixCls,K=P.disabled,Z=P.readOnly,G=P.useTouch,B=P.autoComplete,$=P.upHandler,ne=P.downHandler,ae=P.className,fe=P.max,_e=P.min,Se=P.style,we=P.title,Me=P.onMouseEnter,Le=P.onMouseLeave,ge=P.onMouseOver,ue=P.onMouseOut,ke=P.required,lt=P.onClick,ot=P.tabIndex,st=P.type,ce=P.placeholder,pe=P.id,Oe=P.inputMode,ze=P.pattern,qe=P.step,Je=P.maxLength,rt=P.autoFocus,tt=P.name,Tt=P.onPaste,bt=P.onInput,Et=Object(Q.a)(P,["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"]),yt=this.state,Ot=yt.value,At=yt.focused,Ae=d()(j,(w={},Object(H.a)(w,ae,!!ae),Object(H.a)(w,"".concat(j,"-disabled"),K),Object(H.a)(w,"".concat(j,"-focused"),At),w)),xe={};Object.keys(Et).forEach(function(me){(me.substr(0,5)==="data-"||me.substr(0,5)==="aria-"||me==="role")&&(xe[me]=Et[me])});var Be=!Z&&!K,Ze=this.getInputDisplayValue(null),Pe=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)>=fe),Xe=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)<=_e),be=Pe||K||Z,de=Xe||K||Z,he=d()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(H.a)({},"".concat(j,"-handler-up-disabled"),be)),re=d()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(H.a)({},"".concat(j,"-handler-down-disabled"),de)),ie=G?{onTouchStart:be?n:this.up,onTouchEnd:this.stop}:{onMouseDown:be?n:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},le=G?{onTouchStart:de?n:this.down,onTouchEnd:this.stop}:{onMouseDown:de?n:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return S.a.createElement("div",{className:Ae,style:Se,title:we,onMouseEnter:Me,onMouseLeave:Le,onMouseOver:ge,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},S.a.createElement("div",{className:"".concat(j,"-handler-wrap")},S.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":be,className:he}),$||S.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:r})),S.a.createElement("span",Object.assign({unselectable:"on"},le,{role:"button","aria-label":"Decrease Value","aria-disabled":de,className:re}),ne||S.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:r}))),S.a.createElement("div",{className:"".concat(j,"-input-wrap")},S.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":_e,"aria-valuemax":fe,"aria-valuenow":Ot,required:ke,type:st,placeholder:ce,onPaste:Tt,onClick:lt,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:ot,autoComplete:B,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Be?this.onKeyDown:n,onKeyUp:Be?this.onKeyUp:n,autoFocus:rt,maxLength:Je,readOnly:Z,disabled:K,max:fe,min:_e,step:qe,name:tt,title:we,id:pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ze),pattern:ze,inputMode:Oe,onInput:bt},xe))))}}]),_}(S.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:n,onKeyDown:n,onPressEnter:n,onFocus:n,onBlur:n,parser:o,required:!1,autoComplete:"off"};var g=O,m=se.a=g},fcSX:function(Ye,se,k){"use strict";var Q=k("Ff2n"),H=k("1OyB"),M=k("vuIU"),W=k("Ji7U"),N=k("md7G"),A=k("foSv"),F=k("1W/9"),U=k("q1tI"),S=k("rePB"),L=k("JX7q"),d=k("TSYQ"),v=k.n(d),C=k("qx4F"),p=k("4IlW");function h(K){return Array.isArray(K)?K:[K]}var f={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},n=Object.keys(f).filter(function(K){if(typeof document=="undefined")return!1;var Z=document.getElementsByTagName("html")[0];return K in(Z?Z.style:{})})[0],r=f[n];function o(K,Z,G,B){K.addEventListener?K.addEventListener(Z,G,B):K.attachEvent&&K.attachEvent("on".concat(Z),G)}function l(K,Z,G,B){K.removeEventListener?K.removeEventListener(Z,G,B):K.attachEvent&&K.detachEvent("on".concat(Z),G)}function x(K,Z){var G=typeof K=="function"?K(Z):K;return Array.isArray(G)?G.length===2?G:[G[0],G[1]]:[G]}var E=function(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)},y=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function K(Z,G,B,$){if(!G||G===document||G instanceof Document)return!1;if(G===Z.parentNode)return!0;var ne=Math.max(Math.abs(B),Math.abs($))===Math.abs($),ae=Math.max(Math.abs(B),Math.abs($))===Math.abs(B),fe=G.scrollHeight-G.clientHeight,_e=G.scrollWidth-G.clientWidth,Se=document.defaultView.getComputedStyle(G),we=Se.overflowY==="auto"||Se.overflowY==="scroll",Me=Se.overflowX==="auto"||Se.overflowX==="scroll",Le=fe&&we,ge=_e&&Me;return ne&&(!Le||Le&&(G.scrollTop>=fe&&$<0||G.scrollTop<=0&&$>0))||ae&&(!ge||ge&&(G.scrollLeft>=_e&&B<0||G.scrollLeft<=0&&B>0))?K(Z,G.parentNode,B,$):!1};function O(K){var Z=g();return function(){var B=Object(A.a)(K),$;if(Z){var ne=Object(A.a)(this).constructor;$=Reflect.construct(B,arguments,ne)}else $=B.apply(this,arguments);return Object(N.a)(this,$)}}function g(){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(K){return!1}}var m={},s=function(K){Object(W.a)(G,K);var Z=O(G);function G(B){var $;return Object(H.a)(this,G),$=Z.call(this,B),$.domFocus=function(){$.dom&&$.dom.focus()},$.removeStartHandler=function(ne){if(ne.touches.length>1)return;$.startPos={x:ne.touches[0].clientX,y:ne.touches[0].clientY}},$.removeMoveHandler=function(ne){if(ne.changedTouches.length>1)return;var ae=ne.currentTarget,fe=ne.changedTouches[0].clientX-$.startPos.x,_e=ne.changedTouches[0].clientY-$.startPos.y;(ae===$.maskDom||ae===$.handlerDom||ae===$.contentDom&&R(ae,ne.target,fe,_e))&&ne.cancelable&&ne.preventDefault()},$.transitionEnd=function(ne){var ae=ne.target;l(ae,r,$.transitionEnd),ae.style.transition=""},$.onKeyDown=function(ne){if(ne.keyCode===p.a.ESC){var ae=$.props.onClose;ne.stopPropagation(),ae&&ae(ne)}},$.onWrapperTransitionEnd=function(ne){var ae=$.props,fe=ae.open,_e=ae.afterVisibleChange;ne.target===$.contentWrapper&&ne.propertyName.match(/transform$/)&&($.dom.style.transition="",!fe&&$.getCurrentDrawerSome()&&(document.body.style.overflowX="",$.maskDom&&($.maskDom.style.left="",$.maskDom.style.width="")),_e&&_e(!!fe))},$.openLevelTransition=function(){var ne=$.props,ae=ne.open,fe=ne.width,_e=ne.height,Se=$.getHorizontalBoolAndPlacementName(),we=Se.isHorizontal,Me=Se.placementName,Le=$.contentDom?$.contentDom.getBoundingClientRect()[we?"width":"height"]:0,ge=(we?fe:_e)||Le;$.setLevelAndScrolling(ae,Me,ge)},$.setLevelTransform=function(ne,ae,fe,_e){var Se=$.props,we=Se.placement,Me=Se.levelMove,Le=Se.duration,ge=Se.ease,ue=Se.showMask;$.levelDom.forEach(function(ke){ke.style.transition="transform ".concat(Le," ").concat(ge),o(ke,r,$.transitionEnd);var lt=ne?fe:0;if(Me){var ot=x(Me,{target:ke,open:ne});lt=ne?ot[0]:ot[1]||0}var st=typeof lt=="number"?"".concat(lt,"px"):lt,ce=we==="left"||we==="top"?st:"-".concat(st);ce=ue&&we==="right"&&_e?"calc(".concat(ce," + ").concat(_e,"px)"):ce,ke.style.transform=lt?"".concat(ae,"(").concat(ce,")"):""})},$.setLevelAndScrolling=function(ne,ae,fe){var _e=$.props.onChange;if(!y){var Se=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(C.a)(!0):0;$.setLevelTransform(ne,ae,fe,Se),$.toggleScrollingToDrawerAndBody(Se)}_e&&_e(ne)},$.toggleScrollingToDrawerAndBody=function(ne){var ae=$.props,fe=ae.getOpenCount,_e=ae.getContainer,Se=ae.showMask,we=ae.open,Me=_e&&_e(),Le=fe&&fe();if(Me&&Me.parentNode===document.body&&Se){var ge=["touchstart"],ue=[document.body,$.maskDom,$.handlerDom,$.contentDom];we&&document.body.style.overflow!=="hidden"?(ne&&$.addScrollingEffect(ne),Le===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ue.forEach(function(ke,lt){if(!ke)return;o(ke,ge[lt]||"touchmove",lt?$.removeMoveHandler:$.removeStartHandler,$.passive)})):$.getCurrentDrawerSome()&&(Le||(document.body.style.overflow=""),document.body.style.touchAction="",ne&&$.remScrollingEffect(ne),ue.forEach(function(ke,lt){if(!ke)return;l(ke,ge[lt]||"touchmove",lt?$.removeMoveHandler:$.removeStartHandler,$.passive)}))}},$.addScrollingEffect=function(ne){var ae=$.props,fe=ae.placement,_e=ae.duration,Se=ae.ease,we=ae.getOpenCount,Me=ae.switchScrollingEffect,Le=we&&we();Le===1&&Me();var ge="width ".concat(_e," ").concat(Se),ue="transform ".concat(_e," ").concat(Se);$.dom.style.transition="none";switch(fe){case"right":$.dom.style.transform="translateX(-".concat(ne,"px)");break;case"top":case"bottom":$.dom.style.width="calc(100% - ".concat(ne,"px)"),$.dom.style.transform="translateZ(0)";break;default:break}clearTimeout($.timeout),$.timeout=setTimeout(function(){$.dom&&($.dom.style.transition="".concat(ue,",").concat(ge),$.dom.style.width="",$.dom.style.transform="")})},$.remScrollingEffect=function(ne){var ae=$.props,fe=ae.placement,_e=ae.duration,Se=ae.ease,we=ae.getOpenCount,Me=ae.switchScrollingEffect,Le=we&&we();Le||Me(!0),n&&(document.body.style.overflowX="hidden"),$.dom.style.transition="none";var ge,ue="width ".concat(_e," ").concat(Se),ke="transform ".concat(_e," ").concat(Se);switch(fe){case"left":{$.dom.style.width="100%",ue="width 0s ".concat(Se," ").concat(_e);break}case"right":{$.dom.style.transform="translateX(".concat(ne,"px)"),$.dom.style.width="100%",ue="width 0s ".concat(Se," ").concat(_e),$.maskDom&&($.maskDom.style.left="-".concat(ne,"px"),$.maskDom.style.width="calc(100% + ".concat(ne,"px)"));break}case"top":case"bottom":{$.dom.style.width="calc(100% + ".concat(ne,"px)"),$.dom.style.height="100%",$.dom.style.transform="translateZ(0)",ge="height 0s ".concat(Se," ").concat(_e);break}default:break}clearTimeout($.timeout),$.timeout=setTimeout(function(){$.dom&&($.dom.style.transition="".concat(ke,",").concat(ge?"".concat(ge,","):"").concat(ue),$.dom.style.transform="",$.dom.style.width="",$.dom.style.height="")})},$.getCurrentDrawerSome=function(){return!Object.keys(m).some(function(ne){return m[ne]})},$.getLevelDom=function(ne){var ae=ne.level,fe=ne.getContainer;if(y)return;var _e=fe&&fe(),Se=_e?_e.parentNode:null;if($.levelDom=[],ae==="all"){var we=Se?Array.prototype.slice.call(Se.children):[];we.forEach(function(Me){Me.nodeName!=="SCRIPT"&&Me.nodeName!=="STYLE"&&Me.nodeName!=="LINK"&&Me!==_e&&$.levelDom.push(Me)})}else ae&&h(ae).forEach(function(Me){document.querySelectorAll(Me).forEach(function(Le){$.levelDom.push(Le)})})},$.getHorizontalBoolAndPlacementName=function(){var ne=$.props.placement,ae=ne==="left"||ne==="right",fe="translate".concat(ae?"X":"Y");return{isHorizontal:ae,placementName:fe}},$.state={_self:Object(L.a)($)},$}return Object(M.a)(G,[{key:"componentDidMount",value:function(){var $=this;if(!y){var ne=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return ne=!0,null}}))}catch(we){}this.passive=ne?{passive:!1}:!1}var ae=this.props,fe=ae.open,_e=ae.getContainer,Se=_e&&_e();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),fe&&(Se&&Se.parentNode===document.body&&(m[this.drawerId]=fe),this.openLevelTransition(),this.forceUpdate(function(){$.domFocus()}))}},{key:"componentDidUpdate",value:function($){var ne=this.props,ae=ne.open,fe=ne.getContainer,_e=fe&&fe();ae!==$.open&&(ae&&this.domFocus(),_e&&_e.parentNode===document.body&&(m[this.drawerId]=!!ae),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var $=this.props,ne=$.getOpenCount,ae=$.open,fe=$.switchScrollingEffect,_e=typeof ne=="function"&&ne();delete m[this.drawerId],ae&&(this.setLevelTransform(!1),document.body.style.touchAction=""),_e||(document.body.style.overflow="",fe(!0))}},{key:"render",value:function(){var $,ne=this,ae=this.props,fe=ae.className,_e=ae.children,Se=ae.style,we=ae.width,Me=ae.height,Le=ae.defaultOpen,ge=ae.open,ue=ae.prefixCls,ke=ae.placement,lt=ae.level,ot=ae.levelMove,st=ae.ease,ce=ae.duration,pe=ae.getContainer,Oe=ae.handler,ze=ae.onChange,qe=ae.afterVisibleChange,Je=ae.showMask,rt=ae.maskClosable,tt=ae.maskStyle,Tt=ae.onClose,bt=ae.onHandleClick,Et=ae.keyboard,yt=ae.getOpenCount,Ot=ae.switchScrollingEffect,At=Object(Q.a)(ae,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ae=this.dom?ge:!1,xe=v()(ue,($={},Object(S.a)($,"".concat(ue,"-").concat(ke),!0),Object(S.a)($,"".concat(ue,"-open"),Ae),Object(S.a)($,fe||"",!!fe),Object(S.a)($,"no-mask",!Je),$)),Be=this.getHorizontalBoolAndPlacementName(),Ze=Be.placementName,Pe=ke==="left"||ke==="top"?"-100%":"100%",Xe=Ae?"":"".concat(Ze,"(").concat(Pe,")"),be=Oe&&U.cloneElement(Oe,{onClick:function(he){Oe.props.onClick&&Oe.props.onClick(),bt&&bt(he)},ref:function(he){ne.handlerDom=he}});return U.createElement("div",Object.assign({},At,{tabIndex:-1,className:xe,style:Se,ref:function(he){ne.dom=he},onKeyDown:Ae&&Et?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Je&&U.createElement("div",{className:"".concat(ue,"-mask"),onClick:rt?Tt:void 0,style:tt,ref:function(he){ne.maskDom=he}}),U.createElement("div",{className:"".concat(ue,"-content-wrapper"),style:{transform:Xe,msTransform:Xe,width:E(we)?"".concat(we,"px"):we,height:E(Me)?"".concat(Me,"px"):Me},ref:function(he){ne.contentWrapper=he}},U.createElement("div",{className:"".concat(ue,"-content"),ref:function(he){ne.contentDom=he},onTouchStart:Ae&&Je?this.removeStartHandler:void 0,onTouchMove:Ae&&Je?this.removeMoveHandler:void 0},_e),be))}}],[{key:"getDerivedStateFromProps",value:function($,ne){var ae=ne.prevProps,fe=ne._self,_e={prevProps:$};if(ae!==void 0){var Se=$.placement,we=$.level;Se!==ae.placement&&(fe.contentDom=null),we!==ae.level&&fe.getLevelDom($)}return _e}}]),G}(U.Component);s.defaultProps={switchScrollingEffect:function(){}};var u=s;function _(K){var Z=T();return function(){var B=Object(A.a)(K),$;if(Z){var ne=Object(A.a)(this).constructor;$=Reflect.construct(B,arguments,ne)}else $=B.apply(this,arguments);return Object(N.a)(this,$)}}function T(){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(K){return!1}}var w=function(K){Object(W.a)(G,K);var Z=_(G);function G(B){var $;Object(H.a)(this,G),$=Z.call(this,B),$.onHandleClick=function(ae){var fe=$.props,_e=fe.onHandleClick,Se=fe.open;if(_e&&_e(ae),typeof Se=="undefined"){var we=$.state.open;$.setState({open:!we})}},$.onClose=function(ae){var fe=$.props,_e=fe.onClose,Se=fe.open;_e&&_e(ae),typeof Se=="undefined"&&$.setState({open:!1})};var ne=typeof B.open!="undefined"?B.open:!!B.defaultOpen;return $.state={open:ne},"onMaskClick"in B&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),$}return Object(M.a)(G,[{key:"render",value:function(){var $=this,ne=this.props,ae=ne.defaultOpen,fe=ne.getContainer,_e=ne.wrapperClassName,Se=ne.forceRender,we=ne.handler,Me=Object(Q.a)(ne,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Le=this.state.open;if(!fe)return U.createElement("div",{className:_e,ref:function(ke){$.dom=ke}},U.createElement(u,Object.assign({},Me,{open:Le,handler:we,getContainer:function(){return $.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ge=!!we||Se;return U.createElement(F.a,{visible:Le,forceRender:ge,getContainer:fe,wrapperClassName:_e},function(ue){var ke=ue.visible,lt=ue.afterClose,ot=Object(Q.a)(ue,["visible","afterClose"]);return U.createElement(u,Object.assign({},Me,ot,{open:ke!==void 0?ke:Le,afterVisibleChange:lt!==void 0?lt:Me.afterVisibleChange,handler:we,onClose:$.onClose,onHandleClick:$.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function($,ne){var ae=ne.prevProps,fe={prevProps:$};return typeof ae!="undefined"&&$.open!==ae.open&&(fe.open=$.open),fe}}]),G}(U.Component);w.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:U.createElement("div",{className:"drawer-handle"},U.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var P=w,j=se.a=P},fcyK:function(Ye,se,k){},fjLI:function(Ye,se,k){"use strict";k.d(se,"e",function(){return L}),k.d(se,"a",function(){return d}),k.d(se,"c",function(){return v}),k.d(se,"d",function(){return p}),k.d(se,"b",function(){return h});var Q=k("8HAY"),H=k("Cg/j"),M=k("T8No"),W=k("nnTU"),N=k("MI8n"),A=function(){var f=function(n,r){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var x in l)l.hasOwnProperty(x)&&(o[x]=l[x])},f(n,r)};return function(n,r){f(n,r);function o(){this.constructor=n}n.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),F=function(f,n,r,o){var l=arguments.length,x=l<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,r):o,E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,r,o);else for(var y=f.length-1;y>=0;y--)(E=f[y])&&(x=(l<3?E(x):l>3?E(n,r,x):E(n,r))||x);return l>3&&x&&Object.defineProperty(n,r,x),x},U=function(f,n){return function(r,o){n(r,o,f)}},S=function(){for(var f=0,n=0,r=arguments.length;n<r;n++)f+=arguments[n].length;for(var o=Array(f),l=0,n=0;n<r;n++)for(var x=arguments[n],E=0,y=x.length;E<y;E++,l++)o[l]=x[E];return o};function L(f){return f.command!==void 0}var d=Object(H.c)("menuService"),v=new(function(){function f(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return f.prototype.addCommand=function(n){var r=this;return this._commands.set(n.id,n),this._onDidChangeMenu.fire(0),{dispose:function(){r._commands.delete(n.id)&&r._onDidChangeMenu.fire(0)}}},f.prototype.getCommand=function(n){return this._commands.get(n)},f.prototype.getCommands=function(){var n=new Map;return this._commands.forEach(function(r,o){return n.set(o,r)}),n},f.prototype.appendMenuItem=function(n,r){var o=this,l=this._menuItems.get(n);return l?l.push(r):(l=[r],this._menuItems.set(n,l)),this._onDidChangeMenu.fire(n),{dispose:function(){var x=l.indexOf(r);x>=0&&(l.splice(x,1),o._onDidChangeMenu.fire(n))}}},f.prototype.getMenuItems=function(n){var r=(this._menuItems.get(n)||[]).slice(0);return n===0&&this._appendImplicitItems(r),r},f.prototype._appendImplicitItems=function(n){for(var r=new Set,o=n.filter(function(O){return L(O)}),l=0,x=o;l<x.length;l++){var E=x[l],y=E.command,R=E.alt;r.add(y.id),R&&r.add(R.id)}this._commands.forEach(function(O,g){r.has(g)||n.push({command:O})})},f}()),C=function(f){A(n,f);function n(r,o,l){var x=f.call(this,r,o)||this;return x._commandService=l,x}return n.prototype.run=function(){for(var r,o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];return(r=this._commandService).executeCommand.apply(r,S([this.id],o))},n=F([U(2,W.b)],n),n}(Q.a),p=function(f){A(n,f);function n(r){var o=this;return typeof r.title=="string"?o=f.call(this,"",r.title,"submenu")||this:o=f.call(this,"",r.title.value,"submenu")||this,o.item=r,o}return n}(Q.a),h=function(f){A(n,f);function n(r,o,l,x,E){var y=this;return typeof r.title=="string"?y=f.call(this,r.id,r.title,E)||this:y=f.call(this,r.id,r.title.value,E)||this,y._cssClass=void 0,y._enabled=!r.precondition||x.contextMatchesRules(r.precondition),y._checked=Boolean(r.toggled&&x.contextMatchesRules(r.toggled)),y._options=l||{},y.item=r,y.alt=o?new n(o,void 0,y._options,x,E):void 0,y}return n.prototype.dispose=function(){this.alt&&this.alt.dispose(),f.prototype.dispose.call(this)},n.prototype.run=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var l=[];return this._options.arg&&(l=S(l,[this._options.arg])),this._options.shouldForwardArgs&&(l=S(l,r)),f.prototype.run.apply(this,l)},n=F([U(3,M.c),U(4,W.b)],n),n}(C)},fyJ8:function(Ye,se,k){"use strict";var Q=k("rePB"),H=k("VTBJ"),M=k("Ff2n"),W=k("U8pU"),N=k("q1tI"),A=k.n(N),F=k("TSYQ"),U=k.n(F),S=k("c+Xe"),L=k("sR1s");function d(f){return f&&Object(W.a)(f)==="object"&&!Array.isArray(f)&&!N.isValidElement(f)}function v(f){return typeof f=="string"?!0:Object(S.c)(f)}function C(f,n){var r,o=f.prefixCls,l=f.className,x=f.record,E=f.index,y=f.dataIndex,R=f.render,O=f.children,g=f.component,m=g===void 0?"td":g,s=f.colSpan,u=f.rowSpan,_=f.fixLeft,T=f.fixRight,w=f.firstFixLeft,P=f.lastFixLeft,j=f.firstFixRight,K=f.lastFixRight,Z=f.appendNode,G=f.additionalProps,B=G===void 0?{}:G,$=f.ellipsis,ne=f.align,ae=f.rowType,fe=f.isSticky,_e="".concat(o,"-cell"),Se,we;if(O)we=O;else{var Me=Object(L.b)(x,y);if(we=Me,R){var Le=R(Me,x,E);d(Le)?(we=Le.children,Se=Le.props):we=Le}}Object(W.a)(we)==="object"&&!Array.isArray(we)&&!N.isValidElement(we)&&(we=null),$&&(P||j)&&(we=N.createElement("span",{className:"".concat(_e,"-content")},we));var ge=Se||{},ue=ge.colSpan,ke=ge.rowSpan,lt=ge.style,ot=ge.className,st=Object(M.a)(ge,["colSpan","rowSpan","style","className"]),ce=ue!==void 0?ue:s,pe=ke!==void 0?ke:u;if(ce===0||pe===0)return null;var Oe={},ze=typeof _=="number",qe=typeof T=="number";ze&&(Oe.position="sticky",Oe.left=_),qe&&(Oe.position="sticky",Oe.right=T);var Je={};ne&&(Je.textAlign=ne);var rt,tt=$===!0?{showTitle:!0}:$;tt&&(tt.showTitle||ae==="header")&&(typeof we=="string"||typeof we=="number"?rt=we.toString():N.isValidElement(we)&&typeof we.props.children=="string"&&(rt=we.props.children));var Tt=Object(H.a)(Object(H.a)(Object(H.a)({title:rt},st),B),{},{colSpan:ce&&ce!==1?ce:null,rowSpan:pe&&pe!==1?pe:null,className:U()(_e,l,(r={},Object(Q.a)(r,"".concat(_e,"-fix-left"),ze),Object(Q.a)(r,"".concat(_e,"-fix-left-first"),w),Object(Q.a)(r,"".concat(_e,"-fix-left-last"),P),Object(Q.a)(r,"".concat(_e,"-fix-right"),qe),Object(Q.a)(r,"".concat(_e,"-fix-right-first"),j),Object(Q.a)(r,"".concat(_e,"-fix-right-last"),K),Object(Q.a)(r,"".concat(_e,"-ellipsis"),$),Object(Q.a)(r,"".concat(_e,"-with-append"),Z),Object(Q.a)(r,"".concat(_e,"-fix-sticky"),(ze||qe)&&fe),r),B.className,ot),style:Object(H.a)(Object(H.a)(Object(H.a)(Object(H.a)({},B.style),Je),Oe),lt),ref:v(m)?n:null});return N.createElement(m,Object.assign({},Tt),Z,we)}var p=N.forwardRef(C);p.displayName="Cell";var h=N.memo(p,function(f,n){return n.shouldCellUpdate?!n.shouldCellUpdate(n.record,f.record):!1});se.a=h},gRFJ:function(Ye,se,k){Ye.exports=[k("rdUC"),k("ynwM"),k("RELg"),k("DlR+"),k("CrYA"),k("PD8m")]},gaXo:function(module,exports){typeof JSON!="object"&&(JSON={}),function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(Ye){return Ye<10?"0"+Ye:Ye}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(Ye){return rx_escapable.lastIndex=0,rx_escapable.test(Ye)?'"'+Ye.replace(rx_escapable,function(se){var k=meta[se];return typeof k=="string"?k:"\\u"+("0000"+se.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+Ye+'"'}function str(Ye,se){var k,Q,H,M,W=gap,N,A=se[Ye];A&&typeof A=="object"&&typeof A.toJSON=="function"&&(A=A.toJSON(Ye)),typeof rep=="function"&&(A=rep.call(se,Ye,A));switch(typeof A){case"string":return quote(A);case"number":return isFinite(A)?String(A):"null";case"boolean":case"null":return String(A);case"object":if(!A)return"null";if(gap+=indent,N=[],Object.prototype.toString.apply(A)==="[object Array]"){for(M=A.length,k=0;k<M;k+=1)N[k]=str(k,A)||"null";return H=N.length===0?"[]":gap?`[
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+W+"]":"["+N.join(",")+"]",gap=W,H}if(rep&&typeof rep=="object")for(M=rep.length,k=0;k<M;k+=1)typeof rep[k]=="string"&&(Q=rep[k],H=str(Q,A),H&&N.push(quote(Q)+(gap?": ":":")+H));else for(Q in A)Object.prototype.hasOwnProperty.call(A,Q)&&(H=str(Q,A),H&&N.push(quote(Q)+(gap?": ":":")+H));return H=N.length===0?"{}":gap?`{
|
|
`+gap+N.join(`,
|
|
`+gap)+`
|
|
`+W+"}":"{"+N.join(",")+"}",gap=W,H}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(Ye,se,k){var Q;if(gap="",indent="",typeof k=="number")for(Q=0;Q<k;Q+=1)indent+=" ";else typeof k=="string"&&(indent=k);if(rep=se,se&&typeof se!="function"&&(typeof se!="object"||typeof se.length!="number"))throw new Error("JSON.stringify");return str("",{"":Ye})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(Ye,se){var k,Q,H=Ye[se];if(H&&typeof H=="object")for(k in H)Object.prototype.hasOwnProperty.call(H,k)&&(Q=walk(H,k),Q!==void 0?H[k]=Q:delete H[k]);return reviver.call(Ye,se,H)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(Ye){return"\\u"+("0000"+Ye.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},hW8S:function(Ye,se,k){"use strict";k.d(se,"a",function(){return W}),k.d(se,"c",function(){return N}),k.d(se,"b",function(){return A});var Q=k("VTBJ"),H=k("Ff2n"),M=k("Kwbf"),W="RC_TABLE_INTERNAL_COL_DEFINE";function N(F){var U=F.expandable,S=Object(H.a)(F,["expandable"]);return"expandable"in F?Object(Q.a)(Object(Q.a)({},S),U):S}function A(F){return Object.keys(F).reduce(function(U,S){return(S.substr(0,5)==="data-"||S.substr(0,5)==="aria-")&&(U[S]=F[S]),U},{})}},i3hx:function(Ye,se,k){},je13:function(Ye,se,k){var Q=k("5nXd"),H=k("gRFJ"),M=[k("uQRt")];Ye.exports=Q.createStore(H,M)},kSUc:function(Ye,se,k){},"kaH+":function(Ye,se,k){"use strict";var Q=k("+L6B"),H=k("2/Rp"),M=k("tJVT"),W=k("q1tI"),N=k.n(W),A=k("XFxt"),F=k.n(A),U=k("dhSg"),S=k("rLCj"),L=k("dF/Y"),d=k("4i/N");se.a=function(){var v=Object(W.useState)(""),C=Object(M.a)(v,2),p=C[0],h=C[1],f=Object(W.useState)(0),n=Object(M.a)(f,2),r=n[0],o=n[1],l=Object(W.useRef)("");Object(W.useEffect)(function(){var R=U.a.subscribe("preview-image",function(O){h(O),document.body.style.overflow="hidden"});return R},[]),Object(W.useEffect)(function(){return document.addEventListener("keydown",x),function(){document.removeEventListener("keydown",x)}},[]),Object(W.useEffect)(function(){l.current=p},[p]);function x(R){R.keyCode==27&&l.current&&E()}function E(){document.body.style.overflow="auto",h("")}function y(){o(r+90)}return N.a.createElement(W.Fragment,null,p?N.a.createElement("div",{className:F.a["image-preview-container"]},N.a.createElement("div",{className:F.a["button-group"]},N.a.createElement(H.a,{onClick:y},"\u65CB\u8F6C",N.a.createElement(S.a,null)),N.a.createElement(H.a,{href:p},"\u4E0B\u8F7D",N.a.createElement(L.a,null)),N.a.createElement(H.a,{onClick:E},"\u5173\u95ED",N.a.createElement(d.a,null))),N.a.createElement("div",{className:F.a["preview-wrp-group"]},N.a.createElement("img",{className:F.a["image-preview"],src:p,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(r,"deg)")}}))):null)}},lOMy:function(Ye,se,k){},lZu9:function(Ye,se,k){(function(Q){Q(k("VrN/"),k("1eCo"),k("8EBN"))})(function(Q){"use strict";Q.defineMode("markdown",function(H,M){var W=Q.getMode(H,"text/html"),N=W.name=="null";function A(G){if(Q.findModeByName){var B=Q.findModeByName(G);B&&(G=B.mime||B.mimes[0])}var $=Q.getMode(H,G);return $.name=="null"?null:$}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var F={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 F)F.hasOwnProperty(U)&&M.tokenTypeOverrides[U]&&(F[U]=M.tokenTypeOverrides[U]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,d=/^\[(x| )\](?=\s)/i,v=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,C=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,n=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function o(G,B,$){return B.f=B.inline=$,$(G,B)}function l(G,B,$){return B.f=B.block=$,$(G,B)}function x(G){return!G||!/\S/.test(G.string)}function E(G){if(G.linkTitle=!1,G.linkHref=!1,G.linkText=!1,G.em=!1,G.strong=!1,G.strikethrough=!1,G.quote=0,G.indentedCode=!1,G.f==R){var B=N;if(!B){var $=Q.innerMode(W,G.htmlState);B=$.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText}B&&(G.f=s,G.block=y,G.htmlState=null)}return G.trailingSpace=0,G.trailingSpaceNewLine=!1,G.prevLine=G.thisLine,G.thisLine={stream:null},null}function y(G,B){var $=G.column()===B.indentation,ne=x(B.prevLine.stream),ae=B.indentedCode,fe=B.prevLine.hr,_e=B.list!==!1,Se=(B.listStack[B.listStack.length-1]||0)+3;B.indentedCode=!1;var we=B.indentation;if(B.indentationDiff===null&&(B.indentationDiff=B.indentation,_e)){for(B.list=null;we<B.listStack[B.listStack.length-1];)B.listStack.pop(),B.listStack.length?B.indentation=B.listStack[B.listStack.length-1]:B.list=!1;B.list!==!1&&(B.indentationDiff=we-B.listStack[B.listStack.length-1])}var Me=!ne&&!fe&&!B.prevLine.header&&(!_e||!ae)&&!B.prevLine.fencedCodeEnd,Le=(B.list===!1||fe||ne)&&B.indentation<=Se&&G.match(S),ge=null;if(B.indentationDiff>=4&&(ae||B.prevLine.fencedCodeEnd||B.prevLine.header||ne))return G.skipToEnd(),B.indentedCode=!0,F.code;if(G.eatSpace())return null;if($&&B.indentation<=Se&&(ge=G.match(v))&&ge[1].length<=6)return B.quote=0,B.header=ge[1].length,B.thisLine.header=!0,M.highlightFormatting&&(B.formatting="header"),B.f=B.inline,g(B);if(B.indentation<=Se&&G.eat(">"))return B.quote=$?1:B.quote+1,M.highlightFormatting&&(B.formatting="quote"),G.eatSpace(),g(B);if(!Le&&!B.setext&&$&&B.indentation<=Se&&(ge=G.match(L))){var ue=ge[1]?"ol":"ul";return B.indentation=we+G.current().length,B.list=!0,B.quote=0,B.listStack.push(B.indentation),B.em=!1,B.strong=!1,B.code=!1,B.strikethrough=!1,M.taskLists&&G.match(d,!1)&&(B.taskList=!0),B.f=B.inline,M.highlightFormatting&&(B.formatting=["list","list-"+ue]),g(B)}else{if($&&B.indentation<=Se&&(ge=G.match(h,!0)))return B.quote=0,B.fencedEndRE=new RegExp(ge[1]+"+ *$"),B.localMode=M.fencedCodeBlockHighlighting&&A(ge[2]||M.fencedCodeBlockDefaultMode),B.localMode&&(B.localState=Q.startState(B.localMode)),B.f=B.block=O,M.highlightFormatting&&(B.formatting="code-block"),B.code=-1,g(B);if(B.setext||(!Me||!_e)&&!B.quote&&B.list===!1&&!B.code&&!Le&&!f.test(G.string)&&(ge=G.lookAhead(1))&&(ge=ge.match(C)))return B.setext?(B.header=B.setext,B.setext=0,G.skipToEnd(),M.highlightFormatting&&(B.formatting="header")):(B.header=ge[0].charAt(0)=="="?1:2,B.setext=B.header),B.thisLine.header=!0,B.f=B.inline,g(B);if(Le)return G.skipToEnd(),B.hr=!0,B.thisLine.hr=!0,F.hr;if(G.peek()==="[")return o(G,B,P)}return o(G,B,B.inline)}function R(G,B){var $=W.token(G,B.htmlState);if(!N){var ne=Q.innerMode(W,B.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||B.md_inside&&G.current().indexOf(">")>-1)&&(B.f=s,B.block=y,B.htmlState=null)}return $}function O(G,B){var $=B.listStack[B.listStack.length-1]||0,ne=B.indentation<$,ae=$+3;if(B.fencedEndRE&&B.indentation<=ae&&(ne||G.match(B.fencedEndRE))){M.highlightFormatting&&(B.formatting="code-block");var fe;return ne||(fe=g(B)),B.localMode=B.localState=null,B.block=y,B.f=s,B.fencedEndRE=null,B.code=0,B.thisLine.fencedCodeEnd=!0,ne?l(G,B,B.block):fe}else return B.localMode?B.localMode.token(G,B.localState):(G.skipToEnd(),F.code)}function g(G){var B=[];if(G.formatting){B.push(F.formatting),typeof G.formatting=="string"&&(G.formatting=[G.formatting]);for(var $=0;$<G.formatting.length;$++)B.push(F.formatting+"-"+G.formatting[$]),G.formatting[$]==="header"&&B.push(F.formatting+"-"+G.formatting[$]+"-"+G.header),G.formatting[$]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=G.quote?B.push(F.formatting+"-"+G.formatting[$]+"-"+G.quote):B.push("error"))}if(G.taskOpen)return B.push("meta"),B.length?B.join(" "):null;if(G.taskClosed)return B.push("property"),B.length?B.join(" "):null;if(G.linkHref?B.push(F.linkHref,"url"):(G.strong&&B.push(F.strong),G.em&&B.push(F.em),G.strikethrough&&B.push(F.strikethrough),G.emoji&&B.push(F.emoji),G.linkText&&B.push(F.linkText),G.code&&B.push(F.code),G.image&&B.push(F.image),G.imageAltText&&B.push(F.imageAltText,"link"),G.imageMarker&&B.push(F.imageMarker)),G.header&&B.push(F.header,F.header+"-"+G.header),G.quote&&(B.push(F.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=G.quote?B.push(F.quote+"-"+G.quote):B.push(F.quote+"-"+M.maxBlockquoteDepth)),G.list!==!1){var ne=(G.listStack.length-1)%3;ne?ne===1?B.push(F.list2):B.push(F.list3):B.push(F.list1)}return G.trailingSpaceNewLine?B.push("trailing-space-new-line"):G.trailingSpace&&B.push("trailing-space-"+(G.trailingSpace%2?"a":"b")),B.length?B.join(" "):null}function m(G,B){return G.match(p,!0)?g(B):void 0}function s(G,B){var $=B.text(G,B);if(typeof $!="undefined")return $;if(B.list)return B.list=null,g(B);if(B.taskList){var ne=G.match(d,!0)[1]===" ";return ne?B.taskOpen=!0:B.taskClosed=!0,M.highlightFormatting&&(B.formatting="task"),B.taskList=!1,g(B)}if(B.taskOpen=!1,B.taskClosed=!1,B.header&&G.match(/^#+$/,!0))return M.highlightFormatting&&(B.formatting="header"),g(B);var ae=G.next();if(B.linkTitle){B.linkTitle=!1;var fe=ae;ae==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var _e="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(G.match(new RegExp(_e),!0))return F.linkHref}if(ae==="`"){var Se=B.formatting;M.highlightFormatting&&(B.formatting="code"),G.eatWhile("`");var we=G.current().length;if(B.code==0&&(!B.quote||we==1))return B.code=we,g(B);if(we==B.code){var Me=g(B);return B.code=0,Me}else return B.formatting=Se,g(B)}else if(B.code)return g(B);if(ae==="\\"&&(G.next(),M.highlightFormatting)){var Le=g(B),ge=F.formatting+"-escape";return Le?Le+" "+ge:ge}if(ae==="!"&&G.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return B.imageMarker=!0,B.image=!0,M.highlightFormatting&&(B.formatting="image"),g(B);if(ae==="["&&B.imageMarker&&G.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return B.imageMarker=!1,B.imageAltText=!0,M.highlightFormatting&&(B.formatting="image"),g(B);if(ae==="]"&&B.imageAltText){M.highlightFormatting&&(B.formatting="image");var Le=g(B);return B.imageAltText=!1,B.image=!1,B.inline=B.f=_,Le}if(ae==="["&&!B.image)return B.linkText&&G.match(/^.*?\]/)||(B.linkText=!0,M.highlightFormatting&&(B.formatting="link")),g(B);if(ae==="]"&&B.linkText){M.highlightFormatting&&(B.formatting="link");var Le=g(B);return B.linkText=!1,B.inline=B.f=G.match(/\(.*?\)| ?\[.*?\]/,!1)?_:s,Le}if(ae==="<"&&G.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=u,M.highlightFormatting&&(B.formatting="link");var Le=g(B);return Le?Le+=" ":Le="",Le+F.linkInline}if(ae==="<"&&G.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){B.f=B.inline=u,M.highlightFormatting&&(B.formatting="link");var Le=g(B);return Le?Le+=" ":Le="",Le+F.linkEmail}if(M.xml&&ae==="<"&&G.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=G.string.indexOf(">",G.pos);if(ue!=-1){var ke=G.string.substring(G.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ke)&&(B.md_inside=!0)}return G.backUp(1),B.htmlState=Q.startState(W),l(G,B,R)}if(M.xml&&ae==="<"&&G.match(/^\/\w*?>/))return B.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var lt=1,ot=G.pos==1?" ":G.string.charAt(G.pos-2);lt<3&&G.eat(ae);)lt++;var st=G.peek()||" ",ce=!/\s/.test(st)&&(!n.test(st)||/\s/.test(ot)||n.test(ot)),pe=!/\s/.test(ot)&&(!n.test(ot)||/\s/.test(st)||n.test(st)),Oe=null,ze=null;if(lt%2&&(!B.em&&ce&&(ae==="*"||!pe||n.test(ot))?Oe=!0:B.em==ae&&pe&&(ae==="*"||!ce||n.test(st))&&(Oe=!1)),lt>1&&(!B.strong&&ce&&(ae==="*"||!pe||n.test(ot))?ze=!0:B.strong==ae&&pe&&(ae==="*"||!ce||n.test(st))&&(ze=!1)),ze!=null||Oe!=null){M.highlightFormatting&&(B.formatting=Oe==null?"strong":ze==null?"em":"strong em"),Oe===!0&&(B.em=ae),ze===!0&&(B.strong=ae);var Me=g(B);return Oe===!1&&(B.em=!1),ze===!1&&(B.strong=!1),Me}}else if(ae===" "&&(G.eat("*")||G.eat("_"))){if(G.peek()===" ")return g(B);G.backUp(1)}if(M.strikethrough){if(ae==="~"&&G.eatWhile(ae)){if(B.strikethrough){M.highlightFormatting&&(B.formatting="strikethrough");var Me=g(B);return B.strikethrough=!1,Me}else if(G.match(/^[^\s]/,!1))return B.strikethrough=!0,M.highlightFormatting&&(B.formatting="strikethrough"),g(B)}else if(ae===" "&&G.match(/^~~/,!0)){if(G.peek()===" ")return g(B);G.backUp(2)}}if(M.emoji&&ae===":"&&G.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){B.emoji=!0,M.highlightFormatting&&(B.formatting="emoji");var qe=g(B);return B.emoji=!1,qe}return ae===" "&&(G.match(/^ +$/,!1)?B.trailingSpace++:B.trailingSpace&&(B.trailingSpaceNewLine=!0)),g(B)}function u(G,B){var $=G.next();if($===">"){B.f=B.inline=s,M.highlightFormatting&&(B.formatting="link");var ne=g(B);return ne?ne+=" ":ne="",ne+F.linkInline}return G.match(/^[^>]+/,!0),F.linkInline}function _(G,B){if(G.eatSpace())return null;var $=G.next();return $==="("||$==="["?(B.f=B.inline=w($==="("?")":"]"),M.highlightFormatting&&(B.formatting="link-string"),B.linkHref=!0,g(B)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(G){return function(B,$){var ne=B.next();if(ne===G){$.f=$.inline=s,M.highlightFormatting&&($.formatting="link-string");var ae=g($);return $.linkHref=!1,ae}return B.match(T[G]),$.linkHref=!0,g($)}}function P(G,B){return G.match(/^([^\]\\]|\\.)*\]:/,!1)?(B.f=j,G.next(),M.highlightFormatting&&(B.formatting="link"),B.linkText=!0,g(B)):o(G,B,s)}function j(G,B){if(G.match(/^\]:/,!0)){B.f=B.inline=K,M.highlightFormatting&&(B.formatting="link");var $=g(B);return B.linkText=!1,$}return G.match(/^([^\]\\]|\\.)+/,!0),F.linkText}function K(G,B){return G.eatSpace()?null:(G.match(/^[^\s]+/,!0),G.peek()===void 0?B.linkTitle=!0:G.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),B.f=B.inline=s,F.linkHref+" url")}var Z={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:s,text:m,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(G){return{f:G.f,prevLine:G.prevLine,thisLine:G.thisLine,block:G.block,htmlState:G.htmlState&&Q.copyState(W,G.htmlState),indentation:G.indentation,localMode:G.localMode,localState:G.localMode?Q.copyState(G.localMode,G.localState):null,inline:G.inline,text:G.text,formatting:!1,linkText:G.linkText,linkTitle:G.linkTitle,linkHref:G.linkHref,code:G.code,em:G.em,strong:G.strong,strikethrough:G.strikethrough,emoji:G.emoji,header:G.header,setext:G.setext,hr:G.hr,taskList:G.taskList,list:G.list,listStack:G.listStack.slice(0),quote:G.quote,indentedCode:G.indentedCode,trailingSpace:G.trailingSpace,trailingSpaceNewLine:G.trailingSpaceNewLine,md_inside:G.md_inside,fencedEndRE:G.fencedEndRE}},token:function(G,B){if(B.formatting=!1,G!=B.thisLine.stream){if(B.header=0,B.hr=!1,G.match(/^\s*$/,!0))return E(B),null;if(B.prevLine=B.thisLine,B.thisLine={stream:G},B.taskList=!1,B.trailingSpace=0,B.trailingSpaceNewLine=!1,!B.localState&&(B.f=B.block,B.f!=R)){var $=G.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(B.indentation=$,B.indentationDiff=null,$>0)return null}}return B.f(G,B)},innerMode:function(G){return G.block==R?{state:G.htmlState,mode:W}:G.localState?{state:G.localState,mode:G.localMode}:{state:G,mode:Z}},indent:function(G,B,$){return G.block==R&&W.indent?W.indent(G.htmlState,B,$):G.localState&&G.localMode.indent?G.localMode.indent(G.localState,B,$):Q.Pass},blankLine:E,getType:g,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Z},"xml"),Q.defineMIME("text/markdown","markdown"),Q.defineMIME("text/x-markdown","markdown")})},n6Qo:function(Ye,se,k){"use strict";k.d(se,"a",function(){return U});var Q=k("q1tI"),H=k("biw7"),M=k("fyJ8");function W(S){var L=S.className,d=S.index,v=S.children,C=S.colSpan,p=S.rowSpan,h=Q.useContext(H.a),f=h.prefixCls,n=h.fixedInfoList,r=n[d];return Q.createElement(M.a,Object.assign({className:L,index:d,component:"td",prefixCls:f,record:null,dataIndex:null,render:function(){return{children:v,props:{colSpan:C,rowSpan:p}}}},r))}function N(S){return Q.createElement("tr",Object.assign({},S))}function A(S){var L=S.children,d=Q.useContext(H.a),v=d.prefixCls;return Q.createElement("tfoot",{className:"".concat(v,"-summary")},L)}var F=se.b=A,U={Cell:W,Row:N}},nWbc:function(Ye,se,k){},nnTU:function(Ye,se,k){"use strict";k.d(se,"b",function(){return U}),k.d(se,"a",function(){return S});var Q=k("pmY6"),H=k("746U"),M=k("Cg/j"),W=k("MI8n"),N=k("24hK"),A=k("QDVR"),F=function(){for(var L=0,d=0,v=arguments.length;d<v;d++)L+=arguments[d].length;for(var C=Array(L),p=0,d=0;d<v;d++)for(var h=arguments[d],f=0,n=h.length;f<n;f++,p++)C[p]=h[f];return C},U=Object(M.c)("commandService"),S=new(function(){function L(){this._commands=new Map,this._onDidRegisterCommand=new W.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return L.prototype.registerCommand=function(d,v){var C=this;if(!d)throw new Error("invalid command");if(typeof d=="string"){if(!v)throw new Error("invalid command");return this.registerCommand({id:d,handler:v})}if(d.description){for(var p=[],h=0,f=d.description.args;h<f.length;h++){var n=f[h];p.push(n.constraint)}var r=d.handler;d.handler=function(y){for(var R=[],O=1;O<arguments.length;O++)R[O-1]=arguments[O];return Object(H.m)(R,p),r.apply(void 0,F([y],R))}}var o=d.id,l=this._commands.get(o);l||(l=new N.a,this._commands.set(o,l));var x=l.unshift(d),E=Object(Q.h)(function(){x();var y=C._commands.get(o);(y==null?void 0:y.isEmpty())&&C._commands.delete(o)});return this._onDidRegisterCommand.fire(o),E},L.prototype.registerCommandAlias=function(d,v){return S.registerCommand(d,function(C){for(var p,h=[],f=1;f<arguments.length;f++)h[f-1]=arguments[f];return(p=C.get(U)).executeCommand.apply(p,F([v],h))})},L.prototype.getCommand=function(d){var v=this._commands.get(d);return!v||v.isEmpty()?void 0:v.iterator().next().value},L.prototype.getCommands=function(){for(var d=new Map,v=0,C=Object(A.d)(this._commands);v<C.length;v++){var p=C[v],h=this.getCommand(p);h&&d.set(p,h)}return d},L}())},osHv:function(Ye,se,k){(function(Q){Q(k("VrN/"))})(function(Q){"use strict";var H=Q.Pos;function M(n,r){return n.line-r.line||n.ch-r.ch}var W="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",N=W+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",A=new RegExp("<(/?)(["+W+"]["+N+"]*)","g");function F(n,r,o,l){this.line=r,this.ch=o,this.cm=n,this.text=n.getLine(r),this.min=l?Math.max(l.from,n.firstLine()):n.firstLine(),this.max=l?Math.min(l.to-1,n.lastLine()):n.lastLine()}function U(n,r){var o=n.cm.getTokenTypeAt(H(n.line,r));return o&&/\btag\b/.test(o)}function S(n){return n.line>=n.max?void 0:(n.ch=0,n.text=n.cm.getLine(++n.line),!0)}function L(n){return n.line<=n.min?void 0:(n.text=n.cm.getLine(--n.line),n.ch=n.text.length,!0)}function d(n){for(;;){var r=n.text.indexOf(">",n.ch);if(r==-1){if(S(n))continue;return}if(!U(n,r+1)){n.ch=r+1;continue}var o=n.text.lastIndexOf("/",r),l=o>-1&&!/\S/.test(n.text.slice(o+1,r));return n.ch=r+1,l?"selfClose":"regular"}}function v(n){for(;;){var r=n.ch?n.text.lastIndexOf("<",n.ch-1):-1;if(r==-1){if(L(n))continue;return}if(!U(n,r+1)){n.ch=r;continue}A.lastIndex=r,n.ch=r;var o=A.exec(n.text);if(o&&o.index==r)return o}}function C(n){for(;;){A.lastIndex=n.ch;var r=A.exec(n.text);if(!r){if(S(n))continue;return}if(!U(n,r.index+1)){n.ch=r.index+1;continue}return n.ch=r.index+r[0].length,r}}function p(n){for(;;){var r=n.ch?n.text.lastIndexOf(">",n.ch-1):-1;if(r==-1){if(L(n))continue;return}if(!U(n,r+1)){n.ch=r;continue}var o=n.text.lastIndexOf("/",r),l=o>-1&&!/\S/.test(n.text.slice(o+1,r));return n.ch=r+1,l?"selfClose":"regular"}}function h(n,r){for(var o=[];;){var l=C(n),x,E=n.line,y=n.ch-(l?l[0].length:0);if(!l||!(x=d(n)))return;if(x=="selfClose")continue;if(l[1]){for(var R=o.length-1;R>=0;--R)if(o[R]==l[2]){o.length=R;break}if(R<0&&(!r||r==l[2]))return{tag:l[2],from:H(E,y),to:H(n.line,n.ch)}}else o.push(l[2])}}function f(n,r){for(var o=[];;){var l=p(n);if(!l)return;if(l=="selfClose"){v(n);continue}var x=n.line,E=n.ch,y=v(n);if(!y)return;if(y[1])o.push(y[2]);else{for(var R=o.length-1;R>=0;--R)if(o[R]==y[2]){o.length=R;break}if(R<0&&(!r||r==y[2]))return{tag:y[2],from:H(n.line,n.ch),to:H(x,E)}}}}Q.registerHelper("fold","xml",function(n,r){for(var o=new F(n,r.line,0);;){var l=C(o);if(!l||o.line!=r.line)return;var x=d(o);if(!x)return;if(!l[1]&&x!="selfClose"){var E=H(o.line,o.ch),y=h(o,l[2]);return y&&M(y.from,E)>0?{from:E,to:y.from}:null}}}),Q.findMatchingTag=function(n,r,o){var l=new F(n,r.line,r.ch,o);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var x=d(l),E=x&&H(l.line,l.ch),y=x&&v(l);if(!x||!y||M(l,r)>0)return;var R={from:H(l.line,l.ch),to:E,tag:y[2]};return x=="selfClose"?{open:R,close:null,at:"open"}:y[1]?{open:f(l,y[2]),close:R,at:"close"}:(l=new F(n,E.line,E.ch,o),{open:R,close:h(l,y[2]),at:"open"})},Q.findEnclosingTag=function(n,r,o,l){for(var x=new F(n,r.line,r.ch,o);;){var E=f(x,l);if(!E)break;var y=new F(n,r.line,r.ch,o),R=h(y,E.tag);if(R)return{open:E,close:R}}},Q.scanForClosingTag=function(n,r,o,l){var x=new F(n,r.line,r.ch,l?{from:0,to:l}:null);return h(x,o)}})},"p/48":function(Ye,se,k){},p5ED:function(Ye,se,k){"use strict";var Q=k("+L6B"),H=k("2/Rp"),M=k("5Dmo"),W=k("3S7+"),N=k("k1fw"),A=k("9og8"),F=k("tJVT"),U=k("WmNS"),S=k.n(U),L=k("q1tI"),d=k.n(L),v=k("vHTk"),C=k.n(v),p=k("yEEn"),h=k("ZW9T"),f=k("1vsH"),n=k("V0Rq"),r=k("m3rI");se.a=function(o){var l,x,E,y,R,O,g=o.editOffice,m=g===void 0?"view":g,s=o.name,u=o.data,_=o.theme,T=o.type,w=o.filename,P=o.monacoEditor,j=o.className,K=o.style,Z=o.close,G=o.onClose,B=o.hasMask,$=o.disabledDownload,ne=o.onImgDimensions,ae=o.otherData,fe=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_e=Object(F.a)(fe,2),Se=_e[0],we=_e[1],Me=Object(L.useState)(""),Le=Object(F.a)(Me,2),ge=Le[0],ue=Le[1],ke=Object(L.useState)(),lt=Object(F.a)(ke,2),ot=lt[0],st=lt[1],ce=window.ENV==="build"?"/react/build":"",pe=location.host.startsWith("localhost")?r.a.PROXY_SERVER:r.a.API_SERVER,Oe,ze=1024*1024,qe=10*ze,Je=Object(L.useRef)();(l=u)!==null&&l!==void 0&&l.startsWith("/api")&&T!=="txt"&&(u=r.a.API_SERVER+u),T==="office"&&(Oe=Object(f.P)(u).filesize,Oe>qe&&(T="other")),w&&(P.filename=w),Object(L.useEffect)(function(){var bt,Et,yt=(bt=document.cookie)===null||bt===void 0||((Et=bt.replace(/\s/g,""))===null||Et===void 0)?void 0:Et.split(";");yt==null||yt.map(function(Ot){var At=Ot.split("=");At[0]==="_educoder_session"&&ue(At[1])})},[]),Object(L.useEffect)(function(){T==="office"&&rt()},[T,u]);var rt=function(){var bt=Object(A.a)(S.a.mark(function Et(){var yt,Ot,At;return S.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return console.log("data:",u),yt=u,u.startsWith("http")||(yt=location.origin+yt),Ot=new URL(yt).pathname.split("/").pop(),xe.next=6,Object(n.U)({attachment_id:Ot});case 6:At=xe.sent,st(At);case 8:case"end":return xe.stop()}},Et)}));return function(){return bt.apply(this,arguments)}}(),tt=function(){if(u.startsWith("http")||u.startsWith("blob:")){Tt();return}Object(f.x)(w||"educoder",u,w)},Tt=function(){Object(f.v)(w||"educoder",decodeURIComponent(u))};return d.a.createElement("div",{style:Object(N.a)({},K||{}),className:"".concat(B&&C.a.bgBlack," ").concat(T?C.a.wrp:"hide")},Z&&d.a.createElement("div",{className:C.a.close,ref:Je},!!ne&&d.a.createElement(W.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Je.current}},d.a.createElement("span",{onClick:function(){G(),ne()}},d.a.createElement("i",{className:"icon-yulanpizhu"}))),!$&&d.a.createElement(W.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Je.current}},d.a.createElement("span",{onClick:Tt},d.a.createElement("i",{className:"icon-quxiaozhiding"}))),d.a.createElement(W.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Je.current}},d.a.createElement("span",{className:"",onClick:G},d.a.createElement("i",{className:"icon-guanbi1"})))),d.a.createElement("div",{className:"".concat(C.a[j]," ").concat(j," ").concat(C.a.monaco," ").concat(T==="txt"?"show":"hide")},T==="txt"&&d.a.createElement(h.b,P)),T==="audio"&&d.a.createElement("audio",{src:"".concat(((x=u)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((E=u)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(u),autoPlay:!0}),T==="video"&&d.a.createElement(d.a.Fragment,null,((y=u)===null||y===void 0?void 0:y.indexOf("http"))>-1?d.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):d.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),T==="office"&&ot&&d.a.createElement("iframe",{src:"".concat(ce,"/office.html?key=").concat(ot.key,"&url=").concat(pe+ot.url,"&callbackUrl=").concat(pe+ot.callbackUrl,"&fileType=").concat(ot.fileType,"&title=").concat(ot.title,"&model=").concat(m,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!$)}),(T==="xlsx"||T==="doc"||T==="pptx"||T==="docx")&&d.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(ae.key,"&url=").concat(r.a.API_SERVER+ae.url,"&callbackUrl=").concat(r.a.API_SERVER+ae.callbackUrl,"&fileType=").concat(ae.fileType,"&title=").concat(ae.title,"&model=").concat(ae.model)}),T==="html"&&d.a.createElement("iframe",{src:u+"&disposition=inline"}),T==="pdf"&&d.a.createElement("embed",{className:C.a.embed,src:u}),T==="image"&&d.a.createElement("img",{src:"".concat(((R=u)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=u)===null||O===void 0?void 0:O.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)}),T==="other"&&d.a.createElement("div",null,d.a.createElement(H.a,{type:"primary",size:"large",onClick:tt},d.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),T==="download"&&d.a.createElement(H.a,{type:"primary",size:"large",onClick:tt},d.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ye,se,k){},pPuO:function(Ye,se,k){Ye.exports={desc:"desc___2o_2w",info:"info___Uro3x","commit-info":"commit-info___o2-Ex"}},pmY6:function(Ye,se,k){"use strict";k.d(se,"g",function(){return N}),k.d(se,"f",function(){return A}),k.d(se,"e",function(){return F}),k.d(se,"h",function(){return U}),k.d(se,"b",function(){return S}),k.d(se,"a",function(){return L}),k.d(se,"d",function(){return d}),k.d(se,"c",function(){return v});var Q=!1,H="__is_disposable_tracked__";function M(C){if(!Q)return;if(C&&C!==L.None)try{C[H]=!0}catch(p){}}function W(C){if(!Q)return C;var p=new Error("Potentially leaked disposable").stack;return setTimeout(function(){C[H]||console.log(p)},3e3),C}function N(C){return typeof C.dispose=="function"&&C.dispose.length===0}function A(C){return Array.isArray(C)?(C.forEach(function(p){p&&(M(p),p.dispose())}),[]):C?(M(C),C.dispose(),C):void 0}function F(){for(var C=[],p=0;p<arguments.length;p++)C[p]=arguments[p];return C.forEach(M),W({dispose:function(){return A(C)}})}function U(C){var p=W({dispose:function(){M(p),C()}});return p}var S=function(){function C(){this._toDispose=new Set,this._isDisposed=!1}return C.prototype.dispose=function(){if(this._isDisposed)return;M(this),this._isDisposed=!0,this.clear()},C.prototype.clear=function(){this._toDispose.forEach(function(p){return p.dispose()}),this._toDispose.clear()},C.prototype.add=function(p){if(!p)return p;if(p===this)throw new Error("Cannot register a disposable on itself!");return M(p),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(p),p},C}(),L=function(){function C(){this._store=new S,W(this)}return C.prototype.dispose=function(){M(this),this._store.dispose()},C.prototype._register=function(p){if(p===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(p)},C.None=Object.freeze({dispose:function(){}}),C}(),d=function(){function C(){this._isDisposed=!1,W(this)}return Object.defineProperty(C.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(p){if(this._isDisposed||p===this._value)return;this._value&&this._value.dispose(),p&&M(p),this._value=p},enumerable:!0,configurable:!0}),C.prototype.clear=function(){this.value=void 0},C.prototype.dispose=function(){this._isDisposed=!0,M(this),this._value&&this._value.dispose(),this._value=void 0},C}(),v=function(){function C(p){this.object=p}return C.prototype.dispose=function(){},C}()},"qJ4+":function(Ye,se,k){},"rAM+":function(Ye,se,k){"use strict";k.d(se,"a",function(){return H});var Q=k("Qw5x");function H(M,W){var N;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(N=Object(Q.a)(M))||W&&M&&typeof M.length=="number"){N&&(M=N);var A=0,F=function(){};return{s:F,n:function(){return A>=M.length?{done:!0}:{done:!1,value:M[A++]}},e:function(v){throw v},f:F}}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,S=!1,L;return{s:function(){N=M[Symbol.iterator]()},n:function(){var v=N.next();return U=v.done,v},e:function(v){S=!0,L=v},f:function(){try{!U&&N.return!=null&&N.return()}finally{if(S)throw L}}}}},rUJ1:function(Ye,se){const k=/[&<>"']/,Q=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,W={"&":"&","<":"<",">":">",'"':""","'":"'"},N=O=>W[O];function A(O,g){if(g){if(k.test(O))return O.replace(Q,N)}else if(H.test(O))return O.replace(M,N);return O}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(O){return O.replace(F,(g,m)=>(m=m.toLowerCase(),m==="colon"?":":m.charAt(0)==="#"?m.charAt(1)==="x"?String.fromCharCode(parseInt(m.substring(2),16)):String.fromCharCode(+m.substring(1)):""))}const S=/(^|[^\[])\^/g;function L(O,g){O=O.source||O,g=g||"";const m={replace:(s,u)=>(u=u.source||u,u=u.replace(S,"$1"),O=O.replace(s,u),m),getRegex:()=>new RegExp(O,g)};return m}const d=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(O,g,m){if(O){let s;try{s=decodeURIComponent(U(m)).replace(d,"").toLowerCase()}catch(u){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}g&&!v.test(m)&&(m=r(g,m));try{m=encodeURI(m).replace(/%25/g,"%")}catch(s){return null}return m}const p={},h=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,n=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(O,g){p[" "+O]||(h.test(O)?p[" "+O]=O+"/":p[" "+O]=E(O,"/",!0)),O=p[" "+O];const m=O.indexOf(":")===-1;return g.substring(0,2)==="//"?m?g:O.replace(f,"$1")+g:g.charAt(0)==="/"?m?g:O.replace(n,"$1")+g:O+g}const o={exec:function(){}};function l(O){let g=1,m,s;for(;g<arguments.length;g++){m=arguments[g];for(s in m)Object.prototype.hasOwnProperty.call(m,s)&&(O[s]=m[s])}return O}function x(O,g){const m=O.replace(/\|/g,(_,T,w)=>{let P=!1,j=T;for(;--j>=0&&w[j]==="\\";)P=!P;return P?"|":" |"}),s=m.split(/ \|/);let u=0;if(s.length>g)s.splice(g);else for(;s.length<g;)s.push("");for(;u<s.length;u++)s[u]=s[u].trim().replace(/\\\|/g,"|");return s}function E(O,g,m){const s=O.length;if(s===0)return"";let u=0;for(;u<s;){const _=O.charAt(s-u-1);if(_===g&&!m)u++;else if(_!==g&&m)u++;else break}return O.substr(0,s-u)}function y(O,g){if(O.indexOf(g[1])===-1)return-1;const m=O.length;let s=0,u=0;for(;u<m;u++)if(O[u]==="\\")u++;else if(O[u]===g[0])s++;else if(O[u]===g[1]&&(s--,s<0))return u;return-1}function R(O){O&&O.sanitize&&!O.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")}Ye.exports={escape:A,unescape:U,edit:L,cleanUrl:C,resolveUrl:r,noopTest:o,merge:l,splitCells:x,rtrim:E,findClosingBracket:y,checkSanitizeDeprecation:R}},rdUC:function(Ye,se,k){var Q=k("MFOe"),H=Q.Global;Ye.exports={name:"localStorage",read:W,write:N,each:A,remove:F,clearAll:U};function M(){return H.localStorage}function W(S){return M().getItem(S)}function N(S,L){return M().setItem(S,L)}function A(S){for(var L=M().length-1;L>=0;L--){var d=M().key(L);S(W(d),d)}}function F(S){return M().removeItem(S)}function U(){return M().clear()}},sR1s:function(Ye,se,k){"use strict";k.d(se,"b",function(){return W}),k.d(se,"a",function(){return N}),k.d(se,"c",function(){return A}),k.d(se,"d",function(){return F});var Q=k("U8pU"),H="RC_TABLE_KEY";function M(U){return U==null?[]:Array.isArray(U)?U:[U]}function W(U,S){if(!S&&typeof S!="number")return U;for(var L=M(S),d=U,v=0;v<L.length;v+=1){if(!d)return null;var C=L[v];d=d[C]}return d}function N(U){var S=[],L={};return U.forEach(function(d){for(var v=d||{},C=v.key,p=v.dataIndex,h=C||M(p).join("-")||H;L[h];)h="".concat(h,"_next");L[h]=!0,S.push(h)}),S}function A(){var U={};function S(C,p){p&&Object.keys(p).forEach(function(h){var f=p[h];f&&Object(Q.a)(f)==="object"?(C[h]=C[h]||{},S(C[h],f)):C[h]=f})}for(var L=arguments.length,d=new Array(L),v=0;v<L;v++)d[v]=arguments[v];return d.forEach(function(C){S(U,C)}),U}function F(U){return U!=null}},sboe:function(Ye,se,k){"use strict";k.d(se,"a",function(){return M});var Q=k("q1tI"),H=k.n(Q),M=Q.createContext(null)},t23M:function(Ye,se,k){"use strict";var Q=k("VTBJ"),H=k("1OyB"),M=k("vuIU"),W=k("Ji7U"),N=k("LK+K"),A=k("q1tI"),F=k.n(A),U=k("m+aA"),S=k("Zm9Q"),L=k("Kwbf"),d=k("c+Xe"),v=k("bdgK"),C="rc-observer-key",p=function(h){Object(W.a)(n,h);var f=Object(N.a)(n);function n(){var r;return Object(H.a)(this,n),r=f.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(o){var l=r.props.onResize,x=o[0].target,E=x.getBoundingClientRect(),y=E.width,R=E.height,O=x.offsetWidth,g=x.offsetHeight,m=Math.floor(y),s=Math.floor(R);if(r.state.width!==m||r.state.height!==s||r.state.offsetWidth!==O||r.state.offsetHeight!==g){var u={width:m,height:s,offsetWidth:O,offsetHeight:g};r.setState(u),l&&Promise.resolve().then(function(){l(Object(Q.a)(Object(Q.a)({},u),{},{offsetWidth:O,offsetHeight:g}))})}},r.setChildNode=function(o){r.childNode=o},r}return Object(M.a)(n,[{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 l=Object(U.a)(this.childNode||this),x=l!==this.currentElement;x&&(this.destroyObserver(),this.currentElement=l),!this.resizeObserver&&l&&(this.resizeObserver=new v.default(this.onResize),this.resizeObserver.observe(l))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var o=this.props.children,l=Object(S.a)(o);if(l.length>1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(l.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var x=l[0];if(A.isValidElement(x)&&Object(d.c)(x)){var E=x.ref;l[0]=A.cloneElement(x,{ref:Object(d.a)(E,this.setChildNode)})}return l.length===1?l[0]:l.map(function(y,R){return!A.isValidElement(y)||"key"in y&&y.key!==null?y:A.cloneElement(y,{key:"".concat(C,"-").concat(R)})})}}]),n}(A.Component);p.displayName="ResizeObserver",se.a=p},uD2n:function(Ye,se,k){Ye.exports={"dis-input-editor-container":"dis-input-editor-container___3uf7A",active:"active___20tmT","input-mask":"input-mask___1kijM","text-area":"text-area___2gTEA","tip-container":"tip-container___2tKkE",hide:"hide___3jIwM","md-container":"md-container___14zRI","btn-send":"btn-send___3TabT"}},uMZB:function(Ye,se,k){Ye.exports={header:"header___3a50V",checkboxs:"checkboxs___3TnBC",field:"field___SHW6f","oj-form-container":"oj-form-container___36KBv","oj-left-panel":"oj-left-panel___3Fdj5","oj-form-info":"oj-form-info___dilPb",footer:"footer___1Ie9U","test-case-name":"test-case-name___356US","btn-remove-case":"btn-remove-case___1Z5cd","icon-tag":"icon-tag___3zUaP",btn_back:"btn_back___2UBbR",testJi:"testJi___1dyLk",upBtn:"upBtn___1I0SJ"}},uQRt:function(Ye,se,k){Ye.exports=Q;function Q(){return k("gaXo"),{}}},ulZh:function(Ye,se,k){typeof window!="undefined"&&function(H,M){Ye.exports=M()}(this,function(){return function(Q){var H={};function M(W){if(H[W])return H[W].exports;var N=H[W]={i:W,l:!1,exports:{}};return Q[W].call(N.exports,N,N.exports,M),N.l=!0,N.exports}return M.m=Q,M.c=H,M.d=function(W,N,A){M.o(W,N)||Object.defineProperty(W,N,{enumerable:!0,get:A})},M.r=function(W){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:!0})},M.t=function(W,N){if(N&1&&(W=M(W)),N&8)return W;if(N&4&&typeof W=="object"&&W&&W.__esModule)return W;var A=Object.create(null);if(M.r(A),Object.defineProperty(A,"default",{enumerable:!0,value:W}),N&2&&typeof W!="string")for(var F in W)M.d(A,F,function(U){return W[U]}.bind(null,F));return A},M.n=function(W){var N=W&&W.__esModule?function(){return W.default}:function(){return W};return M.d(N,"a",N),N},M.o=function(W,N){return Object.prototype.hasOwnProperty.call(W,N)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Q,H,M){"use strict";var W=Object.prototype.hasOwnProperty,N="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(N=!1));function F(d,v,C){this.fn=d,this.context=v,this.once=C||!1}function U(d,v,C,p,h){if(typeof C!="function")throw new TypeError("The listener must be a function");var f=new F(C,p||d,h),n=N?N+v:v;return d._events[n]?d._events[n].fn?d._events[n]=[d._events[n],f]:d._events[n].push(f):(d._events[n]=f,d._eventsCount++),d}function S(d,v){--d._eventsCount===0?d._events=new A:delete d._events[v]}function L(){this._events=new A,this._eventsCount=0}L.prototype.eventNames=function(){var v=[],C,p;if(this._eventsCount===0)return v;for(p in C=this._events)W.call(C,p)&&v.push(N?p.slice(1):p);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(C)):v},L.prototype.listeners=function(v){var C=N?N+v:v,p=this._events[C];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,f=p.length,n=new Array(f);h<f;h++)n[h]=p[h].fn;return n},L.prototype.listenerCount=function(v){var C=N?N+v:v,p=this._events[C];return p?p.fn?1:p.length:0},L.prototype.emit=function(v,C,p,h,f,n){var r=N?N+v:v;if(!this._events[r])return!1;var o=this._events[r],l=arguments.length,x,E;if(o.fn){o.once&&this.removeListener(v,o.fn,void 0,!0);switch(l){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,C),!0;case 3:return o.fn.call(o.context,C,p),!0;case 4:return o.fn.call(o.context,C,p,h),!0;case 5:return o.fn.call(o.context,C,p,h,f),!0;case 6:return o.fn.call(o.context,C,p,h,f,n),!0}for(E=1,x=new Array(l-1);E<l;E++)x[E-1]=arguments[E];o.fn.apply(o.context,x)}else{var y=o.length,R;for(E=0;E<y;E++){o[E].once&&this.removeListener(v,o[E].fn,void 0,!0);switch(l){case 1:o[E].fn.call(o[E].context);break;case 2:o[E].fn.call(o[E].context,C);break;case 3:o[E].fn.call(o[E].context,C,p);break;case 4:o[E].fn.call(o[E].context,C,p,h);break;default:if(!x)for(R=1,x=new Array(l-1);R<l;R++)x[R-1]=arguments[R];o[E].fn.apply(o[E].context,x)}}}return!0},L.prototype.on=function(v,C,p){return U(this,v,C,p,!1)},L.prototype.once=function(v,C,p){return U(this,v,C,p,!0)},L.prototype.removeListener=function(v,C,p,h){var f=N?N+v:v;if(!this._events[f])return this;if(!C)return S(this,f),this;var n=this._events[f];if(n.fn)n.fn===C&&(!h||n.once)&&(!p||n.context===p)&&S(this,f);else{for(var r=0,o=[],l=n.length;r<l;r++)(n[r].fn!==C||h&&!n[r].once||p&&n[r].context!==p)&&o.push(n[r]);o.length?this._events[f]=o.length===1?o[0]:o:S(this,f)}return this},L.prototype.removeAllListeners=function(v){var C;return v?(C=N?N+v:v,this._events[C]&&S(this,C)):(this._events=new A,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=N,L.EventEmitter=L,Q.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q,H,M){(function(W){var N=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,A=/^([^\/?#]*)([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,S={buildAbsoluteURL:function(L,d,v){if(v=v||{},L=L.trim(),d=d.trim(),!d){if(!v.alwaysNormalize)return L;var C=S.parseURL(L);if(!C)throw new Error("Error trying to parse base URL.");return C.path=S.normalizePath(C.path),S.buildURLFromParts(C)}var p=S.parseURL(d);if(!p)throw new Error("Error trying to parse relative URL.");if(p.scheme)return v.alwaysNormalize?(p.path=S.normalizePath(p.path),S.buildURLFromParts(p)):d;var h=S.parseURL(L);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var f=A.exec(h.path);h.netLoc=f[1],h.path=f[2]}h.netLoc&&!h.path&&(h.path="/");var n={scheme:h.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(n.netLoc=h.netLoc,p.path[0]!=="/"))if(!p.path)n.path=h.path,p.params||(n.params=h.params,p.query||(n.query=h.query));else{var r=h.path,o=r.substring(0,r.lastIndexOf("/")+1)+p.path;n.path=S.normalizePath(o)}return n.path===null&&(n.path=v.alwaysNormalize?S.normalizePath(p.path):p.path),S.buildURLFromParts(n)},parseURL:function(L){var d=N.exec(L);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(F,"");L.length!==(L=L.replace(U,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};Q.exports=S})(this)},"./node_modules/webworkify-webpack/index.js":function(Q,H,M){function W(v){var C={};function p(f){if(C[f])return C[f].exports;var n=C[f]={i:f,l:!1,exports:{}};return v[f].call(n.exports,n,n.exports,p),n.l=!0,n.exports}p.m=v,p.c=C,p.i=function(f){return f},p.d=function(f,n,r){p.o(f,n)||Object.defineProperty(f,n,{configurable:!1,enumerable:!0,get:r})},p.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},p.n=function(f){var n=f&&f.__esModule?function(){return f.default}:function(){return f};return p.d(n,"a",n),n},p.o=function(f,n){return Object.prototype.hasOwnProperty.call(f,n)},p.p="/",p.oe=function(f){throw console.error(f),f};var h=p(p.s=ENTRY_MODULE);return h.default||h}var N="[\\.|\\-|\\+|\\w|/|@]+",A="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+N+").*?\\)";function F(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(v){return!isNaN(1*v)}function S(v,C,p){var h={};h[p]=[];var f=C.toString(),n=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!n)return h;for(var r=n[1],o=new RegExp("(\\\\n|\\W)"+F(r)+A,"g"),l;l=o.exec(f);){if(l[3]==="dll-reference")continue;h[p].push(l[3])}for(o=new RegExp("\\("+F(r)+'\\("(dll-reference\\s('+N+'))"\\)\\)'+A,"g");l=o.exec(f);)v[l[2]]||(h[p].push(l[1]),v[l[2]]=M(l[1]).m),h[l[2]]=h[l[2]]||[],h[l[2]].push(l[4]);for(var x=Object.keys(h),E=0;E<x.length;E++)for(var y=0;y<h[x[E]].length;y++)U(h[x[E]][y])&&(h[x[E]][y]=1*h[x[E]][y]);return h}function L(v){var C=Object.keys(v);return C.reduce(function(p,h){return p||v[h].length>0},!1)}function d(v,C){for(var p={main:[C]},h={main:[]},f={main:{}};L(p);)for(var n=Object.keys(p),r=0;r<n.length;r++){var o=n[r],l=p[o],x=l.pop();if(f[o]=f[o]||{},f[o][x]||!v[o][x])continue;f[o][x]=!0,h[o]=h[o]||[],h[o].push(x);for(var E=S(v,v[o][x],o),y=Object.keys(E),R=0;R<y.length;R++)p[y[R]]=p[y[R]]||[],p[y[R]]=p[y[R]].concat(E[y[R]])}return h}Q.exports=function(v,C){C=C||{};var p={main:M.m},h=C.all?{main:Object.keys(p.main)}:d(p,v),f="";Object.keys(h).filter(function(x){return x!=="main"}).forEach(function(x){for(var E=0;h[x][E];)E++;h[x].push(E),p[x][E]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+x+" = ("+W.toString().replace("ENTRY_MODULE",JSON.stringify(E))+")({"+h[x].map(function(y){return""+JSON.stringify(y)+": "+p[x][y].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+W.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+h.main.map(function(x){return""+JSON.stringify(x)+": "+p.main[x].toString()}).join(",")+"}))(self);";var n=new window.Blob([f],{type:"text/javascript"});if(C.bare)return n;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,o=r.createObjectURL(n),l=new window.Worker(o);return l.objectURL=o,l}},"./src/config.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"hlsDefaultConfig",function(){return R}),M.d(H,"mergeConfig",function(){return g}),M.d(H,"enableStreamingMode",function(){return m});var W=M("./src/controller/abr-controller.ts"),N=M("./src/controller/audio-stream-controller.ts"),A=M("./src/controller/audio-track-controller.ts"),F=M("./src/controller/subtitle-stream-controller.ts"),U=M("./src/controller/subtitle-track-controller.ts"),S=M("./src/controller/buffer-controller.ts"),L=M("./src/controller/timeline-controller.ts"),d=M("./src/controller/cap-level-controller.ts"),v=M("./src/controller/fps-controller.ts"),C=M("./src/controller/eme-controller.ts"),p=M("./src/controller/cmcd-controller.ts"),h=M("./src/utils/xhr-loader.ts"),f=M("./src/utils/fetch-loader.ts"),n=M("./src/utils/cues.ts"),r=M("./src/utils/mediakeys-helper.ts"),o=M("./src/utils/logger.ts");function l(){return l=Object.assign||function(s){for(var u=1;u<arguments.length;u++){var _=arguments[u];for(var T in _)Object.prototype.hasOwnProperty.call(_,T)&&(s[T]=_[T])}return s},l.apply(this,arguments)}function x(s,u){var _=Object.keys(s);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(s);u&&(T=T.filter(function(w){return Object.getOwnPropertyDescriptor(s,w).enumerable})),_.push.apply(_,T)}return _}function E(s){for(var u=1;u<arguments.length;u++){var _=arguments[u]!=null?arguments[u]:{};u%2?x(Object(_),!0).forEach(function(T){y(s,T,_[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(_)):x(Object(_)).forEach(function(T){Object.defineProperty(s,T,Object.getOwnPropertyDescriptor(_,T))})}return s}function y(s,u,_){return u in s?Object.defineProperty(s,u,{value:_,enumerable:!0,configurable:!0,writable:!0}):s[u]=_,s}var R=E(E({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:h.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:W.default,bufferController:S.default,capLevelController:d.default,fpsController:v.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:F.SubtitleStreamController,subtitleTrackController:U.default,timelineController:L.TimelineController,audioStreamController:N.default,audioTrackController:A.default,emeController:C.default,cmcdController:p.default});function O(){return{cueHandler:n.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 g(s,u){if((u.liveSyncDurationCount||u.liveMaxLatencyDurationCount)&&(u.liveSyncDuration||u.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(u.liveMaxLatencyDurationCount!==void 0&&(u.liveSyncDurationCount===void 0||u.liveMaxLatencyDurationCount<=u.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(u.liveMaxLatencyDuration!==void 0&&(u.liveSyncDuration===void 0||u.liveMaxLatencyDuration<=u.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return l({},s,u)}function m(s){var u=s.loader;if(u!==f.default&&u!==h.default)o.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1;else{var _=Object(f.fetchSupported)();_&&(s.loader=f.default,s.progressive=!0,s.enableSoftwareAES=!0,o.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/polyfills/number.ts"),N=M("./src/utils/ewma-bandwidth-estimator.ts"),A=M("./src/events.ts"),F=M("./src/utils/buffer-helper.ts"),U=M("./src/errors.ts"),S=M("./src/types/loader.ts"),L=M("./src/utils/logger.ts");function d(p,h){for(var f=0;f<h.length;f++){var n=h[f];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}function v(p,h,f){return h&&d(p.prototype,h),f&&d(p,f),p}var C=function(){function p(f){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=f;var n=f.config;this.bwEstimator=new N.default(n.abrEwmaSlowVoD,n.abrEwmaFastVoD,n.abrEwmaDefaultEstimate),this.registerListeners()}var h=p.prototype;return h.registerListeners=function(){var n=this.hls;n.on(A.Events.FRAG_LOADING,this.onFragLoading,this),n.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.on(A.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var n=this.hls;n.off(A.Events.FRAG_LOADING,this.onFragLoading,this),n.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this),n.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),n.off(A.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},h.onFragLoading=function(n,r){var o=r.frag;if(o.type===S.PlaylistLevelType.MAIN&&!this.timer){var l;this.fragCurrent=o,this.partCurrent=(l=r.part)!=null?l:null,this.timer=self.setInterval(this.onCheck,100)}},h.onLevelLoaded=function(n,r){var o=this.hls.config;r.details.live?this.bwEstimator.update(o.abrEwmaSlowLive,o.abrEwmaFastLive):this.bwEstimator.update(o.abrEwmaSlowVoD,o.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var n=this.fragCurrent,r=this.partCurrent,o=this.hls,l=o.autoLevelEnabled,x=o.config,E=o.media;if(!n||!E)return;var y=r?r.stats:n.stats,R=r?r.duration:n.duration;if(y.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!l||E.paused||!E.playbackRate||!E.readyState)return;var O=performance.now()-y.loading.start,g=Math.abs(E.playbackRate);if(O<=500*R/g)return;var m=o.levels,s=o.minAutoLevel,u=m[n.level],_=y.total||Math.max(y.loaded,Math.round(R*u.maxBitrate/8)),T=Math.max(1,y.bwEstimate?y.bwEstimate/8:y.loaded*1e3/O),w=(_-y.loaded)/T,P=E.currentTime,j=(F.BufferHelper.bufferInfo(E,P,x.maxBufferHole).end-P)/g;if(j>=2*R/g||w<=j)return;var K=Number.POSITIVE_INFINITY,Z;for(Z=n.level-1;Z>s;Z--){var G=m[Z].maxBitrate;if(K=R*G/(8*.8*T),K<j)break}if(K>=w)return;var B=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+n.sn+(r?" part "+r.index:"")+" of level "+n.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Z+`
|
|
Current BW estimate: `+(Object(W.isFiniteNumber)(B)?(B/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+w.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+K.toFixed(3)+` s
|
|
Time to underbuffer: `+j.toFixed(3)+" s"),o.nextLoadLevel=Z,this.bwEstimator.sample(O,y.loaded),this.clearTimer(),n.loader&&(this.fragCurrent=this.partCurrent=null,n.loader.abort()),o.trigger(A.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:n,part:r,stats:y})},h.onFragLoaded=function(n,r){var o=r.frag,l=r.part;if(o.type===S.PlaylistLevelType.MAIN&&Object(W.isFiniteNumber)(o.sn)){var x=l?l.stats:o.stats,E=l?l.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[o.level],R=(y.loaded?y.loaded.bytes:0)+x.loaded,O=(y.loaded?y.loaded.duration:0)+E;y.loaded={bytes:R,duration:O},y.realBitrate=Math.round(8*R/O)}if(o.bitrateTest){var g={stats:x,frag:o,part:l,id:o.type};this.onFragBuffered(A.Events.FRAG_BUFFERED,g),o.bitrateTest=!1}}},h.onFragBuffered=function(n,r){var o=r.frag,l=r.part,x=l?l.stats:o.stats;if(x.aborted)return;if(o.type!==S.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},h.onError=function(n,r){switch(r.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var n=this.fragCurrent,r=this.partCurrent,o=this.hls,l=o.maxAutoLevel,x=o.config,E=o.minAutoLevel,y=o.media,R=r?r.duration:n?n.duration:0,O=y?y.currentTime:0,g=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,m=this.bwEstimator?this.bwEstimator.getEstimate():x.abrEwmaDefaultEstimate,s=(F.BufferHelper.bufferInfo(y,O,x.maxBufferHole).end-O)/g,u=this.findBestLevel(m,E,l,s,x.abrBandWidthFactor,x.abrBandWidthUpFactor);if(u>=0)return u;L.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,x.maxStarvationDelay):x.maxStarvationDelay,T=x.abrBandWidthFactor,w=x.abrBandWidthUpFactor;if(!s){var P=this.bitrateTestDelay;if(P){var j=R?Math.min(R,x.maxLoadingDelay):x.maxLoadingDelay;_=j-P,L.logger.trace("bitrate test took "+Math.round(1e3*P)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),T=w=1}}return u=this.findBestLevel(m,E,l,s+_,T,w),Math.max(u,0)},h.findBestLevel=function(n,r,o,l,x,E){for(var y,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,m=this.hls.levels,s=m[g],u=!!(s!=null&&(y=s.details)!==null&&y!==void 0&&y.live),_=s==null?void 0:s.codecSet,T=O?O.duration:R?R.duration:0,w=o;w>=r;w--){var P=m[w];if(!P||_&&P.codecSet!==_)continue;var j=P.details,K=(O?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||T,Z=void 0;w<=g?Z=x*n:Z=E*n;var G=m[w].maxBitrate,B=G*K/Z;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(Z)+"/"+G+"/"+K+"/"+l+"/"+B),Z>G&&(!B||u&&!this.bitrateTestDelay||B<l))return w}return-1},v(p,[{key:"nextAutoLevel",get:function(){var n=this._nextAutoLevel,r=this.bwEstimator;if(n!==-1&&(!r||!r.canEstimate()))return n;var o=this.getNextABRAutoLevel();return n!==-1&&(o=Math.min(n,o)),o},set:function(n){this._nextAutoLevel=n}}]),p}();H.default=C},"./src/controller/audio-stream-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/polyfills/number.ts"),N=M("./src/controller/base-stream-controller.ts"),A=M("./src/events.ts"),F=M("./src/utils/buffer-helper.ts"),U=M("./src/controller/fragment-tracker.ts"),S=M("./src/types/level.ts"),L=M("./src/types/loader.ts"),d=M("./src/loader/fragment.ts"),v=M("./src/demux/chunk-cache.ts"),C=M("./src/demux/transmuxer-interface.ts"),p=M("./src/types/transmuxer.ts"),h=M("./src/controller/fragment-finders.ts"),f=M("./src/utils/discontinuities.ts"),n=M("./src/errors.ts"),r=M("./src/utils/logger.ts");function o(){return o=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(R[m]=g[m])}return R},o.apply(this,arguments)}function l(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,x(R,O)}function x(R,O){return x=Object.setPrototypeOf||function(m,s){return m.__proto__=s,m},x(R,O)}var E=100,y=function(R){l(O,R);function O(m,s){var u;return u=R.call(this,m,s,"[audio-stream-controller]")||this,u.videoBuffer=null,u.videoTrackCC=-1,u.waitingVideoCC=-1,u.audioSwitch=!1,u.trackId=-1,u.waitingData=null,u.mainDetails=null,u.bufferFlushed=!1,u._registerListeners(),u}var g=O.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var s=this.hls;s.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(A.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.on(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.on(A.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(A.Events.ERROR,this.onError,this),s.on(A.Events.BUFFER_RESET,this.onBufferReset,this),s.on(A.Events.BUFFER_CREATED,this.onBufferCreated,this),s.on(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.on(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var s=this.hls;s.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(A.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),s.off(A.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),s.off(A.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(A.Events.ERROR,this.onError,this),s.off(A.Events.BUFFER_RESET,this.onBufferReset,this),s.off(A.Events.BUFFER_CREATED,this.onBufferCreated,this),s.off(A.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),s.off(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(A.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(s,u){var _=u.frag,T=u.id,w=u.initPTS;if(T==="main"){var P=_.cc;this.initPTS[_.cc]=w,this.log("InitPTS for cc: "+P+" found from main: "+w),this.videoTrackCC=P,this.state===N.State.WAITING_INIT_PTS&&this.tick()}},g.startLoad=function(s){if(!this.levels){this.startPosition=s,this.state=N.State.STOPPED;return}var u=this.lastCurrentTime;this.stopLoad(),this.setInterval(E),this.fragLoadError=0,u>0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=N.State.IDLE):(this.loadedmetadata=!1,this.state=N.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},g.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_TRACK:{var s,u=this.levels,_=this.trackId,T=u==null||((s=u[_])===null||s===void 0)?void 0:s.details;if(T){if(this.waitForCdnTuneIn(T))break;this.state=N.State.WAITING_INIT_PTS}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var w,P=performance.now(),j=this.retryDate;(!j||P>=j||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=N.State.IDLE);break}case N.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var Z=K.frag,G=K.part,B=K.cache,$=K.complete;if(this.initPTS[Z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.FRAG_LOADING;var ne=B.flush(),ae={frag:Z,part:G,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(ae),$&&R.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+Z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),_e=F.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Se=Object(h.fragmentWithinToleranceTest)(_e.end,this.config.maxFragLookUpTolerance,Z);Se<0&&(r.logger.log("Waiting fragment cc ("+Z.cc+") @ "+Z.start+" cancelled because another fragment at "+_e.end+" is needed"),this.clearWaitingFragment())}}else this.state=N.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=N.State.IDLE)},g.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:s,_=u.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},g.doTickIdle=function(){var s,u,_=this.hls,T=this.levels,w=this.media,P=this.trackId,j=_.config;if(!T||!T[P])return;if(!w&&(this.startFragRequested||!j.startFragPrefetch))return;var K=T[P],Z=K.details;if(!Z||Z.live&&this.levelLastLoaded!==P||this.waitForCdnTuneIn(Z)){this.state=N.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,d.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(G===null)return;var B=G.len,$=this.getMaxBufferLength(),ne=this.audioSwitch;if(B>=$&&!ne)return;if(!ne&&this._streamEnded(G,Z)){_.trigger(A.Events.BUFFER_EOS,{type:"audio"}),this.state=N.State.ENDED;return}var ae=Z.fragments,fe=ae[0].start,_e=G.end;if(ne){var Se=this.getLoadPosition();_e=Se,Z.PTSKnown&&Se<fe&&((G.end>fe||G.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=fe+.05))}var we=this.getNextFragment(_e,Z);if(!we){this.bufferFlushed=!0;return}((s=we.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((u=we.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(we,Z):this.loadFragment(we,Z,_e)},g.getMaxBufferLength=function(){var s=R.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return u===null?s:Math.max(s,u.len)},g.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(s,u){var _=u.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(T){return new S.Level(T)})},g.onAudioTrackSwitching=function(s,u){var _=!!u.url;this.trackId=u.id;var T=this.fragCurrent;T!=null&&T.loader&&T.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(E):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=N.State.IDLE):this.state=N.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(s,u){this.mainDetails=u.details},g.onAudioTrackLoaded=function(s,u){var _,T=this.levels,w=u.details,P=u.id;if(!T){this.warn("Audio tracks were reset while loading level "+P);return}this.log("Track "+P+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var j=T[P],K=0;if(w.live||(_=j.details)!==null&&_!==void 0&&_.live){var Z=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!Z)return;!j.details&&w.hasProgramDateTime&&Z.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(w,Z),K=w.fragments[0].start):K=this.alignPlaylists(w,j.details)}j.details=w,this.levelLastLoaded=P,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(j.details,K),this.state===N.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=N.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(s){var u,_=s.frag,T=s.part,w=s.payload,P=this.config,j=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var Z=K[j];console.assert(Z,"Audio track is defined on fragment load progress");var G=Z.details;console.assert(G,"Audio track details are defined on fragment load progress");var B=P.defaultAudioCodec||Z.audioCodec||"mp4a.40.2",$=this.transmuxer;$||($=this.transmuxer=new C.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[_.cc],ae=(u=_.initSegment)===null||u===void 0?void 0:u.data;if(ne!==void 0){var fe=!1,_e=T?T.index:-1,Se=_e!==-1,we=new p.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,w.byteLength,_e,Se);$.push(w,ae,B,"",_,T,G.totalduration,fe,we,ne)}else{r.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+G.startSN+" ,"+G.endSN+"],track "+j);var Me=this.waitingData=this.waitingData||{frag:_,part:T,cache:new v.default,complete:!1},Le=Me.cache;Le.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=N.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,s)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(s,u){var _=u.tracks.audio;_&&(this.mediaBuffer=_.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},g.onFragBuffered=function(s,u){var _=u.frag,T=u.part;if(_.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(T?" p: "+T.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,T)},g.onError=function(s,u){switch(u.details){case n.ErrorDetails.FRAG_LOAD_ERROR:case n.ErrorDetails.FRAG_LOAD_TIMEOUT:case n.ErrorDetails.KEY_LOAD_ERROR:case n.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,u);break;case n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case n.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==N.State.ERROR&&this.state!==N.State.STOPPED&&(this.state=u.fatal?N.State.ERROR:N.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case n.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var _=!0,T=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);T&&T.len>.5&&(_=!this.reduceMaxBufferLength(T.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(s,u){var _=u.type;_===d.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(s){var u,_="audio",T=this.hls,w=s.remuxResult,P=s.chunkMeta,j=this.getCurrentContext(P);if(!j){this.warn("The loading context changed while buffering fragment "+P.sn+" of level "+P.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(P.level);return}var K=j.frag,Z=j.part,G=w.audio,B=w.text,$=w.id3,ne=w.initSegment;if(this.fragContextChanged(K))return;if(this.state=N.State.PARSING,this.audioSwitch&&G&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,K,P),T.trigger(A.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:_,tracks:ne.tracks})),G){var ae=G.startPTS,fe=G.endPTS,_e=G.startDTS,Se=G.endDTS;Z&&(Z.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:fe,startDTS:_e,endDTS:Se}),K.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,ae,fe,_e,Se),this.bufferFragmentData(G,K,Z,P)}if($!=null&&(u=$.samples)!==null&&u!==void 0&&u.length){var we=o({frag:K,id:_},$);T.trigger(A.Events.FRAG_PARSING_METADATA,we)}if(B){var Me=o({frag:K,id:_},B);T.trigger(A.Events.FRAG_PARSING_USERDATA,Me)}},g._bufferInitSegment=function(s,u,_){if(this.state!==N.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(A.Events.BUFFER_CODECS,s);var w=T.initSegment;if(w!=null&&w.byteLength){var P={type:"audio",frag:u,part:null,chunkMeta:_,parent:u.type,data:w};this.hls.trigger(A.Events.BUFFER_APPENDING,P)}this.tick()},g.loadFragment=function(s,u,_){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):u.live&&!Object(W.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=N.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,s,u,_)))},g.completeAudioSwitch=function(){var s=this.hls,u=this.media,_=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(A.Events.AUDIO_TRACK_SWITCHED,{id:_})},O}(N.default);H.default=y},"./src/controller/audio-track-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts"),N=M("./src/errors.ts"),A=M("./src/controller/base-playlist-controller.ts"),F=M("./src/types/loader.ts");function U(C,p){for(var h=0;h<p.length;h++){var f=p[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(C,f.key,f)}}function S(C,p,h){return p&&U(C.prototype,p),h&&U(C,h),C}function L(C,p){C.prototype=Object.create(p.prototype),C.prototype.constructor=C,d(C,p)}function d(C,p){return d=Object.setPrototypeOf||function(f,n){return f.__proto__=n,f},d(C,p)}var v=function(C){L(p,C);function p(f){var n;return n=C.call(this,f,"[audio-track-controller]")||this,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.trackName="",n.selectDefaultTrack=!0,n.registerListeners(),n}var h=p.prototype;return h.registerListeners=function(){var n=this.hls;n.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.on(W.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var n=this.hls;n.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),n.off(W.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,C.prototype.destroy.call(this)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},h.onManifestParsed=function(n,r){this.tracks=r.audioTracks||[]},h.onAudioTrackLoaded=function(n,r){var o=r.id,l=r.details,x=this.tracksInGroup[o];if(!x){this.warn("Invalid audio track id "+o);return}var E=x.details;x.details=r.details,this.log("audioTrack "+o+" loaded ["+l.startSN+"-"+l.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,r,E))},h.onLevelLoading=function(n,r){this.switchLevel(r.level)},h.onLevelSwitching=function(n,r){this.switchLevel(r.level)},h.switchLevel=function(n){var r=this.hls.levels[n];if(!(r!=null&&r.audioGroupIds))return;var o=r.audioGroupIds[r.urlId];if(this.groupId!==o){this.groupId=o;var l=this.tracks.filter(function(E){return!o||E.groupId===o});this.selectDefaultTrack&&!l.some(function(E){return E.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=l;var x={audioTracks:l};this.log("Updating audio tracks, "+l.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,x),this.selectInitialTrack()}},h.onError=function(n,r){if(C.prototype.onError.call(this,n,r),r.fatal||!r.context)return;r.context.type===F.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},h.setAudioTrack=function(n){var r=this.tracksInGroup;if(n<0||n>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var o=r[this.trackId];this.log("Now switching to audio-track index "+n);var l=r[n],x=l.id,E=l.groupId,y=E===void 0?"":E,R=l.name,O=l.type,g=l.url;if(this.trackId=n,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:x,groupId:y,name:R,type:O,url:g}),l.details&&!l.details.live)return;var m=this.switchParams(l.url,o==null?void 0:o.details);this.loadPlaylist(m)},h.selectInitialTrack=function(){var n=this.tracksInGroup;console.assert(n.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,o=this.findTrackId(r)||this.findTrackId();o!==-1?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(n){for(var r=this.tracksInGroup,o=0;o<r.length;o++){var l=r[o];if((!this.selectDefaultTrack||l.default)&&(!n||n===l.name))return l.id}return-1},h.loadPlaylist=function(n){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var o=r.id,l=r.groupId,x=r.url;if(n)try{x=n.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(W.Events.AUDIO_TRACK_LOADING,{url:x,id:o,groupId:l,deliveryDirectives:n||null})}},S(p,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1,this.setAudioTrack(n)}}]),p}(A.default);H.default=v},"./src/controller/base-playlist-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return S});var W=M("./src/polyfills/number.ts"),N=M("./src/types/level.ts"),A=M("./src/controller/level-helper.ts"),F=M("./src/utils/logger.ts"),U=M("./src/errors.ts"),S=function(){function L(v,C){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,C+":"),this.warn=F.logger.warn.bind(F.logger,C+":"),this.hls=v}var d=L.prototype;return d.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},d.onError=function(C,p){p.fatal&&p.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},d.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},d.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},d.stopLoad=function(){this.canLoad=!1,this.clearTimer()},d.switchParams=function(C,p){var h=p==null?void 0:p.renditionReports;if(h)for(var f=0;f<h.length;f++){var n=h[f],r=""+n.URI;if(r===C.substr(-r.length)){var o=parseInt(n["LAST-MSN"]),l=parseInt(n["LAST-PART"]);if(p&&this.hls.config.lowLatencyMode){var x=Math.min(p.age-p.partTarget,p.targetduration);l!==void 0&&x>p.partTarget&&(l+=1)}if(Object(W.isFiniteNumber)(o))return new N.HlsUrlParameters(o,Object(W.isFiniteNumber)(l)?l:void 0,N.HlsSkip.No)}}},d.loadPlaylist=function(C){},d.shouldLoadTrack=function(C){return this.canLoad&&C&&!!C.url&&(!C.details||C.details.live)},d.playlistLoaded=function(C,p,h){var f=this,n=p.details,r=p.stats,o=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(n.advancedDateTime=Date.now()-o,n.live||h!=null&&h.live){if(n.reloaded(h),h&&this.log("live playlist "+C+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),h&&n.fragments.length>0&&Object(A.mergeDetails)(h,n),!this.canLoad||!n.live)return;var l,x=void 0,E=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var y=this.hls.config.lowLatencyMode,R=n.lastPartSn,O=n.endSN,g=n.lastPartIndex,m=g!==-1,s=R===O,u=y?0:g;m?(x=s?O+1:R,E=s?u:g+1):x=O+1;var _=n.age,T=_+n.ageHeader,w=Math.min(T-n.partTarget,n.targetduration*1.5);if(w>0){if(h&&w>h.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+h.tuneInGoal+" to: "+w+" with playlist age: "+n.age),w=0;else{var P=Math.floor(w/n.targetduration);if(x+=P,E!==void 0){var j=Math.round(w%n.targetduration/n.partTarget);E+=j}this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+w+" skip sn "+P+" to part "+E)}n.tuneInGoal=w}if(l=this.getDeliveryDirectives(n,p.deliveryDirectives,x,E),y||!s){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(n,p.deliveryDirectives,x,E);var K=Object(A.computeReloadInterval)(n,r);x!==void 0&&n.canBlockReload&&(K-=n.partTarget||1),this.log("reload live playlist "+C+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(l)},K)}else this.clearTimer()},d.getDeliveryDirectives=function(C,p,h,f){var n=Object(N.getSkipValue)(C,h);return p!=null&&p.skip&&C.deltaUpdateFailed&&(h=p.msn,f=p.part,n=N.HlsSkip.No),new N.HlsUrlParameters(h,f,n)},d.retryLoadingOrFail=function(C){var p=this,h=this.hls.config,f=this.retryCount<h.levelLoadingMaxRetry;if(f){var n;if(this.retryCount++,C.details.indexOf("LoadTimeOut")>-1&&(n=C.context)!==null&&n!==void 0&&n.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+C.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*h.levelLoadingRetryDelay,h.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+C.details+'"')}}else this.warn('cannot recover from error "'+C.details+'"'),this.clearTimer(),C.fatal=!0;return f},L}()},"./src/controller/base-stream-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"State",function(){return O}),M.d(H,"default",function(){return g});var W=M("./src/polyfills/number.ts"),N=M("./src/task-loop.ts"),A=M("./src/controller/fragment-tracker.ts"),F=M("./src/utils/buffer-helper.ts"),U=M("./src/utils/logger.ts"),S=M("./src/events.ts"),L=M("./src/errors.ts"),d=M("./src/types/transmuxer.ts"),v=M("./src/utils/mp4-tools.ts"),C=M("./src/utils/discontinuities.ts"),p=M("./src/controller/fragment-finders.ts"),h=M("./src/controller/level-helper.ts"),f=M("./src/loader/fragment-loader.ts"),n=M("./src/crypt/decrypter.ts"),r=M("./src/utils/time-ranges.ts"),o=M("./src/types/loader.ts");function l(m,s){for(var u=0;u<s.length;u++){var _=s[u];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}function x(m,s,u){return s&&l(m.prototype,s),u&&l(m,u),m}function E(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function y(m,s){m.prototype=Object.create(s.prototype),m.prototype.constructor=m,R(m,s)}function R(m,s){return R=Object.setPrototypeOf||function(_,T){return _.__proto__=T,_},R(m,s)}var O={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"},g=function(m){y(s,m);function s(_,T,w){var P;return P=m.call(this)||this,P.hls=void 0,P.fragPrevious=null,P.fragCurrent=null,P.fragmentTracker=void 0,P.transmuxer=null,P._state=O.STOPPED,P.media=void 0,P.mediaBuffer=void 0,P.config=void 0,P.bitrateTest=!1,P.lastCurrentTime=0,P.nextLoadPosition=0,P.startPosition=0,P.loadedmetadata=!1,P.fragLoadError=0,P.retryDate=0,P.levels=null,P.fragmentLoader=void 0,P.levelLastLoaded=null,P.startFragRequested=!1,P.decrypter=void 0,P.initPTS=[],P.onvseeking=null,P.onvended=null,P.logPrefix="",P.log=void 0,P.warn=void 0,P.logPrefix=w,P.log=U.logger.log.bind(U.logger,w+":"),P.warn=U.logger.warn.bind(U.logger,w+":"),P.hls=_,P.fragmentLoader=new f.default(_.config),P.fragmentTracker=T,P.config=_.config,P.decrypter=new n.default(_,_.config),_.on(S.Events.KEY_LOADED,P.onKeyLoaded,E(P)),P}var u=s.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(T){},u.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=O.STOPPED},u._streamEnded=function(T,w){var P=this.fragCurrent,j=this.fragmentTracker;if(!w.live&&P&&P.sn===w.endSN&&!T.nextStart){var K=j.getState(P);return K===A.FragmentState.PARTIAL||K===A.FragmentState.OK}return!1},u.onMediaAttached=function(T,w){var P=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),P.addEventListener("seeking",this.onvseeking),P.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(j.startPosition)},u.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()},u.onMediaSeeking=function(){var T=this.config,w=this.fragCurrent,P=this.media,j=this.mediaBuffer,K=this.state,Z=P?P.currentTime:0,G=F.BufferHelper.bufferInfo(j||P,Z,T.maxBufferHole);if(this.log("media seeking to "+(Object(W.isFiniteNumber)(Z)?Z.toFixed(3):Z)+", state: "+K),K===O.ENDED)this.resetLoadingState();else if(w&&!G.len){var B=T.maxFragLookUpTolerance,$=w.start-B,ne=w.start+w.duration+B,ae=Z>ne;(Z<$||ae)&&(ae&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}P&&(this.lastCurrentTime=Z),!this.loadedmetadata&&!G.len&&(this.nextLoadPosition=this.startPosition=Z),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(T,w){if(this.state!==O.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var P=this.levels[w.frag.level].details;P&&this.loadFragment(w.frag,P,w.frag.start)},u.onHandlerDestroying=function(){this.stopLoad(),m.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(S.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,m.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(T,w){this.log("Loading key for "+T.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level),this.state=O.KEY_LOADING,this.fragCurrent=T,this.hls.trigger(S.Events.KEY_LOADING,{frag:T})},u.loadFragment=function(T,w,P){this._loadFragForPlayback(T,w,P)},u._loadFragForPlayback=function(T,w,P){var j=this,K=function(G){if(j.fragContextChanged(T)){j.warn("Fragment "+T.sn+(G.part?" p: "+G.part.index:"")+" of level "+T.level+" was dropped during download."),j.fragmentTracker.removeFragment(T);return}T.stats.chunkCount++,j._handleFragmentLoadProgress(G)};this._doFragLoad(T,w,P,K).then(function(Z){if(!Z)return;j.fragLoadError=0;var G=j.state;if(j.fragContextChanged(T)){(G===O.FRAG_LOADING||G===O.BACKTRACKING||!j.fragCurrent&&G===O.PARSING)&&(j.fragmentTracker.removeFragment(T),j.state=O.IDLE);return}if("payload"in Z&&(j.log("Loaded fragment "+T.sn+" of level "+T.level),j.hls.trigger(S.Events.FRAG_LOADED,Z),j.state===O.BACKTRACKING)){j.fragmentTracker.backtrack(T,Z),j.resetFragmentLoading(T);return}j._handleFragmentLoadComplete(Z)}).catch(function(Z){j.warn(Z),j.resetFragmentLoading(T)})},u.flushMainBuffer=function(T,w,P){if(P===void 0&&(P=null),!(T-w))return;var j={startOffset:T,endOffset:w,type:P};this.fragLoadError=0,this.hls.trigger(S.Events.BUFFER_FLUSHING,j)},u._loadInitSegment=function(T){var w=this;this._doFragLoad(T).then(function(P){if(!P||w.fragContextChanged(T)||!w.levels)throw new Error("init load aborted");return P}).then(function(P){var j=w.hls,K=P.payload,Z=T.decryptdata;if(K&&K.byteLength>0&&Z&&Z.key&&Z.iv&&Z.method==="AES-128"){var G=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(K),Z.key.buffer,Z.iv.buffer).then(function(B){var $=self.performance.now();return j.trigger(S.Events.FRAG_DECRYPTED,{frag:T,payload:B,stats:{tstart:G,tdecrypt:$}}),P.payload=B,P})}return P}).then(function(P){var j=w.fragCurrent,K=w.hls,Z=w.levels;if(!Z)throw new Error("init load aborted, missing levels");var G=Z[T.level].details;console.assert(G,"Level details are defined when init segment is loaded");var B=T.stats;w.state=O.IDLE,w.fragLoadError=0,T.data=new Uint8Array(P.payload),B.parsing.start=B.buffering.start=self.performance.now(),B.parsing.end=B.buffering.end=self.performance.now(),P.frag===j&&K.trigger(S.Events.FRAG_BUFFERED,{stats:B,frag:j,part:null,id:T.type}),w.tick()}).catch(function(P){w.warn(P),w.resetFragmentLoading(T)})},u.fragContextChanged=function(T){var w=this.fragCurrent;return!T||!w||T.level!==w.level||T.sn!==w.sn||T.urlId!==w.urlId},u.fragBufferedComplete=function(T,w){var P=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+T.type+" sn: "+T.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+T.level+" "+r.default.toString(F.BufferHelper.getBuffered(P))),this.state=O.IDLE,this.tick()},u._handleFragmentLoadComplete=function(T){var w=this.transmuxer;if(!w)return;var P=T.frag,j=T.part,K=T.partsLoaded,Z=!K||K.length===0||K.some(function(B){return!B}),G=new d.ChunkMetadata(P.level,P.sn,P.stats.chunkCount+1,0,j?j.index:-1,!Z);w.flush(G)},u._handleFragmentLoadProgress=function(T){},u._doFragLoad=function(T,w,P,j){var K=this;if(P===void 0&&(P=null),!this.levels)throw new Error("frag load aborted, missing levels");if(P=Math.max(T.start,P||0),this.config.lowLatencyMode&&w){var Z=w.partList;if(Z&&j){P>T.end&&w.fragmentHint&&(T=w.fragmentHint);var G=this.getNextPart(Z,T,P);if(G>-1){var B=Z[G];return this.log("Loading part sn: "+T.sn+" p: "+B.index+" cc: "+T.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+G+"-"+(Z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(P.toFixed(3))),this.nextLoadPosition=B.start+B.duration,this.state=O.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:T,part:Z[G],targetBufferTime:P}),this.doFragPartsLoad(T,Z,G,j).catch(function($){return K.handleFragLoadError($)})}else if(!T.url||this.loadedEndOfParts(Z,P))return Promise.resolve(null)}}return this.log("Loading fragment "+T.sn+" cc: "+T.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+T.level+", target: "+parseFloat(P.toFixed(3))),Object(W.isFiniteNumber)(T.sn)&&!this.bitrateTest&&(this.nextLoadPosition=T.start+T.duration),this.state=O.FRAG_LOADING,this.hls.trigger(S.Events.FRAG_LOADING,{frag:T,targetBufferTime:P}),this.fragmentLoader.load(T,j).catch(function($){return K.handleFragLoadError($)})},u.doFragPartsLoad=function(T,w,P,j){var K=this;return new Promise(function(Z,G){var B=[],$=function ne(ae){var fe=w[ae];K.fragmentLoader.loadPart(T,fe,j).then(function(_e){B[fe.index]=_e;var Se=_e.part;K.hls.trigger(S.Events.FRAG_LOADED,_e);var we=w[ae+1];if(we&&we.fragment===T)ne(ae+1);else return Z({frag:T,part:Se,partsLoaded:B})}).catch(G)};$(P)})},u.handleFragLoadError=function(T){var w=T.data;return w&&w.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(S.Events.ERROR,w),null},u._handleTransmuxerFlush=function(T){var w=this.getCurrentContext(T);if(!w||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var P=w.frag,j=w.part,K=w.level,Z=self.performance.now();P.stats.parsing.end=Z,j&&(j.stats.parsing.end=Z),this.updateLevelTiming(P,j,K,T.partial)},u.getCurrentContext=function(T){var w=this.levels,P=T.level,j=T.sn,K=T.part;if(!w||!w[P])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+P+". The current chunk will not be buffered."),null;var Z=w[P],G=K>-1?Object(h.getPartWith)(Z,j,K):null,B=G?G.fragment:Object(h.getFragmentWithSN)(Z,j,this.fragCurrent);return B?{frag:B,part:G,level:Z}:null},u.bufferFragmentData=function(T,w,P,j){if(!T||this.state!==O.PARSING)return;var K=T.data1,Z=T.data2,G=K;if(K&&Z&&(G=Object(v.appendUint8Array)(K,Z)),!G||!G.length)return;var B={type:T.type,frag:w,part:P,chunkMeta:j,parent:w.type,data:G};this.hls.trigger(S.Events.BUFFER_APPENDING,B),T.dropped&&T.independent&&!P&&this.flushBufferGap(w)},u.flushBufferGap=function(T){var w=this.media;if(!w)return;if(!F.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,T.start);return}var P=w.currentTime,j=F.BufferHelper.bufferInfo(w,P,0),K=T.duration,Z=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),G=Math.max(Math.min(T.start-Z,j.end-Z),P+Z);T.start-G>Z&&this.flushMainBuffer(G,T.start)},u.getFwdBufferInfo=function(T,w){var P=this.config,j=this.getLoadPosition();if(!Object(W.isFiniteNumber)(j))return null;var K=F.BufferHelper.bufferInfo(T,j,P.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var Z=this.fragmentTracker.getBufferedFrag(j,w);if(Z&&K.nextStart<Z.end)return F.BufferHelper.bufferInfo(T,j,Math.max(K.nextStart,P.maxBufferHole))}return K},u.getMaxBufferLength=function(T){var w=this.config,P;return T?P=Math.max(8*w.maxBufferSize/T,w.maxBufferLength):P=w.maxBufferLength,Math.min(P,w.maxMaxBufferLength)},u.reduceMaxBufferLength=function(T){var w=this.config,P=T||w.maxBufferLength;return w.maxMaxBufferLength>=P?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(T,w){var P,j,K=w.fragments,Z=K.length;if(!Z)return null;var G=this.config,B=K[0].start,$;if(w.live){var ne=G.initialLiveManifestSize;if(Z<ne)return this.warn("Not enough fragments to start playback (have: "+Z+", need: "+ne+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&($=this.getInitialLiveFragment(w,K),this.startPosition=$?this.hls.liveSyncPosition||$.start:T)}else T<=B&&($=K[0]);if(!$){var ae=G.lowLatencyMode?w.partEnd:w.fragmentEnd;$=this.getFragmentAtPosition(T,ae,w)}return(P=$)!==null&&P!==void 0&&P.initSegment&&!((j=$)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&($=$.initSegment),$},u.getNextPart=function(T,w,P){for(var j=-1,K=!1,Z=!0,G=0,B=T.length;G<B;G++){var $=T[G];if(Z=Z&&!$.independent,j>-1&&P<$.start)break;var ne=$.loaded;!ne&&(K||$.independent||Z)&&$.fragment===w&&(j=G),K=ne}return j},u.loadedEndOfParts=function(T,w){var P=T[T.length-1];return P&&w>P.start&&P.loaded},u.getInitialLiveFragment=function(T,w){var P=this.fragPrevious,j=null;if(P){if(T.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+P.programDateTime),j=Object(p.findFragmentByPDT)(w,P.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var K=P.sn+1;if(K>=T.startSN&&K<=T.endSN){var Z=w[K-T.startSN];P.cc===Z.cc&&(j=Z,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(p.findFragWithCC)(w,P.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var G=this.hls.liveSyncPosition;G!==null&&(j=this.getFragmentAtPosition(G,this.bitrateTest?T.fragmentEnd:T.edge,T))}return j},u.getFragmentAtPosition=function(T,w,P){var j=this.config,K=this.fragPrevious,Z=P.fragments,G=P.endSN,B=P.fragmentHint,$=j.maxFragLookUpTolerance,ne=!!(j.lowLatencyMode&&P.partList&&B);ne&&B&&!this.bitrateTest&&(Z=Z.concat(B),G=B.sn);var ae;if(T<w){var fe=T>w-$?0:$;ae=Object(p.findFragmentByPTS)(K,Z,T,fe)}else ae=Z[Z.length-1];if(ae){var _e=ae.sn-P.startSN,Se=K&&ae.level===K.level,we=Z[_e+1],Me=this.fragmentTracker.getState(ae);if(Me===A.FragmentState.BACKTRACKED){ae=null;for(var Le=_e;Z[Le]&&this.fragmentTracker.getState(Z[Le])===A.FragmentState.BACKTRACKED;)K?ae=Z[Le--]:ae=Z[--Le];ae||(ae=we)}else K&&ae.sn===K.sn&&!ne&&(Se&&(ae.sn<G&&this.fragmentTracker.getState(we)!==A.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+we.sn),ae=we):ae=null))}return ae},u.synchronizeToLiveEdge=function(T){var w=this.config,P=this.media;if(!P)return;var j=this.hls.liveSyncPosition,K=P.currentTime,Z=T.fragments[0].start,G=T.edge,B=K>=Z-w.maxFragLookUpTolerance&&K<=G;if(j!==null&&P.duration>j&&(K<j||!B)){var $=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*T.targetduration;(!B&&P.readyState<4||K<G-$)&&(this.loadedmetadata||(this.nextLoadPosition=j),P.readyState&&(this.warn("Playback: "+K.toFixed(3)+" is located too far from the end of live sliding playlist: "+G+", reset currentTime to : "+j.toFixed(3)),P.currentTime=j))}},u.alignPlaylists=function(T,w){var P=this.levels,j=this.levelLastLoaded,K=this.fragPrevious,Z=j!==null?P[j]:null,G=T.fragments.length;if(!G)return this.warn("No fragments in live playlist"),0;var B=T.fragments[0].start,$=!w,ne=T.alignedSliding&&Object(W.isFiniteNumber)(B);if($||!ne&&!B){Object(C.alignStream)(K,Z,T);var ae=T.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+T.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+G),ae}return B},u.waitForCdnTuneIn=function(T){var w=3;return T.live&&T.canBlockReload&&T.tuneInGoal>Math.max(T.partHoldBack,T.partTarget*w)},u.setStartPosition=function(T,w){var P=this.startPosition;if(P<w&&(P=-1),P===-1||this.lastCurrentTime===-1){var j=T.startTimeOffset;Object(W.isFiniteNumber)(j)?(P=w+j,j<0&&(P+=T.totalduration),P=Math.min(Math.max(w,P),w+T.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+P),this.startPosition=P):T.live?P=this.hls.liveSyncPosition||w:this.startPosition=P=0,this.lastCurrentTime=P}this.nextLoadPosition=P},u.getLoadPosition=function(){var T=this.media,w=0;return this.loadedmetadata&&T?w=T.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},u.handleFragLoadAborted=function(T,w){this.transmuxer&&T.sn!=="initSegment"&&T.stats.aborted&&(this.warn("Fragment "+T.sn+(w?" part"+w.index:"")+" of level "+T.level+" was aborted"),this.resetFragmentLoading(T))},u.resetFragmentLoading=function(T){(!this.fragCurrent||!this.fragContextChanged(T))&&(this.state=O.IDLE)},u.onFragmentOrKeyLoadError=function(T,w){if(w.fatal)return;var P=w.frag;if(!P||P.type!==T)return;var j=this.fragCurrent;console.assert(j&&P.sn===j.sn&&P.level===j.level&&P.urlId===j.urlId,"Frag load error must match current frag to retry");var K=this.config;if(this.fragLoadError+1<=K.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(P.level))return;var Z=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+P.sn+" of "+T+" "+P.level+" failed to load, retrying in "+Z+"ms"),this.retryDate=self.performance.now()+Z,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(T===o.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(U.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},u.afterBufferFlushed=function(T,w,P){if(!T)return;var j=F.BufferHelper.getBuffered(T);this.fragmentTracker.detectEvictedFragments(w,j,P),this.state===O.ENDED&&this.resetLoadingState()},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},u.resetLiveStartWhenNotLoaded=function(T){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[T].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(T,w,P,j){var K=this,Z=P.details;console.assert(!!Z,"level.details must be defined");var G=Object.keys(T.elementaryStreams).reduce(function(B,$){var ne=T.elementaryStreams[$];if(ne){var ae=ne.endPTS-ne.startPTS;if(ae<=0)return K.warn("Could not parse fragment "+T.sn+" "+$+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),B||!1;var fe=j?0:Object(h.updateFragPTSDTS)(Z,T,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return K.hls.trigger(S.Events.LEVEL_PTS_UPDATED,{details:Z,level:P,drift:fe,type:$,frag:T,start:ne.startPTS,end:ne.endPTS}),!0}return B},!1);G?(this.state=O.PARSED,this.hls.trigger(S.Events.FRAG_PARSED,{frag:T,part:w})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x(s,[{key:"state",get:function(){return this._state},set:function(T){var w=this._state;w!==T&&(this._state=T,this.log(w+"->"+T))}}]),s}(N.default)},"./src/controller/buffer-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return p});var W=M("./src/polyfills/number.ts"),N=M("./src/events.ts"),A=M("./src/utils/logger.ts"),F=M("./src/errors.ts"),U=M("./src/utils/buffer-helper.ts"),S=M("./src/utils/mediasource-helper.ts"),L=M("./src/loader/fragment.ts"),d=M("./src/controller/buffer-operation-queue.ts"),v=Object(S.getMediaSource)(),C=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function h(n){var r=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var o=r.hls,l=r.media,x=r.mediaSource;A.logger.log("[buffer-controller]: Media source opened"),l&&(r.updateMediaElementDuration(),o.trigger(N.Events.MEDIA_ATTACHED,{media:l})),x&&x.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){A.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){A.logger.log("[buffer-controller]: Media source ended")},this.hls=n,this._initSourceBuffer(),this.registerListeners()}var f=h.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(N.Events.BUFFER_RESET,this.onBufferReset,this),r.on(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(N.Events.BUFFER_EOS,this.onBufferEos,this),r.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(N.Events.FRAG_PARSED,this.onFragParsed,this),r.on(N.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(N.Events.BUFFER_RESET,this.onBufferReset,this),r.off(N.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(N.Events.BUFFER_EOS,this.onBufferEos,this),r.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(N.Events.FRAG_PARSED,this.onFragParsed,this),r.off(N.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(r,o){var l=2;(o.audio&&!o.video||!o.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,A.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(r,o){var l=this.media=o.media;if(l&&v){var x=this.mediaSource=new v;x.addEventListener("sourceopen",this._onMediaSourceOpen),x.addEventListener("sourceended",this._onMediaSourceEnded),x.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(x),this._objectUrl=l.src}},f.onMediaDetaching=function(){var r=this.media,o=this.mediaSource,l=this._objectUrl;if(o){if(A.logger.log("[buffer-controller]: media source detaching"),o.readyState==="open")try{o.endOfStream()}catch(x){A.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),r&&(l&&self.URL.revokeObjectURL(l),r.src===l?(r.removeAttribute("src"),r.load()):A.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(N.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(o){var l=r.sourceBuffer[o];try{l&&(r.removeBufferListeners(o),r.mediaSource&&r.mediaSource.removeSourceBuffer(l),r.sourceBuffer[o]=void 0)}catch(x){A.logger.warn("[buffer-controller]: Failed to reset the "+o+" buffer",x)}}),this._initSourceBuffer()},f.onBufferCodecs=function(r,o){var l=this,x=this.getSourceBufferTypes().length;if(Object.keys(o).forEach(function(E){if(x){var y=l.tracks[E];if(y&&typeof y.buffer.changeType=="function"){var R=o[E],O=R.codec,g=R.levelCodec,m=R.container,s=(y.levelCodec||y.codec).replace(C,"$1"),u=(g||O).replace(C,"$1");if(s!==u){var _=m+";codecs="+(g||O);l.appendChangeType(E,_)}}}else l.pendingTracks[E]=o[E]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(r,o){var l=this,x=this.operationQueue,E={execute:function(){var R=l.sourceBuffer[r];R&&(A.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+o),R.changeType(o)),x.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(R){A.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",R)}};x.append(E,r)},f.onBufferAppending=function(r,o){var l=this,x=this.hls,E=this.operationQueue,y=this.tracks,R=o.data,O=o.type,g=o.frag,m=o.part,s=o.chunkMeta,u=s.buffering[O],_=self.performance.now();u.start=_;var T=g.stats.buffering,w=m?m.stats.buffering:null;T.start===0&&(T.start=_),w&&w.start===0&&(w.start=_);var P=y.audio,j=O==="audio"&&s.id===1&&(P==null?void 0:P.container)==="audio/mpeg",K={execute:function(){if(u.executeStart=self.performance.now(),j){var G=l.sourceBuffer[O];if(G){var B=g.start-G.timestampOffset;Math.abs(B)>=.1&&(A.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+B+") sn: "+g.sn+")"),G.timestampOffset=g.start)}}l.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var G=self.performance.now();u.executeEnd=u.end=G,T.first===0&&(T.first=G),w&&w.first===0&&(w.first=G);var B=l.sourceBuffer,$={};for(var ne in B)$[ne]=U.BufferHelper.getBuffered(B[ne]);l.appendError=0,l.hls.trigger(N.Events.BUFFER_APPENDED,{type:O,frag:g,part:m,chunkMeta:s,parent:g.type,timeRanges:$})},onError:function(G){A.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",G);var B={type:F.ErrorTypes.MEDIA_ERROR,parent:g.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:G,fatal:!1};G.code===DOMException.QUOTA_EXCEEDED_ERR?B.details=F.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,B.details=F.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>x.config.appendErrorMaxRetry&&(A.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),B.fatal=!0)),x.trigger(N.Events.ERROR,B)}};E.append(K,O)},f.onBufferFlushing=function(r,o){var l=this,x=this.operationQueue,E=function(R){return{execute:l.removeExecutor.bind(l,R,o.startOffset,o.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(N.Events.BUFFER_FLUSHED,{type:R})},onError:function(g){A.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",g)}}};o.type?x.append(E(o.type),o.type):this.getSourceBufferTypes().forEach(function(y){x.append(E(y),y)})},f.onFragParsed=function(r,o){var l=this,x=o.frag,E=o.part,y=[],R=E?E.elementaryStreams:x.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?y.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&y.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&y.push("video"));var O=function(){var m=self.performance.now();x.stats.buffering.end=m,E&&(E.stats.buffering.end=m);var s=E?E.stats:x.stats;l.hls.trigger(N.Events.FRAG_BUFFERED,{frag:x,part:E,stats:s,id:x.type})};y.length===0&&A.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(O,y)},f.onFragChanged=function(r,o){this.flushBackBuffer()},f.onBufferEos=function(r,o){var l=this,x=this.getSourceBufferTypes().reduce(function(E,y){var R=l.sourceBuffer[y];return(!o.type||o.type===y)&&(R&&!R.ended&&(R.ended=!0,A.logger.log("[buffer-controller]: "+y+" sourceBuffer now EOS"))),E&&!!(!R||R.ended)},!0);x&&this.blockBuffers(function(){var E=l.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},f.onLevelUpdated=function(r,o){var l=o.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var r=this.hls,o=this.details,l=this.media,x=this.sourceBuffer;if(!l||o===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var y=o.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(W.isFiniteNumber)(y)||y<0)return;var R=l.currentTime,O=o.levelTargetDuration,g=Math.max(y,O),m=Math.floor(R/O)*O-g;E.forEach(function(s){var u=x[s];if(u){var _=U.BufferHelper.getBuffered(u);_.length>0&&m>_.start(0)&&(r.trigger(N.Events.BACK_BUFFER_REACHED,{bufferEnd:m}),o.live&&r.trigger(N.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:m}),r.trigger(N.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:m,type:s}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,o=this.hls,l=this.media,x=this.mediaSource,E=r.fragments[0].start+r.totalduration,y=l.duration,R=Object(W.isFiniteNumber)(x.duration)?x.duration:0;r.live&&o.config.liveDurationInfinity?(A.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(r)):(E>R&&E>y||!Object(W.isFiniteNumber)(y))&&(A.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),x.duration=E)},f.updateSeekableRange=function(r){var o=this.mediaSource,l=r.fragments,x=l.length;if(x&&r.live&&o!==null&&o!==void 0&&o.setLiveSeekableRange){var E=Math.max(0,l[0].start),y=Math.max(E,E+r.totalduration);o.setLiveSeekableRange(E,y)}},f.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,o=this.operationQueue,l=this.pendingTracks,x=Object.keys(l).length;if(x&&!r||x===2){this.createSourceBuffers(l),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(N.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(y){o.executeNext(y)})}},f.createSourceBuffers=function(r){var o=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var E in r)if(!o[E]){var y=r[E];if(!y)throw Error("source buffer exists for track "+E+", however track does not");var R=y.levelCodec||y.codec,O=y.container+";codecs="+R;A.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var g=o[E]=l.addSourceBuffer(O),m=E;this.addBufferListener(m,"updatestart",this._onSBUpdateStart),this.addBufferListener(m,"updateend",this._onSBUpdateEnd),this.addBufferListener(m,"error",this._onSBUpdateError),this.tracks[E]={buffer:g,codec:R,container:y.container,levelCodec:y.levelCodec,id:y.id},x++}catch(s){A.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(N.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:O})}}x&&this.hls.trigger(N.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(r){var o=this.operationQueue,l=o.current(r);l.onStart()},f._onSBUpdateEnd=function(r){var o=this.operationQueue,l=o.current(r);l.onComplete(),o.shiftAndExecuteNext(r)},f._onSBUpdateError=function(r,o){A.logger.error("[buffer-controller]: "+r+" SourceBuffer error",o),this.hls.trigger(N.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(r);l&&l.onError(o)},f.removeExecutor=function(r,o,l){var x=this.media,E=this.mediaSource,y=this.operationQueue,R=this.sourceBuffer,O=R[r];if(!x||!E||!O){A.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),y.shiftAndExecuteNext(r);return}var g=Object(W.isFiniteNumber)(x.duration)?x.duration:Infinity,m=Object(W.isFiniteNumber)(E.duration)?E.duration:Infinity,s=Math.max(0,o),u=Math.min(l,g,m);u>s?(A.logger.log("[buffer-controller]: Removing ["+s+","+u+"] from the "+r+" SourceBuffer"),console.assert(!O.updating,r+" sourceBuffer must not be updating"),O.remove(s,u)):y.shiftAndExecuteNext(r)},f.appendExecutor=function(r,o){var l=this.operationQueue,x=this.sourceBuffer,E=x[o];if(!E){A.logger.warn("[buffer-controller]: Attempting to append to the "+o+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(o);return}E.ended=!1,console.assert(!E.updating,o+" sourceBuffer must not be updating"),E.appendBuffer(r)},f.blockBuffers=function(r,o){var l=this;if(o===void 0&&(o=this.getSourceBufferTypes()),!o.length){A.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var x=this.operationQueue,E=o.map(function(y){return x.appendBlocker(y)});Promise.all(E).then(function(){r(),o.forEach(function(y){var R=l.sourceBuffer[y];(!R||!R.updating)&&x.shiftAndExecuteNext(y)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(r,o,l){var x=this.sourceBuffer[r];if(!x)return;var E=l.bind(this,r);this.listeners[r].push({event:o,listener:E}),x.addEventListener(o,E)},f.removeBufferListeners=function(r){var o=this.sourceBuffer[r];if(!o)return;this.listeners[r].forEach(function(l){o.removeEventListener(l.event,l.listener)})},h}()},"./src/controller/buffer-operation-queue.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return N});var W=M("./src/utils/logger.ts"),N=function(){function A(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var F=A.prototype;return F.append=function(S,L){var d=this.queues[L];d.push(S),d.length===1&&this.buffers[L]&&this.executeNext(L)},F.insertAbort=function(S,L){var d=this.queues[L];d.unshift(S),this.executeNext(L)},F.appendBlocker=function(S){var L,d=new Promise(function(C){L=C}),v={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(v,S),d},F.executeNext=function(S){var L=this.buffers,d=this.queues,v=L[S],C=d[S];if(C.length){var p=C[0];try{p.execute()}catch(h){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(h),(!v||!v.updating)&&(C.shift(),this.executeNext(S))}}},F.shiftAndExecuteNext=function(S){this.queues[S].shift(),this.executeNext(S)},F.current=function(S){return this.queues[S][0]},A}()},"./src/controller/cap-level-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts");function N(U,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(U,d.key,d)}}function A(U,S,L){return S&&N(U.prototype,S),L&&N(U,L),U}var F=function(){function U(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var S=U.prototype;return S.setStreamController=function(d){this.streamController=d},S.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},S.registerListeners=function(){var d=this.hls;d.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.unregisterListener=function(){var d=this.hls;d.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},S.onFpsDropLevelCapping=function(d,v){U.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},S.onMediaAttaching=function(d,v){this.media=v.media instanceof HTMLVideoElement?v.media:null},S.onManifestParsed=function(d,v){var C=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,C.config.capLevelToPlayerSize&&v.video&&this.startCapping()},S.onBufferCodecs=function(d,v){var C=this.hls;C.config.capLevelToPlayerSize&&v.video&&this.startCapping()},S.onMediaDetaching=function(){this.stopCapping()},S.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var d=this.hls.levels;if(d.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(d.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},S.getMaxLevel=function(d){var v=this,C=this.hls.levels;if(!C.length)return-1;var p=C.filter(function(h,f){return U.isLevelAllowed(f,v.restrictedLevels)&&f<=d});return this.clientRect=null,U.getMaxLevelByMediaSize(p,this.mediaWidth,this.mediaHeight)},S.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()},S.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},S.getDimensions=function(){if(this.clientRect)return this.clientRect;var d=this.media,v={width:0,height:0};if(d){var C=d.getBoundingClientRect();v.width=C.width,v.height=C.height,!v.width&&!v.height&&(v.width=C.right-C.left||d.width||0,v.height=C.bottom-C.top||d.height||0)}return this.clientRect=v,v},U.isLevelAllowed=function(d,v){return v===void 0&&(v=[]),v.indexOf(d)===-1},U.getMaxLevelByMediaSize=function(d,v,C){if(!d||!d.length)return-1;for(var p=function(o,l){return l?o.width!==l.width||o.height!==l.height:!0},h=d.length-1,f=0;f<d.length;f+=1){var n=d[f];if((n.width>=v||n.height>=C)&&p(n,d[f+1])){h=f;break}}return h},A(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 d=1;try{d=self.devicePixelRatio}catch(v){}return d}}]),U}();H.default=F},"./src/controller/cmcd-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return p});var W=M("./src/events.ts"),N=M("./src/types/cmcd.ts"),A=M("./src/utils/buffer-helper.ts"),F=M("./src/utils/logger.ts");function U(h,f){for(var n=0;n<f.length;n++){var r=f[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(h,r.key,r)}}function S(h,f,n){return f&&U(h.prototype,f),n&&U(h,n),h}function L(h,f){var n=typeof Symbol!="undefined"&&h[Symbol.iterator]||h["@@iterator"];if(n)return(n=n.call(h)).next.bind(n);if(Array.isArray(h)||(n=d(h))||f&&h&&typeof h.length=="number"){n&&(h=n);var r=0;return function(){return r>=h.length?{done:!0}:{done:!1,value:h[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(h,f){if(!h)return;if(typeof h=="string")return v(h,f);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(h,f)}function v(h,f){(f==null||f>h.length)&&(f=h.length);for(var n=0,r=new Array(f);n<f;n++)r[n]=h[n];return r}function C(){return C=Object.assign||function(h){for(var f=1;f<arguments.length;f++){var n=arguments[f];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(h[r]=n[r])}return h},C.apply(this,arguments)}var p=function(){function h(n){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(x){try{r.apply(x,{ot:N.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(E){F.logger.warn("Could not generate manifest CMCD data.",E)}},this.applyFragmentData=function(x){try{var E=x.frag,y=r.hls.levels[E.level],R=r.getObjectType(E),O={d:E.duration*1e3,ot:R};(R===N.CMCDObjectType.VIDEO||R===N.CMCDObjectType.AUDIO||R==N.CMCDObjectType.MUXED)&&(O.br=y.bitrate/1e3,O.tb=r.getTopBandwidth(R),O.bl=r.getBufferLength(R)),r.apply(x,O)}catch(g){F.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=n;var o=this.config=n.config,l=o.cmcd;l!=null&&(o.pLoader=this.createPlaylistLoader(),o.fLoader=this.createFragmentLoader(),this.sid=l.sessionId||h.uuid(),this.cid=l.contentId,this.useHeaders=l.useHeaders===!0,this.registerListeners())}var f=h.prototype;return f.registerListeners=function(){var r=this.hls;r.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(r,o){this.media=o.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(r,o){var l,x;this.audioBuffer=(l=o.tracks.audio)===null||l===void 0?void 0:l.buffer,this.videoBuffer=(x=o.tracks.video)===null||x===void 0?void 0:x.buffer},f.createData=function(){var r;return{v:N.CMCDVersion,sf:N.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(r,o){o===void 0&&(o={}),C(o,this.createData());var l=o.ot===N.CMCDObjectType.INIT||o.ot===N.CMCDObjectType.VIDEO||o.ot===N.CMCDObjectType.MUXED;if(this.starved&&l&&(o.bs=!0,o.su=!0,this.starved=!1),o.su==null&&(o.su=this.buffering),this.useHeaders){var x=h.toHeaders(o);if(!Object.keys(x).length)return;r.headers||(r.headers={}),C(r.headers,x)}else{var E=h.toQuery(o);if(!E)return;r.url=h.appendQueryToUri(r.url,E)}},f.getObjectType=function(r){var o=r.type;return o==="subtitle"?N.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?N.CMCDObjectType.INIT:o==="audio"?N.CMCDObjectType.AUDIO:o==="main"?this.hls.audioTracks.length?N.CMCDObjectType.VIDEO:N.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(r){for(var o=0,l=r===N.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,x=L(l),E;!(E=x()).done;){var y=E.value;y.bitrate>o&&(o=y.bitrate)}return o>0?o:NaN},f.getBufferLength=function(r){var o=this.hls.media,l=r===N.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!o)return NaN;var x=A.BufferHelper.bufferInfo(l,o.currentTime,this.config.maxBufferHole);return x.len*1e3},f.createPlaylistLoader=function(){var r=this.config.pLoader,o=this.applyPlaylistData,l=r||this.config.loader;return function(){function x(y){this.loader=void 0,this.loader=new l(y)}var E=x.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(R,O,g){o(R),this.loader.load(R,O,g)},S(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},f.createFragmentLoader=function(){var r=this.config.fLoader,o=this.applyFragmentData,l=r||this.config.loader;return function(){function x(y){this.loader=void 0,this.loader=new l(y)}var E=x.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(R,O,g){o(R),this.loader.load(R,O,g)},S(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},h.uuid=function(){var r=URL.createObjectURL(new Blob),o=r.toString();return URL.revokeObjectURL(r),o.substr(o.lastIndexOf("/")+1)},h.serialize=function(r){for(var o=[],l=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},x=function(j){return Math.round(j)},E=function(j){return x(j/100)*100},y=function(j){return encodeURIComponent(j)},R={br:x,d:x,bl:E,dl:E,mtp:E,nor:y,rtp:E,tb:x},O=Object.keys(r||{}).sort(),g=L(O),m;!(m=g()).done;){var s=m.value,u=r[s];if(!l(u))continue;if(s==="v"&&u===1)continue;if(s=="pr"&&u===1)continue;var _=R[s];_&&(u=_(u));var T=typeof u,w=void 0;s==="ot"||s==="sf"||s==="st"?w=s+"="+u:T==="boolean"?w=s:T==="number"?w=s+"="+u:w=s+"="+JSON.stringify(u),o.push(w)}return o.join(",")},h.toHeaders=function(r){for(var o=Object.keys(r),l={},x=["Object","Request","Session","Status"],E=[{},{},{},{}],y={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},R=0,O=o;R<O.length;R++){var g=O[R],m=y[g]!=null?y[g]:1;E[m][g]=r[g]}for(var s=0;s<E.length;s++){var u=h.serialize(E[s]);u&&(l["CMCD-"+x[s]]=u)}return l},h.toQuery=function(r){return"CMCD="+encodeURIComponent(h.serialize(r))},h.appendQueryToUri=function(r,o){if(!o)return r;var l=r.includes("?")?"&":"?";return""+r+l+o},h}()},"./src/controller/eme-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts"),N=M("./src/errors.ts"),A=M("./src/utils/logger.ts"),F=M("./src/utils/mediakeys-helper.ts");function U(p,h){for(var f=0;f<h.length;f++){var n=h[f];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}function S(p,h,f){return h&&U(p.prototype,h),f&&U(p,f),p}var L=3,d=function(h,f,n){var r={audioCapabilities:[],videoCapabilities:[]};return h.forEach(function(o){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+o+'"',robustness:n.audioRobustness||""})}),f.forEach(function(o){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+o+'"',robustness:n.videoRobustness||""})}),[r]},v=function(h,f,n,r){switch(h){case F.KeySystems.WIDEVINE:return d(f,n,r);default:throw new Error("Unknown key-system: "+h)}},C=function(){function p(f){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=f,this._config=f.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var h=p.prototype;return h.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},h._registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h._unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},h.getLicenseServerUrl=function(n){switch(n){case F.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+n+'"')},h._attemptKeySystemAccess=function(n,r,o){var l=this,x=v(n,r,o,this._drmSystemOptions);A.logger.log("Requesting encrypted media key-system access");var E=this.requestMediaKeySystemAccess(n,x);this.mediaKeysPromise=E.then(function(y){return l._onMediaKeySystemAccessObtained(n,y)}),E.catch(function(y){A.logger.error('Failed to obtain key-system "'+n+'" access:',y)})},h._onMediaKeySystemAccessObtained=function(n,r){var o=this;A.logger.log('Access for key-system "'+n+'" obtained');var l={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:n};this._mediaKeysList.push(l);var x=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(E){return l.mediaKeys=E,A.logger.log('Media-keys created for key-system "'+n+'"'),o._onMediaKeysCreated(),E});return x.catch(function(E){A.logger.error("Failed to create media-keys:",E)}),x},h._onMediaKeysCreated=function(){var n=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),n._onNewMediaKeySession(r.mediaKeysSession))})},h._onNewMediaKeySession=function(n){var r=this;A.logger.log("New key-system session "+n.sessionId),n.addEventListener("message",function(o){r._onKeySessionMessage(n,o.message)},!1)},h._onKeySessionMessage=function(n,r){A.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(o){A.logger.log("Received license data (length: "+(o&&o.byteLength)+"), updating key-session"),n.update(o)})},h.onMediaEncrypted=function(n){var r=this;if(A.logger.log('Media is encrypted using "'+n.initDataType+'" init data type'),!this.mediaKeysPromise){A.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var o=function(x){if(!r._media)return;r._attemptSetMediaKeys(x),r._generateRequestWithPreferredKeySession(n.initDataType,n.initData)};this.mediaKeysPromise.then(o).catch(o)},h._attemptSetMediaKeys=function(n){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){A.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}A.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},h._generateRequestWithPreferredKeySession=function(n,r){var o=this,l=this._mediaKeysList[0];if(!l){A.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(l.mediaKeysSessionInitialized){A.logger.warn("Key-Session already initialized but requested again");return}var x=l.mediaKeysSession;if(!x){A.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){A.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}A.logger.log('Generating key-session request for "'+n+'" init data type'),l.mediaKeysSessionInitialized=!0,x.generateRequest(n,r).then(function(){A.logger.debug("Key-session generation succeeded")}).catch(function(E){A.logger.error("Error generating key-session request:",E),o.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},h._createLicenseXhr=function(n,r,o){var l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,l,n,r,o);var x=this._licenseXhrSetup;if(x)try{x.call(this.hls,l,n),x=void 0}catch(E){A.logger.error(E)}try{l.readyState||l.open("POST",n,!0),x&&x.call(this.hls,l,n)}catch(E){throw new Error("issue setting up KeySystem license XHR "+E)}return l},h._onLicenseRequestReadyStageChange=function(n,r,o,l){switch(n.readyState){case 4:if(n.status===200){this._requestLicenseFailureCount=0,A.logger.log("License request succeeded");var x=n.response,E=this._licenseResponseCallback;if(E)try{x=E.call(this.hls,n,r)}catch(R){A.logger.error(R)}l(x)}else{if(A.logger.error("License Request XHR failed ("+r+"). Status: "+n.status+" ("+n.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var y=L-this._requestLicenseFailureCount+1;A.logger.warn("Retrying license request, "+y+" attempts left"),this._requestLicense(o,l)}break}},h._generateLicenseRequestChallenge=function(n,r){switch(n.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+n.mediaKeySystemDomain)},h._requestLicense=function(n,r){A.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o){A.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(o.mediaKeySystemDomain),x=this._createLicenseXhr(l,n,r);A.logger.log("Sending license request to URL: "+l);var E=this._generateLicenseRequestChallenge(o,n);x.send(E)}catch(y){A.logger.error("Failure requesting DRM license: "+y),this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.KEY_SYSTEM_ERROR,details:N.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},h.onMediaAttached=function(n,r){if(!this._emeEnabled)return;var o=r.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)},h.onMediaDetached=function(){var n=this._media,r=this._mediaKeysList;if(!n)return;n.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(o){if(o.mediaKeysSession)return o.mediaKeysSession.close().catch(function(){})})).then(function(){return n.setMediaKeys(null)}).catch(function(){})},h.onManifestParsed=function(n,r){if(!this._emeEnabled)return;var o=r.levels.map(function(x){return x.audioCodec}).filter(function(x){return!!x}),l=r.levels.map(function(x){return x.videoCodec}).filter(function(x){return!!x});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,o,l)},S(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}();H.default=C},"./src/controller/fps-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts"),N=M("./src/utils/logger.ts"),A=function(){function F(S){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=S,this.registerListeners()}var U=F.prototype;return U.setStreamController=function(L){this.streamController=L},U.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(L,d){var v=this.hls.config;if(v.capLevelOnFPSDrop){var C=d.media instanceof self.HTMLVideoElement?d.media:null;this.media=C,C&&typeof C.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),v.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(L,d,v){var C=performance.now();if(d){if(this.lastTime){var p=C-this.lastTime,h=v-this.lastDroppedFrames,f=d-this.lastDecodedFrames,n=1e3*h/p,r=this.hls;if(r.trigger(W.Events.FPS_DROP,{currentDropped:h,currentDecoded:f,totalDroppedFrames:v}),n>0&&h>r.config.fpsDroppedMonitoringThreshold*f){var o=r.currentLevel;N.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+o),o>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=o)&&(o=o-1,r.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:o,droppedLevel:r.currentLevel}),r.autoLevelCapping=o,this.streamController.nextLevelSwitch())}}this.lastTime=C,this.lastDroppedFrames=v,this.lastDecodedFrames=d}},U.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var d=L.getVideoPlaybackQuality();this.checkFPS(L,d.totalVideoFrames,d.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},F}();H.default=A},"./src/controller/fragment-finders.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"findFragmentByPDT",function(){return A}),M.d(H,"findFragmentByPTS",function(){return F}),M.d(H,"fragmentWithinToleranceTest",function(){return U}),M.d(H,"pdtWithinToleranceTest",function(){return S}),M.d(H,"findFragWithCC",function(){return L});var W=M("./src/polyfills/number.ts"),N=M("./src/utils/binary-search.ts");function A(d,v,C){if(v===null||!Array.isArray(d)||!d.length||!Object(W.isFiniteNumber)(v))return null;var p=d[0].programDateTime;if(v<(p||0))return null;var h=d[d.length-1].endProgramDateTime;if(v>=(h||0))return null;C=C||0;for(var f=0;f<d.length;++f){var n=d[f];if(S(v,C,n))return n}return null}function F(d,v,C,p){C===void 0&&(C=0),p===void 0&&(p=0);var h=null;if(d?h=v[d.sn-v[0].sn+1]||null:C===0&&v[0].start===0&&(h=v[0]),h&&U(C,p,h)===0)return h;var f=N.default.search(v,U.bind(null,C,p));return f||h}function U(d,v,C){d===void 0&&(d=0),v===void 0&&(v=0);var p=Math.min(v,C.duration+(C.deltaPTS?C.deltaPTS:0));return C.start+C.duration-p<=d?1:C.start-p>d&&C.start?-1:0}function S(d,v,C){var p=Math.min(v,C.duration+(C.deltaPTS?C.deltaPTS:0))*1e3,h=C.endProgramDateTime||0;return h-p>d}function L(d,v){return N.default.search(d,function(C){return C.cc<v?1:C.cc>v?-1:0})}},"./src/controller/fragment-tracker.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"FragmentState",function(){return A}),M.d(H,"FragmentTracker",function(){return F});var W=M("./src/events.ts"),N=M("./src/types/loader.ts"),A;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(A||(A={}));var F=function(){function L(v){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=v,this._registerListeners()}var d=L.prototype;return d._registerListeners=function(){var C=this.hls;C.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),C.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),C.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},d._unregisterListeners=function(){var C=this.hls;C.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),C.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),C.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},d.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},d.getAppendedFrag=function(C,p){if(p===N.PlaylistLevelType.MAIN){var h=this.activeFragment,f=this.activeParts;if(!h)return null;if(f)for(var n=f.length;n--;){var r=f[n],o=r?r.end:h.appendedPTS;if(r.start<=C&&o!==void 0&&C<=o)return n>9&&(this.activeParts=f.slice(n-9)),r}else if(h.start<=C&&h.appendedPTS!==void 0&&C<=h.appendedPTS)return h}return this.getBufferedFrag(C,p)},d.getBufferedFrag=function(C,p){for(var h=this.fragments,f=Object.keys(h),n=f.length;n--;){var r=h[f[n]];if((r==null?void 0:r.body.type)===p&&r.buffered){var o=r.body;if(o.start<=C&&C<=o.end)return o}}return null},d.detectEvictedFragments=function(C,p,h){var f=this;Object.keys(this.fragments).forEach(function(n){var r=f.fragments[n];if(!r)return;if(!r.buffered){r.body.type===h&&f.removeFragment(r.body);return}var o=r.range[C];if(!o)return;o.time.some(function(l){var x=!f.isTimeBuffered(l.startPTS,l.endPTS,p);return x&&f.removeFragment(r.body),x})})},d.detectPartialFragments=function(C){var p=this,h=this.timeRanges,f=C.frag,n=C.part;if(!h||f.sn==="initSegment")return;var r=S(f),o=this.fragments[r];if(!o)return;Object.keys(h).forEach(function(l){var x=f.elementaryStreams[l];if(!x)return;var E=h[l],y=n!==null||x.partial===!0;o.range[l]=p.getBufferedTimes(f,n,y,E)}),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body)},d.fragBuffered=function(C){var p=S(C),h=this.fragments[p];h&&(h.backtrack=h.loaded=null,h.buffered=!0)},d.getBufferedTimes=function(C,p,h,f){for(var n={time:[],partial:h},r=p?p.start:C.start,o=p?p.end:C.end,l=C.minEndPTS||o,x=C.maxStartPTS||r,E=0;E<f.length;E++){var y=f.start(E)-this.bufferPadding,R=f.end(E)+this.bufferPadding;if(x>=y&&l<=R){n.time.push({startPTS:Math.max(r,f.start(E)),endPTS:Math.min(o,f.end(E))});break}else if(r<R&&o>y)n.partial=!0,n.time.push({startPTS:Math.max(r,f.start(E)),endPTS:Math.min(o,f.end(E))});else if(o<=y)break}return n},d.getPartialFragment=function(C){var p=null,h,f,n,r=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(x){var E=l[x];if(!E)return;U(E)&&(f=E.body.start-o,n=E.body.end+o,C>=f&&C<=n&&(h=Math.min(C-f,n-C),r<=h&&(p=E.body,r=h)))}),p},d.getState=function(C){var p=S(C),h=this.fragments[p];return h?h.buffered?U(h)?A.PARTIAL:A.OK:h.backtrack?A.BACKTRACKED:A.APPENDING:A.NOT_LOADED},d.backtrack=function(C,p){var h=S(C),f=this.fragments[h];if(!f||f.backtrack)return null;var n=f.backtrack=p||f.loaded;return f.loaded=null,n},d.getBacktrackData=function(C){var p=S(C),h=this.fragments[p];if(h){var f,n=h.backtrack;if(n!=null&&(f=n.payload)!==null&&f!==void 0&&f.byteLength)return n;this.removeFragment(C)}return null},d.isTimeBuffered=function(C,p,h){for(var f,n,r=0;r<h.length;r++){if(f=h.start(r)-this.bufferPadding,n=h.end(r)+this.bufferPadding,C>=f&&p<=n)return!0;if(p<=f)return!1}return!1},d.onFragLoaded=function(C,p){var h=p.frag,f=p.part;if(h.sn==="initSegment"||h.bitrateTest||f)return;var n=S(h);this.fragments[n]={body:h,loaded:p,backtrack:null,buffered:!1,range:Object.create(null)}},d.onBufferAppended=function(C,p){var h=this,f=p.frag,n=p.part,r=p.timeRanges;if(f.type===N.PlaylistLevelType.MAIN)if(this.activeFragment=f,n){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(n)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(l){var x=r[l];if(h.detectEvictedFragments(l,x),!n)for(var E=0;E<x.length;E++)f.appendedPTS=Math.max(x.end(E),f.appendedPTS||0)})},d.onFragBuffered=function(C,p){this.detectPartialFragments(p)},d.hasFragment=function(C){var p=S(C);return!!this.fragments[p]},d.removeFragmentsInRange=function(C,p,h){var f=this;Object.keys(this.fragments).forEach(function(n){var r=f.fragments[n];if(!r)return;if(r.buffered){var o=r.body;o.type===h&&o.start<p&&o.end>C&&f.removeFragment(o)}})},d.removeFragment=function(C){var p=S(C);C.stats.loaded=0,C.clearElementaryStreamInfo(),delete this.fragments[p]},d.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function U(L){var d,v;return L.buffered&&(((d=L.range.video)===null||d===void 0?void 0:d.partial)||((v=L.range.audio)===null||v===void 0?void 0:v.partial))}function S(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"STALL_MINIMUM_DURATION_MS",function(){return U}),M.d(H,"MAX_START_GAP_JUMP",function(){return S}),M.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),M.d(H,"SKIP_BUFFER_RANGE_START",function(){return d}),M.d(H,"default",function(){return v});var W=M("./src/utils/buffer-helper.ts"),N=M("./src/errors.ts"),A=M("./src/events.ts"),F=M("./src/utils/logger.ts"),U=250,S=2,L=.1,d=.05,v=function(){function C(h,f,n,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=h,this.media=f,this.fragmentTracker=n,this.hls=r}var p=C.prototype;return p.destroy=function(){this.hls=this.fragmentTracker=this.media=null},p.poll=function(f){var n=this.config,r=this.media,o=this.stalled,l=r.currentTime,x=r.seeking,E=this.seeking&&!x,y=!this.seeking&&x;if(this.seeking=x,l!==f){if(this.moved=!0,o!==null){if(this.stallReported){var R=self.performance.now()-o;F.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((y||E)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!W.BufferHelper.getBuffered(r).length)return;var O=W.BufferHelper.bufferInfo(r,l,0),g=O.len>0,m=O.nextStart||0;if(!g&&!m)return;if(x){var s=O.len>S,u=!m||m-l>S&&!this.fragmentTracker.getPartialFragment(l);if(s||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,T=Math.max(m,O.start||0)-l,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,P=w==null||((_=w.details)===null||_===void 0)?void 0:_.live,j=P?w.details.targetduration*2:S;if(T>0&&T<=j){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(o===null){this.stalled=K;return}var Z=K-o;!x&&Z>=U&&this._reportStall(O.len);var G=W.BufferHelper.bufferInfo(r,l,n.maxBufferHole);this._tryFixBufferStall(G,Z)},p._tryFixBufferStall=function(f,n){var r=this.config,o=this.fragmentTracker,l=this.media,x=l.currentTime,E=o.getPartialFragment(x);if(E){var y=this._trySkipBufferHole(E);if(y)return}f.len>r.maxBufferHole&&n>r.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(f){var n=this.hls,r=this.media,o=this.stallReported;o||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+f+")"),n.trigger(A.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},p._trySkipBufferHole=function(f){for(var n=this.config,r=this.hls,o=this.media,l=o.currentTime,x=0,E=W.BufferHelper.getBuffered(o),y=0;y<E.length;y++){var R=E.start(y);if(l+n.maxBufferHole>=x&&l<R){var O=Math.max(R+d,o.currentTime+L);return F.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+O),this.moved=!0,this.stalled=null,o.currentTime=O,f&&r.trigger(A.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+O,frag:f}),O}x=E.end(y)}return 0},p._tryNudgeBuffer=function(){var f=this.config,n=this.hls,r=this.media,o=r.currentTime,l=(this.nudgeRetry||0)+1;if(this.nudgeRetry=l,l<f.nudgeMaxRetry){var x=o+l*f.nudgeOffset;F.logger.warn("Nudging 'currentTime' from "+o+" to "+x),r.currentTime=x,n.trigger(A.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else F.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+f.nudgeMaxRetry+" nudges"),n.trigger(A.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},C}()},"./src/controller/id3-track-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts"),N=M("./src/utils/texttrack-utils.ts"),A=M("./src/demux/id3.ts"),F=.25,U=function(){function S(d){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=d,this._registerListeners()}var L=S.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var v=this.hls;v.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var v=this.hls;v.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(v,C){this.media=C.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(N.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(v){if(!this.media)return;for(var C=0;C<v.length;C++){var p=v[C];if(p.kind==="metadata"&&p.label==="id3")return Object(N.sendAddTrackEvent)(p,this.media),p}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(v,C){if(!this.media)return;var p=C.frag,h=C.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,n=0;n<h.length;n++){var r=A.getID3Frames(h[n].data);if(r){var o=h[n].pts,l=n<h.length-1?h[n+1].pts:p.end,x=l-o;x<=0&&(l=o+F);for(var E=0;E<r.length;E++){var y=r[E];if(!A.isTimeStampFrame(y)){var R=new f(o,l,"");R.value=y,this.id3Track.addCue(R)}}}}},L.onBufferFlushing=function(v,C){var p=C.startOffset,h=C.endOffset,f=C.type;if(!f||f==="audio"){var n=this.id3Track;n&&Object(N.removeCuesInRange)(n,p,h)}},S}();H.default=U},"./src/controller/latency-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return S});var W=M("./src/errors.ts"),N=M("./src/events.ts"),A=M("./src/utils/logger.ts");function F(L,d){for(var v=0;v<d.length;v++){var C=d[v];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(L,C.key,C)}}function U(L,d,v){return d&&F(L.prototype,d),v&&F(L,v),L}var S=function(){function L(v){var C=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 C.timeupdate()},this.hls=v,this.config=v.config,this.registerListeners()}var d=L.prototype;return d.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},d.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(N.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(N.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(N.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(N.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(N.Events.ERROR,this.onError)},d.onMediaAttached=function(C,p){this.media=p.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},d.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},d.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},d.onLevelUpdated=function(C,p){var h=p.details;this.levelDetails=h,h.advanced&&this.timeupdate(),!h.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},d.onError=function(C,p){if(p.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,A.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},d.timeupdate=function(){var C=this.media,p=this.levelDetails;if(!C||!p)return;this.currentTime=C.currentTime;var h=this.computeLatency();if(h===null)return;this._latency=h;var f=this.config,n=f.lowLatencyMode,r=f.maxLiveSyncPlaybackRate;if(!n||r===1)return;var o=this.targetLatency;if(o===null)return;var l=h-o,x=Math.min(this.maxLatency,o+p.targetduration),E=l<x;if(p.live&&E&&l>.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,r)),R=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;C.playbackRate=Math.min(y,Math.max(1,R))}else C.playbackRate!==1&&C.playbackRate!==0&&(C.playbackRate=1)},d.estimateLiveEdge=function(){var C=this.levelDetails;return C===null?null:C.edge+C.age},d.computeLatency=function(){var C=this.estimateLiveEdge();return C===null?null:C-this.currentTime},U(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var C=this.config,p=this.levelDetails;return C.liveMaxLatencyDuration!==void 0?C.liveMaxLatencyDuration:p?C.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var C=this.levelDetails;if(C===null)return null;var p=C.holdBack,h=C.partHoldBack,f=C.targetduration,n=this.config,r=n.liveSyncDuration,o=n.liveSyncDurationCount,l=n.lowLatencyMode,x=this.hls.userConfig,E=l&&h||p;(x.liveSyncDuration||x.liveSyncDurationCount||E===0)&&(E=r!==void 0?r:o*f);var y=f,R=1;return E+Math.min(this.stallCount*R,y)}},{key:"liveSyncPosition",get:function(){var C=this.estimateLiveEdge(),p=this.targetLatency,h=this.levelDetails;if(C===null||p===null||h===null)return null;var f=h.edge,n=C-p-this.edgeStalled,r=f-h.totalduration,o=f-(this.config.lowLatencyMode&&h.partTarget||h.targetduration);return Math.min(Math.max(r,n),o)}},{key:"drift",get:function(){var C=this.levelDetails;return C===null?1:C.drift}},{key:"edgeStalled",get:function(){var C=this.levelDetails;if(C===null)return 0;var p=(this.config.lowLatencyMode&&C.partTarget||C.targetduration)*3;return Math.max(C.age-p,0)}},{key:"forwardBufferLength",get:function(){var C=this.media,p=this.levelDetails;if(!C||!p)return 0;var h=C.buffered.length;return h?C.buffered.end(h-1):p.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return n});var W=M("./src/types/level.ts"),N=M("./src/events.ts"),A=M("./src/errors.ts"),F=M("./src/utils/codecs.ts"),U=M("./src/controller/level-helper.ts"),S=M("./src/controller/base-playlist-controller.ts"),L=M("./src/types/loader.ts");function d(){return d=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var x in l)Object.prototype.hasOwnProperty.call(l,x)&&(r[x]=l[x])}return r},d.apply(this,arguments)}function v(r,o){for(var l=0;l<o.length;l++){var x=o[l];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(r,x.key,x)}}function C(r,o,l){return o&&v(r.prototype,o),l&&v(r,l),r}function p(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,h(r,o)}function h(r,o){return h=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},h(r,o)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),n=function(r){p(o,r);function o(x){var E;return E=r.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 l=o.prototype;return l._registerListeners=function(){var E=this.hls;E.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),E.on(N.Events.ERROR,this.onError,this)},l._unregisterListeners=function(){var E=this.hls;E.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),E.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(N.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),E.off(N.Events.ERROR,this.onError,this)},l.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},l.startLoad=function(){var E=this._levels;E.forEach(function(y){y.loadError=0}),r.prototype.startLoad.call(this)},l.onManifestLoaded=function(E,y){var R=[],O=[],g=[],m,s={},u,_=!1,T=!1,w=!1;if(y.levels.forEach(function(Z){var G=Z.attrs;_=_||!!(Z.width&&Z.height),T=T||!!Z.videoCodec,w=w||!!Z.audioCodec,f&&Z.audioCodec&&Z.audioCodec.indexOf("mp4a.40.34")!==-1&&(Z.audioCodec=void 0);var B=Z.bitrate+"-"+Z.attrs.RESOLUTION+"-"+Z.attrs.CODECS;u=s[B],u?u.url.push(Z.url):(u=new W.Level(Z),s[B]=u,R.push(u)),G&&(G.AUDIO&&Object(U.addGroupId)(u,"audio",G.AUDIO),G.SUBTITLES&&Object(U.addGroupId)(u,"text",G.SUBTITLES))}),(_||T)&&w&&(R=R.filter(function(Z){var G=Z.videoCodec,B=Z.width,$=Z.height;return!!G||!!(B&&$)})),R=R.filter(function(Z){var G=Z.audioCodec,B=Z.videoCodec;return(!G||Object(F.isCodecSupportedInMp4)(G,"audio"))&&(!B||Object(F.isCodecSupportedInMp4)(B,"video"))}),y.audioTracks&&(O=y.audioTracks.filter(function(Z){return!Z.audioCodec||Object(F.isCodecSupportedInMp4)(Z.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(O)),y.subtitles&&(g=y.subtitles,Object(U.assignTrackIdsByGroup)(g)),R.length>0){m=R[0].bitrate,R.sort(function(Z,G){return Z.bitrate-G.bitrate}),this._levels=R;for(var P=0;P<R.length;P++)if(R[P].bitrate===m){this._firstLevel=P,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+m);break}var j=w&&!T,K={levels:R,audioTracks:O,subtitleTracks:g,firstLevel:this._firstLevel,stats:y.stats,audio:w,video:T,altAudio:!j&&O.some(function(Z){return!!Z.url})};this.hls.trigger(N.Events.MANIFEST_PARSED,K),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(N.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:y.url,reason:"no level with compatible codecs found in manifest"})},l.onError=function(E,y){if(r.prototype.onError.call(this,E,y),y.fatal)return;var R=y.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,m=!0,s;switch(y.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:if(y.frag){var u=this._levels[y.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=y.frag.level)):s=y.frag.level}break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(m=!1),s=R.level),g=!0;break;case A.ErrorDetails.REMUX_ALLOC_ERROR:s=y.level,g=!0;break}s!==void 0&&this.recoverLevel(y,s,g,m)},l.recoverLevel=function(E,y,R,O){var g=E.details,m=this._levels[y];if(m.loadError++,R){var s=this.retryLoadingOrFail(E);if(s)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var u=m.url.length;if(u>1&&m.loadError<u)E.levelRetry=!0,this.redundantFailover(y);else if(this.manualLevelIndex===-1){var _=y===0?this._levels.length-1:y-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(g+": switch to "+_),E.levelRetry=!0,this.hls.nextAutoLevel=_)}}},l.redundantFailover=function(E){var y=this._levels[E],R=y.url.length;if(R>1){var O=(y.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=E}},l.onFragLoaded=function(E,y){var R=y.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},l.onLevelLoaded=function(E,y){var R,O=y.level,g=y.details,m=this._levels[O];if(!m){var s;this.warn("Invalid level index "+O),(s=y.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(O,y,m.details)):(R=y.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(E,y){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[y.id].groupId,m=0;m<R.audioGroupIds.length;m++)if(R.audioGroupIds[m]===g){O=m;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},l.loadPlaylist=function(E){var y=this.currentLevelIndex,R=this._levels[y];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,g=R.url[O];if(E)try{g=E.addDirectives(g)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+y+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(N.Events.LEVEL_LOADING,{url:g,level:y,id:O,deliveryDirectives:E||null})}},l.removeLevel=function(E,y){var R=function(m,s){return s!==y},O=this._levels.filter(function(g,m){return m!==E?!0:g.url.length>1&&y!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,m){var s=g.details;return s!=null&&s.fragments&&s.fragments.forEach(function(u){u.level=m}),g});this._levels=O,this.hls.trigger(N.Events.LEVELS_UPDATED,{levels:O})},C(o,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var y,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===E&&(y=R[E])!==null&&y!==void 0&&y.details)return;if(E<0||E>=R.length){var O=E<0;if(this.hls.trigger(N.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:O,reason:"invalid level idx"}),O)return;E=Math.min(E,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,m=R[g],s=R[E];this.log("switching to level "+E+" from "+g),this.currentLevelIndex=E;var u=d({},s,{level:E,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete u._urlId,this.hls.trigger(N.Events.LEVEL_SWITCHING,u);var _=s.details;if(!_||_.live){var T=this.switchParams(s.uri,m==null?void 0:m.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}(S.default)},"./src/controller/level-helper.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"addGroupId",function(){return A}),M.d(H,"assignTrackIdsByGroup",function(){return F}),M.d(H,"updatePTS",function(){return U}),M.d(H,"updateFragPTSDTS",function(){return L}),M.d(H,"mergeDetails",function(){return d}),M.d(H,"mapPartIntersection",function(){return v}),M.d(H,"mapFragmentIntersection",function(){return C}),M.d(H,"adjustSliding",function(){return p}),M.d(H,"addSliding",function(){return h}),M.d(H,"computeReloadInterval",function(){return f}),M.d(H,"getFragmentWithSN",function(){return n}),M.d(H,"getPartWith",function(){return r});var W=M("./src/polyfills/number.ts"),N=M("./src/utils/logger.ts");function A(o,l,x){switch(l){case"audio":o.audioGroupIds||(o.audioGroupIds=[]),o.audioGroupIds.push(x);break;case"text":o.textGroupIds||(o.textGroupIds=[]),o.textGroupIds.push(x);break}}function F(o){var l={};o.forEach(function(x){var E=x.groupId||"";x.id=l[E]=l[E]||0,l[E]++})}function U(o,l,x){var E=o[l],y=o[x];S(E,y)}function S(o,l){var x=l.startPTS;if(Object(W.isFiniteNumber)(x)){var E=0,y;l.sn>o.sn?(E=x-o.start,y=o):(E=o.start-x,y=l),y.duration!==E&&(y.duration=E)}else if(l.sn>o.sn){var R=o.cc===l.cc;R&&o.minEndPTS?l.start=o.start+(o.minEndPTS-o.start):l.start=o.start+o.duration}else l.start=Math.max(o.start-l.duration,0)}function L(o,l,x,E,y,R){var O=E-x;O<=0&&(N.logger.warn("Fragment should have a positive duration",l),E=x+l.duration,R=y+l.duration);var g=x,m=E,s=l.startPTS,u=l.endPTS;if(Object(W.isFiniteNumber)(s)){var _=Math.abs(s-x);Object(W.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(_,l.deltaPTS):l.deltaPTS=_,g=Math.max(x,s),x=Math.min(x,s),y=Math.min(y,l.startDTS),m=Math.min(E,u),E=Math.max(E,u),R=Math.max(R,l.endDTS)}l.duration=E-x;var T=x-l.start;l.appendedPTS=E,l.start=l.startPTS=x,l.maxStartPTS=g,l.startDTS=y,l.endPTS=E,l.minEndPTS=m,l.endDTS=R;var w=l.sn;if(!o||w<o.startSN||w>o.endSN)return 0;var P,j=w-o.startSN,K=o.fragments;for(K[j]=l,P=j;P>0;P--)S(K[P],K[P-1]);for(P=j;P<K.length-1;P++)S(K[P],K[P+1]);return o.fragmentHint&&S(K[K.length-1],o.fragmentHint),o.PTSKnown=o.alignedSliding=!0,T}function d(o,l){for(var x=null,E=o.fragments,y=E.length-1;y>=0;y--){var R=E[y].initSegment;if(R){x=R;break}}o.fragmentHint&&delete o.fragmentHint.endPTS;var O=0,g;if(C(o,l,function(P,j){P.relurl&&(O=P.cc-j.cc),Object(W.isFiniteNumber)(P.startPTS)&&Object(W.isFiniteNumber)(P.endPTS)&&(j.start=j.startPTS=P.startPTS,j.startDTS=P.startDTS,j.appendedPTS=P.appendedPTS,j.maxStartPTS=P.maxStartPTS,j.endPTS=P.endPTS,j.endDTS=P.endDTS,j.minEndPTS=P.minEndPTS,j.duration=P.endPTS-P.startPTS,j.duration&&(g=j),l.PTSKnown=l.alignedSliding=!0),j.elementaryStreams=P.elementaryStreams,j.loader=P.loader,j.stats=P.stats,j.urlId=P.urlId,P.initSegment&&(j.initSegment=P.initSegment,x=P.initSegment)}),x){var m=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;m.forEach(function(P){var j;(!P.initSegment||P.initSegment.relurl===((j=x)===null||j===void 0?void 0:j.relurl))&&(P.initSegment=x)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(P){return!P}),l.deltaUpdateFailed)){N.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=l.skippedSegments;s--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var u=l.fragments;if(O){N.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<u.length;_++)u[_].cc+=O}l.skippedSegments&&(l.startCC=l.fragments[0].cc),v(o.partList,l.partList,function(P,j){j.elementaryStreams=P.elementaryStreams,j.stats=P.stats}),g?L(l,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS):p(o,l),u.length&&(l.totalduration=l.edge-u[0].start),l.driftStartTime=o.driftStartTime,l.driftStart=o.driftStart;var T=l.advancedDateTime;if(l.advanced&&T){var w=l.edge;l.driftStart||(l.driftStartTime=T,l.driftStart=w),l.driftEndTime=T,l.driftEnd=w}else l.driftEndTime=o.driftEndTime,l.driftEnd=o.driftEnd,l.advancedDateTime=o.advancedDateTime}function v(o,l,x){if(o&&l)for(var E=0,y=0,R=o.length;y<=R;y++){var O=o[y],g=l[y+E];O&&g&&O.index===g.index&&O.fragment.sn===g.fragment.sn?x(O,g):E--}}function C(o,l,x){for(var E=l.skippedSegments,y=Math.max(o.startSN,l.startSN)-l.startSN,R=(o.fragmentHint?1:0)+(E?l.endSN:Math.min(o.endSN,l.endSN))-l.startSN,O=l.startSN-o.startSN,g=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,m=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,s=y;s<=R;s++){var u=m[O+s],_=g[s];E&&!_&&s<E&&(_=l.fragments[s]=u),u&&_&&x(u,_)}}function p(o,l){var x=l.startSN+l.skippedSegments-o.startSN,E=o.fragments;if(x<0||x>=E.length)return;h(l,E[x].start)}function h(o,l){if(l){for(var x=o.fragments,E=o.skippedSegments;E<x.length;E++)x[E].start+=l;o.fragmentHint&&(o.fragmentHint.start+=l)}}function f(o,l){var x=1e3*o.levelTargetDuration,E=x/2,y=o.age,R=y>0&&y<x*3,O=l.loading.end-l.loading.start,g,m=o.availabilityDelay;if(o.updated===!1)if(R){var s=333*o.misses;g=Math.max(Math.min(E,O*2),s),o.availabilityDelay=(o.availabilityDelay||0)+g}else g=E;else R?(m=Math.min(m||x/2,y),o.availabilityDelay=m,g=m+x-y):g=x-O;return Math.round(g)}function n(o,l,x){if(!o||!o.details)return null;var E=o.details,y=E.fragments[l-E.startSN];return y||(y=E.fragmentHint,y&&y.sn===l?y:l<E.startSN&&x&&x.sn===l?x:null)}function r(o,l,x){if(!o||!o.details)return null;var E=o.details.partList;if(E)for(var y=E.length;y--;){var R=E[y];if(R.index===x&&R.fragment.sn===l)return R}return null}},"./src/controller/stream-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return E});var W=M("./src/polyfills/number.ts"),N=M("./src/controller/base-stream-controller.ts"),A=M("./src/is-supported.ts"),F=M("./src/events.ts"),U=M("./src/utils/buffer-helper.ts"),S=M("./src/controller/fragment-tracker.ts"),L=M("./src/types/loader.ts"),d=M("./src/loader/fragment.ts"),v=M("./src/demux/transmuxer-interface.ts"),C=M("./src/types/transmuxer.ts"),p=M("./src/controller/gap-controller.ts"),h=M("./src/errors.ts"),f=M("./src/utils/logger.ts");function n(y,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}function r(y,R,O){return R&&n(y.prototype,R),O&&n(y,O),y}function o(y,R){y.prototype=Object.create(R.prototype),y.prototype.constructor=y,l(y,R)}function l(y,R){return l=Object.setPrototypeOf||function(g,m){return g.__proto__=m,g},l(y,R)}var x=100,E=function(y){o(R,y);function R(g,m){var s;return s=y.call(this,g,m,"[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 O=R.prototype;return O._registerListeners=function(){var m=this.hls;m.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),m.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.on(F.Events.ERROR,this.onError,this),m.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var m=this.hls;m.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.off(F.Events.ERROR,this.onError,this),m.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(m){if(this.levels){var s=this.lastCurrentTime,u=this.hls;if(this.stopLoad(),this.setInterval(x),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=u.startLevel;_===-1&&(u.config.testBandwidth?(_=0,this.bitrateTest=!0):_=u.nextAutoLevel),this.level=u.nextLoadLevel=_,this.loadedmetadata=!1}s>0&&m===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),m=s),this.state=N.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()}else this._forceStartLoad=!0,this.state=N.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,y.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case N.State.IDLE:this.doTickIdle();break;case N.State.WAITING_LEVEL:{var m,s=this.levels,u=this.level,_=s==null||((m=s[u])===null||m===void 0)?void 0:m.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=N.State.IDLE;break}break}case N.State.FRAG_LOADING_WAITING_RETRY:{var T,w=self.performance.now(),P=this.retryDate;(!P||w>=P||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=N.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){y.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var m,s,u=this.hls,_=this.levelLastLoaded,T=this.levels,w=this.media,P=u.config,j=u.nextLoadLevel;if(_===null||!w&&(this.startFragRequested||!P.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!T||!T[j])return;var K=T[j];this.level=u.nextLoadLevel=j;var Z=K.details;if(!Z||this.state===N.State.WAITING_LEVEL||Z.live&&this.levelLastLoaded!==j){this.state=N.State.WAITING_LEVEL;return}var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,L.PlaylistLevelType.MAIN);if(G===null)return;var B=G.len,$=this.getMaxBufferLength(K.maxBitrate);if(B>=$)return;if(this._streamEnded(G,Z)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,ne),this.state=N.State.ENDED;return}var ae=G.end,fe=this.getNextFragment(ae,Z);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var _e=fe.sn-Z.startSN;_e>1&&(fe=Z.fragments[_e-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===S.FragmentState.OK&&this.nextLoadPosition>ae){var Se=this.audioOnly&&!this.altAudio?d.ElementaryStreamTypes.AUDIO:d.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,Se,L.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,Z)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((m=fe.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((s=fe.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(fe,Z):this.loadFragment(fe,Z,ae)},O.loadFragment=function(m,s,u){var _,T=this.fragmentTracker.getState(m);if(this.fragCurrent=m,T===S.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(m);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else T=S.FragmentState.NOT_LOADED}T===S.FragmentState.NOT_LOADED||T===S.FragmentState.PARTIAL?m.sn==="initSegment"?this._loadInitSegment(m):this.bitrateTest?(m.bitrateTest=!0,this.log("Fragment "+m.sn+" of level "+m.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(m)):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,m,s,u)):T===S.FragmentState.APPENDING?this.reduceMaxBufferLength(m.duration)&&this.fragmentTracker.removeFragment(m):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(m){var s=this.fragmentTracker.getAppendedFrag(m,L.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},O.getBufferedFrag=function(m){return this.fragmentTracker.getBufferedFrag(m,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(m){return m?this.getBufferedFrag(m.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var m=this.levels,s=this.media;if(s!=null&&s.readyState){var u,_=this.getAppendedFrag(s.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!s.paused&&m){var T=this.hls.nextLoadLevel,w=m[T],P=this.fragLastKbps;P&&this.fragCurrent?u=this.fragCurrent.duration*w.maxBitrate/(1e3*P)+1:u=0}else u=0;var j=this.getBufferedFrag(s.currentTime+u);if(j){var K=this.followingBufferedFrag(j);if(K){this.abortCurrentFrag();var Z=K.maxStartPTS?K.maxStartPTS:K.start,G=K.duration,B=Math.max(j.end,Z+Math.min(Math.max(G-this.config.maxFragLookUpTolerance,G*.5),G*.75));this.flushMainBuffer(B,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var m=this.fragCurrent;this.fragCurrent=null,m!=null&&m.loader&&m.loader.abort(),this.state===N.State.KEY_LOADING&&(this.state=N.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(m,s){y.prototype.flushMainBuffer.call(this,m,s,this.altAudio?"video":null)},O.onMediaAttached=function(m,s){y.prototype.onMediaAttached.call(this,m,s);var u=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,u,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var m=this.media;m&&(m.removeEventListener("playing",this.onvplaying),m.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),y.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var m=this.media,s=m?m.currentTime:null;Object(W.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(m,s){var u=!1,_=!1,T;s.levels.forEach(function(w){T=w.audioCodec,T&&(T.indexOf("mp4a.40.2")!==-1&&(u=!0),T.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=u&&_&&!Object(A.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},O.onLevelLoading=function(m,s){var u=this.levels;if(!u||this.state!==N.State.IDLE)return;var _=u[s.level];(!_.details||_.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(_.details))&&(this.state=N.State.WAITING_LEVEL)},O.onLevelLoaded=function(m,s){var u,_=this.levels,T=s.level,w=s.details,P=w.totalduration;if(!_){this.warn("Levels were reset while loading level "+T);return}this.log("Level "+T+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+P);var j=this.fragCurrent;j&&(this.state===N.State.FRAG_LOADING||this.state===N.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==s.level&&j.loader&&(this.state=N.State.IDLE,j.loader.abort()));var K=_[T],Z=0;if(w.live||(u=K.details)!==null&&u!==void 0&&u.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;Z=this.alignPlaylists(w,K.details)}if(K.details=w,this.levelLastLoaded=T,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:w,level:T}),this.state===N.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=N.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,Z),this.tick()},O._handleFragmentLoadProgress=function(m){var s,u=m.frag,_=m.part,T=m.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var P=w[u.level],j=P.details;if(!j){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var K=P.videoCodec,Z=j.PTSKnown||!j.live,G=(s=u.initSegment)===null||s===void 0?void 0:s.data,B=this._getAudioCodec(P),$=this.transmuxer=this.transmuxer||new v.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=_?_.index:-1,ae=ne!==-1,fe=new C.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,T.byteLength,ne,ae),_e=this.initPTS[u.cc];$.push(T,G,B,K,u,_,j.totalduration,Z,fe,_e)},O.onAudioTrackSwitching=function(m,s){var u=this.altAudio,_=!!s.url,T=s.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var P=this.hls;u&&P.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),P.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:T})}},O.onAudioTrackSwitched=function(m,s){var u=s.id,_=!!this.hls.audioTracks[u].url;if(_){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=_,this.tick()},O.onBufferCreated=function(m,s){var u=s.tracks,_,T,w=!1;for(var P in u){var j=u[P];if(j.id==="main"){if(T=P,_=j,P==="video"){var K=u[P];K&&(this.videoBuffer=K.buffer)}}else w=!0}w&&_?(this.log("Alternate track found, use "+T+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(m,s){var u=s.frag,_=s.part;if(u&&u.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(_?" p: "+_.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===N.State.PARSED&&(this.state=N.State.IDLE);return}var T=_?_.stats:u.stats;this.fragLastKbps=Math.round(8*T.total/(T.buffering.end-T.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,_)},O.onError=function(m,s){switch(s.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,s);break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==N.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=N.State.ERROR):!s.levelRetry&&this.state===N.State.WAITING_LEVEL&&(this.state=N.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===N.State.PARSING||this.state===N.State.PARSED)){var u=!0,_=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);_&&_.len>.5&&(u=!this.reduceMaxBufferLength(_.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var m=this.media,s=this.gapController;if(!m||!s||!m.readyState)return;var u=U.BufferHelper.getBuffered(m);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=m.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=N.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(m,s){var u=s.type;if(u!==d.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(u===d.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,u,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(m,s){this.levels=s.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var m=this.media,s=m.currentTime,u=this.startPosition;if(u>=0&&s<u){if(m.seeking){f.logger.log("could not seek to "+u+", already seeking at "+s);return}var _=U.BufferHelper.getBuffered(m),T=_.length?_.start(0):0,w=T-u;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+w+" to match buffer start"),u+=w,this.startPosition=u),this.log("seek to target start position "+u+" from current time "+s),m.currentTime=u}},O._getAudioCodec=function(m){var s=this.config.defaultAudioCodec||m.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},O._loadBitrateTestFrag=function(m){var s=this;this._doFragLoad(m).then(function(u){var _=s.hls;if(!u||_.nextLoadLevel||s.fragContextChanged(m))return;s.fragLoadError=0,s.state=N.State.IDLE,s.startFragRequested=!1,s.bitrateTest=!1;var T=m.stats;T.parsing.start=T.parsing.end=T.buffering.start=T.buffering.end=self.performance.now(),_.trigger(F.Events.FRAG_LOADED,u)})},O._handleTransmuxComplete=function(m){var s,u="main",_=this.hls,T=m.remuxResult,w=m.chunkMeta,P=this.getCurrentContext(w);if(!P){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var j=P.frag,K=P.part,Z=P.level,G=T.video,B=T.text,$=T.id3,ne=T.initSegment,ae=this.altAudio?void 0:T.audio;if(this.fragContextChanged(j))return;if(this.state=N.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(Z,ne.tracks,j,w),_.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:u,tracks:ne.tracks}));var fe=ne.initPTS,_e=ne.timescale;Object(W.isFiniteNumber)(fe)&&(this.initPTS[j.cc]=fe,_.trigger(F.Events.INIT_PTS_FOUND,{frag:j,id:u,initPTS:fe,timescale:_e}))}if(G&&T.independent!==!1){if(Z.details){var Se=G.startPTS,we=G.endPTS,Me=G.startDTS,Le=G.endDTS;if(K)K.elementaryStreams[G.type]={startPTS:Se,endPTS:we,startDTS:Me,endDTS:Le};else if(G.firstKeyFrame&&G.independent&&(this.couldBacktrack=!0),G.dropped&&G.independent){var ge=this.getLoadPosition()+this.config.maxBufferHole;if(ge<Se){this.backtrack(j);return}j.setElementaryStreamInfo(G.type,j.start,we,j.start,Le,!0)}j.setElementaryStreamInfo(G.type,Se,we,Me,Le),this.bufferFragmentData(G,j,K,w)}}else if(T.independent===!1){this.backtrack(j);return}if(ae){var ue=ae.startPTS,ke=ae.endPTS,lt=ae.startDTS,ot=ae.endDTS;K&&(K.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:ke,startDTS:lt,endDTS:ot}),j.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,ue,ke,lt,ot),this.bufferFragmentData(ae,j,K,w)}if($!=null&&(s=$.samples)!==null&&s!==void 0&&s.length){var st={frag:j,id:u,samples:$.samples};_.trigger(F.Events.FRAG_PARSING_METADATA,st)}if(B){var ce={frag:j,id:u,samples:B.samples};_.trigger(F.Events.FRAG_PARSING_USERDATA,ce)}},O._bufferInitSegment=function(m,s,u,_){var T=this;if(this.state!==N.State.PARSING)return;this.audioOnly=!!s.audio&&!s.video,this.altAudio&&!this.audioOnly&&delete s.audio;var w=s.audio,P=s.video,j=s.audiovideo;if(w){var K=m.audioCodec,Z=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(K&&(K.indexOf("mp4a.40.5")!==-1?K="mp4a.40.2":K="mp4a.40.5"),w.metadata.channelCount!==1&&Z.indexOf("firefox")===-1&&(K="mp4a.40.5")),Z.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(K="mp4a.40.2",this.log("Android: force audio codec to "+K)),m.audioCodec&&m.audioCodec!==K&&this.log('Swapping manifest audio codec "'+m.audioCodec+'" for "'+K+'"'),w.levelCodec=K,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(K||"")+"/"+(m.audioCodec||"")+"/"+w.codec+"]")}P&&(P.levelCodec=m.videoCodec,P.id="main",this.log("Init video buffer, container:"+P.container+", codecs[level/parsed]=["+(m.videoCodec||"")+"/"+P.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(m.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,s),Object.keys(s).forEach(function(G){var B=s[G],$=B.initSegment;$!=null&&$.byteLength&&T.hls.trigger(F.Events.BUFFER_APPENDING,{type:G,data:$,frag:u,part:null,chunkMeta:_,parent:u.type})}),this.tick()},O.backtrack=function(m){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(m);var s=this.fragmentTracker.backtrack(m);this.fragPrevious=null,this.nextLoadPosition=m.start,s?this.resetFragmentLoading(m):this.state=N.State.BACKTRACKING},O.checkFragmentChanged=function(){var m=this.media,s=null;if(m&&m.readyState>1&&m.seeking===!1){var u=m.currentTime;if(U.BufferHelper.isBuffered(m,u)?s=this.getAppendedFrag(u):U.BufferHelper.isBuffered(m,u+.1)&&(s=this.getAppendedFrag(u+.1)),s){var _=this.fragPlaying,T=s.level;(!_||s.sn!==_.sn||_.level!==T||s.urlId!==_.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:s}),(!_||_.level!==T)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:T}),this.fragPlaying=s)}}},r(R,[{key:"nextLevel",get:function(){var m=this.nextBufferedFrag;return m?m.level:-1}},{key:"currentLevel",get:function(){var m=this.media;if(m){var s=this.getAppendedFrag(m.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var m=this.media;if(m){var s=this.getAppendedFrag(m.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(N.default)},"./src/controller/subtitle-stream-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"SubtitleStreamController",function(){return o});var W=M("./src/events.ts"),N=M("./src/utils/logger.ts"),A=M("./src/utils/buffer-helper.ts"),F=M("./src/controller/fragment-finders.ts"),U=M("./src/utils/discontinuities.ts"),S=M("./src/controller/level-helper.ts"),L=M("./src/controller/fragment-tracker.ts"),d=M("./src/controller/base-stream-controller.ts"),v=M("./src/types/loader.ts"),C=M("./src/types/level.ts");function p(l,x){for(var E=0;E<x.length;E++){var y=x[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(l,y.key,y)}}function h(l,x,E){return x&&p(l.prototype,x),E&&p(l,E),l}function f(l,x){l.prototype=Object.create(x.prototype),l.prototype.constructor=l,n(l,x)}function n(l,x){return n=Object.setPrototypeOf||function(y,R){return y.__proto__=R,y},n(l,x)}var r=500,o=function(l){f(x,l);function x(y,R){var O;return O=l.call(this,y,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var E=x.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var R=this.hls;R.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(W.Events.ERROR,this.onError,this),R.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E._unregisterListeners=function(){var R=this.hls;R.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(W.Events.ERROR,this.onError,this),R.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},E.startLoad=function(){this.stopLoad(),this.state=d.State.IDLE,this.setInterval(r),this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},E.onLevelLoaded=function(R,O){this.mainDetails=O.details},E.onSubtitleFragProcessed=function(R,O){var g=O.frag,m=O.success;if(this.fragPrevious=g,this.state=d.State.IDLE,!m)return;var s=this.tracksBuffered[this.currentTrackId];if(!s)return;for(var u,_=g.start,T=0;T<s.length;T++)if(_>=s[T].start&&_<=s[T].end){u=s[T];break}var w=g.start+g.duration;u?u.end=w:(u={start:_,end:w},s.push(u)),this.fragmentTracker.fragBuffered(g)},E.onBufferFlushing=function(R,O){var g=O.startOffset,m=O.endOffset;if(g===0&&m!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,u=this.levels;if(!u.length||!u[s]||!u[s].details)return;var _=u[s].details,T=_.targetduration,w=m-T;if(w<=0)return;O.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(P){for(var j=0;j<P.length;){if(P[j].end<=w){P.shift();continue}else if(P[j].start<w)P[j].start=w;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(g,w,v.PlaylistLevelType.SUBTITLE)}},E.onError=function(R,O){var g,m=O.frag;if(!m||m.type!==v.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=d.State.IDLE},E.onSubtitleTracksUpdated=function(R,O){var g=this,m=O.subtitleTracks;this.tracksBuffered=[],this.levels=m.map(function(s){return new C.Level(s)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(s){g.tracksBuffered[s.id]=[]}),this.mediaBuffer=null},E.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(r)},E.onSubtitleTrackLoaded=function(R,O){var g,m=O.details,s=O.id,u=this.currentTrackId,_=this.levels;if(!_.length)return;var T=_[u];if(s>=_.length||s!==u||!T)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,m.live||(g=T.details)!==null&&g!==void 0&&g.live){var w=this.mainDetails;if(m.deltaUpdateFailed||!w)return;var P=w.fragments[0];if(!T.details)m.hasProgramDateTime&&w.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(m,w):P&&Object(S.addSliding)(m,P.start);else{var j=this.alignPlaylists(m,T.details);j===0&&P&&Object(S.addSliding)(m,P.start)}}if(T.details=m,this.levelLastLoaded=s,this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===d.State.IDLE){var K=Object(F.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),T.details=void 0)}},E._handleFragmentLoadComplete=function(R){var O=R.frag,g=R.payload,m=O.decryptdata,s=this.hls;if(this.fragContextChanged(O))return;if(g&&g.byteLength>0&&m&&m.key&&m.iv&&m.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),m.key.buffer,m.iv.buffer).then(function(_){var T=performance.now();s.trigger(W.Events.FRAG_DECRYPTED,{frag:O,payload:_,stats:{tstart:u,tdecrypt:T}})})}},E.doTick=function(){if(!this.media){this.state=d.State.IDLE;return}if(this.state===d.State.IDLE){var R,O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var m=g[O].details,s=m.targetduration,u=this.config,_=this.media,T=A.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-s,u.maxBufferHole),w=T.end,P=T.len,j=this.getMaxBufferLength()+s;if(P>j)return;console.assert(m,"Subtitle track details are defined on idle subtitle stream controller tick");var K=m.fragments,Z=K.length,G=m.edge,B,$=this.fragPrevious;if(w<G){var ne=u.maxFragLookUpTolerance;$&&m.hasProgramDateTime&&(B=Object(F.findFragmentByPDT)(K,$.endProgramDateTime,ne)),B||(B=Object(F.findFragmentByPTS)($,K,w,ne),!B&&$&&$.start<K[0].start&&(B=K[0]))}else B=K[Z-1];(R=B)!==null&&R!==void 0&&R.encrypted?(N.logger.log("Loading key for "+B.sn),this.state=d.State.KEY_LOADING,this.hls.trigger(W.Events.KEY_LOADING,{frag:B})):B&&this.fragmentTracker.getState(B)===L.FragmentState.NOT_LOADED&&this.loadFragment(B,m,w)}},E.loadFragment=function(R,O,g){this.fragCurrent=R,l.prototype.loadFragment.call(this,R,O,g)},h(x,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),x}(d.default)},"./src/controller/subtitle-track-controller.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/events.ts"),N=M("./src/utils/texttrack-utils.ts"),A=M("./src/controller/base-playlist-controller.ts"),F=M("./src/types/loader.ts");function U(p,h){for(var f=0;f<h.length;f++){var n=h[f];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(p,n.key,n)}}function S(p,h,f){return h&&U(p.prototype,h),f&&U(p,f),p}function L(p,h){p.prototype=Object.create(h.prototype),p.prototype.constructor=p,d(p,h)}function d(p,h){return d=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},d(p,h)}var v=function(p){L(h,p);function h(n){var r;return r=p.call(this,n,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var f=h.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,p.prototype.destroy.call(this)},f.registerListeners=function(){var r=this.hls;r.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(W.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var r=this.hls;r.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(W.Events.ERROR,this.onError,this)},f.onMediaAttached=function(r,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)},f.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=C(this.media.textTracks);r.forEach(function(o){Object(N.clearCurrentCues)(o)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(r,o){this.tracks=o.subtitleTracks},f.onSubtitleTrackLoaded=function(r,o){var l=o.id,x=o.details,E=this.trackId,y=this.tracksInGroup[E];if(!y){this.warn("Invalid subtitle track id "+l);return}var R=y.details;y.details=o.details,this.log("subtitle track "+l+" loaded ["+x.startSN+"-"+x.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,o,R))},f.onLevelLoading=function(r,o){this.switchLevel(o.level)},f.onLevelSwitching=function(r,o){this.switchLevel(o.level)},f.switchLevel=function(r){var o=this.hls.levels[r];if(!(o!=null&&o.textGroupIds))return;var l=o.textGroupIds[o.urlId];if(this.groupId!==l){var x=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(O){return!l||O.groupId===l});this.tracksInGroup=E;var y=this.findTrackId(x==null?void 0:x.name)||this.findTrackId();this.groupId=l;var R={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,R),y!==-1&&this.setSubtitleTrack(y,x)}},f.findTrackId=function(r){for(var o=this.tracksInGroup,l=0;l<o.length;l++){var x=o[l];if((!this.selectDefaultTrack||x.default)&&(!r||r===x.name))return x.id}return-1},f.onError=function(r,o){if(p.prototype.onError.call(this,r,o),o.fatal||!o.context)return;o.context.type===F.PlaylistContextType.SUBTITLE_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},f.loadPlaylist=function(r){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var l=o.id,x=o.groupId,E=o.url;if(r)try{E=r.addDirectives(E)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Loading subtitle playlist for id "+l),this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADING,{url:E,id:l,groupId:x,deliveryDirectives:r||null})}},f.toggleTrackModes=function(r){var o=this,l=this.media,x=this.subtitleDisplay,E=this.trackId;if(!l)return;var y=C(l.textTracks),R=y.filter(function(m){return m.groupId===o.groupId});if(r===-1)[].slice.call(y).forEach(function(m){m.mode="disabled"});else{var O=R[E];O&&(O.mode="disabled")}var g=R[r];g&&(g.mode=x?"showing":"hidden")},f.setSubtitleTrack=function(r,o){var l,x=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(l=x[r])!==null&&l!==void 0&&l.details)||r<-1||r>=x.length)return;this.clearTimer();var E=x[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,E){var y=E.id,R=E.groupId,O=R===void 0?"":R,g=E.name,m=E.type,s=E.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:y,groupId:O,name:g,type:m,url:s});var u=this.switchParams(E.url,o==null?void 0:o.details);this.loadPlaylist(u)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:r})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,o=C(this.media.textTracks),l=0;l<o.length;l++)if(o[l].mode==="hidden")r=l;else if(o[l].mode==="showing"){r=l;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},S(h,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var o=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,o)}}]),h}(A.default);function C(p){for(var h=[],f=0;f<p.length;f++){var n=p[f];n.kind==="subtitles"&&n.label&&h.push(p[f])}return h}H.default=v},"./src/controller/timeline-controller.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"TimelineController",function(){return C});var W=M("./src/polyfills/number.ts"),N=M("./src/events.ts"),A=M("./src/utils/cea-608-parser.ts"),F=M("./src/utils/output-filter.ts"),U=M("./src/utils/webvtt-parser.ts"),S=M("./src/utils/texttrack-utils.ts"),L=M("./src/utils/imsc1-ttml-parser.ts"),d=M("./src/types/loader.ts"),v=M("./src/utils/logger.ts"),C=function(){function n(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=f(),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 l=new F.default(this,"textTrack1"),x=new F.default(this,"textTrack2"),E=new F.default(this,"textTrack3"),y=new F.default(this,"textTrack4");this.cea608Parser1=new A.default(1,l,x),this.cea608Parser2=new A.default(3,E,y)}o.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.on(N.Events.FRAG_LOADING,this.onFragLoading,this),o.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.on(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=n.prototype;return r.destroy=function(){var l=this.hls;l.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(N.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.off(N.Events.FRAG_LOADING,this.onFragLoading,this),l.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(N.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.off(N.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(N.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(l,x,E,y,R){for(var O=!1,g=R.length;g--;){var m=R[g],s=h(m[0],m[1],x,E);if(s>=0&&(m[0]=Math.min(m[0],x),m[1]=Math.max(m[1],E),O=!0,s/(E-x)>.5))return}if(O||R.push([x,E]),this.config.renderTextTracksNatively){var u=this.captionsTracks[l];this.Cues.newCue(u,x,E,y)}else{var _=this.Cues.newCue(null,x,E,y);this.hls.trigger(N.Events.CUES_PARSED,{type:"captions",cues:_,track:l})}},r.onInitPtsFound=function(l,x){var E=this,y=x.frag,R=x.id,O=x.initPTS,g=x.timescale,m=this.unparsedVttFrags;R==="main"&&(this.initPTS[y.cc]=O,this.timescale[y.cc]=g),m.length&&(this.unparsedVttFrags=[],m.forEach(function(s){E.onFragLoaded(N.Events.FRAG_LOADED,s)}))},r.getExistingTrack=function(l){var x=this.media;if(x)for(var E=0;E<x.textTracks.length;E++){var y=x.textTracks[E];if(y[l])return y}return null},r.createCaptionsTrack=function(l){this.config.renderTextTracksNatively?this.createNativeTrack(l):this.createNonNativeTrack(l)},r.createNativeTrack=function(l){if(this.captionsTracks[l])return;var x=this.captionsProperties,E=this.captionsTracks,y=this.media,R=x[l],O=R.label,g=R.languageCode,m=this.getExistingTrack(l);if(m)E[l]=m,Object(S.clearCurrentCues)(E[l]),Object(S.sendAddTrackEvent)(E[l],y);else{var s=this.createTextTrack("captions",O,g);s&&(s[l]=!0,E[l]=s)}},r.createNonNativeTrack=function(l){if(this.nonNativeCaptionsTracks[l])return;var x=this.captionsProperties[l];if(!x)return;var E=x.label,y={_id:l,label:E,kind:"captions",default:x.media?!!x.media.default:!1,closedCaptions:x.media};this.nonNativeCaptionsTracks[l]=y,this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[y]})},r.createTextTrack=function(l,x,E){var y=this.media;return y?y.addTextTrack(l,x,E):void 0},r.onMediaAttaching=function(l,x){this.media=x.media,this._cleanTracks()},r.onMediaDetaching=function(){var l=this.captionsTracks;Object.keys(l).forEach(function(x){Object(S.clearCurrentCues)(l[x]),delete l[x]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var l=this.media;if(!l)return;var x=l.textTracks;if(x)for(var E=0;E<x.length;E++)Object(S.clearCurrentCues)(x[E])},r.onSubtitleTracksUpdated=function(l,x){var E=this;this.textTracks=[];var y=x.subtitleTracks||[],R=y.some(function(s){return s.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&y&&this.tracks.length===y.length;if(this.tracks=y||[],this.config.renderTextTracksNatively){var g=this.media?this.media.textTracks:[];this.tracks.forEach(function(s,u){var _;if(u<g.length){for(var T=null,w=0;w<g.length;w++)if(p(g[w],s)){T=g[w];break}T&&(_=T)}_?Object(S.clearCurrentCues)(_):(_=E.createTextTrack("subtitles",s.name,s.lang),_&&(_.mode="disabled")),_&&(_.groupId=s.groupId,E.textTracks.push(_))})}else if(!O&&this.tracks&&this.tracks.length){var m=this.tracks.map(function(s){return{label:s.name,kind:s.type.toLowerCase(),default:s.default,subtitleTrack:s}});this.hls.trigger(N.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:m})}}},r.onManifestLoaded=function(l,x){var E=this;this.config.enableCEA708Captions&&x.captions&&x.captions.forEach(function(y){var R=/(?:CC|SERVICE)([1-4])/.exec(y.instreamId);if(!R)return;var O="textTrack"+R[1],g=E.captionsProperties[O];if(!g)return;g.label=y.name,y.lang&&(g.languageCode=y.lang),g.media=y})},r.onFragLoading=function(l,x){var E=this.cea608Parser1,y=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(E&&y))return;if(x.frag.type===d.PlaylistLevelType.MAIN){var g,m,s=x.frag.sn,u=(g=x==null||((m=x.part)===null||m===void 0)?void 0:m.index)!=null?g:-1;s===R+1||s===R&&u===O+1||(E.reset(),y.reset()),this.lastSn=s,this.lastPartIndex=u}},r.onFragLoaded=function(l,x){var E=x.frag,y=x.payload,R=this.initPTS,O=this.unparsedVttFrags;if(E.type===d.PlaylistLevelType.SUBTITLE)if(y.byteLength){if(!Object(W.isFiniteNumber)(R[E.cc])){O.push(x),R.length&&this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Missing initial subtitle PTS")});return}var g=E.decryptdata;if(g==null||g.key==null||g.method!=="AES-128"){var m=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),m&&m.textCodec===L.IMSC1_CODEC?this._parseIMSC1(E,y):this._parseVTTs(E,y,s)}}else this.hls.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:E,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(l,x){var E=this,y=this.hls;Object(L.parseIMSC1)(x,this.initPTS[l.cc],this.timescale[l.cc],function(R){E._appendCues(R,l.level),y.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(R){v.logger.log("Failed to parse IMSC1: "+R),y.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:R})})},r._parseVTTs=function(l,x,E){var y=this,R=this.hls;Object(U.parseWebVTT)(x,this.initPTS[l.cc],this.timescale[l.cc],E,l.cc,l.start,function(O){y._appendCues(O,l.level),R.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:l})},function(O){y._fallbackToIMSC1(l,x),v.logger.log("Failed to parse VTT cue: "+O),R.trigger(N.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:l,error:O})})},r._fallbackToIMSC1=function(l,x){var E=this,y=this.tracks[l.level];y.textCodec||Object(L.parseIMSC1)(x,this.initPTS[l.cc],this.timescale[l.cc],function(){y.textCodec=L.IMSC1_CODEC,E._parseIMSC1(l,x)},function(){y.textCodec="wvtt"})},r._appendCues=function(l,x){var E=this.hls;if(this.config.renderTextTracksNatively){var y=this.textTracks[x];if(y.mode==="disabled")return;l.forEach(function(g){return Object(S.addCueToTrack)(y,g)})}else{var R=this.tracks[x],O=R.default?"default":"subtitles"+x;E.trigger(N.Events.CUES_PARSED,{type:"subtitles",cues:l,track:O})}},r.onFragDecrypted=function(l,x){var E=x.frag;if(E.type===d.PlaylistLevelType.SUBTITLE){if(!Object(W.isFiniteNumber)(this.initPTS[E.cc])){this.unparsedVttFrags.push(x);return}this.onFragLoaded(N.Events.FRAG_LOADED,x)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(l,x){var E=this.cea608Parser1,y=this.cea608Parser2;if(!this.enabled||!(E&&y))return;for(var R=0;R<x.samples.length;R++){var O=x.samples[R].bytes;if(O){var g=this.extractCea608Data(O);E.addData(x.samples[R].pts,g[0]),y.addData(x.samples[R].pts,g[1])}}},r.onBufferFlushing=function(l,x){var E=x.startOffset,y=x.endOffset,R=x.endOffsetSubtitles,O=x.type,g=this.media;if(!g||g.currentTime<y)return;if(!O||O==="video"){var m=this.captionsTracks;Object.keys(m).forEach(function(u){return Object(S.removeCuesInRange)(m[u],E,y)})}if(this.config.renderTextTracksNatively&&(E===0&&R!==void 0)){var s=this.textTracks;Object.keys(s).forEach(function(u){return Object(S.removeCuesInRange)(s[u],E,R)})}},r.extractCea608Data=function(l){for(var x=l[0]&31,E=2,y=[[],[]],R=0;R<x;R++){var O=l[E++],g=127&l[E++],m=127&l[E++],s=(4&O)!==0,u=3&O;if(g===0&&m===0)continue;s&&((u===0||u===1)&&(y[u].push(g),y[u].push(m)))}return y},n}();function p(n,r){return n&&n.label===r.name&&!(n.textTrack1||n.textTrack2)}function h(n,r,o,l){return Math.min(r,l)-Math.max(n,o)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return W});var W=function(){function N(F,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=F,this.aesIV=U}var A=N.prototype;return A.decrypt=function(U,S){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},S,U)},N}()},"./src/crypt/aes-decryptor.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"removePadding",function(){return N}),M.d(H,"default",function(){return A});var W=M("./src/utils/typed-array.ts");function N(F){var U=F.byteLength,S=U&&new DataView(F.buffer).getUint8(U-1);return S?Object(W.sliceUint8)(F,0,U-S):F}var A=function(){function F(){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=F.prototype;return U.uint8ArrayToUint32Array_=function(L){for(var d=new DataView(L),v=new Uint32Array(4),C=0;C<4;C++)v[C]=d.getUint32(C*4);return v},U.initTable=function(){var L=this.sBox,d=this.invSBox,v=this.subMix,C=v[0],p=v[1],h=v[2],f=v[3],n=this.invSubMix,r=n[0],o=n[1],l=n[2],x=n[3],E=new Uint32Array(256),y=0,R=0,O=0;for(O=0;O<256;O++)O<128?E[O]=O<<1:E[O]=O<<1^283;for(O=0;O<256;O++){var g=R^R<<1^R<<2^R<<3^R<<4;g=g>>>8^g&255^99,L[y]=g,d[g]=y;var m=E[y],s=E[m],u=E[s],_=E[g]*257^g*16843008;C[y]=_<<24|_>>>8,p[y]=_<<16|_>>>16,h[y]=_<<8|_>>>24,f[y]=_,_=u*16843009^s*65537^m*257^y*16843008,r[g]=_<<24|_>>>8,o[g]=_<<16|_>>>16,l[g]=_<<8|_>>>24,x[g]=_,y?(y=m^E[E[E[u^m]]],R^=E[E[R]]):y=R=1}},U.expandKey=function(L){for(var d=this.uint8ArrayToUint32Array_(L),v=!0,C=0;C<d.length&&v;)v=d[C]===this.key[C],C++;if(v)return;this.key=d;var p=this.keySize=d.length;if(p!==4&&p!==6&&p!==8)throw new Error("Invalid aes key size="+p);var h=this.ksRows=(p+6+1)*4,f,n,r=this.keySchedule=new Uint32Array(h),o=this.invKeySchedule=new Uint32Array(h),l=this.sBox,x=this.rcon,E=this.invSubMix,y=E[0],R=E[1],O=E[2],g=E[3],m,s;for(f=0;f<h;f++){if(f<p){m=r[f]=d[f];continue}s=m,f%p===0?(s=s<<8|s>>>24,s=l[s>>>24]<<24|l[s>>>16&255]<<16|l[s>>>8&255]<<8|l[s&255],s^=x[f/p|0]<<24):p>6&&f%p===4&&(s=l[s>>>24]<<24|l[s>>>16&255]<<16|l[s>>>8&255]<<8|l[s&255]),r[f]=m=(r[f-p]^s)>>>0}for(n=0;n<h;n++)f=h-n,n&3?s=r[f]:s=r[f-4],n<4||f<=4?o[n]=s:o[n]=y[l[s>>>24]]^R[l[s>>>16&255]]^O[l[s>>>8&255]]^g[l[s&255]],o[n]=o[n]>>>0},U.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},U.decrypt=function(L,d,v){for(var C=this.keySize+6,p=this.invKeySchedule,h=this.invSBox,f=this.invSubMix,n=f[0],r=f[1],o=f[2],l=f[3],x=this.uint8ArrayToUint32Array_(v),E=x[0],y=x[1],R=x[2],O=x[3],g=new Int32Array(L),m=new Int32Array(g.length),s,u,_,T,w,P,j,K,Z,G,B,$,ne,ae,fe=this.networkToHostOrderSwap;d<g.length;){for(Z=fe(g[d]),G=fe(g[d+1]),B=fe(g[d+2]),$=fe(g[d+3]),w=Z^p[0],P=$^p[1],j=B^p[2],K=G^p[3],ne=4,ae=1;ae<C;ae++)s=n[w>>>24]^r[P>>16&255]^o[j>>8&255]^l[K&255]^p[ne],u=n[P>>>24]^r[j>>16&255]^o[K>>8&255]^l[w&255]^p[ne+1],_=n[j>>>24]^r[K>>16&255]^o[w>>8&255]^l[P&255]^p[ne+2],T=n[K>>>24]^r[w>>16&255]^o[P>>8&255]^l[j&255]^p[ne+3],w=s,P=u,j=_,K=T,ne=ne+4;s=h[w>>>24]<<24^h[P>>16&255]<<16^h[j>>8&255]<<8^h[K&255]^p[ne],u=h[P>>>24]<<24^h[j>>16&255]<<16^h[K>>8&255]<<8^h[w&255]^p[ne+1],_=h[j>>>24]<<24^h[K>>16&255]<<16^h[w>>8&255]<<8^h[P&255]^p[ne+2],T=h[K>>>24]<<24^h[w>>16&255]<<16^h[P>>8&255]<<8^h[j&255]^p[ne+3],m[d]=fe(s^E),m[d+1]=fe(T^y),m[d+2]=fe(_^R),m[d+3]=fe(u^O),E=Z,y=G,R=B,O=$,d=d+4}return m.buffer},F}()},"./src/crypt/decrypter.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return d});var W=M("./src/crypt/aes-crypto.ts"),N=M("./src/crypt/fast-aes-key.ts"),A=M("./src/crypt/aes-decryptor.ts"),F=M("./src/utils/logger.ts"),U=M("./src/utils/mp4-tools.ts"),S=M("./src/utils/typed-array.ts"),L=16,d=function(){function v(p,h,f){var n=f===void 0?{}:f,r=n.removePKCS7Padding,o=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=p,this.config=h,this.removePKCS7Padding=o,o)try{var l=self.crypto;l&&(this.subtle=l.subtle||l.webkitSubtle)}catch(x){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var C=v.prototype;return C.destroy=function(){this.observer=null},C.isSync=function(){return this.config.enableSoftwareAES},C.flush=function(){var h=this.currentResult;if(!h){this.reset();return}var f=new Uint8Array(h);return this.reset(),this.removePKCS7Padding?Object(A.removePadding)(f):f},C.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},C.decrypt=function(h,f,n,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(h),f,n);var o=this.flush();o&&r(o.buffer)}else this.webCryptoDecrypt(new Uint8Array(h),f,n).then(r)},C.softwareDecrypt=function(h,f,n){var r=this.currentIV,o=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(h=Object(U.appendUint8Array)(l,h),this.remainderData=null);var x=this.getValidChunk(h);if(!x.length)return null;r&&(n=r);var E=this.softwareDecrypter;E||(E=this.softwareDecrypter=new A.default),E.expandKey(f);var y=o;return this.currentResult=E.decrypt(x.buffer,0,n),this.currentIV=Object(S.sliceUint8)(x,-16).buffer,y||null},C.webCryptoDecrypt=function(h,f,n){var r=this,o=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new N.default(o,f)),this.fastAesKey.expandKey().then(function(l){if(!o)return Promise.reject(new Error("web crypto not initialized"));var x=new W.default(o,n);return x.decrypt(h.buffer,l)}).catch(function(l){return r.onWebCryptoError(l,h,f,n)})},C.onWebCryptoError=function(h,f,n,r){return F.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",h),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,n,r)},C.getValidChunk=function(h){var f=h,n=h.length-h.length%L;return n!==h.length&&(f=Object(S.sliceUint8)(h,0,n),this.remainderData=Object(S.sliceUint8)(h,n)),f},C.logOnce=function(h){if(!this.logEnabled)return;F.logger.log("[decrypter.ts]: "+h),this.logEnabled=!1},v}()},"./src/crypt/fast-aes-key.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return W});var W=function(){function N(F,U){this.subtle=void 0,this.key=void 0,this.subtle=F,this.key=U}var A=N.prototype;return A.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},N}()},"./src/demux/aacdemuxer.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/demux/base-audio-demuxer.ts"),N=M("./src/demux/adts.ts"),A=M("./src/utils/logger.ts"),F=M("./src/demux/id3.ts");function U(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,S(d,v)}function S(d,v){return S=Object.setPrototypeOf||function(p,h){return p.__proto__=h,p},S(d,v)}var L=function(d){U(v,d);function v(p,h){var f;return f=d.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=p,f.config=h,f}var C=v.prototype;return C.resetInitSegment=function(h,f,n){d.prototype.resetInitSegment.call(this,h,f,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:h,duration:n,inputTimeScale:9e4,dropped:0}},v.probe=function(h){if(!h)return!1;for(var f=F.getID3Data(h,0)||[],n=f.length,r=h.length;n<r;n++)if(N.probe(h,n))return A.logger.log("ADTS sync word found !"),!0;return!1},C.canParse=function(h,f){return N.canParse(h,f)},C.appendFrame=function(h,f,n){N.initTrackConfig(h,this.observer,f,n,h.manifestCodec);var r=N.appendFrame(h,f,n,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},v}(W.default);L.minProbeByteLength=9,H.default=L},"./src/demux/adts.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"getAudioConfig",function(){return F}),M.d(H,"isHeaderPattern",function(){return U}),M.d(H,"getHeaderLength",function(){return S}),M.d(H,"getFullFrameLength",function(){return L}),M.d(H,"canGetFrameLength",function(){return d}),M.d(H,"isHeader",function(){return v}),M.d(H,"canParse",function(){return C}),M.d(H,"probe",function(){return p}),M.d(H,"initTrackConfig",function(){return h}),M.d(H,"getFrameDuration",function(){return f}),M.d(H,"parseFrameHeader",function(){return n}),M.d(H,"appendFrame",function(){return r});var W=M("./src/utils/logger.ts"),N=M("./src/errors.ts"),A=M("./src/events.ts");function F(o,l,x,E){var y,R,O,g,m=navigator.userAgent.toLowerCase(),s=E,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];y=((l[x+2]&192)>>>6)+1;var _=(l[x+2]&60)>>>2;if(_>u.length-1){o.trigger(A.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return O=(l[x+2]&1)<<2,O|=(l[x+3]&192)>>>6,W.logger.log("manifest codec:"+E+", ADTS type:"+y+", samplingIndex:"+_),/firefox/i.test(m)?_>=6?(y=5,g=new Array(4),R=_-3):(y=2,g=new Array(2),R=_):m.indexOf("android")!==-1?(y=2,g=new Array(2),R=_):(y=5,g=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&_>=6?R=_-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(_>=6&&O===1||/vivaldi/i.test(m))||!E&&O===1)&&(y=2,g=new Array(2)),R=_)),g[0]=y<<3,g[0]|=(_&14)>>1,g[1]|=(_&1)<<7,g[1]|=O<<3,y===5&&(g[1]|=(R&14)>>1,g[2]=(R&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:u[_],channelCount:O,codec:"mp4a.40."+y,manifestCodec:s}}function U(o,l){return o[l]===255&&(o[l+1]&246)===240}function S(o,l){return o[l+1]&1?7:9}function L(o,l){return(o[l+3]&3)<<11|o[l+4]<<3|(o[l+5]&224)>>>5}function d(o,l){return l+5<o.length}function v(o,l){return l+1<o.length&&U(o,l)}function C(o,l){return d(o,l)&&U(o,l)&&L(o,l)<=o.length-l}function p(o,l){if(v(o,l)){var x=S(o,l);if(l+x>=o.length)return!1;var E=L(o,l);if(E<=x)return!1;var y=l+E;return y===o.length||v(o,y)}return!1}function h(o,l,x,E,y){if(!o.samplerate){var R=F(l,x,E,y);if(!R)return;o.config=R.config,o.samplerate=R.samplerate,o.channelCount=R.channelCount,o.codec=R.codec,o.manifestCodec=R.manifestCodec,W.logger.log("parsed codec:"+o.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function f(o){return 1024*9e4/o}function n(o,l,x,E,y){var R=S(o,l),O=L(o,l);if(O-=R,O>0){var g=x+E*y;return{headerLength:R,frameLength:O,stamp:g}}}function r(o,l,x,E,y){var R=f(o.samplerate),O=n(l,x,E,y,R);if(O){var g=O.frameLength,m=O.headerLength,s=O.stamp,u=m+g,_=Math.max(0,x+u-l.length),T;_?(T=new Uint8Array(u-m),T.set(l.subarray(x+m,l.length),0)):T=l.subarray(x+m,x+u);var w={unit:T,pts:s};return _||o.samples.push(w),{sample:w,length:u,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"initPTSFn",function(){return L});var W=M("./src/polyfills/number.ts"),N=M("./src/demux/id3.ts"),A=M("./src/demux/dummy-demuxed-track.ts"),F=M("./src/utils/mp4-tools.ts"),U=M("./src/utils/typed-array.ts"),S=function(){function d(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var v=d.prototype;return v.resetInitSegment=function(p,h,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},v.resetTimeStamp=function(){},v.resetContiguity=function(){},v.canParse=function(p,h){return!1},v.appendFrame=function(p,h,f){},v.demux=function(p,h){this.cachedData&&(p=Object(F.appendUint8Array)(this.cachedData,p),this.cachedData=null);var f=N.getID3Data(p,0),n=f?f.length:0,r,o,l=this._audioTrack,x=this._id3Track,E=f?N.getTimeStamp(f):void 0,y=p.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(E,h)),f&&f.length>0&&x.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),o=this.initPTS;n<y;){if(this.canParse(p,n)){var R=this.appendFrame(l,p,n);R?(this.frameIndex++,o=R.sample.pts,n+=R.length,r=n):n=y}else N.canParse(p,n)?(f=N.getID3Data(p,n),x.samples.push({pts:o,dts:o,data:f}),n+=f.length,r=n):n++;if(n===y&&r!==y){var O=Object(U.sliceUint8)(p,r);this.cachedData?this.cachedData=Object(F.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:l,avcTrack:Object(A.dummyTrack)(),id3Track:x,textTrack:Object(A.dummyTrack)()}},v.demuxSampleAes=function(p,h,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},v.flush=function(p){var h=this.cachedData;return h&&(this.cachedData=null,this.demux(h,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(A.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(A.dummyTrack)()}},v.destroy=function(){},d}(),L=function(v,C){return Object(W.isFiniteNumber)(v)?v*90:C*9e4};H.default=S},"./src/demux/chunk-cache.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return W});var W=function(){function A(){this.chunks=[],this.dataLength=0}var F=A.prototype;return F.push=function(S){this.chunks.push(S),this.dataLength+=S.length},F.flush=function(){var S=this.chunks,L=this.dataLength,d;if(S.length)S.length===1?d=S[0]:d=N(S,L);else return new Uint8Array(0);return this.reset(),d},F.reset=function(){this.chunks.length=0,this.dataLength=0},A}();function N(A,F){for(var U=new Uint8Array(F),S=0,L=0;L<A.length;L++){var d=A[L];U.set(d,S),S+=d.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"dummyTrack",function(){return W});function W(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/utils/logger.ts"),N=function(){function A(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 F=A.prototype;return F.loadWord=function(){var S=this.data,L=this.bytesAvailable,d=S.byteLength-L,v=new Uint8Array(4),C=Math.min(4,L);if(C===0)throw new Error("no bytes available");v.set(S.subarray(d,d+C)),this.word=new DataView(v.buffer).getUint32(0),this.bitsAvailable=C*8,this.bytesAvailable-=C},F.skipBits=function(S){var L;this.bitsAvailable>S?(this.word<<=S,this.bitsAvailable-=S):(S-=this.bitsAvailable,L=S>>3,S-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=S,this.bitsAvailable-=S)},F.readBits=function(S){var L=Math.min(this.bitsAvailable,S),d=this.word>>>32-L;return S>32&&W.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=S-L,L>0&&this.bitsAvailable?d<<L|this.readBits(L):d},F.skipLZ=function(){var S;for(S=0;S<this.bitsAvailable;++S)if((this.word&2147483648>>>S)!==0)return this.word<<=S,this.bitsAvailable-=S,S;return this.loadWord(),S+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var S=this.skipLZ();return this.readBits(S+1)-1},F.readEG=function(){var S=this.readUEG();return 1&S?1+S>>>1:-1*(S>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(S){for(var L=8,d=8,v,C=0;C<S;C++)d!==0&&(v=this.readEG(),d=(L+v+256)%256),L=d===0?L:d},F.readSPS=function(){var S=0,L=0,d=0,v=0,C,p,h,f=this.readUByte.bind(this),n=this.readBits.bind(this),r=this.readUEG.bind(this),o=this.readBoolean.bind(this),l=this.skipBits.bind(this),x=this.skipEG.bind(this),E=this.skipUEG.bind(this),y=this.skipScalingList.bind(this);f();var R=f();if(n(5),l(3),f(),E(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=r();if(O===3&&l(1),E(),E(),l(1),o())for(p=O!==3?8:12,h=0;h<p;h++)o()&&(h<6?y(16):y(64))}E();var g=r();if(g===0)r();else if(g===1)for(l(1),x(),x(),C=r(),h=0;h<C;h++)x();E(),l(1);var m=r(),s=r(),u=n(1);u===0&&l(1),l(1),o()&&(S=r(),L=r(),d=r(),v=r());var _=[1,1];if(o()&&o()){var T=f();switch(T){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((m+1)*16-S*2-L*2),height:(2-u)*(s+1)*16-(u?2:4)*(d+v),pixelRatio:_}},F.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},A}();H.default=N},"./src/demux/id3.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"isHeader",function(){return W}),M.d(H,"isFooter",function(){return N}),M.d(H,"getID3Data",function(){return A}),M.d(H,"canParse",function(){return U}),M.d(H,"getTimeStamp",function(){return S}),M.d(H,"isTimeStampFrame",function(){return L}),M.d(H,"getID3Frames",function(){return v}),M.d(H,"decodeFrame",function(){return C}),M.d(H,"utf8ArrayToStr",function(){return r}),M.d(H,"testables",function(){return o});var W=function(y,R){return R+10<=y.length&&(y[R]===73&&y[R+1]===68&&y[R+2]===51&&(y[R+3]<255&&y[R+4]<255&&(y[R+6]<128&&y[R+7]<128&&y[R+8]<128&&y[R+9]<128)))},N=function(y,R){return R+10<=y.length&&(y[R]===51&&y[R+1]===68&&y[R+2]===73&&(y[R+3]<255&&y[R+4]<255&&(y[R+6]<128&&y[R+7]<128&&y[R+8]<128&&y[R+9]<128)))},A=function(y,R){for(var O=R,g=0;W(y,R);){g+=10;var m=F(y,R+6);g+=m,N(y,R+10)&&(g+=10),R+=g}return g>0?y.subarray(O,O+g):void 0},F=function(y,R){var O=0;return O=(y[R]&127)<<21,O|=(y[R+1]&127)<<14,O|=(y[R+2]&127)<<7,O|=y[R+3]&127,O},U=function(y,R){return W(y,R)&&F(y,R+6)+10<=y.length-R},S=function(y){for(var R=v(y),O=0;O<R.length;O++){var g=R[O];if(L(g))return n(g)}return},L=function(y){return y&&y.key==="PRIV"&&y.info==="com.apple.streaming.transportStreamTimestamp"},d=function(y){var R=String.fromCharCode(y[0],y[1],y[2],y[3]),O=F(y,4),g=10;return{type:R,size:O,data:y.subarray(g,g+O)}},v=function(y){for(var R=0,O=[];W(y,R);){var g=F(y,R+6);R+=10;for(var m=R+g;R+8<m;){var s=d(y.subarray(R)),u=C(s);u&&O.push(u),R+=s.size+10}N(y,R)&&(R+=10)}return O},C=function(y){return y.type==="PRIV"?p(y):y.type[0]==="W"?f(y):h(y)},p=function(y){if(y.size<2)return;var R=r(y.data,!0),O=new Uint8Array(y.data.subarray(R.length+1));return{key:y.type,info:R,data:O.buffer}},h=function(y){if(y.size<2)return;if(y.type==="TXXX"){var R=1,O=r(y.data.subarray(R),!0);R+=O.length+1;var g=r(y.data.subarray(R));return{key:y.type,info:O,data:g}}var m=r(y.data.subarray(1));return{key:y.type,data:m}},f=function(y){if(y.type==="WXXX"){if(y.size<2)return;var R=1,O=r(y.data.subarray(R),!0);R+=O.length+1;var g=r(y.data.subarray(R));return{key:y.type,info:O,data:g}}var m=r(y.data);return{key:y.type,data:m}},n=function(y){if(y.data.byteLength===8){var R=new Uint8Array(y.data),O=R[3]&1,g=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return g/=45,O&&(g+=4772185884e-2),Math.round(g)}return},r=function(y,R){R===void 0&&(R=!1);var O=x();if(O){var g=O.decode(y);if(R){var m=g.indexOf("\0");return m!==-1?g.substring(0,m):g}return g.replace(/\0/g,"")}for(var s=y.length,u,_,T,w="",P=0;P<s;){if(u=y[P++],u===0&&R)return w;if(u===0||u===3)continue;switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(u);break;case 12:case 13:_=y[P++],w+=String.fromCharCode((u&31)<<6|_&63);break;case 14:_=y[P++],T=y[P++],w+=String.fromCharCode((u&15)<<12|(_&63)<<6|(T&63)<<0);break;default:}}return w},o={decodeTextFrame:h},l;function x(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/demux/base-audio-demuxer.ts"),N=M("./src/demux/id3.ts"),A=M("./src/utils/logger.ts"),F=M("./src/demux/mpegaudio.ts");function U(d,v){d.prototype=Object.create(v.prototype),d.prototype.constructor=d,S(d,v)}function S(d,v){return S=Object.setPrototypeOf||function(p,h){return p.__proto__=h,p},S(d,v)}var L=function(d){U(v,d);function v(){return d.apply(this,arguments)||this}var C=v.prototype;return C.resetInitSegment=function(h,f,n){d.prototype.resetInitSegment.call(this,h,f,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:h,duration:n,inputTimeScale:9e4,dropped:0}},v.probe=function(h){if(!h)return!1;for(var f=N.getID3Data(h,0)||[],n=f.length,r=h.length;n<r;n++)if(F.probe(h,n))return A.logger.log("MPEG Audio sync word found !"),!0;return!1},C.canParse=function(h,f){return F.canParse(h,f)},C.appendFrame=function(h,f,n){return this.initPTS===null?void 0:F.appendFrame(h,f,n,this.initPTS,this.frameIndex)},v}(W.default);L.minProbeByteLength=4,H.default=L},"./src/demux/mp4demuxer.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/utils/mp4-tools.ts"),N=M("./src/demux/dummy-demuxed-track.ts"),A=function(){function F(S,L){this.remainderData=null,this.config=void 0,this.config=L}var U=F.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},F.probe=function(L){return Object(W.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},U.demux=function(L){var d=L,v=Object(N.dummyTrack)();if(this.config.progressive){this.remainderData&&(d=Object(W.appendUint8Array)(this.remainderData,L));var C=Object(W.segmentValidRange)(d);this.remainderData=C.remainder,v.samples=C.valid||new Uint8Array}else v.samples=d;return{audioTrack:Object(N.dummyTrack)(),avcTrack:v,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},U.flush=function(){var L=Object(N.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(N.dummyTrack)(),avcTrack:L,id3Track:Object(N.dummyTrack)(),textTrack:Object(N.dummyTrack)()}},U.demuxSampleAes=function(L,d,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},F}();A.minProbeByteLength=1024,H.default=A},"./src/demux/mpegaudio.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"appendFrame",function(){return S}),M.d(H,"parseHeader",function(){return L}),M.d(H,"isHeaderPattern",function(){return d}),M.d(H,"isHeader",function(){return v}),M.d(H,"canParse",function(){return C}),M.d(H,"probe",function(){return p});var W=null,N=[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],A=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function S(h,f,n,r,o){if(n+24>f.length)return;var l=L(f,n);if(l&&n+l.frameLength<=f.length){var x=l.samplesPerFrame*9e4/l.sampleRate,E=r+o*x,y={unit:f.subarray(n,n+l.frameLength),pts:E,dts:E};return h.config=[],h.channelCount=l.channelCount,h.samplerate=l.sampleRate,h.samples.push(y),{sample:y,length:l.frameLength,missing:0}}}function L(h,f){var n=h[f+1]>>3&3,r=h[f+1]>>1&3,o=h[f+2]>>4&15,l=h[f+2]>>2&3;if(n!==1&&o!==0&&o!==15&&l!==3){var x=h[f+2]>>1&1,E=h[f+3]>>6,y=n===3?3-r:r===3?3:4,R=N[y*14+o-1]*1e3,O=n===3?0:n===2?1:2,g=A[O*3+l],m=E===3?1:2,s=F[n][r],u=U[r],_=s*8*u,T=Math.floor(s*R/g+x)*u;if(W===null){var w=navigator.userAgent||"",P=w.match(/Chrome\/(\d+)/i);W=P?parseInt(P[1]):0}var j=!!W&&W<=87;return j&&r===2&&R>=224e3&&E===0&&(h[f+3]=h[f+3]|128),{sampleRate:g,channelCount:m,frameLength:T,samplesPerFrame:_}}}function d(h,f){return h[f]===255&&(h[f+1]&224)===224&&(h[f+1]&6)!==0}function v(h,f){return f+1<h.length&&d(h,f)}function C(h,f){var n=4;return d(h,f)&&n<=h.length-f}function p(h,f){if(f+1<h.length&&d(h,f)){var n=4,r=L(h,f),o=n;r!=null&&r.frameLength&&(o=r.frameLength);var l=f+o;return l===h.length||v(h,l)}return!1}},"./src/demux/sample-aes.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/crypt/decrypter.ts"),N=M("./src/demux/tsdemuxer.ts"),A=function(){function F(S,L,d){this.keyData=void 0,this.decrypter=void 0,this.keyData=d,this.decrypter=new W.default(S,L,{removePKCS7Padding:!1})}var U=F.prototype;return U.decryptBuffer=function(L,d){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,d)},U.decryptAacSample=function(L,d,v,C){var p=L[d].unit,h=p.subarray(16,p.length-p.length%16),f=h.buffer.slice(h.byteOffset,h.byteOffset+h.length),n=this;this.decryptBuffer(f,function(r){var o=new Uint8Array(r);p.set(o,16),C||n.decryptAacSamples(L,d+1,v)})},U.decryptAacSamples=function(L,d,v){for(;;d++){if(d>=L.length){v();return}if(L[d].unit.length<32)continue;var C=this.decrypter.isSync();if(this.decryptAacSample(L,d,v,C),!C)return}},U.getAvcEncryptedData=function(L){for(var d=Math.floor((L.length-48)/160)*16+16,v=new Int8Array(d),C=0,p=32;p<=L.length-16;p+=160,C+=16)v.set(L.subarray(p,p+16),C);return v},U.getAvcDecryptedUnit=function(L,d){for(var v=new Uint8Array(d),C=0,p=32;p<=L.length-16;p+=160,C+=16)L.set(v.subarray(C,C+16),p);return L},U.decryptAvcSample=function(L,d,v,C,p,h){var f=Object(N.discardEPB)(p.data),n=this.getAvcEncryptedData(f),r=this;this.decryptBuffer(n.buffer,function(o){p.data=r.getAvcDecryptedUnit(f,o),h||r.decryptAvcSamples(L,d,v+1,C)})},U.decryptAvcSamples=function(L,d,v,C){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;d++,v=0){if(d>=L.length){C();return}for(var p=L[d].units;!(v>=p.length);v++){var h=p[v];if(h.data.length<=48||h.type!==1&&h.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(L,d,v,C,h,f),!f)return}}},F}();H.default=A},"./src/demux/transmuxer-interface.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return p});var W=M("./node_modules/webworkify-webpack/index.js"),N=M.n(W),A=M("./src/events.ts"),F=M("./src/demux/transmuxer.ts"),U=M("./src/utils/logger.ts"),S=M("./src/errors.ts"),L=M("./src/utils/mediasource-helper.ts"),d=M("./node_modules/eventemitter3/index.js"),v=M.n(d),C=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function h(n,r,o,l){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=n,this.id=r,this.onTransmuxComplete=o,this.onFlush=l;var E=n.config,y=function(s,u){u=u||{},u.frag=x.frag,u.id=x.id,n.trigger(s,u)};this.observer=new d.EventEmitter,this.observer.on(A.Events.FRAG_DECRYPTED,y),this.observer.on(A.Events.ERROR,y);var R={mp4:C.isTypeSupported("video/mp4"),mpeg:C.isTypeSupported("audio/mpeg"),mp3:C.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var g;try{g=this.worker=W("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(m){n.trigger(A.Events.ERROR,{type:S.ErrorTypes.OTHER_ERROR,details:S.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(m.message+" ("+m.filename+":"+m.lineno+")")})},g.postMessage({cmd:"init",typeSupported:R,vendor:O,id:r,config:JSON.stringify(E)})}catch(m){U.logger.warn("Error in worker:",m),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new F.default(this.observer,R,E,O,r),this.worker=null}}else this.transmuxer=new F.default(this.observer,R,E,O,r)}var f=h.prototype;return f.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},f.push=function(r,o,l,x,E,y,R,O,g,m){var s=this;g.transmuxing.start=self.performance.now();var u=this.transmuxer,_=this.worker,T=y?y.start:E.start,w=E.decryptdata,P=this.frag,j=!(P&&E.cc===P.cc),K=!(P&&g.level===P.level),Z=P?g.sn-P.sn:-1,G=this.part?g.part-this.part.index:1,B=!K&&(Z===1||Z===0&&G===1),$=self.performance.now();(K||Z||E.stats.parsing.start===0)&&(E.stats.parsing.start=$),y&&(G||!B)&&(y.stats.parsing.start=$);var ne=new F.TransmuxState(j,B,O,K,T);if(!B||j){U.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+`
|
|
discontinuity: `+j+`
|
|
trackSwitch: `+K+`
|
|
contiguous: `+B+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+T);var ae=new F.TransmuxConfig(l,x,o,R,m);this.configureTransmuxer(ae)}if(this.frag=E,this.part=y,_)_.postMessage({cmd:"demux",data:r,decryptdata:w,chunkMeta:g,state:ne},r instanceof ArrayBuffer?[r]:[]);else if(u){var fe=u.push(r,w,g,ne);Object(F.isPromise)(fe)?fe.then(function(_e){s.handleTransmuxComplete(_e)}):this.handleTransmuxComplete(fe)}},f.flush=function(r){var o=this;r.transmuxing.start=self.performance.now();var l=this.transmuxer,x=this.worker;if(x)x.postMessage({cmd:"flush",chunkMeta:r});else if(l){var E=l.flush(r);Object(F.isPromise)(E)?E.then(function(y){o.handleFlushResult(y,r)}):this.handleFlushResult(E,r)}},f.handleFlushResult=function(r,o){var l=this;r.forEach(function(x){l.handleTransmuxComplete(x)}),this.onFlush(o)},f.onWorkerMessage=function(r){var o=r.data,l=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,l.trigger(o.event,o.data);break}}},f.configureTransmuxer=function(r){var o=this.worker,l=this.transmuxer;o?o.postMessage({cmd:"configure",config:r}):l&&l.configure(r)},f.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},h}()},"./src/demux/transmuxer-worker.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return S});var W=M("./src/demux/transmuxer.ts"),N=M("./src/events.ts"),A=M("./src/utils/logger.ts"),F=M("./node_modules/eventemitter3/index.js"),U=M.n(F);function S(p){var h=new F.EventEmitter,f=function(r,o){p.postMessage({event:r,data:o})};h.on(N.Events.FRAG_DECRYPTED,f),h.on(N.Events.ERROR,f),p.addEventListener("message",function(n){var r=n.data;switch(r.cmd){case"init":{var o=JSON.parse(r.config);p.transmuxer=new W.default(h,r.typeSupported,o,r.vendor,r.id),Object(A.enableLogs)(o.debug),f("init",null);break}case"configure":{p.transmuxer.configure(r.config);break}case"demux":{var l=p.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(W.isPromise)(l)?l.then(function(y){L(p,y)}):L(p,l);break}case"flush":{var x=r.chunkMeta,E=p.transmuxer.flush(x);Object(W.isPromise)(E)?E.then(function(y){v(p,y,x)}):v(p,E,x);break}default:break}})}function L(p,h){if(C(h.remuxResult))return;var f=[],n=h.remuxResult,r=n.audio,o=n.video;r&&d(f,r),o&&d(f,o),p.postMessage({event:"transmuxComplete",data:h},f)}function d(p,h){h.data1&&p.push(h.data1.buffer),h.data2&&p.push(h.data2.buffer)}function v(p,h,f){h.forEach(function(n){L(p,n)}),p.postMessage({event:"flush",data:f})}function C(p){return!p.audio&&!p.video&&!p.text&&!p.id3&&!p.initSegment}},"./src/demux/transmuxer.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return o}),M.d(H,"isPromise",function(){return E}),M.d(H,"TransmuxConfig",function(){return y}),M.d(H,"TransmuxState",function(){return R});var W=M("./src/events.ts"),N=M("./src/errors.ts"),A=M("./src/crypt/decrypter.ts"),F=M("./src/demux/aacdemuxer.ts"),U=M("./src/demux/mp4demuxer.ts"),S=M("./src/demux/tsdemuxer.ts"),L=M("./src/demux/mp3demuxer.ts"),d=M("./src/remux/mp4-remuxer.ts"),v=M("./src/remux/passthrough-remuxer.ts"),C=M("./src/demux/chunk-cache.ts"),p=M("./src/utils/mp4-tools.ts"),h=M("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){h.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var n=[{demux:S.default,remux:d.default},{demux:U.default,remux:v.default},{demux:F.default,remux:d.default},{demux:L.default,remux:d.default}],r=1024;n.forEach(function(O){var g=O.demux;r=Math.max(r,g.minProbeByteLength)});var o=function(){function O(m,s,u,_,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 C.default,this.observer=m,this.typeSupported=s,this.config=u,this.vendor=_,this.id=T}var g=O.prototype;return g.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},g.push=function(s,u,_,T){var w=this,P=_.transmuxing;P.executeStart=f();var j=new Uint8Array(s),K=this.cache,Z=this.config,G=this.currentTransmuxState,B=this.transmuxConfig;T&&(this.currentTransmuxState=T);var $=l(j,u);if($&&$.method==="AES-128"){var ne=this.getDecrypter();if(Z.enableSoftwareAES){var ae=ne.softwareDecrypt(j,$.key.buffer,$.iv.buffer);if(!ae)return P.executeEnd=f(),x(_);j=new Uint8Array(ae)}else return this.decryptionPromise=ne.webCryptoDecrypt(j,$.key.buffer,$.iv.buffer).then(function(Oe){var ze=w.push(Oe,null,_);return w.decryptionPromise=null,ze}),this.decryptionPromise}var fe=T||G,_e=fe.contiguous,Se=fe.discontinuity,we=fe.trackSwitch,Me=fe.accurateTimeOffset,Le=fe.timeOffset,ge=B.audioCodec,ue=B.videoCodec,ke=B.defaultInitPts,lt=B.duration,ot=B.initSegmentData;if((Se||we)&&this.resetInitSegment(ot,ge,ue,lt),Se&&this.resetInitialTimestamp(ke),_e||this.resetContiguity(),this.needsProbing(j,Se,we)){if(K.dataLength){var st=K.flush();j=Object(p.appendUint8Array)(st,j)}this.configureTransmuxer(j,B)}var ce=this.transmux(j,$,Le,Me,_),pe=this.currentTransmuxState;return pe.contiguous=!0,pe.discontinuity=!1,pe.trackSwitch=!1,P.executeEnd=f(),ce},g.flush=function(s){var u=this,_=s.transmuxing;_.executeStart=f();var T=this.decrypter,w=this.cache,P=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return u.flush(s)});var K=[],Z=P.timeOffset;if(T){var G=T.flush();G&&K.push(this.push(G,null,s))}var B=w.dataLength;w.reset();var $=this.demuxer,ne=this.remuxer;if(!$||!ne)return B>=r&&this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=f(),[x(s)];var ae=$.flush(Z);return E(ae)?ae.then(function(fe){return u.flushRemux(K,fe,s),K}):(this.flushRemux(K,ae,s),K)},g.flushRemux=function(s,u,_){var T=u.audioTrack,w=u.avcTrack,P=u.id3Track,j=u.textTrack,K=this.currentTransmuxState,Z=K.accurateTimeOffset,G=K.timeOffset;h.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var B=this.remuxer.remux(T,w,P,j,G,Z,!0,this.id);s.push({remuxResult:B,chunkMeta:_}),_.transmuxing.executeEnd=f()},g.resetInitialTimestamp=function(s){var u=this.demuxer,_=this.remuxer;if(!u||!_)return;u.resetTimeStamp(s),_.resetTimeStamp(s)},g.resetContiguity=function(){var s=this.demuxer,u=this.remuxer;if(!s||!u)return;s.resetContiguity(),u.resetNextTimestamp()},g.resetInitSegment=function(s,u,_,T){var w=this.demuxer,P=this.remuxer;if(!w||!P)return;w.resetInitSegment(u,_,T),P.resetInitSegment(s,u,_)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(s,u,_,T,w){var P;return u&&u.method==="SAMPLE-AES"?P=this.transmuxSampleAes(s,u,_,T,w):P=this.transmuxUnencrypted(s,_,T,w),P},g.transmuxUnencrypted=function(s,u,_,T){var w=this.demuxer.demux(s,u,!1,!this.config.progressive),P=w.audioTrack,j=w.avcTrack,K=w.id3Track,Z=w.textTrack,G=this.remuxer.remux(P,j,K,Z,u,_,!1,this.id);return{remuxResult:G,chunkMeta:T}},g.transmuxSampleAes=function(s,u,_,T,w){var P=this;return this.demuxer.demuxSampleAes(s,u,_).then(function(j){var K=P.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,_,T,!1,P.id);return{remuxResult:K,chunkMeta:w}})},g.configureTransmuxer=function(s,u){for(var _=this.config,T=this.observer,w=this.typeSupported,P=this.vendor,j=u.audioCodec,K=u.defaultInitPts,Z=u.duration,G=u.initSegmentData,B=u.videoCodec,$,ne=0,ae=n.length;ne<ae;ne++)if(n[ne].demux.probe(s)){$=n[ne];break}$||(h.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),$={demux:U.default,remux:v.default});var fe=this.demuxer,_e=this.remuxer,Se=$.remux,we=$.demux;(!_e||!(_e instanceof Se))&&(this.remuxer=new Se(T,_,w,P)),(!fe||!(fe instanceof we))&&(this.demuxer=new we(T,_,w),this.probe=we.probe),this.resetInitSegment(G,j,B,Z),this.resetInitialTimestamp(K)},g.needsProbing=function(s,u,_){return!this.demuxer||!this.remuxer||u||_},g.getDecrypter=function(){var s=this.decrypter;return s||(s=this.decrypter=new A.default(this.observer,this.config)),s},O}();function l(O,g){var m=null;return O.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(m=g),m}var x=function(g){return{remuxResult:{},chunkMeta:g}};function E(O){return"then"in O&&O.then instanceof Function}var y=function(g,m,s,u,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=m,this.initSegmentData=s,this.duration=u,this.defaultInitPts=_},R=function(g,m,s,u,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=m,this.accurateTimeOffset=s,this.trackSwitch=u,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"discardEPB",function(){return x});var W=M("./src/demux/adts.ts"),N=M("./src/demux/mpegaudio.ts"),A=M("./src/demux/exp-golomb.ts"),F=M("./src/demux/id3.ts"),U=M("./src/demux/sample-aes.ts"),S=M("./src/events.ts"),L=M("./src/utils/mp4-tools.ts"),d=M("./src/utils/logger.ts"),v=M("./src/errors.ts"),C={video:1,audio:2,id3:3,text:4},p=function(){function E(R,O,g){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=R,this.config=O,this.typeSupported=g}E.probe=function(O){var g=E.syncOffset(O);return g<0?!1:(g&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},E.syncOffset=function(O){for(var g=Math.min(1e3,O.length-3*188),m=0;m<g;){if(O[m]===71&&O[m+188]===71&&O[m+2*188]===71)return m;m++}return-1},E.createTrack=function(O,g){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:C[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?g:void 0}};var y=E.prototype;return y.resetInitSegment=function(O,g,m){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=E.createTrack("video",m),this._audioTrack=E.createTrack("audio",m),this._id3Track=E.createTrack("id3",m),this._txtTrack=E.createTrack("text",m),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=g,this._duration=m},y.resetTimeStamp=function(){},y.resetContiguity=function(){var O=this._audioTrack,g=this._avcTrack,m=this._id3Track;O&&(O.pesData=null),g&&(g.pesData=null),m&&(m.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},y.demux=function(O,g,m,s){m===void 0&&(m=!1),s===void 0&&(s=!1),m||(this.sampleAes=null);var u,_=this._avcTrack,T=this._audioTrack,w=this._id3Track,P=_.pid,j=_.pesData,K=T.pid,Z=w.pid,G=T.pesData,B=w.pesData,$=!1,ne=this.pmtParsed,ae=this._pmtId,fe=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),fe=O.length,this.remainderData=null),fe<188&&!s)return this.remainderData=O,{audioTrack:T,avcTrack:_,id3Track:w,textTrack:this._txtTrack};var _e=Math.max(0,E.syncOffset(O));fe-=(fe+_e)%188,fe<O.byteLength&&!s&&(this.remainderData=new Uint8Array(O.buffer,fe,O.buffer.byteLength-fe));for(var Se=_e;Se<fe;Se+=188)if(O[Se]===71){var we=!!(O[Se+1]&64),Me=((O[Se+1]&31)<<8)+O[Se+2],Le=(O[Se+3]&48)>>4,ge=void 0;if(Le>1){if(ge=Se+5+O[Se+4],ge===Se+188)continue}else ge=Se+4;switch(Me){case P:we&&(j&&(u=r(j))&&this.parseAVCPES(u,!1),j={data:[],size:0}),j&&(j.data.push(O.subarray(ge,Se+188)),j.size+=Se+188-ge);break;case K:we&&(G&&(u=r(G))&&(T.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),G={data:[],size:0}),G&&(G.data.push(O.subarray(ge,Se+188)),G.size+=Se+188-ge);break;case Z:we&&(B&&(u=r(B))&&this.parseID3PES(u),B={data:[],size:0}),B&&(B.data.push(O.subarray(ge,Se+188)),B.size+=Se+188-ge);break;case 0:we&&(ge+=O[ge]+1),ae=this._pmtId=f(O,ge);break;case ae:{we&&(ge+=O[ge]+1);var ue=n(O,ge,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,m);P=ue.avc,P>0&&(_.pid=P),K=ue.audio,K>0&&(T.pid=K,T.isAAC=ue.isAAC),Z=ue.id3,Z>0&&(w.pid=Z),$&&!ne&&(d.logger.log("reparse from beginning"),$=!1,Se=_e-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:$=!0;break}}else this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=j,T.pesData=G,w.pesData=B;var ke={audioTrack:T,avcTrack:_,id3Track:w,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(ke),ke},y.flush=function(){var O=this.remainderData;this.remainderData=null;var g;return O?g=this.demux(O,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},y.extractRemainingSamples=function(O){var g=O.audioTrack,m=O.avcTrack,s=O.id3Track,u=m.pesData,_=g.pesData,T=s.pesData,w;u&&(w=r(u))?(this.parseAVCPES(w,!0),m.pesData=null):m.pesData=u,_&&(w=r(_))?(g.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),g.pesData=null):(_!=null&&_.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=_),T&&(w=r(T))?(this.parseID3PES(w),s.pesData=null):s.pesData=T},y.demuxSampleAes=function(O,g,m){var s=this.demux(O,m,!0,!this.config.progressive),u=this.sampleAes=new U.default(this.observer,this.config,g);return this.decrypt(s,u)},y.decrypt=function(O,g){return new Promise(function(m){var s=O.audioTrack,u=O.avcTrack;s.samples&&s.isAAC?g.decryptAacSamples(s.samples,0,function(){u.samples?g.decryptAvcSamples(u.samples,0,0,function(){m(O)}):m(O)}):u.samples&&g.decryptAvcSamples(u.samples,0,0,function(){m(O)})})},y.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},y.parseAVCPES=function(O,g){var m=this,s=this._avcTrack,u=this.parseAVCNALu(O.data),_=!1,T=this.avcSample,w,P=!1;O.data=null,T&&u.length&&!s.audFound&&(o(T,s),T=this.avcSample=h(!1,O.pts,O.dts,"")),u.forEach(function(j){switch(j.type){case 1:{w=!0,T||(T=m.avcSample=h(!0,O.pts,O.dts,"")),_&&(T.debug+="NDR "),T.frame=!0;var K=j.data;if(P&&K.length>4){var Z=new A.default(K).readSliceType();(Z===2||Z===4||Z===7||Z===9)&&(T.key=!0)}break}case 5:w=!0,T||(T=m.avcSample=h(!0,O.pts,O.dts,"")),_&&(T.debug+="IDR "),T.key=!0,T.frame=!0;break;case 6:{w=!0,_&&T&&(T.debug+="SEI ");var G=new A.default(x(j.data));G.readUByte();for(var B=0,$=0,ne=!1,ae=0;!ne&&G.bytesAvailable>1;){B=0;do ae=G.readUByte(),B+=ae;while(ae===255);$=0;do ae=G.readUByte(),$+=ae;while(ae===255);if(B===4&&G.bytesAvailable!==0){ne=!0;var fe=G.readUByte();if(fe===181){var _e=G.readUShort();if(_e===49){var Se=G.readUInt();if(Se===1195456820){var we=G.readUByte();if(we===3){for(var Me=G.readUByte(),Le=G.readUByte(),ge=31&Me,ue=[Me,Le],ke=0;ke<ge;ke++)ue.push(G.readUByte()),ue.push(G.readUByte()),ue.push(G.readUByte());l(m._txtTrack.samples,{type:3,pts:O.pts,bytes:ue})}}}}}else if(B===5&&G.bytesAvailable!==0){if(ne=!0,$>16){for(var lt=[],ot=0;ot<16;ot++)lt.push(G.readUByte().toString(16)),(ot===3||ot===5||ot===7||ot===9)&<.push("-");for(var st=$-16,ce=new Uint8Array(st),pe=0;pe<st;pe++)ce[pe]=G.readUByte();l(m._txtTrack.samples,{pts:O.pts,payloadType:B,uuid:lt.join(""),userData:Object(F.utf8ArrayToStr)(ce),userDataBytes:ce})}}else if($<G.bytesAvailable)for(var Oe=0;Oe<$;Oe++)G.readUByte()}break}case 7:if(w=!0,P=!0,_&&T&&(T.debug+="SPS "),!s.sps){var ze=new A.default(j.data),qe=ze.readSPS();s.width=qe.width,s.height=qe.height,s.pixelRatio=qe.pixelRatio,s.sps=[j.data],s.duration=m._duration;for(var Je=j.data.subarray(1,4),rt="avc1.",tt=0;tt<3;tt++){var Tt=Je[tt].toString(16);Tt.length<2&&(Tt="0"+Tt),rt+=Tt}s.codec=rt}break;case 8:w=!0,_&&T&&(T.debug+="PPS "),s.pps||(s.pps=[j.data]);break;case 9:w=!1,s.audFound=!0,T&&o(T,s),T=m.avcSample=h(!1,O.pts,O.dts,_?"AUD ":"");break;case 12:w=!1;break;default:w=!1,T&&(T.debug+="unknown NAL "+j.type+" ");break}if(T&&w){var bt=T.units;bt.push(j)}}),g&&T&&(o(T,s),this.avcSample=null)},y.getLastNalUnit=function(){var O,g=this.avcSample,m;if(!g||g.units.length===0){var s=this._avcTrack.samples;g=s[s.length-1]}if((O=g)!==null&&O!==void 0&&O.units){var u=g.units;m=u[u.length-1]}return m},y.parseAVCNALu=function(O){var g=O.byteLength,m=this._avcTrack,s=m.naluState||0,u=s,_=[],T=0,w,P,j,K=-1,Z=0;for(s===-1&&(K=0,Z=O[0]&31,s=0,T=1);T<g;){if(w=O[T++],!s){s=w?0:1;continue}if(s===1){s=w?0:2;continue}if(!w)s=3;else if(w===1){if(K>=0){var G={data:O.subarray(K,T-s-1),type:Z};_.push(G)}else{var B=this.getLastNalUnit();if(B&&(u&&T<=4-u&&(B.state&&(B.data=B.data.subarray(0,B.data.byteLength-u))),P=T-s-1,P>0)){var $=new Uint8Array(B.data.byteLength+P);$.set(B.data,0),$.set(O.subarray(0,P),B.data.byteLength),B.data=$,B.state=0}}T<g?(j=O[T]&31,K=T,Z=j,s=0):s=-1}else s=0}if(K>=0&&s>=0){var ne={data:O.subarray(K,g),type:Z,state:s};_.push(ne)}if(_.length===0){var ae=this.getLastNalUnit();if(ae){var fe=new Uint8Array(ae.data.byteLength+O.byteLength);fe.set(ae.data,0),fe.set(O,ae.data.byteLength),ae.data=fe}}return m.naluState=s,_},y.parseAACPES=function(O){var g=0,m=this._audioTrack,s=this.aacOverFlow,u=O.data;if(s){this.aacOverFlow=null;var _=s.sample.unit.byteLength,T=Math.min(s.missing,_),w=_-T;s.sample.unit.set(u.subarray(0,T),w),m.samples.push(s.sample),g=s.missing}var P,j;for(P=g,j=u.length;P<j-1&&!W.isHeader(u,P);P++);if(P!==g){var K,Z;if(P<j-1?(K="AAC PES did not start with ADTS header,offset:"+P,Z=!1):(K="no ADTS header found in AAC PES",Z=!0),d.logger.warn("parsing error:"+K),this.observer.emit(S.Events.ERROR,S.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:Z,reason:K}),Z)return}W.initTrackConfig(m,this.observer,u,P,this.audioCodec);var G;if(O.pts!==void 0)G=O.pts;else if(s){var B=W.getFrameDuration(m.samplerate);G=s.sample.pts+B}else{d.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var $=0;P<j;)if(W.isHeader(u,P)){if(P+5<j){var ne=W.appendFrame(m,u,P,G,$);if(ne)if(ne.missing)this.aacOverFlow=ne;else{P+=ne.length,$++;continue}}break}else P++},y.parseMPEGPES=function(O){var g=O.data,m=g.length,s=0,u=0,_=O.pts;if(_===void 0){d.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<m;)if(N.isHeader(g,u)){var T=N.appendFrame(this._audioTrack,g,u,_,s);if(T)u+=T.length,s++;else break}else u++},y.parseID3PES=function(O){if(O.pts===void 0){d.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},E}();p.minProbeByteLength=188;function h(E,y,R,O){return{key:E,frame:!1,pts:y,dts:R,units:[],debug:O,length:0}}function f(E,y){return(E[y+10]&31)<<8|E[y+11]}function n(E,y,R,O){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},m=(E[y+1]&15)<<8|E[y+2],s=y+3+m-4,u=(E[y+10]&15)<<8|E[y+11];for(y+=12+u;y<s;){var _=(E[y+1]&31)<<8|E[y+2];switch(E[y]){case 207:if(!O){d.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:g.audio===-1&&(g.audio=_);break;case 21:g.id3===-1&&(g.id3=_);break;case 219:if(!O){d.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:g.avc===-1&&(g.avc=_);break;case 3:case 4:R?g.audio===-1&&(g.audio=_,g.isAAC=!1):d.logger.log("MPEG audio found, not supported in this browser");break;case 36:d.logger.warn("Unsupported HEVC stream type found");break;default:break}y+=((E[y+3]&15)<<8|E[y+4])+5}return g}function r(E){var y=0,R,O,g,m,s,u=E.data;if(!E||E.size===0)return null;for(;u[0].length<19&&u.length>1;){var _=new Uint8Array(u[0].length+u[1].length);_.set(u[0]),_.set(u[1],u[0].length),u[0]=_,u.splice(1,1)}R=u[0];var T=(R[0]<<16)+(R[1]<<8)+R[2];if(T===1){if(O=(R[4]<<8)+R[5],O&&O>E.size-6)return null;var w=R[7];w&192&&(m=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(s=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,m-s>60*9e4&&(d.logger.warn(Math.round((m-s)/9e4)+"s delta between PTS and DTS, align them"),m=s)):s=m),g=R[8];var P=g+9;if(E.size<=P)return null;E.size-=P;for(var j=new Uint8Array(E.size),K=0,Z=u.length;K<Z;K++){R=u[K];var G=R.byteLength;if(P)if(P>G){P-=G;continue}else R=R.subarray(P),G-=P,P=0;j.set(R,y),y+=G}return O&&(O-=g+3),{data:j,pts:m,dts:s,len:O}}return null}function o(E,y){if(E.units.length&&E.frame){if(E.pts===void 0){var R=y.samples,O=R.length;if(O){var g=R[O-1];E.pts=g.pts,E.dts=g.dts}else{y.dropped++;return}}y.samples.push(E)}E.debug.length&&d.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function l(E,y){var R=E.length;if(R>0){if(y.pts>=E[R-1].pts)E.push(y);else for(var O=R-1;O>=0;O--)if(y.pts<E[O].pts){E.splice(O,0,y);break}}else E.push(y)}function x(E){for(var y=E.byteLength,R=[],O=1;O<y-2;)E[O]===0&&E[O+1]===0&&E[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return E;var g=y-R.length,m=new Uint8Array(g),s=0;for(O=0;O<g;s++,O++)s===R[0]&&(s++,R.shift()),m[O]=E[s];return m}H.default=p},"./src/errors.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"ErrorTypes",function(){return W}),M.d(H,"ErrorDetails",function(){return N});var W;(function(A){A.NETWORK_ERROR="networkError",A.MEDIA_ERROR="mediaError",A.KEY_SYSTEM_ERROR="keySystemError",A.MUX_ERROR="muxError",A.OTHER_ERROR="otherError"})(W||(W={}));var N;(function(A){A.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",A.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",A.KEY_SYSTEM_NO_SESSION="keySystemNoSession",A.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",A.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",A.MANIFEST_LOAD_ERROR="manifestLoadError",A.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",A.MANIFEST_PARSING_ERROR="manifestParsingError",A.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",A.LEVEL_EMPTY_ERROR="levelEmptyError",A.LEVEL_LOAD_ERROR="levelLoadError",A.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",A.LEVEL_SWITCH_ERROR="levelSwitchError",A.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",A.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",A.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",A.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",A.FRAG_LOAD_ERROR="fragLoadError",A.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",A.FRAG_DECRYPT_ERROR="fragDecryptError",A.FRAG_PARSING_ERROR="fragParsingError",A.REMUX_ALLOC_ERROR="remuxAllocError",A.KEY_LOAD_ERROR="keyLoadError",A.KEY_LOAD_TIMEOUT="keyLoadTimeOut",A.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",A.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",A.BUFFER_APPEND_ERROR="bufferAppendError",A.BUFFER_APPENDING_ERROR="bufferAppendingError",A.BUFFER_STALLED_ERROR="bufferStalledError",A.BUFFER_FULL_ERROR="bufferFullError",A.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",A.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",A.INTERNAL_EXCEPTION="internalException",A.INTERNAL_ABORTED="aborted",A.UNKNOWN="unknown"})(N||(N={}))},"./src/events.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"Events",function(){return W});var W;(function(N){N.MEDIA_ATTACHING="hlsMediaAttaching",N.MEDIA_ATTACHED="hlsMediaAttached",N.MEDIA_DETACHING="hlsMediaDetaching",N.MEDIA_DETACHED="hlsMediaDetached",N.BUFFER_RESET="hlsBufferReset",N.BUFFER_CODECS="hlsBufferCodecs",N.BUFFER_CREATED="hlsBufferCreated",N.BUFFER_APPENDING="hlsBufferAppending",N.BUFFER_APPENDED="hlsBufferAppended",N.BUFFER_EOS="hlsBufferEos",N.BUFFER_FLUSHING="hlsBufferFlushing",N.BUFFER_FLUSHED="hlsBufferFlushed",N.MANIFEST_LOADING="hlsManifestLoading",N.MANIFEST_LOADED="hlsManifestLoaded",N.MANIFEST_PARSED="hlsManifestParsed",N.LEVEL_SWITCHING="hlsLevelSwitching",N.LEVEL_SWITCHED="hlsLevelSwitched",N.LEVEL_LOADING="hlsLevelLoading",N.LEVEL_LOADED="hlsLevelLoaded",N.LEVEL_UPDATED="hlsLevelUpdated",N.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",N.LEVELS_UPDATED="hlsLevelsUpdated",N.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",N.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",N.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",N.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",N.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",N.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",N.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",N.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",N.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",N.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",N.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",N.CUES_PARSED="hlsCuesParsed",N.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",N.INIT_PTS_FOUND="hlsInitPtsFound",N.FRAG_LOADING="hlsFragLoading",N.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",N.FRAG_LOADED="hlsFragLoaded",N.FRAG_DECRYPTED="hlsFragDecrypted",N.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",N.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",N.FRAG_PARSING_METADATA="hlsFragParsingMetadata",N.FRAG_PARSED="hlsFragParsed",N.FRAG_BUFFERED="hlsFragBuffered",N.FRAG_CHANGED="hlsFragChanged",N.FPS_DROP="hlsFpsDrop",N.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",N.ERROR="hlsError",N.DESTROYING="hlsDestroying",N.KEY_LOADING="hlsKeyLoading",N.KEY_LOADED="hlsKeyLoaded",N.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",N.BACK_BUFFER_REACHED="hlsBackBufferReached"})(W||(W={}))},"./src/hls.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return E});var W=M("./node_modules/url-toolkit/src/url-toolkit.js"),N=M.n(W),A=M("./src/loader/playlist-loader.ts"),F=M("./src/loader/key-loader.ts"),U=M("./src/controller/id3-track-controller.ts"),S=M("./src/controller/latency-controller.ts"),L=M("./src/controller/level-controller.ts"),d=M("./src/controller/fragment-tracker.ts"),v=M("./src/controller/stream-controller.ts"),C=M("./src/is-supported.ts"),p=M("./src/utils/logger.ts"),h=M("./src/config.ts"),f=M("./node_modules/eventemitter3/index.js"),n=M.n(f),r=M("./src/events.ts"),o=M("./src/errors.ts");function l(y,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(y,g.key,g)}}function x(y,R,O){return R&&l(y.prototype,R),O&&l(y,O),y}var E=function(){y.isSupported=function(){return Object(C.isSupported)()};function y(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.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 g=this.config=Object(h.mergeConfig)(y.DefaultConfig,O);this.userConfig=O,Object(p.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(h.enableStreamingMode)(g);var m=g.abrController,s=g.bufferController,u=g.capLevelController,_=g.fpsController,T=this.abrController=new m(this),w=this.bufferController=new s(this),P=this.capLevelController=new u(this),j=new _(this),K=new A.default(this),Z=new F.default(this),G=new U.default(this),B=this.levelController=new L.default(this),$=new d.FragmentTracker(this),ne=this.streamController=new v.default(this,$);P.setStreamController(ne),j.setStreamController(ne);var ae=[B,ne];this.networkControllers=ae;var fe=[K,Z,T,w,P,j,G,$];this.audioTrackController=this.createController(g.audioTrackController,null,ae),this.createController(g.audioStreamController,$,ae),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,ae),this.createController(g.subtitleStreamController,$,ae),this.createController(g.timelineController,null,fe),this.emeController=this.createController(g.emeController,null,fe),this.cmcdController=this.createController(g.cmcdController,null,fe),this.latencyController=this.createController(S.default,null,fe),this.coreComponents=fe}var R=y.prototype;return R.createController=function(g,m,s){if(g){var u=m?new g(this,m):new g(this);return s&&s.push(u),u}return null},R.on=function(g,m,s){s===void 0&&(s=this),this._emitter.on(g,m,s)},R.once=function(g,m,s){s===void 0&&(s=this),this._emitter.once(g,m,s)},R.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},R.off=function(g,m,s,u){s===void 0&&(s=this),this._emitter.off(g,m,s,u)},R.listeners=function(g){return this._emitter.listeners(g)},R.emit=function(g,m,s){return this._emitter.emit(g,m,s)},R.trigger=function(g,m){if(this.config.debug)return this.emit(g,g,m);try{return this.emit(g,g,m)}catch(s){p.logger.error("An internal error happened while handling event "+g+'. Error message: "'+s.message+'". Here is a stacktrace:',s),this.trigger(r.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:s})}return!1},R.listenerCount=function(g){return this._emitter.listenerCount(g)},R.destroy=function(){p.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(g){return g.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(g){return g.destroy()}),this.coreComponents.length=0},R.attachMedia=function(g){p.logger.log("attachMedia"),this._media=g,this.trigger(r.Events.MEDIA_ATTACHING,{media:g})},R.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(g){this.stopLoad();var m=this.media,s=this.url,u=this.url=W.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});p.logger.log("loadSource:"+u),m&&s&&s!==u&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(m)),this.trigger(r.Events.MANIFEST_LOADING,{url:g})},R.startLoad=function(g){g===void 0&&(g=-1),p.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(m){m.startLoad(g)})},R.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},R.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){p.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},R.removeLevel=function(g,m){m===void 0&&(m=0),this.levelController.removeLevel(g,m)},x(y,[{key:"levels",get:function(){var g=this.levelController.levels;return g||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(g){p.logger.log("set currentLevel:"+g),this.loadLevel=g,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(g){p.logger.log("set nextLevel:"+g),this.levelController.manualLevel=g,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(g){p.logger.log("set loadLevel:"+g),this.levelController.manualLevel=g}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(g){this.levelController.nextLoadLevel=g}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(g){p.logger.log("set firstLevel:"+g),this.levelController.firstLevel=g}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(g){p.logger.log("set startLevel:"+g),g!==-1&&(g=Math.max(g,this.minAutoLevel)),this.levelController.startLevel=g}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(g){var m=!!g;m!==this.config.capLevelToPlayerSize&&(m?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=m)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(g){this._autoLevelCapping!==g&&(p.logger.log("set autoLevelCapping:"+g),this._autoLevelCapping=g)}},{key:"bandwidthEstimate",get:function(){var g=this.abrController.bwEstimator;return g?g.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var g=this.levels,m=this.config.minAutoBitrate;if(!g)return 0;for(var s=g.length,u=0;u<s;u++)if(g[u].maxBitrate>m)return u;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,m=this.autoLevelCapping,s;return m===-1&&g&&g.length?s=g.length-1:s=m,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var m=this.audioTrackController;m&&(m.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var m=this.subtitleTrackController;m&&(m.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var m=this.subtitleTrackController;m&&(m.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return o.ErrorTypes}},{key:"ErrorDetails",get:function(){return o.ErrorDetails}},{key:"DefaultConfig",get:function(){return y.defaultConfig?y.defaultConfig:h.hlsDefaultConfig},set:function(g){y.defaultConfig=g}}]),y}();E.defaultConfig=void 0},"./src/is-supported.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"isSupported",function(){return A}),M.d(H,"changeTypeSupported",function(){return F});var W=M("./src/utils/mediasource-helper.ts");function N(){return self.SourceBuffer||self.WebKitSourceBuffer}function A(){var U=Object(W.getMediaSource)();if(!U)return!1;var S=N(),L=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),d=!S||S.prototype&&typeof S.prototype.appendBuffer=="function"&&typeof S.prototype.remove=="function";return!!L&&!!d}function F(){var U,S=N();return typeof(S==null||((U=S.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return p}),M.d(H,"LoadError",function(){return f});var W=M("./src/polyfills/number.ts"),N=M("./src/errors.ts");function A(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,d(n,r)}function F(n){var r=typeof Map=="function"?new Map:void 0;return F=function(l){if(l===null||!L(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(l))return r.get(l);r.set(l,x)}function x(){return U(l,arguments,v(this).constructor)}return x.prototype=Object.create(l.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),d(x,l)},F(n)}function U(n,r,o){return S()?U=Reflect.construct:U=function(x,E,y){var R=[null];R.push.apply(R,E);var O=Function.bind.apply(x,R),g=new O;return y&&d(g,y.prototype),g},U.apply(null,arguments)}function S(){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(n){return!1}}function L(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function d(n,r){return d=Object.setPrototypeOf||function(l,x){return l.__proto__=x,l},d(n,r)}function v(n){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},v(n)}var C=Math.pow(2,17),p=function(){function n(o){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=o}var r=n.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(l,x){var E=this,y=l.url;if(!y)return Promise.reject(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(y?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(m,s){E.loader&&E.loader.destroy();var u=E.loader=l.loader=O?new O(R):new g(R),_=h(l),T={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:C};l.stats=u.stats,u.load(_,T,{onSuccess:function(P,j,K,Z){E.resetLoader(l,u),m({frag:l,part:null,payload:P.data,networkDetails:Z})},onError:function(P,j,K){E.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:P,networkDetails:K}))},onAbort:function(P,j,K){E.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:K}))},onTimeout:function(P,j,K){E.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:K}))},onProgress:function(P,j,K,Z){x&&x({frag:l,part:null,payload:K,networkDetails:Z})}})})},r.loadPart=function(l,x,E){var y=this;this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(m,s){y.loader&&y.loader.destroy();var u=y.loader=l.loader=O?new O(R):new g(R),_=h(l,x),T={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:C};x.stats=u.stats,u.load(_,T,{onSuccess:function(P,j,K,Z){y.resetLoader(l,u),y.updateStatsFromPart(l,x);var G={frag:l,part:x,payload:P.data,networkDetails:Z};E(G),m(G)},onError:function(P,j,K){y.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:x,response:P,networkDetails:K}))},onAbort:function(P,j,K){l.stats.aborted=x.stats.aborted,y.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:x,networkDetails:K}))},onTimeout:function(P,j,K){y.resetLoader(l,u),s(new f({type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:x,networkDetails:K}))}})})},r.updateStatsFromPart=function(l,x){var E=l.stats,y=x.stats,R=y.total;if(E.loaded+=y.loaded,R){var O=Math.round(l.duration/x.duration),g=Math.min(Math.round(E.loaded/R),O),m=O-g,s=m*Math.round(E.loaded/g);E.total=E.loaded+s}else E.total=Math.max(E.loaded,E.total);var u=E.loading,_=y.loading;u.start?u.first+=_.first-_.start:(u.start=_.start,u.first=_.first),u.end=_.end},r.resetLoader=function(l,x){l.loader=null,this.loader===x&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),x.destroy()},n}();function h(n,r){r===void 0&&(r=null);var o=r||n,l={frag:n,part:r,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},x=o.byteRangeStartOffset,E=o.byteRangeEndOffset;return Object(W.isFiniteNumber)(x)&&Object(W.isFiniteNumber)(E)&&(l.rangeStart=x,l.rangeEnd=E),l}var f=function(n){A(r,n);function r(o){for(var l,x=arguments.length,E=new Array(x>1?x-1:0),y=1;y<x;y++)E[y-1]=arguments[y];return l=n.call.apply(n,[this].concat(E))||this,l.data=void 0,l.data=o,l}return r}(F(Error))},"./src/loader/fragment.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"ElementaryStreamTypes",function(){return p}),M.d(H,"BaseSegment",function(){return h}),M.d(H,"Fragment",function(){return f}),M.d(H,"Part",function(){return n});var W=M("./src/polyfills/number.ts"),N=M("./node_modules/url-toolkit/src/url-toolkit.js"),A=M.n(N),F=M("./src/utils/logger.ts"),U=M("./src/loader/level-key.ts"),S=M("./src/loader/load-stats.ts");function L(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,d(r,o)}function d(r,o){return d=Object.setPrototypeOf||function(x,E){return x.__proto__=E,x},d(r,o)}function v(r,o){for(var l=0;l<o.length;l++){var x=o[l];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(r,x.key,x)}}function C(r,o,l){return o&&v(r.prototype,o),l&&v(r,l),r}var p;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(p||(p={}));var h=function(){function r(l){var x;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(x={},x[p.AUDIO]=null,x[p.VIDEO]=null,x[p.AUDIOVIDEO]=null,x),this.baseurl=l}var o=r.prototype;return o.setByteRange=function(x,E){var y=x.split("@",2),R=[];y.length===1?R[0]=E?E.byteRangeEndOffset:0:R[0]=parseInt(y[1]),R[1]=parseInt(y[0])+R[0],this._byteRange=R},C(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(N.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(x){this._url=x}}]),r}(),f=function(r){L(o,r);function o(x,E){var y;return y=r.call(this,E)||this,y._decryptdata=null,y.rawProgramDateTime=null,y.programDateTime=null,y.tagList=[],y.duration=0,y.sn=0,y.levelkey=void 0,y.type=void 0,y.loader=null,y.level=-1,y.cc=0,y.startPTS=void 0,y.endPTS=void 0,y.appendedPTS=void 0,y.startDTS=void 0,y.endDTS=void 0,y.start=0,y.deltaPTS=void 0,y.maxStartPTS=void 0,y.minEndPTS=void 0,y.stats=new S.LoadStats,y.urlId=0,y.data=void 0,y.bitrateTest=!1,y.title=null,y.initSegment=null,y.type=x,y}var l=o.prototype;return l.createInitializationVector=function(E){for(var y=new Uint8Array(16),R=12;R<16;R++)y[R]=E>>8*(15-R)&255;return y},l.setDecryptDataFromLevelKey=function(E,y){var R=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(R=U.LevelKey.fromURI(E.uri),R.method=E.method,R.iv=this.createInitializationVector(y),R.keyFormat="identity"),R},l.setElementaryStreamInfo=function(E,y,R,O,g,m){m===void 0&&(m=!1);var s=this.elementaryStreams,u=s[E];if(!u){s[E]={startPTS:y,endPTS:R,startDTS:O,endDTS:g,partial:m};return}u.startPTS=Math.min(u.startPTS,y),u.endPTS=Math.max(u.endPTS,R),u.startDTS=Math.min(u.startDTS,O),u.endDTS=Math.max(u.endDTS,g)},l.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[p.AUDIO]=null,E[p.VIDEO]=null,E[p.AUDIOVIDEO]=null},C(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&&F.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(W.isFiniteNumber)(this.programDateTime))return null;var E=Object(W.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}(h),n=function(r){L(o,r);function o(l,x,E,y,R){var O;O=r.call(this,E)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new S.LoadStats,O.duration=l.decimalFloatingPoint("DURATION"),O.gap=l.bool("GAP"),O.independent=l.bool("INDEPENDENT"),O.relurl=l.enumeratedString("URI"),O.fragment=x,O.index=y;var g=l.enumeratedString("BYTERANGE");return g&&O.setByteRange(g,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return C(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}(h)},"./src/loader/key-loader.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return F});var W=M("./src/events.ts"),N=M("./src/errors.ts"),A=M("./src/utils/logger.ts"),F=function(){function U(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var S=U.prototype;return S._registerListeners=function(){this.hls.on(W.Events.KEY_LOADING,this.onKeyLoading,this)},S._unregisterListeners=function(){this.hls.off(W.Events.KEY_LOADING,this.onKeyLoading)},S.destroy=function(){this._unregisterListeners();for(var d in this.loaders){var v=this.loaders[d];v&&v.destroy()}this.loaders={}},S.onKeyLoading=function(d,v){var C=v.frag,p=C.type,h=this.loaders[p];if(!C.decryptdata){A.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=C.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var n=this.hls.config;if(h&&(A.logger.warn("abort previous key loader for type:"+p),h.abort()),!f){A.logger.warn("key uri is falsy");return}var r=n.loader,o=C.loader=this.loaders[p]=new r(n);this.decrypturl=f,this.decryptkey=null;var l={url:f,frag:C,responseType:"arraybuffer"},x={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:n.fragLoadingRetryDelay,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};o.load(l,x,E)}else this.decryptkey&&(C.decryptdata.key=this.decryptkey,this.hls.trigger(W.Events.KEY_LOADED,{frag:C}))},S.loadsuccess=function(d,v,C){var p=C.frag;if(!p.decryptdata){A.logger.error("after key load, decryptdata unset");return}this.decryptkey=p.decryptdata.key=new Uint8Array(d.data),p.loader=null,delete this.loaders[p.type],this.hls.trigger(W.Events.KEY_LOADED,{frag:p})},S.loaderror=function(d,v){var C=v.frag,p=C.loader;p&&p.abort(),delete this.loaders[C.type],this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:C,response:d})},S.loadtimeout=function(d,v){var C=v.frag,p=C.loader;p&&p.abort(),delete this.loaders[C.type],this.hls.trigger(W.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:C})},U}()},"./src/loader/level-details.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"LevelDetails",function(){return U});var W=M("./src/polyfills/number.ts");function N(S,L){for(var d=0;d<L.length;d++){var v=L[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}function A(S,L,d){return L&&N(S.prototype,L),d&&N(S,d),S}var F=10,U=function(){function S(d){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=d}var L=S.prototype;return L.reloaded=function(v){if(!v){this.advanced=!0,this.updated=!0;return}var C=this.lastPartSn-v.lastPartSn,p=this.lastPartIndex-v.lastPartIndex;this.updated=this.endSN!==v.endSN||!!p||!!C,this.advanced=this.endSN>v.endSN||C>0||C===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(v.misses*.6):this.misses=v.misses+1,this.availabilityDelay=v.availabilityDelay},A(S,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var v=this.driftEndTime-this.driftStartTime;if(v>0){var C=this.driftEnd-this.driftStart;return C*1e3/v}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var v;return(v=this.fragments)!==null&&v!==void 0&&v.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 v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),S}()},"./src/loader/level-key.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"LevelKey",function(){return U});var W=M("./node_modules/url-toolkit/src/url-toolkit.js"),N=M.n(W);function A(S,L){for(var d=0;d<L.length;d++){var v=L[d];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}function F(S,L,d){return L&&A(S.prototype,L),d&&A(S,d),S}var U=function(){S.fromURL=function(d,v){return new S(d,v)},S.fromURI=function(d){return new S(d)};function S(L,d){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,d?this._uri=Object(W.buildAbsoluteURL)(L,d,{alwaysNormalize:!0}):this._uri=L}return F(S,[{key:"uri",get:function(){return this._uri}}]),S}()},"./src/loader/load-stats.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"LoadStats",function(){return W});var W=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(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return o});var W=M("./src/polyfills/number.ts"),N=M("./node_modules/url-toolkit/src/url-toolkit.js"),A=M.n(N),F=M("./src/loader/fragment.ts"),U=M("./src/loader/level-details.ts"),S=M("./src/loader/level-key.ts"),L=M("./src/utils/attr-list.ts"),d=M("./src/utils/logger.ts"),v=M("./src/utils/codecs.ts"),C=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,p=/#EXT-X-MEDIA:(.*)/g,h=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=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("|")),n=/\.(mp4|m4s|m4v|m4a)$/i;function r(R){var O,g;return n.test((O=(g=N.parseURL(R))===null||g===void 0?void 0:g.path)!=null?O:"")}var o=function(){function R(){}return R.findGroup=function(g,m){for(var s=0;s<g.length;s++){var u=g[s];if(u.id===m)return u}},R.convertAVC1ToAVCOTI=function(g){var m=g.split(".");if(m.length>2){var s=m.shift()+".";return s+=parseInt(m.shift()).toString(16),s+=("000"+parseInt(m.shift()).toString(16)).substr(-4),s}return g},R.resolve=function(g,m){return N.buildAbsoluteURL(m,g,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(g,m){var s=[],u={},_=!1;C.lastIndex=0;for(var T;(T=C.exec(g))!=null;)if(T[1]){var w=new L.AttrList(T[1]),P={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(T[2],m)},j=w.decimalResolution("RESOLUTION");j&&(P.width=j.width,P.height=j.height),l((w.CODECS||"").split(/[ ,]+/).filter(function(Z){return Z}),P),P.videoCodec&&P.videoCodec.indexOf("avc1")!==-1&&(P.videoCodec=R.convertAVC1ToAVCOTI(P.videoCodec)),s.push(P)}else if(T[3]){var K=new L.AttrList(T[3]);K["DATA-ID"]&&(_=!0,u[K["DATA-ID"]]=K)}return{levels:s,sessionData:_?u:null}},R.parseMasterPlaylistMedia=function(g,m,s,u){u===void 0&&(u=[]);var _,T=[],w=0;for(p.lastIndex=0;(_=p.exec(g))!==null;){var P=new L.AttrList(_[1]);if(P.TYPE===s){var j={attrs:P,bitrate:0,id:w++,groupId:P["GROUP-ID"],instreamId:P["INSTREAM-ID"],name:P.NAME||P.LANGUAGE||"",type:s,default:P.bool("DEFAULT"),autoselect:P.bool("AUTOSELECT"),forced:P.bool("FORCED"),lang:P.LANGUAGE,url:P.URI?R.resolve(P.URI,m):""};if(u.length){var K=R.findGroup(u,j.groupId)||u[0];x(j,K,"audioCodec"),x(j,K,"textCodec")}T.push(j)}}return T},R.parseLevelPlaylist=function(g,m,s,u,_){var T=new U.LevelDetails(m),w=T.fragments,P=null,j=0,K=0,Z=0,G=0,B=null,$=new F.Fragment(u,m),ne,ae,fe,_e=-1,Se=!1;for(h.lastIndex=0,T.m3u8=g;(ne=h.exec(g))!==null;){Se&&(Se=!1,$=new F.Fragment(u,m),$.start=Z,$.sn=j,$.cc=G,$.level=s,P&&($.initSegment=P,$.rawProgramDateTime=P.rawProgramDateTime));var we=ne[1];if(we){$.duration=parseFloat(we);var Me=(" "+ne[2]).slice(1);$.title=Me||null,$.tagList.push(Me?["INF",we,Me]:["INF",we])}else if(ne[3])Object(W.isFiniteNumber)($.duration)&&($.start=Z,fe&&($.levelkey=fe),$.sn=j,$.level=s,$.cc=G,$.urlId=_,w.push($),$.relurl=(" "+ne[3]).slice(1),y($,B),B=$,Z+=$.duration,j++,K=0,Se=!0);else if(ne[4]){var Le=(" "+ne[4]).slice(1);B?$.setByteRange(Le,B):$.setByteRange(Le)}else if(ne[5])$.rawProgramDateTime=(" "+ne[5]).slice(1),$.tagList.push(["PROGRAM-DATE-TIME",$.rawProgramDateTime]),_e===-1&&(_e=w.length);else{if(ne=ne[0].match(f),!ne){d.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<ne.length&&!(typeof ne[ae]!="undefined");ae++);var ge=(" "+ne[ae]).slice(1),ue=(" "+ne[ae+1]).slice(1),ke=ne[ae+2]?(" "+ne[ae+2]).slice(1):"";switch(ge){case"PLAYLIST-TYPE":T.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":j=T.startSN=parseInt(ue);break;case"SKIP":{var lt=new L.AttrList(ue),ot=lt.decimalInteger("SKIPPED-SEGMENTS");if(Object(W.isFiniteNumber)(ot)){T.skippedSegments=ot;for(var st=ot;st--;)w.unshift(null);j+=ot}var ce=lt.enumeratedString("RECENTLY-REMOVED-DATERANGES");ce&&(T.recentlyRemovedDateranges=ce.split(" "));break}case"TARGETDURATION":T.targetduration=parseFloat(ue);break;case"VERSION":T.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":T.live=!1;break;case"#":(ue||ke)&&$.tagList.push(ke?[ue,ke]:[ue]);break;case"DIS":G++;case"GAP":$.tagList.push([ge]);break;case"BITRATE":$.tagList.push([ge,ue]);break;case"DISCONTINUITY-SEQ":G=parseInt(ue);break;case"KEY":{var pe,Oe=new L.AttrList(ue),ze=Oe.enumeratedString("METHOD"),qe=Oe.URI,Je=Oe.hexadecimalInteger("IV"),rt=Oe.enumeratedString("KEYFORMATVERSIONS"),tt=Oe.enumeratedString("KEYID"),Tt=(pe=Oe.enumeratedString("KEYFORMAT"))!=null?pe:"identity",bt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(bt.indexOf(Tt)>-1){d.logger.warn("Keyformat "+Tt+" is not supported from the manifest");continue}else if(Tt!=="identity")continue;ze&&(fe=S.LevelKey.fromURL(m,qe),qe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ze)>=0&&(fe.method=ze,fe.keyFormat=Tt,tt&&(fe.keyID=tt),rt&&(fe.keyFormatVersions=rt),fe.iv=Je));break}case"START":{var Et=new L.AttrList(ue),yt=Et.decimalFloatingPoint("TIME-OFFSET");Object(W.isFiniteNumber)(yt)&&(T.startTimeOffset=yt);break}case"MAP":{var Ot=new L.AttrList(ue);$.relurl=Ot.URI,Ot.BYTERANGE&&$.setByteRange(Ot.BYTERANGE),$.level=s,$.sn="initSegment",fe&&($.levelkey=fe),$.initSegment=null,P=$,Se=!0;break}case"SERVER-CONTROL":{var At=new L.AttrList(ue);T.canBlockReload=At.bool("CAN-BLOCK-RELOAD"),T.canSkipUntil=At.optionalFloat("CAN-SKIP-UNTIL",0),T.canSkipDateRanges=T.canSkipUntil>0&&At.bool("CAN-SKIP-DATERANGES"),T.partHoldBack=At.optionalFloat("PART-HOLD-BACK",0),T.holdBack=At.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new L.AttrList(ue);T.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var xe=T.partList;xe||(xe=T.partList=[]);var Be=K>0?xe[xe.length-1]:void 0,Ze=K++,Pe=new F.Part(new L.AttrList(ue),$,m,Ze,Be);xe.push(Pe),$.duration+=Pe.duration;break}case"PRELOAD-HINT":{var Xe=new L.AttrList(ue);T.preloadHint=Xe;break}case"RENDITION-REPORT":{var be=new L.AttrList(ue);T.renditionReports=T.renditionReports||[],T.renditionReports.push(be);break}default:d.logger.warn("line parsed but not handled: "+ne);break}}}B&&!B.relurl?(w.pop(),Z-=B.duration,T.partList&&(T.fragmentHint=B)):T.partList&&(y($,B),$.cc=G,T.fragmentHint=$);var de=w.length,he=w[0],re=w[de-1];if(Z+=T.skippedSegments*T.targetduration,Z>0&&de&&re){T.averagetargetduration=Z/de;var ie=re.sn;T.endSN=ie!=="initSegment"?ie:0,he&&(T.startCC=he.cc,he.initSegment||T.fragments.every(function(le){return le.relurl&&r(le.relurl)})&&(d.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),$=new F.Fragment(u,m),$.relurl=re.relurl,$.level=s,$.sn="initSegment",he.initSegment=$,T.needSidxRanges=!0))}else T.endSN=0,T.startCC=0;return T.fragmentHint&&(Z+=T.fragmentHint.duration),T.totalduration=Z,T.endCC=G,_e>0&&E(w,_e),T},R}();function l(R,O){["video","audio","text"].forEach(function(g){var m=R.filter(function(u){return Object(v.isCodecType)(u,g)});if(m.length){var s=m.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});O[g+"Codec"]=s.length>0?s[0]:m[0],R=R.filter(function(u){return m.indexOf(u)===-1})}}),O.unknownCodecs=R}function x(R,O,g){var m=O[g];m&&(R[g]=m)}function E(R,O){for(var g=R[O],m=O;m--;){var s=R[m];if(!s)return;s.programDateTime=g.programDateTime-s.duration*1e3,g=s}}function y(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(W.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/polyfills/number.ts"),N=M("./src/events.ts"),A=M("./src/errors.ts"),F=M("./src/utils/logger.ts"),U=M("./src/utils/mp4-tools.ts"),S=M("./src/loader/m3u8-parser.ts"),L=M("./src/types/loader.ts"),d=M("./src/utils/attr-list.ts");function v(h){var f=h.type;switch(f){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function C(h,f){var n=h.url;return(n===void 0||n.indexOf("data:")===0)&&(n=f.url),n}var p=function(){function h(n){this.hls=void 0,this.loaders=Object.create(null),this.hls=n,this.registerListeners()}var f=h.prototype;return f.registerListeners=function(){var r=this.hls;r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(N.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(N.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(r){var o=this.hls.config,l=o.pLoader,x=o.loader,E=l||x,y=new E(o);return r.loader=y,this.loaders[r.type]=y,y},f.getInternalLoader=function(r){return this.loaders[r.type]},f.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},f.destroyInternalLoaders=function(){for(var r in this.loaders){var o=this.loaders[r];o&&o.destroy(),this.resetInternalLoader(r)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(r,o){var l=o.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},f.onLevelLoading=function(r,o){var l=o.id,x=o.level,E=o.url,y=o.deliveryDirectives;this.load({id:l,groupId:null,level:x,responseType:"text",type:L.PlaylistContextType.LEVEL,url:E,deliveryDirectives:y})},f.onAudioTrackLoading=function(r,o){var l=o.id,x=o.groupId,E=o.url,y=o.deliveryDirectives;this.load({id:l,groupId:x,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:y})},f.onSubtitleTrackLoading=function(r,o){var l=o.id,x=o.groupId,E=o.url,y=o.deliveryDirectives;this.load({id:l,groupId:x,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:y})},f.load=function(r){var o,l=this.hls.config,x=this.getInternalLoader(r);if(x){var E=x.context;if(E&&E.url===r.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),x.abort()}var y,R,O,g;switch(r.type){case L.PlaylistContextType.MANIFEST:y=l.manifestLoadingMaxRetry,R=l.manifestLoadingTimeOut,O=l.manifestLoadingRetryDelay,g=l.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:y=0,R=l.levelLoadingTimeOut;break;default:y=l.levelLoadingMaxRetry,R=l.levelLoadingTimeOut,O=l.levelLoadingRetryDelay,g=l.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(r),(o=r.deliveryDirectives)!==null&&o!==void 0&&o.part){var m;if(r.type===L.PlaylistContextType.LEVEL&&r.level!==null?m=this.hls.levels[r.level].details:r.type===L.PlaylistContextType.AUDIO_TRACK&&r.id!==null?m=this.hls.audioTracks[r.id].details:r.type===L.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(m=this.hls.subtitleTracks[r.id].details),m){var s=m.partTarget,u=m.targetduration;s&&u&&(R=Math.min(Math.max(s*3,u*.8)*1e3,R))}}var _={timeout:R,maxRetry:y,retryDelay:O,maxRetryDelay:g,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(r,_,T)},f.loadsuccess=function(r,o,l,x){if(x===void 0&&(x=null),l.isSidxRequest){this.handleSidxRequest(r,l),this.handlePlaylistLoaded(r,o,l,x);return}this.resetInternalLoader(l.type);var E=r.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,l,"no EXTM3U delimiter",x);return}o.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,o,l,x):this.handleMasterPlaylist(r,o,l,x)},f.loaderror=function(r,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!1,r)},f.loadtimeout=function(r,o,l){l===void 0&&(l=null),this.handleNetworkError(o,l,!0)},f.handleMasterPlaylist=function(r,o,l,x){var E=this.hls,y=r.data,R=C(r,l),O=S.default.parseMasterPlaylist(y,R),g=O.levels,m=O.sessionData;if(!g.length){this.handleManifestParsingError(r,l,"no level found in manifest",x);return}var s=g.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),u=g.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),_=S.default.parseMasterPlaylistMedia(y,R,"AUDIO",s),T=S.default.parseMasterPlaylistMedia(y,R,"SUBTITLES",u),w=S.default.parseMasterPlaylistMedia(y,R,"CLOSED-CAPTIONS");if(_.length){var P=_.some(function(j){return!j.url});!P&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new d.AttrList({}),bitrate:0,url:""}))}E.trigger(N.Events.MANIFEST_LOADED,{levels:g,audioTracks:_,subtitles:T,captions:w,url:R,stats:o,networkDetails:x,sessionData:m})},f.handleTrackOrLevelPlaylist=function(r,o,l,x){var E=this.hls,y=l.id,R=l.level,O=l.type,g=C(r,l),m=Object(W.isFiniteNumber)(y)?y:0,s=Object(W.isFiniteNumber)(R)?R:m,u=v(l),_=S.default.parseLevelPlaylist(r.data,g,s,u,m);if(!_.fragments.length){E.trigger(N.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var T={attrs:new d.AttrList({}),bitrate:0,details:_,name:"",url:g};E.trigger(N.Events.MANIFEST_LOADED,{levels:[T],audioTracks:[],url:g,stats:o,networkDetails:x,sessionData:null})}if(o.parsing.end=performance.now(),_.needSidxRanges){var w,P=(w=_.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:P,isSidxRequest:!0,type:O,level:R,levelDetails:_,id:y,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=_,this.handlePlaylistLoaded(r,o,l,x)},f.handleSidxRequest=function(r,o){var l=Object(U.parseSegmentIndex)(new Uint8Array(r.data));if(!l)return;var x=l.references,E=o.levelDetails;x.forEach(function(y,R){var O=y.info,g=E.fragments[R];g.byteRange.length===0&&g.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),g.initSegment&&g.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(r,o,l,x){this.hls.trigger(N.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:o.type===L.PlaylistContextType.MANIFEST,url:r.url,reason:l,response:r,context:o,networkDetails:x})},f.handleNetworkError=function(r,o,l,x){l===void 0&&(l=!1),F.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var E=A.ErrorDetails.UNKNOWN,y=!1,R=this.getInternalLoader(r);switch(r.type){case L.PlaylistContextType.MANIFEST:E=l?A.ErrorDetails.MANIFEST_LOAD_TIMEOUT:A.ErrorDetails.MANIFEST_LOAD_ERROR,y=!0;break;case L.PlaylistContextType.LEVEL:E=l?A.ErrorDetails.LEVEL_LOAD_TIMEOUT:A.ErrorDetails.LEVEL_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.AUDIO_TRACK:E=l?A.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:A.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:E=l?A.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:A.ErrorDetails.SUBTITLE_LOAD_ERROR,y=!1;break}R&&this.resetInternalLoader(r.type);var O={type:A.ErrorTypes.NETWORK_ERROR,details:E,fatal:y,url:r.url,loader:R,context:r,networkDetails:o};x&&(O.response=x),this.hls.trigger(N.Events.ERROR,O)},f.handlePlaylistLoaded=function(r,o,l,x){var E=l.type,y=l.level,R=l.id,O=l.groupId,g=l.loader,m=l.levelDetails,s=l.deliveryDirectives;if(!(m!=null&&m.targetduration)){this.handleManifestParsingError(r,l,"invalid target duration",x);return}if(!g)return;m.live&&(g.getCacheAge&&(m.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(m.ageHeader))&&(m.ageHeader=0));switch(E){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(N.Events.LEVEL_LOADED,{details:m,level:y||0,id:R||0,stats:o,networkDetails:x,deliveryDirectives:s});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(N.Events.AUDIO_TRACK_LOADED,{details:m,id:R||0,groupId:O||"",stats:o,networkDetails:x,deliveryDirectives:s});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADED,{details:m,id:R||0,groupId:O||"",stats:o,networkDetails:x,deliveryDirectives:s});break}},h}();H.default=p},"./src/polyfills/number.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"isFiniteNumber",function(){return W}),M.d(H,"MAX_SAFE_INTEGER",function(){return N});var W=Number.isFinite||function(A){return typeof A=="number"&&isFinite(A)},N=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Q,H,M){"use strict";M.r(H);var W=function(){function N(){}return N.getSilentFrame=function(F,U){switch(F){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},N}();H.default=W},"./src/remux/mp4-generator.ts":function(Q,H,M){"use strict";M.r(H);var W=Math.pow(2,32)-1,N=function(){function A(){}return A.init=function(){A.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 A.types)A.types.hasOwnProperty(U)&&(A.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var S=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);A.HDLR_TYPES={video:S,audio:L};var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),v=new Uint8Array([0,0,0,0,0,0,0,0]);A.STTS=A.STSC=A.STCO=v,A.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),A.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),A.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),A.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var C=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),h=new Uint8Array([0,0,0,1]);A.FTYP=A.box(A.types.ftyp,C,h,C,p),A.DINF=A.box(A.types.dinf,A.box(A.types.dref,d))},A.box=function(U){for(var S=8,L=arguments.length,d=new Array(L>1?L-1:0),v=1;v<L;v++)d[v-1]=arguments[v];for(var C=d.length,p=C;C--;)S+=d[C].byteLength;var h=new Uint8Array(S);for(h[0]=S>>24&255,h[1]=S>>16&255,h[2]=S>>8&255,h[3]=S&255,h.set(U,4),C=0,S=8;C<p;C++)h.set(d[C],S),S+=d[C].byteLength;return h},A.hdlr=function(U){return A.box(A.types.hdlr,A.HDLR_TYPES[U])},A.mdat=function(U){return A.box(A.types.mdat,U)},A.mdhd=function(U,S){S*=U;var L=Math.floor(S/(W+1)),d=Math.floor(S%(W+1));return A.box(A.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,L>>24,L>>16&255,L>>8&255,L&255,d>>24,d>>16&255,d>>8&255,d&255,85,196,0,0]))},A.mdia=function(U){return A.box(A.types.mdia,A.mdhd(U.timescale,U.duration),A.hdlr(U.type),A.minf(U))},A.mfhd=function(U){return A.box(A.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},A.minf=function(U){return U.type==="audio"?A.box(A.types.minf,A.box(A.types.smhd,A.SMHD),A.DINF,A.stbl(U)):A.box(A.types.minf,A.box(A.types.vmhd,A.VMHD),A.DINF,A.stbl(U))},A.moof=function(U,S,L){return A.box(A.types.moof,A.mfhd(U),A.traf(L,S))},A.moov=function(U){for(var S=U.length,L=[];S--;)L[S]=A.trak(U[S]);return A.box.apply(null,[A.types.moov,A.mvhd(U[0].timescale,U[0].duration)].concat(L).concat(A.mvex(U)))},A.mvex=function(U){for(var S=U.length,L=[];S--;)L[S]=A.trex(U[S]);return A.box.apply(null,[A.types.mvex].concat(L))},A.mvhd=function(U,S){S*=U;var L=Math.floor(S/(W+1)),d=Math.floor(S%(W+1)),v=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,L>>24,L>>16&255,L>>8&255,L&255,d>>24,d>>16&255,d>>8&255,d&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 A.box(A.types.mvhd,v)},A.sdtp=function(U){var S=U.samples||[],L=new Uint8Array(4+S.length),d,v;for(d=0;d<S.length;d++)v=S[d].flags,L[d+4]=v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy;return A.box(A.types.sdtp,L)},A.stbl=function(U){return A.box(A.types.stbl,A.stsd(U),A.box(A.types.stts,A.STTS),A.box(A.types.stsc,A.STSC),A.box(A.types.stsz,A.STSZ),A.box(A.types.stco,A.STCO))},A.avc1=function(U){var S=[],L=[],d,v,C;for(d=0;d<U.sps.length;d++)v=U.sps[d],C=v.byteLength,S.push(C>>>8&255),S.push(C&255),S=S.concat(Array.prototype.slice.call(v));for(d=0;d<U.pps.length;d++)v=U.pps[d],C=v.byteLength,L.push(C>>>8&255),L.push(C&255),L=L.concat(Array.prototype.slice.call(v));var p=A.box(A.types.avcC,new Uint8Array([1,S[3],S[4],S[5],252|3,224|U.sps.length].concat(S).concat([U.pps.length]).concat(L))),h=U.width,f=U.height,n=U.pixelRatio[0],r=U.pixelRatio[1];return A.box(A.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,h>>8&255,h&255,f>>8&255,f&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]),p,A.box(A.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),A.box(A.types.pasp,new Uint8Array([n>>24,n>>16&255,n>>8&255,n&255,r>>24,r>>16&255,r>>8&255,r&255])))},A.esds=function(U){var S=U.config.length;return new Uint8Array([0,0,0,0,3,23+S,0,1,0,4,15+S,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([S]).concat(U.config).concat([6,1,2]))},A.mp4a=function(U){var S=U.samplerate;return A.box(A.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,S>>8&255,S&255,0,0]),A.box(A.types.esds,A.esds(U)))},A.mp3=function(U){var S=U.samplerate;return A.box(A.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,S>>8&255,S&255,0,0]))},A.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?A.box(A.types.stsd,A.STSD,A.mp3(U)):A.box(A.types.stsd,A.STSD,A.mp4a(U)):A.box(A.types.stsd,A.STSD,A.avc1(U))},A.tkhd=function(U){var S=U.id,L=U.duration*U.timescale,d=U.width,v=U.height,C=Math.floor(L/(W+1)),p=Math.floor(L%(W+1));return A.box(A.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,S>>24&255,S>>16&255,S>>8&255,S&255,0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,p>>24,p>>16&255,p>>8&255,p&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,d>>8&255,d&255,0,0,v>>8&255,v&255,0,0]))},A.traf=function(U,S){var L=A.sdtp(U),d=U.id,v=Math.floor(S/(W+1)),C=Math.floor(S%(W+1));return A.box(A.types.traf,A.box(A.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255])),A.box(A.types.tfdt,new Uint8Array([1,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,C>>24,C>>16&255,C>>8&255,C&255])),A.trun(U,L.length+16+20+8+16+8+8),L)},A.trak=function(U){return U.duration=U.duration||4294967295,A.box(A.types.trak,A.tkhd(U),A.mdia(U))},A.trex=function(U){var S=U.id;return A.box(A.types.trex,new Uint8Array([0,0,0,0,S>>24,S>>16&255,S>>8&255,S&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},A.trun=function(U,S){var L=U.samples||[],d=L.length,v=12+16*d,C=new Uint8Array(v),p,h,f,n,r,o;for(S+=8+v,C.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,d&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255],0),p=0;p<d;p++)h=L[p],f=h.duration,n=h.size,r=h.flags,o=h.cts,C.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,o>>>24&255,o>>>16&255,o>>>8&255,o&255],12+16*p);return A.box(A.types.trun,C)},A.initSegment=function(U){A.types||A.init();var S=A.moov(U),L=new Uint8Array(A.FTYP.byteLength+S.byteLength);return L.set(A.FTYP),L.set(S,A.FTYP.byteLength),L},A}();N.types=void 0,N.HDLR_TYPES=void 0,N.STTS=void 0,N.STSC=void 0,N.STCO=void 0,N.STSZ=void 0,N.VMHD=void 0,N.SMHD=void 0,N.STSD=void 0,N.FTYP=void 0,N.DINF=void 0,H.default=N},"./src/remux/mp4-remuxer.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return o}),M.d(H,"normalizePts",function(){return l});var W=M("./src/polyfills/number.ts"),N=M("./src/remux/aac-helper.ts"),A=M("./src/remux/mp4-generator.ts"),F=M("./src/events.ts"),U=M("./src/errors.ts"),S=M("./src/utils/logger.ts"),L=M("./src/types/loader.ts"),d=M("./src/utils/timescale-conversion.ts");function v(){return v=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(R[m]=g[m])}return R},v.apply(this,arguments)}var C=10*1e3,p=1024,h=1152,f=null,n=null,r=!1,o=function(){function R(g,m,s,u){if(u===void 0&&(u=""),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=g,this.config=m,this.typeSupported=s,this.ISGenerated=!1,f===null){var _=navigator.userAgent||"",T=_.match(/Chrome\/(\d+)/i);f=T?parseInt(T[1]):0}if(n===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);n=w?parseInt(w[1]):0}r=!!f&&f<75||!!n&&n<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(m){S.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=m},O.resetNextTimestamp=function(){S.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){S.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(m){var s=!1,u=m.reduce(function(_,T){var w=T.pts-_;return w<-4294967296?(s=!0,l(_,T.pts)):w>0?_:T.pts},m[0].pts);return s&&S.logger.debug("PTS rollover detected"),u},O.remux=function(m,s,u,_,T,w,P,j){var K,Z,G,B,$,ne,ae=T,fe=T,_e=m.pid>-1,Se=s.pid>-1,we=s.samples.length,Me=m.samples.length>0,Le=we>1,ge=(!_e||Me)&&(!Se||Le)||this.ISGenerated||P;if(ge){this.ISGenerated||(G=this.generateIS(m,s,T));var ue=this.isVideoContiguous,ke=-1;if(Le&&(ke=x(s.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,ke>0){S.logger.warn("[mp4-remuxer]: Dropped "+ke+" out of "+we+" video samples due to a missing keyframe");var lt=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(ke),s.dropped+=ke,fe+=(s.samples[0].pts-lt)/(s.timescale||9e4)}else ke===-1&&(S.logger.warn("[mp4-remuxer]: No keyframe found out of "+we+" video samples"),ne=!1);if(this.ISGenerated){if(Me&&Le){var ot=this.getVideoStartPts(s.samples),st=l(m.samples[0].pts,ot)-ot,ce=st/s.inputTimeScale;ae+=Math.max(0,ce),fe+=Math.max(0,-ce)}if(Me){if(m.samplerate||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),G=this.generateIS(m,s,T)),Z=this.remuxAudio(m,ae,this.isAudioContiguous,w,Se||Le||j===L.PlaylistLevelType.AUDIO?fe:void 0),Le){var pe=Z?Z.endPTS-Z.startPTS:0;s.inputTimeScale||(S.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),G=this.generateIS(m,s,T)),K=this.remuxVideo(s,fe,ue,pe)}}else Le&&(K=this.remuxVideo(s,fe,ue,0));K&&(K.firstKeyFrame=ke,K.independent=ke!==-1)}}return this.ISGenerated&&(u.samples.length&&($=this.remuxID3(u,T)),_.samples.length&&(B=this.remuxText(_,T))),{audio:Z,video:K,initSegment:G,independent:ne,text:B,id3:$}},O.generateIS=function(m,s,u){var _=m.samples,T=s.samples,w=this.typeSupported,P={},j=!Object(W.isFiniteNumber)(this._initPTS),K="audio/mp4",Z,G,B;if(j&&(Z=G=Infinity),m.config&&_.length&&(m.timescale=m.samplerate,m.isAAC||(w.mpeg?(K="audio/mpeg",m.codec=""):w.mp3&&(m.codec="mp3")),P.audio={id:"audio",container:K,codec:m.codec,initSegment:!m.isAAC&&w.mpeg?new Uint8Array(0):A.default.initSegment([m]),metadata:{channelCount:m.channelCount}},j&&(B=m.inputTimeScale,Z=G=_[0].pts-Math.round(B*u))),s.sps&&s.pps&&T.length&&(s.timescale=s.inputTimeScale,P.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:A.default.initSegment([s]),metadata:{width:s.width,height:s.height}},j)){B=s.inputTimeScale;var $=this.getVideoStartPts(T),ne=Math.round(B*u);G=Math.min(G,l(T[0].dts,$)-ne),Z=Math.min(Z,$-ne)}if(Object.keys(P).length)return this.ISGenerated=!0,j&&(this._initPTS=Z,this._initDTS=G),{tracks:P,initPTS:Z,timescale:B}},O.remuxVideo=function(m,s,u,_){var T=m.inputTimeScale,w=m.samples,P=[],j=w.length,K=this._initPTS,Z=this.nextAvcDts,G=8,B,$,ne,ae=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,_e=0,Se=!1;if(!u||Z===null){var we=s*T,Me=w[0].pts-l(w[0].dts,w[0].pts);Z=we-Me}for(var Le=0;Le<j;Le++){var ge=w[Le];if(ge.pts=l(ge.pts-K,Z),ge.dts=l(ge.dts-K,Z),ge.dts>ge.pts){var ue=9e4*.2;_e=Math.max(Math.min(_e,ge.pts-ge.dts),-1*ue)}ge.dts<w[Le>0?Le-1:Le].dts&&(Se=!0)}Se&&w.sort(function(ut,$e){var Ve=ut.dts-$e.dts,Ne=ut.pts-$e.pts;return Ve||Ne}),$=w[0].dts,ne=w[w.length-1].dts;var ke=Math.round((ne-$)/(j-1));if(_e<0){if(_e<ke*-2){S.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(d.toMsFromMpegTsClock)(-ke,!0)+" ms");for(var lt=_e,ot=0;ot<j;ot++)w[ot].dts=lt=Math.max(lt,w[ot].pts-ke),w[ot].pts=Math.max(lt,w[ot].pts)}else{S.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(d.toMsFromMpegTsClock)(_e,!0)+" ms to overcome this issue");for(var st=0;st<j;st++)w[st].dts=w[st].dts+_e}$=w[0].dts}if(u){var ce=$-Z,pe=ce>ke,Oe=ce<-1;if(pe||Oe){pe?S.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(ce,!0)+" ms ("+ce+"dts) hole between fragments detected, filling it"):S.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(-ce,!0)+" ms ("+ce+"dts) overlapping between fragments detected"),$=Z;var ze=w[0].pts-ce;w[0].dts=$,w[0].pts=ze,S.logger.log("Video: First PTS/DTS adjusted: "+Object(d.toMsFromMpegTsClock)(ze,!0)+"/"+Object(d.toMsFromMpegTsClock)($,!0)+", delta: "+Object(d.toMsFromMpegTsClock)(ce,!0)+" ms")}}r&&($=Math.max(0,$));for(var qe=0,Je=0,rt=0;rt<j;rt++){for(var tt=w[rt],Tt=tt.units,bt=Tt.length,Et=0,yt=0;yt<bt;yt++)Et+=Tt[yt].data.length;Je+=Et,qe+=bt,tt.length=Et,tt.dts=Math.max(tt.dts,$),tt.pts=Math.max(tt.pts,tt.dts,0),ae=Math.min(tt.pts,ae),fe=Math.max(tt.pts,fe)}ne=w[j-1].dts;var Ot=Je+4*qe+8,At;try{At=new Uint8Array(Ot)}catch(ut){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ot,reason:"fail allocating video mdat "+Ot});return}var Ae=new DataView(At.buffer);Ae.setUint32(0,Ot),At.set(A.default.types.mdat,4);for(var xe=0;xe<j;xe++){for(var Be=w[xe],Ze=Be.units,Pe=0,Xe=0,be=Ze.length;Xe<be;Xe++){var de=Ze[Xe],he=de.data,re=de.data.byteLength;Ae.setUint32(G,re),G+=4,At.set(he,G),G+=re,Pe+=4+re}if(xe<j-1)B=w[xe+1].dts-Be.dts;else{var ie=this.config,le=Be.dts-w[xe>0?xe-1:xe].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(ie.maxBufferHole*T),De=(_?ae+_*T:this.nextAudioPts)-Be.pts;De>me?(B=De-le,B<0&&(B=le),S.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+B/90+" ms for the last video frame.")):B=le}else B=le}var Te=Math.round(Be.pts-Be.dts);P.push(new E(Be.key,B,Pe,Te))}if(P.length&&f&&f<70){var Qe=P[0].flags;Qe.dependsOn=2,Qe.isNonSync=0}console.assert(B!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Z=ne+B,this.isVideoContiguous=!0;var ct=A.default.moof(m.sequenceNumber++,$,v({},m,{samples:P})),xt="video",ft={data1:ct,data2:At,startPTS:ae/T,endPTS:(fe+B)/T,startDTS:$/T,endDTS:Z/T,type:xt,hasAudio:!1,hasVideo:!0,nb:P.length,dropped:m.dropped};return m.samples=[],m.dropped=0,console.assert(At.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(m,s,u,_,T){var w=m.inputTimeScale,P=m.samplerate?m.samplerate:w,j=w/P,K=m.isAAC?p:h,Z=K*j,G=this._initPTS,B=!m.isAAC&&this.typeSupported.mpeg,$=[],ne=m.samples,ae=B?0:8,fe=this.nextAudioPts||-1,_e=s*w;if(this.isAudioContiguous=u=u||ne.length&&fe>0&&(_&&Math.abs(_e-fe)<9e3||Math.abs(l(ne[0].pts-G,_e)-fe)<20*Z),ne.forEach(function(he){he.pts=l(he.pts-G,_e)}),!u||fe<0){if(ne=ne.filter(function(he){return he.pts>=0}),!ne.length)return;T===0?fe=0:_?fe=Math.max(0,_e):fe=ne[0].pts}if(m.isAAC)for(var Se=T!==void 0,we=this.config.maxAudioFramesDrift,Me=0,Le=fe;Me<ne.length;Me++){var ge=ne[Me],ue=ge.pts,ke=ue-Le,lt=Math.abs(1e3*ke/w);if(ke<=-we*Z&&Se)Me===0&&(S.logger.warn("Audio frame @ "+(ue/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ke/w)+" ms."),this.nextAudioPts=fe=Le=ue);else if(ke>=we*Z&<<C&&Se){var ot=Math.round(ke/Z);Le=ue-ot*Z,Le<0&&(ot--,Le+=Z),Me===0&&(this.nextAudioPts=fe=Le),S.logger.warn("[mp4-remuxer]: Injecting "+ot+" audio frame @ "+(Le/w).toFixed(3)+"s due to "+Math.round(1e3*ke/w)+" ms gap.");for(var st=0;st<ot;st++){var ce=Math.max(Le,0),pe=N.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);pe||(S.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),pe=ge.unit.subarray()),ne.splice(Me,0,{unit:pe,pts:ce}),Le+=Z,Me++}}ge.pts=Le,Le+=Z}for(var Oe=null,ze=null,qe,Je=0,rt=ne.length;rt--;)Je+=ne[rt].unit.byteLength;for(var tt=0,Tt=ne.length;tt<Tt;tt++){var bt=ne[tt],Et=bt.unit,yt=bt.pts;if(ze!==null){var Ot=$[tt-1];Ot.duration=Math.round((yt-ze)/j)}else if(u&&m.isAAC&&(yt=fe),Oe=yt,Je>0){Je+=ae;try{qe=new Uint8Array(Je)}catch(he){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Je,reason:"fail allocating audio mdat "+Je});return}if(!B){var At=new DataView(qe.buffer);At.setUint32(0,Je),qe.set(A.default.types.mdat,4)}}else return;qe.set(Et,ae);var Ae=Et.byteLength;ae+=Ae,$.push(new E(!0,K,Ae,0)),ze=yt}var xe=$.length;if(!xe)return;var Be=$[$.length-1];this.nextAudioPts=fe=ze+j*Be.duration;var Ze=B?new Uint8Array(0):A.default.moof(m.sequenceNumber++,Oe/j,v({},m,{samples:$}));m.samples=[];var Pe=Oe/w,Xe=fe/w,be="audio",de={data1:Ze,data2:qe,startPTS:Pe,endPTS:Xe,startDTS:Pe,endDTS:Xe,type:be,hasAudio:!0,hasVideo:!1,nb:xe};return this.isAudioContiguous=!0,console.assert(qe.length,"MDAT length must not be zero"),de},O.remuxEmptyAudio=function(m,s,u,_){var T=m.inputTimeScale,w=m.samplerate?m.samplerate:T,P=T/w,j=this.nextAudioPts,K=(j!==null?j:_.startDTS*T)+this._initDTS,Z=_.endDTS*T+this._initDTS,G=P*p,B=Math.ceil((Z-K)/G),$=N.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);if(S.logger.warn("[mp4-remuxer]: remux empty Audio"),!$){S.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],ae=0;ae<B;ae++){var fe=K+ae*G;ne.push({unit:$,pts:fe,dts:fe})}return m.samples=ne,this.remuxAudio(m,s,u,!1)},O.remuxID3=function(m,s){var u=m.samples.length;if(!u)return;for(var _=m.inputTimeScale,T=this._initPTS,w=this._initDTS,P=0;P<u;P++){var j=m.samples[P];j.pts=l(j.pts-T,s*_)/_,j.dts=l(j.dts-w,s*_)/_}var K=m.samples;return m.samples=[],{samples:K}},O.remuxText=function(m,s){var u=m.samples.length;if(!u)return;for(var _=m.inputTimeScale,T=this._initPTS,w=0;w<u;w++){var P=m.samples[w];P.pts=l(P.pts-T,s*_)/_}m.samples.sort(function(K,Z){return K.pts-Z.pts});var j=m.samples;return m.samples=[],{samples:j}},R}();function l(R,O){var g;if(O===null)return R;for(O<R?g=-8589934592:g=8589934592;Math.abs(R-O)>4294967296;)R+=g;return R}function x(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var E=function(O,g,m,s){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=m,this.cts=s,this.flags=new y(O)},y=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/polyfills/number.ts"),N=M("./src/utils/mp4-tools.ts"),A=M("./src/loader/fragment.ts"),F=M("./src/utils/logger.ts"),U=function(){function d(){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 v=d.prototype;return v.destroy=function(){},v.resetTimeStamp=function(p){this.initPTS=p,this.lastEndDTS=null},v.resetNextTimestamp=function(){this.lastEndDTS=null},v.resetInitSegment=function(p,h,f){this.audioCodec=h,this.videoCodec=f,this.generateInitSegment(p),this.emitInitSegment=!0},v.generateInitSegment=function(p){var h=this.audioCodec,f=this.videoCodec;if(!p||!p.byteLength){this.initTracks=void 0,this.initData=void 0;return}var n=this.initData=Object(N.parseInitSegment)(p);h||(h=L(n.audio,A.ElementaryStreamTypes.AUDIO)),f||(f=L(n.video,A.ElementaryStreamTypes.VIDEO));var r={};n.audio&&n.video?r.audiovideo={container:"video/mp4",codec:h+","+f,initSegment:p,id:"main"}:n.audio?r.audio={container:"audio/mp4",codec:h,initSegment:p,id:"audio"}:n.video?r.video={container:"video/mp4",codec:f,initSegment:p,id:"main"}:F.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},v.remux=function(p,h,f,n,r){var o=this.initPTS,l=this.lastEndDTS,x={audio:void 0,video:void 0,text:n,id3:f,initSegment:void 0};Object(W.isFiniteNumber)(l)||(l=this.lastEndDTS=r||0);var E=h.samples;if(!E||!E.length)return x;var y={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(E),R=this.initData),!R||!R.length)return F.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),x;this.emitInitSegment&&(y.tracks=this.initTracks,this.emitInitSegment=!1),Object(W.isFiniteNumber)(o)||(this.initPTS=y.initPTS=o=S(R,E,l));var O=Object(N.getDuration)(E,R),g=l,m=O+g;Object(N.offsetStartDTS)(R,E,o),O>0?this.lastEndDTS=m:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!R.audio,u=!!R.video,_="";s&&(_+="audio"),u&&(_+="video");var T={data1:E,startPTS:g,startDTS:g,endPTS:m,endDTS:m,type:_,hasAudio:s,hasVideo:u,nb:1,dropped:0};return x.audio=T.type==="audio"?T:void 0,x.video=T.type!=="audio"?T:void 0,x.text=n,x.id3=f,x.initSegment=y,x},d}(),S=function(v,C,p){return Object(N.getStartDTS)(v,C)-p};function L(d,v){var C=d==null?void 0:d.codec;return C&&C.length>4?C:C==="hvc1"?"hvc1.1.c.L120.90":C==="av01"?"av01.0.04M.08":C==="avc1"||v===A.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=U},"./src/task-loop.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return W});var W=function(){function N(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var A=N.prototype;return A.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},A.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},A.onHandlerDestroyed=function(){},A.hasInterval=function(){return!!this._tickInterval},A.hasNextTick=function(){return!!this._tickTimer},A.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},A.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},A.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},A.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},A.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},A.doTick=function(){},N}()},"./src/types/cmcd.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"CMCDVersion",function(){return W}),M.d(H,"CMCDObjectType",function(){return N}),M.d(H,"CMCDStreamingFormat",function(){return A}),M.d(H,"CMCDStreamType",function(){return F});var W=1,N;(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"})(N||(N={}));var A;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(A||(A={}));var F;(function(U){U.VOD="v",U.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"HlsSkip",function(){return A}),M.d(H,"getSkipValue",function(){return F}),M.d(H,"HlsUrlParameters",function(){return U}),M.d(H,"Level",function(){return S});function W(L,d){for(var v=0;v<d.length;v++){var C=d[v];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(L,C.key,C)}}function N(L,d,v){return d&&W(L.prototype,d),v&&W(L,v),L}var A;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(A||(A={}));function F(L,d){var v=L.canSkipUntil,C=L.canSkipDateRanges,p=L.endSN,h=d!==void 0?d-p:0;return v&&h<v?C?A.v2:A.Yes:A.No}var U=function(){function L(v,C,p){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=C,this.skip=p}var d=L.prototype;return d.addDirectives=function(C){var p=new self.URL(C);return this.msn!==void 0&&p.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&p.searchParams.set("_HLS_part",this.part.toString()),this.skip&&p.searchParams.set("_HLS_skip",this.skip),p.toString()},L}(),S=function(){function L(d){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=[d.url],this.attrs=d.attrs,this.bitrate=d.bitrate,d.details&&(this.details=d.details),this.id=d.id||0,this.name=d.name,this.width=d.width||0,this.height=d.height||0,this.audioCodec=d.audioCodec,this.videoCodec=d.videoCodec,this.unknownCodecs=d.unknownCodecs,this.codecSet=[d.videoCodec,d.audioCodec].filter(function(v){return v}).join(",").replace(/\.[^.,]+/g,"")}return N(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(v){var C=v%this.url.length;this._urlId!==C&&(this.details=void 0,this._urlId=C)}}]),L}()},"./src/types/loader.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"PlaylistContextType",function(){return W}),M.d(H,"PlaylistLevelType",function(){return N});var W;(function(A){A.MANIFEST="manifest",A.LEVEL="level",A.AUDIO_TRACK="audioTrack",A.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var N;(function(A){A.MAIN="main",A.AUDIO="audio",A.SUBTITLE="subtitle"})(N||(N={}))},"./src/types/transmuxer.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"ChunkMetadata",function(){return W});var W=function(F,U,S,L,d,v){L===void 0&&(L=0),d===void 0&&(d=-1),v===void 0&&(v=!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=N(),this.buffering={audio:N(),video:N(),audiovideo:N()},this.level=F,this.sn=U,this.id=S,this.size=L,this.part=d,this.partial=v};function N(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"AttrList",function(){return A});var W=/^(\d+)x(\d+)$/,N=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,A=function(){function F(S){typeof S=="string"&&(S=F.parseAttrList(S));for(var L in S)S.hasOwnProperty(L)&&(this[L]=S[L])}var U=F.prototype;return U.decimalInteger=function(L){var d=parseInt(this[L],10);return d>Number.MAX_SAFE_INTEGER?Infinity:d},U.hexadecimalInteger=function(L){if(this[L]){var d=(this[L]||"0x").slice(2);d=(d.length&1?"0":"")+d;for(var v=new Uint8Array(d.length/2),C=0;C<d.length/2;C++)v[C]=parseInt(d.slice(C*2,C*2+2),16);return v}else return null},U.hexadecimalIntegerAsNumber=function(L){var d=parseInt(this[L],16);return d>Number.MAX_SAFE_INTEGER?Infinity:d},U.decimalFloatingPoint=function(L){return parseFloat(this[L])},U.optionalFloat=function(L,d){var v=this[L];return v?parseFloat(v):d},U.enumeratedString=function(L){return this[L]},U.bool=function(L){return this[L]==="YES"},U.decimalResolution=function(L){var d=W.exec(this[L]);return d===null?void 0:{width:parseInt(d[1],10),height:parseInt(d[2],10)}},F.parseAttrList=function(L){var d,v={},C='"';for(N.lastIndex=0;(d=N.exec(L))!==null;){var p=d[2];p.indexOf(C)===0&&p.lastIndexOf(C)===p.length-1&&(p=p.slice(1,-1)),v[d[1]]=p}return v},F}()},"./src/utils/binary-search.ts":function(Q,H,M){"use strict";M.r(H);var W={search:function(A,F){for(var U=0,S=A.length-1,L=null,d=null;U<=S;){L=(U+S)/2|0,d=A[L];var v=F(d);if(v>0)U=L+1;else if(v<0)S=L-1;else return d}return null}};H.default=W},"./src/utils/buffer-helper.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"BufferHelper",function(){return A});var W=M("./src/utils/logger.ts"),N={length:0,start:function(){return 0},end:function(){return 0}},A=function(){function F(){}return F.isBuffered=function(S,L){try{if(S){for(var d=F.getBuffered(S),v=0;v<d.length;v++)if(L>=d.start(v)&&L<=d.end(v))return!0}}catch(C){}return!1},F.bufferInfo=function(S,L,d){try{if(S){var v=F.getBuffered(S),C=[],p;for(p=0;p<v.length;p++)C.push({start:v.start(p),end:v.end(p)});return this.bufferedInfo(C,L,d)}}catch(h){}return{len:0,start:L,end:L,nextStart:void 0}},F.bufferedInfo=function(S,L,d){L=Math.max(0,L),S.sort(function(y,R){var O=y.start-R.start;return O||R.end-y.end});var v=[];if(d)for(var C=0;C<S.length;C++){var p=v.length;if(p){var h=v[p-1].end;S[C].start-h<d?S[C].end>h&&(v[p-1].end=S[C].end):v.push(S[C])}else v.push(S[C])}else v=S;for(var f=0,n,r=L,o=L,l=0;l<v.length;l++){var x=v[l].start,E=v[l].end;if(L+d>=x&&L<E)r=x,o=E,f=o-L;else if(L+d<x){n=x;break}}return{len:f,start:r||0,end:o||0,nextStart:n}},F.getBuffered=function(S){try{return S.buffered}catch(L){return W.logger.log("failed to get media.buffered",L),N}},F}()},"./src/utils/cea-608-parser.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"Row",function(){return o}),M.d(H,"CaptionScreen",function(){return l});var W=M("./src/utils/logger.ts"),N={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},A=function(m){var s=m;return N.hasOwnProperty(m)&&(s=N[m]),String.fromCharCode(s)},F=15,U=100,S={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},v={25:2,26:4,29:6,30:8,31:10,27:13,28:15},C=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],p;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(p||(p={}));var h=function(){function g(){this.time=null,this.verboseLevel=p.ERROR}var m=g.prototype;return m.log=function(u,_){this.verboseLevel>=u&&W.logger.log(this.time+" ["+u+"] "+_)},g}(),f=function(m){for(var s=[],u=0;u<m.length;u++)s.push(m[u].toString(16));return s},n=function(){function g(s,u,_,T,w){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=u||!1,this.italics=_||!1,this.background=T||"black",this.flash=w||!1}var m=g.prototype;return m.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},m.setStyles=function(u){for(var _=["foreground","underline","italics","background","flash"],T=0;T<_.length;T++){var w=_[T];u.hasOwnProperty(w)&&(this[w]=u[w])}},m.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},m.equals=function(u){return this.foreground===u.foreground&&this.underline===u.underline&&this.italics===u.italics&&this.background===u.background&&this.flash===u.flash},m.copy=function(u){this.foreground=u.foreground,this.underline=u.underline,this.italics=u.italics,this.background=u.background,this.flash=u.flash},m.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),r=function(){function g(s,u,_,T,w,P){this.uchar=void 0,this.penState=void 0,this.uchar=s||" ",this.penState=new n(u,_,T,w,P)}var m=g.prototype;return m.reset=function(){this.uchar=" ",this.penState.reset()},m.setChar=function(u,_){this.uchar=u,this.penState.copy(_)},m.setPenState=function(u){this.penState.copy(u)},m.equals=function(u){return this.uchar===u.uchar&&this.penState.equals(u.penState)},m.copy=function(u){this.uchar=u.uchar,this.penState.copy(u.penState)},m.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),o=function(){function g(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 u=0;u<U;u++)this.chars.push(new r);this.logger=s,this.pos=0,this.currPenState=new n}var m=g.prototype;return m.equals=function(u){for(var _=!0,T=0;T<U;T++)if(!this.chars[T].equals(u.chars[T])){_=!1;break}return _},m.copy=function(u){for(var _=0;_<U;_++)this.chars[_].copy(u.chars[_])},m.isEmpty=function(){for(var u=!0,_=0;_<U;_++)if(!this.chars[_].isEmpty()){u=!1;break}return u},m.setCursor=function(u){this.pos!==u&&(this.pos=u),this.pos<0?(this.logger.log(p.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},m.moveCursor=function(u){var _=this.pos+u;if(u>1)for(var T=this.pos+1;T<_+1;T++)this.chars[T].setPenState(this.currPenState);this.setCursor(_)},m.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},m.insertChar=function(u){u>=144&&this.backSpace();var _=A(u);if(this.pos>=U){this.logger.log(p.ERROR,"Cannot insert "+u.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},m.clearFromPos=function(u){var _;for(_=u;_<U;_++)this.chars[_].reset()},m.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},m.clearToEndOfRow=function(){this.clearFromPos(this.pos)},m.getTextString=function(){for(var u=[],_=!0,T=0;T<U;T++){var w=this.chars[T].uchar;w!==" "&&(_=!1),u.push(w)}return _?"":u.join("")},m.setPenStyles=function(u){this.currPenState.setStyles(u);var _=this.chars[this.pos];_.setPenState(this.currPenState)},g}(),l=function(){function g(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 u=0;u<F;u++)this.rows.push(new o(s));this.logger=s,this.currRow=F-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var m=g.prototype;return m.reset=function(){for(var u=0;u<F;u++)this.rows[u].clear();this.currRow=F-1},m.equals=function(u){for(var _=!0,T=0;T<F;T++)if(!this.rows[T].equals(u.rows[T])){_=!1;break}return _},m.copy=function(u){for(var _=0;_<F;_++)this.rows[_].copy(u.rows[_])},m.isEmpty=function(){for(var u=!0,_=0;_<F;_++)if(!this.rows[_].isEmpty()){u=!1;break}return u},m.backSpace=function(){var u=this.rows[this.currRow];u.backSpace()},m.clearToEndOfRow=function(){var u=this.rows[this.currRow];u.clearToEndOfRow()},m.insertChar=function(u){var _=this.rows[this.currRow];_.insertChar(u)},m.setPen=function(u){var _=this.rows[this.currRow];_.setPenStyles(u)},m.moveCursor=function(u){var _=this.rows[this.currRow];_.moveCursor(u)},m.setCursor=function(u){this.logger.log(p.INFO,"setCursor: "+u);var _=this.rows[this.currRow];_.setCursor(u)},m.setPAC=function(u){this.logger.log(p.INFO,"pacData = "+JSON.stringify(u));var _=u.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var T=0;T<F;T++)this.rows[T].clear();var w=this.currRow+1-this.nrRollUpRows,P=this.lastOutputScreen;if(P){var j=P.rows[w].cueStartTime,K=this.logger.time;if(j&&K!==null&&j<K)for(var Z=0;Z<this.nrRollUpRows;Z++)this.rows[_-this.nrRollUpRows+Z+1].copy(P.rows[w+Z])}}this.currRow=_;var G=this.rows[this.currRow];if(u.indent!==null){var B=u.indent,$=Math.max(B-1,0);G.setCursor(u.indent),u.color=G.chars[$].penState.foreground}var ne={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen(ne)},m.setBkgData=function(u){this.logger.log(p.INFO,"bkgData = "+JSON.stringify(u)),this.backSpace(),this.setPen(u),this.insertChar(32)},m.setRollUpRows=function(u){this.nrRollUpRows=u},m.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(p.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(p.TEXT,this.getDisplayText());var u=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(u,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(p.INFO,"Rolling up")},m.getDisplayText=function(u){u=u||!1;for(var _=[],T="",w=-1,P=0;P<F;P++){var j=this.rows[P].getTextString();j&&(w=P+1,u?_.push("Row "+w+": '"+j+"'"):_.push(j.trim()))}return _.length>0&&(u?T="["+_.join(" | ")+"]":T=_.join(`
|
|
`)),T},m.getTextAndFormat=function(){return this.rows},g}(),x=function(){function g(s,u,_){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=u,this.mode=null,this.verbose=0,this.displayedMemory=new l(_),this.nonDisplayedMemory=new l(_),this.lastOutputScreen=new l(_),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var m=g.prototype;return m.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},m.getHandler=function(){return this.outputFilter},m.setHandler=function(u){this.outputFilter=u},m.setPAC=function(u){this.writeScreen.setPAC(u)},m.setBkgData=function(u){this.writeScreen.setBkgData(u)},m.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(p.INFO,"MODE="+u),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=u},m.insertChars=function(u){for(var _=0;_<u.length;_++)this.writeScreen.insertChar(u[_]);var T=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(p.INFO,T+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(p.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},m.ccRCL=function(){this.logger.log(p.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},m.ccBS=function(){if(this.logger.log(p.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},m.ccAOF=function(){},m.ccAON=function(){},m.ccDER=function(){this.logger.log(p.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},m.ccRU=function(u){this.logger.log(p.INFO,"RU("+u+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(u)},m.ccFON=function(){this.logger.log(p.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},m.ccRDC=function(){this.logger.log(p.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},m.ccTR=function(){this.logger.log(p.INFO,"TR"),this.setMode("MODE_TEXT")},m.ccRTD=function(){this.logger.log(p.INFO,"RTD"),this.setMode("MODE_TEXT")},m.ccEDM=function(){this.logger.log(p.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},m.ccCR=function(){this.logger.log(p.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},m.ccENM=function(){this.logger.log(p.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},m.ccEOC=function(){if(this.logger.log(p.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var u=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=u,this.writeScreen=this.nonDisplayedMemory,this.logger.log(p.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},m.ccTO=function(u){this.logger.log(p.INFO,"TO("+u+") - Tab Offset"),this.writeScreen.moveCursor(u)},m.ccMIDROW=function(u){var _={flash:!1};if(_.underline=u%2===1,_.italics=u>=46,_.italics)_.foreground="white";else{var T=Math.floor(u/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=w[T]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},m.outputDataUpdate=function(u){u===void 0&&(u=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},m.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},g}(),E=function(){function g(s,u,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var T=new h;this.channels=[null,new x(s,u,T),new x(s+1,_,T)],this.cmdHistory=O(),this.logger=T}var m=g.prototype;return m.getHandler=function(u){return this.channels[u].getHandler()},m.setHandler=function(u,_){this.channels[u].setHandler(_)},m.addData=function(u,_){var T,w,P,j=!1;this.logger.time=u;for(var K=0;K<_.length;K+=2){if(w=_[K]&127,P=_[K+1]&127,w===0&&P===0)continue;if(this.logger.log(p.DATA,"["+f([_[K],_[K+1]])+"] -> ("+f([w,P])+")"),T=this.parseCmd(w,P),T||(T=this.parseMidrow(w,P)),T||(T=this.parsePAC(w,P)),T||(T=this.parseBackgroundAttributes(w,P)),!T&&(j=this.parseChars(w,P),j)){var Z=this.currentChannel;if(Z&&Z>0){var G=this.channels[Z];G.insertChars(j)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!T&&!j&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+f([w,P])+" orig: "+f([_[K],_[K+1]]))}},m.parseCmd=function(u,_){var T=this.cmdHistory,w=(u===20||u===28||u===21||u===29)&&_>=32&&_<=47,P=(u===23||u===31)&&_>=33&&_<=35;if(!(w||P))return!1;if(R(u,_,T))return y(null,null,T),this.logger.log(p.DEBUG,"Repeated command ("+f([u,_])+") is dropped"),!0;var j=u===20||u===21||u===23?1:2,K=this.channels[j];return u===20||u===21||u===28||u===29?_===32?K.ccRCL():_===33?K.ccBS():_===34?K.ccAOF():_===35?K.ccAON():_===36?K.ccDER():_===37?K.ccRU(2):_===38?K.ccRU(3):_===39?K.ccRU(4):_===40?K.ccFON():_===41?K.ccRDC():_===42?K.ccTR():_===43?K.ccRTD():_===44?K.ccEDM():_===45?K.ccCR():_===46?K.ccENM():_===47&&K.ccEOC():K.ccTO(_-32),y(u,_,T),this.currentChannel=j,!0},m.parseMidrow=function(u,_){var T=0;if((u===17||u===25)&&_>=32&&_<=47){if(u===17?T=1:T=2,T!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[T];return w?(w.ccMIDROW(_),this.logger.log(p.DEBUG,"MIDROW ("+f([u,_])+")"),!0):!1}return!1},m.parsePAC=function(u,_){var T,w=this.cmdHistory,P=(u>=17&&u<=23||u>=25&&u<=31)&&_>=64&&_<=127,j=(u===16||u===24)&&_>=64&&_<=95;if(!(P||j))return!1;if(R(u,_,w))return y(null,null,w),!0;var K=u<=23?1:2;_>=64&&_<=95?T=K===1?S[u]:d[u]:T=K===1?L[u]:v[u];var Z=this.channels[K];return Z?(Z.setPAC(this.interpretPAC(T,_)),y(u,_,w),this.currentChannel=K,!0):!1},m.interpretPAC=function(u,_){var T,w={color:null,italics:!1,indent:null,underline:!1,row:u};return _>95?T=_-96:T=_-64,w.underline=(T&1)===1,T<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(T/2)]:T<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((T-16)/2)*4,w},m.parseChars=function(u,_){var T,w=null,P=null;if(u>=25?(T=2,P=u-8):(T=1,P=u),P>=17&&P<=19){var j;P===17?j=_+80:P===18?j=_+112:j=_+144,this.logger.log(p.INFO,"Special char '"+A(j)+"' in channel "+T),w=[j]}else u>=32&&u<=127&&(w=_===0?[u]:[u,_]);if(w){var K=f(w);this.logger.log(p.DEBUG,"Char codes = "+K.join(",")),y(u,_,this.cmdHistory)}return w},m.parseBackgroundAttributes=function(u,_){var T=(u===16||u===24)&&_>=32&&_<=47,w=(u===23||u===31)&&_>=45&&_<=47;if(!(T||w))return!1;var P,j={};u===16||u===24?(P=Math.floor((_-32)/2),j.background=C[P],_%2===1&&(j.background=j.background+"_semi")):_===45?j.background="transparent":(j.foreground="black",_===47&&(j.underline=!0));var K=u<=23?1:2,Z=this.channels[K];return Z.setBkgData(j),y(u,_,this.cmdHistory),!0},m.reset=function(){for(var u=0;u<Object.keys(this.channels).length;u++){var _=this.channels[u];_&&_.reset()}this.cmdHistory=O()},m.cueSplitAtTime=function(u){for(var _=0;_<this.channels.length;_++){var T=this.channels[_];T&&T.cueSplitAtTime(u)}},g}();function y(g,m,s){s.a=g,s.b=m}function R(g,m,s){return s.a===g&&s.b===m}function O(){return{a:null,b:null}}H.default=E},"./src/utils/codecs.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"isCodecType",function(){return N}),M.d(H,"isCodecSupportedInMp4",function(){return A});var W={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 N(F,U){var S=W[U];return!!S&&S[F.slice(0,4)]===!0}function A(F,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+F+'"')}},"./src/utils/cues.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/utils/vttparser.ts"),N=M("./src/utils/webvtt-parser.ts"),A=M("./src/utils/texttrack-utils.ts"),F=/\s/,U={newCue:function(L,d,v,C){for(var p=[],h,f,n,r,o,l=self.VTTCue||self.TextTrackCue,x=0;x<C.rows.length;x++)if(h=C.rows[x],n=!0,r=0,o="",!h.isEmpty()){for(var E=0;E<h.chars.length;E++)F.test(h.chars[E].uchar)&&n?r++:(o+=h.chars[E].uchar,n=!1);h.cueStartTime=d,d===v&&(v+=1e-4),r>=16?r--:r++;var y=Object(W.fixLineBreaks)(o.trim()),R=Object(N.generateCueId)(d,v,y);(!L||!L.cues||!L.cues.getCueById(R))&&(f=new l(d,v,y),f.id=R,f.line=x+1,f.align="left",f.position=10+Math.min(80,Math.floor(r*8/32)*10),p.push(f))}return L&&p.length&&(p.sort(function(O,g){return O.line==="auto"||g.line==="auto"?0:O.line>8&&g.line>8?g.line-O.line:O.line-g.line}),p.forEach(function(O){return Object(A.addCueToTrack)(L,O)})),p}};H.default=U},"./src/utils/discontinuities.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"findFirstFragWithCC",function(){return F}),M.d(H,"shouldAlignOnDiscontinuities",function(){return U}),M.d(H,"findDiscontinuousReferenceFrag",function(){return S}),M.d(H,"adjustSlidingStart",function(){return d}),M.d(H,"alignStream",function(){return v}),M.d(H,"alignPDT",function(){return p}),M.d(H,"alignFragmentByPDTDelta",function(){return h}),M.d(H,"alignMediaPlaylistByPDT",function(){return f});var W=M("./src/polyfills/number.ts"),N=M("./src/utils/logger.ts"),A=M("./src/controller/level-helper.ts");function F(n,r){for(var o=null,l=0,x=n.length;l<x;l++){var E=n[l];if(E&&E.cc===r){o=E;break}}return o}function U(n,r,o){return!!(r.details&&(o.endCC>o.startCC||n&&n.cc<o.startCC))}function S(n,r){var o=n.fragments,l=r.fragments;if(!l.length||!o.length){N.logger.log("No fragments to align");return}var x=F(o,l[0].cc);if(!x||x&&!x.startPTS){N.logger.log("No frag in previous level to align on");return}return x}function L(n,r){if(n){var o=n.start+r;n.start=n.startPTS=o,n.endPTS=o+n.duration}}function d(n,r){for(var o=r.fragments,l=0,x=o.length;l<x;l++)L(o[l],n);r.fragmentHint&&L(r.fragmentHint,n),r.alignedSliding=!0}function v(n,r,o){if(!r)return;C(n,o,r),!o.alignedSliding&&r.details&&p(o,r.details),!o.alignedSliding&&r.details&&!o.skippedSegments&&Object(A.adjustSliding)(r.details,o)}function C(n,r,o){if(U(n,o,r)){var l=S(o.details,r);l&&Object(W.isFiniteNumber)(l.start)&&(N.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),d(l.start,r))}}function p(n,r){if(!r.fragments.length||!n.hasProgramDateTime||!r.hasProgramDateTime)return;var o=r.fragments[0].programDateTime,l=n.fragments[0].programDateTime,x=(l-o)/1e3+r.fragments[0].start;x&&Object(W.isFiniteNumber)(x)&&(N.logger.log("Adjusting PTS using programDateTime delta "+(l-o)+"ms, sliding:"+x.toFixed(3)+" "+n.url+" "),d(x,n))}function h(n,r){var o=n.programDateTime;if(!o)return;var l=(o-r)/1e3;n.start=n.startPTS=l,n.endPTS=l+n.duration}function f(n,r){if(!r.fragments.length||!n.hasProgramDateTime||!r.hasProgramDateTime)return;var o=r.fragments[0].programDateTime,l=r.fragments[0].start,x=o-l*1e3;n.fragments.forEach(function(E){h(E,x)}),n.fragmentHint&&h(n.fragmentHint,x),n.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/utils/ewma.ts"),N=function(){function A(U,S,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new W.default(U),this.fast_=new W.default(S)}var F=A.prototype;return F.update=function(S,L){var d=this.slow_,v=this.fast_;this.slow_.halfLife!==S&&(this.slow_=new W.default(S,d.getEstimate(),d.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new W.default(L,v.getEstimate(),v.getTotalWeight()))},F.sample=function(S,L){S=Math.max(S,this.minDelayMs_);var d=8*L,v=S/1e3,C=d/v;this.fast_.sample(v,C),this.slow_.sample(v,C)},F.canEstimate=function(){var S=this.fast_;return S&&S.getTotalWeight()>=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},A}();H.default=N},"./src/utils/ewma.ts":function(Q,H,M){"use strict";M.r(H);var W=function(){function N(F,U,S){U===void 0&&(U=0),S===void 0&&(S=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=U,this.totalWeight_=S}var A=N.prototype;return A.sample=function(U,S){var L=Math.pow(this.alpha_,U);this.estimate_=S*(1-L)+L*this.estimate_,this.totalWeight_+=U},A.getTotalWeight=function(){return this.totalWeight_},A.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},N}();H.default=W},"./src/utils/fetch-loader.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"fetchSupported",function(){return h});var W=M("./src/polyfills/number.ts"),N=M("./src/loader/load-stats.ts"),A=M("./src/demux/chunk-cache.ts");function F(l,x){l.prototype=Object.create(x.prototype),l.prototype.constructor=l,v(l,x)}function U(l){var x=typeof Map=="function"?new Map:void 0;return U=function(y){if(y===null||!d(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x!="undefined"){if(x.has(y))return x.get(y);x.set(y,R)}function R(){return S(y,arguments,C(this).constructor)}return R.prototype=Object.create(y.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),v(R,y)},U(l)}function S(l,x,E){return L()?S=Reflect.construct:S=function(R,O,g){var m=[null];m.push.apply(m,O);var s=Function.bind.apply(R,m),u=new s;return g&&v(u,g.prototype),u},S.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function d(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function v(l,x){return v=Object.setPrototypeOf||function(y,R){return y.__proto__=R,y},v(l,x)}function C(l){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},C(l)}function p(){return p=Object.assign||function(l){for(var x=1;x<arguments.length;x++){var E=arguments[x];for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(l[y]=E[y])}return l},p.apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(l){}return!1}var f=function(){function l(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||r,this.controller=new self.AbortController,this.stats=new N.LoadStats}var x=l.prototype;return x.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},x.abortInternal=function(){var y=this.response;(!y||!y.ok)&&(this.stats.aborted=!0,this.controller.abort())},x.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},x.load=function(y,R,O){var g=this,m=this.stats;if(m.loading.start)throw new Error("Loader can only be used once.");m.loading.start=self.performance.now();var s=n(y,this.controller.signal),u=O.onProgress,_=y.responseType==="arraybuffer",T=_?"byteLength":"length";this.context=y,this.config=R,this.callbacks=O,this.request=this.fetchSetup(y,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),O.onTimeout(m,y,g.response)},R.timeout),self.fetch(this.request).then(function(w){if(g.response=g.loader=w,!w.ok){var P=w.status,j=w.statusText;throw new o(j||"fetch, bad network response",P,w)}return m.loading.first=Math.max(self.performance.now(),m.loading.start),m.total=parseInt(w.headers.get("Content-Length")||"0"),u&&Object(W.isFiniteNumber)(R.highWaterMark)?g.loadProgressively(w,m,y,R.highWaterMark,u):_?w.arrayBuffer():w.text()}).then(function(w){var P=g.response;self.clearTimeout(g.requestTimeout),m.loading.end=Math.max(self.performance.now(),m.loading.first),m.loaded=m.total=w[T];var j={url:P.url,data:w};u&&!Object(W.isFiniteNumber)(R.highWaterMark)&&u(m,y,w,P),O.onSuccess(j,m,y,P)}).catch(function(w){if(self.clearTimeout(g.requestTimeout),m.aborted)return;var P=w.code||0;O.onError({code:P,text:w.message},y,w.details)})},x.getCacheAge=function(){var y=null;if(this.response){var R=this.response.headers.get("age");y=R?parseFloat(R):null}return y},x.loadProgressively=function(y,R,O,g,m){g===void 0&&(g=0);var s=new A.default,u=y.body.getReader(),_=function T(){return u.read().then(function(w){if(w.done)return s.dataLength&&m(R,O,s.flush(),y),Promise.resolve(new ArrayBuffer(0));var P=w.value,j=P.length;return R.loaded+=j,j<g||s.dataLength?(s.push(P),s.dataLength>=g&&m(R,O,s.flush(),y)):m(R,O,P,y),T()}).catch(function(){return Promise.reject()})};return _()},l}();function n(l,x){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:x,headers:new self.Headers(p({},l.headers))};return l.rangeEnd&&E.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),E}function r(l,x){return new self.Request(l.url,x)}var o=function(l){F(x,l);function x(E,y,R){var O;return O=l.call(this,E)||this,O.code=void 0,O.details=void 0,O.code=y,O.details=R,O}return x}(U(Error));H.default=f},"./src/utils/imsc1-ttml-parser.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"IMSC1_CODEC",function(){return d}),M.d(H,"parseIMSC1",function(){return h});var W=M("./src/utils/mp4-tools.ts"),N=M("./src/utils/vttparser.ts"),A=M("./src/utils/vttcue.ts"),F=M("./src/demux/id3.ts"),U=M("./src/utils/timescale-conversion.ts"),S=M("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var s=arguments[m];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(g[u]=s[u])}return g},L.apply(this,arguments)}var d="stpp.ttml.im1t",v=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,C=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,p={left:"start",center:"center",right:"end",start:"start",end:"end"};function h(g,m,s,u,_){var T=Object(W.findBox)(new Uint8Array(g),["mdat"]);if(T.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var w=T[0],P=Object(F.utf8ArrayToStr)(new Uint8Array(g,w.start,w.end-w.start)),j=Object(U.toTimescaleFromScale)(m,1,s);try{u(f(P,j))}catch(K){_(K)}}function f(g,m){var s=new DOMParser,u=s.parseFromString(g,"text/xml"),_=u.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var T={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(T).reduce(function(G,B){return G[B]=_.getAttribute("ttp:"+B)||T[B],G},{}),P=_.getAttribute("xml:space")!=="preserve",j=r(n(_,"styling","style")),K=r(n(_,"layout","region")),Z=n(_,"body","[begin]");return[].map.call(Z,function(G){var B=o(G,P);if(!B||!G.hasAttribute("begin"))return null;var $=y(G.getAttribute("begin"),w),ne=y(G.getAttribute("dur"),w),ae=y(G.getAttribute("end"),w);if($===null)throw E(G);if(ae===null){if(ne===null)throw E(G);ae=$+ne}var fe=new A.default($-m,ae-m,B);fe.id=Object(S.generateCueId)(fe.startTime,fe.endTime,fe.text);var _e=K[G.getAttribute("region")],Se=j[G.getAttribute("style")];fe.position=10,fe.size=80;var we=l(_e,Se),Me=we.textAlign;if(Me){var Le=p[Me];Le&&(fe.lineAlign=Le),fe.align=Me}return L(fe,we),fe}).filter(function(G){return G!==null})}function n(g,m,s){var u=g.getElementsByTagName(m)[0];return u?[].slice.call(u.querySelectorAll(s)):[]}function r(g){return g.reduce(function(m,s){var u=s.getAttribute("xml:id");return u&&(m[u]=s),m},{})}function o(g,m){return[].slice.call(g.childNodes).reduce(function(s,u,_){var T;return u.nodeName==="br"&&_?s+`
|
|
`:(T=u.childNodes)!==null&&T!==void 0&&T.length?o(u,m):m?s+u.textContent.trim().replace(/\s+/g," "):s+u.textContent},"")}function l(g,m){var s="http://www.w3.org/ns/ttml#styling",u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return u.reduce(function(_,T){var w=x(m,s,T)||x(g,s,T);return w&&(_[T]=w),_},{})}function x(g,m,s){return g.hasAttributeNS(m,s)?g.getAttributeNS(m,s):null}function E(g){return new Error("Could not parse ttml timestamp "+g)}function y(g,m){if(!g)return null;var s=Object(N.parseTimeStamp)(g);return s===null&&(v.test(g)?s=R(g,m):C.test(g)&&(s=O(g,m))),s}function R(g,m){var s=v.exec(g),u=(s[4]|0)+(s[5]|0)/m.subFrameRate;return(s[1]|0)*3600+(s[2]|0)*60+(s[3]|0)+u/m.frameRate}function O(g,m){var s=C.exec(g),u=Number(s[1]),_=s[2];switch(_){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/m.frameRate;case"t":return u/m.tickRate}return u}},"./src/utils/logger.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"enableLogs",function(){return S}),M.d(H,"logger",function(){return L});var W=function(){},N={trace:W,debug:W,log:W,warn:W,info:W,error:W},A=N;function F(d){var v=self.console[d];return v?v.bind(self.console,"["+d+"] >"):W}function U(d){for(var v=arguments.length,C=new Array(v>1?v-1:0),p=1;p<v;p++)C[p-1]=arguments[p];C.forEach(function(h){A[h]=d[h]?d[h].bind(d):F(h)})}function S(d){if(self.console&&d===!0||typeof d=="object"){U(d,"debug","log","info","warn","error");try{A.log()}catch(v){A=N}}else A=N}var L=A},"./src/utils/mediakeys-helper.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"KeySystems",function(){return W}),M.d(H,"requestMediaKeySystemAccess",function(){return N});var W;(function(A){A.WIDEVINE="com.widevine.alpha",A.PLAYREADY="com.microsoft.playready"})(W||(W={}));var N=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"getMediaSource",function(){return W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"bin2str",function(){return U}),M.d(H,"readUint16",function(){return S}),M.d(H,"readUint32",function(){return L}),M.d(H,"writeUint32",function(){return d}),M.d(H,"findBox",function(){return v}),M.d(H,"parseSegmentIndex",function(){return C}),M.d(H,"parseInitSegment",function(){return p}),M.d(H,"getStartDTS",function(){return h}),M.d(H,"getDuration",function(){return f}),M.d(H,"computeRawDurationFromSamples",function(){return n}),M.d(H,"offsetStartDTS",function(){return r}),M.d(H,"segmentValidRange",function(){return o}),M.d(H,"appendUint8Array",function(){return l});var W=M("./src/utils/typed-array.ts"),N=M("./src/loader/fragment.ts"),A=Math.pow(2,32)-1,F=[].push;function U(x){return String.fromCharCode.apply(null,x)}function S(x,E){"data"in x&&(E+=x.start,x=x.data);var y=x[E]<<8|x[E+1];return y<0?65536+y:y}function L(x,E){"data"in x&&(E+=x.start,x=x.data);var y=x[E]<<24|x[E+1]<<16|x[E+2]<<8|x[E+3];return y<0?4294967296+y:y}function d(x,E,y){"data"in x&&(E+=x.start,x=x.data),x[E]=y>>24,x[E+1]=y>>16&255,x[E+2]=y>>8&255,x[E+3]=y&255}function v(x,E){var y=[];if(!E.length)return y;var R,O,g;"data"in x?(R=x.data,O=x.start,g=x.end):(R=x,O=0,g=R.byteLength);for(var m=O;m<g;){var s=L(R,m),u=U(R.subarray(m+4,m+8)),_=s>1?m+s:g;if(u===E[0])if(E.length===1)y.push({data:R,start:m+8,end:_});else{var T=v({data:R,start:m+8,end:_},E.slice(1));T.length&&F.apply(y,T)}m=_}return y}function C(x){var E=v(x,["moov"]),y=E[0],R=y?y.end:null,O=v(x,["sidx"]);if(!O||!O[0])return null;var g=[],m=O[0],s=m.data[0],u=s===0?8:16,_=L(m,u);u+=4;var T=0,w=0;s===0?u+=8:u+=16,u+=2;var P=m.end+w,j=S(m,u);u+=2;for(var K=0;K<j;K++){var Z=u,G=L(m,Z);Z+=4;var B=G&2147483647,$=(G&2147483648)>>>31;if($===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=L(m,Z);Z+=4,g.push({referenceSize:B,subsegmentDuration:ne,info:{duration:ne/_,start:P,end:P+B-1}}),P+=B,Z+=4,u=Z}return{earliestPresentationTime:T,timescale:_,version:s,referencesCount:j,references:g,moovEndOffset:R}}function p(x){for(var E=[],y=v(x,["moov","trak"]),R=0;R<y.length;R++){var O=y[R],g=v(O,["tkhd"])[0];if(g){var m=g.data[g.start],s=m===0?12:20,u=L(g,s),_=v(O,["mdia","mdhd"])[0];if(_){m=_.data[_.start],s=m===0?12:20;var T=L(_,s),w=v(O,["mdia","hdlr"])[0];if(w){var P=U(w.data.subarray(w.start+8,w.start+12)),j={soun:N.ElementaryStreamTypes.AUDIO,vide:N.ElementaryStreamTypes.VIDEO}[P];if(j){var K=v(O,["mdia","minf","stbl","stsd"])[0],Z=void 0;K&&(Z=U(K.data.subarray(K.start+12,K.start+16))),E[u]={timescale:T,type:j},E[j]={timescale:T,id:u,codec:Z}}}}}}var G=v(x,["moov","mvex","trex"]);return G.forEach(function(B){var $=L(B,4),ne=E[$];ne&&(ne.default={duration:L(B,12),flags:L(B,20)})}),E}function h(x,E){return v(E,["moof","traf"]).reduce(function(y,R){var O=v(R,["tfdt"])[0],g=O.data[O.start],m=v(R,["tfhd"]).reduce(function(s,u){var _=L(u,4),T=x[_];if(T){var w=L(O,4);g===1&&(w*=Math.pow(2,32),w+=L(O,8));var P=T.timescale||9e4,j=w/P;if(isFinite(j)&&(s===null||j<s))return j}return s},null);return m!==null&&isFinite(m)&&(y===null||m<y)?m:y},null)||0}function f(x,E){for(var y=0,R=0,O=0,g=v(x,["moof","traf"]),m=0;m<g.length;m++){var s=g[m],u=v(s,["tfhd"])[0],_=L(u,4),T=E[_];if(!T)continue;var w=T.default,P=L(u,0)|(w==null?void 0:w.flags),j=w==null?void 0:w.duration;P&8&&(P&2?j=L(u,12):j=L(u,8));for(var K=T.timescale||9e4,Z=v(s,["trun"]),G=0;G<Z.length;G++){if(j){var B=L(Z[G],4);y=j*B}else y=n(Z[G]);T.type===N.ElementaryStreamTypes.VIDEO?R+=y/K:T.type===N.ElementaryStreamTypes.AUDIO&&(O+=y/K)}}if(R===0&&O===0){var $=C(x);if($!=null&&$.references)return $.references.reduce(function(ne,ae){return ne+ae.info.duration||0},0)}return R||O}function n(x){var E=L(x,0),y=8;E&1&&(y+=4),E&4&&(y+=4);for(var R=0,O=L(x,4),g=0;g<O;g++){if(E&256){var m=L(x,y);R+=m,y+=4}E&512&&(y+=4),E&1024&&(y+=4),E&2048&&(y+=4)}return R}function r(x,E,y){v(E,["moof","traf"]).forEach(function(R){v(R,["tfhd"]).forEach(function(O){var g=L(O,4),m=x[g];if(!m)return;var s=m.timescale||9e4;v(R,["tfdt"]).forEach(function(u){var _=u.data[u.start],T=L(u,4);if(_===0)d(u,4,T-y*s);else{T*=Math.pow(2,32),T+=L(u,8),T-=y*s,T=Math.max(T,0);var w=Math.floor(T/(A+1)),P=Math.floor(T%(A+1));d(u,4,w),d(u,8,P)}})})})}function o(x){var E={valid:null,remainder:null},y=v(x,["moof"]);if(y){if(y.length<2)return E.remainder=x,E}else return E;var R=y[y.length-1];return E.valid=Object(W.sliceUint8)(x,0,R.start-8),E.remainder=Object(W.sliceUint8)(x,R.start-8),E}function l(x,E){var y=new Uint8Array(x.length+E.length);return y.set(x),y.set(E,x.length),y}},"./src/utils/output-filter.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"default",function(){return W});var W=function(){function N(F,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=F,this.trackName=U}var A=N.prototype;return A.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},A.newCue=function(U,S,L){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=S,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},A.reset=function(){this.cueRanges=[]},N}()},"./src/utils/texttrack-utils.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"sendAddTrackEvent",function(){return N}),M.d(H,"addCueToTrack",function(){return A}),M.d(H,"clearCurrentCues",function(){return F}),M.d(H,"removeCuesInRange",function(){return U}),M.d(H,"getCuesInRange",function(){return L});var W=M("./src/utils/logger.ts");function N(d,v){var C;try{C=new Event("addtrack")}catch(p){C=document.createEvent("Event"),C.initEvent("addtrack",!1,!1)}C.track=d,v.dispatchEvent(C)}function A(d,v){var C=d.mode;if(C==="disabled"&&(d.mode="hidden"),d.cues&&!d.cues.getCueById(v.id))try{if(d.addCue(v),!d.cues.getCueById(v.id))throw new Error("addCue is failed for: "+v)}catch(h){W.logger.debug("[texttrack-utils]: "+h);var p=new self.TextTrackCue(v.startTime,v.endTime,v.text);p.id=v.id,d.addCue(p)}C==="disabled"&&(d.mode=C)}function F(d){var v=d.mode;if(v==="disabled"&&(d.mode="hidden"),d.cues)for(var C=d.cues.length;C--;)d.removeCue(d.cues[C]);v==="disabled"&&(d.mode=v)}function U(d,v,C){var p=d.mode;if(p==="disabled"&&(d.mode="hidden"),d.cues&&d.cues.length>0)for(var h=L(d.cues,v,C),f=0;f<h.length;f++)d.removeCue(h[f]);p==="disabled"&&(d.mode=p)}function S(d,v){if(v<d[0].startTime)return 0;var C=d.length-1;if(v>d[C].endTime)return-1;for(var p=0,h=C;p<=h;){var f=Math.floor((h+p)/2);if(v<d[f].startTime)h=f-1;else if(v>d[f].startTime&&p<C)p=f+1;else return f}return d[p].startTime-v<v-d[h].startTime?p:h}function L(d,v,C){var p=[],h=S(d,v);if(h>-1)for(var f=h,n=d.length;f<n;f++){var r=d[f];if(r.startTime>=v&&r.endTime<=C)p.push(r);else if(r.startTime>C)return p}return p}},"./src/utils/time-ranges.ts":function(Q,H,M){"use strict";M.r(H);var W={toString:function(A){for(var F="",U=A.length,S=0;S<U;S++)F+="["+A.start(S).toFixed(3)+","+A.end(S).toFixed(3)+"]";return F}};H.default=W},"./src/utils/timescale-conversion.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"toTimescaleFromBase",function(){return N}),M.d(H,"toTimescaleFromScale",function(){return A}),M.d(H,"toMsFromMpegTsClock",function(){return F}),M.d(H,"toMpegTsClockFromTimescale",function(){return U});var W=9e4;function N(S,L,d,v){d===void 0&&(d=1),v===void 0&&(v=!1);var C=S*L*d;return v?Math.round(C):C}function A(S,L,d,v){return d===void 0&&(d=1),v===void 0&&(v=!1),N(S,L,1/d,v)}function F(S,L){return L===void 0&&(L=!1),N(S,1e3,1/W,L)}function U(S,L){return L===void 0&&(L=1),N(S,W,1/L)}},"./src/utils/typed-array.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"sliceUint8",function(){return W});function W(N,A,F){return Uint8Array.prototype.slice?N.slice(A,F):new Uint8Array(Array.prototype.slice.call(N,A,F))}},"./src/utils/vttcue.ts":function(Q,H,M){"use strict";M.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var W=["","lr","rl"],N=["start","middle","end","left","right"];function A(d,v){if(typeof v!="string")return!1;if(!Array.isArray(d))return!1;var C=v.toLowerCase();return~d.indexOf(C)?C:!1}function F(d){return A(W,d)}function U(d){return A(N,d)}function S(d){for(var v=arguments.length,C=new Array(v>1?v-1:0),p=1;p<v;p++)C[p-1]=arguments[p];for(var h=1;h<arguments.length;h++){var f=arguments[h];for(var n in f)d[n]=f[n]}return d}function L(d,v,C){var p=this,h={enumerable:!0};p.hasBeenReset=!1;var f="",n=!1,r=d,o=v,l=C,x=null,E="",y=!0,R="auto",O="start",g=50,m="middle",s=50,u="middle";Object.defineProperty(p,"id",S({},h,{get:function(){return f},set:function(T){f=""+T}})),Object.defineProperty(p,"pauseOnExit",S({},h,{get:function(){return n},set:function(T){n=!!T}})),Object.defineProperty(p,"startTime",S({},h,{get:function(){return r},set:function(T){if(typeof T!="number")throw new TypeError("Start time must be set to a number.");r=T,this.hasBeenReset=!0}})),Object.defineProperty(p,"endTime",S({},h,{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(p,"text",S({},h,{get:function(){return l},set:function(T){l=""+T,this.hasBeenReset=!0}})),Object.defineProperty(p,"region",S({},h,{get:function(){return x},set:function(T){x=T,this.hasBeenReset=!0}})),Object.defineProperty(p,"vertical",S({},h,{get:function(){return E},set:function(T){var w=F(T);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");E=w,this.hasBeenReset=!0}})),Object.defineProperty(p,"snapToLines",S({},h,{get:function(){return y},set:function(T){y=!!T,this.hasBeenReset=!0}})),Object.defineProperty(p,"line",S({},h,{get:function(){return R},set:function(T){if(typeof T!="number"&&T!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=T,this.hasBeenReset=!0}})),Object.defineProperty(p,"lineAlign",S({},h,{get:function(){return O},set:function(T){var w=U(T);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");O=w,this.hasBeenReset=!0}})),Object.defineProperty(p,"position",S({},h,{get:function(){return g},set:function(T){if(T<0||T>100)throw new Error("Position must be between 0 and 100.");g=T,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",S({},h,{get:function(){return m},set:function(T){var w=U(T);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");m=w,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",S({},h,{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(p,"align",S({},h,{get:function(){return u},set:function(T){var w=U(T);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");u=w,this.hasBeenReset=!0}})),p.displayState=void 0}return L.prototype.getCueAsHTML=function(){var d=self.WebVTT;return d.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"parseTimeStamp",function(){return A}),M.d(H,"fixLineBreaks",function(){return v}),M.d(H,"VTTParser",function(){return C});var W=M("./src/utils/vttcue.ts"),N=function(){function p(){}var h=p.prototype;return h.decode=function(n,r){if(!n)return"";if(typeof n!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(n))},p}();function A(p){function h(n,r,o,l){return(n|0)*3600+(r|0)*60+(o|0)+parseFloat(l||0)}var f=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?h(f[2],f[3],0,f[4]):h(f[1],f[2],f[3],f[4]):null}var F=function(){function p(){this.values=Object.create(null)}var h=p.prototype;return h.set=function(n,r){!this.get(n)&&r!==""&&(this.values[n]=r)},h.get=function(n,r,o){return o?this.has(n)?this.values[n]:r[o]:this.has(n)?this.values[n]:r},h.has=function(n){return n in this.values},h.alt=function(n,r,o){for(var l=0;l<o.length;++l)if(r===o[l]){this.set(n,r);break}},h.integer=function(n,r){/^-?\d+$/.test(r)&&this.set(n,parseInt(r,10))},h.percent=function(n,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var o=parseFloat(r);if(o>=0&&o<=100)return this.set(n,o),!0}return!1},p}();function U(p,h,f,n){var r=n?p.split(n):[p];for(var o in r){if(typeof r[o]!="string")continue;var l=r[o].split(f);if(l.length!==2)continue;var x=l[0],E=l[1];h(x,E)}}var S=new W.default(0,0,""),L=S.align==="middle"?"middle":"center";function d(p,h,f){var n=p;function r(){var x=A(p);if(x===null)throw new Error("Malformed timestamp: "+n);return p=p.replace(/^[^\sa-zA-Z-]+/,""),x}function o(x,E){var y=new F;U(x,function(g,m){var s;switch(g){case"region":for(var u=f.length-1;u>=0;u--)if(f[u].id===m){y.set(g,f[u].region);break}break;case"vertical":y.alt(g,m,["rl","lr"]);break;case"line":s=m.split(","),y.integer(g,s[0]),y.percent(g,s[0])&&y.set("snapToLines",!1),y.alt(g,s[0],["auto"]),s.length===2&&y.alt("lineAlign",s[1],["start",L,"end"]);break;case"position":s=m.split(","),y.percent(g,s[0]),s.length===2&&y.alt("positionAlign",s[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":y.percent(g,m);break;case"align":y.alt(g,m,["start",L,"end","left","right"]);break}},/:/,/\s/),E.region=y.get("region",null),E.vertical=y.get("vertical","");var R=y.get("line","auto");R==="auto"&&S.line===-1&&(R=-1),E.line=R,E.lineAlign=y.get("lineAlign","start"),E.snapToLines=y.get("snapToLines",!0),E.size=y.get("size",100),E.align=y.get("align",L);var O=y.get("position","auto");O==="auto"&&S.position===50&&(O=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=O}function l(){p=p.replace(/^\s+/,"")}if(l(),h.startTime=r(),l(),p.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);p=p.substr(3),l(),h.endTime=r(),l(),o(p,h)}function v(p){return p.replace(/<br(?: \/)?>/gi,`
|
|
`)}var C=function(){function p(){this.state="INITIAL",this.buffer="",this.decoder=new N,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var h=p.prototype;return h.parse=function(n){var r=this;n&&(r.buffer+=r.decoder.decode(n,{stream:!0}));function o(){var O=r.buffer,g=0;for(O=v(O);g<O.length&&O[g]!=="\r"&&O[g]!==`
|
|
`;)++g;var m=O.substr(0,g);return O[g]==="\r"&&++g,O[g]===`
|
|
`&&++g,r.buffer=O.substr(g),m}function l(O){U(O,function(g,m){},/:/)}try{var x="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;x=o();var E=x.match(/^()?WEBVTT([ \t].*)?$/);if(!E||!E[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var y=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;y?y=!1:x=o();switch(r.state){case"HEADER":/:/.test(x)?l(x):x||(r.state="ID");continue;case"NOTE":x||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(x)){r.state="NOTE";break}if(!x)continue;if(r.cue=new W.default(0,0,""),r.state="CUE",x.indexOf("-->")===-1){r.cue.id=x;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{d(x,r.cue,r.regionList)}catch(O){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var R=x.indexOf("-->")!==-1;if(!x||R&&(y=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
|
|
`),r.cue.text+=x}continue;case"BADCUE":x||(r.state="ID")}}}catch(O){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},h.flush=function(){var n=this;try{if((n.cue||n.state==="HEADER")&&(n.buffer+=`
|
|
|
|
`,n.parse()),n.state==="INITIAL"||n.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){n.onparsingerror&&n.onparsingerror(r)}return n.onflush&&n.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":function(Q,H,M){"use strict";M.r(H),M.d(H,"generateCueId",function(){return C}),M.d(H,"parseWebVTT",function(){return h});var W=M("./src/polyfills/number.ts"),N=M("./src/utils/vttparser.ts"),A=M("./src/demux/id3.ts"),F=M("./src/utils/timescale-conversion.ts"),U=M("./src/remux/mp4-remuxer.ts"),S=/\r\n|\n\r|\n|\r/g,L=function(n,r,o){return o===void 0&&(o=0),n.substr(o,r.length)===r},d=function(n){var r=parseInt(n.substr(-3)),o=parseInt(n.substr(-6,2)),l=parseInt(n.substr(-9,2)),x=n.length>9?parseInt(n.substr(0,n.indexOf(":"))):0;if(!Object(W.isFiniteNumber)(r)||!Object(W.isFiniteNumber)(o)||!Object(W.isFiniteNumber)(l)||!Object(W.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+n);return r+=1e3*o,r+=60*1e3*l,r+=60*60*1e3*x,r},v=function(n){for(var r=5381,o=n.length;o;)r=r*33^n.charCodeAt(--o);return(r>>>0).toString()};function C(f,n,r){return v(f.toString())+v(n.toString())+v(r)}var p=function(n,r,o){var l=n[r],x=n[l.prevCC];if(!x||!x.new&&l.new){n.ccOffset=n.presentationOffset=l.start,l.new=!1;return}for(;(E=x)!==null&&E!==void 0&&E.new;){var E;n.ccOffset+=l.start-x.start,l.new=!1,l=x,x=n[l.prevCC]}n.presentationOffset=o};function h(f,n,r,o,l,x,E,y){var R=new N.VTTParser,O=Object(A.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(S,`
|
|
`).split(`
|
|
`),g=[],m=Object(F.toMpegTsClockFromTimescale)(n,r),s="00:00.000",u=0,_=0,T,w=!0,P=!1;R.oncue=function(j){var K=o[l],Z=o.ccOffset,G=(u-m)/9e4;if(K!=null&&K.new&&(_!==void 0?Z=o.ccOffset=K.start:p(o,l,G)),G&&(Z=G-o.presentationOffset),P){var B=j.endTime-j.startTime,$=Object(U.normalizePts)((j.startTime+Z-_)*9e4,x*9e4)/9e4;j.startTime=$,j.endTime=$+B}var ne=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(ne)),j.id||(j.id=C(j.startTime,j.endTime,ne)),j.endTime>0&&g.push(j)},R.onparsingerror=function(j){T=j},R.onflush=function(){if(T){y(T);return}E(g)},O.forEach(function(j){if(w)if(L(j,"X-TIMESTAMP-MAP=")){w=!1,P=!0,j.substr(16).split(",").forEach(function(K){L(K,"LOCAL:")?s=K.substr(6):L(K,"MPEGTS:")&&(u=parseInt(K.substr(7)))});try{_=d(s)/1e3}catch(K){P=!1,T=K}return}else j===""&&(w=!1);R.parse(j+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Q,H,M){"use strict";M.r(H);var W=M("./src/utils/logger.ts"),N=M("./src/loader/load-stats.ts"),A=/^age:\s*[\d.]+\s*$/m,F=function(){function U(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new N.LoadStats,this.retryDelay=0}var S=U.prototype;return S.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},S.abortInternal=function(){var d=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),d&&(d.onreadystatechange=null,d.onprogress=null,d.readyState!==4&&(this.stats.aborted=!0,d.abort()))},S.abort=function(){var d;this.abortInternal(),(d=this.callbacks)!==null&&d!==void 0&&d.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},S.load=function(d,v,C){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=d,this.config=v,this.callbacks=C,this.retryDelay=v.retryDelay,this.loadInternal()},S.loadInternal=function(){var d=this.config,v=this.context;if(!d)return;var C=this.loader=new self.XMLHttpRequest,p=this.stats;p.loading.first=0,p.loaded=0;var h=this.xhrSetup;try{if(h)try{h(C,v.url)}catch(r){C.open("GET",v.url,!0),h(C,v.url)}C.readyState||C.open("GET",v.url,!0);var f=this.context.headers;if(f)for(var n in f)C.setRequestHeader(n,f[n])}catch(r){this.callbacks.onError({code:C.status,text:r.message},v,C);return}v.rangeEnd&&C.setRequestHeader("Range","bytes="+v.rangeStart+"-"+(v.rangeEnd-1)),C.onreadystatechange=this.readystatechange.bind(this),C.onprogress=this.loadprogress.bind(this),C.responseType=v.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),d.timeout),C.send()},S.readystatechange=function(){var d=this.context,v=this.loader,C=this.stats;if(!d||!v)return;var p=v.readyState,h=this.config;if(C.aborted)return;if(p>=2)if(self.clearTimeout(this.requestTimeout),C.loading.first===0&&(C.loading.first=Math.max(self.performance.now(),C.loading.start)),p===4){v.onreadystatechange=null,v.onprogress=null;var f=v.status;if(f>=200&&f<300){C.loading.end=Math.max(self.performance.now(),C.loading.first);var n,r;if(d.responseType==="arraybuffer"?(n=v.response,r=n.byteLength):(n=v.responseText,r=n.length),C.loaded=C.total=r,!this.callbacks)return;var o=this.callbacks.onProgress;if(o&&o(C,d,n,v),!this.callbacks)return;var l={url:v.responseURL,data:n};this.callbacks.onSuccess(l,C,d,v)}else C.retry>=h.maxRetry||f>=400&&f<499?(W.logger.error(f+" while loading "+d.url),this.callbacks.onError({code:f,text:v.statusText},d,v)):(W.logger.warn(f+" while loading "+d.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,h.maxRetryDelay),C.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout)},S.loadtimeout=function(){W.logger.warn("timeout while loading "+this.context.url);var d=this.callbacks;d&&(this.abortInternal(),d.onTimeout(this.stats,this.context,this.loader))},S.loadprogress=function(d){var v=this.stats;v.loaded=d.loaded,d.lengthComputable&&(v.total=d.total)},S.getCacheAge=function(){var d=null;if(this.loader&&A.test(this.loader.getAllResponseHeaders())){var v=this.loader.getResponseHeader("age");d=v?parseFloat(v):null}return d},U}();H.default=F}}).default})},vHTk:function(Ye,se,k){Ye.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Ye,se,k){"use strict";k.d(se,"a",function(){return Et});var Q=k("rePB"),H=k("VTBJ"),M=k("KQm4"),W=k("U8pU"),N=k("ODXe"),A=k("q1tI"),F=k("TSYQ"),U=k.n(F),S=k("Gytx"),L=k.n(S),d=k("Kwbf"),v=k("t23M"),C=k("qx4F"),p=k("6eGT"),h=k("IBYe"),f=k("Ff2n"),n=k("c+Xe"),r=k("fyJ8"),o=k("biw7");function l(Ae,xe,Be,Ze,Pe){var Xe=Be[Ae]||{},be=Be[xe]||{},de,he;Xe.fixed==="left"?de=Ze.left[Ae]:be.fixed==="right"&&(he=Ze.right[xe]);var re=!1,ie=!1,le=!1,me=!1,De=Be[xe+1],Te=Be[Ae-1];if(Pe==="rtl"){if(de!==void 0){var Qe=Te&&Te.fixed==="left";me=!Qe}else if(he!==void 0){var ct=De&&De.fixed==="right";le=!ct}}else if(de!==void 0){var xt=De&&De.fixed==="left";re=!xt}else if(he!==void 0){var ft=Te&&Te.fixed==="right";ie=!ft}return{fixLeft:de,fixRight:he,lastFixLeft:re,firstFixRight:ie,lastFixRight:le,firstFixLeft:me,isSticky:Ze.isSticky}}var x=k("sR1s");function E(Ae){var xe=Ae.cells,Be=Ae.stickyOffsets,Ze=Ae.flattenColumns,Pe=Ae.rowComponent,Xe=Ae.cellComponent,be=Ae.onHeaderRow,de=Ae.index,he=A.useContext(o.a),re=he.prefixCls,ie=he.direction,le;be&&(le=be(xe.map(function(De){return De.column}),de));var me=Object(x.a)(xe.map(function(De){return De.column}));return A.createElement(Pe,Object.assign({},le),xe.map(function(De,Te){var Qe=De.column,ct=l(De.colStart,De.colEnd,Ze,Be,ie),xt;return Qe&&Qe.onHeaderCell&&(xt=De.column.onHeaderCell(Qe)),A.createElement(r.a,Object.assign({},De,{ellipsis:Qe.ellipsis,align:Qe.align,component:Xe,prefixCls:re,key:me[Te]},ct,{additionalProps:xt,rowType:"header"}))}))}E.displayName="HeaderRow";var y=E;function R(Ae){var xe=[];function Be(be,de){var he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;xe[he]=xe[he]||[];var re=de,ie=be.filter(Boolean).map(function(le){var me={key:le.key,className:le.className||"",children:le.title,column:le,colStart:re},De=1,Te=le.children;return Te&&Te.length>0&&(De=Be(Te,re,he+1).reduce(function(Qe,ct){return Qe+ct},0),me.hasSubColumns=!0),"colSpan"in le&&(De=le.colSpan),"rowSpan"in le&&(me.rowSpan=le.rowSpan),me.colSpan=De,me.colEnd=me.colStart+De-1,xe[he].push(me),re+=De,De});return ie}Be(Ae,0);for(var Ze=xe.length,Pe=function(de){xe[de].forEach(function(he){!("rowSpan"in he)&&!he.hasSubColumns&&(he.rowSpan=Ze-de)})},Xe=0;Xe<Ze;Xe+=1)Pe(Xe);return xe}function O(Ae){var xe=Ae.stickyOffsets,Be=Ae.columns,Ze=Ae.flattenColumns,Pe=Ae.onHeaderRow,Xe=A.useContext(o.a),be=Xe.prefixCls,de=Xe.getComponent,he=A.useMemo(function(){return R(Be)},[Be]),re=de(["header","wrapper"],"thead"),ie=de(["header","row"],"tr"),le=de(["header","cell"],"th");return A.createElement(re,{className:"".concat(be,"-thead")},he.map(function(me,De){var Te=A.createElement(y,{key:De,flattenColumns:Ze,cells:me,stickyOffsets:xe,rowComponent:ie,cellComponent:le,onHeaderRow:Pe,index:De});return Te}))}var g=O,m=k("hW8S");function s(Ae){for(var xe=Ae.colWidths,Be=Ae.columns,Ze=Ae.columCount,Pe=[],Xe=Ze||Be.length,be=!1,de=Xe-1;de>=0;de-=1){var he=xe[de],re=Be&&Be[de],ie=re&&re[m.a];(he||ie||be)&&(Pe.unshift(A.createElement("col",Object.assign({key:de,style:{width:he,minWidth:he}},ie))),be=!0)}return A.createElement("colgroup",null,Pe)}var u=s;function _(Ae,xe){return Object(A.useMemo)(function(){for(var Be=[],Ze=0;Ze<xe;Ze+=1){var Pe=Ae[Ze];if(Pe!==void 0)Be[Ze]=Pe;else return null}return Be},[Ae.join("_"),xe])}var T=A.forwardRef(function(Ae,xe){var Be=Ae.noData,Ze=Ae.columns,Pe=Ae.flattenColumns,Xe=Ae.colWidths,be=Ae.columCount,de=Ae.stickyOffsets,he=Ae.direction,re=Ae.fixHeader,ie=Ae.offsetHeader,le=Ae.stickyClassName,me=Ae.onScroll,De=Object(f.a)(Ae,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Te=A.useContext(o.a),Qe=Te.prefixCls,ct=Te.scrollbarSize,xt=Te.isSticky,ft=xt&&!re?0:ct,ut=A.useRef(null),$e=A.useCallback(function(pt){Object(n.b)(xe,pt),Object(n.b)(ut,pt)},[]);A.useEffect(function(){var pt;function gt(Re){var Ge=Re.currentTarget,Ue=Re.deltaX;Ue&&(me({currentTarget:Ge,scrollLeft:Ge.scrollLeft+Ue}),Re.preventDefault())}return(pt=ut.current)===null||pt===void 0||pt.addEventListener("wheel",gt),function(){var Re;(Re=ut.current)===null||Re===void 0||Re.removeEventListener("wheel",gt)}},[]);var Ve=Pe[Pe.length-1],Ne={fixed:Ve?Ve.fixed:null,onHeaderCell:function(){return{className:"".concat(Qe,"-cell-scrollbar")}}},oe=Object(A.useMemo)(function(){return ft?[].concat(Object(M.a)(Ze),[Ne]):Ze},[ft,Ze]),ve=Object(A.useMemo)(function(){return ft?[].concat(Object(M.a)(Pe),[Ne]):Pe},[ft,Pe]),He=Object(A.useMemo)(function(){var pt=de.right,gt=de.left;return Object(H.a)(Object(H.a)({},de),{},{left:he==="rtl"?[].concat(Object(M.a)(gt.map(function(Re){return Re+ft})),[0]):gt,right:he==="rtl"?pt:[].concat(Object(M.a)(pt.map(function(Re){return Re+ft})),[0]),isSticky:xt})},[ft,de,xt]),je=_(Xe,be);return A.createElement("div",{style:Object(H.a)({overflow:"hidden"},xt?{top:ie}:{}),ref:$e,className:U()("".concat(Qe,"-header"),Object(Q.a)({},le,!!le))},A.createElement("table",{style:{tableLayout:"fixed",visibility:Be||je?null:"hidden"}},A.createElement(u,{colWidths:je?[].concat(Object(M.a)(je),[ft]):[],columCount:be+1,columns:ve}),A.createElement(g,Object.assign({},De,{stickyOffsets:He,columns:oe,flattenColumns:ve}))))});T.displayName="FixedHeader";var w=T,P=A.createContext(null),j=P;function K(Ae){var xe=Ae.prefixCls,Be=Ae.children,Ze=Ae.component,Pe=Ae.cellComponent,Xe=Ae.fixHeader,be=Ae.fixColumn,de=Ae.horizonScroll,he=Ae.className,re=Ae.expanded,ie=Ae.componentWidth,le=Ae.colSpan,me=A.useContext(o.a),De=me.scrollbarSize;return A.useMemo(function(){var Te=Be;return be&&(Te=A.createElement("div",{style:{width:ie-(Xe?De:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(xe,"-expanded-row-fixed")},Te)),A.createElement(Ze,{className:he,style:{display:re?null:"none"}},A.createElement(r.a,{component:Pe,prefixCls:xe,colSpan:le},Te))},[Be,Ze,Xe,de,he,re,ie,le,De])}var Z=K;function G(Ae){var xe=Ae.className,Be=Ae.style,Ze=Ae.record,Pe=Ae.index,Xe=Ae.rowKey,be=Ae.getRowKey,de=Ae.rowExpandable,he=Ae.expandedKeys,re=Ae.onRow,ie=Ae.indent,le=ie===void 0?0:ie,me=Ae.rowComponent,De=Ae.cellComponent,Te=Ae.childrenColumnName,Qe=A.useContext(o.a),ct=Qe.prefixCls,xt=Qe.fixedInfoList,ft=A.useContext(j),ut=ft.fixHeader,$e=ft.fixColumn,Ve=ft.horizonScroll,Ne=ft.componentWidth,oe=ft.flattenColumns,ve=ft.expandableType,He=ft.expandRowByClick,je=ft.onTriggerExpand,pt=ft.rowClassName,gt=ft.expandedRowClassName,Re=ft.indentSize,Ge=ft.expandIcon,Ue=ft.expandedRowRender,mt=ft.expandIconColumnIndex,wt=A.useState(!1),qt=Object(N.a)(wt,2),en=qt[0],Vt=qt[1],Dt=he&&he.has(Ae.recordKey);A.useEffect(function(){Dt&&Vt(!0)},[Dt]);var Ke=ve==="row"&&(!de||de(Ze)),Ct=ve==="nest",Bt=Te&&Ze&&Ze[Te],It=Ke||Ct,Zt;re&&(Zt=re(Ze,Pe));var nn=function(b){if(He&&It&&je(Ze,b),Zt&&Zt.onClick){for(var D,V=arguments.length,J=new Array(V>1?V-1:0),X=1;X<V;X++)J[X-1]=arguments[X];(D=Zt).onClick.apply(D,[b].concat(J))}},an;typeof pt=="string"?an=pt:typeof pt=="function"&&(an=pt(Ze,Pe,le));var We=Object(x.a)(oe),nt=A.createElement(me,Object.assign({},Zt,{"data-row-key":Xe,className:U()(xe,"".concat(ct,"-row"),"".concat(ct,"-row-level-").concat(le),an,Zt&&Zt.className),style:Object(H.a)(Object(H.a)({},Be),Zt?Zt.style:null),onClick:nn}),oe.map(function(z,b){var D=z.render,V=z.dataIndex,J=z.className,X=We[b],Ee=xt[b],et;b===(mt||0)&&Ct&&(et=A.createElement(A.Fragment,null,A.createElement("span",{style:{paddingLeft:"".concat(Re*le,"px")},className:"".concat(ct,"-row-indent indent-level-").concat(le)}),Ge({prefixCls:ct,expanded:Dt,expandable:Bt,record:Ze,onExpand:je})));var vt;return z.onCell&&(vt=z.onCell(Ze,Pe)),A.createElement(r.a,Object.assign({className:J,ellipsis:z.ellipsis,align:z.align,component:De,prefixCls:ct,key:X,record:Ze,index:Pe,dataIndex:V,render:D,shouldCellUpdate:z.shouldCellUpdate},Ee,{appendNode:et,additionalProps:vt}))})),Kt;if(Ke&&(en||Dt)){var kt=Ue(Ze,Pe,le+1,Dt),Ut=gt&>(Ze,Pe,le);Kt=A.createElement(Z,{expanded:Dt,className:U()("".concat(ct,"-expanded-row"),"".concat(ct,"-expanded-row-level-").concat(le+1),Ut),prefixCls:ct,fixHeader:ut,fixColumn:$e,horizonScroll:Ve,component:me,componentWidth:Ne,cellComponent:De,colSpan:oe.length},kt)}var _t;return Bt&&Dt&&(_t=(Ze[Te]||[]).map(function(z,b){var D=be(z,b);return A.createElement(G,Object.assign({},Ae,{key:D,rowKey:D,record:z,recordKey:D,index:b,indent:le+1}))})),A.createElement(A.Fragment,null,nt,Kt,_t)}G.displayName="BodyRow";var B=G,$=A.createContext(null),ne=$;function ae(Ae){var xe=Ae.columnKey,Be=Ae.onColumnResize,Ze=A.useRef();return A.useEffect(function(){Ze.current&&Be(xe,Ze.current.offsetWidth)},[]),A.createElement(v.a,{onResize:function(Xe){var be=Xe.offsetWidth;Be(xe,be)}},A.createElement("td",{ref:Ze,style:{padding:0,border:0,height:0}},A.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function fe(Ae){var xe=Ae.data,Be=Ae.getRowKey,Ze=Ae.measureColumnWidth,Pe=Ae.expandedKeys,Xe=Ae.onRow,be=Ae.rowExpandable,de=Ae.emptyNode,he=Ae.childrenColumnName,re=A.useContext(ne),ie=re.onColumnResize,le=A.useContext(o.a),me=le.prefixCls,De=le.getComponent,Te=A.useContext(j),Qe=Te.fixHeader,ct=Te.horizonScroll,xt=Te.flattenColumns,ft=Te.componentWidth;return A.useMemo(function(){var ut=De(["body","wrapper"],"tbody"),$e=De(["body","row"],"tr"),Ve=De(["body","cell"],"td"),Ne;xe.length?Ne=xe.map(function(ve,He){var je=Be(ve,He);return A.createElement(B,{key:je,rowKey:je,record:ve,recordKey:je,index:He,rowComponent:$e,cellComponent:Ve,expandedKeys:Pe,onRow:Xe,getRowKey:Be,rowExpandable:be,childrenColumnName:he})}):Ne=A.createElement(Z,{expanded:!0,className:"".concat(me,"-placeholder"),prefixCls:me,fixHeader:Qe,fixColumn:ct,horizonScroll:ct,component:$e,componentWidth:ft,cellComponent:Ve,colSpan:xt.length},de);var oe=Object(x.a)(xt);return A.createElement(ut,{className:"".concat(me,"-tbody")},Ze&&A.createElement("tr",{"aria-hidden":"true",className:"".concat(me,"-measure-row"),style:{height:0}},oe.map(function(ve){return A.createElement(ae,{key:ve,columnKey:ve,onColumnResize:ie})})),Ne)},[xe,me,Xe,Ze,Pe,Be,De,ft,de,xt])}var _e=A.memo(fe);_e.displayName="Body";var Se=_e,we=k("wRmb"),Me=k("xEkU"),Le=k.n(Me);function ge(Ae){var xe=Object(A.useRef)(Ae),Be=Object(A.useState)({}),Ze=Object(N.a)(Be,2),Pe=Ze[1],Xe=Object(A.useRef)(null),be=Object(A.useRef)([]);function de(he){Xe.current===null&&(be.current=[],Xe.current=Le()(function(){be.current.forEach(function(re){xe.current=re(xe.current)}),Xe.current=null,Pe({})})),be.current.push(he)}return Object(A.useEffect)(function(){return function(){Le.a.cancel(Xe.current)}},[]),[xe.current,de]}function ue(Ae){var xe=Object(A.useRef)(Ae),Be=Object(A.useRef)(null);function Ze(){window.clearTimeout(Be.current)}function Pe(be){xe.current=be,Ze(),Be.current=window.setTimeout(function(){xe.current=null,Be.current=null},100)}function Xe(){return xe.current}return Object(A.useEffect)(function(){return Ze},[]),[Pe,Xe]}function ke(Ae,xe,Be){var Ze=Object(A.useMemo)(function(){for(var Pe=[],Xe=[],be=0,de=0,he=0;he<xe;he+=1)if(Be==="rtl"){Xe[he]=de,de+=Ae[he]||0;var re=xe-he-1;Pe[re]=be,be+=Ae[re]||0}else{Pe[he]=be,be+=Ae[he]||0;var ie=xe-he-1;Xe[ie]=de,de+=Ae[ie]||0}return{left:Pe,right:Xe}},[Ae,xe,Be]);return Ze}var lt=ke;function ot(Ae){var xe=Ae.className,Be=Ae.children;return A.createElement("div",{className:xe},Be)}var st=ot,ce=k("n6Qo");function pe(Ae){var xe,Be=Ae.prefixCls,Ze=Ae.record,Pe=Ae.onExpand,Xe=Ae.expanded,be=Ae.expandable,de="".concat(Be,"-row-expand-icon");if(!be)return A.createElement("span",{className:U()(de,"".concat(Be,"-row-spaced"))});var he=function(ie){Pe(Ze,ie),ie.stopPropagation()};return A.createElement("span",{className:U()(de,(xe={},Object(Q.a)(xe,"".concat(Be,"-row-expanded"),Xe),Object(Q.a)(xe,"".concat(Be,"-row-collapsed"),!Xe),xe)),onClick:he})}function Oe(Ae,xe,Be){var Ze=[];function Pe(Xe){(Xe||[]).forEach(function(be,de){Ze.push(xe(be,de)),Pe(be[Be])})}return Pe(Ae),Ze}var ze=k("zT1h"),qe=k("y0+3"),Je=function(xe,Be){var Ze,Pe,Xe=xe.scrollBodyRef,be=xe.onScroll,de=xe.offsetScroll,he=A.useContext(o.a),re=he.prefixCls,ie=((Ze=Xe.current)===null||Ze===void 0?void 0:Ze.scrollWidth)||0,le=((Pe=Xe.current)===null||Pe===void 0?void 0:Pe.clientWidth)||0,me=ie&&le*(le/ie),De=A.useRef(),Te=ge({scrollLeft:0,isHiddenScrollBar:!1}),Qe=Object(N.a)(Te,2),ct=Qe[0],xt=Qe[1],ft=A.useRef({delta:0,x:0}),ut=A.useState(!1),$e=Object(N.a)(ut,2),Ve=$e[0],Ne=$e[1],oe=function(){Ne(!1)},ve=function(Re){Re.persist(),ft.current.delta=Re.pageX-ct.scrollLeft,ft.current.x=0,Ne(!0),Re.preventDefault()},He=function(Re){var Ge,Ue=Re||((Ge=window)===null||Ge===void 0?void 0:Ge.event),mt=Ue.buttons;if(!Ve||mt===0){Ve&&Ne(!1);return}var wt=ft.current.x+Re.pageX-ft.current.x-ft.current.delta;wt<=0&&(wt=0),wt+me>=le&&(wt=le-me),be({scrollLeft:wt/le*(ie+2)}),ft.current.x=Re.pageX},je=function(){var Re=Object(qe.b)(Xe.current).top,Ge=Re+Xe.current.offsetHeight,Ue=document.documentElement.scrollTop+window.innerHeight;Ge-Object(C.a)()<=Ue||Re>=Ue-de?xt(function(mt){return Object(H.a)(Object(H.a)({},mt),{},{isHiddenScrollBar:!0})}):xt(function(mt){return Object(H.a)(Object(H.a)({},mt),{},{isHiddenScrollBar:!1})})},pt=function(Re){xt(function(Ge){return Object(H.a)(Object(H.a)({},Ge),{},{scrollLeft:Re/ie*le||0})})};return A.useImperativeHandle(Be,function(){return{setScrollLeft:pt}}),A.useEffect(function(){var gt=Object(ze.a)(document.body,"mouseup",oe,!1),Re=Object(ze.a)(document.body,"mousemove",He,!1);return je(),function(){gt.remove(),Re.remove()}},[me,Ve]),A.useEffect(function(){var gt=Object(ze.a)(window,"scroll",je,!1),Re=Object(ze.a)(window,"resize",je,!1);return function(){gt.remove(),Re.remove()}},[]),A.useEffect(function(){ct.isHiddenScrollBar||xt(function(gt){var Re,Ge;return Object(H.a)(Object(H.a)({},gt),{},{scrollLeft:Xe.current.scrollLeft/((Re=Xe.current)===null||Re===void 0?void 0:Re.scrollWidth)*((Ge=Xe.current)===null||Ge===void 0?void 0:Ge.clientWidth)})})},[ct.isHiddenScrollBar]),ie<=le||!me||ct.isHiddenScrollBar?null:A.createElement("div",{style:{height:Object(C.a)(),width:le,bottom:de},className:"".concat(re,"-sticky-scroll")},A.createElement("div",{onMouseDown:ve,ref:De,className:U()("".concat(re,"-sticky-scroll-bar"),Object(Q.a)({},"".concat(re,"-sticky-scroll-bar-active"),Ve)),style:{width:"".concat(me,"px"),transform:"translate3d(".concat(ct.scrollLeft,"px, 0, 0)")}}))},rt=A.forwardRef(Je);function tt(Ae,xe){return A.useMemo(function(){var Be=!!Ae;return{isSticky:Be,stickyClassName:Be?"".concat(xe,"-sticky-header"):"",offsetHeader:Object(W.a)(Ae)==="object"&&Ae.offsetHeader||0,offsetScroll:Object(W.a)(Ae)==="object"&&Ae.offsetScroll||0}},[Ae,xe])}var Tt=[],bt={},Et="rc-table-internal-hook",yt=A.memo(function(Ae){var xe=Ae.children;return xe},function(Ae,xe){return L()(Ae.props,xe.props)?Ae.pingLeft!==xe.pingLeft||Ae.pingRight!==xe.pingRight:!1});function Ot(Ae){var xe,Be=Ae.prefixCls,Ze=Ae.className,Pe=Ae.rowClassName,Xe=Ae.style,be=Ae.data,de=Ae.rowKey,he=Ae.scroll,re=Ae.tableLayout,ie=Ae.direction,le=Ae.title,me=Ae.footer,De=Ae.summary,Te=Ae.id,Qe=Ae.showHeader,ct=Ae.components,xt=Ae.emptyText,ft=Ae.onRow,ut=Ae.onHeaderRow,$e=Ae.internalHooks,Ve=Ae.transformColumns,Ne=Ae.internalRefs,oe=Ae.sticky,ve=be||Tt,He=!!ve.length,je=A.useState(0),pt=Object(N.a)(je,2),gt=pt[0],Re=pt[1];A.useEffect(function(){Re(Object(C.a)())});var Ge=A.useMemo(function(){return Object(x.c)(ct,{})},[ct]),Ue=A.useCallback(function(gn,Jt){return Object(x.b)(Ge,gn)||Jt},[Ge]),mt=A.useMemo(function(){return typeof de=="function"?de:function(gn){var Jt=gn&&gn[de];return Jt}},[de]),wt=Object(m.c)(Ae),qt=wt.expandIcon,en=wt.expandedRowKeys,Vt=wt.defaultExpandedRowKeys,Dt=wt.defaultExpandAllRows,Ke=wt.expandedRowRender,Ct=wt.onExpand,Bt=wt.onExpandedRowsChange,It=wt.expandRowByClick,Zt=wt.rowExpandable,nn=wt.expandIconColumnIndex,an=wt.expandedRowClassName,We=wt.childrenColumnName,nt=wt.indentSize,Kt=qt||pe,kt=We||"children",Ut=A.useMemo(function(){return Ke?"row":Ae.expandable&&$e===Et&&Ae.expandable.__PARENT_RENDER_ICON__||ve.some(function(gn){return gn&&Object(W.a)(gn)==="object"&&gn[kt]})?"nest":!1},[!!Ke,ve]),_t=A.useState(function(){return Vt||(Dt?Oe(ve,mt,kt):[])}),z=Object(N.a)(_t,2),b=z[0],D=z[1],V=A.useMemo(function(){return new Set(en||b||[])},[en,b]),J=A.useCallback(function(gn){var Jt=mt(gn,ve.indexOf(gn)),En,yr=V.has(Jt);yr?(V.delete(Jt),En=Object(M.a)(V)):En=[].concat(Object(M.a)(V),[Jt]),D(En),Ct&&Ct(!yr,gn),Bt&&Bt(En)},[mt,V,ve,Ct,Bt]),X=A.useState(0),Ee=Object(N.a)(X,2),et=Ee[0],vt=Ee[1],Rt=Object(we.b)(Object(H.a)(Object(H.a)(Object(H.a)({},Ae),wt),{},{expandable:!!Ke,expandedKeys:V,getRowKey:mt,onTriggerExpand:J,expandIcon:Kt,expandIconColumnIndex:nn,direction:ie}),$e===Et?Ve:null),at=Object(N.a)(Rt,2),zt=at[0],Wt=at[1],yn=A.useMemo(function(){return{columns:zt,flattenColumns:Wt}},[zt,Wt]),Un=A.useRef(),hn=A.useRef(),tn=A.useRef(),An=A.useState(!1),Mn=Object(N.a)(An,2),pn=Mn[0],Cn=Mn[1],bn=A.useState(!1),$n=Object(N.a)(bn,2),jn=$n[0],pr=$n[1],Sn=ge(new Map),wr=Object(N.a)(Sn,2),xn=wr[0],tr=wr[1],nr=Object(x.a)(Wt),mr=nr.map(function(gn){return xn.get(gn)}),Ar=A.useMemo(function(){return mr},[mr.join("_")]),ar=lt(Ar,Wt.length,ie),vn=he&&Object(x.d)(he.y),on=he&&Object(x.d)(he.x),Dn=on&&Wt.some(function(gn){var Jt=gn.fixed;return Jt}),mn=A.useRef(),On=tt(oe,Be),ln=On.isSticky,gr=On.offsetHeader,Pn=On.offsetScroll,Hn=On.stickyClassName,Or,xr,vr;vn&&(xr={overflowY:"scroll",maxHeight:he.y}),on&&(Or={overflowX:"auto"},vn||(xr={overflowY:"hidden"}),vr={width:he.x===!0?"auto":he.x,minWidth:"100%"});var Nr=A.useCallback(function(gn,Jt){tr(function(En){var yr=new Map(En);return yr.set(gn,Jt),yr})},[]),Xn=ue(null),Lr=Object(N.a)(Xn,2),lr=Lr[0],Cr=Lr[1];function Mr(gn,Jt){if(!Jt)return;typeof Jt=="function"?Jt(gn):Jt.scrollLeft!==gn&&(Jt.scrollLeft=gn)}var un=function(Jt){var En=Jt.currentTarget,yr=Jt.scrollLeft,Br=typeof yr=="number"?yr:En.scrollLeft,Wr=En||bt;if(!Cr()||Cr()===Wr){var Si;lr(Wr),Mr(Br,hn.current),Mr(Br,tn.current),Mr(Br,(Si=mn.current)===null||Si===void 0?void 0:Si.setScrollLeft)}if(En){var Xi=En.scrollWidth,ga=En.clientWidth;Cn(Br>0),pr(Br<Xi-ga)}},rn=function(){tn.current&&un({currentTarget:tn.current})},Rn=function(Jt){var En=Jt.width;rn(),vt(Un.current?Un.current.offsetWidth:En)};A.useEffect(function(){return rn},[]),A.useEffect(function(){on&&rn()},[on]),A.useEffect(function(){$e===Et&&Ne&&(Ne.body.current=tn.current)});var dt=Ue(["table"],"table"),jt=A.useMemo(function(){return re||(Dn?he.x==="max-content"?"auto":"fixed":vn||Wt.some(function(gn){var Jt=gn.ellipsis;return Jt})?"fixed":"auto")},[vn,Dn,Wt,re]),Nt,Xt={colWidths:Ar,columCount:Wt.length,stickyOffsets:ar,onHeaderRow:ut,fixHeader:vn},Yt=A.useMemo(function(){return He?null:typeof xt=="function"?xt():xt},[He,xt]),fn=A.createElement(Se,{data:ve,measureColumnWidth:vn||on||ln,expandedKeys:V,rowExpandable:Zt,getRowKey:mt,onRow:ft,emptyNode:Yt,childrenColumnName:kt}),Lt=A.createElement(u,{colWidths:Wt.map(function(gn){var Jt=gn.width;return Jt}),columns:Wt}),Tn=De&&A.createElement(ce.b,null,De(ve)),kn=Ue(["body"]);if(vn||ln){var $t;typeof kn=="function"?($t=kn(ve,{scrollbarSize:gt,ref:tn,onScroll:un}),Xt.colWidths=Wt.map(function(gn,Jt){var En=gn.width,yr=Jt===zt.length-1?En-gt:En;return typeof yr=="number"&&!Number.isNaN(yr)?yr:(Object(d.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):$t=A.createElement("div",{style:Object(H.a)(Object(H.a)({},Or),xr),onScroll:un,ref:tn,className:U()("".concat(Be,"-body"))},A.createElement(dt,{style:Object(H.a)(Object(H.a)({},vr),{},{tableLayout:jt})},Lt,fn,Tn),ln&&A.createElement(rt,{ref:mn,offsetScroll:Pn,scrollBodyRef:tn,onScroll:un})),Nt=A.createElement(A.Fragment,null,Qe!==!1&&A.createElement(w,Object.assign({noData:!ve.length},Xt,yn,{direction:ie,offsetHeader:gr,stickyClassName:Hn,ref:hn,onScroll:un})),$t)}else Nt=A.createElement("div",{style:Object(H.a)(Object(H.a)({},Or),xr),className:U()("".concat(Be,"-content")),onScroll:un,ref:tn},A.createElement(dt,{style:Object(H.a)(Object(H.a)({},vr),{},{tableLayout:jt})},Lt,Qe!==!1&&A.createElement(g,Object.assign({},Xt,yn)),fn,Tn));var Bn=Object(m.b)(Ae),sn=A.createElement("div",Object.assign({className:U()(Be,Ze,(xe={},Object(Q.a)(xe,"".concat(Be,"-rtl"),ie==="rtl"),Object(Q.a)(xe,"".concat(Be,"-ping-left"),pn),Object(Q.a)(xe,"".concat(Be,"-ping-right"),jn),Object(Q.a)(xe,"".concat(Be,"-layout-fixed"),re==="fixed"),Object(Q.a)(xe,"".concat(Be,"-fixed-header"),vn),Object(Q.a)(xe,"".concat(Be,"-fixed-column"),Dn),Object(Q.a)(xe,"".concat(Be,"-scroll-horizontal"),on),Object(Q.a)(xe,"".concat(Be,"-has-fix-left"),Wt[0]&&Wt[0].fixed),Object(Q.a)(xe,"".concat(Be,"-has-fix-right"),Wt[Wt.length-1]&&Wt[Wt.length-1].fixed==="right"),xe)),style:Xe,id:Te,ref:Un},Bn),A.createElement(yt,{pingLeft:pn,pingRight:jn,props:Object(H.a)(Object(H.a)({},Ae),{},{stickyOffsets:ar,mergedExpandedKeys:V})},le&&A.createElement(st,{className:"".concat(Be,"-title")},le(ve)),A.createElement("div",{className:"".concat(Be,"-container")},Nt),me&&A.createElement(st,{className:"".concat(Be,"-footer")},me(ve))));on&&(sn=A.createElement(v.a,{onResize:Rn},sn));var dn=A.useMemo(function(){return{prefixCls:Be,getComponent:Ue,scrollbarSize:gt,direction:ie,fixedInfoList:Wt.map(function(gn,Jt){return l(Jt,Jt,Wt,ar,ie)}),isSticky:ln}},[Be,Ue,gt,ie,Wt,ar,ie,ln]),Kn=A.useMemo(function(){return Object(H.a)(Object(H.a)({},yn),{},{tableLayout:jt,rowClassName:Pe,expandedRowClassName:an,componentWidth:et,fixHeader:vn,fixColumn:Dn,horizonScroll:on,expandIcon:Kt,expandableType:Ut,expandRowByClick:It,expandedRowRender:Ke,onTriggerExpand:J,expandIconColumnIndex:nn,indentSize:nt})},[yn,jt,Pe,an,et,vn,Dn,on,Kt,Ut,It,Ke,J,nn,nt]),zn=A.useMemo(function(){return{onColumnResize:Nr}},[Nr]);return A.createElement(o.a.Provider,{value:dn},A.createElement(j.Provider,{value:Kn},A.createElement(ne.Provider,{value:zn},sn)))}Ot.Column=h.a,Ot.ColumnGroup=p.a,Ot.Summary=ce.a,Ot.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var At=se.b=Ot},wRmb:function(Ye,se,k){"use strict";k.d(se,"a",function(){return L});var Q=k("rePB"),H=k("KQm4"),M=k("VTBJ"),W=k("Ff2n"),N=k("q1tI"),A=k.n(N),F=k("Kwbf"),U=k("Zm9Q"),S=k("hW8S");function L(h){return Object(U.a)(h).filter(function(f){return N.isValidElement(f)}).map(function(f){var n=f.key,r=f.props,o=r.children,l=Object(W.a)(r,["children"]),x=Object(M.a)({key:n},l);return o&&(x.children=L(o)),x})}function d(h){return h.reduce(function(f,n){var r=n.fixed,o=r===!0?"left":r,l=n.children;return l&&l.length>0?[].concat(Object(H.a)(f),Object(H.a)(d(l).map(function(x){return Object(M.a)({fixed:o},x)}))):[].concat(Object(H.a)(f),[Object(M.a)(Object(M.a)({},n),{},{fixed:o})])},[])}function v(h){for(var f=!0,n=0;n<h.length;n+=1){var r=h[n];if(f&&r.fixed!=="left")f=!1;else if(!f&&r.fixed==="left"){Object(F.a)(!1,"Index ".concat(n-1," of `columns` missing `fixed='left'` prop."));break}}for(var o=!0,l=h.length-1;l>=0;l-=1){var x=h[l];if(o&&x.fixed!=="right")o=!1;else if(!o&&x.fixed==="right"){Object(F.a)(!1,"Index ".concat(l+1," of `columns` missing `fixed='right'` prop."));break}}}function C(h){return h.map(function(f){var n=f.fixed,r=Object(W.a)(f,["fixed"]),o=n;return n==="left"?o="right":n==="right"&&(o="left"),Object(M.a)({fixed:o},r)})}function p(h,f){var n=h.prefixCls,r=h.columns,o=h.children,l=h.expandable,x=h.expandedKeys,E=h.getRowKey,y=h.onTriggerExpand,R=h.expandIcon,O=h.rowExpandable,g=h.expandIconColumnIndex,m=h.direction,s=h.expandRowByClick,u=N.useMemo(function(){return r||L(o)},[r,o]),_=N.useMemo(function(){if(l){var P,j=g||0,K=u[j],Z=(P={},Object(Q.a)(P,S.a,{className:"".concat(n,"-expand-icon-col")}),Object(Q.a)(P,"title",""),Object(Q.a)(P,"fixed",K?K.fixed:null),Object(Q.a)(P,"className","".concat(n,"-row-expand-icon-cell")),Object(Q.a)(P,"render",function($,ne,ae){var fe=E(ne,ae),_e=x.has(fe),Se=O?O(ne):!0,we=R({prefixCls:n,expanded:_e,expandable:Se,record:ne,onExpand:y});return s?N.createElement("span",{onClick:function(Le){return Le.stopPropagation()}},we):we}),P),G=u.slice();return j>=0&&G.splice(j,0,Z),G}return u},[l,u,E,x,R,m]),T=N.useMemo(function(){var P=_;return f&&(P=f(P)),P.length||(P=[{render:function(){return null}}]),P},[f,_,m]),w=N.useMemo(function(){return m==="rtl"?C(d(T)):d(T)},[T,m]);return[T,w]}se.b=p},"y0+3":function(Ye,se,k){"use strict";k.d(se,"a",function(){return d}),k.d(se,"b",function(){return C});var Q=/margin|padding|width|height|max|min|offset/,H={left:!0,top:!0},M={cssFloat:1,styleFloat:1,float:1};function W(p){return p.nodeType===1?p.ownerDocument.defaultView.getComputedStyle(p,null):{}}function N(p,h,f){if(h=h.toLowerCase(),f==="auto"){if(h==="height")return p.offsetHeight;if(h==="width")return p.offsetWidth}return h in H||(H[h]=Q.test(h)),H[h]?parseFloat(f)||0:f}function A(p,h){var f=arguments.length,n=W(p);return h=M[h]?"cssFloat"in p.style?"cssFloat":"styleFloat":h,f===1?n:N(p,h,n[h]||p.style[h])}function F(p,h,f){var n=arguments.length;if(h=M[h]?"cssFloat"in p.style?"cssFloat":"styleFloat":h,n===3)return typeof f=="number"&&Q.test(h)&&(f="".concat(f,"px")),p.style[h]=f,f;for(var r in h)h.hasOwnProperty(r)&&F(p,r,h[r]);return W(p)}function U(p){return p===document.body?document.documentElement.clientWidth:p.offsetWidth}function S(p){return p===document.body?window.innerHeight||document.documentElement.clientHeight:p.offsetHeight}function L(){var p=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),h=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:p,height:h}}function d(){var p=document.documentElement.clientWidth,h=window.innerHeight||document.documentElement.clientHeight;return{width:p,height:h}}function v(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function C(p){var h=p.getBoundingClientRect(),f=document.documentElement;return{left:h.left+(window.pageXOffset||f.scrollLeft)-(f.clientLeft||document.body.clientLeft||0),top:h.top+(window.pageYOffset||f.scrollTop)-(f.clientTop||document.body.clientTop||0)}}},ynwM:function(Ye,se,k){var Q=k("MFOe"),H=Q.Global;Ye.exports={name:"oldFF-globalStorage",read:W,write:N,each:A,remove:F,clearAll:U};var M=H.globalStorage;function W(S){return M[S]}function N(S,L){M[S]=L}function A(S){for(var L=M.length-1;L>=0;L--){var d=M.key(L);S(M[d],d)}}function F(S){return M.removeItem(S)}function U(){A(function(S,L){delete M[S]})}}}]);
|