(window.webpackJsonp=window.webpackJsonp||[]).push([[216,3,5,7,8,20],{"++UQ":function(je,ce,D){},"+NIl":function(je,ce,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(z,M){"use strict";function X(u,o){u.cmdState.push(o)}function F(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function I(u){var o=u.cmdState.pop();o&&o.closeBracket()}function H(u){for(var o=u.cmdState,h=o.length-1;h>=0;h--){var r=o[h];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function N(u,o,h){return function(){this.name=u,this.bracketNo=0,this.style=o,this.styles=h,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=N("importmodule","tag",["string","builtin"]),n.documentclass=N("documentclass","tag",["","atom"]),n.usepackage=N("usepackage","tag",["atom"]),n.begin=N("begin","tag",["atom"]),n.end=N("end","tag",["atom"]),n.label=N("label","tag",["atom"]),n.ref=N("ref","tag",["atom"]),n.eqref=N("eqref","tag",["atom"]),n.cite=N("cite","tag",["atom"]),n.bibitem=N("bibitem","tag",["atom"]),n.Bibitem=N("Bibitem","tag",["atom"]),n.RBibitem=N("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(u,o){u.f=o}function p(u,o){var h;if(u.match(/^\\[a-zA-Z@]+/)){var r=u.current().slice(1);return h=n.hasOwnProperty(r)?n[r]:n.DEFAULT,h=new h,X(o,h),P(o,d),h.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return P(o,function(i,s){return m(i,s,"\\]")}),"keyword";if(u.match("\\("))return P(o,function(i,s){return m(i,s,"\\)")}),"keyword";if(u.match("$$"))return P(o,function(i,s){return m(i,s,"$$")}),"keyword";if(u.match("$"))return P(o,function(i,s){return m(i,s,"$")}),"keyword";var a=u.next();if(a=="%")return u.skipToEnd(),"comment";if(a=="}"||a=="]"){if(h=F(o),h)h.closeBracket(a),P(o,d);else return"error";return"bracket"}else return a=="{"||a=="["?(h=n.DEFAULT,h=new h,X(o,h),"bracket"):/\d/.test(a)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),h=H(o),h.name=="begin"&&(h.argument=u.current()),h.styleIdentifier())}function m(u,o,h){if(u.eatSpace())return null;if(h&&u.match(h))return P(o,p),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=u.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(u.skipToEnd(),"comment"):"error"}function d(u,o){var h=u.peek(),r;return h=="{"||h=="["?(r=F(o),r.openBracket(h),u.eat(h),P(o,p),"bracket"):/[ \t\r]/.test(h)?(u.eat(h),null):(P(o,p),I(o),p(u,o))}return{startState:function(){var u=M.inMathMode?function(o,h){return m(o,h)}:p;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,o){return o.f(u,o)},blankLine:function(u){u.f=p,u.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+QRC":function(je,ce,D){"use strict";var Z=D("E9nw"),z={"text/plain":"Text","text/html":"Url",default:"Text"},M="Copy to clipboard: #{key}, Enter";function X(I){var H=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return I.replace(/#{\s*key\s*}/g,H)}function F(I,H){var N,n,P,p,m,d,u=!1;H||(H={}),N=H.debug||!1;try{P=Z(),p=document.createRange(),m=document.getSelection(),d=document.createElement("span"),d.textContent=I,d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(h){if(h.stopPropagation(),H.format)if(h.preventDefault(),typeof h.clipboardData=="undefined"){N&&console.warn("unable to use e.clipboardData"),N&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=z[H.format]||z.default;window.clipboardData.setData(r,I)}else h.clipboardData.clearData(),h.clipboardData.setData(H.format,I);H.onCopy&&(h.preventDefault(),H.onCopy(h.clipboardData))}),document.body.appendChild(d),p.selectNodeContents(d),m.addRange(p);var o=document.execCommand("copy");if(!o)throw new Error("copy command was unsuccessful");u=!0}catch(h){N&&console.error("unable to copy using execCommand: ",h),N&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(H.format||"text",I),H.onCopy&&H.onCopy(window.clipboardData),u=!0}catch(r){N&&console.error("unable to copy using clipboardData: ",r),N&&console.error("falling back to prompt"),n=X("message"in H?H.message:M),window.prompt(n,I)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(p):m.removeAllRanges()),d&&document.body.removeChild(d),P()}return u}je.exports=F},"+aKw":function(je,ce,D){"use strict";var Z=D("tJVT"),z=D("q1tI"),M=D.n(z),X=function(H){return String(H).length===1?"0".concat(H):H},F=function(H){var N=H.className,n=N===void 0?"":N,P=H.onChange,p=H.defaultValue,m=p===void 0?0:p,d=Object(z.useState)(m),u=Object(Z.a)(d,2),o=u[0],h=u[1];Object(z.useEffect)(function(){var s=setTimeout(function(){h(o+1e3)},1e3);return P(o+1e3),function(){clearInterval(s)}},[o]);var r=parseInt(o/(60*6e4))||"00",a=parseInt(o%(60*6e4)/6e4)||"00",i=parseInt(o%6e4/1e3)||"00";return M.a.createElement("div",{className:n},X(r),":",X(a),":",X(i))};ce.a=F},"+ua5":function(je,ce,D){},"/cxE":function(je,ce,D){"use strict";D.d(ce,"f",function(){return M}),D.d(ce,"g",function(){return X}),D.d(ce,"h",function(){return F}),D.d(ce,"e",function(){return H}),D.d(ce,"b",function(){return N}),D.d(ce,"c",function(){return n}),D.d(ce,"d",function(){return P}),D.d(ce,"a",function(){return p});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(m){setTimeout(()=>{throw m.stack?new Error(m.message+` `+m.stack):m},0)}}emit(m){this.listeners.forEach(d=>{d(m)})}onUnexpectedError(m){this.unexpectedErrorHandler(m),this.emit(m)}onUnexpectedExternalError(m){this.unexpectedErrorHandler(m)}}const z=new Z;function M(m){H(m)||z.onUnexpectedError(m);return}function X(m){H(m)||z.onUnexpectedExternalError(m);return}function F(m){if(m instanceof Error){let{name:d,message:u}=m;const o=m.stacktrace||m.stack;return{$isError:!0,name:d,message:u,stack:o}}return m}const I="Canceled";function H(m){return m instanceof Error&&m.name===I&&m.message===I}function N(){const m=new Error(I);return m.name=m.message,m}function n(m){return m?new Error(`Illegal argument: ${m}`):new Error("Illegal argument")}function P(m){return m?new Error(`Illegal state: ${m}`):new Error("Illegal state")}class p extends Error{constructor(m){super("NotSupported");m&&(this.message=m)}}},"07cG":function(je,ce,D){je.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":function(je,ce){var D=arguments[3],Z=arguments[4],z=arguments[5],M=JSON.stringify;je.exports=function(X,F){for(var I,H=Object.keys(z),N=0,n=H.length;N")):null:f.match("--")?E(o("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),E(h(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(P=f.eat("/")?"closeTag":"openTag",C.tokenize=d,"tag bracket");if(y=="&"){var U;return f.eat("#")?f.eat("x")?U=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):U=f.eatWhile(/[\d]/)&&f.eat(";"):U=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),U?"atom":"error"}else return f.eatWhile(/[^&<]/),null}m.isInText=!0;function d(f,C){var E=f.next();if(E==">"||E=="/"&&f.eat(">"))return C.tokenize=m,P=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return P="equals",null;if(E=="<"){C.tokenize=m,C.state=s,C.tagName=C.tagStart=null;var y=C.tokenize(f,C);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=u(E),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(f){var C=function(E,y){for(;!E.eol();)if(E.next()==f){y.tokenize=d;break}return"string"};return C.isInAttribute=!0,C}function o(f,C){return function(E,y){for(;!E.eol();){if(E.match(C)){y.tokenize=m;break}E.next()}return f}}function h(f){return function(C,E){for(var y;(y=C.next())!=null;){if(y=="<")return E.tokenize=h(f+1),E.tokenize(C,E);if(y==">")if(f==1){E.tokenize=m;break}else return E.tokenize=h(f-1),E.tokenize(C,E)}return"meta"}}function r(f,C,E){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=E,(H.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function a(f){f.context&&(f.context=f.context.prev)}function i(f,C){for(var E;;){if(!f.context)return;if(E=f.context.tagName,!H.contextGrabbers.hasOwnProperty(E)||!H.contextGrabbers[E].hasOwnProperty(C))return;a(f)}}function s(f,C,E){return f=="openTag"?(E.tagStart=C.column(),S):f=="closeTag"?x:s}function S(f,C,E){return f=="word"?(E.tagName=C.current(),p="tag",w):H.allowMissingTagName&&f=="endTag"?(p="tag bracket",w(f,C,E)):(p="error",S)}function x(f,C,E){if(f=="word"){var y=C.current();return E.context&&E.context.tagName!=y&&H.implicitlyClosed.hasOwnProperty(E.context.tagName)&&a(E),E.context&&E.context.tagName==y||H.matchClosing===!1?(p="tag",T):(p="tag error",R)}else return H.allowMissingTagName&&f=="endTag"?(p="tag bracket",T(f,C,E)):(p="error",R)}function T(f,C,E){return f!="endTag"?(p="error",T):(a(E),s)}function R(f,C,E){return p="error",T(f,C,E)}function w(f,C,E){if(f=="word")return p="attribute",v;if(f=="endTag"||f=="selfcloseTag"){var y=E.tagName,U=E.tagStart;return E.tagName=E.tagStart=null,f=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(y)?i(E,y):(i(E,y),E.context=new r(E,y,U==E.indented)),s}return p="error",w}function v(f,C,E){return f=="equals"?b:(H.allowMissing||(p="error"),w(f,C,E))}function b(f,C,E){return f=="string"?g:f=="word"&&H.allowUnquoted?(p="string",w):(p="error",w(f,C,E))}function g(f,C,E){return f=="string"?g:w(f,C,E)}return{startState:function(f){var C={tokenize:m,state:s,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;P=null;var E=C.tokenize(f,C);return(E||P)&&E!="comment"&&(p=null,C.state=C.state(P||E,f,C),p&&(E=p=="error"?E+" error":p)),E},indent:function(f,C,E){var y=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+I;if(y&&y.noIndent)return Z.Pass;if(f.tokenize!=d&&f.tokenize!=m)return E?E.match(/^(\s*)/)[0].length:0;if(f.tagName)return H.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+I*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=w)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],E=f.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(je,ce,D){"use strict";D.d(ce,"d",function(){return Be}),D.d(ce,"b",function(){return Le}),D.d(ce,"c",function(){return dt}),D.d(ce,"a",function(){return Ft});var Z=D("VTBJ"),z=D("1OyB"),M=D("vuIU"),X=D("JX7q"),F=D("Ji7U"),I=D("LK+K"),H=D("q1tI"),N=D("I8Z2"),n=D("BGR+"),P=D("wx14"),p=D("rePB"),m=D("4IlW"),d=D("2GS6"),u=D("Gytx"),o=D.n(u),h=D("TSYQ"),r=D.n(h),a=D("U8pU"),i=D("ODXe"),s=/iPhone/i,S=/iPod/i,x=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,w=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,g=/\bWindows(?:.+)ARM\b/i,f=/BlackBerry/i,C=/BB10/i,E=/Opera Mini/i,y=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i;function j(St,qe){return St.test(qe)}function A(St){var qe=St||(typeof navigator!="undefined"?navigator.userAgent:""),rt=qe.split("[FBAN");if(typeof rt[1]!="undefined"){var Ye=rt,pe=Object(i.a)(Ye,1);qe=pe[0]}if(rt=qe.split("Twitter"),typeof rt[1]!="undefined"){var Te=rt,nt=Object(i.a)(Te,1);qe=nt[0]}var Xe={apple:{phone:j(s,qe)&&!j(b,qe),ipod:j(S,qe),tablet:!j(s,qe)&&j(x,qe)&&!j(b,qe),device:(j(s,qe)||j(S,qe)||j(x,qe))&&!j(b,qe)},amazon:{phone:j(w,qe),tablet:!j(w,qe)&&j(v,qe),device:j(w,qe)||j(v,qe)},android:{phone:!j(b,qe)&&j(w,qe)||!j(b,qe)&&j(T,qe),tablet:!j(b,qe)&&!j(w,qe)&&!j(T,qe)&&(j(v,qe)||j(R,qe)),device:!j(b,qe)&&(j(w,qe)||j(v,qe)||j(T,qe)||j(R,qe))||j(/\bokhttp\b/i,qe)},windows:{phone:j(b,qe),tablet:j(g,qe),device:j(b,qe)||j(g,qe)},other:{blackberry:j(f,qe),blackberry10:j(C,qe),opera:j(E,qe),firefox:j(U,qe),chrome:j(y,qe),device:j(f,qe)||j(C,qe)||j(E,qe)||j(U,qe)||j(y,qe)},any:null,phone:null,tablet:null};return Xe.any=Xe.apple.device||Xe.android.device||Xe.windows.device||Xe.other.device,Xe.phone=Xe.apple.phone||Xe.android.phone||Xe.windows.phone,Xe.tablet=Xe.apple.tablet||Xe.android.tablet||Xe.windows.tablet,Xe}var G=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),W=G;function O(){}function V(St,qe,rt){var Ye=qe||"";return St.key||"".concat(Ye,"item_").concat(rt)}function te(St){return"".concat(St,"-menu-")}function ae(St,qe){var rt=-1;H.Children.forEach(St,function(Ye){rt+=1,Ye&&Ye.type&&Ye.type.isMenuItemGroup?H.Children.forEach(Ye.props.children,function(pe){rt+=1,qe(pe,rt)}):qe(Ye,rt)})}function me(St,qe,rt){if(!St||rt.find)return;H.Children.forEach(St,function(Ye){if(Ye){var pe=Ye.type;if(!pe||!(pe.isSubMenu||pe.isMenuItem||pe.isMenuItemGroup))return;qe.indexOf(Ye.key)!==-1?rt.find=!0:Ye.props.children&&me(Ye.props.children,qe,rt)}})}var Re=["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"],Oe=function(qe){var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ye=qe&&typeof qe.getBoundingClientRect=="function"&&qe.getBoundingClientRect().width;if(Ye){if(rt){var pe=getComputedStyle(qe),Te=pe.marginLeft,nt=pe.marginRight;Ye+=+Te.replace("px","")+ +nt.replace("px","")}Ye=+Ye.toFixed(6)}return Ye||0},Ce=function(qe,rt,Ye){qe&&Object(a.a)(qe.style)==="object"&&(qe.style[rt]=Ye)},Pe=function(){return W.any},He=D("KQm4"),Ee=D("Ff2n"),be=D("i8i4"),Ke=D("bdgK"),bt=D("uciX"),Et=D("8XRh"),yt={adjustX:1,adjustY:1},pt={topLeft:{points:["bl","tl"],overflow:yt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:yt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:yt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:yt,offset:[4,0]}},st={topLeft:{points:["bl","tl"],overflow:yt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:yt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:yt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:yt,offset:[4,0]}},ht=pt,wt=0,_e={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Me=function(qe,rt,Ye){var pe=te(rt),Te=qe.getState();qe.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Te.defaultActiveFirst),{},Object(p.a)({},pe,Ye))})},ye=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(Ye){var pe;Object(z.a)(this,rt),pe=qe.call(this,Ye),pe.onDestroy=function(Ve){pe.props.onDestroy(Ve)},pe.onKeyDown=function(Ve){var gt=Ve.keyCode,It=pe.menuInstance,Zt=pe.props,le=Zt.isOpen,re=Zt.store;if(gt===m.a.ENTER)return pe.onTitleClick(Ve),Me(re,pe.props.eventKey,!0),!0;if(gt===m.a.RIGHT)return le?It.onKeyDown(Ve):(pe.triggerOpenChange(!0),Me(re,pe.props.eventKey,!0)),!0;if(gt===m.a.LEFT){var B;if(le)B=It.onKeyDown(Ve);else return;return B||(pe.triggerOpenChange(!1),B=!0),B}return le&&(gt===m.a.UP||gt===m.a.DOWN)?It.onKeyDown(Ve):void 0},pe.onOpenChange=function(Ve){pe.props.onOpenChange(Ve)},pe.onPopupVisibleChange=function(Ve){pe.triggerOpenChange(Ve,Ve?"mouseenter":"mouseleave")},pe.onMouseEnter=function(Ve){var gt=pe.props,It=gt.eventKey,Zt=gt.onMouseEnter,le=gt.store;Me(le,pe.props.eventKey,!1),Zt({key:It,domEvent:Ve})},pe.onMouseLeave=function(Ve){var gt=pe.props,It=gt.parentMenu,Zt=gt.eventKey,le=gt.onMouseLeave;It.subMenuInstance=Object(X.a)(pe),le({key:Zt,domEvent:Ve})},pe.onTitleMouseEnter=function(Ve){var gt=pe.props,It=gt.eventKey,Zt=gt.onItemHover,le=gt.onTitleMouseEnter;Zt({key:It,hover:!0}),le({key:It,domEvent:Ve})},pe.onTitleMouseLeave=function(Ve){var gt=pe.props,It=gt.parentMenu,Zt=gt.eventKey,le=gt.onItemHover,re=gt.onTitleMouseLeave;It.subMenuInstance=Object(X.a)(pe),le({key:Zt,hover:!1}),re({key:Zt,domEvent:Ve})},pe.onTitleClick=function(Ve){var gt=Object(X.a)(pe),It=gt.props;if(It.onTitleClick({key:It.eventKey,domEvent:Ve}),It.triggerSubMenuAction==="hover")return;pe.triggerOpenChange(!It.isOpen,"click"),Me(It.store,pe.props.eventKey,!1)},pe.onSubMenuClick=function(Ve){typeof pe.props.onClick=="function"&&pe.props.onClick(pe.addKeyPath(Ve))},pe.onSelect=function(Ve){pe.props.onSelect(Ve)},pe.onDeselect=function(Ve){pe.props.onDeselect(Ve)},pe.getPrefixCls=function(){return"".concat(pe.props.rootPrefixCls,"-submenu")},pe.getActiveClassName=function(){return"".concat(pe.getPrefixCls(),"-active")},pe.getDisabledClassName=function(){return"".concat(pe.getPrefixCls(),"-disabled")},pe.getSelectedClassName=function(){return"".concat(pe.getPrefixCls(),"-selected")},pe.getOpenClassName=function(){return"".concat(pe.props.rootPrefixCls,"-submenu-open")},pe.saveMenuInstance=function(Ve){pe.menuInstance=Ve},pe.addKeyPath=function(Ve){return Object(Z.a)(Object(Z.a)({},Ve),{},{keyPath:(Ve.keyPath||[]).concat(pe.props.eventKey)})},pe.triggerOpenChange=function(Ve,gt){var It=pe.props.eventKey,Zt=function(){pe.onOpenChange({key:It,item:Object(X.a)(pe),trigger:gt,open:Ve})};gt==="mouseenter"?pe.mouseenterTimeout=setTimeout(function(){Zt()},0):Zt()},pe.isChildrenSelected=function(){var Ve={find:!1};return me(pe.props.children,pe.props.selectedKeys,Ve),Ve.find},pe.isOpen=function(){return pe.props.openKeys.indexOf(pe.props.eventKey)!==-1},pe.adjustWidth=function(){if(!pe.subMenuTitle||!pe.menuInstance)return;var Ve=be.findDOMNode(pe.menuInstance);if(Ve.offsetWidth>=pe.subMenuTitle.offsetWidth)return;Ve.style.minWidth="".concat(pe.subMenuTitle.offsetWidth,"px")},pe.saveSubMenuTitle=function(Ve){pe.subMenuTitle=Ve},pe.getBaseProps=function(){var Ve=Object(X.a)(pe),gt=Ve.props;return{mode:gt.mode==="horizontal"?"vertical":gt.mode,visible:pe.props.isOpen,level:gt.level+1,inlineIndent:gt.inlineIndent,focusable:!1,onClick:pe.onSubMenuClick,onSelect:pe.onSelect,onDeselect:pe.onDeselect,onDestroy:pe.onDestroy,selectedKeys:gt.selectedKeys,eventKey:"".concat(gt.eventKey,"-menu-"),openKeys:gt.openKeys,motion:gt.motion,onOpenChange:pe.onOpenChange,subMenuOpenDelay:gt.subMenuOpenDelay,parentMenu:Object(X.a)(pe),subMenuCloseDelay:gt.subMenuCloseDelay,forceSubMenuRender:gt.forceSubMenuRender,triggerSubMenuAction:gt.triggerSubMenuAction,builtinPlacements:gt.builtinPlacements,defaultActiveFirst:gt.store.getState().defaultActiveFirst[te(gt.eventKey)],multiple:gt.multiple,prefixCls:gt.rootPrefixCls,id:pe.internalMenuId,manualRef:pe.saveMenuInstance,itemIcon:gt.itemIcon,expandIcon:gt.expandIcon,direction:gt.direction}},pe.getMotion=function(Ve,gt){var It=Object(X.a)(pe),Zt=It.haveRendered,le=pe.props,re=le.motion,B=le.rootPrefixCls,$=Object(Z.a)(Object(Z.a)({},re),{},{leavedClassName:"".concat(B,"-hidden"),removeOnLeave:!1,motionAppear:Zt||!gt||Ve!=="inline"});return $};var Te=Ye.store,nt=Ye.eventKey,Xe=Te.getState(),Pt=Xe.defaultActiveFirst;pe.isRootMenu=!1;var Mt=!1;return Pt&&(Mt=Pt[nt]),Me(Te,nt,Mt),pe}return Object(M.a)(rt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var pe=this,Te=this.props,nt=Te.mode,Xe=Te.parentMenu,Pt=Te.manualRef;if(Pt&&Pt(this),nt!=="horizontal"||!Xe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return pe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var pe=this.props,Te=pe.onDestroy,nt=pe.eventKey;Te&&Te(nt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(pe){var Te=this,nt=this.getBaseProps(),Xe=this.getMotion(nt.mode,nt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||nt.visible||nt.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var Pt=nt.direction;return H.createElement(Et.default,Object.assign({visible:nt.visible},Xe),function(Mt){var Ve=Mt.className,gt=Mt.style,It=r()("".concat(nt.prefixCls,"-sub"),Ve,Object(p.a)({},"".concat(nt.prefixCls,"-rtl"),Pt==="rtl"));return H.createElement(Ae,Object.assign({},nt,{id:Te.internalMenuId,className:It,style:gt}),pe)})}},{key:"render",value:function(){var pe,Te=Object(Z.a)({},this.props),nt=Te.isOpen,Xe=this.getPrefixCls(),Pt=Te.mode==="inline",Mt=r()(Xe,"".concat(Xe,"-").concat(Te.mode),(pe={},Object(p.a)(pe,Te.className,!!Te.className),Object(p.a)(pe,this.getOpenClassName(),nt),Object(p.a)(pe,this.getActiveClassName(),Te.active||nt&&!Pt),Object(p.a)(pe,this.getDisabledClassName(),Te.disabled),Object(p.a)(pe,this.getSelectedClassName(),this.isChildrenSelected()),pe));this.internalMenuId||(Te.eventKey?this.internalMenuId="".concat(Te.eventKey,"$Menu"):(wt+=1,this.internalMenuId="$__$".concat(wt,"$Menu")));var Ve={},gt={},It={};Te.disabled||(Ve={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},gt={onClick:this.onTitleClick},It={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Zt={},le=Te.direction;Pt&&(le==="rtl"?Zt.paddingRight=Te.inlineIndent*Te.level:Zt.paddingLeft=Te.inlineIndent*Te.level);var re={};this.props.isOpen&&(re={"aria-owns":this.internalMenuId});var B=null;Te.mode!=="horizontal"&&(B=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(B=H.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var $=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Zt,className:"".concat(Xe,"-title"),role:"button"},It,gt,{"aria-expanded":nt},re,{"aria-haspopup":"true",title:typeof Te.title=="string"?Te.title:void 0}),Te.title,B||H.createElement("i",{className:"".concat(Xe,"-arrow")})),J=this.renderChildren(Te.children),ne=Te.parentMenu.isRootMenu?Te.parentMenu.props.getPopupContainer:function(qt){return qt.parentNode},ge=_e[Te.mode],Ue=Te.popupOffset?{offset:Te.popupOffset}:{},We=Te.mode==="inline"?"":Te.popupClassName;We+=le==="rtl"?" ".concat(Xe,"-rtl"):"";var _t=Te.disabled,Rt=Te.triggerSubMenuAction,Bt=Te.subMenuOpenDelay,tt=Te.forceSubMenuRender,Dt=Te.subMenuCloseDelay,At=Te.builtinPlacements;Re.forEach(function(qt){return delete Te[qt]}),delete Te.onClick;var nn=le==="rtl"?Object.assign({},st,At):Object.assign({},pt,At);return delete Te.direction,H.createElement("li",Object.assign({},Te,Ve,{className:Mt,role:"menuitem"}),Pt&&$,Pt&&J,!Pt&&H.createElement(bt.a,{prefixCls:Xe,popupClassName:r()("".concat(Xe,"-popup"),We),getPopupContainer:ne,builtinPlacements:nn,popupPlacement:ge,popupVisible:nt,popupAlign:Ue,popup:J,action:_t?[]:[Rt],mouseEnterDelay:Bt,mouseLeaveDelay:Dt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:tt},$))}}]),rt}(H.Component);ye.defaultProps={onMouseEnter:O,onMouseLeave:O,onTitleMouseEnter:O,onTitleMouseLeave:O,onTitleClick:O,manualRef:O,mode:"vertical",title:""};var Se=Object(N.b)(function(St,qe){var rt=St.openKeys,Ye=St.activeKey,pe=St.selectedKeys,Te=qe.eventKey,nt=qe.subMenuKey;return{isOpen:rt.indexOf(Te)>-1,active:Ye[nt]===Te,selectedKeys:pe}})(ye);Se.isSubMenu=!0;var Be=Se,Ze="menuitem-overflowed",ot=.5,ft=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(){var Ye;return Object(z.a)(this,rt),Ye=qe.apply(this,arguments),Ye.resizeObserver=null,Ye.mutationObserver=null,Ye.originalTotalWidth=0,Ye.overflowedItems=[],Ye.menuItemSizes=[],Ye.cancelFrameId=null,Ye.state={lastVisibleIndex:void 0},Ye.getMenuItemNodes=function(){var pe=Ye.props.prefixCls,Te=be.findDOMNode(Object(X.a)(Ye));return Te?[].slice.call(Te.children).filter(function(nt){return nt.className.split(" ").indexOf("".concat(pe,"-overflowed-submenu"))<0}):[]},Ye.getOverflowedSubMenuItem=function(pe,Te,nt){var Xe=Ye.props,Pt=Xe.overflowedIndicator,Mt=Xe.level,Ve=Xe.mode,gt=Xe.prefixCls,It=Xe.theme;if(Mt!==1||Ve!=="horizontal")return null;var Zt=Ye.props.children[0],le=Zt.props,re=le.children,B=le.title,$=le.style,J=Object(Ee.a)(le,["children","title","style"]),ne=Object(Z.a)({},$),ge="".concat(pe,"-overflowed-indicator"),Ue="".concat(pe,"-overflowed-indicator");Te.length===0&&nt!==!0?ne=Object(Z.a)(Object(Z.a)({},ne),{},{display:"none"}):nt&&(ne=Object(Z.a)(Object(Z.a)({},ne),{},{visibility:"hidden",position:"absolute"}),ge="".concat(ge,"-placeholder"),Ue="".concat(Ue,"-placeholder"));var We=It?"".concat(gt,"-").concat(It):"",_t={};return Re.forEach(function(Rt){J[Rt]!==void 0&&(_t[Rt]=J[Rt])}),H.createElement(Be,Object.assign({title:Pt,className:"".concat(gt,"-overflowed-submenu"),popupClassName:We},_t,{key:ge,eventKey:Ue,disabled:!1,style:ne}),Te)},Ye.setChildrenWidthAndResize=function(){if(Ye.props.mode!=="horizontal")return;var pe=be.findDOMNode(Object(X.a)(Ye));if(!pe)return;var Te=pe.children;if(!Te||Te.length===0)return;var nt=pe.children[Te.length-1];Ce(nt,"display","inline-block");var Xe=Ye.getMenuItemNodes(),Pt=Xe.filter(function(Mt){return Mt.className.split(" ").indexOf(Ze)>=0});Pt.forEach(function(Mt){Ce(Mt,"display","inline-block")}),Ye.menuItemSizes=Xe.map(function(Mt){return Oe(Mt,!0)}),Pt.forEach(function(Mt){Ce(Mt,"display","none")}),Ye.overflowedIndicatorWidth=Oe(pe.children[pe.children.length-1],!0),Ye.originalTotalWidth=Ye.menuItemSizes.reduce(function(Mt,Ve){return Mt+Ve},0),Ye.handleResize(),Ce(nt,"display","none")},Ye.handleResize=function(){if(Ye.props.mode!=="horizontal")return;var pe=be.findDOMNode(Object(X.a)(Ye));if(!pe)return;var Te=Oe(pe);Ye.overflowedItems=[];var nt=0,Xe;Ye.originalTotalWidth>Te+ot&&(Xe=-1,Ye.menuItemSizes.forEach(function(Pt){nt+=Pt,nt+Ye.overflowedIndicatorWidth<=Te&&(Xe+=1)})),Ye.setState({lastVisibleIndex:Xe})},Ye}return Object(M.a)(rt,[{key:"componentDidMount",value:function(){var pe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Te=be.findDOMNode(this);if(!Te)return;this.resizeObserver=new Ke.default(function(nt){nt.forEach(function(){var Xe=pe.cancelFrameId;cancelAnimationFrame(Xe),pe.cancelFrameId=requestAnimationFrame(pe.setChildrenWidthAndResize)})}),[].slice.call(Te.children).concat(Te).forEach(function(nt){pe.resizeObserver.observe(nt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){pe.resizeObserver.disconnect(),[].slice.call(Te.children).concat(Te).forEach(function(nt){pe.resizeObserver.observe(nt)}),pe.setChildrenWidthAndResize()}),this.mutationObserver.observe(Te,{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(pe){var Te=this,nt=this.state.lastVisibleIndex;return(pe||[]).reduce(function(Xe,Pt,Mt){var Ve=Pt;if(Te.props.mode==="horizontal"){var gt=Te.getOverflowedSubMenuItem(Pt.props.eventKey,[]);nt!==void 0&&Te.props.className.indexOf("".concat(Te.props.prefixCls,"-root"))!==-1&&(Mt>nt&&(Ve=H.cloneElement(Pt,{style:{display:"none"},eventKey:"".concat(Pt.props.eventKey,"-hidden"),className:"".concat(Ze)})),Mt===nt+1&&(Te.overflowedItems=pe.slice(nt+1).map(function(Zt){return H.cloneElement(Zt,{key:Zt.props.eventKey,mode:"vertical-left"})}),gt=Te.getOverflowedSubMenuItem(Pt.props.eventKey,Te.overflowedItems)));var It=[].concat(Object(He.a)(Xe),[gt,Ve]);return Mt===pe.length-1&&It.push(Te.getOverflowedSubMenuItem(Pt.props.eventKey,[],!0)),It}return[].concat(Object(He.a)(Xe),[Ve])},[])}},{key:"render",value:function(){var pe=this.props,Te=pe.visible,nt=pe.prefixCls,Xe=pe.overflowedIndicator,Pt=pe.mode,Mt=pe.level,Ve=pe.tag,gt=pe.children,It=pe.theme,Zt=Object(Ee.a)(pe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),le=Ve;return H.createElement(le,Object.assign({},Zt),this.renderChildren(gt))}}]),rt}(H.Component);ft.defaultProps={tag:"div",className:""};var Ct=ft;function Ot(St){return St.length?St.every(function(qe){return!!qe.props.disabled}):!0}function Ne(St,qe,rt){var Ye=St.getState();St.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ye.activeKey),{},Object(p.a)({},qe,rt))})}function ke(St){return St.eventKey||"0-menu-"}function at(St,qe){var rt=qe,Ye=St.children,pe=St.eventKey;if(rt){var Te;if(ae(Ye,function(nt,Xe){nt&&nt.props&&!nt.props.disabled&&rt===V(nt,pe,Xe)&&(Te=!0)}),Te)return rt}return rt=null,St.defaultActiveFirst&&ae(Ye,function(nt,Xe){!rt&&nt&&!nt.props.disabled&&(rt=V(nt,pe,Xe))}),rt}function ct(St){if(St){var qe=this.instanceArray.indexOf(St);qe!==-1?this.instanceArray[qe]=St:this.instanceArray.push(St)}}var Ge=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(Ye){var pe;return Object(z.a)(this,rt),pe=qe.call(this,Ye),pe.onKeyDown=function(Te,nt){var Xe=Te.keyCode,Pt;if(pe.getFlatInstanceArray().forEach(function(Ve){Ve&&Ve.props.active&&Ve.onKeyDown&&(Pt=Ve.onKeyDown(Te))}),Pt)return 1;var Mt=null;return(Xe===m.a.UP||Xe===m.a.DOWN)&&(Mt=pe.step(Xe===m.a.UP?-1:1)),Mt?(Te.preventDefault(),Ne(pe.props.store,ke(pe.props),Mt.props.eventKey),typeof nt=="function"&&nt(Mt),1):void 0},pe.onItemHover=function(Te){var nt=Te.key,Xe=Te.hover;Ne(pe.props.store,ke(pe.props),Xe?nt:null)},pe.onDeselect=function(Te){pe.props.onDeselect(Te)},pe.onSelect=function(Te){pe.props.onSelect(Te)},pe.onClick=function(Te){pe.props.onClick(Te)},pe.onOpenChange=function(Te){pe.props.onOpenChange(Te)},pe.onDestroy=function(Te){pe.props.onDestroy(Te)},pe.getFlatInstanceArray=function(){return pe.instanceArray},pe.step=function(Te){var nt=pe.getFlatInstanceArray(),Xe=pe.props.store.getState().activeKey[ke(pe.props)],Pt=nt.length;if(!Pt)return null;Te<0&&(nt=nt.concat().reverse());var Mt=-1;if(nt.every(function(Zt,le){return Zt&&Zt.props.eventKey===Xe?(Mt=le,!1):!0}),!pe.props.defaultActiveFirst&&Mt!==-1&&Ot(nt.slice(Mt,Pt-1)))return;var Ve=(Mt+1)%Pt,gt=Ve;do{var It=nt[gt];if(!It||It.props.disabled)gt=(gt+1)%Pt;else return It}while(gt!==Ve);return null},pe.renderCommonMenuItem=function(Te,nt,Xe){var Pt=pe.props.store.getState(),Mt=Object(X.a)(pe),Ve=Mt.props,gt=V(Te,Ve.eventKey,nt),It=Te.props;if(!It||typeof Te.type=="string")return Te;var Zt=gt===Pt.activeKey,le=Object(Z.a)(Object(Z.a)({mode:It.mode||Ve.mode,level:Ve.level,inlineIndent:Ve.inlineIndent,renderMenuItem:pe.renderMenuItem,rootPrefixCls:Ve.prefixCls,index:nt,parentMenu:Ve.parentMenu,manualRef:It.disabled?void 0:Object(d.a)(Te.ref,ct.bind(Object(X.a)(pe))),eventKey:gt,active:!It.disabled&&Zt,multiple:Ve.multiple,onClick:function(B){(It.onClick||O)(B),pe.onClick(B)},onItemHover:pe.onItemHover,motion:Ve.motion,subMenuOpenDelay:Ve.subMenuOpenDelay,subMenuCloseDelay:Ve.subMenuCloseDelay,forceSubMenuRender:Ve.forceSubMenuRender,onOpenChange:pe.onOpenChange,onDeselect:pe.onDeselect,onSelect:pe.onSelect,builtinPlacements:Ve.builtinPlacements,itemIcon:It.itemIcon||pe.props.itemIcon,expandIcon:It.expandIcon||pe.props.expandIcon},Xe),{},{direction:Ve.direction});return(Ve.mode==="inline"||Pe())&&(le.triggerSubMenuAction="click"),H.cloneElement(Te,le)},pe.renderMenuItem=function(Te,nt,Xe){if(!Te)return null;var Pt=pe.props.store.getState(),Mt={openKeys:Pt.openKeys,selectedKeys:Pt.selectedKeys,triggerSubMenuAction:pe.props.triggerSubMenuAction,subMenuKey:Xe};return pe.renderCommonMenuItem(Te,nt,Mt)},Ye.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Ye.store.getState().activeKey),{},Object(p.a)({},Ye.eventKey,at(Ye,Ye.activeKey)))}),pe.instanceArray=[],pe}return Object(M.a)(rt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(pe){return this.props.visible||pe.visible||this.props.className!==pe.className||!o()(this.props.style,pe.style)}},{key:"componentDidUpdate",value:function(pe){var Te=this.props,nt="activeKey"in Te?Te.activeKey:Te.store.getState().activeKey[ke(Te)],Xe=at(Te,nt);if(Xe!==nt)Ne(Te.store,ke(Te),Xe);else if("activeKey"in pe){var Pt=at(pe,pe.activeKey);Xe!==Pt&&Ne(Te.store,ke(Te),Xe)}}},{key:"render",value:function(){var pe=this,Te=Object(P.a)({},this.props);this.instanceArray=[];var nt=r()(Te.prefixCls,Te.className,"".concat(Te.prefixCls,"-").concat(Te.mode)),Xe={className:nt,role:Te.role||"menu"};Te.id&&(Xe.id=Te.id),Te.focusable&&(Xe.tabIndex=0,Xe.onKeyDown=this.onKeyDown);var Pt=Te.prefixCls,Mt=Te.eventKey,Ve=Te.visible,gt=Te.level,It=Te.mode,Zt=Te.overflowedIndicator,le=Te.theme;return Re.forEach(function(re){return delete Te[re]}),delete Te.onClick,H.createElement(Ct,Object.assign({},Te,{prefixCls:Pt,mode:It,tag:"ul",level:gt,theme:le,visible:Ve,overflowedIndicator:Zt},Xe),H.Children.map(Te.children,function(re,B){return pe.renderMenuItem(re,B,Mt||"0-menu-")}))}}]),rt}(H.Component);Ge.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:O};var et=Object(N.b)()(Ge),Ae=et,ve=D("Kwbf");function xe(St,qe,rt){var Ye=St.prefixCls,pe=St.motion,Te=St.defaultMotions,nt=Te===void 0?{}:Te,Xe=St.openAnimation,Pt=St.openTransitionName,Mt=qe.switchingModeFromInline;if(pe)return pe;if(Object(a.a)(Xe)==="object"&&Xe)Object(ve.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Xe=="string")return{motionName:"".concat(Ye,"-open-").concat(Xe)};if(Pt)return{motionName:Pt};var Ve=nt[rt];return Ve||(Mt?null:nt.other)}var ue=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(Ye){var pe;Object(z.a)(this,rt),pe=qe.call(this,Ye),pe.inlineOpenKeys=[],pe.onSelect=function(Xe){var Pt=Object(X.a)(pe),Mt=Pt.props;if(Mt.selectable){var Ve=pe.store.getState(),gt=Ve.selectedKeys,It=Xe.key;Mt.multiple?gt=gt.concat([It]):gt=[It],"selectedKeys"in Mt||pe.store.setState({selectedKeys:gt}),Mt.onSelect(Object(Z.a)(Object(Z.a)({},Xe),{},{selectedKeys:gt}))}},pe.onClick=function(Xe){var Pt=pe.getRealMenuMode(),Mt=Object(X.a)(pe),Ve=Mt.store,gt=Mt.props.onOpenChange;Pt!=="inline"&&!("openKeys"in pe.props)&&(Ve.setState({openKeys:[]}),gt([])),pe.props.onClick(Xe)},pe.onKeyDown=function(Xe,Pt){pe.innerMenu.getWrappedInstance().onKeyDown(Xe,Pt)},pe.onOpenChange=function(Xe){var Pt=Object(X.a)(pe),Mt=Pt.props,Ve=pe.store.getState().openKeys.concat(),gt=!1,It=function(le){var re=!1;if(le.open)re=Ve.indexOf(le.key)===-1,re&&Ve.push(le.key);else{var B=Ve.indexOf(le.key);re=B!==-1,re&&Ve.splice(B,1)}gt=gt||re};Array.isArray(Xe)?Xe.forEach(It):It(Xe),gt&&("openKeys"in pe.props||pe.store.setState({openKeys:Ve}),Mt.onOpenChange(Ve))},pe.onDeselect=function(Xe){var Pt=Object(X.a)(pe),Mt=Pt.props;if(Mt.selectable){var Ve=pe.store.getState().selectedKeys.concat(),gt=Xe.key,It=Ve.indexOf(gt);It!==-1&&Ve.splice(It,1),"selectedKeys"in Mt||pe.store.setState({selectedKeys:Ve}),Mt.onDeselect(Object(Z.a)(Object(Z.a)({},Xe),{},{selectedKeys:Ve}))}},pe.onMouseEnter=function(Xe){pe.restoreModeVerticalFromInline();var Pt=pe.props.onMouseEnter;Pt&&Pt(Xe)},pe.onTransitionEnd=function(Xe){var Pt=Xe.propertyName==="width"&&Xe.target===Xe.currentTarget,Mt=Xe.target.className,Ve=Object.prototype.toString.call(Mt)==="[object SVGAnimatedString]"?Mt.animVal:Mt,gt=Xe.propertyName==="font-size"&&Ve.indexOf("anticon")>=0;(Pt||gt)&&pe.restoreModeVerticalFromInline()},pe.setInnerMenu=function(Xe){pe.innerMenu=Xe},pe.isRootMenu=!0;var Te=Ye.defaultSelectedKeys,nt=Ye.defaultOpenKeys;return"selectedKeys"in Ye&&(Te=Ye.selectedKeys||[]),"openKeys"in Ye&&(nt=Ye.openKeys||[]),pe.store=Object(N.c)({selectedKeys:Te,openKeys:nt,activeKey:{"0-menu-":at(Ye,Ye.activeKey)}}),pe.state={switchingModeFromInline:!1},pe}return Object(M.a)(rt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(pe){this.updateOpentKeysWhenSwitchMode(pe),this.updateMiniStore();var Te=this.props,nt=Te.siderCollapsed,Xe=Te.inlineCollapsed,Pt=Te.onOpenChange;(!pe.inlineCollapsed&&Xe||!pe.siderCollapsed&&nt)&&Pt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(pe){var Te=this.props,nt=this.store,Xe=this.inlineOpenKeys,Pt=nt.getState(),Mt={};pe.mode==="inline"&&Te.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Te||((Te.inlineCollapsed&&!pe.inlineCollapsed||Te.siderCollapsed&&!pe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Pt.openKeys.concat(),Mt.openKeys=[]),(!Te.inlineCollapsed&&pe.inlineCollapsed||!Te.siderCollapsed&&pe.siderCollapsed)&&(Mt.openKeys=Xe,this.inlineOpenKeys=[])),Object.keys(Mt).length&&nt.setState(Mt)}},{key:"updateMenuDisplay",value:function(){var pe=this.props.collapsedWidth,Te=this.store,nt=this.prevOpenKeys,Xe=this.getInlineCollapsed()&&(pe===0||pe==="0"||pe==="0px");Xe?(this.prevOpenKeys=Te.getState().openKeys.concat(),this.store.setState({openKeys:[]})):nt&&(this.store.setState({openKeys:nt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var pe=this.props.mode,Te=this.state.switchingModeFromInline,nt=this.getInlineCollapsed();return Te&&nt?"inline":nt?"vertical":pe}},{key:"getInlineCollapsed",value:function(){var pe=this.props,Te=pe.inlineCollapsed,nt=pe.siderCollapsed;return nt!==void 0?nt:Te}},{key:"restoreModeVerticalFromInline",value:function(){var pe=this.state.switchingModeFromInline;pe&&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 pe=Object(Z.a)({},Object(n.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Te=this.getRealMenuMode();return pe.className+=" ".concat(pe.prefixCls,"-root"),pe.direction==="rtl"&&(pe.className+=" ".concat(pe.prefixCls,"-rtl")),pe=Object(Z.a)(Object(Z.a)({},pe),{},{mode:Te,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:xe(this.props,this.state,Te)}),delete pe.openAnimation,delete pe.openTransitionName,H.createElement(N.a,{store:this.store},H.createElement(Ae,Object.assign({},pe,{ref:this.setInnerMenu}),this.props.children))}}]),rt}(H.Component);ue.defaultProps={selectable:!0,onClick:O,onSelect:O,onOpenChange:O,onDeselect:O,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var fe=ue,de=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(){var Ye;return Object(z.a)(this,rt),Ye=qe.apply(this,arguments),Ye.onKeyDown=function(pe){var Te=pe.keyCode;return Te===m.a.ENTER?(Ye.onClick(pe),!0):void 0},Ye.onMouseLeave=function(pe){var Te=Ye.props,nt=Te.eventKey,Xe=Te.onItemHover,Pt=Te.onMouseLeave;Xe({key:nt,hover:!1}),Pt({key:nt,domEvent:pe})},Ye.onMouseEnter=function(pe){var Te=Ye.props,nt=Te.eventKey,Xe=Te.onItemHover,Pt=Te.onMouseEnter;Xe({key:nt,hover:!0}),Pt({key:nt,domEvent:pe})},Ye.onClick=function(pe){var Te=Ye.props,nt=Te.eventKey,Xe=Te.multiple,Pt=Te.onClick,Mt=Te.onSelect,Ve=Te.onDeselect,gt=Te.isSelected,It={key:nt,keyPath:[nt],item:Object(X.a)(Ye),domEvent:pe};Pt(It),Xe?gt?Ve(It):Mt(It):gt||Mt(It)},Ye.saveNode=function(pe){Ye.node=pe},Ye}return Object(M.a)(rt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var pe=this.props;pe.onDestroy&&pe.onDestroy(pe.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 pe,Te=Object(Z.a)({},this.props),nt=r()(this.getPrefixCls(),Te.className,(pe={},Object(p.a)(pe,this.getActiveClassName(),!Te.disabled&&Te.active),Object(p.a)(pe,this.getSelectedClassName(),Te.isSelected),Object(p.a)(pe,this.getDisabledClassName(),Te.disabled),pe)),Xe=Object(Z.a)(Object(Z.a)({},Te.attribute),{},{title:typeof Te.title=="string"?Te.title:void 0,className:nt,role:Te.role||"menuitem","aria-disabled":Te.disabled});Te.role==="option"?Xe=Object(Z.a)(Object(Z.a)({},Xe),{},{role:"option","aria-selected":Te.isSelected}):(Te.role===null||Te.role==="none")&&(Xe.role="none");var Pt={onClick:Te.disabled?null:this.onClick,onMouseLeave:Te.disabled?null:this.onMouseLeave,onMouseEnter:Te.disabled?null:this.onMouseEnter},Mt=Object(Z.a)({},Te.style);Te.mode==="inline"&&(Te.direction==="rtl"?Mt.paddingRight=Te.inlineIndent*Te.level:Mt.paddingLeft=Te.inlineIndent*Te.level),Re.forEach(function(gt){return delete Te[gt]}),delete Te.direction;var Ve=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ve=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(n.default)(Te,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Xe,Pt,{style:Mt,ref:this.saveNode}),Te.children,Ve)}}]),rt}(H.Component);de.isMenuItem=!0,de.defaultProps={onSelect:O,onMouseEnter:O,onMouseLeave:O,manualRef:O};var we=Object(N.b)(function(St,qe){var rt=St.activeKey,Ye=St.selectedKeys,pe=qe.eventKey,Te=qe.subMenuKey;return{active:rt[Te]===pe,isSelected:Ye.indexOf(pe)!==-1}})(de),Le=we,ze=function(St){Object(F.a)(rt,St);var qe=Object(I.a)(rt);function rt(){var Ye;return Object(z.a)(this,rt),Ye=qe.apply(this,arguments),Ye.renderInnerMenuItem=function(pe){var Te=Ye.props,nt=Te.renderMenuItem,Xe=Te.index;return nt(pe,Xe,Ye.props.subMenuKey)},Ye}return Object(M.a)(rt,[{key:"render",value:function(){var pe=Object(P.a)({},this.props),Te=pe.className,nt=Te===void 0?"":Te,Xe=pe.rootPrefixCls,Pt="".concat(Xe,"-item-group-title"),Mt="".concat(Xe,"-item-group-list"),Ve=pe.title,gt=pe.children;return Re.forEach(function(It){return delete pe[It]}),delete pe.onClick,delete pe.direction,H.createElement("li",Object.assign({},pe,{className:"".concat(nt," ").concat(Xe,"-item-group")}),H.createElement("div",{className:Pt,title:typeof Ve=="string"?Ve:void 0},Ve),H.createElement("ul",{className:Mt},H.Children.map(gt,this.renderInnerMenuItem)))}}]),rt}(H.Component);ze.isMenuItemGroup=!0,ze.defaultProps={disabled:!0};var dt=ze,Lt=function(qe){var rt=qe.className,Ye=qe.rootPrefixCls,pe=qe.style;return H.createElement("li",{className:"".concat(rt," ").concat(Ye,"-item-divider"),style:pe})};Lt.defaultProps={disabled:!0,className:"",style:{}};var Ft=Lt,kt=ce.e=fe},"24hK":function(je,ce,D){"use strict";D.d(ce,"a",function(){return z});class Z{constructor(M){this.element=M,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class z{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let M=this._first;for(;M!==Z.Undefined;){const X=M.next;M.prev=Z.Undefined,M.next=Z.Undefined,M=X}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,X){const F=new Z(M);if(this._first===Z.Undefined)this._first=F,this._last=F;else if(X){const H=this._last;this._last=F,F.prev=H,H.next=F}else{const H=this._first;this._first=F,F.next=H,H.prev=F}this._size+=1;let I=!1;return()=>{I||(I=!0,this._remove(F))}}shift(){if(this._first===Z.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===Z.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==Z.Undefined&&M.next!==Z.Undefined){const X=M.prev;X.next=M.next,M.next.prev=X}else M.prev===Z.Undefined&&M.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):M.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):M.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==Z.Undefined;)yield M.element,M=M.next}}},"3/fG":function(je,ce,D){"use strict";D.d(ce,"a",function(){return z});function Z(M,X){let F;return X.length===0?F=M:F=M.replace(/\{(\d+)\}/g,function(I,H){const N=H[0];return typeof X[N]!="undefined"?X[N]:I}),F}function z(M,X,...F){return Z(X,F)}},"3tLw":function(je,ce,D){je.exports=D.p+"static/a.39070d50.svg"},"4xil":function(je,ce,D){je.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","right-controls":"right-controls___3oxDi","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","fullscreen-button1":"fullscreen-button1___1murk","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"55Ip":function(je,ce,D){"use strict";D.d(ce,"a",function(){return i});var Z=D("Ty5D"),z=D("dI71"),M=D("q1tI"),X=D.n(M),F=D("YS25"),I=D("17x9"),H=D.n(I),N=D("wx14"),n=D("zLVn"),P=D("9R94"),p=function(b){Object(z.a)(g,b);function g(){for(var C,E=arguments.length,y=new Array(E),U=0;U=0||E.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;b.setState({goInputText:""}),j(b.getValidValue())},b.go=function(E){var y=b.state.goInputText;if(y==="")return;(E.keyCode===u.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(F.a)(v,[{key:"getValidValue",value:function(){var g=this.state,f=g.goInputText,C=g.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var g=this.props,f=g.pageSize,C=g.pageSizeOptions;return C.some(function(E){return E.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(E,y){var U=isNaN(Number(E))?0:Number(E),j=isNaN(Number(y))?0:Number(y);return U-j})}},{key:"render",value:function(){var g=this,f=this.props,C=f.pageSize,E=f.locale,y=f.rootPrefixCls,U=f.changeSize,j=f.quickGo,A=f.goButton,G=f.selectComponentClass,W=f.buildOptionText,O=f.selectPrefixCls,V=f.disabled,te=this.state.goInputText,ae="".concat(y,"-options"),me=G,Re=null,Oe=null,Ce=null;if(!U&&!j)return null;var Pe=this.getPageSizeOptions();if(U&&me){var He=Pe.map(function(Ee,be){return n.a.createElement(me.Option,{key:be,value:Ee.toString()},(W||g.buildOptionText)(Ee))});Re=n.a.createElement(me,{disabled:V,prefixCls:O,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||Pe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(be){return be.parentNode}},He)}return j&&(A&&(Ce=typeof A=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(ae,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),Oe=n.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:V,type:"text",value:te,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Ce)),n.a.createElement("li",{className:"".concat(ae)},Re,Oe)}}]),v}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=o,r=D("N2Kk");function a(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function s(R,w,v){return v}function S(R,w,v){var b=typeof R=="undefined"?w.pageSize:R;return Math.floor((v.total-1)/b)+1}var x=function(R){Object(I.a)(v,R);var w=Object(H.a)(v);function v(b){var g;Object(X.a)(this,v),g=w.call(this,b),g.getJumpPrevPage=function(){return Math.max(1,g.state.current-(g.props.showLessItems?3:5))},g.getJumpNextPage=function(){return Math.min(S(void 0,g.state,g.props),g.state.current+(g.props.showLessItems?3:5))},g.getItemIcon=function(U,j){var A=g.props.prefixCls,G=U||n.a.createElement("button",{type:"button","aria-label":j,className:"".concat(A,"-item-link")});return typeof U=="function"&&(G=n.a.createElement(U,Object(M.a)({},g.props))),G},g.savePaginationNode=function(U){g.paginationNode=U},g.isValid=function(U){return i(U)&&U!==g.state.current},g.shouldDisplayQuickJumper=function(){var U=g.props,j=U.showQuickJumper,A=U.pageSize,G=U.total;return G<=A?!1:j},g.handleKeyDown=function(U){(U.keyCode===u.ARROW_UP||U.keyCode===u.ARROW_DOWN)&&U.preventDefault()},g.handleKeyUp=function(U){var j=g.getValidValue(U),A=g.state.currentInputValue;j!==A&&g.setState({currentInputValue:j}),U.keyCode===u.ENTER?g.handleChange(j):U.keyCode===u.ARROW_UP?g.handleChange(j-1):U.keyCode===u.ARROW_DOWN&&g.handleChange(j+1)},g.changePageSize=function(U){var j=g.state.current,A=S(U,g.state,g.props);j=j>A?A:j,A===0&&(j=g.state.current),typeof U=="number"&&("pageSize"in g.props||g.setState({pageSize:U}),"current"in g.props||g.setState({current:j,currentInputValue:j})),g.props.onShowSizeChange(j,U),"onChange"in g.props&&g.props.onChange&&g.props.onChange(j,U)},g.handleChange=function(U){var j=g.props.disabled,A=U;if(g.isValid(A)&&!j){var G=S(void 0,g.state,g.props);A>G?A=G:A<1&&(A=1),"current"in g.props||g.setState({current:A,currentInputValue:A});var W=g.state.pageSize;return g.props.onChange(A,W),A}return g.state.current},g.prev=function(){g.hasPrev()&&g.handleChange(g.state.current-1)},g.next=function(){g.hasNext()&&g.handleChange(g.state.current+1)},g.jumpPrev=function(){g.handleChange(g.getJumpPrevPage())},g.jumpNext=function(){g.handleChange(g.getJumpNextPage())},g.hasPrev=function(){return g.state.current>1},g.hasNext=function(){return g.state.current2?A-2:0),W=2;W=C?y=C:y=Number(f),y}},{key:"getShowSizeChanger",value:function(){var g=this.props,f=g.showSizeChanger,C=g.total,E=g.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>E}},{key:"renderPrev",value:function(g){var f=this.props,C=f.prevIcon,E=f.itemRender,y=E(g,"prev",this.getItemIcon(C,"prev page")),U=!this.hasPrev();return Object(N.isValidElement)(y)?Object(N.cloneElement)(y,{disabled:U}):y}},{key:"renderNext",value:function(g){var f=this.props,C=f.nextIcon,E=f.itemRender,y=E(g,"next",this.getItemIcon(C,"next page")),U=!this.hasNext();return Object(N.isValidElement)(y)?Object(N.cloneElement)(y,{disabled:U}):y}},{key:"render",value:function(){var g=this,f=this.props,C=f.prefixCls,E=f.className,y=f.style,U=f.disabled,j=f.hideOnSinglePage,A=f.total,G=f.locale,W=f.showQuickJumper,O=f.showLessItems,V=f.showTitle,te=f.showTotal,ae=f.simple,me=f.itemRender,Re=f.showPrevNextJumpers,Oe=f.jumpPrevIcon,Ce=f.jumpNextIcon,Pe=f.selectComponentClass,He=f.selectPrefixCls,Ee=f.pageSizeOptions,be=this.state,Ke=be.current,bt=be.pageSize,Et=be.currentInputValue;if(j===!0&&A<=bt)return null;var yt=S(void 0,this.state,this.props),pt=[],st=null,ht=null,wt=null,_e=null,Me=null,ye=W&&W.goButton,Se=O?1:2,Be=Ke-1>0?Ke-1:0,Ze=Ke+1=Se*2&&Ke!==1+2&&(pt[0]=Object(N.cloneElement)(pt[0],{className:"".concat(C,"-item-after-jump-prev")}),pt.unshift(st)),yt-Ke>=Se*2&&Ke!==yt-2&&(pt[pt.length-1]=Object(N.cloneElement)(pt[pt.length-1],{className:"".concat(C,"-item-before-jump-next")}),pt.push(ht)),at!==1&&pt.unshift(wt),ct!==yt&&pt.push(_e)}var Ae=null;te&&(Ae=n.a.createElement("li",{className:"".concat(C,"-total-text")},te(A,[A===0?0:(Ke-1)*bt+1,Ke*bt>A?A:Ke*bt])));var ve=!this.hasPrev()||!yt,xe=!this.hasNext()||!yt;return n.a.createElement("ul",Object(Z.a)({className:p()(C,E,Object(z.a)({},"".concat(C,"-disabled"),U)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},ot),Ae,n.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:ve?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(z.a)({},"".concat(C,"-disabled"),ve)),"aria-disabled":ve},this.renderPrev(Be)),pt,n.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:xe?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(z.a)({},"".concat(C,"-disabled"),xe)),"aria-disabled":xe},this.renderNext(Ze)),n.a.createElement(h,{disabled:U,locale:G,rootPrefixCls:C,selectComponentClass:Pe,selectPrefixCls:He,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ke,pageSize:bt,pageSizeOptions:Ee,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ye}))}}],[{key:"getDerivedStateFromProps",value:function(g,f){var C={};if("current"in g&&(C.current=g.current,g.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in g&&g.pageSize!==f.pageSize){var E=f.current,y=S(g.pageSize,f,g);E=E>y?y:E,"current"in g||(C.current=E,C.currentInputValue=E),C.pageSize=g.pageSize}return C}}]),v}(n.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:r.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var T=x},"6RRn":function(je,ce,D){"use strict";var Z=D("wCXF"),z=D("n6Qo");D.d(ce,"b",function(){return z.a});var M=D("IBYe"),X=D("6eGT"),F=D("hW8S");D.d(ce,"a",function(){return F.a}),ce.c=Z.b},"6UM0":function(je,ce,D){var Z,z;(function(){var M;(function(){"use strict";var F=[function(n,P,p){var m=p(1).Beautifier,d=p(5).Options;function u(o,h){var r=new m(o,h);return r.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new d}},function(n,P,p){var m=p(2).Output,d=p(3).Token,u=p(4),o=p(5).Options,h=p(7).Tokenizer,r=p(7).line_starters,a=p(7).positionable_operators,i=p(7).TOKEN;function s(O,V){return V.indexOf(O)!==-1}function S(O){return O.replace(/^\s+/g,"")}function x(O){for(var V={},te=0;tete&&(te=O.line_indent_level));var ae={mode:V,parent:O,last_token:O?O.last_token:new d(i.START_BLOCK,""),last_word:O?O.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:O?O.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},G.prototype._reset=function(O){var V=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var te=new h(O,this._options);return this._tokens=te.tokenize(),O},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,V=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=` `,V&&u.lineBreak.test(V||"")&&(te=V.match(u.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return O=this._output.get_code(te),O},G.prototype.handle_token=function(O,V){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,V):O.type===i.COMMENT?this.handle_comment(O,V):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,V):this.handle_unknown(O,V)},G.prototype.handle_whitespace_and_comments=function(O,V){var te=O.newlines,ae=this._options.keep_array_indentation&&y(this._flags.mode);if(O.comments_before)for(var me=O.comments_before.next();me;)this.handle_whitespace_and_comments(me,V),this.handle_token(me,V),me=O.comments_before.next();if(ae)for(var Re=0;Re0,V);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,V);for(var Oe=1;Oe0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(O){var V=!1;return V=V||R(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,V=V||T(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&R(this._flags.last_token,W)&&!O.newlines,V=V||T(this._flags.last_token,"else")&&!(T(O,"if")&&!O.comments_before),V=V||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),V=V||this._flags.last_token.type===i.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,V=V||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),V?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,R(O,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var V=f.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=f.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),s(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=f.ForInitializer):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=f.Conditional):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(s(this._flags.last_token.text,r)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var ae=this._tokens.peek(-4);R(te,["async","function"])||te.text==="*"&&R(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(O){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(O),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var V=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):te&&(s(te.text,[":",","])&&s(V.type,[i.STRING,i.WORD,i.RESERVED])||s(V.text,["get","set","..."])&&s(te.type,[i.WORD,i.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(te.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):s(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!V.comments_before&&V.text==="}",me=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Re=0,Oe=null;this._flags.inline_frame=!0;do if(Re+=1,Oe=this._tokens.peek(Re-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==i.EOF&&!(Oe.type===i.END_BLOCK&&Oe.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(me||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===f.Statement;)this.restore_mode();var V=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(O)},G.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(s(O.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&s(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(s(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===f.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?R(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(T(O,"while")){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(O,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),T(O,"function")){(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(s(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,W)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var te="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":R(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===f.BlockStatement?te="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&U(this._flags.mode)?te="SPACE":this._flags.last_token.type===i.STRING?te="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(s(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&s(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),R(O,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),R(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?R(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!R(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(O,"if")&&T(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(O,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(O,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var V=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&T(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},G.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},G.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},G.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(U(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},G.prototype.handle_operator=function(O){var V=O.text==="*"&&(R(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),te=s(O.text,["-","+"])&&(s(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||s(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var ae=!V;this.handle_whitespace_and_comments(O,ae)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&s(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,Re=!0,Oe=!1;if(O.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,Oe=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!te&&!V&&this._options.preserve_newlines&&s(O.text,a)){var Ce=O.text===":",Pe=Ce&&Oe,He=Ce&&!Oe;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!He,this.print_token(O),(!Ce||Pe)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Ce||Pe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case b.preserve_newline:He||this.allow_wrap_or_preserved_newline(O),me=!(this._output.just_added_newline()||He),this._output.space_before_token=me,this.print_token(O),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(O),me=!1;var Ee=this._tokens.peek();Re=Ee&&s(Ee.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),me=this._flags.last_token.type===i.START_BLOCK,Re=!1;else if(s(O.text,["--","++","!","~"])||te){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),me=!1,Re=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var be=R(this._flags.last_token,w)&&O.newlines;be&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(be,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(me=!0),this._flags.last_token.type===i.RESERVED?me=!0:this._flags.last_token.type===i.END_EXPR?me=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(me=s(O.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(O.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(Re=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(O),this._output.space_before_token=Re},G.prototype.handle_block_comment=function(O,V){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,V),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,V)},G.prototype.print_block_commment=function(O,V){var te=E(O.text),ae,me=!1,Re=!1,Oe=O.whitespace_before,Ce=Oe.length;if(this.print_newline(!1,V),this.print_token_line_indentation(O),this._output.add_token(te[0]),this.print_newline(!1,V),te.length>1){for(te=te.slice(1),me=j(te,"*"),Re=A(te,Oe),me&&(this._flags.alignment=1),ae=0;ae=0;u--)if(this.__items[u].match(d))return!0;return!1},P.prototype.set_indent=function(d,u){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(d){this.__items.push(d);var u=d.lastIndexOf(` `);u!==-1?this.__character_count=d.length-u:this.__character_count+=d.length},P.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function p(d,u){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),u=u||"",d.indent_level>0&&(u=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}p.prototype.get_indent_size=function(d,u){var o=this.__base_string_length;return u=u||0,d<0&&(o=0),o+=d*this.__indent_size,o+=u,o},p.prototype.get_indent_string=function(d,u){var o=this.__base_string;return u=u||0,d<0&&(d=0,o=""),u+=d*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},p.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var d=this.__cache.length,u=0,o="";this.__indent_size&&d>=this.__indent_size&&(u=Math.floor(d/this.__indent_size),d-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),d&&(o+=new Array(d+1).join(" ")),this.__cache.push(o)};function m(d,u){this.__indent_cache=new p(d,u),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(d,u){return this.__indent_cache.get_indent_string(d,u)},m.prototype.get_indent_size=function(d,u){return this.__indent_cache.get_indent_size(d,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(d){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return d!==` `&&(o=o.replace(/[\n]/g,d)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(d,u){return d=d||0,u=u||0,this.next_line.set_indent(d,u),this.__lines.length>1?(this.current_line.set_indent(d,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(d){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(d,u){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(d)!==0&&h.item(-1)!==u){this.__lines.splice(o+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=m},function(n){function P(p,m,d,u){this.type=p,this.text=m,this.comments_before=null,this.newlines=d||0,this.whitespace_before=u||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=P},function(n,P){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+d+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+m+d+u+"])*";P.identifier=new RegExp(o+h,"g"),P.identifierStart=new RegExp(o),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+d+u+"])+");var r=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;P.newline=/[\n\r\u2028\u2029]/,P.lineBreak=new RegExp(`\r |`+P.newline.source),P.allLineBreaks=new RegExp(P.lineBreak.source,"g")},function(n,P,p){var m=p(6).Options,d=["before-newline","after-newline","preserve-newline"];function u(o){m.call(this,o,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var b=new RegExp(v),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),E,y=function(j,A){d.call(this,j,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new r(this._input),W=new a(this._input).read_options(this._options);this.__patterns={template:W,identifier:W.starting_with(h.identifier).matching(h.identifierMatch),number:G.matching(x),punct:G.matching(b),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(//),include:G.starting_with(/#include/).until_after(h.lineBreak),shebang:G.starting_with(/#!/).until_after(h.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:W.until(/['\\\n\r\u2028\u2029]/),double_quote:W.until(/["\\\n\r\u2028\u2029]/),template_text:W.until(/[`\\$]/),template_expression:W.until(/[`}\\]/)}};y.prototype=new d,y.prototype._is_comment=function(j){return j.type===s.COMMENT||j.type===s.BLOCK_COMMENT||j.type===s.UNKNOWN},y.prototype._is_opening=function(j){return j.type===s.START_BLOCK||j.type===s.START_EXPR},y.prototype._is_closing=function(j,A){return(j.type===s.END_BLOCK||j.type===s.END_EXPR)&&A&&(j.text==="]"&&A.text==="["||j.text===")"&&A.text==="("||j.text==="}"&&A.text==="{")},y.prototype._reset=function(){E=!1},y.prototype._get_next_token=function(j,A){var G=null;this._readWhitespace();var W=this._input.peek();return W===null?this._create_token(s.EOF,""):(G=G||this._read_non_javascript(W),G=G||this._read_string(W),G=G||this._read_word(j),G=G||this._read_singles(W),G=G||this._read_comment(W),G=G||this._read_regexp(W,j),G=G||this._read_xml(W,j),G=G||this._read_punctuation(),G=G||this._create_token(s.UNKNOWN,this._input.next()),G)},y.prototype._read_word=function(j){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(h.allLineBreaks,` `),!(j.type===s.DOT||j.type===s.RESERVED&&(j.text==="set"||j.text==="get"))&&C.test(A)?(A==="in"||A==="of")&&(j.type===s.WORD||j.type===s.STRING)?this._create_token(s.OPERATOR,A):this._create_token(s.RESERVED,A):this._create_token(s.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(s.WORD,A)},y.prototype._read_singles=function(j){var A=null;return j==="("||j==="["?A=this._create_token(s.START_EXPR,j):j===")"||j==="]"?A=this._create_token(s.END_EXPR,j):j==="{"?A=this._create_token(s.START_BLOCK,j):j==="}"?A=this._create_token(s.END_BLOCK,j):j===";"?A=this._create_token(s.SEMICOLON,j):j==="."&&R.test(this._input.peek(1))?A=this._create_token(s.DOT,j):j===","&&(A=this._create_token(s.COMMA,j)),A&&this._input.next(),A},y.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(s.EQUALS,j):j==="?."?this._create_token(s.DOT,j):this._create_token(s.OPERATOR,j)},y.prototype._read_non_javascript=function(j){var A="";if(j==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(s.UNKNOWN,A.trim()+` `);if(A=this.__patterns.include.read(),A)return this._create_token(s.UNKNOWN,A.trim()+` `);j=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(T)){do j=this._input.next(),G+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,G)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)A+=this._input.next();return E=!0,this._create_token(s.COMMENT,A)}}else if(E&&j==="-"&&(A=this.__patterns.html_comment_end.read(),A))return E=!1,this._create_token(s.COMMENT,A);return null},y.prototype._read_comment=function(j){var A=null;if(j==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var W=S.get_directives(G);W&&W.ignore==="start"&&(G+=S.readIgnored(this._input)),G=G.replace(h.allLineBreaks,` `),A=this._create_token(s.BLOCK_COMMENT,G),A.directives=W}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),A=this._create_token(s.COMMENT,G))}return A},y.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var A=this._input.next();return this.has_char_escapes=!1,j==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(A=U(A)),this._input.peek()===j&&(A+=this._input.next()),A=A.replace(h.allLineBreaks,` `),this._create_token(s.STRING,A)}return null},y.prototype._allow_regexp_or_xml=function(j){return j.type===s.RESERVED&&i(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===s.END_EXPR&&j.text===")"&&j.opened.previous.type===s.RESERVED&&i(j.opened.previous.text,["if","while","for"])||i(j.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(j,A){if(j==="/"&&this._allow_regexp_or_xml(A)){for(var G=this._input.next(),W=!1,O=!1;this._input.hasNext()&&(W||O||this._input.peek()!==j)&&!this._input.testChar(h.newline);)G+=this._input.peek(),W?W=!1:(W=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===j&&(G+=this._input.next(),G+=this._input.read(h.identifier)),this._create_token(s.STRING,G)}return null},y.prototype._read_xml=function(j,A){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(A)){var G="",W=this.__patterns.xml.read_match();if(W){for(var O=W[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=O.indexOf("{")===0,te=0;W;){var ae=!!W[1],me=W[2],Re=!!W[W.length-1]||me.slice(0,8)==="![CDATA[";if(!Re&&(me===O||V&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--te:++te),G+=W[0],te<=0)break;W=this.__patterns.xml.read_match()}return W||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(h.allLineBreaks,` `),this._create_token(s.STRING,G)}}return null};function U(j){for(var A="",G=0,W=new m(j),O=null;W.hasNext();)if(O=W.match(/([\s]|[^\\]|\\\\)+/g),O&&(A+=O[0]),W.peek()==="\\"){if(W.next(),W.peek()==="x")O=W.match(/x([0-9A-Fa-f]{2})/g);else if(W.peek()==="u")O=W.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",W.hasNext()&&(A+=W.next());continue}if(!O)return j;if(G=parseInt(O[1],16),G>126&&G<=255&&O[0].indexOf("x")===0)return j;if(G>=0&&G<32){A+="\\"+O[0];continue}else G===34||G===39||G===92?A+="\\"+String.fromCharCode(G):A+=String.fromCharCode(G)}return A}y.prototype._read_string_recursive=function(j,A,G){var W,O;j==="'"?O=this.__patterns.single_quote:j==='"'?O=this.__patterns.double_quote:j==="`"?O=this.__patterns.template_text:j==="}"&&(O=this.__patterns.template_expression);for(var V=O.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!A&&h.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(W=this._input.peek(),W==="x"||W==="u"?this.has_char_escapes=!0:W==="\r"&&this._input.peek(1)===` `&&this._input.next(),te+=this._input.next()):G&&(G==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),G===te&&(j==="`"?te+=this._read_string_recursive("}",A,"`"):te+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=O.read(),V+=te}return V},n.exports.Tokenizer=y,n.exports.TOKEN=s,n.exports.positionable_operators=w.slice(),n.exports.line_starters=g.slice()},function(n){var P=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&m=0&&d=m.length&&this.__input.substring(d-m.length,d).toLowerCase()===m},n.exports.InputScanner=p},function(n,P,p){var m=p(8).InputScanner,d=p(3).Token,u=p(10).TokenStream,o=p(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(a,i){this._input=new m(a),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var a,i=new d(h.START,""),s=null,S=[],x=new u;i.type!==h.EOF;){for(a=this._get_next_token(i,s);this._is_comment(a);)x.add(a),a=this._get_next_token(i,s);x.isEmpty()||(a.comments_before=x,x=new u),a.parent=s,this._is_opening(a)?(S.push(s),s=a):s&&this._is_closing(a,s)&&(a.opened=s,s.closed=a,s=S.pop(),a.parent=s),a.previous=i,i.next=a,this.__tokens.add(a),i=a}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(a,i){this._readWhitespace();var s=this._input.read(/.+/g);return s?this._create_token(h.RAW,s):this._create_token(h.EOF,"")},r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return!1},r.prototype._is_closing=function(a,i){return!1},r.prototype._create_token=function(a,i){var s=new d(a,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return s},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=r,n.exports.TOKEN=h},function(n){function P(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}P.prototype.restart=function(){this.__position=0},P.prototype.isEmpty=function(){return this.__tokens_length===0},P.prototype.hasNext=function(){return this.__position=0&&p/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}u.prototype=new m,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(o){var h=this._create();return h._disabled[o]=!0,h._update(),h},u.prototype.read_options=function(o){var h=this._create();for(var r in d)h._disabled[r]=o.templating.indexOf(r)===-1;return h._update(),h},u.prototype.exclude=function(o){var h=this._create();return h._excluded[o]=!0,h._update(),h},u.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),o+=h,h=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},u.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},u.prototype._read_template=function(){var o="",h=this._input.peek();if(h==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(o=o||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=u}],I={};function H(n){var P=I[n];if(P!==void 0)return P.exports;var p=I[n]={exports:{}};return F[n](p,p.exports,H),p.exports}var N=H(0);M=N})();var X=M;!(Z=[],z=function(){return{js_beautify:X}}.apply(ce,Z),z!==void 0&&(je.exports=z))})()},"6eGT":function(je,ce,D){"use strict";function Z(z){return null}ce.a=Z},"7+5b":function(je,ce,D){je.exports=D.p+"static/v.e7f297d6.svg"},"746U":function(je,ce,D){"use strict";D.d(ce,"f",function(){return Z}),D.d(ce,"l",function(){return z}),D.d(ce,"k",function(){return M}),D.d(ce,"j",function(){return X}),D.d(ce,"g",function(){return F}),D.d(ce,"m",function(){return I}),D.d(ce,"h",function(){return H}),D.d(ce,"n",function(){return N}),D.d(ce,"c",function(){return n}),D.d(ce,"a",function(){return P}),D.d(ce,"i",function(){return p}),D.d(ce,"o",function(){return m}),D.d(ce,"e",function(){return o}),D.d(ce,"d",function(){return h}),D.d(ce,"p",function(){return r}),D.d(ce,"b",function(){return a});function Z(i){return Array.isArray(i)}function z(i){return typeof i=="string"}function M(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function X(i){return typeof i=="number"&&!isNaN(i)}function F(i){return i===!0||i===!1}function I(i){return typeof i=="undefined"}function H(i){return!N(i)}function N(i){return I(i)||i===null}function n(i,s){if(!i)throw new Error(s?`Unexpected type, expected '${s}'`:"Unexpected type")}function P(i){if(N(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function p(i){return typeof i=="function"}function m(i,s){const S=Math.min(i.length,s.length);for(let x=0;xfunction(){const R=Array.prototype.slice.call(arguments,0);return s(T,R)};let x={};for(const T of i)x[T]=S(T);return x}function r(i){return i===null?void 0:i}function a(i,s="Unreachable"){throw new Error(s)}},"7Cbv":function(je,ce,D){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),z=new Uint8Array(16);function M(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(z)}var X=/^(?:[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 F(d){return typeof d=="string"&&X.test(d)}for(var I=F,H=[],N=0;N<256;++N)H.push((N+256).toString(16).substr(1));function n(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(H[d[u+0]]+H[d[u+1]]+H[d[u+2]]+H[d[u+3]]+"-"+H[d[u+4]]+H[d[u+5]]+"-"+H[d[u+6]]+H[d[u+7]]+"-"+H[d[u+8]]+H[d[u+9]]+"-"+H[d[u+10]]+H[d[u+11]]+H[d[u+12]]+H[d[u+13]]+H[d[u+14]]+H[d[u+15]]).toLowerCase();if(!I(o))throw TypeError("Stringified UUID is invalid");return o}var P=n;function p(d,u,o){d=d||{};var h=d.random||(d.rng||M)();if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,u){o=o||0;for(var r=0;r<16;++r)u[o+r]=h[r];return u}return P(h)}var m=ce.a=p},"7ahc":function(je,ce,D){"use strict";D.d(ce,"a",function(){return S});var Z=D("k1fw"),z=D("0Owb"),M=D("+L6B"),X=D("2/Rp"),F=D("y8nQ"),I=D("Vl3Y"),H=D("tJVT"),N=D("OaEy"),n=D("2fM7"),P=D("q1tI"),p=D.n(P),m=D("VrN/"),d=D.n(m),u=D("p77/"),o=D.n(u),h=D("c5Ni"),r=D.n(h),a=n.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};ce.b=function(x){var T=x.callback,R=x.onCancel,w=Object(P.useState)("python"),v=Object(H.a)(w,2),b=v[0],g=v[1];function f(E){g(s[E][1])}function C(E){T(E)}return p.a.createElement(I.a,Object(z.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),p.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(n.a,{onChange:f},Object.keys(s).map(function(E){return p.a.createElement(a,{key:E,value:E},s[E][0])}))),p.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(S,{mode:b})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function S(x){var T=x.value,R=x.onChange,w=x.mode,v=x.options,b=v===void 0?{}:v,g=Object(P.useRef)(),f=Object(P.useState)(),C=Object(H.a)(f,2),E=C[0],y=C[1];return Object(P.useEffect)(function(){if(E){function U(j){var A=j.getValue();R&&R(A)}return E.on("change",U),function(){E.off("change",U)}}},[E,R]),Object(P.useEffect)(function(){E&&E.setOption("mode",w)},[E,w]),Object(P.useEffect)(function(){E&&((T!==E.getValue()||T==="")&&setTimeout(function(){E.setValue(T||" ")},300))},[E,T]),Object(P.useEffect)(function(){if(g.current&&!E){var U=d.a.fromTextArea(g.current,Object(Z.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));y(U)}},[g.current,E]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:g}))}},"7ixt":function(je,ce,D){"use strict";D.d(ce,"a",function(){return M});var Z={adjustX:1,adjustY:1},z=[0,0],M={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:z}},X=M},"7qur":function(je,ce,D){"use strict";D.d(ce,"m",function(){return z}),D.d(ce,"s",function(){return M}),D.d(ce,"h",function(){return X}),D.d(ce,"o",function(){return F}),D.d(ce,"n",function(){return I}),D.d(ce,"l",function(){return H}),D.d(ce,"b",function(){return N}),D.d(ce,"q",function(){return n}),D.d(ce,"t",function(){return P}),D.d(ce,"v",function(){return p}),D.d(ce,"w",function(){return m}),D.d(ce,"u",function(){return d}),D.d(ce,"p",function(){return u}),D.d(ce,"f",function(){return o}),D.d(ce,"a",function(){return h}),D.d(ce,"j",function(){return r}),D.d(ce,"k",function(){return a}),D.d(ce,"d",function(){return i}),D.d(ce,"g",function(){return s}),D.d(ce,"c",function(){return S}),D.d(ce,"e",function(){return x}),D.d(ce,"i",function(){return T}),D.d(ce,"r",function(){return R});var Z=D("ErOA");function z(w){return Object(Z.c)("mypractices/".concat(w,".json"),{hidePopLogin:!0})}function M(w,v){return Object(Z.f)("mypractices/".concat(w,"/code_submit.json"),v)}function X(w,v){return Object(Z.c)("mypractices/".concat(w,"/code_debug.json"),v)}function F(w,v){return Object(Z.c)("mypractices/".concat(w,"/submit_records.json"),v)}function I(w){return Object(Z.c)("mypractices/record_detail.json",{id:w})}function H(w,v){return Object(Z.c)("mypractices/".concat(w,"/result.json"),{mode:v})}function N(w,v){return Object(Z.f)("mypractices/".concat(w,"/add_notes.json"),v)}function n(w,v){return Object(Z.f)("mypractices/".concat(w,"/restore_initial_code.json"),v)}function P(w,v){return Object(Z.f)("mypractices/".concat(w,"/sync_code.json"),v)}function p(w,v){return Object(Z.f)("mypractices/".concat(w,"/update_code.json"),v)}function m(w){return Object(Z.f)("mypractices/".concat(w,"/initial_codes.json"))}function d(w,v){return Object(Z.f)("discusses/".concat(w,"/plus.json"),v)}function u(w){return Object(Z.c)("practices/practices_list.json",w)}function o(w,v){return Object(Z.c)("practices/".concat(w,"/question_solution_articles"),v)}function h(w,v){return Object(Z.f)("practices/".concat(w,"/question_solution_articles"),v)}function r(w,v){return Object(Z.g)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function a(w,v){return Object(Z.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/edit"),v)}function i(w,v){return Object(Z.c)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function s(w,v){return Object(Z.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/set_authority_or_excellent"),v)}function S(w,v){return Object(Z.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/praise_or_treads"),v)}function x(w,v){return Object(Z.f)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active,"/hide"))}function T(w,v){return Object(Z.b)("practices/".concat(w,"/question_solution_articles/").concat(v==null?void 0:v.active),v)}function R(w,v){return Object(Z.f)("mypractices/".concat(w,"/update_practice_time_sum"),v)}},"815F":function(je,ce,D){"use strict";D.d(ce,"e",function(){return H}),D.d(ce,"c",function(){return n}),D.d(ce,"d",function(){return P}),D.d(ce,"a",function(){return m}),D.d(ce,"f",function(){return d}),D.d(ce,"b",function(){return u});var Z=D("KQm4"),z=D("VTBJ"),M=D("Ff2n"),X=D("Zm9Q"),F=D("Kwbf"),I=D("OZM5");function H(o,h){return o!=null?o:h}function N(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=new Map;function r(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(s){var S=s.key,x=s.children;Object(F.a)(S!=null,"Tree node must have a certain key: [".concat(i).concat(S,"]"));var T=String(S);Object(F.a)(!h.has(T)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(T)),h.set(T,!0),r(x,"".concat(i).concat(T," > "))})}r(o)}function n(o){function h(r){var a=Object(X.a)(r);return a.map(function(i){if(!Object(I.i)(i))return Object(F.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var s=i.key,S=i.props,x=S.children,T=Object(M.a)(S,["children"]),R=Object(z.a)({key:s},T),w=h(x);return w.length&&(R.children=w),R}).filter(function(i){return i})}return h(o)}function P(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(h===!0?[]:h),a=[];function i(s){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(x,T){var R=Object(I.h)(S?S.pos:"0",T),w=H(x.key,R),v=Object(z.a)(Object(z.a)({},x),{},{parent:S,pos:R,children:null,data:x,isStart:[].concat(Object(Z.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(Z.a)(S?S.isEnd:[]),[T===s.length-1])});return a.push(v),h===!0||r.has(w)?v.children=i(x.children||[],v):v.children=[],v})}return i(o),a}function p(o,h,r){var a;r?typeof r=="string"?a=function(S){return S[r]}:typeof r=="function"&&(a=function(S){return r(S)}):a=function(S,x){return H(S.key,x)};function i(s,S,x){var T=s?s.children:o,R=s?Object(I.h)(x.pos,S):"0";if(s){var w=a(s,R),v={node:s,index:S,pos:R,key:w,parentPos:x.node?x.pos:null,level:x.level+1};h(v)}T&&T.forEach(function(b,g){i(b,g,{node:s,pos:R,level:x?x.level+1:-1})})}i(null)}function m(o){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=h.initWrapper,a=h.processEntity,i=h.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,S={},x={},T={posEntities:S,keyEntities:x};return r&&(T=r(T)||T),p(o,function(R){var w=R.node,v=R.index,b=R.pos,g=R.key,f=R.parentPos,C=R.level,E={node:w,index:v,key:g,pos:b,level:C},y=H(g,b);S[b]=E,x[y]=E,E.parent=S[f],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),a&&a(E,T)},s),i&&i(T),T}function d(o,h){var r=h.expandedKeys,a=h.selectedKeys,i=h.loadedKeys,s=h.loadingKeys,S=h.checkedKeys,x=h.halfCheckedKeys,T=h.dragOverNodeKey,R=h.dropPosition,w=h.keyEntities,v=w[o],b={eventKey:o,expanded:r.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:i.indexOf(o)!==-1,loading:s.indexOf(o)!==-1,checked:S.indexOf(o)!==-1,halfChecked:x.indexOf(o)!==-1,pos:String(v?v.pos:""),dragOver:T===o&&R===0,dragOverGapTop:T===o&&R===-1,dragOverGapBottom:T===o&&R===1};return b}function u(o){var h=o.data,r=o.expanded,a=o.selected,i=o.checked,s=o.loaded,S=o.loading,x=o.halfChecked,T=o.dragOver,R=o.dragOverGapTop,w=o.dragOverGapBottom,v=o.pos,b=o.active,g=Object(z.a)(Object(z.a)({},h),{},{expanded:r,selected:a,checked:i,loaded:s,loading:S,halfChecked:x,dragOver:T,dragOverGapTop:R,dragOverGapBottom:w,pos:v,active:b});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(F.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),g}},"8EBN":function(je,ce,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.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 z=0;z-1&&X.substring(H+1,X.length);if(N)return Z.findModeByExtension(N)},Z.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F0)){de.next=20;break}return de.next=18,Promise.all(ve);case 18:xe=de.sent,Ge+=et;case 20:de.next=13;break;case 22:return de.next=24,Object(N.a)("/api/attachments/multipart_upload_end",{method:"POST",body:Object(Z.a)({fileName:ye.name,chunkCount:Be,uploadId:Ot},S)});case 24:ue=de.sent,ue.object?(O("success"),pt(),T&&T(Object(Z.a)(Object(Z.a)({},ue),{},{file:ye,percent:100}))):(O("error"),Pe("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),pt(),R&&R(ye.name));case 26:case"end":return de.stop()}},ft)})(),"t0",11);case 11:ot.next=19;break;case 13:ot.prev=13,ot.t1=ot.catch(9),O("error"),Pe("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"),pt(),R&&R(ye.name);case 19:case"end":return ot.stop()}},Me,null,[[9,13]])}));return function(ye){return _e.apply(this,arguments)}}(),ht=Object(I.useCallback)(function(){yt.current=!0,bt.current&&(bt.current.abort(),x&&x())},[x]),wt=function(Me){var ye,Se,Be=Me==null||((ye=Me.target)===null||ye===void 0||((Se=ye.files)===null||Se===void 0))?void 0:Se[0];if(Ke(Be),W="ready",!Be)return;if(v){var Ze=v(Be);Ze||st(Be),pt();return}st(Be)};return H.a.createElement(I.Fragment,null,H.a.createElement("input",{type:"file",id:Et.current,style:{display:"none"},onChange:wt,accept:f}),H.a.createElement("label",{className:p()(d.a.upload,C),htmlFor:Et.current,style:y},g))};ce.a=Object(I.forwardRef)(u)},"9Bee":function(je,ce,D){"use strict";var Z=D("DYRE"),z=D("zeV3"),M=D("+L6B"),X=D("2/Rp"),F=D("k1fw"),I=D("9og8"),H=D("tJVT"),N=D("WmNS"),n=D.n(N),P=D("q1tI"),p=D.n(P),m=D("vg9a"),d=D("DlQD"),u=D.n(d),o=D("rUJ1");function h(Q,L){var k=Q.match(/^(\s+)(?:```)/);if(k===null)return L;var Y=k[1];return L.split(` `).map(function(se){var q=se.match(/^\s+/);if(q===null)return se;var De=Object(H.a)(q,1),lt=De[0];return lt.length>=Y.length?se.slice(Y.length):se}).join(` `)}var r=[],a=["
    "],i=new u.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function S(){r.length=0,a=["
      "]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(Q,L,k,Y){if(L>=Q.length||Q[L].level<=k)return L;var se=Q[L];Y.push("
    • "+se.text+""),L++;var q=[];return L=T(Q,L,se.level,q),q.length>0&&(Y.push("
        "),q.forEach(function(De){Y.push(De)}),Y.push("
      ")),Y.push("
    • "),L=T(Q,L,k,Y),L}function R(){return T(r,0,0,a),a.push("
    "),a.join("")}var w={heading:function(L){var k=s.exec(L);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(L){var k=this.rules.block.fences.exec(L);if(k){var Y=k[0],se=h(Y,k[3]||""),q=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(q)>=0){var De=g(),lt=se;se=De,f[De]={type:"block",expression:lt}}return{type:"code",raw:Y,lang:q,text:se}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,g=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function E(){b=0,f={}}function y(Q){return Q=Q.replace(v,function(L,k){var Y=g();return f[Y]={type:"inline",expression:k},Y}),Q}var U=i.listitem;i.listitem=function(Q){return U(y(Q))};var j=i.paragraph;i.paragraph=function(Q){return j(y(Q))};var A=i.tablecell;i.tablecell=function(Q,L){return A(y(Q),L)},i.code=function(Q,L,k){var Y=(L||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"

    ".concat(Q,"

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

    [TOC]

    ",R()),S()),Wn=Wn.replace(/(__special_katext_id_\d+__)/g,function(Tr,ki){var Xi=Si[ki],cr=Xi.type,gr=Xi.expression;return Object(ae.renderToString)(qt(gr)||"",{displayMode:cr==="block",throwOnError:!1,output:"html"})}),Wn=Wn.replace(/▁/g,"\u2581\u2581\u2581"),E(),De){var ai=document.createElement("div");return ai.innerHTML=Wn,ai.innerText}return setTimeout(function(){return Mr()},500),Wn},[ri]),qi=Object(P.useRef)();x.WebkitLineClamp=lt,lt&&(gn=Object(F.a)(Object(F.a)({},gn),x));function ur(Fn){var Pn=Fn.target;if(Pn.tagName.toUpperCase()==="IMG"){if(Qt){var xi=Pn.getAttribute("src");ji(xi),ar("image")}}else if(Pn.tagName.toUpperCase()==="A"){var Wn=Pn.getAttribute("href");if(Wn.indexOf("office")>-1)Fn.preventDefault(),ji(Wn),ar("office");else if(Wn.indexOf("application/pdf")>-1)Fn.preventDefault(),ji(Wn),ar("pdf");else if(Wn.indexOf("text/html")>-1)Fn.preventDefault(),ji(Wn),ar("html");else if(Wn.startsWith("#")){Fn.preventDefault();var Si=document.getElementById(Wn.replace("#",""));Si&&Si.scrollIntoView(!0)}}}var Mr=function(){var Pn,xi=(Pn=qi.current)===null||Pn===void 0?void 0:Pn.querySelectorAll("video");xi==null||xi.forEach(function(Wn){if(Wn.oncontextmenu=function(){return!1},Wn.src.indexOf(".m3u8")>-1&&!Wn.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Si=new V.a;Si.loadSource(Wn.src),Si.attachMedia(Wn)}}})};Object(P.useEffect)(function(){if(qi.current&&Vi&&(Vi.match(nn)&&window.PR.prettyPrint()),qi.current)return qi.current.addEventListener("click",ur),function(){qi.current.removeEventListener("click",ur),E(),S()}},[Vi,qi.current,ur]);var Li=function(Pn){if(!se)return;Pn.target.nodeName==="IMG"?(Nn.current.style.zIndex=1,Nn.current.style.display="flex",Nn.current.style.width=Pn.target.clientWidth+"px",Nn.current.style.height=Pn.target.clientHeight+"px",Nn.current.style.top=Pn.target.offsetTop+"px",Nn.current.style.left=Pn.target.offsetLeft+"px",Gi.current.src=Pn.target.getAttribute("src")):Nn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:qi,style:Object(F.a)({},gn),className:"".concat(q||""," markdown-body ").concat(At.a.mdBody),onMouseOver:Li,dangerouslySetInnerHTML:{__html:Vi}}),p.a.createElement("div",{ref:Nn,className:At.a.button},p.a.createElement(z.a,null,p.a.createElement(X.a,{onClick:function(){return Zi()}},"\u88C1\u526A"),p.a.createElement(X.a,{onClick:function(){return lr()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:Gi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(me.a,{close:!0,data:di,type:di!=null&&di.length?Ci:"",style:Object(F.a)({},mi),onClose:function(){return ji("")}}))}},"9VGf":function(je,ce,D){"use strict";D.d(ce,"a",function(){return M});var Z=D("q1tI"),z=D.n(Z);function M(X,F){var I=Object(Z.useRef)();Object(Z.useEffect)(function(){I.current=X}),Object(Z.useEffect)(function(){function H(){I.current()}if(F!==null){var N=setInterval(H,F);return function(){return clearInterval(N)}}},[F])}},AMnG:function(je,ce,D){"use strict";var Z=D("miYZ"),z=D("tsqr"),M=D("tJVT"),X=D("q1tI"),F=D.n(X),I=D("nWbc"),H=D.n(I),N=D("Ot1p");ce.a=function(n){var P=n.id,p=n.activeDiscussIndex,m=n.onReplyDiscuss,d=Object(X.useState)(""),u=Object(M.a)(d,2),o=u[0],h=u[1];function r(i){h(i)}function a(){if(!o){z.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}m(P,o),h("")}return F.a.createElement("div",{key:P,className:"discuss-item-editor",style:{display:p===P?"block":"none",width:"100%"}},F.a.createElement(N.a,{miniToolbar:!0,startInit:p===P,defaultValue:o,id:P,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),F.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(je,ce,D){"use strict";D.d(ce,"a",function(){return I});var Z=D("MNnm"),z="rc-util-key";function M(H){if(H.attachTo)return H.attachTo;var N=document.querySelector("head");return N||document.body}function X(H){var N,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var P=document.createElement("style");if((N=n.csp)===null||N===void 0?void 0:N.nonce){var p;P.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}P.innerHTML=H;var m=M(n),d=m.firstChild;return n.prepend&&m.prepend?m.prepend(P):n.prepend&&d?m.insertBefore(P,d):m.appendChild(P),P}var F=new Map;function I(H,N){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=M(n);if(!F.has(P)){var p=X("",n),m=p.parentNode;F.set(P,m),m.removeChild(p)}var d=Array.from(F.get(P).children).find(function(a){return a.tagName==="STYLE"&&a[z]===N});if(d){var u,o;if(((u=n.csp)===null||u===void 0?void 0:u.nonce)&&d.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var h;d.nonce=(h=n.csp)===null||h===void 0?void 0:h.nonce}return d.innerHTML!==H&&(d.innerHTML=H),d}var r=X(H,n);return r[z]=N,r}},Bd2K:function(je,ce,D){(function(Z){Z(D("VrN/"),D("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(n,P,p){if(p!=Z.Init&&p&&n.removeKeyMap("autoCloseTags"),!P)return;var m={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(m["'/'"]=function(d){return I(d)}),(typeof P!="object"||P.whenOpening!==!1)&&(m["'>'"]=function(d){return X(d)}),n.addKeyMap(m)});var z=["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 X(n){if(n.getOption("disableInput"))return Z.Pass;for(var P=n.listSelections(),p=[],m=n.getOption("autoCloseTags"),d=0;du.ch&&(i=i.slice(0,i.length-o.end+u.ch));var T=i.toLowerCase();if(!i||o.type=="string"&&(o.end!=u.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==u.ch-o.start-1||S&&H(S,T)>-1||N(n,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(r)||[],i,u,!0))return Z.Pass;var R=typeof m=="object"&&m.emptyTags;if(R&&H(R,i)>-1){p[d]={text:"/>",newPos:Z.Pos(u.line,u.ch+2)};continue}var w=x&&H(x,T)>-1;p[d]={indent:w,text:">"+(w?` `:"")+"",newPos:w?Z.Pos(u.line+1,0):Z.Pos(u.line,u.ch+1)}}for(var v=typeof m=="object"&&m.dontIndentOnAutoClose,d=P.length-1;d>=0;d--){var b=p[d];n.replaceRange(b.text,P[d].head,P[d].anchor,"+insert");var g=n.listSelections().slice(0);g[d]={head:b.newPos,anchor:b.newPos},n.setSelections(g),!v&&b.indent&&(n.indentLine(b.newPos.line,null,!0),n.indentLine(b.newPos.line+1,null,!0))}}function F(n,P){for(var p=n.listSelections(),m=[],d=P?"/":""&&(S+=">"),m[h]=S}if(n.replaceSelections(m),p=n.listSelections(),!o)for(var h=0;h=0&&P[r]==p;r--)++h;m=o.to;for(var r=1;r0){for(var P=0;P1&&arguments[1]!==void 0?arguments[1]:"",P=[],p=0;pI,Z.serviceIds.set(I,H),H}function F(I){return function(H,N,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(I,H,n,!0)}}},CrYA:function(je,ce,D){var Z=D("MFOe"),z=Z.Global;je.exports={name:"sessionStorage",read:X,write:F,each:I,remove:H,clearAll:N};function M(){return z.sessionStorage}function X(n){return M().getItem(n)}function F(n,P){return M().setItem(n,P)}function I(n){for(var P=M().length-1;P>=0;P--){var p=M().key(P);n(X(p),p)}}function H(n){return M().removeItem(n)}function N(){return M().clear()}},DlQD:function(je,ce,D){(function(Z,z){je.exports=z()})(this,function(){"use strict";function Z(Ae,ve){for(var xe=0;xeAe.length)&&(ve=Ae.length);for(var xe=0,ue=new Array(ve);xe=Ae.length?{done:!0}:{done:!1,value:Ae[ue++]}}}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 xe=Ae[Symbol.iterator](),xe.next.bind(xe)}function I(Ae,ve){return ve={exports:{}},Ae(ve,ve.exports),ve.exports}var H=I(function(Ae){function ve(){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 xe(ue){Ae.exports.defaults=ue}Ae.exports={defaults:ve(),getDefaults:ve,changeDefaults:xe}}),N=H.defaults,n=H.getDefaults,P=H.changeDefaults,p=/[&<>"']/,m=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(ve){return o[ve]};function r(Ae,ve){if(ve){if(p.test(Ae))return Ae.replace(m,h)}else if(d.test(Ae))return Ae.replace(u,h);return Ae}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(Ae){return Ae.replace(a,function(ve,xe){return xe=xe.toLowerCase(),xe==="colon"?":":xe.charAt(0)==="#"?xe.charAt(1)==="x"?String.fromCharCode(parseInt(xe.substring(2),16)):String.fromCharCode(+xe.substring(1)):""})}var s=/(^|[^\[])\^/g;function S(Ae,ve){Ae=Ae.source||Ae,ve=ve||"";var xe={replace:function(fe,de){return de=de.source||de,de=de.replace(s,"$1"),Ae=Ae.replace(fe,de),xe},getRegex:function(){return new RegExp(Ae,ve)}};return xe}var x=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ae,ve,xe){if(Ae){var ue;try{ue=decodeURIComponent(i(xe)).replace(x,"").toLowerCase()}catch(fe){return null}if(ue.indexOf("javascript:")===0||ue.indexOf("vbscript:")===0||ue.indexOf("data:")===0)return null}ve&&!T.test(xe)&&(xe=f(ve,xe));try{xe=encodeURI(xe).replace(/%25/g,"%")}catch(fe){return null}return xe}var w={},v=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Ae,ve){w[" "+Ae]||(v.test(Ae)?w[" "+Ae]=Ae+"/":w[" "+Ae]=U(Ae,"/",!0)),Ae=w[" "+Ae];var xe=Ae.indexOf(":")===-1;return ve.substring(0,2)==="//"?xe?ve:Ae.replace(b,"$1")+ve:ve.charAt(0)==="/"?xe?ve:Ae.replace(g,"$1")+ve:Ae+ve}var C={exec:function(){}};function E(Ae){for(var ve=1,xe,ue;ve=0&&Le[dt]==="\\";)ze=!ze;return ze?"|":" |"}),ue=xe.split(/ \|/),fe=0;if(ue.length>ve)ue.splice(ve);else for(;ue.length=ue.length?fe.slice(ue.length):fe}).join(` `)}var Oe=function(){function Ae(xe){this.options=xe||W}var ve=Ae.prototype;return ve.space=function(ue){var fe=this.rules.block.newline.exec(ue);if(fe)return fe[0].length>1?{type:"space",raw:fe[0]}:{raw:` `}},ve.code=function(ue,fe){var de=this.rules.block.code.exec(ue);if(de){var we=fe[fe.length-1];if(we&&we.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var Le=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:O(Le,` `)}}},ve.fences=function(ue){var fe=this.rules.block.fences.exec(ue);if(fe){var de=fe[0],we=Re(de,fe[3]||"");return{type:"code",raw:de,lang:fe[2]?fe[2].trim():fe[2],text:we}}},ve.heading=function(ue){var fe=this.rules.block.heading.exec(ue);if(fe)return{type:"heading",raw:fe[0],depth:fe[1].length,text:fe[2]}},ve.nptable=function(ue){var fe=this.rules.block.nptable.exec(ue);if(fe){var de={type:"table",header:V(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(` `):[],raw:fe[0]};if(de.header.length===de.align.length){var we=de.align.length,Le;for(Le=0;Le ?/gm,"");return{type:"blockquote",raw:fe[0],text:de}}},ve.list=function(ue){var fe=this.rules.block.list.exec(ue);if(fe){for(var de=fe[0],we=fe[2],Le=we.length>1,ze=we[we.length-1]===")",dt={type:"list",raw:de,ordered:Le,start:Le?+we.slice(0,-1):"",loose:!1,items:[]},Lt=fe[0].match(this.rules.block.item),Ft=!1,kt,St,qe,rt,Ye,pe,Te,nt=Lt.length,Xe=0;Xe1||this.options.smartLists&&qe!==we)&&(rt=Lt.slice(Xe+1).join(` `),dt.raw=dt.raw.substring(0,dt.raw.length-rt.length),Xe=nt-1)),Ye=Ft||/\n\n(?!\s*$)/.test(kt),Xe!==nt-1&&(Ft=kt.charAt(kt.length-1)===` `,Ye||(Ye=Ft)),Ye&&(dt.loose=!0),pe=/^\[[ xX]\] /.test(kt),Te=void 0,pe&&(Te=kt[1]!==" ",kt=kt.replace(/^\[[ xX]\] +/,"")),dt.items.push({type:"list_item",raw:de,task:pe,checked:Te,loose:Ye,text:kt});return dt}},ve.html=function(ue){var fe=this.rules.block.html.exec(ue);if(fe)return{type:this.options.sanitize?"paragraph":"html",raw:fe[0],pre:!this.options.sanitizer&&(fe[1]==="pre"||fe[1]==="script"||fe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):te(fe[0]):fe[0]}},ve.def=function(ue){var fe=this.rules.block.def.exec(ue);if(fe){fe[3]&&(fe[3]=fe[3].substring(1,fe[3].length-1));var de=fe[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:fe[0],href:fe[2],title:fe[3]}}},ve.table=function(ue){var fe=this.rules.block.table.exec(ue);if(fe){var de={type:"table",header:V(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(` `):[]};if(de.header.length===de.align.length){de.raw=fe[0];var we=de.align.length,Le;for(Le=0;Le/i.test(we[0])&&(fe=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(we[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(we[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:we[0],inLink:fe,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):te(we[0]):we[0]}},ve.link=function(ue){var fe=this.rules.inline.link.exec(ue);if(fe){var de=ae(fe[2],"()");if(de>-1){var we=fe[0].indexOf("!")===0?5:4,Le=we+fe[1].length+de;fe[2]=fe[2].substring(0,de),fe[0]=fe[0].substring(0,Le).trim(),fe[3]=""}var ze=fe[2],dt="";if(this.options.pedantic){var Lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ze);Lt?(ze=Lt[1],dt=Lt[3]):dt=""}else dt=fe[3]?fe[3].slice(1,-1):"";ze=ze.trim().replace(/^<([\s\S]*)>$/,"$1");var Ft=me(fe,{href:ze&&ze.replace(this.rules.inline._escapes,"$1"),title:dt&&dt.replace(this.rules.inline._escapes,"$1")},fe[0]);return Ft}},ve.reflink=function(ue,fe){var de;if((de=this.rules.inline.reflink.exec(ue))||(de=this.rules.inline.nolink.exec(ue))){var we=(de[2]||de[1]).replace(/\s+/g," ");if(we=fe[we.toLowerCase()],!we||!we.href){var Le=de[0].charAt(0);return{type:"text",raw:Le,text:Le}}var ze=me(de,we,de[0]);return ze}},ve.strong=function(ue,fe,de){de===void 0&&(de="");var we=this.rules.inline.strong.start.exec(ue);if(we&&(!we[1]||we[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){fe=fe.slice(-1*ue.length);var Le=we[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Le.lastIndex=0;for(var ze;(we=Le.exec(fe))!=null;)if(ze=this.rules.inline.strong.middle.exec(fe.slice(0,we.index+3)),ze)return{type:"strong",raw:ue.slice(0,ze[0].length),text:ue.slice(2,ze[0].length-2)}}},ve.em=function(ue,fe,de){de===void 0&&(de="");var we=this.rules.inline.em.start.exec(ue);if(we&&(!we[1]||we[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){fe=fe.slice(-1*ue.length);var Le=we[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Le.lastIndex=0;for(var ze;(we=Le.exec(fe))!=null;)if(ze=this.rules.inline.em.middle.exec(fe.slice(0,we.index+2)),ze)return{type:"em",raw:ue.slice(0,ze[0].length),text:ue.slice(1,ze[0].length-1)}}},ve.codespan=function(ue){var fe=this.rules.inline.code.exec(ue);if(fe){var de=fe[2].replace(/\n/g," "),we=/[^ ]/.test(de),Le=de.startsWith(" ")&&de.endsWith(" ");return we&&Le&&(de=de.substring(1,de.length-1)),de=te(de,!0),{type:"codespan",raw:fe[0],text:de}}},ve.br=function(ue){var fe=this.rules.inline.br.exec(ue);if(fe)return{type:"br",raw:fe[0]}},ve.del=function(ue){var fe=this.rules.inline.del.exec(ue);if(fe)return{type:"del",raw:fe[0],text:fe[1]}},ve.autolink=function(ue,fe){var de=this.rules.inline.autolink.exec(ue);if(de){var we,Le;return de[2]==="@"?(we=te(this.options.mangle?fe(de[1]):de[1]),Le="mailto:"+we):(we=te(de[1]),Le=we),{type:"link",raw:de[0],text:we,href:Le,tokens:[{type:"text",raw:we,text:we}]}}},ve.url=function(ue,fe){var de;if(de=this.rules.inline.url.exec(ue)){var we,Le;if(de[2]==="@")we=te(this.options.mangle?fe(de[0]):de[0]),Le="mailto:"+we;else{var ze;do ze=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(ze!==de[0]);we=te(de[0]),de[1]==="www."?Le="http://"+we:Le=we}return{type:"link",raw:de[0],text:we,href:Le,tokens:[{type:"text",raw:we,text:we}]}}},ve.inlineText=function(ue,fe,de){var we=this.rules.inline.text.exec(ue);if(we){var Le;return fe?Le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(we[0]):te(we[0]):we[0]:Le=te(this.options.smartypants?de(we[0]):we[0]),{type:"text",raw:we[0],text:Le}}},Ae}(),Ce=G.noopTest,Pe=G.edit,He=G.merge,Ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ee.def=Pe(Ee.def).replace("label",Ee._label).replace("title",Ee._title).getRegex(),Ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ee.item=Pe(Ee.item,"gm").replace(/bull/g,Ee.bullet).getRegex(),Ee.list=Pe(Ee.list).replace(/bull/g,Ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ee.def.source+")").getRegex(),Ee._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",Ee._comment=//,Ee.html=Pe(Ee.html,"i").replace("comment",Ee._comment).replace("tag",Ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ee.paragraph=Pe(Ee._paragraph).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.blockquote=Pe(Ee.blockquote).replace("paragraph",Ee.paragraph).getRegex(),Ee.normal=He({},Ee),Ee.gfm=He({},Ee.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*|$)"}),Ee.gfm.nptable=Pe(Ee.gfm.nptable).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.gfm.table=Pe(Ee.gfm.table).replace("hr",Ee.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",Ee._tag).getRegex(),Ee.pedantic=He({},Ee.normal,{html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ee._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ce,paragraph:Pe(Ee.normal._paragraph).replace("hr",Ee.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",be.punctuation=Pe(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",be._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",be.em.start=Pe(be.em.start).replace(/punctuation/g,be._punctuation).getRegex(),be.em.middle=Pe(be.em.middle).replace(/punctuation/g,be._punctuation).replace(/overlapSkip/g,be._overlapSkip).getRegex(),be.em.endAst=Pe(be.em.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.em.endUnd=Pe(be.em.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.start=Pe(be.strong.start).replace(/punctuation/g,be._punctuation).getRegex(),be.strong.middle=Pe(be.strong.middle).replace(/punctuation/g,be._punctuation).replace(/blockSkip/g,be._blockSkip).getRegex(),be.strong.endAst=Pe(be.strong.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.endUnd=Pe(be.strong.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=Pe(be._blockSkip,"g").getRegex(),be.overlapSkip=Pe(be._overlapSkip,"g").getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._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])?)+(?![-_])/,be.autolink=Pe(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=Pe(be.tag).replace("comment",Ee._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=Pe(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=Pe(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=Pe(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=He({},be),be.pedantic=He({},be.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:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=He({},be.normal,{escape:Pe(be.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ue="x"+ue.toString(16)),ve+="&#"+ue+";";return ve}var ht=function(){function Ae(xe){this.tokens=[],this.tokens.links=Object.create(null),this.options=xe||bt,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ue={block:Et.normal,inline:yt.normal};this.options.pedantic?(ue.block=Et.pedantic,ue.inline=yt.pedantic):this.options.gfm&&(ue.block=Et.gfm,this.options.breaks?ue.inline=yt.breaks:ue.inline=yt.gfm),this.tokenizer.rules=ue}Ae.lex=function(ue,fe){var de=new Ae(fe);return de.lex(ue)};var ve=Ae.prototype;return ve.lex=function(ue){return ue=ue.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ue,this.tokens,!0),this.inline(this.tokens),this.tokens},ve.blockTokens=function(ue,fe,de){fe===void 0&&(fe=[]),de===void 0&&(de=!0),ue=ue.replace(/^ +$/gm,"");for(var we,Le,ze,dt;ue;){if(we=this.tokenizer.space(ue)){ue=ue.substring(we.raw.length),we.type&&fe.push(we);continue}if(we=this.tokenizer.code(ue,fe)){ue=ue.substring(we.raw.length),we.type?fe.push(we):(dt=fe[fe.length-1],dt.raw+=` `+we.raw,dt.text+=` `+we.text);continue}if(we=this.tokenizer.fences(ue)){ue=ue.substring(we.raw.length),fe.push(we);continue}if(we=this.tokenizer.heading(ue)){ue=ue.substring(we.raw.length),fe.push(we);continue}if(we=this.tokenizer.nptable(ue)){ue=ue.substring(we.raw.length),fe.push(we);continue}if(we=this.tokenizer.hr(ue)){ue=ue.substring(we.raw.length),fe.push(we);continue}if(we=this.tokenizer.blockquote(ue)){ue=ue.substring(we.raw.length),we.tokens=this.blockTokens(we.text,[],de),fe.push(we);continue}if(we=this.tokenizer.list(ue)){for(ue=ue.substring(we.raw.length),ze=we.items.length,Le=0;Le0)for(;(Lt=this.tokenizer.rules.inline.reflinkSearch.exec(dt))!=null;)Ft.includes(Lt[0].slice(Lt[0].lastIndexOf("[")+1,-1))&&(dt=dt.slice(0,Lt.index)+"["+"a".repeat(Lt[0].length-2)+"]"+dt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Lt=this.tokenizer.rules.inline.blockSkip.exec(dt))!=null;)dt=dt.slice(0,Lt.index)+"["+"a".repeat(Lt[0].length-2)+"]"+dt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ue;){if(ze=this.tokenizer.escape(ue)){ue=ue.substring(ze.raw.length),fe.push(ze);continue}if(ze=this.tokenizer.tag(ue,de,we)){ue=ue.substring(ze.raw.length),de=ze.inLink,we=ze.inRawBlock,fe.push(ze);continue}if(ze=this.tokenizer.link(ue)){ue=ue.substring(ze.raw.length),ze.type==="link"&&(ze.tokens=this.inlineTokens(ze.text,[],!0,we)),fe.push(ze);continue}if(ze=this.tokenizer.reflink(ue,this.tokens.links)){ue=ue.substring(ze.raw.length),ze.type==="link"&&(ze.tokens=this.inlineTokens(ze.text,[],!0,we)),fe.push(ze);continue}if(ze=this.tokenizer.strong(ue,dt,Le)){ue=ue.substring(ze.raw.length),ze.tokens=this.inlineTokens(ze.text,[],de,we),fe.push(ze);continue}if(ze=this.tokenizer.em(ue,dt,Le)){ue=ue.substring(ze.raw.length),ze.tokens=this.inlineTokens(ze.text,[],de,we),fe.push(ze);continue}if(ze=this.tokenizer.codespan(ue)){ue=ue.substring(ze.raw.length),fe.push(ze);continue}if(ze=this.tokenizer.br(ue)){ue=ue.substring(ze.raw.length),fe.push(ze);continue}if(ze=this.tokenizer.del(ue)){ue=ue.substring(ze.raw.length),ze.tokens=this.inlineTokens(ze.text,[],de,we),fe.push(ze);continue}if(ze=this.tokenizer.autolink(ue,st)){ue=ue.substring(ze.raw.length),fe.push(ze);continue}if(!de&&(ze=this.tokenizer.url(ue,st))){ue=ue.substring(ze.raw.length),fe.push(ze);continue}if(ze=this.tokenizer.inlineText(ue,we,pt)){ue=ue.substring(ze.raw.length),Le=ze.raw.slice(-1),fe.push(ze);continue}if(ue){var kt="Infinite loop on byte: "+ue.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return fe},z(Ae,null,[{key:"rules",get:function(){return{block:Et,inline:yt}}}]),Ae}(),wt=H.defaults,_e=G.cleanUrl,Me=G.escape,ye=function(){function Ae(xe){this.options=xe||wt}var ve=Ae.prototype;return ve.code=function(ue,fe,de){var we=(fe||"").match(/\S*/)[0];if(this.options.highlight){var Le=this.options.highlight(ue,we);Le!=null&&Le!==ue&&(de=!0,ue=Le)}return we?'
    '+(de?ue:Me(ue,!0))+`
    `:"
    "+(de?ue:Me(ue,!0))+`
    `},ve.blockquote=function(ue){return`
    `+ue+`
    `},ve.html=function(ue){return ue},ve.heading=function(ue,fe,de,we){return this.options.headerIds?"'+ue+" `:""+ue+" `},ve.hr=function(){return this.options.xhtml?`
    `:`
    `},ve.list=function(ue,fe,de){var we=fe?"ol":"ul",Le=fe&&de!==1?' start="'+de+'"':"";return"<"+we+Le+`> `+ue+" `},ve.listitem=function(ue){return"
  • "+ue+`
  • `},ve.checkbox=function(ue){return" "},ve.paragraph=function(ue){return"

    "+ue+`

    `},ve.table=function(ue,fe){return fe&&(fe=""+fe+""),` `+ue+` `+fe+`
    `},ve.tablerow=function(ue){return` `+ue+` `},ve.tablecell=function(ue,fe){var de=fe.header?"th":"td",we=fe.align?"<"+de+' align="'+fe.align+'">':"<"+de+">";return we+ue+" `},ve.strong=function(ue){return""+ue+""},ve.em=function(ue){return""+ue+""},ve.codespan=function(ue){return""+ue+""},ve.br=function(){return this.options.xhtml?"
    ":"
    "},ve.del=function(ue){return""+ue+""},ve.link=function(ue,fe,de){if(ue=_e(this.options.sanitize,this.options.baseUrl,ue),ue===null)return de;var we='",we},ve.image=function(ue,fe,de){if(ue=_e(this.options.sanitize,this.options.baseUrl,ue),ue===null)return de;var we=''+de+'":">",we},ve.text=function(ue){return ue},Ae}(),Se=function(){function Ae(){}var ve=Ae.prototype;return ve.strong=function(ue){return ue},ve.em=function(ue){return ue},ve.codespan=function(ue){return ue},ve.del=function(ue){return ue},ve.html=function(ue){return ue},ve.text=function(ue){return ue},ve.link=function(ue,fe,de){return""+de},ve.image=function(ue,fe,de){return""+de},ve.br=function(){return""},Ae}(),Be=function(){function Ae(){this.seen={}}var ve=Ae.prototype;return ve.slug=function(ue){var fe=ue.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(fe)){var de=fe;do this.seen[de]++,fe=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(fe))}return this.seen[fe]=0,fe},Ae}(),Ze=H.defaults,ot=G.unescape,ft=function(){function Ae(xe){this.options=xe||Ze,this.options.renderer=this.options.renderer||new ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Be}Ae.parse=function(ue,fe){var de=new Ae(fe);return de.parse(ue)};var ve=Ae.prototype;return ve.parse=function(ue,fe){fe===void 0&&(fe=!0);var de="",we,Le,ze,dt,Lt,Ft,kt,St,qe,rt,Ye,pe,Te,nt,Xe,Pt,Mt,Ve,gt=ue.length;for(we=0;we0&&Xe.tokens[0].type==="text"?(Xe.tokens[0].text=Ve+" "+Xe.tokens[0].text,Xe.tokens[0].tokens&&Xe.tokens[0].tokens.length>0&&Xe.tokens[0].tokens[0].type==="text"&&(Xe.tokens[0].tokens[0].text=Ve+" "+Xe.tokens[0].tokens[0].text)):Xe.tokens.unshift({type:"text",text:Ve}):nt+=Ve),nt+=this.parse(Xe.tokens,Te),qe+=this.renderer.listitem(nt,Mt,Pt);de+=this.renderer.list(qe,Ye,pe);continue}case"html":{de+=this.renderer.html(rt.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(rt.tokens));continue}case"text":{for(qe=rt.tokens?this.parseInline(rt.tokens):rt.text;we+1An error occurred:

    "+Ne(ze.message+"",!0)+"
    ";throw ze}}Ge.options=Ge.setOptions=function(Ae){return Ct(Ge.defaults,Ae),at(Ge.defaults),Ge},Ge.getDefaults=ke,Ge.defaults=ct,Ge.use=function(Ae){var ve=Ct({},Ae);if(Ae.renderer&&function(){var ue=Ge.defaults.renderer||new ye,fe=function(Le){var ze=ue[Le];ue[Le]=function(){for(var dt=arguments.length,Lt=new Array(dt),Ft=0;Ft=0;d--){if(!M(m[d]))continue;var u=m[d].split("="),o=unescape(u[0]),h=unescape(u[1]);p(h,o)}}function H(p,m){if(!p)return;X.cookie=escape(p)+"="+escape(m)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function N(p){if(!p||!P(p))return;X.cookie=escape(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function n(){I(function(p,m){N(m)})}function P(p){return new RegExp("(?:^|;\\s*)"+escape(p).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(X.cookie)}},E2g8:function(je,ce,D){(function(Z,z){/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */(function(M,X){je.exports=X()})(this,function(){"use strict";function M(ye){var Se=typeof ye;return ye!==null&&(Se==="object"||Se==="function")}function X(ye){return typeof ye=="function"}var F=void 0;Array.isArray?F=Array.isArray:F=function(ye){return Object.prototype.toString.call(ye)==="[object Array]"};var I=F,H=0,N=void 0,n=void 0,P=function(Se,Be){T[H]=Se,T[H+1]=Be,H+=2,H===2&&(n?n(R):v())};function p(ye){n=ye}function m(ye){P=ye}var d=typeof window!="undefined"?window:void 0,u=d||{},o=u.MutationObserver||u.WebKitMutationObserver,h=typeof self=="undefined"&&typeof Z!="undefined"&&{}.toString.call(Z)==="[object process]",r=typeof Uint8ClampedArray!="undefined"&&typeof importScripts!="undefined"&&typeof MessageChannel!="undefined";function a(){return function(){return Z.nextTick(R)}}function i(){return typeof N!="undefined"?function(){N(R)}:x()}function s(){var ye=0,Se=new o(R),Be=document.createTextNode("");return Se.observe(Be,{characterData:!0}),function(){Be.data=ye=++ye%2}}function S(){var ye=new MessageChannel;return ye.port1.onmessage=R,function(){return ye.port2.postMessage(0)}}function x(){var ye=setTimeout;return function(){return ye(R,1)}}var T=new Array(1e3);function R(){for(var ye=0;ye`,triples:"",explode:"[]{}"},M=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(o,h,r){r&&r!=Z.Init&&(o.removeKeyMap(F),o.state.closeBrackets=null),h&&(I(X(h,"pairs")),o.state.closeBrackets=h,o.addKeyMap(F))});function X(o,h){return h=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[h]!=null?o[h]:z[h]}var F={Backspace:n,Enter:P};function I(o){for(var h=0;h=0;i--){var S=a[i].head;o.replaceRange("",M(S.line,S.ch-1),M(S.line,S.ch+1),"+delete")}}function P(o){var h=N(o),r=h&&X(h,"explode");if(!r||o.getOption("disableInput"))return Z.Pass;for(var a=o.listSelections(),i=0;i0;return{anchor:new M(o.anchor.line,o.anchor.ch+(h?-1:1)),head:new M(o.head.line,o.head.ch+(h?1:-1))}}function m(o,h){var r=N(o);if(!r||o.getOption("disableInput"))return Z.Pass;var a=X(r,"pairs"),i=a.indexOf(h);if(i==-1)return Z.Pass;for(var s=X(r,"closeBefore"),S=X(r,"triples"),x=a.charAt(i+1)==h,T=o.listSelections(),R=i%2==0,w,v=0;v=0&&o.getRange(g,M(g.line,g.ch+3))==h+h+h?f="skipThree":f="skip";else if(x&&g.ch>1&&S.indexOf(h)>=0&&o.getRange(M(g.line,g.ch-2),g)==h+h){if(g.ch>2&&/\bstring/.test(o.getTokenTypeAt(M(g.line,g.ch-2))))return Z.Pass;f="addFour"}else if(x){var E=g.ch==0?" ":o.getRange(M(g.line,g.ch-1),g);if(!Z.isWordChar(C)&&E!=h&&!Z.isWordChar(E))f="both";else return Z.Pass}else if(R&&(C.length===0||/\s/.test(C)||s.indexOf(C)>-1))f="both";else return Z.Pass;if(!w)w=f;else if(w!=f)return Z.Pass}var y=i%2?a.charAt(i-1):h,U=i%2?h:a.charAt(i+1);o.operation(function(){if(w=="skip")o.execCommand("goCharRight");else if(w=="skipThree")for(var j=0;j<3;j++)o.execCommand("goCharRight");else if(w=="surround"){for(var A=o.getSelections(),j=0;j ").concat($);if(le.ENABLE_CALLBACK&&le.emitter.emit("log","error",J),!le.ENABLE_ERROR)return;console.error?console.error(J):console.warn?console.warn(J):console.log(J)}},{key:"i",value:function(B,$){(!B||le.FORCE_GLOBAL_TAG)&&(B=le.GLOBAL_TAG);var J="[".concat(B,"] > ").concat($);if(le.ENABLE_CALLBACK&&le.emitter.emit("log","info",J),!le.ENABLE_INFO)return;console.info?console.info(J):console.log(J)}},{key:"w",value:function(B,$){(!B||le.FORCE_GLOBAL_TAG)&&(B=le.GLOBAL_TAG);var J="[".concat(B,"] > ").concat($);if(le.ENABLE_CALLBACK&&le.emitter.emit("log","warn",J),!le.ENABLE_WARN)return;console.warn?console.warn(J):console.log(J)}},{key:"d",value:function(B,$){(!B||le.FORCE_GLOBAL_TAG)&&(B=le.GLOBAL_TAG);var J="[".concat(B,"] > ").concat($);if(le.ENABLE_CALLBACK&&le.emitter.emit("log","debug",J),!le.ENABLE_DEBUG)return;console.debug?console.debug(J):console.log(J)}},{key:"v",value:function(B,$){(!B||le.FORCE_GLOBAL_TAG)&&(B=le.GLOBAL_TAG);var J="[".concat(B,"] > ").concat($);if(le.ENABLE_CALLBACK&&le.emitter.emit("log","verbose",J),!le.ENABLE_VERBOSE)return;console.log(J)}}]),le}();H.GLOBAL_TAG="flv.js",H.FORCE_GLOBAL_TAG=!1,H.ENABLE_ERROR=!0,H.ENABLE_INFO=!0,H.ENABLE_WARN=!0,H.ENABLE_DEBUG=!0,H.ENABLE_VERBOSE=!0,H.ENABLE_CALLBACK=!1,H.emitter=new I.a;var N=H,n=function(){function le(){Object(Z.a)(this,le),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(z.a)(le,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(B){this._firstCheckpoint===0?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=B,this._totalBytes+=B):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=B,this._totalBytes+=B):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=B,this._totalBytes+=B,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var B=(this._now()-this._lastCheckpoint)/1e3;return B==0&&(B=1),this._intervalBytes/B/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),this._lastSecondBytes!==0?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var B=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/B/1024}}]),le}(),P=n,p=D("yKVA"),m=D("879j"),d=function(){function le(re){Object(Z.a)(this,le),this._message=re}return Object(z.a)(le,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),le}(),u=function(le){Object(p.a)(B,le);var re=Object(m.a)(B);function B($){return Object(Z.a)(this,B),re.call(this,$)}return Object(z.a)(B,[{key:"name",get:function(){return"IllegalStateException"}}]),B}(d),o=function(le){Object(p.a)(B,le);var re=Object(m.a)(B);function B($){return Object(Z.a)(this,B),re.call(this,$)}return Object(z.a)(B,[{key:"name",get:function(){return"InvalidArgumentException"}}]),B}(d),h=function(le){Object(p.a)(B,le);var re=Object(m.a)(B);function B($){return Object(Z.a)(this,B),re.call(this,$)}return Object(z.a)(B,[{key:"name",get:function(){return"NotImplementedException"}}]),B}(d),r={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},a={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},i=function(){function le(re){Object(Z.a)(this,le),this._type=re||"undefined",this._status=r.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(z.a)(le,[{key:"destroy",value:function(){this._status=r.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===r.kConnecting||this._status===r.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(B){this._onContentLengthKnown=B}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(B){this._onURLRedirect=B}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(B){this._onDataArrival=B}},{key:"onError",get:function(){return this._onError},set:function(B){this._onError=B}},{key:"onComplete",get:function(){return this._onComplete},set:function(B){this._onComplete=B}},{key:"open",value:function(B,$){throw new h("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new h("Unimplemented abstract function!")}}]),le}(),s=D("w4Tj"),S=D("oZsa"),x={};function T(){var le=self.navigator.userAgent.toLowerCase(),re=/(edge)\/([\w.]+)/.exec(le)||/(opr)[\/]([\w.]+)/.exec(le)||/(chrome)[ \/]([\w.]+)/.exec(le)||/(iemobile)[\/]([\w.]+)/.exec(le)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(le)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(le)||/(webkit)[ \/]([\w.]+)/.exec(le)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(le)||/(msie) ([\w.]+)/.exec(le)||le.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(le)||le.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(le)||[],B=/(ipad)/.exec(le)||/(ipod)/.exec(le)||/(windows phone)/.exec(le)||/(iphone)/.exec(le)||/(kindle)/.exec(le)||/(android)/.exec(le)||/(windows)/.exec(le)||/(mac)/.exec(le)||/(linux)/.exec(le)||/(cros)/.exec(le)||[],$={browser:re[5]||re[3]||re[1]||"",version:re[2]||re[4]||"0",majorVersion:re[4]||re[2]||"0",platform:B[0]||""},J={};if($.browser){J[$.browser]=!0;var ne=$.majorVersion.split(".");J.version={major:parseInt($.majorVersion,10),string:$.version},ne.length>1&&(J.version.minor=parseInt(ne[1],10)),ne.length>2&&(J.version.build=parseInt(ne[2],10))}if($.platform&&(J[$.platform]=!0),(J.chrome||J.opr||J.safari)&&(J.webkit=!0),J.rv||J.iemobile){J.rv&&delete J.rv;var ge="msie";$.browser=ge,J[ge]=!0}if(J.edge){delete J.edge;var Ue="msedge";$.browser=Ue,J[Ue]=!0}if(J.opr){var We="opera";$.browser=We,J[We]=!0}if(J.safari&&J.android){var _t="android";$.browser=_t,J[_t]=!0}J.name=$.browser,J.platform=$.platform;for(var Rt in x)x.hasOwnProperty(Rt)&&delete x[Rt];Object.assign(x,J)}T();var R=x,w=function(le){Object(p.a)(B,le);var re=Object(m.a)(B);function B($,J){var ne;return Object(Z.a)(this,B),ne=re.call(this,"fetch-stream-loader"),ne.TAG="FetchStreamLoader",ne._seekHandler=$,ne._config=J,ne._needStash=!0,ne._requestAbort=!1,ne._contentLength=null,ne._receivedLength=0,ne}return Object(z.a)(B,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),Object(s.a)(Object(S.a)(B.prototype),"destroy",this).call(this)}},{key:"open",value:function(J,ne){var ge=this;this._dataSource=J,this._range=ne;var Ue=J.url;this._config.reuseRedirectedURL&&J.redirectedURL!=null&&(Ue=J.redirectedURL);var We=this._seekHandler.getConfig(Ue,ne),_t=new self.Headers;if(typeof We.headers=="object"){var Rt=We.headers;for(var Bt in Rt)Rt.hasOwnProperty(Bt)&&_t.append(Bt,Rt[Bt])}var tt={method:"GET",headers:_t,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if(typeof this._config.headers=="object")for(var Dt in this._config.headers)_t.append(Dt,this._config.headers[Dt]);J.cors===!1&&(tt.mode="same-origin"),J.withCredentials&&(tt.credentials="include"),J.referrerPolicy&&(tt.referrerPolicy=J.referrerPolicy),this._status=r.kConnecting,self.fetch(We.url,tt).then(function(At){if(ge._requestAbort){ge._requestAbort=!1,ge._status=r.kIdle;return}if(At.ok&&At.status>=200&&At.status<=299){if(At.url!==We.url&&ge._onURLRedirect){var nn=ge._seekHandler.removeURLParameters(At.url);ge._onURLRedirect(nn)}var qt=At.headers.get("Content-Length");return qt!=null&&(ge._contentLength=parseInt(qt),ge._contentLength!==0&&(ge._onContentLengthKnown&&ge._onContentLengthKnown(ge._contentLength))),ge._pump.call(ge,At.body.getReader())}else if(ge._status=r.kError,ge._onError)ge._onError(a.HTTP_STATUS_CODE_INVALID,{code:At.status,msg:At.statusText});else throw new d("FetchStreamLoader: Http code invalid, "+At.status+" "+At.statusText)}).catch(function(At){if(ge._status=r.kError,ge._onError)ge._onError(a.EXCEPTION,{code:-1,msg:At.message});else throw At})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(J){var ne=this;return J.read().then(function(ge){if(ge.done)if(ne._contentLength!==null&&ne._receivedLength=15048,ne=R.msedge?J:!0;return self.fetch&&self.ReadableStream&&ne}catch(ge){return!1}}}]),B}(i),v=w,b=function(le){Object(p.a)(B,le);var re=Object(m.a)(B);function B($,J){var ne;return Object(Z.a)(this,B),ne=re.call(this,"xhr-moz-chunked-loader"),ne.TAG="MozChunkedLoader",ne._seekHandler=$,ne._config=J,ne._needStash=!0,ne._xhr=null,ne._requestAbort=!1,ne._contentLength=null,ne._receivedLength=0,ne}return Object(z.a)(B,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),Object(s.a)(Object(S.a)(B.prototype),"destroy",this).call(this)}},{key:"open",value:function(J,ne){this._dataSource=J,this._range=ne;var ge=J.url;this._config.reuseRedirectedURL&&J.redirectedURL!=null&&(ge=J.redirectedURL);var Ue=this._seekHandler.getConfig(ge,ne);this._requestURL=Ue.url;var We=this._xhr=new XMLHttpRequest;if(We.open("GET",Ue.url,!0),We.responseType="moz-chunked-arraybuffer",We.onreadystatechange=this._onReadyStateChange.bind(this),We.onprogress=this._onProgress.bind(this),We.onloadend=this._onLoadEnd.bind(this),We.onerror=this._onXhrError.bind(this),J.withCredentials&&(We.withCredentials=!0),typeof Ue.headers=="object"){var _t=Ue.headers;for(var Rt in _t)_t.hasOwnProperty(Rt)&&We.setRequestHeader(Rt,_t[Rt])}if(typeof this._config.headers=="object"){var Bt=this._config.headers;for(var tt in Bt)Bt.hasOwnProperty(tt)&&We.setRequestHeader(tt,Bt[tt])}this._status=r.kConnecting,We.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=r.kComplete}},{key:"_onReadyStateChange",value:function(J){var ne=J.target;if(ne.readyState===2){if(ne.responseURL!=null&&ne.responseURL!==this._requestURL&&this._onURLRedirect){var ge=this._seekHandler.removeURLParameters(ne.responseURL);this._onURLRedirect(ge)}if(ne.status!==0&&(ne.status<200||ne.status>299))if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("MozChunkedLoader: Http code invalid, "+ne.status+" "+ne.statusText);else this._status=r.kBuffering}}},{key:"_onProgress",value:function(J){if(this._status===r.kError)return;this._contentLength===null&&(J.total!==null&&J.total!==0&&(this._contentLength=J.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)));var ne=J.target.response,ge=this._range.from+this._receivedLength;this._receivedLength+=ne.byteLength,this._onDataArrival&&this._onDataArrival(ne,ge,this._receivedLength)}},{key:"_onLoadEnd",value:function(J){if(this._requestAbort===!0){this._requestAbort=!1;return}else if(this._status===r.kError)return;this._status=r.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)}},{key:"_onXhrError",value:function(J){this._status=r.kError;var ne=0,ge=null;if(this._contentLength&&J.loaded=200&&ne.status<=299){if(this._status=r.kBuffering,ne.responseURL!=null){var ge=this._seekHandler.removeURLParameters(ne.responseURL);ne.responseURL!==this._currentRequestURL&&ge!==this._currentRedirectedURL&&(this._currentRedirectedURL=ge,this._onURLRedirect&&this._onURLRedirect(ge))}var Ue=ne.getResponseHeader("Content-Length");if(Ue!=null&&this._contentLength==null){var We=parseInt(Ue);We>0&&(this._contentLength=We,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("MSStreamLoader: Http code invalid, "+ne.status+" "+ne.statusText);else if(ne.readyState===3&&(ne.status>=200&&ne.status<=299)){this._status=r.kBuffering;var _t=ne.response;this._reader.readAsArrayBuffer(_t)}}},{key:"_xhrOnError",value:function(J){this._status=r.kError;var ne=a.EXCEPTION,ge={code:-1,msg:J.constructor.name+" "+J.type};if(this._onError)this._onError(ne,ge);else throw new d(ge.msg)}},{key:"_msrOnProgress",value:function(J){var ne=J.target,ge=ne.result;if(ge==null){this._doReconnectIfNeeded();return}var Ue=ge.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=ge.byteLength;var We=this._totalRange.from+this._receivedLength;this._receivedLength+=Ue.byteLength,this._onDataArrival&&this._onDataArrival(Ue,We,this._receivedLength),ge.byteLength>=this._bufferLimit&&(N.v(this.TAG,"MSStream buffer exceeded max size near ".concat(We+Ue.byteLength,", reconnecting...")),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(this._contentLength==null||this._receivedLength=this._contentLength&&(ge=this._range.from+this._contentLength-1)),this._currentRequestRange={from:ne,to:ge},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(J,ne){this._lastTimeLoaded=0;var ge=J.url;this._config.reuseRedirectedURL&&(this._currentRedirectedURL!=null?ge=this._currentRedirectedURL:J.redirectedURL!=null&&(ge=J.redirectedURL));var Ue=this._seekHandler.getConfig(ge,ne);this._currentRequestURL=Ue.url;var We=this._xhr=new XMLHttpRequest;if(We.open("GET",Ue.url,!0),We.responseType="arraybuffer",We.onreadystatechange=this._onReadyStateChange.bind(this),We.onprogress=this._onProgress.bind(this),We.onload=this._onLoad.bind(this),We.onerror=this._onXhrError.bind(this),J.withCredentials&&(We.withCredentials=!0),typeof Ue.headers=="object"){var _t=Ue.headers;for(var Rt in _t)_t.hasOwnProperty(Rt)&&We.setRequestHeader(Rt,_t[Rt])}if(typeof this._config.headers=="object"){var Bt=this._config.headers;for(var tt in Bt)Bt.hasOwnProperty(tt)&&We.setRequestHeader(tt,Bt[tt])}We.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=r.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(J){var ne=J.target;if(ne.readyState===2){if(ne.responseURL!=null){var ge=this._seekHandler.removeURLParameters(ne.responseURL);ne.responseURL!==this._currentRequestURL&&ge!==this._currentRedirectedURL&&(this._currentRedirectedURL=ge,this._onURLRedirect&&this._onURLRedirect(ge))}if(ne.status>=200&&ne.status<=299){if(this._waitForTotalLength)return;this._status=r.kBuffering}else if(this._status=r.kError,this._onError)this._onError(a.HTTP_STATUS_CODE_INVALID,{code:ne.status,msg:ne.statusText});else throw new d("RangeLoader: Http code invalid, "+ne.status+" "+ne.statusText)}}},{key:"_onProgress",value:function(J){if(this._status===r.kError)return;if(this._contentLength===null){var ne=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,ne=!0;var ge=J.total;this._internalAbort(),ge!=null&ge!==0&&(this._totalLength=ge)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,ne){this._openSubRange();return}this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var Ue=J.loaded-this._lastTimeLoaded;this._lastTimeLoaded=J.loaded,this._speedSampler.addBytes(Ue)}},{key:"_normalizeSpeed",value:function(J){var ne=this._chunkSizeKBList,ge=ne.length-1,Ue=0,We=0,_t=ge;if(J=ne[Ue]&&J=3&&(ne=this._speedSampler.currentKBps)),ne!==0){var ge=this._normalizeSpeed(ne);this._currentSpeedNormalized!==ge&&(this._currentSpeedNormalized=ge,this._currentChunkSizeKB=ge)}var Ue=J.target.response,We=this._range.from+this._receivedLength;this._receivedLength+=Ue.byteLength;var _t=!1;this._contentLength!=null&&this._receivedLength0&&this._receivedLength0)for(var Ue=J.split("&"),We=0;We0;_t[0]!==this._startName&&_t[0]!==this._endName&&(Rt&&(ge+="&"),ge+=Ue[We])}return ge.length===0?$:$+"?"+ge}}]),le}(),O=W,V=function(){function le(re,B,$){Object(Z.a)(this,le),this.TAG="IOController",this._config=B,this._extraData=$,this._stashInitialSize=1024*384,B.stashInitialSize!=null&&B.stashInitialSize>0&&(this._stashInitialSize=B.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=1024*1024*3,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,B.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=re,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(re.url),this._refTotalLength=re.filesize?re.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new P,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(z.a)(le,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(B){this._extraData=B}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(B){this._onDataArrival=B}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(B){this._onSeeked=B}},{key:"onError",get:function(){return this._onError},set:function(B){this._onError=B}},{key:"onComplete",get:function(){return this._onComplete},set:function(B){this._onComplete=B}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(B){this._onRedirect=B}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(B){this._onRecoveredEarlyEof=B}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return this._redirectedURL!=null||this._dataSource.redirectedURL!=null}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===y?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var B=this._config;if(B.seekType==="range")this._seekHandler=new G(this._config.rangeLoadZeroStart);else if(B.seekType==="param"){var $=B.seekParamStart||"bstart",J=B.seekParamEnd||"bend";this._seekHandler=new O($,J)}else if(B.seekType==="custom"){if(typeof B.customSeekHandler!="function")throw new o("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new B.customSeekHandler}else throw new o("Invalid seekType in config: ".concat(B.seekType))}},{key:"_selectLoader",value:function(){if(this._config.customLoader!=null)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=j;else if(v.isSupported())this._loaderClass=v;else if(g.isSupported())this._loaderClass=g;else if(y.isSupported())this._loaderClass=y;else throw new d("Your browser doesn't support xhr with arraybuffer responseType!")}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(B){this._currentRange={from:0,to:-1},B&&(this._currentRange.from=B),this._speedSampler.reset(),B||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),this._stashUsed!==0?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var B=this._resumeFrom;this._resumeFrom=0,this._internalSeek(B,!0)}}},{key:"seek",value:function(B){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(B,!0)}},{key:"_internalSeek",value:function(B,$){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer($),this._loader.destroy(),this._loader=null;var J={from:B,to:-1};this._currentRange={from:J.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,J),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(B){if(!B||typeof B!="string"||B.length===0)throw new o("Url must be a non-empty string!");this._dataSource.url=B}},{key:"_expandBuffer",value:function(B){for(var $=this._stashSize;$+1024*1024*10){var ne=new Uint8Array(this._stashBuffer,0,this._stashUsed),ge=new Uint8Array(J,0,$);ge.set(ne,0)}this._stashBuffer=J,this._bufferSize=$}},{key:"_normalizeSpeed",value:function(B){var $=this._speedNormalizeList,J=$.length-1,ne=0,ge=0,Ue=J;if(B<$[0])return $[0];for(;ge<=Ue;){if(ne=ge+Math.floor((Ue-ge)/2),ne===J||B>=$[ne]&&B<$[ne+1])return $[ne];$[ne]=512&&B<=1024?$=Math.floor(B*1.5):$=B*2,$>8192&&($=8192);var J=$*1024+1024*1024*1;this._bufferSize0){var nn=this._stashBuffer.slice(0,this._stashUsed),qt=this._dispatchChunks(nn,this._stashByteStart);if(qt0){var Yt=new Uint8Array(nn,qt);At.set(Yt,0),this._stashUsed=Yt.byteLength,this._stashByteStart+=qt}}else this._stashUsed=0,this._stashByteStart+=qt;this._stashUsed+B.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+B.byteLength),At=new Uint8Array(this._stashBuffer,0,this._bufferSize)),At.set(new Uint8Array(B),this._stashUsed),this._stashUsed+=B.byteLength}else{var Q=this._dispatchChunks(B,$);if(Qthis._bufferSize&&(this._expandBuffer(L),At=new Uint8Array(this._stashBuffer,0,this._bufferSize)),At.set(new Uint8Array(B,Q),0),this._stashUsed+=L,this._stashByteStart=$+Q}}}else if(this._stashUsed===0){var Ue=this._dispatchChunks(B,$);if(Uethis._bufferSize&&this._expandBuffer(We);var _t=new Uint8Array(this._stashBuffer,0,this._bufferSize);_t.set(new Uint8Array(B,Ue),0),this._stashUsed+=We,this._stashByteStart=$+Ue}}else{this._stashUsed+B.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+B.byteLength);var Rt=new Uint8Array(this._stashBuffer,0,this._bufferSize);Rt.set(new Uint8Array(B),this._stashUsed),this._stashUsed+=B.byteLength;var Bt=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(Bt0){var tt=new Uint8Array(this._stashBuffer,Bt);Rt.set(tt,0)}this._stashUsed-=Bt,this._stashByteStart+=Bt}}},{key:"_flushStashBuffer",value:function(B){if(this._stashUsed>0){var $=this._stashBuffer.slice(0,this._stashUsed),J=this._dispatchChunks($,this._stashByteStart),ne=$.byteLength-J;if(J<$.byteLength)if(B)N.w(this.TAG,"".concat(ne," bytes unconsumed data remain when flush buffer, dropped"));else{if(J>0){var ge=new Uint8Array(this._stashBuffer,0,this._bufferSize),Ue=new Uint8Array($,J);ge.set(Ue,0),this._stashUsed=Ue.byteLength,this._stashByteStart+=J}return 0}return this._stashUsed=0,this._stashByteStart=0,ne}return 0}},{key:"_onLoaderComplete",value:function(B,$){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(B,$){N.e(this.TAG,"Loader error, code = ".concat($.code,", msg = ").concat($.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,B=a.UNRECOVERABLE_EARLY_EOF);switch(B){case a.EARLY_EOF:{if(!this._config.isLive&&this._totalLength){var J=this._currentRange.to+1;J0){var $=le.getConfig();B.emit("change",$)}}},{key:"registerListener",value:function(B){le.emitter.addListener("change",B)}},{key:"removeListener",value:function(B){le.emitter.removeListener("change",B)}},{key:"addLogListener",value:function(B){N.emitter.addListener("log",B),N.emitter.listenerCount("log")>0&&(N.ENABLE_CALLBACK=!0,le._notifyChange())}},{key:"removeLogListener",value:function(B){N.emitter.removeListener("log",B),N.emitter.listenerCount("log")===0&&(N.ENABLE_CALLBACK=!1,le._notifyChange())}}]),le}();He.emitter=new I.a;var Ee=He,be=function(){function le(){Object(Z.a)(this,le),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(z.a)(le,[{key:"isComplete",value:function(){var B=this.hasAudio===!1||this.hasAudio===!0&&this.audioCodec!=null&&this.audioSampleRate!=null&&this.audioChannelCount!=null,$=this.hasVideo===!1||this.hasVideo===!0&&this.videoCodec!=null&&this.width!=null&&this.height!=null&&this.fps!=null&&this.profile!=null&&this.level!=null&&this.refFrames!=null&&this.chromaFormat!=null&&this.sarNum!=null&&this.sarDen!=null;return this.mimeType!=null&&this.duration!=null&&this.metadata!=null&&this.hasKeyframesIndex!=null&&B&&$}},{key:"isSeekable",value:function(){return this.hasKeyframesIndex===!0}},{key:"getNearestKeyframe",value:function(B){if(this.keyframesIndex==null)return null;var $=this.keyframesIndex,J=this._search($.times,B);return{index:J,milliseconds:$.times[J],fileposition:$.filepositions[J]}}},{key:"_search",value:function(B,$){var J=0,ne=B.length-1,ge=0,Ue=0,We=ne;for($=B[ge]&&$=128){re.push(String.fromCharCode(ne&65535)),$+=2;continue}}}else if(B[$]<240){if(bt(B,$,2)){var ge=(B[$]&15)<<12|(B[$+1]&63)<<6|B[$+2]&63;if(ge>=2048&&(ge&63488)!==55296){re.push(String.fromCharCode(ge&65535)),$+=3;continue}}}else if(B[$]<248&&bt(B,$,3)){var Ue=(B[$]&7)<<18|(B[$+1]&63)<<12|(B[$+2]&63)<<6|B[$+3]&63;if(Ue>65536&&Ue<1114112){Ue-=65536,re.push(String.fromCharCode(Ue>>>10|55296)),re.push(String.fromCharCode(Ue&1023|56320)),$+=4;continue}}}re.push(String.fromCharCode(65533)),++$}return re.join("")}var yt=Et,pt=function(){var le=new ArrayBuffer(2);return new DataView(le).setInt16(0,256,!0),new Int16Array(le)[0]===256}(),st=function(){function le(){Object(Z.a)(this,le)}return Object(z.a)(le,null,[{key:"parseScriptData",value:function(B,$,J){var ne={};try{var ge=le.parseValue(B,$,J),Ue=le.parseValue(B,$+ge.size,J-ge.size);ne[ge.data]=Ue.data}catch(We){N.e("AMF",We.toString())}return ne}},{key:"parseObject",value:function(B,$,J){if(J<3)throw new u("Data not enough when parse ScriptDataObject");var ne=le.parseString(B,$,J),ge=le.parseValue(B,$+ne.size,J-ne.size),Ue=ge.objectEnd;return{data:{name:ne.data,value:ge.data},size:ne.size+ge.size,objectEnd:Ue}}},{key:"parseVariable",value:function(B,$,J){return le.parseObject(B,$,J)}},{key:"parseString",value:function(B,$,J){if(J<2)throw new u("Data not enough when parse String");var ne=new DataView(B,$,J),ge=ne.getUint16(0,!pt),Ue;return ge>0?Ue=yt(new Uint8Array(B,$+2,ge)):Ue="",{data:Ue,size:2+ge}}},{key:"parseLongString",value:function(B,$,J){if(J<4)throw new u("Data not enough when parse LongString");var ne=new DataView(B,$,J),ge=ne.getUint32(0,!pt),Ue;return ge>0?Ue=yt(new Uint8Array(B,$+4,ge)):Ue="",{data:Ue,size:4+ge}}},{key:"parseDate",value:function(B,$,J){if(J<10)throw new u("Data size invalid when parse Date");var ne=new DataView(B,$,J),ge=ne.getFloat64(0,!pt),Ue=ne.getInt16(8,!pt);return ge+=Ue*60*1e3,{data:new Date(ge),size:8+2}}},{key:"parseValue",value:function(B,$,J){if(J<1)throw new u("Data not enough when parse Value");var ne=new DataView(B,$,J),ge=1,Ue=ne.getUint8(0),We,_t=!1;try{switch(Ue){case 0:We=ne.getFloat64(1,!pt),ge+=8;break;case 1:{var Rt=ne.getUint8(1);We=!!Rt,ge+=1;break}case 2:{var Bt=le.parseString(B,$+1,J-1);We=Bt.data,ge+=Bt.size;break}case 3:{We={};var tt=0;for((ne.getUint32(J-4,!pt)&16777215)===9&&(tt=3);ge32)throw new o("ExpGolomb: readBits() bits exceeded max 32bits!");if(B<=this._current_word_bits_left){var $=this._current_word>>>32-B;return this._current_word<<=B,this._current_word_bits_left-=B,$}var J=this._current_word_bits_left?this._current_word:0;J=J>>>32-this._current_word_bits_left;var ne=B-this._current_word_bits_left;this._fillCurrentWord();var ge=Math.min(ne,this._current_word_bits_left),Ue=this._current_word>>>32-ge;return this._current_word<<=ge,this._current_word_bits_left-=ge,J=J<>>B)!==0)return this._current_word<<=B,this._current_word_bits_left-=B,B;return this._fillCurrentWord(),B+this._skipLeadingZero()}},{key:"readUEG",value:function(){var B=this._skipLeadingZero();return this.readBits(B+1)-1}},{key:"readSEG",value:function(){var B=this.readUEG();return B&1?B+1>>>1:-1*(B>>>1)}}]),le}(),_e=wt,Me=function(){function le(){Object(Z.a)(this,le)}return Object(z.a)(le,null,[{key:"_ebsp2rbsp",value:function(B){for(var $=B,J=$.byteLength,ne=new Uint8Array(J),ge=0,Ue=0;Ue=2&&($[Ue]===3&&$[Ue-1]===0&&$[Ue-2]===0))continue;ne[ge]=$[Ue],ge++}return new Uint8Array(ne.buffer,0,ge)}},{key:"parseSPS",value:function(B){var $=le._ebsp2rbsp(B),J=new _e($);J.readByte();var ne=J.readByte();J.readByte();var ge=J.readByte();J.readUEG();var Ue=le.getProfileString(ne),We=le.getLevelString(ge),_t=1,Rt=420,Bt=[0,420,422,444],tt=8;if((ne===100||ne===110||ne===122||ne===244||ne===44||ne===83||ne===86||ne===118||ne===128||ne===138||ne===144)&&(_t=J.readUEG(),_t===3&&J.readBits(1),_t<=3&&(Rt=Bt[_t]),tt=J.readUEG()+8,J.readUEG(),J.readBits(1),J.readBool()))for(var Dt=_t!==3?8:12,At=0;At0&&Nn<16?(Qt=Gi[Nn-1],ut=zi[Nn-1]):Nn===255&&(Qt=J.readByte()<<8|J.readByte(),ut=J.readByte()<<8|J.readByte())}if(J.readBool()&&J.readBool(),J.readBool()&&(J.readBits(4),J.readBool()&&J.readBits(24)),J.readBool()&&(J.readUEG(),J.readUEG()),J.readBool()){var ni=J.readBits(32),di=J.readBits(32);gn=J.readBool(),Yn=di,mi=ni*2,en=Yn/mi}}var ji=1;(Qt!==1||ut!==1)&&(ji=Qt/ut);var Mi=0,wi=0;if(_t===0)Mi=1,wi=2-Y;else{var Ci=_t===3?1:2,ar=_t===1?2:1;Mi=Ci,wi=ar*(2-Y)}var Zi=(L+1)*16,lr=(2-Y)*((k+1)*16);Zi-=(se+q)*Mi,lr-=(De+lt)*wi;var Vi=Math.ceil(Zi*ji);return J.destroy(),J=null,{profile_string:Ue,level_string:We,bit_depth:tt,ref_frames:Q,chroma_format:Rt,chroma_format_string:le.getChromaFormatString(Rt),frame_rate:{fixed:gn,fps:en,fps_den:mi,fps_num:Yn},sar_ratio:{width:Qt,height:ut},codec_size:{width:Zi,height:lr},present_size:{width:Vi,height:lr}}}},{key:"_skipScalingList",value:function(B,$){for(var J=8,ne=8,ge=0,Ue=0;Ue<$;Ue++)ne!==0&&(ge=B.readSEG(),ne=(J+ge+256)%256),J=ne===0?J:ne}},{key:"getProfileString",value:function(B){switch(B){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(B){return(B/10).toFixed(1)}},{key:"getChromaFormatString",value:function(B){switch(B){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),le}(),ye=Me,Se={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"},Be=Se;function Ze(le){return le>>>8&255|(le&255)<<8}function ot(le){return(le&4278190080)>>>24|(le&16711680)>>>8|(le&65280)<<8|(le&255)<<24}function ft(le,re){return le[re]<<24|le[re+1]<<16|le[re+2]<<8|le[re+3]}var Ct=function(){function le(re,B){Object(Z.a)(this,le),this.TAG="FLVDemuxer",this._config=B,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=re.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=re.hasAudioTrack,this._hasVideo=re.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new Ke,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var $=new ArrayBuffer(2);return new DataView($).setInt16(0,256,!0),new Int16Array($)[0]===256}()}return Object(z.a)(le,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(B){return B.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(B){this._onTrackMetadata=B}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(B){this._onMediaInfo=B}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(B){this._onMetaDataArrived=B}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(B){this._onScriptDataArrived=B}},{key:"onError",get:function(){return this._onError},set:function(B){this._onError=B}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(B){this._onDataAvailable=B}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(B){this._timestampBase=B}},{key:"overridedDuration",get:function(){return this._duration},set:function(B){this._durationOverrided=!0,this._duration=B,this._mediaInfo.duration=B}},{key:"overridedHasAudio",set:function(B){this._hasAudioFlagOverrided=!0,this._hasAudio=B,this._mediaInfo.hasAudio=B}},{key:"overridedHasVideo",set:function(B){this._hasVideoFlagOverrided=!0,this._hasVideo=B,this._mediaInfo.hasVideo=B}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new Ke}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!this._hasAudio&&this._hasVideo?this._videoInitialMetadataDispatched:!1}},{key:"parseChunks",value:function(B,$){if(!this._onError||!this._onMediaInfo||!this._onTrackMetadata||!this._onDataAvailable)throw new u("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var J=0,ne=this._littleEndian;if($===0)if(B.byteLength>13){var ge=le.probe(B);J=ge.dataOffset}else return 0;if(this._firstParse){this._firstParse=!1,$+J!==this._dataOffset&&N.w(this.TAG,"First time parsing but chunk byteStart invalid!");var Ue=new DataView(B,J),We=Ue.getUint32(0,!ne);We!==0&&N.w(this.TAG,"PrevTagSize0 !== 0 !!!"),J+=4}for(;JB.byteLength)break;var Rt=_t.getUint8(0),Bt=_t.getUint32(0,!ne)&16777215;if(J+11+Bt+4>B.byteLength)break;if(Rt!==8&&Rt!==9&&Rt!==18){N.w(this.TAG,"Unsupported tag type ".concat(Rt,", skipped")),J+=11+Bt+4;continue}var tt=_t.getUint8(4),Dt=_t.getUint8(5),At=_t.getUint8(6),nn=_t.getUint8(7),qt=At|Dt<<8|tt<<16|nn<<24,Yt=_t.getUint32(7,!ne)&16777215;Yt!==0&&N.w(this.TAG,"Meet tag which has StreamID != 0!");var Q=J+11;switch(Rt){case 8:this._parseAudioData(B,Q,Bt,qt);break;case 9:this._parseVideoData(B,Q,Bt,qt,$+J);break;case 18:this._parseScriptData(B,Q,Bt);break}var L=_t.getUint32(11+Bt,!ne);L!==11+Bt&&N.w(this.TAG,"Invalid PrevTagSize ".concat(L)),J+=11+Bt+4}return this._isInitialMetadataDispatched()&&(this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack)),J}},{key:"_parseScriptData",value:function(B,$,J){var ne=ht.parseScriptData(B,$,J);if(ne.hasOwnProperty("onMetaData")){if(ne.onMetaData==null||typeof ne.onMetaData!="object"){N.w(this.TAG,"Invalid onMetaData structure!");return}this._metadata&&N.w(this.TAG,"Found another onMetaData tag!"),this._metadata=ne;var ge=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},ge)),typeof ge.hasAudio=="boolean"&&(this._hasAudioFlagOverrided===!1&&(this._hasAudio=ge.hasAudio,this._mediaInfo.hasAudio=this._hasAudio)),typeof ge.hasVideo=="boolean"&&(this._hasVideoFlagOverrided===!1&&(this._hasVideo=ge.hasVideo,this._mediaInfo.hasVideo=this._hasVideo)),typeof ge.audiodatarate=="number"&&(this._mediaInfo.audioDataRate=ge.audiodatarate),typeof ge.videodatarate=="number"&&(this._mediaInfo.videoDataRate=ge.videodatarate),typeof ge.width=="number"&&(this._mediaInfo.width=ge.width),typeof ge.height=="number"&&(this._mediaInfo.height=ge.height),typeof ge.duration=="number"){if(!this._durationOverrided){var Ue=Math.floor(ge.duration*this._timescale);this._duration=Ue,this._mediaInfo.duration=Ue}}else this._mediaInfo.duration=0;if(typeof ge.framerate=="number"){var We=Math.floor(ge.framerate*1e3);if(We>0){var _t=We/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=_t,this._referenceFrameRate.fps_num=We,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=_t}}if(typeof ge.keyframes=="object"){this._mediaInfo.hasKeyframesIndex=!0;var Rt=ge.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(Rt),ge.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=ge,N.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(ne).length>0&&(this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},ne)))}},{key:"_parseKeyframesIndex",value:function(B){for(var $=[],J=[],ne=1;ne>>4;if(_t!==2&&_t!==10){this._onError(Be.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+_t);return}var Rt=0,Bt=(We&12)>>>2;if(Bt>=0&&Bt<=4)Rt=this._flvSoundRateTable[Bt];else{this._onError(Be.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+Bt);return}var tt=(We&2)>>>1,Dt=We&1,At=this._audioMetadata,nn=this._audioTrack;if(At||(this._hasAudio===!1&&this._hasAudioFlagOverrided===!1&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),At=this._audioMetadata={},At.type="audio",At.id=nn.id,At.timescale=this._timescale,At.duration=this._duration,At.audioSampleRate=Rt,At.channelCount=Dt===0?1:2),_t===10){var qt=this._parseAACAudioData(B,$+1,J-1);if(qt==null)return;if(qt.packetType===0){At.config&&N.w(this.TAG,"Found another AudioSpecificConfig!");var Yt=qt.data;At.audioSampleRate=Yt.samplingRate,At.channelCount=Yt.channelCount,At.codec=Yt.codec,At.originalCodec=Yt.originalCodec,At.config=Yt.config,At.refSampleDuration=1024/At.audioSampleRate*At.timescale,N.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",At);var Q=this._mediaInfo;Q.audioCodec=At.originalCodec,Q.audioSampleRate=At.audioSampleRate,Q.audioChannelCount=At.channelCount,Q.hasVideo?Q.videoCodec!=null&&(Q.mimeType='video/x-flv; codecs="'+Q.videoCodec+","+Q.audioCodec+'"'):Q.mimeType='video/x-flv; codecs="'+Q.audioCodec+'"',Q.isComplete()&&this._onMediaInfo(Q)}else if(qt.packetType===1){var L=this._timestampBase+ne,k={unit:qt.data,length:qt.data.byteLength,dts:L,pts:L};nn.samples.push(k),nn.length+=qt.data.length}else N.e(this.TAG,"Flv: Unsupported AAC data type ".concat(qt.packetType))}else if(_t===2){if(!At.codec){var Y=this._parseMP3AudioData(B,$+1,J-1,!0);if(Y==null)return;At.audioSampleRate=Y.samplingRate,At.channelCount=Y.channelCount,At.codec=Y.codec,At.originalCodec=Y.originalCodec,At.refSampleDuration=1152/At.audioSampleRate*At.timescale,N.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",At);var se=this._mediaInfo;se.audioCodec=At.codec,se.audioSampleRate=At.audioSampleRate,se.audioChannelCount=At.channelCount,se.audioDataRate=Y.bitRate,se.hasVideo?se.videoCodec!=null&&(se.mimeType='video/x-flv; codecs="'+se.videoCodec+","+se.audioCodec+'"'):se.mimeType='video/x-flv; codecs="'+se.audioCodec+'"',se.isComplete()&&this._onMediaInfo(se)}var q=this._parseMP3AudioData(B,$+1,J-1,!1);if(q==null)return;var De=this._timestampBase+ne,lt={unit:q,length:q.byteLength,dts:De,pts:De};nn.samples.push(lt),nn.length+=q.length}}},{key:"_parseAACAudioData",value:function(B,$,J){if(J<=1){N.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");return}var ne={},ge=new Uint8Array(B,$,J);return ne.packetType=ge[0],ge[0]===0?ne.data=this._parseAACAudioSpecificConfig(B,$+1,J-1):ne.data=ge.subarray(1),ne}},{key:"_parseAACAudioSpecificConfig",value:function(B,$,J){var ne=new Uint8Array(B,$,J),ge=null,Ue=0,We=0,_t=null,Rt=0,Bt=null;if(Ue=We=ne[0]>>>3,Rt=(ne[0]&7)<<1|ne[1]>>>7,Rt<0||Rt>=this._mpegSamplingRates.length){this._onError(Be.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");return}var tt=this._mpegSamplingRates[Rt],Dt=(ne[1]&120)>>>3;if(Dt<0||Dt>=8){this._onError(Be.FORMAT_ERROR,"Flv: AAC invalid channel configuration");return}Ue===5&&(Bt=(ne[1]&7)<<1|ne[2]>>>7,_t=(ne[2]&124)>>>2);var At=self.navigator.userAgent.toLowerCase();return At.indexOf("firefox")!==-1?Rt>=6?(Ue=5,ge=new Array(4),Bt=Rt-3):(Ue=2,ge=new Array(2),Bt=Rt):At.indexOf("android")!==-1?(Ue=2,ge=new Array(2),Bt=Rt):(Ue=5,Bt=Rt,ge=new Array(4),Rt>=6?Bt=Rt-3:Dt===1&&(Ue=2,ge=new Array(2),Bt=Rt)),ge[0]=Ue<<3,ge[0]|=(Rt&15)>>>1,ge[1]=(Rt&15)<<7,ge[1]|=(Dt&15)<<3,Ue===5&&(ge[1]|=(Bt&15)>>>1,ge[2]=(Bt&1)<<7,ge[2]|=2<<2,ge[3]=0),{config:ge,samplingRate:tt,channelCount:Dt,codec:"mp4a.40."+Ue,originalCodec:"mp4a.40."+We}}},{key:"_parseMP3AudioData",value:function(B,$,J,ne){if(J<4){N.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");return}var ge=this._littleEndian,Ue=new Uint8Array(B,$,J),We=null;if(ne){if(Ue[0]!==255)return;var _t=Ue[1]>>>3&3,Rt=(Ue[1]&6)>>1,Bt=(Ue[2]&240)>>>4,tt=(Ue[2]&12)>>>2,Dt=Ue[3]>>>6&3,At=Dt!==3?2:1,nn=0,qt=0,Yt=34,Q="mp3";switch(_t){case 0:nn=this._mpegAudioV25SampleRateTable[tt];break;case 2:nn=this._mpegAudioV20SampleRateTable[tt];break;case 3:nn=this._mpegAudioV10SampleRateTable[tt];break}switch(Rt){case 1:Yt=34,Bt>>4,_t=Ue&15;if(_t!==7){this._onError(Be.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(_t));return}this._parseAVCVideoPacket(B,$+1,J-1,ne,ge,We)}},{key:"_parseAVCVideoPacket",value:function(B,$,J,ne,ge,Ue){if(J<4){N.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");return}var We=this._littleEndian,_t=new DataView(B,$,J),Rt=_t.getUint8(0),Bt=_t.getUint32(0,!We)&16777215,tt=Bt<<8>>8;if(Rt===0)this._parseAVCDecoderConfigurationRecord(B,$+4,J-4);else if(Rt===1)this._parseAVCVideoData(B,$+4,J-4,ne,ge,Ue,tt);else if(!(Rt===2)){this._onError(Be.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(Rt));return}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(B,$,J){if(J<7){N.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");return}var ne=this._videoMetadata,ge=this._videoTrack,Ue=this._littleEndian,We=new DataView(B,$,J);ne?typeof ne.avcc!="undefined"&&N.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(this._hasVideo===!1&&this._hasVideoFlagOverrided===!1&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),ne=this._videoMetadata={},ne.type="video",ne.id=ge.id,ne.timescale=this._timescale,ne.duration=this._duration);var _t=We.getUint8(0),Rt=We.getUint8(1),Bt=We.getUint8(2),tt=We.getUint8(3);if(_t!==1||Rt===0){this._onError(Be.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");return}if(this._naluLengthSize=(We.getUint8(4)&3)+1,this._naluLengthSize!==3&&this._naluLengthSize!==4){this._onError(Be.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));return}var Dt=We.getUint8(5)&31;if(Dt===0){this._onError(Be.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");return}else Dt>1&&N.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(Dt));for(var At=6,nn=0;nn1&&N.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(Nt));At++;for(var Qt=0;Qt=J){N.w(this.TAG,"Malformed Nalu near timestamp ".concat(nn,", offset = ").concat(Dt,", dataSize = ").concat(J));break}var Yt=Rt.getUint32(Dt,!_t);if(At===3&&(Yt>>>=8),Yt>J-At){N.w(this.TAG,"Malformed Nalus near timestamp ".concat(nn,", NaluSize > DataSize!"));return}var Q=Rt.getUint8(Dt+At)&31;Q===5&&(qt=!0);var L=new Uint8Array(B,$+Dt,At+Yt),k={type:Q,data:L};Bt.push(k),tt+=L.byteLength,Dt+=At+Yt}if(Bt.length){var Y=this._videoTrack,se={units:Bt,length:tt,isKeyframe:qt,dts:nn,cts:We,pts:nn+We};qt&&(se.fileposition=ge),Y.samples.push(se),Y.length+=tt}}}],[{key:"probe",value:function(B){var $=new Uint8Array(B),J={match:!1};if($[0]!==70||$[1]!==76||$[2]!==86||$[3]!==1)return J;var ne=($[4]&4)>>>2!==0,ge=($[4]&1)!==0,Ue=ft($,5);return Ue<9?J:{match:!0,consumed:Ue,dataOffset:Ue,hasAudioTrack:ne,hasVideoTrack:ge}}}]),le}(),Ot=Ct,Ne=function(){function le(){Object(Z.a)(this,le)}return Object(z.a)(le,null,[{key:"init",value:function(){le.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]};for(var B in le.types)le.types.hasOwnProperty(B)&&(le.types[B]=[B.charCodeAt(0),B.charCodeAt(1),B.charCodeAt(2),B.charCodeAt(3)]);var $=le.constants={};$.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),$.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),$.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),$.STSC=$.STCO=$.STTS,$.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),$.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),$.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),$.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),$.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),$.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(B){for(var $=8,J=null,ne=Array.prototype.slice.call(arguments,1),ge=ne.length,Ue=0;Ue>>24&255,J[1]=$>>>16&255,J[2]=$>>>8&255,J[3]=$&255,J.set(B,4);for(var We=8,_t=0;_t>>24&255,B>>>16&255,B>>>8&255,B&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(B){return le.box(le.types.trak,le.tkhd(B),le.mdia(B))}},{key:"tkhd",value:function(B){var $=B.id,J=B.duration,ne=B.presentWidth,ge=B.presentHeight;return le.box(le.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&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,ne>>>8&255,ne&255,0,0,ge>>>8&255,ge&255,0,0]))}},{key:"mdia",value:function(B){return le.box(le.types.mdia,le.mdhd(B),le.hdlr(B),le.minf(B))}},{key:"mdhd",value:function(B){var $=B.timescale,J=B.duration;return le.box(le.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,J>>>24&255,J>>>16&255,J>>>8&255,J&255,85,196,0,0]))}},{key:"hdlr",value:function(B){var $=null;return B.type==="audio"?$=le.constants.HDLR_AUDIO:$=le.constants.HDLR_VIDEO,le.box(le.types.hdlr,$)}},{key:"minf",value:function(B){var $=null;return B.type==="audio"?$=le.box(le.types.smhd,le.constants.SMHD):$=le.box(le.types.vmhd,le.constants.VMHD),le.box(le.types.minf,$,le.dinf(),le.stbl(B))}},{key:"dinf",value:function(){var B=le.box(le.types.dinf,le.box(le.types.dref,le.constants.DREF));return B}},{key:"stbl",value:function(B){var $=le.box(le.types.stbl,le.stsd(B),le.box(le.types.stts,le.constants.STTS),le.box(le.types.stsc,le.constants.STSC),le.box(le.types.stsz,le.constants.STSZ),le.box(le.types.stco,le.constants.STCO));return $}},{key:"stsd",value:function(B){return B.type==="audio"?B.codec==="mp3"?le.box(le.types.stsd,le.constants.STSD_PREFIX,le.mp3(B)):le.box(le.types.stsd,le.constants.STSD_PREFIX,le.mp4a(B)):le.box(le.types.stsd,le.constants.STSD_PREFIX,le.avc1(B))}},{key:"mp3",value:function(B){var $=B.channelCount,J=B.audioSampleRate,ne=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,$,0,16,0,0,0,0,J>>>8&255,J&255,0,0]);return le.box(le.types[".mp3"],ne)}},{key:"mp4a",value:function(B){var $=B.channelCount,J=B.audioSampleRate,ne=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,$,0,16,0,0,0,0,J>>>8&255,J&255,0,0]);return le.box(le.types.mp4a,ne,le.esds(B))}},{key:"esds",value:function(B){var $=B.config||[],J=$.length,ne=new Uint8Array([0,0,0,0,3,23+J,0,1,0,4,15+J,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([J]).concat($).concat([6,1,2]));return le.box(le.types.esds,ne)}},{key:"avc1",value:function(B){var $=B.avcc,J=B.codecWidth,ne=B.codecHeight,ge=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,J>>>8&255,J&255,ne>>>8&255,ne&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return le.box(le.types.avc1,ge,le.box(le.types.avcC,$))}},{key:"mvex",value:function(B){return le.box(le.types.mvex,le.trex(B))}},{key:"trex",value:function(B){var $=B.id,J=new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return le.box(le.types.trex,J)}},{key:"moof",value:function(B,$){return le.box(le.types.moof,le.mfhd(B.sequenceNumber),le.traf(B,$))}},{key:"mfhd",value:function(B){var $=new Uint8Array([0,0,0,0,B>>>24&255,B>>>16&255,B>>>8&255,B&255]);return le.box(le.types.mfhd,$)}},{key:"traf",value:function(B,$){var J=B.id,ne=le.box(le.types.tfhd,new Uint8Array([0,0,0,0,J>>>24&255,J>>>16&255,J>>>8&255,J&255])),ge=le.box(le.types.tfdt,new Uint8Array([0,0,0,0,$>>>24&255,$>>>16&255,$>>>8&255,$&255])),Ue=le.sdtp(B),We=le.trun(B,Ue.byteLength+16+16+8+16+8+8);return le.box(le.types.traf,ne,ge,We,Ue)}},{key:"sdtp",value:function(B){for(var $=B.samples||[],J=$.length,ne=new Uint8Array(4+J),ge=0;ge>>24&255,ne>>>16&255,ne>>>8&255,ne&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255],0);for(var We=0;We>>24&255,_t>>>16&255,_t>>>8&255,_t&255,Rt>>>24&255,Rt>>>16&255,Rt>>>8&255,Rt&255,Bt.isLeading<<2|Bt.dependsOn,Bt.isDependedOn<<6|Bt.hasRedundancy<<4|Bt.isNonSync,0,0,tt>>>24&255,tt>>>16&255,tt>>>8&255,tt&255],12+16*We)}return le.box(le.types.trun,Ue)}},{key:"mdat",value:function(B){return le.box(le.types.mdat,B)}}]),le}();Ne.init();var ke=Ne,at=function(){function le(){Object(Z.a)(this,le)}return Object(z.a)(le,null,[{key:"getSilentFrame",value:function(B,$){if(B==="mp4a.40.2"){if($===1)return new Uint8Array([0,200,0,128,35,128]);if($===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if($===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if($===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if($===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($===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if($===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($===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($===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),le}(),ct=at,Ge=function le(re,B,$,J,ne){Object(Z.a)(this,le),this.dts=re,this.pts=B,this.duration=$,this.originalDts=J,this.isSyncPoint=ne,this.fileposition=null},et=function(){function le(){Object(Z.a)(this,le),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(z.a)(le,[{key:"appendSyncPoint",value:function(B){B.isSyncPoint=!0,this.syncPoints.push(B)}}]),le}(),Ae=function(){function le(){Object(Z.a)(this,le),this._list=[]}return Object(z.a)(le,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(B){var $=this._list;if(B.length===0)return;$.length>0&&B[0].originalDts<$[$.length-1].originalDts&&this.clear(),Array.prototype.push.apply($,B)}},{key:"getLastSyncPointBeforeDts",value:function(B){if(this._list.length==0)return null;var $=this._list,J=0,ne=$.length-1,ge=0,Ue=0,We=ne;for(B<$[0].dts&&(J=0,Ue=We+1);Ue<=We;)if(ge=Ue+Math.floor((We-Ue)/2),ge===ne||B>=$[ge].dts&&B<$[ge+1].dts){J=ge;break}else $[ge].dts$[ne].lastSample.originalDts&&B<$[ne+1].originalBeginDts){We=ne;break}else $[ne].originalBeginDts=$[ne].lastSample.originalDts&&(ne===$.length-1||ne<$.length-1&&J.originalBeginDts<$[ne+1].originalBeginDts)?ge=ne+1:$.length>0&&(ge=this._searchNearestSegmentBefore(J.originalBeginDts)+1),this._lastAppendLocation=ge,this._list.splice(ge,0,J)}},{key:"getLastSegmentBefore",value:function(B){var $=this._searchNearestSegmentBefore(B);return $>=0?this._list[$]:null}},{key:"getLastSampleBefore",value:function(B){var $=this.getLastSegmentBefore(B);return $!=null?$.lastSample:null}},{key:"getLastSyncPointBefore",value:function(B){for(var $=this._searchNearestSegmentBefore(B),J=this._list[$].syncPoints;J.length===0&&$>0;)$--,J=this._list[$].syncPoints;return J.length>0?J[J.length-1]:null}}]),le}(),xe=function(){function le(re){Object(Z.a)(this,le),this.TAG="MP4Remuxer",this._config=re,this._isLive=re.isLive===!0,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=Infinity,this._videoDtsBase=Infinity,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ve("audio"),this._videoSegmentInfoList=new ve("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!!(R.chrome&&(R.version.major<50||R.version.major===50&&R.version.build<2661)),this._fillSilentAfterSeek=R.msedge||R.msie,this._mp3UseMpegAudio=!R.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(z.a)(le,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(B){return B.onDataAvailable=this.remux.bind(this),B.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(B){this._onInitSegment=B}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(B){this._onMediaSegment=B}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(B){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(B,$){if(!this._onMediaSegment)throw new u("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(B,$),this._remuxVideo($),this._remuxAudio(B)}},{key:"_onTrackMetadataReceived",value:function(B,$){var J=null,ne="mp4",ge=$.codec;if(B==="audio")this._audioMeta=$,$.codec==="mp3"&&this._mp3UseMpegAudio?(ne="mpeg",ge="",J=new Uint8Array):J=ke.generateInitSegment($);else if(B==="video")this._videoMeta=$,J=ke.generateInitSegment($);else return;if(!this._onInitSegment)throw new u("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(B,{type:B,data:J.buffer,codec:ge,container:"".concat(B,"/").concat(ne),mediaDuration:$.duration})}},{key:"_calculateDtsBase",value:function(B,$){if(this._dtsBaseInited)return;B.samples&&B.samples.length&&(this._audioDtsBase=B.samples[0].dts),$.samples&&$.samples.length&&(this._videoDtsBase=$.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0}},{key:"flushStashedSamples",value:function(){var B=this._videoStashedLastSample,$=this._audioStashedLastSample,J={type:"video",id:1,sequenceNumber:0,samples:[],length:0};B!=null&&(J.samples.push(B),J.length=B.length);var ne={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};$!=null&&(ne.samples.push($),ne.length=$.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(J,!0),this._remuxAudio(ne,!0)}},{key:"_remuxAudio",value:function(B,$){if(this._audioMeta==null)return;var J=B,ne=J.samples,ge=void 0,Ue=-1,We=-1,_t=-1,Rt=this._audioMeta.refSampleDuration,Bt=this._audioMeta.codec==="mp3"&&this._mp3UseMpegAudio,tt=this._dtsBaseInited&&this._audioNextDts===void 0,Dt=!1;if(!ne||ne.length===0)return;if(ne.length===1&&!$)return;var At=0,nn=null,qt=0;Bt?(At=0,qt=J.length):(At=8,qt=8+J.length);var Yt=null;if(ne.length>1&&(Yt=ne.pop(),qt-=Yt.length),this._audioStashedLastSample!=null){var Q=this._audioStashedLastSample;this._audioStashedLastSample=null,ne.unshift(Q),qt+=Q.length}Yt!=null&&(this._audioStashedLastSample=Yt);var L=ne[0].dts-this._dtsBase;if(this._audioNextDts)ge=L-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())ge=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(this._audioMeta.originalCodec!=="mp3"&&(Dt=!0));else{var k=this._audioSegmentInfoList.getLastSampleBefore(L);if(k!=null){var Y=L-(k.originalDts+k.duration);Y<=3&&(Y=0);var se=k.dts+k.duration+Y;ge=L-se}else ge=0}if(Dt){var q=L-ge,De=this._videoSegmentInfoList.getLastSegmentBefore(L);if(De!=null&&De.beginDts=1?Nn=ut[ut.length-1].duration:Nn=Math.floor(Rt);var ni=!1,di=null;if(Nn>Rt*1.5&&this._audioMeta.codec!=="mp3"&&this._fillAudioTimestampGap&&!R.safari){ni=!0;var ji=Math.abs(Nn-Rt),Mi=Math.ceil(ji/Rt),wi=ri+Rt;N.w(this.TAG,`Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync. `+"dts: ".concat(ri+Nn," ms, expected: ").concat(ri+Math.round(Rt)," ms, ")+"delta: ".concat(Math.round(ji)," ms, generate: ").concat(Mi," frames"));var Ci=ct.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);Ci==null&&(N.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),Ci=Yn),di=[];for(var ar=0;ar0){var lr=di[di.length-1];lr.duration=Zi-lr.dts}var Vi={dts:Zi,pts:Zi,cts:0,unit:Ci,size:Ci.byteLength,duration:0,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};di.push(Vi),qt+=Vi.size,wi+=Rt}var qi=di[di.length-1];qi.duration=ri+Nn-qi.dts,Nn=Math.round(Rt)}ut.push({dts:ri,pts:ri,cts:0,unit:gn.unit,size:gn.unit.byteLength,duration:Nn,originalDts:mi,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),ni&&ut.push.apply(ut,di)}Bt?nn=new Uint8Array(qt):(nn=new Uint8Array(qt),nn[0]=qt>>>24&255,nn[1]=qt>>>16&255,nn[2]=qt>>>8&255,nn[3]=qt&255,nn.set(ke.types.mdat,4));for(var ur=0;ur1&&(At=ne.pop(),Dt-=At.length),this._videoStashedLastSample!=null){var nn=this._videoStashedLastSample;this._videoStashedLastSample=null,ne.unshift(nn),Dt+=nn.length}At!=null&&(this._videoStashedLastSample=At);var qt=ne[0].dts-this._dtsBase;if(this._videoNextDts)ge=qt-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())ge=0;else{var Yt=this._videoSegmentInfoList.getLastSampleBefore(qt);if(Yt!=null){var Q=qt-(Yt.originalDts+Yt.duration);Q<=3&&(Q=0);var L=Yt.dts+Yt.duration+Q;ge=qt-L}else ge=0}for(var k=new et,Y=[],se=0;se=1?en=Y[Y.length-1].duration:en=Math.floor(this._videoMeta.refSampleDuration);if(lt){var mi=new Ge(Nt,ut,en,q.dts,!0);mi.fileposition=q.fileposition,k.appendSyncPoint(mi)}Y.push({dts:Nt,pts:ut,cts:Qt,units:q.units,size:q.length,isKeyframe:lt,duration:en,originalDts:De,flags:{isLeading:0,dependsOn:lt?2:1,isDependedOn:lt?1:0,hasRedundancy:0,isNonSync:lt?0:1}})}tt=new Uint8Array(Dt),tt[0]=Dt>>>24&255,tt[1]=Dt>>>16&255,tt[2]=Dt>>>8&255,tt[3]=Dt&255,tt.set(ke.types.mdat,4);for(var ri=0;ri0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,ge=this._demuxer.parseChunks(B,$);else if((ne=Ot.probe(B)).match){this._demuxer=new Ot(ne,this._config),this._remuxer||(this._remuxer=new ue(this._config));var Ue=this._mediaDataSource;Ue.duration!=null&&!isNaN(Ue.duration)&&(this._demuxer.overridedDuration=Ue.duration),typeof Ue.hasAudio=="boolean"&&(this._demuxer.overridedHasAudio=Ue.hasAudio),typeof Ue.hasVideo=="boolean"&&(this._demuxer.overridedHasVideo=Ue.hasVideo),this._demuxer.timestampBase=Ue.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),ge=this._demuxer.parseChunks(B,$)}else ne=null,N.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){J._internalAbort()}),this._emitter.emit(de.DEMUX_ERROR,Be.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),ge=0;return ge}},{key:"_onMediaInfo",value:function(B){var $=this;this._mediaInfo==null&&(this._mediaInfo=Object.assign({},B),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,Ke.prototype));var J=Object.assign({},B);Object.setPrototypeOf(J,Ke.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=J,this._reportSegmentMediaInfo(this._currentSegmentIndex),this._pendingSeekTime!=null&&Promise.resolve().then(function(){var ne=$._pendingSeekTime;$._pendingSeekTime=null,$.seek(ne)})}},{key:"_onMetaDataArrived",value:function(B){this._emitter.emit(de.METADATA_ARRIVED,B)}},{key:"_onScriptDataArrived",value:function(B){this._emitter.emit(de.SCRIPTDATA_ARRIVED,B)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(B){var $=B,J=$+1;J0&&J[0].originalDts===ne&&(ne=J[0].pts),this._emitter.emit(de.RECOMMEND_SEEKPOINT,ne)}}},{key:"_enableStatisticsReporter",value:function(){this._statisticsReporter==null&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(B){var $=this._mediaInfo.segments[B],J=Object.assign({},$);J.duration=this._mediaInfo.duration,J.segmentCount=this._mediaInfo.segmentCount,delete J.segments,delete J.keyframesIndex,this._emitter.emit(de.MEDIA_INFO,J)}},{key:"_reportStatisticsInfo",value:function(){var B={};B.url=this._ioctl.currentURL,B.hasRedirect=this._ioctl.hasRedirect,B.hasRedirect&&(B.redirectedURL=this._ioctl.currentRedirectedURL),B.speed=this._ioctl.currentSpeed,B.loaderType=this._ioctl.loaderType,B.currentSegmentIndex=this._currentSegmentIndex,B.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(de.STATISTICS_INFO,B)}}]),le}(),Le=we,ze=function(re){var B="TransmuxingWorker",$=null,J=qt.bind(this);X.install(),re.addEventListener("message",function(Yt){switch(Yt.data.cmd){case"init":$=new Le(Yt.data.param[0],Yt.data.param[1]),$.on(de.IO_ERROR,Dt.bind(this)),$.on(de.DEMUX_ERROR,At.bind(this)),$.on(de.INIT_SEGMENT,ne.bind(this)),$.on(de.MEDIA_SEGMENT,ge.bind(this)),$.on(de.LOADING_COMPLETE,Ue.bind(this)),$.on(de.RECOVERED_EARLY_EOF,We.bind(this)),$.on(de.MEDIA_INFO,_t.bind(this)),$.on(de.METADATA_ARRIVED,Rt.bind(this)),$.on(de.SCRIPTDATA_ARRIVED,Bt.bind(this)),$.on(de.STATISTICS_INFO,tt.bind(this)),$.on(de.RECOMMEND_SEEKPOINT,nn.bind(this));break;case"destroy":$&&($.destroy(),$=null),re.postMessage({msg:"destroyed"});break;case"start":$.start();break;case"stop":$.stop();break;case"seek":$.seek(Yt.data.param);break;case"pause":$.pause();break;case"resume":$.resume();break;case"logging_config":{var Q=Yt.data.param;Ee.applyConfig(Q),Q.enableCallback===!0?Ee.addLogListener(J):Ee.removeLogListener(J);break}}});function ne(Yt,Q){var L={msg:de.INIT_SEGMENT,data:{type:Yt,data:Q}};re.postMessage(L,[Q.data])}function ge(Yt,Q){var L={msg:de.MEDIA_SEGMENT,data:{type:Yt,data:Q}};re.postMessage(L,[Q.data])}function Ue(){var Yt={msg:de.LOADING_COMPLETE};re.postMessage(Yt)}function We(){var Yt={msg:de.RECOVERED_EARLY_EOF};re.postMessage(Yt)}function _t(Yt){var Q={msg:de.MEDIA_INFO,data:Yt};re.postMessage(Q)}function Rt(Yt){var Q={msg:de.METADATA_ARRIVED,data:Yt};re.postMessage(Q)}function Bt(Yt){var Q={msg:de.SCRIPTDATA_ARRIVED,data:Yt};re.postMessage(Q)}function tt(Yt){var Q={msg:de.STATISTICS_INFO,data:Yt};re.postMessage(Q)}function Dt(Yt,Q){re.postMessage({msg:de.IO_ERROR,data:{type:Yt,info:Q}})}function At(Yt,Q){re.postMessage({msg:de.DEMUX_ERROR,data:{type:Yt,info:Q}})}function nn(Yt){re.postMessage({msg:de.RECOMMEND_SEEKPOINT,data:Yt})}function qt(Yt,Q){re.postMessage({msg:"logcat_callback",data:{type:Yt,logcat:Q}})}},dt=ze,Lt=function(){function le(re,B){if(Object(Z.a)(this,le),this.TAG="Transmuxer",this._emitter=new I.a,B.enableWorker&&typeof Worker!="undefined")try{var $=D("0r65");this._worker=$(dt),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[re,B]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},Ee.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:Ee.getConfig()})}catch(ne){N.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new Le(re,B)}else this._controller=new Le(re,B);if(this._controller){var J=this._controller;J.on(de.IO_ERROR,this._onIOError.bind(this)),J.on(de.DEMUX_ERROR,this._onDemuxError.bind(this)),J.on(de.INIT_SEGMENT,this._onInitSegment.bind(this)),J.on(de.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),J.on(de.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),J.on(de.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),J.on(de.MEDIA_INFO,this._onMediaInfo.bind(this)),J.on(de.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),J.on(de.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),J.on(de.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),J.on(de.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(z.a)(le,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),Ee.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(B,$){this._emitter.addListener(B,$)}},{key:"off",value:function(B,$){this._emitter.removeListener(B,$)}},{key:"hasWorker",value:function(){return this._worker!=null}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(B){this._worker?this._worker.postMessage({cmd:"seek",param:B}):this._controller.seek(B)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(B,$){var J=this;Promise.resolve().then(function(){J._emitter.emit(de.INIT_SEGMENT,B,$)})}},{key:"_onMediaSegment",value:function(B,$){var J=this;Promise.resolve().then(function(){J._emitter.emit(de.MEDIA_SEGMENT,B,$)})}},{key:"_onLoadingComplete",value:function(){var B=this;Promise.resolve().then(function(){B._emitter.emit(de.LOADING_COMPLETE)})}},{key:"_onRecoveredEarlyEof",value:function(){var B=this;Promise.resolve().then(function(){B._emitter.emit(de.RECOVERED_EARLY_EOF)})}},{key:"_onMediaInfo",value:function(B){var $=this;Promise.resolve().then(function(){$._emitter.emit(de.MEDIA_INFO,B)})}},{key:"_onMetaDataArrived",value:function(B){var $=this;Promise.resolve().then(function(){$._emitter.emit(de.METADATA_ARRIVED,B)})}},{key:"_onScriptDataArrived",value:function(B){var $=this;Promise.resolve().then(function(){$._emitter.emit(de.SCRIPTDATA_ARRIVED,B)})}},{key:"_onStatisticsInfo",value:function(B){var $=this;Promise.resolve().then(function(){$._emitter.emit(de.STATISTICS_INFO,B)})}},{key:"_onIOError",value:function(B,$){var J=this;Promise.resolve().then(function(){J._emitter.emit(de.IO_ERROR,B,$)})}},{key:"_onDemuxError",value:function(B,$){var J=this;Promise.resolve().then(function(){J._emitter.emit(de.DEMUX_ERROR,B,$)})}},{key:"_onRecommendSeekpoint",value:function(B){var $=this;Promise.resolve().then(function(){$._emitter.emit(de.RECOMMEND_SEEKPOINT,B)})}},{key:"_onLoggingConfigChanged",value:function(B){this._worker&&this._worker.postMessage({cmd:"logging_config",param:B})}},{key:"_onWorkerMessage",value:function(B){var $=B.data,J=$.data;if($.msg==="destroyed"||this._workerDestroying){this._workerDestroying=!1,this._worker.terminate(),this._worker=null;return}switch($.msg){case de.INIT_SEGMENT:case de.MEDIA_SEGMENT:this._emitter.emit($.msg,J.type,J.data);break;case de.LOADING_COMPLETE:case de.RECOVERED_EARLY_EOF:this._emitter.emit($.msg);break;case de.MEDIA_INFO:Object.setPrototypeOf(J,Ke.prototype),this._emitter.emit($.msg,J);break;case de.METADATA_ARRIVED:case de.SCRIPTDATA_ARRIVED:case de.STATISTICS_INFO:this._emitter.emit($.msg,J);break;case de.IO_ERROR:case de.DEMUX_ERROR:this._emitter.emit($.msg,J.type,J.info);break;case de.RECOMMEND_SEEKPOINT:this._emitter.emit($.msg,J);break;case"logcat_callback":N.emitter.emit("log",J.type,J.logcat);break;default:break}}}]),le}(),Ft=Lt,kt={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},St=kt,qe=function(){function le(re){Object(Z.a)(this,le),this.TAG="MSEController",this._config=re,this._emitter=new I.a,this._config.isLive&&this._config.autoCleanupSourceBuffer==null&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Ae}return Object(z.a)(le,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(B,$){this._emitter.addListener(B,$)}},{key:"off",value:function(B,$){this._emitter.removeListener(B,$)}},{key:"attachMediaElement",value:function(B){if(this._mediaSource)throw new u("MediaSource has been attached to an HTMLMediaElement!");var $=this._mediaSource=new window.MediaSource;$.addEventListener("sourceopen",this.e.onSourceOpen),$.addEventListener("sourceended",this.e.onSourceEnded),$.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=B,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),B.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var B=this._mediaSource;for(var $ in this._sourceBuffers){var J=this._pendingSegments[$];J.splice(0,J.length),this._pendingSegments[$]=null,this._pendingRemoveRanges[$]=null,this._lastInitSegments[$]=null;var ne=this._sourceBuffers[$];if(ne){if(B.readyState!=="closed"){try{B.removeSourceBuffer(ne)}catch(ge){N.e(this.TAG,ge.message)}ne.removeEventListener("error",this.e.onSourceBufferError),ne.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[$]=null,this._sourceBuffers[$]=null}}if(B.readyState==="open")try{B.endOfStream()}catch(ge){N.e(this.TAG,ge.message)}B.removeEventListener("sourceopen",this.e.onSourceOpen),B.removeEventListener("sourceended",this.e.onSourceEnded),B.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(B,$){if(!this._mediaSource||this._mediaSource.readyState!=="open"){this._pendingSourceBufferInit.push(B),this._pendingSegments[B.type].push(B);return}var J=B,ne="".concat(J.container);J.codec&&J.codec.length>0&&(ne+=";codecs=".concat(J.codec));var ge=!1;if(N.v(this.TAG,"Received Initialization Segment, mimeType: "+ne),this._lastInitSegments[J.type]=J,ne!==this._mimeTypes[J.type]){if(this._mimeTypes[J.type])N.v(this.TAG,"Notice: ".concat(J.type," mimeType changed, origin: ").concat(this._mimeTypes[J.type],", target: ").concat(ne));else{ge=!0;try{var Ue=this._sourceBuffers[J.type]=this._mediaSource.addSourceBuffer(ne);Ue.addEventListener("error",this.e.onSourceBufferError),Ue.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(We){N.e(this.TAG,We.message),this._emitter.emit(St.ERROR,{code:We.code,msg:We.message});return}}this._mimeTypes[J.type]=ne}$||this._pendingSegments[J.type].push(J),ge||this._sourceBuffers[J.type]&&!this._sourceBuffers[J.type].updating&&this._doAppendSegments(),R.safari&&J.container==="audio/mpeg"&&J.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=J.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(B){var $=B;this._pendingSegments[$.type].push($),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var J=this._sourceBuffers[$.type];J&&!J.updating&&!this._hasPendingRemoveRanges()&&this._doAppendSegments()}},{key:"seek",value:function(B){for(var $ in this._sourceBuffers){if(!this._sourceBuffers[$])continue;var J=this._sourceBuffers[$];if(this._mediaSource.readyState==="open")try{J.abort()}catch(Rt){N.e(this.TAG,Rt.message)}this._idrList.clear();var ne=this._pendingSegments[$];if(ne.splice(0,ne.length),this._mediaSource.readyState==="closed")continue;for(var ge=0;ge=1&&B-ne.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var B=this._mediaElement.currentTime;for(var $ in this._sourceBuffers){var J=this._sourceBuffers[$];if(J){for(var ne=J.buffered,ge=!1,Ue=0;Ue=this._config.autoCleanupMaxBackwardDuration){ge=!0;var Rt=B-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[$].push({start:We,end:Rt})}}else _t0&&(isNaN($)||J>$)&&(N.v(this.TAG,"Update MediaSource duration from ".concat($," to ").concat(J)),this._mediaSource.duration=J),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},{key:"_doRemoveRanges",value:function(){for(var B in this._pendingRemoveRanges){if(!this._sourceBuffers[B]||this._sourceBuffers[B].updating)continue;for(var $=this._sourceBuffers[B],J=this._pendingRemoveRanges[B];J.length&&!$.updating;){var ne=J.shift();$.remove(ne.start,ne.end)}}}},{key:"_doAppendSegments",value:function(){var B=this._pendingSegments;for(var $ in B){if(!this._sourceBuffers[$]||this._sourceBuffers[$].updating)continue;if(B[$].length>0){var J=B[$].shift();if(J.timestampOffset){var ne=this._sourceBuffers[$].timestampOffset,ge=J.timestampOffset/1e3,Ue=Math.abs(ne-ge);Ue>.1&&(N.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(ne," to ").concat(ge)),this._sourceBuffers[$].timestampOffset=ge),delete J.timestampOffset}if(!J.data||J.data.byteLength===0)continue;try{this._sourceBuffers[$].appendBuffer(J.data),this._isBufferFull=!1,$==="video"&&J.hasOwnProperty("info")&&this._idrList.appendArray(J.info.syncPoints)}catch(We){this._pendingSegments[$].unshift(J),We.code===22?(this._isBufferFull||this._emitter.emit(St.BUFFER_FULL),this._isBufferFull=!0):(N.e(this.TAG,We.message),this._emitter.emit(St.ERROR,{code:We.code,msg:We.message}))}}}}},{key:"_onSourceOpen",value:function(){if(N.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var B=this._pendingSourceBufferInit;B.length;){var $=B.shift();this.appendInitSegment($,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(St.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){N.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){N.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&this.e!=null&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var B=this._pendingSegments;return B.video.length>0||B.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var B=this._pendingRemoveRanges;return B.video.length>0||B.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(St.UPDATE_END)}},{key:"_onSourceBufferError",value:function(B){N.e(this.TAG,"SourceBuffer Error: ".concat(B))}}]),le}(),rt=qe,Ye={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},pe={NETWORK_EXCEPTION:a.EXCEPTION,NETWORK_STATUS_CODE_INVALID:a.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:a.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:a.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:Be.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:Be.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:Be.CODEC_UNSUPPORTED},Te=function(){function le(re,B){if(Object(Z.a)(this,le),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new I.a,this._config=me(),typeof B=="object"&&Object.assign(this._config,B),re.type.toLowerCase()!=="flv")throw new o("FlvPlayer requires an flv MediaDataSource input!");re.isLive===!0&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=re,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var $=R.chrome&&(R.version.major<50||R.version.major===50&&R.version.build<2661);this._alwaysSeekKeyframe=!!($||R.msedge||R.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(z.a)(le,[{key:"destroy",value:function(){this._progressChecker!=null&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(B,$){var J=this;B===Pe.MEDIA_INFO?this._mediaInfo!=null&&Promise.resolve().then(function(){J._emitter.emit(Pe.MEDIA_INFO,J.mediaInfo)}):B===Pe.STATISTICS_INFO&&(this._statisticsInfo!=null&&Promise.resolve().then(function(){J._emitter.emit(Pe.STATISTICS_INFO,J.statisticsInfo)})),this._emitter.addListener(B,$)}},{key:"off",value:function(B,$){this._emitter.removeListener(B,$)}},{key:"attachMediaElement",value:function(B){var $=this;if(this._mediaElement=B,B.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),B.addEventListener("seeking",this.e.onvSeeking),B.addEventListener("canplay",this.e.onvCanPlay),B.addEventListener("stalled",this.e.onvStalled),B.addEventListener("progress",this.e.onvProgress),this._msectl=new rt(this._config),this._msectl.on(St.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(St.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(St.SOURCE_OPEN,function(){$._mseSourceOpened=!0,$._hasPendingLoad&&($._hasPendingLoad=!1,$.load())}),this._msectl.on(St.ERROR,function(J){$._emitter.emit(Pe.ERROR,Ye.MEDIA_ERROR,pe.MEDIA_MSE_ERROR,J)}),this._msectl.attachMediaElement(B),this._pendingSeekTime!=null)try{B.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(J){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var B=this;if(!this._mediaElement)throw new u("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new u("FlvPlayer.load() has been called, please call unload() first!");if(this._hasPendingLoad)return;if(this._config.deferLoadAfterSourceOpen&&this._mseSourceOpened===!1){this._hasPendingLoad=!0;return}this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new Ft(this._mediaDataSource,this._config),this._transmuxer.on(de.INIT_SEGMENT,function($,J){B._msectl.appendInitSegment(J)}),this._transmuxer.on(de.MEDIA_SEGMENT,function($,J){if(B._msectl.appendMediaSegment(J),B._config.lazyLoad&&!B._config.isLive){var ne=B._mediaElement.currentTime;J.info.endDts>=(ne+B._config.lazyLoadMaxDuration)*1e3&&(B._progressChecker==null&&(N.v(B.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),B._suspendTransmuxer()))}}),this._transmuxer.on(de.LOADING_COMPLETE,function(){B._msectl.endOfStream(),B._emitter.emit(Pe.LOADING_COMPLETE)}),this._transmuxer.on(de.RECOVERED_EARLY_EOF,function(){B._emitter.emit(Pe.RECOVERED_EARLY_EOF)}),this._transmuxer.on(de.IO_ERROR,function($,J){B._emitter.emit(Pe.ERROR,Ye.NETWORK_ERROR,$,J)}),this._transmuxer.on(de.DEMUX_ERROR,function($,J){B._emitter.emit(Pe.ERROR,Ye.MEDIA_ERROR,$,{code:-1,msg:J})}),this._transmuxer.on(de.MEDIA_INFO,function($){B._mediaInfo=$,B._emitter.emit(Pe.MEDIA_INFO,Object.assign({},$))}),this._transmuxer.on(de.METADATA_ARRIVED,function($){B._emitter.emit(Pe.METADATA_ARRIVED,$)}),this._transmuxer.on(de.SCRIPTDATA_ARRIVED,function($){B._emitter.emit(Pe.SCRIPTDATA_ARRIVED,$)}),this._transmuxer.on(de.STATISTICS_INFO,function($){B._statisticsInfo=B._fillStatisticsInfo($),B._emitter.emit(Pe.STATISTICS_INFO,Object.assign({},B._statisticsInfo))}),this._transmuxer.on(de.RECOMMEND_SEEKPOINT,function($){B._mediaElement&&!B._config.accurateSeek&&(B._requestSetTime=!0,B._mediaElement.currentTime=$/1e3)}),this._transmuxer.open()}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(B){this._mediaElement.volume=B}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(B){this._mediaElement.muted=B}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(B){this._mediaElement?this._internalSeek(B):this._pendingSeekTime=B}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return this._statisticsInfo==null&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(B){if(B.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return B;var $=!0,J=0,ne=0;if(this._mediaElement.getVideoPlaybackQuality){var ge=this._mediaElement.getVideoPlaybackQuality();J=ge.totalVideoFrames,ne=ge.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(J=this._mediaElement.webkitDecodedFrameCount,ne=this._mediaElement.webkitDroppedFrameCount):$=!1;return $&&(B.decodedFrames=J,B.droppedFrames=ne),B}},{key:"_onmseUpdateEnd",value:function(){if(!this._config.lazyLoad||this._config.isLive)return;for(var B=this._mediaElement.buffered,$=this._mediaElement.currentTime,J=0,ne=0,ge=0;ge=$+this._config.lazyLoadMaxDuration&&this._progressChecker==null&&(N.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},{key:"_onmseBufferFull",value:function(){N.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),this._progressChecker==null&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),this._progressChecker==null&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var B=this._mediaElement.currentTime,$=this._mediaElement.buffered,J=!1,ne=0;ne<$.length;ne++){var ge=$.start(ne),Ue=$.end(ne);if(B>=ge&&B=Ue-this._config.lazyLoadRecoverDuration&&(J=!0);break}}J&&(window.clearInterval(this._progressChecker),this._progressChecker=null,J&&(N.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(B){for(var $=this._mediaElement.buffered,J=0;J<$.length;J++){var ne=$.start(J),ge=$.end(J);if(B>=ne&&B0){var ge=this._mediaElement.buffered.start(0);(ge<1&&B0&&$.currentTime0){var ne=J.start(0);if(ne<1&&$0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),this._statisticsReporter!=null&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(B){this._mediaElement.volume=B}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(B){this._mediaElement.muted=B}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(B){this._mediaElement?this._mediaElement.currentTime=B:this._pendingSeekTime=B}},{key:"mediaInfo",get:function(){var B=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",$={mimeType:B+this._mediaDataSource.type};return this._mediaElement&&($.duration=Math.floor(this._mediaElement.duration*1e3),this._mediaElement instanceof HTMLVideoElement&&($.width=this._mediaElement.videoWidth,$.height=this._mediaElement.videoHeight)),$}},{key:"statisticsInfo",get:function(){var B={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return B;var $=!0,J=0,ne=0;if(this._mediaElement.getVideoPlaybackQuality){var ge=this._mediaElement.getVideoPlaybackQuality();J=ge.totalVideoFrames,ne=ge.droppedVideoFrames}else this._mediaElement.webkitDecodedFrameCount!=null?(J=this._mediaElement.webkitDecodedFrameCount,ne=this._mediaElement.webkitDroppedFrameCount):$=!1;return $&&(B.decodedFrames=J,B.droppedFrames=ne),B}},{key:"_onvLoadedMetadata",value:function(B){this._pendingSeekTime!=null&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(Pe.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(Pe.STATISTICS_INFO,this.statisticsInfo)}}]),le}(),Pt=Xe;X.install();function Mt(le,re){var B=le;if(B==null||typeof B!="object")throw new o("MediaDataSource must be an javascript object!");if(!B.hasOwnProperty("type"))throw new o("MediaDataSource must has type field to indicate video file type!");switch(B.type){case"flv":return new nt(B,re);default:return new Pt(B,re)}}function Ve(){return Oe.supportMSEH264Playback()}function gt(){return Oe.getFeatureList()}var It={};It.createPlayer=Mt,It.isSupported=Ve,It.getFeatureList=gt,It.BaseLoader=i,It.LoaderStatus=r,It.LoaderErrors=a,It.Events=Pe,It.ErrorTypes=Ye,It.ErrorDetails=pe,It.FlvPlayer=nt,It.NativePlayer=Pt,It.LoggingControl=Ee,Object.defineProperty(It,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var Zt=ce.a=It},GgEA:function(je,ce,D){},Gytx:function(je,ce){je.exports=function(Z,z,M,X){var F=M?M.call(X,Z,z):void 0;if(F!==void 0)return!!F;if(Z===z)return!0;if(typeof Z!="object"||!Z||typeof z!="object"||!z)return!1;var I=Object.keys(Z),H=Object.keys(z);if(I.length!==H.length)return!1;for(var N=Object.prototype.hasOwnProperty.bind(z),n=0;n>>6)+n(128|U&63):n(224|U>>>12&15)+n(128|U>>>6&63)+n(128|U&63)}else{var U=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return n(240|U>>>18&7)+n(128|U>>>12&63)+n(128|U>>>6&63)+n(128|U&63)}},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(y){return y.replace(p,P)},d=function(y){var U=[0,2,1][y.length%3],j=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),A=[H.charAt(j>>>18),H.charAt(j>>>12&63),U>=2?"=":H.charAt(j>>>6&63),U>=1?"=":H.charAt(j&63)];return A.join("")},u=X.btoa&&typeof X.btoa=="function"?function(y){return X.btoa(y)}:function(y){if(y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return y.replace(/[\s\S]{1,3}/g,d)},o=function(y){return u(m(String(y)))},h=function(y){return y.replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,"")},r=function(y,U){return U?h(o(y)):o(y)},a=function(y){return r(y,!0)},i;X.Uint8Array&&(i=function(y,U){for(var j="",A=0,G=y.length;A>>18)+H.charAt(te>>>12&63)+(typeof O!="undefined"?H.charAt(te>>>6&63):"=")+(typeof V!="undefined"?H.charAt(te&63):"=")}return U?h(j):j});var s=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,S=function(y){switch(y.length){case 4:var U=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),j=U-65536;return n((j>>>10)+55296)+n((j&1023)+56320);case 3:return n((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));default:return n((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},x=function(y){return y.replace(s,S)},T=function(y){var U=y.length,j=U%4,A=(U>0?N[y.charAt(0)]<<18:0)|(U>1?N[y.charAt(1)]<<12:0)|(U>2?N[y.charAt(2)]<<6:0)|(U>3?N[y.charAt(3)]:0),G=[n(A>>>16),n(A>>>8&255),n(A&255)];return G.length-=[0,0,2,1][j],G.join("")},R=X.atob&&typeof X.atob=="function"?function(y){return X.atob(y)}:function(y){return y.replace(/\S{1,4}/g,T)},w=function(y){return R(String(y).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(y){return x(R(y))},b=function(y){return String(y).replace(/[-_]/g,function(U){return U=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},g=function(y){return v(b(y))},f;X.Uint8Array&&(f=function(y){return Uint8Array.from(w(b(y)),function(U){return U.charCodeAt(0)})});var C=function(){var y=X.Base64;return X.Base64=F,y};if(X.Base64={VERSION:I,atob:w,btoa:u,fromBase64:g,toBase64:r,utob:m,encode:r,encodeURI:a,btou:x,decode:g,noConflict:C,fromUint8Array:i,toUint8Array:f},typeof Object.defineProperty=="function"){var E=function(y){return{value:y,enumerable:!1,writable:!0,configurable:!0}};X.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",E(function(){return g(this)})),Object.defineProperty(String.prototype,"toBase64",E(function(y){return r(this,y)})),Object.defineProperty(String.prototype,"toBase64URI",E(function(){return r(this,!0)}))}}return X.Meteor&&(Base64=X.Base64),je.exports?je.exports.Base64=X.Base64:!(z=[],M=function(){return X.Base64}.apply(ce,z),M!==void 0&&(je.exports=M)),{Base64:X.Base64}})}).call(this,D("IyRk"))},JOrW:function(je,ce,D){je.exports=D.p+"static/gf.09d89ab3.svg"},JYp7:function(je,ce,D){"use strict";D.d(ce,"a",function(){return Z});var Z;(function(z){function M(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}z.is=M;const X=Object.freeze([]);function F(){return X}z.empty=F;function*I(s){yield s}z.single=I;function H(s){return s||X}z.from=H;function N(s){return!s||s[Symbol.iterator]().next().done===!0}z.isEmpty=N;function n(s){return s[Symbol.iterator]().next().value}z.first=n;function P(s,S){for(const x of s)if(S(x))return!0;return!1}z.some=P;function p(s,S){for(const x of s)if(S(x))return x;return}z.find=p;function*m(s,S){for(const x of s)S(x)&&(yield x)}z.filter=m;function*d(s,S){let x=0;for(const T of s)yield S(T,x++)}z.map=d;function*u(...s){for(const S of s)for(const x of S)yield x}z.concat=u;function*o(s){for(const S of s)for(const x of S)yield x}z.concatNested=o;function h(s,S,x){let T=x;for(const R of s)T=S(T,R);return T}z.reduce=h;function*r(s,S,x=s.length){for(S<0&&(S+=s.length),x<0?x+=s.length:x>s.length&&(x=s.length);ST===R){const T=s[Symbol.iterator](),R=S[Symbol.iterator]();for(;;){const w=T.next(),v=R.next();if(w.done!==v.done)return!1;if(w.done)return!0;if(!x(w.value,v.value))return!1}}z.equals=i})(Z||(Z={}))},LdHM:function(je,ce,D){"use strict";D.d(ce,"b",function(){return s}),D.d(ce,"a",function(){return x});var Z=D("1OyB"),z=D("vuIU"),M=D("Ji7U"),X=D("LK+K"),F=D("q1tI"),I=D("rePB"),H=D("Ff2n"),N=D("ODXe"),n=D("4IlW"),P=D("bX4T"),p=D("YrtM"),m=D("TSYQ"),d=D.n(m),u=D("+nKL"),o=D("8OUc"),h=function(V,te){var ae=V.prefixCls,me=V.id,Re=V.flattenOptions,Oe=V.childrenAsData,Ce=V.values,Pe=V.searchValue,He=V.multiple,Ee=V.defaultActiveFirstOption,be=V.height,Ke=V.itemHeight,bt=V.notFoundContent,Et=V.open,yt=V.menuItemSelectedIcon,pt=V.virtual,st=V.onSelect,ht=V.onToggleOpen,wt=V.onActiveValue,_e=V.onScroll,Me=V.onMouseEnter,ye="".concat(ae,"-item"),Se=Object(p.a)(function(){return Re},[Et,Re],function(et,Ae){return Ae[0]&&et[1]!==Ae[1]}),Be=F.useRef(null),Ze=function(Ae){Ae.preventDefault()},ot=function(Ae){Be.current&&Be.current.scrollTo({index:Ae})},ft=function(Ae){for(var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=Se.length,ue=0;ue1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(O).map(function(te,ae){if(!F.isValidElement(te)||!te.type)return null;var me=te.type.isSelectOptGroup,Re=te.key,Oe=te.props,Ce=Oe.children,Pe=Object(H.a)(Oe,["children"]);return V||!me?w(te):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ae:Re,"__"),label:Re},Pe),{},{options:v(Ce)})}).filter(function(te){return te})}var b=D("2Qr1"),g=D("qNPg"),f=D("U8pU"),C=D("Kwbf"),E=D("WKfj");function y(O){var V=O.mode,te=O.options,ae=O.children,me=O.backfill,Re=O.allowClear,Oe=O.placeholder,Ce=O.getInputElement,Pe=O.showSearch,He=O.onSearch,Ee=O.defaultOpen,be=O.autoFocus,Ke=O.labelInValue,bt=O.value,Et=O.inputValue,yt=O.optionLabelProp,pt=V==="multiple"||V==="tags",st=Pe!==void 0?Pe:pt||V==="combobox",ht=te||v(ae);if(Object(C.a)(V!=="tags"||ht.every(function(ye){return!ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var wt=ht.some(function(ye){return ye.options?ye.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in ye?ye.value:ye.key)=="number"});Object(C.a)(!wt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(V!=="combobox"||!yt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(V==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(C.a)(V==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(C.b)(V!=="combobox"||!Ce||!Re||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),He&&!st&&V!=="combobox"&&V!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!Ee||be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),bt!=null){var _e=Object(E.d)(bt);Object(C.a)(!Ke||_e.every(function(ye){return Object(f.a)(ye)==="object"&&("key"in ye||"value"in ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!pt||Array.isArray(bt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Me=null;Object(R.a)(ae).some(function(ye){if(!F.isValidElement(ye)||!ye.type)return!1;var Se=ye.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Be=Object(R.a)(ye.props.children).every(function(Ze){return!F.isValidElement(Ze)||!ye.type||Ze.type.isSelectOption?!0:(Me=Ze.type,!1)});return!Be}return Me=Se,!0}),Me&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Me.displayName||Me.name||Me,"`.")),Object(C.a)(Et===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=y,j=Object(g.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:v,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:U,fillOptionsWithMissingValue:b.a}),A=function(O){Object(M.a)(te,O);var V=Object(X.a)(te);function te(){var ae;return Object(Z.a)(this,te),ae=V.apply(this,arguments),ae.selectRef=F.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(z.a)(te,[{key:"render",value:function(){return F.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(F.Component);A.Option=s,A.OptGroup=x;var G=A,W=ce.c=G},M8RZ:function(je,ce,D){"use strict";D.d(ce,"a",function(){return n});var Z=D("fWQN"),z=D("mtLc"),M=D("yKVA"),X=D("879j"),F=D("q1tI"),I=D.n(F),H=D("i8i4"),N=D.n(H),n=function(P){Object(M.a)(m,P);var p=Object(X.a)(m);function m(d){var u;Object(Z.a)(this,m),u=p.call(this,d);var o=window.document;return u.node=o.createElement("div"),o.body.appendChild(u.node),u}return Object(z.a)(m,[{key:"render",value:function(){var u=this.props.children;return Object(H.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(I.a.Component)},MFOe:function(je,ce,D){(function(Z){var z=I(),M=H(),X=N(),F=typeof window!="undefined"?window:Z;je.exports={assign:z,create:M,trim:X,bind:n,slice:P,each:p,map:m,pluck:d,isList:u,isFunction:o,isObject:h,Global:F};function I(){return Object.assign?Object.assign:function(a,i,s,S){for(var x=1;xz.a.None;function o(y){return(U,j=null,A)=>{let G=!1,W;return W=y(O=>G?void 0:(W?W.dispose():G=!0,U.call(j,O)),null,A),G&&W.dispose(),W}}u.once=o;function h(y,U){return x((j,A=null,G)=>y(W=>j.call(A,U(W)),null,G))}u.map=h;function r(y,U){return x((j,A=null,G)=>y(W=>{U(W),j.call(A,W)},null,G))}u.forEach=r;function a(y,U){return x((j,A=null,G)=>y(W=>U(W)&&j.call(A,W),null,G))}u.filter=a;function i(y){return y}u.signal=i;function s(...y){return(U,j=null,A)=>Object(z.e)(...y.map(G=>G(W=>U.call(j,W),null,A)))}u.any=s;function S(y,U,j){let A=j;return h(y,G=>(A=U(A,G),A))}u.reduce=S;function x(y){let U;const j=new n({onFirstListenerAdd(){U=y(j.fire,j)},onLastListenerRemove(){U.dispose()}});return j.event}function T(y,U,j=100,A=!1,G){let W,O,V,te=0;const ae=new n({leakWarningThreshold:G,onFirstListenerAdd(){W=y(me=>{te++,O=U(O,me),A&&!V&&(ae.fire(O),O=void 0),clearTimeout(V),V=setTimeout(()=>{const Re=O;O=void 0,V=void 0,(!A||te>1)&&ae.fire(Re),te=0},j)})},onLastListenerRemove(){W.dispose()}});return ae.event}u.debounce=T;function R(y,U=(j,A)=>j===A){let j=!0,A;return a(y,G=>{const W=j||!U(G,A);return j=!1,A=G,W})}u.latch=R;function w(y,U){return[u.filter(y,U),u.filter(y,j=>!U(j))]}u.split=w;function v(y,U=!1,j=[]){let A=j.slice(),G=y(V=>{A?A.push(V):O.fire(V)});const W=()=>{A&&A.forEach(V=>O.fire(V)),A=null},O=new n({onFirstListenerAdd(){G||(G=y(V=>O.fire(V)))},onFirstListenerDidAdd(){A&&(U?setTimeout(W):W())},onLastListenerRemove(){G&&G.dispose(),G=null}});return O.event}u.buffer=v;class b{constructor(y){this.event=y}map(y){return new b(h(this.event,y))}forEach(y){return new b(r(this.event,y))}filter(y){return new b(a(this.event,y))}reduce(y,U){return new b(S(this.event,y,U))}latch(){return new b(R(this.event))}debounce(y,U=100,j=!1,A){return new b(T(this.event,y,U,j,A))}on(y,U,j){return this.event(y,U,j)}once(y,U,j){return o(this.event)(y,U,j)}}function g(y){return new b(y)}u.chain=g;function f(y,U,j=A=>A){const A=(...V)=>O.fire(j(...V)),G=()=>y.on(U,A),W=()=>y.removeListener(U,A),O=new n({onFirstListenerAdd:G,onLastListenerRemove:W});return O.event}u.fromNodeEventEmitter=f;function C(y,U,j=A=>A){const A=(...V)=>O.fire(j(...V)),G=()=>y.addEventListener(U,A),W=()=>y.removeEventListener(U,A),O=new n({onFirstListenerAdd:G,onLastListenerRemove:W});return O.event}u.fromDOMEventEmitter=C;function E(y){return new Promise(U=>o(y)(U))}u.toPromise=E})(F||(F={}));class I{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${I._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}I._idPool=0;let H=-1;class N{constructor(u,o=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let o=H;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||u{const a=this._stacks.get(h)||0;this._stacks.set(h,a-1)}}}class n{constructor(u){var o;this._disposed=!1,this._options=u,this._leakageMon=H>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new I(this._options._profName):void 0}get event(){return this._event||(this._event=(u,o,h)=>{var r;this._listeners||(this._listeners=new M.a);const a=this._listeners.isEmpty();a&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(o?[u,o]:u);a&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,o);const s=(r=this._leakageMon)===null||r===void 0?void 0:r.check(this._listeners.size),S=Object(z.i)(()=>{if(s&&s(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const x=this._listeners&&!this._listeners.isEmpty();x||this._options.onLastListenerRemove(this)}});return h instanceof z.b?h.add(S):Array.isArray(h)&&h.push(S),S}),this._event}fire(u){var o,h;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let r of this._listeners)this._deliveryQueue.push([r,u]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[r,a]=this._deliveryQueue.shift();try{typeof r=="function"?r.call(void 0,a):r[0].call(r[1],a)}catch(i){Object(Z.f)(i)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var u,o,h,r,a;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(r=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||r===void 0||r.call(h),(a=this._leakageMon)===null||a===void 0||a.dispose())}}class P extends n{constructor(u){super(u);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class p extends P{constructor(u){var o;super(u);this._delay=(o=u.delay)!==null&&o!==void 0?o:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class m{constructor(){this.buffers=[]}wrapEvent(u){return(o,h,r)=>u(a=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>o.call(h,a)):o.call(h,a)},void 0,r)}bufferEvents(u){const o=[];this.buffers.push(o);const h=u();return this.buffers.pop(),o.forEach(r=>r()),h}}class d{constructor(){this.listening=!1,this.inputEvent=F.None,this.inputEventListener=z.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(je,ce,D){"use strict";(function(Z,z){D.d(ce,"b",function(){return h}),D.d(ce,"i",function(){return s}),D.d(ce,"f",function(){return S}),D.d(ce,"d",function(){return x}),D.d(ce,"g",function(){return T}),D.d(ce,"h",function(){return R}),D.d(ce,"c",function(){return w}),D.d(ce,"k",function(){return v}),D.d(ce,"j",function(){return b}),D.d(ce,"a",function(){return g}),D.d(ce,"e",function(){return E});var M;const X="en";let F=!1,I=!1,H=!1,N=!1,n=!1,P=!1,p=!1,m,d=X,u,o;const h=typeof self=="object"?self:typeof Z=="object"?Z:{};let r;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?r=h.vscode.process:typeof z!="undefined"&&(r=z);const a=typeof((M=r==null?void 0:r.versions)===null||M===void 0?void 0:M.electron)=="string"&&r.type==="renderer";if(typeof navigator=="object"&&!a)o=navigator.userAgent,F=o.indexOf("Windows")>=0,I=o.indexOf("Macintosh")>=0,p=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=o.indexOf("Linux")>=0,P=!0,m=navigator.language,d=m;else if(typeof r=="object"){F=r.platform==="win32",I=r.platform==="darwin",H=r.platform==="linux",N=H&&!!r.env.SNAP&&!!r.env.SNAP_REVISION,m=X,d=X;const y=r.env.VSCODE_NLS_CONFIG;if(y)try{const U=JSON.parse(y),j=U.availableLanguages["*"];m=U.locale,d=j||X,u=U._translationsConfigFile}catch(U){}n=!0}else console.error("Unable to resolve platform.");let i=0;I?i=1:F?i=3:H&&(i=2);const s=F,S=I,x=H,T=n,R=P,w=p,v=o,b=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let j=[];h.addEventListener("message",G=>{if(G.data&&G.data.vscodeSetImmediateId)for(let W=0,O=j.length;W{const W=++A;j.push({id:W,callback:G}),h.postMessage({vscodeSetImmediateId:W},"*")}}if(typeof(r==null?void 0:r.nextTick)=="function")return r.nextTick.bind(r);const U=Promise.resolve();return j=>U.then(j)}(),g=I||p?2:F?1:3;let f=!0,C=!1;function E(){if(!C){C=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const U=new Uint16Array(y.buffer);f=U[0]===(2<<8)+1}return f}}).call(this,D("IyRk"),D("Q2Ig"))},MVJL:function(je,ce,D){je.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},N0LK:function(je,ce,D){"use strict";D.d(ce,"C",function(){return Z}),D.d(ce,"v",function(){return M}),D.d(ce,"s",function(){return X}),D.d(ce,"t",function(){return F}),D.d(ce,"U",function(){return I}),D.d(ce,"J",function(){return H}),D.d(ce,"O",function(){return N}),D.d(ce,"p",function(){return n}),D.d(ce,"T",function(){return P}),D.d(ce,"q",function(){return p}),D.d(ce,"N",function(){return m}),D.d(ce,"M",function(){return d}),D.d(ce,"Q",function(){return u}),D.d(ce,"u",function(){return o}),D.d(ce,"x",function(){return h}),D.d(ce,"I",function(){return r}),D.d(ce,"f",function(){return a}),D.d(ce,"h",function(){return i}),D.d(ce,"g",function(){return s}),D.d(ce,"i",function(){return S}),D.d(ce,"G",function(){return x}),D.d(ce,"H",function(){return T}),D.d(ce,"r",function(){return R}),D.d(ce,"R",function(){return w}),D.d(ce,"d",function(){return v}),D.d(ce,"e",function(){return b}),D.d(ce,"E",function(){return g}),D.d(ce,"F",function(){return f}),D.d(ce,"j",function(){return C}),D.d(ce,"z",function(){return E}),D.d(ce,"K",function(){return U}),D.d(ce,"L",function(){return j}),D.d(ce,"m",function(){return G}),D.d(ce,"k",function(){return O}),D.d(ce,"A",function(){return te}),D.d(ce,"a",function(){return ae}),D.d(ce,"n",function(){return me}),D.d(ce,"l",function(){return Re}),D.d(ce,"D",function(){return Oe}),D.d(ce,"B",function(){return Ce}),D.d(ce,"b",function(){return Pe}),D.d(ce,"S",function(){return He}),D.d(ce,"o",function(){return Ee}),D.d(ce,"P",function(){return be}),D.d(ce,"w",function(){return Ke}),D.d(ce,"c",function(){return bt}),D.d(ce,"y",function(){return pt});function Z(_e){return!_e||typeof _e!="string"?!0:_e.trim().length===0}const z=/{(\d+)}/g;function M(_e,...Me){return Me.length===0?_e:_e.replace(z,function(ye,Se){const Be=parseInt(Se,10);return isNaN(Be)||Be<0||Be>=Me.length?ye:Me[Be]})}function X(_e){return _e.replace(/[<>&]/g,function(Me){switch(Me){case"<":return"<";case">":return">";case"&":return"&";default:return Me}})}function F(_e){return _e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function I(_e,Me=" "){const ye=H(_e,Me);return N(ye,Me)}function H(_e,Me){if(!_e||!Me)return _e;const ye=Me.length;if(ye===0||_e.length===0)return _e;let Se=0;for(;_e.indexOf(Me,Se)===Se;)Se=Se+ye;return _e.substring(Se)}function N(_e,Me){if(!_e||!Me)return _e;const ye=Me.length,Se=_e.length;if(ye===0||Se===0)return _e;let Be=Se,Ze=-1;for(;!(Ze=_e.lastIndexOf(Me,Be-1),Ze===-1||Ze+ye!==Be);){if(Ze===0)return"";Be=Ze}return _e.substring(0,Be)}function n(_e){return _e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function P(_e){return _e.replace(/\*/g,"")}function p(_e,Me,ye={}){if(!_e)throw new Error("Cannot create regex from empty string");Me||(_e=F(_e)),ye.wholeWord&&(/\B/.test(_e.charAt(0))||(_e="\\b"+_e),/\B/.test(_e.charAt(_e.length-1))||(_e=_e+"\\b"));let Se="";return ye.global&&(Se+="g"),ye.matchCase||(Se+="i"),ye.multiline&&(Se+="m"),ye.unicode&&(Se+="u"),new RegExp(_e,Se)}function m(_e){if(_e.source==="^"||_e.source==="^$"||_e.source==="$"||_e.source==="^\\s*$")return!1;const Me=_e.exec("");return!!(Me&&_e.lastIndex===0)}function d(_e){return(_e.global?"g":"")+(_e.ignoreCase?"i":"")+(_e.multiline?"m":"")+(_e.unicode?"u":"")}function u(_e){return _e.split(/\r\n|\r|\n/)}function o(_e){for(let Me=0,ye=_e.length;Me=0;ye--){const Se=_e.charCodeAt(ye);if(Se!==32&&Se!==9)return ye}return-1}function a(_e,Me){return _eMe?1:0}function i(_e,Me,ye=0,Se=_e.length,Be=0,Ze=Me.length){for(;yeOt)return 1}const ot=Se-ye,ft=Ze-Be;return otft?1:0}function s(_e,Me){return S(_e,Me,0,_e.length,0,Me.length)}function S(_e,Me,ye=0,Se=_e.length,Be=0,Ze=Me.length){for(;ye=128||Ot>=128)return i(_e.toLowerCase(),Me.toLowerCase(),ye,Se,Be,Ze);x(Ct)&&(Ct-=32),x(Ot)&&(Ot-=32);const Ne=Ct-Ot;if(Ne===0)continue;return Ne}const ot=Se-ye,ft=Ze-Be;return otft?1:0}function x(_e){return _e>=97&&_e<=122}function T(_e){return _e>=65&&_e<=90}function R(_e,Me){return _e.length===Me.length&&S(_e,Me)===0}function w(_e,Me){const ye=Me.length;return Me.length>_e.length?!1:S(_e,Me,0,ye)===0}function v(_e,Me){let ye,Se=Math.min(_e.length,Me.length);for(ye=0;ye1){const Se=_e.charCodeAt(Me-2);if(g(Se))return C(Se,ye)}return ye}function U(_e,Me){const ye=Et.getInstance(),Se=Me,Be=_e.length,Ze=E(_e,Be,Me);Me+=Ze>=65536?2:1;let ot=ye.getGraphemeBreakType(Ze);for(;Me=65536?2:1,ot=Ct}return Me-Se}function j(_e,Me){const ye=Et.getInstance(),Se=Me,Be=y(_e,Me);Me-=Be>=65536?2:1;let Ze=ye.getGraphemeBreakType(Be);for(;Me>0;){const ot=y(_e,Me),ft=ye.getGraphemeBreakType(ot);if(bt(ft,Ze))break;Me-=ot>=65536?2:1,Ze=ft}return Se-Me}const A=/(?:[\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 G(_e){return A.test(_e)}const W=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O(_e){return W.test(_e)}const V=/^[\t\n\r\x20-\x7E]*$/;function te(_e){return V.test(_e)}const ae=/[\u2028\u2029]/;function me(_e){return ae.test(_e)}function Re(_e){for(let Me=0,ye=_e.length;Me=11904&&_e<=55215||_e>=63744&&_e<=64255||_e>=65281&&_e<=65374}function Ce(_e){return _e>=127462&&_e<=127487||_e===8986||_e===8987||_e===9200||_e===9203||_e>=9728&&_e<=10175||_e===11088||_e===11093||_e>=127744&&_e<=128591||_e>=128640&&_e<=128764||_e>=128992&&_e<=129003||_e>=129280&&_e<=129535||_e>=129648&&_e<=129750}const Pe=String.fromCharCode(65279);function He(_e){return!!(_e&&_e.length>0&&_e.charCodeAt(0)===65279)}function Ee(_e,Me=!1){return _e?(Me&&(_e=_e.replace(/\\./g,"")),_e.toLowerCase()!==_e):!1}function be(_e){const Me=90-65+1;return _e=_e%(2*Me),_eMe[3*Se+1])Se=2*Se+1;else return Me[3*Se+2];return 0}}Et._INSTANCE=null;function yt(){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]")}function pt(_e,Me){if(_e===0)return 0;const ye=st(_e,Me);if(ye!==void 0)return ye;const Se=y(Me,_e);return _e-=ht(Se),_e}function st(_e,Me){let ye=y(Me,_e);for(_e-=ht(ye);wt(ye)||ye===65039||ye===8419;){if(_e===0)return;ye=y(Me,_e),_e-=ht(ye)}if(!Ce(ye))return;if(_e>=0){const Se=y(Me,_e);Se===8205&&(_e-=ht(Se))}return _e}function ht(_e){return _e>=65536?2:1}function wt(_e){return 127995<=_e&&_e<=127999}},NvD2:function(je,ce,D){"use strict";D.d(ce,"a",function(){return I});var Z=D("Kwbf");function z(H,N){var n=new Set;return H.forEach(function(P){N.has(P)||n.add(P)}),n}function M(H){var N=H||{},n=N.disabled,P=N.disableCheckbox,p=N.checkable;return!!(n||P)||p===!1}function X(H,N,n,P){for(var p=new Set(H),m=new Set,d=0;d<=n;d+=1){var u=N.get(d)||new Set;u.forEach(function(a){var i=a.key,s=a.node,S=a.children,x=S===void 0?[]:S;p.has(i)&&!P(s)&&x.filter(function(T){return!P(T.node)}).forEach(function(T){p.add(T.key)})})}for(var o=new Set,h=n;h>=0;h-=1){var r=N.get(h)||new Set;r.forEach(function(a){var i=a.parent,s=a.node;if(P(s)||!a.parent||o.has(a.parent.key))return;if(P(a.parent.node)){o.add(i.key);return}var S=!0,x=!1;(i.children||[]).filter(function(T){return!P(T.node)}).forEach(function(T){var R=T.key,w=p.has(R);S&&!w&&(S=!1),!x&&(w||m.has(R))&&(x=!0)}),S&&p.add(i.key),x&&m.add(i.key),o.add(i.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(z(m,p))}}function F(H,N,n,P,p){for(var m=new Set(H),d=new Set(N),u=0;u<=P;u+=1){var o=n.get(u)||new Set;o.forEach(function(i){var s=i.key,S=i.node,x=i.children,T=x===void 0?[]:x;!m.has(s)&&!d.has(s)&&!p(S)&&T.filter(function(R){return!p(R.node)}).forEach(function(R){m.delete(R.key)})})}d=new Set;for(var h=new Set,r=P;r>=0;r-=1){var a=n.get(r)||new Set;a.forEach(function(i){var s=i.parent,S=i.node;if(p(S)||!i.parent||h.has(i.parent.key))return;if(p(i.parent.node)){h.add(s.key);return}var x=!0,T=!1;(s.children||[]).filter(function(R){return!p(R.node)}).forEach(function(R){var w=R.key,v=m.has(w);x&&!v&&(x=!1),!T&&(v||d.has(w))&&(T=!0)}),x||m.delete(s.key),T&&d.add(s.key),h.add(s.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(z(d,m))}}function I(H,N,n,P){var p=[],m;P?m=P:m=M;var d=new Set(H.filter(function(r){var a=!!n[r];return a||p.push(r),a})),u=new Map,o=0;Object.keys(n).forEach(function(r){var a=n[r],i=a.level,s=u.get(i);s||(s=new Set,u.set(i,s)),s.add(a),o=Math.max(o,i)}),Object(Z.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var h;return N===!0?h=X(d,u,o,m):h=F(d,N.halfCheckedKeys,u,o,m),h}},OLES:function(je,ce,D){"use strict";var Z=D("U8pU"),z=D("VTBJ"),M=D("Ff2n"),X=D("q1tI"),F=D("uciX"),I=D("7ixt"),H=function(d){var u=d.overlay,o=d.prefixCls,h=d.id,r=d.overlayInnerStyle;return X.createElement("div",{className:"".concat(o,"-inner"),id:h,role:"tooltip",style:r},typeof u=="function"?u():u)},N=H,n=function(d,u){var o=d.overlayClassName,h=d.trigger,r=h===void 0?["hover"]:h,a=d.mouseEnterDelay,i=a===void 0?0:a,s=d.mouseLeaveDelay,S=s===void 0?.1:s,x=d.overlayStyle,T=d.prefixCls,R=T===void 0?"rc-tooltip":T,w=d.children,v=d.onVisibleChange,b=d.afterVisibleChange,g=d.transitionName,f=d.animation,C=d.placement,E=C===void 0?"right":C,y=d.align,U=y===void 0?{}:y,j=d.destroyTooltipOnHide,A=j===void 0?!1:j,G=d.defaultVisible,W=d.getTooltipContainer,O=d.overlayInnerStyle,V=Object(M.a)(d,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(X.useRef)(null);Object(X.useImperativeHandle)(u,function(){return te.current});var ae=Object(z.a)({},V);"visible"in d&&(ae.popupVisible=d.visible);var me=function(){var He=d.arrowContent,Ee=He===void 0?null:He,be=d.overlay,Ke=d.id;return[X.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},Ee),X.createElement(N,{key:"content",prefixCls:R,id:Ke,overlay:be,overlayInnerStyle:O})]},Re=!1,Oe=!1;if(typeof A=="boolean")Re=A;else if(A&&Object(Z.a)(A)==="object"){var Ce=A.keepParent;Re=Ce===!0,Oe=Ce===!1}return X.createElement(F.a,Object.assign({popupClassName:o,prefixCls:R,popup:me,action:r,builtinPlacements:I.a,popupPlacement:E,ref:te,popupAlign:U,getPopupContainer:W,onPopupVisibleChange:v,afterPopupVisibleChange:b,popupTransitionName:g,popupAnimation:f,defaultPopupVisible:G,destroyPopupOnHide:Re,autoDestroy:Oe,mouseLeaveDelay:S,popupStyle:x,mouseEnterDelay:i},ae),w)},P=Object(X.forwardRef)(n),p=ce.a=P},OZM5:function(je,ce,D){"use strict";D.d(ce,"b",function(){return P}),D.d(ce,"a",function(){return p}),D.d(ce,"k",function(){return m}),D.d(ce,"h",function(){return d}),D.d(ce,"i",function(){return u}),D.d(ce,"g",function(){return o}),D.d(ce,"c",function(){return h}),D.d(ce,"d",function(){return r}),D.d(ce,"j",function(){return s}),D.d(ce,"e",function(){return S}),D.d(ce,"f",function(){return x});var Z=D("KQm4"),z=D("U8pU"),M=D("Ff2n"),X=D("q1tI"),F=D.n(X),I=D("Kwbf"),H=D("WaYH"),N=.25,n=2;function P(T,R){var w=T.slice(),v=w.indexOf(R);return v>=0&&w.splice(v,1),w}function p(T,R){var w=T.slice();return w.indexOf(R)===-1&&w.push(R),w}function m(T){return T.split("-")}function d(T,R){return"".concat(T,"-").concat(R)}function u(T){return T&&T.type&&T.type.isTreeNode}function o(T,R){var w=[T],v=R[T];function b(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(f){var C=f.key,E=f.children;w.push(C),b(E)})}return b(v.children),w}function h(T,R){var w=T.clientY,v=R.selectHandle.getBoundingClientRect(),b=v.top,g=v.bottom,f=v.height,C=Math.max(f*N,n);return w<=b+C?-1:w>=g-C?1:0}function r(T,R){if(!T)return;var w=R.multiple;return w?T.slice():T.length?[T[0]]:T}var a=function(R){return R};function i(T,R){if(!T)return[];var w=R||{},v=w.processProps,b=v===void 0?a:v,g=Array.isArray(T)?T:[T];return g.map(function(f){var C=f.children,E=Object(M.a)(f,["children"]),y=i(C,R);return F.a.createElement(H.a,Object.assign({},b(E)),y)})}function s(T){if(!T)return null;var R;if(Array.isArray(T))R={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(z.a)(T)==="object")R={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function S(T,R){var w=new Set;function v(b){if(w.has(b))return;var g=R[b];if(!g)return;w.add(b);var f=g.parent,C=g.node;if(C.disabled)return;f&&v(f.key)}return(T||[]).forEach(function(b){v(b)}),Object(Z.a)(w)}function x(T){var R={};return Object.keys(T).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(R[w]=T[w])}),R}},"OkW/":function(je,ce,D){},Ot1p:function(je,ce,D){"use strict";var Z=D("2qtc"),z=D("kLXV"),M=D("rAM+"),X=D("miYZ"),F=D("tsqr"),I=D("9og8"),H=D("tJVT"),N=D("jrin"),n=D("WmNS"),P=D.n(n),p=D("q1tI"),m=D.n(p),d=D("VrN/"),u=D.n(d),o=D("bdgK"),h=D("p77/"),r=D("Bd2K"),a=D("ELLl"),i=D("19Vz"),s=D("lZu9"),S=D("+NIl"),x=D("kSUc"),T=D("9Bee"),R=function(Le){var ze=Le.value,dt=ze===void 0?"":ze,Lt=Le.className,Ft=Le.showTextOnly,kt=Le.showLines,St=Le.style,qe=St===void 0?{}:St,rt=Object(p.useMemo)(function(){return""},[dt]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:rt}}))},w=D("0Owb"),v=D("dejd"),b=D("C+DQ"),g=D("1vsH"),f=D("m3rI"),C=[{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 E(Le){var ze=Le.onActionCallback,dt=Le.title,Lt=Le.icon,Ft=Le.actionName,kt=Le.className,St=kt===void 0?"":kt,qe=Le.children;function rt(){ze(Ft)}return m.a.createElement("a",{title:dt,className:St,onClick:rt},m.a.createElement("i",{className:"md-iconfont ".concat(Lt)}),qe)}var y=function(Le){var ze=Le.watch,dt=Le.showNullButton,Lt=Le.onActionCallback,Ft=Le.fullScreen,kt=Le.insertTemp,St=Le.hidetoolBar,qe=Le.uuid,rt=Le.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(g.H)("_educoder_session_login"),"&_educoder_session=").concat(Object(g.H)("_educoder_session"),"&key=").concat(qe,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var Ye=[].concat(C,[{title:"".concat(ze?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ze?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!St&&Ye.map(function(pe,Te){return m.a.createElement("li",{key:Te},pe.actionName?m.a.createElement(E,Object(w.a)({},pe,{onActionCallback:Lt})):m.a.createElement("span",{className:"v-line"}))}),dt?m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Lt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:Lt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(E,{icon:"".concat(Ft?"icon-shrink":"icon-enlarge"),title:Ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Lt})))},U=D("M8RZ"),j=D("+L6B"),A=D("2/Rp"),G=D("y8nQ"),W=D("Vl3Y"),O=D("5NDa"),V=D("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},ae=function(Le){var ze=Le.callback,dt=Le.onCancel;function Lt(Ft){ze(Ft)}return m.a.createElement(W.a,Object(w.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Lt}),m.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(V.a,null)),m.a.createElement(W.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(V.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},me=D("7ahc"),Re=D("HmJG"),Oe=D("BjJ7"),Ce=W.a.useForm,Pe={width:280,marginRight:10},He={labelCol:{span:5},wrapperCol:{span:19}},Ee=function(Le){var ze=Le.callback,dt=Le.onCancel,Lt=Ce(),Ft=Object(H.a)(Lt,1),kt=Ft[0];function St(Ye){ze(Ye)}function qe(Ye,pe){if(Ye.status===-1){F.b.error(Ye.message);return}kt.setFieldsValue({src:"/api/attachments/".concat(Ye.id),type:pe.type})}function rt(Ye){var pe=Ye.target.files[0];Ke(pe,qe)}return m.a.createElement(W.a,Object(w.a)({form:kt},He,{className:"upload-image-panel",onFinish:St}),m.a.createElement(W.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(W.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(V.a,{style:Pe})),m.a.createElement(be,{onFileChange:rt}))),m.a.createElement(W.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(V.a,{style:{width:264}})),m.a.createElement(W.a.Item,{style:{textAlign:"right"}},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))};function be(Le){var ze=Le.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:ze}))}function Ke(Le,ze){if(!Le)throw new String("\u6CA1\u6709\u6587\u4EF6");var dt=new FormData;dt.append("editormd-image-file",Le),dt.append("file_param_name","editormd-image-file"),dt.append("byxhr","true");var Lt=new window.XMLHttpRequest;Lt.withCredentials=!0,Lt.addEventListener("load",function(Ft){ze(JSON.parse(Ft.target.responseText),Le)},!1),Lt.addEventListener("error",function(Ft){console.error(Ft)},!1),Lt.open("POST","".concat(Oe.a,"/api/attachments.json")),Lt.send(dt)}var bt=D("giR+"),Et=D("fyUT"),yt=D("7Kak"),pt=D("9yH6"),st=pt.a.Group,ht={margin:"0 8px"},wt=function(Le){var ze=Le.callback,dt=Le.onCancel;function Lt(Ft){ze(Ft)}return m.a.createElement(W.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Lt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:ht},"\u884C\u6570"),m.a.createElement(W.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(Et.a,null)),m.a.createElement("span",{style:ht},"\u5217\u6570"),m.a.createElement(W.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(Et.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:ht},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(W.a.Item,{name:"align"},m.a.createElement(st,null,m.a.createElement(pt.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(pt.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(pt.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(pt.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(A.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},_e=D("ErOA"),Me=D("7Cbv"),ye="link",Se="upload-image",Be="code-block",Ze="add-table",ot="------------",ft={default:ot,left:":".concat(ot),center:":".concat(ot,":"),right:"".concat(ot,":")},Ct=D("9VGf"),Ot,Ne;function ke(){}var at=0,ct=1e4,Ge="\u2581",et=` **\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 Ae(Le){return/^\d+$/.test(Le)?"".concat(Le,"px"):Le}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=ve?"Cmd":"Ctrl",ue=["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"],fe=(Ot={},Object(N.a)(Ot,xe+"-B","bold"),Object(N.a)(Ot,xe+"-I","italic"),Ot),de=(Ne={},Object(N.a)(Ne,ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(Ne,Be,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(Ne,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(Ne,Ze,"\u6DFB\u52A0\u8868\u683C"),Ne),we=ce.a=function(Le){var ze=Le.defaultValue,dt=ze===void 0?"":ze,Lt=Le.onChange,Ft=Le.width,kt=Ft===void 0?"100%":Ft,St=Le.height,qe=St===void 0?400:St,rt=Le.miniToolbar,Ye=rt===void 0?!1:rt,pe=Le.isFocus,Te=pe===void 0?!1:pe,nt=Le.watch,Xe=Le.insertTemp,Pt=Le.mode,Mt=Pt===void 0?"markdown":Pt,Ve=Le.id,gt=Ve===void 0?"markdown-editor-id":Ve,It=Le.showResizeBar,Zt=It===void 0?!1:It,le=Le.noStorage,re=le===void 0?!1:le,B=Le.showNullButton,$=B===void 0?!1:B,J=Le.hidetoolBar,ne=J===void 0?!1:J,ge=Le.fullScreen,Ue=ge===void 0?!1:ge,We=Le.onBlur,_t=Le.onCMBeforeChange,Rt=Le.onFullScreen,Bt=Le.className,tt=Bt===void 0?"":Bt,Dt=Le.disablePaste,At=Dt===void 0?!1:Dt,nn=Le.placeholder,qt=nn===void 0?"":nn,Yt=Le.values,Q=Yt===void 0?"":Yt,L=Object(p.useState)(null),k=Object(H.a)(L,2),Y=k[0],se=k[1],q=Object(p.useState)(dt),De=Object(H.a)(q,2),lt=De[0],Nt=De[1],Qt=Object(p.useState)(nt),ut=Object(H.a)(Qt,2),en=ut[0],gn=ut[1],Yn=Object(p.useState)(Ue),mi=Object(H.a)(Yn,2),ri=mi[0],Nn=mi[1],Gi=Object(p.useState)(""),zi=Object(H.a)(Gi,2),ni=zi[0],di=zi[1],ji=Object(p.useState)(0),Mi=Object(H.a)(ji,2),wi=Mi[0],Ci=Mi[1],ar=Object(p.useState)(qe),Zi=Object(H.a)(ar,2),lr=Zi[0],Vi=Zi[1],qi=Object(p.useState)(!1),ur=Object(H.a)(qi,2),Mr=ur[0],Li=ur[1],Fn=Object(p.useRef)(Object(Me.a)()),Pn=Object(p.useRef)(!1),xi=Object(p.useRef)(),Wn=Object(p.useRef)(),Si=Object(p.useRef)(),ai=Object(p.useRef)(),Tr=Object(p.useRef)(),ki=function(){var pn=Object(I.a)(P.a.mark(function Cn(){var yn,jn;return P.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,Object(_e.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Fn.current}});case 2:jn=un.sent,jn!=null&&(yn=jn.attachments)!==null&&yn!==void 0&&yn.length&&(console.log("cm:",Y,Wn),jn.attachments.map(function(Bn){Bn.content_type.indexOf("image")>-1?Y.replaceSelection("![,](/api/attachments/".concat(Bn.id,"?type=").concat(Bn.content_type,")")):Bn.content_type.indexOf("video")>-1?Y.replaceSelection('')):Bn.content_type.indexOf("pdf")>-1?Y.replaceSelection('
    ').concat(Bn.name,"")):Y.replaceSelection("[".concat(Bn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Bn.id,"?type=").concat(Bn.content_type,")"))}));case 4:case"end":return un.stop()}},Cn)}));return function(){return pn.apply(this,arguments)}}();Object(p.useEffect)(function(){Nt(Q),Y==null||Y.setValue(Q)},[Q]),Object(p.useEffect)(function(){Rt==null||Rt(ri)},[ri]),Object(p.useEffect)(function(){if(Wn.current){var pn=u.a.fromTextArea(Wn.current,{mode:Mt,lineNumbers:!Ye,lineWrapping:!0,value:dt,autoCloseTags:!0,autoCloseBrackets:!0});Te&&pn.focus();function Cn(yn,jn){if(At){jn.preventDefault();return}var Qn=jn.clipboardData;if(Qn){var un=Qn.types.toString(),Bn=Qn.items;if(un==="Files"||Qn.types.indexOf("Files")>-1){if(jn.preventDefault(),Mt=="stex")return;try{var Oi,Yi=Bn[1];((Oi=Bn[0])===null||Oi===void 0?void 0:Oi.kind)==="file"&&(Yi=Bn[0]);var Vn=Yi.getAsFile(),yr=Vn.name.split(".").pop();Ke(Vn,function(oi){if(oi.id){var Je,vt,Kt;(Vn==null||((Je=Vn.type)===null||Je===void 0)?void 0:Je.indexOf("image"))>-1?pn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Vn==null||((vt=Vn.type)===null||vt===void 0)?void 0:vt.indexOf("video"))>-1?pn.replaceSelection('')):(Vn==null||((Kt=Vn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?pn.replaceSelection('').concat(Vn.name,"")):ue.includes(yr)?pn.replaceSelection('').concat(Vn.name,"")):pn.replaceSelection("[".concat(Vn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})}catch(oi){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return pn.on("paste",Cn),pn.on("dragleave",function(yn,jn){Si.current.classList.remove("mouse-hover-md")}),pn.on("dragover",function(yn,jn){Si.current.classList.add("mouse-hover-md")}),pn.on("drop",function(yn,jn){Si.current.classList.add("mouse-hover-md");var Qn;if(Qn=jn.dataTransfer.files,Qn.length>0){jn.preventDefault(),jn.stopPropagation();for(var un=function(Yi){var Vn=Qn[Yi],yr=Vn.name.split(".").pop();Ke(Vn,function(oi){if(oi.id){var Je,vt,Kt;(Vn==null||((Je=Vn.type)===null||Je===void 0)?void 0:Je.indexOf("image"))>-1?pn.replaceSelection("![,](/api/attachments/".concat(oi.id,"?type=").concat(oi.content_type,")")):(Vn==null||((vt=Vn.type)===null||vt===void 0)?void 0:vt.indexOf("video"))>-1?pn.replaceSelection('')):(Vn==null||((Kt=Vn.type)===null||Kt===void 0)?void 0:Kt.indexOf("pdf"))>-1?pn.replaceSelection('').concat(Vn.name,"")):ue.includes(yr)?pn.replaceSelection('').concat(Vn.name,"")):pn.replaceSelection("[".concat(Vn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(oi.id,"?type=").concat(oi.content_type,")"))}else(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")})},Bn=0;Bn0||Bn.target.offsetWidth>0)&&(Xi(),Y.setSize("100%","100%"),Y.refresh())}}catch(Oi){Qn.e(Oi)}finally{Qn.f()}});return yn.observe(Wn.current.parentElement),yn}if(Y){var Cn=pn();return function(){Cn.unobserve(Wn.current.parentElement)}}},[Y,Xi]),Object(p.useEffect)(function(){if(Y){for(var pn=[],Cn=function(){var Bn=jn[yn];Qn=Object(H.a)(Bn,2);var Oi=Qn[0],Yi=Qn[1],Vn=Object(N.a)({},Oi,function(){cr(Yi)});pn.push(Vn),Y.addKeyMap(Vn)},yn=0,jn=Object.entries(fe);yn0){var pn=new Date().getTime(),Cn=window.sessionStorage.getItem(gt);pn>=wi+ct&&(!Cn||Cn!==lt)&&(window.sessionStorage.setItem(gt,lt),Li(!0))}},ct),Object(p.useEffect)(function(){gn(nt)},[Y,nt]),Object(p.useEffect)(function(){Y&&(Te&&Y.focus())},[Y,Te]),Object(p.useEffect)(function(){if(en&&Y){var pn=Y.getScrollerElement();function Cn(yn){var jn=yn.target;if(Tr.current){var Qn=jn.scrollTop/jn.scrollHeight;Tr.current.scrollTop=Tr.current.scrollHeight*Qn}}return pn.addEventListener("scroll",Cn),function(){pn.removeEventListener("scroll",Cn)}}},[Y,en]),Object(p.useEffect)(function(){if(Y&&_t){function pn(Cn,yn){_t(Cn,yn)}return Y.on("beforeChange",pn),function(){Y.off("beforeChange",pn)}}},[Y,_t]),Object(p.useEffect)(function(){if(Y&&We){function pn(){We(Y.getValue())}return Y.on("blur",pn),function(){Y.off("blur",pn)}}},[Y,We]),Object(p.useEffect)(function(){if(Y){function pn(Cn){var yn=Cn.getValue();Nt(yn),Ci(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Lt&&Lt(yn)}return Y.on("change",pn),function(){Y.off("change",pn)}}},[Y,Lt]),Object(p.useEffect)(function(){Y&&(dt==null?(Y.setValue(""),Nt("")):dt!==Y.getValue()&&(Y.setValue(dt),Nt(dt),Y.setCursor(Y.lineCount(),0)))},[Y,dt]);var cr=Object(p.useCallback)(function(pn){var Cn=Y.getCursor(),yn=Y.getSelection(),jn=yn.split(` `);switch(pn){case"bold":return Y.replaceSelection("**"+yn+"**"),yn===""&&Y.setCursor(Cn.line,Cn.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+yn+"*"),yn===""&&Y.setCursor(Cn.line,Cn.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+yn+"`"),yn===""&&Y.setCursor(Cn.line,Cn.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+yn+"$$`"),yn===""&&Y.setCursor(Cn.line,Cn.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+yn+"\n```"),Y.setCursor(Cn.line+1,yn.length+1),Y.focus();case"line-break":return Y.replaceSelection(`
    `),Y.focus();case"list-ul":return yn===""?Y.replaceSelection("- "+yn):Y.replaceSelection(jn.map(function(Qn){return Qn===""?"":"- ".concat(Qn)}).join(` `)),Y.focus();case"list-ol":return yn===""?Y.replaceSelection("1. "+yn):Y.replaceSelection(jn.map(function(Qn,un){return Qn===""?"":"".concat(un+1,". ").concat(Qn)}).join(` `)),Y.focus();case"add-null-ch":return yn===""&&Y.setCursor(Cn.line,Cn.ch+1),Y.replaceSelection(Ge),Y.focus();case"inster-template-1":return yn===""&&Y.setCursor(Cn.line,Cn.ch),Y.replaceSelection(et),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return gn(!en),Y.focus();case"trigger-full-screen":return Nn(!ri),Y.focus();case ye:di(ye);return;case Be:di(Be);return;case Se:di(Se);return;case Ze:di(Ze);return;default:throw new Error}},[Y,en,ri]),gr=Object(p.useCallback)(function(pn){di("");switch(ni){case ye:var Cn=pn.title,yn=pn.link;return Y.replaceSelection("[".concat(Cn,"](").concat(yn,")")),Y.focus();case Be:var jn=pn.language,Qn=pn.content;return Y.replaceSelection(["```"+jn,Qn,"```"].join(` `)),Y.focus();case Se:var un=pn.src,Bn=pn.alt;return Bn?Y.replaceSelection("![ ".concat(Bn," ]( ").concat(un,' "').concat(Bn,'" )')):Y.replaceSelection("![,](".concat(un,")")),Y.focus();case Ze:for(var Oi=pn.row,Yi=pn.col,Vn=pn.align,yr=` `,oi=0;oi300&&(Oi=300);var Yi=qe+Oi+"px";Vi(Yi)}}return pn.addEventListener("mousedown",jn),document.addEventListener("mousemove",un),document.addEventListener("mouseup",Qn),function(){pn.removeEventListener("mousedown",jn),document.removeEventListener("mousemove",un),document.removeEventListener("mouseup",Qn)}}},[Y,ai]),Object(p.useEffect)(function(){Vi(qe)},[qe]);var wr=Ae(kt),Xr=Ae(lr),vr={width:wr,height:Xr},Yr=Object(p.useMemo)(function(){if(wi){var pn=new Date(wi),Cn=pn.getHours(),yn=pn.getMinutes(),jn=pn.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,yn=yn<10?"0"+yn:yn,jn=jn<10?"0"+jn:jn,"".concat(Cn,":").concat(yn,":").concat(jn)}return 0},[wi]);function $r(){window.sessionStorage.removeItem(gt),Li(!1),Ci(0)}function fr(){Li(!1),Ci(0),Y.setValue(window.sessionStorage.getItem(gt))}function Qr(pn,Cn){var yn=Y.getValue();yn=yn.replace(pn,Cn),Nt(yn),Y==null||Y.setValue(yn)}return m.a.createElement(p.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Si},m.a.createElement("div",{className:"markdown-editor-container ".concat(tt," ").concat(en?"on-preview":""," ").concat(Ye?"mini":""," ").concat(ri?"full-screen":""),style:vr},m.a.createElement(y,{insertTemp:Xe,watch:en,fullScreen:ri,showNullButton:$,onActionCallback:cr,hidetoolBar:ne,uuid:Fn.current,setOpenPhones:function(){Pn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:Wn,placeholder:qt})),en?m.a.createElement("div",{ref:Tr,className:"preview-container"},Mt==="stex"&&m.a.createElement(R,{value:lt}),Mt!=="stex"&&m.a.createElement(T.a,{edit:!0,value:lt,replaces:Qr})):null))),Zt?m.a.createElement("a",{ref:ai,className:"editor-resize"}):null,m.a.createElement(U.a,null,de[ni]?m.a.createElement(z.a,{centered:!0,title:de[ni],visible:!0,onCancel:kr,footer:null,className:"markdown-popup-form"},Hr):null))}},P5Jw:function(je,ce,D){"use strict";var Z=D("rHrb"),z=Z.CopyToClipboard;z.CopyToClipboard=z,je.exports=z},PD8m:function(je,ce){je.exports={name:"memoryStorage",read:Z,write:z,each:M,remove:X,clearAll:F};var D={};function Z(I){return D[I]}function z(I,H){D[I]=H}function M(I){for(var H in D)D.hasOwnProperty(H)&&I(D[H],H)}function X(I){delete D[I]}function F(I){D={}}},RELg:function(je,ce,D){var Z=D("MFOe"),z=Z.Global;je.exports={name:"oldIE-userDataStorage",write:H,read:N,each:n,remove:P,clearAll:p};var M="storejs",X=z.document,F=u(),I=(z.navigator?z.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function H(o,h){if(I)return;var r=d(o);F(function(a){a.setAttribute(r,h),a.save(M)})}function N(o){if(I)return;var h=d(o),r=null;return F(function(a){r=a.getAttribute(h)}),r}function n(o){F(function(h){for(var r=h.XMLDocument.documentElement.attributes,a=r.length-1;a>=0;a--){var i=r[a];o(h.getAttribute(i.name),i.name)}})}function P(o){var h=d(o);F(function(r){r.removeAttribute(h),r.save(M)})}function p(){F(function(o){var h=o.XMLDocument.documentElement.attributes;o.load(M);for(var r=h.length-1;r>=0;r--)o.removeAttribute(h[r].name);o.save(M)})}var m=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function d(o){return o.replace(/^\d/,"___$&").replace(m,"___")}function u(){if(!X||!X.documentElement||!X.documentElement.addBehavior)return null;var o="script",h,r,a;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+o+">document.w=window'),r.close(),h=r.w.frames[0].document,a=h.createElement("div")}catch(i){a=X.createElement("div"),h=X.body}return function(i){var s=[].slice.call(arguments,0);s.unshift(a),h.appendChild(a),a.addBehavior("#default#userData"),a.load(M),i.apply(this,s),h.removeChild(a);return}}},RpDr:function(je,ce,D){"use strict";D.d(ce,"a",function(){return T}),D.d(ce,"c",function(){return v});var Z=D("+L6B"),z=D("2/Rp"),M=D("tJVT"),X=D("k1fw"),F=D("jrin"),I=D("5NDa"),H=D("5rEg"),N=D("q1tI"),n=D.n(N),P=D("8Skl"),p=D("y3Kf"),m=D("bdLU"),d=D("J66h"),u=D.n(d),o=D("++UQ"),h=D.n(o),r=D("IxHN"),a=D("9Bee"),i=D("1vsH"),s,S=H.a.TextArea,x={visible:!1,tabIndex:"0"},T=(s={},Object(F.a)(s,m.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(F.a)(s,m.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(F.a)(s,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(F.a)(s,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(F.a)(s,4,"\u7F16\u8BD1\u5931\u8D25"),Object(F.a)(s,5,"\u6267\u884C\u5931\u8D25"),s),R;(function(g){g[g.SET_VISIBLE=0]="SET_VISIBLE",g[g.SET_TABINDEX=1]="SET_TABINDEX"})(R||(R={}));function w(g,f){switch(f.type){case R.SET_VISIBLE:return Object(X.a)(Object(X.a)({},g),{},{visible:f.payload});case R.SET_TABINDEX:return Object(X.a)(Object(X.a)({},g),{},{tabIndex:f.payload});default:throw new Error}}function v(g){var f=g.status,C=g.error_msg,E=g.output,y=g.input,U=g.expected_output,j=g.is_file,A=g.input_file_url,G=g.output_file_url,W=g.expected_output_file_url,O=null,V={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(f){case m.a.NOMATCH:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:y,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.A)(A,y)}},y)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!j&&n.a.createElement(a.a,{value:E&&d.Base64.decode(E)||"",style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.A)(G,E)}},E)),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!j&&n.a.createElement(a.a,{value:U&&d.Base64.decode(U)||"",style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.A)(W,U)}},U)));break;case m.a.EXECUTEFAILURE:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:y,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.A)(A,y)}},y)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.COMPILEFAILURE:O=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!j&&n.a.createElement(a.a,{value:y,style:V}),j&&n.a.createElement("div",{style:V},n.a.createElement("a",{onClick:function(){return Object(i.A)(A,y)}},y)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.PODFAILURE:O=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:O=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",O," ")}function b(g){var f=g.status,C=g.error_msg,E=g.execute_time,y=g.output,U=g.input,j=g.expected_output,A=g.is_file,G=g.input_file_url,W=g.output_file_url,O=g.expected_output_file_url,V=null;switch(f){case m.a.OK:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",E),n.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),n.a.createElement("pre",null,d.Base64.decode(y)));break;case m.a.NOMATCH:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u8F93\u51FA\uFF1A",y&&d.Base64.decode(y)),n.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",j&&d.Base64.decode(j)));break;case m.a.EXECUTEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.COMPILEFAILURE:V=n.a.createElement(n.a.Fragment,null,n.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",n.a.createElement("pre",null,U)),n.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),n.a.createElement("pre",{className:"error"},d.Base64.decode(C)));break;case m.a.PODFAILURE:V=n.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case m.a.TIMEOUT:V=n.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return n.a.createElement(n.a.Fragment,null," ",V," ")}ce.b=function(g){var f=g.id,C=g.input,E=g.debuging,y=g.submitting,U=g.executingMessage,j=g.debugResult,A=g.onChangeInput,G=g.onDebugCode,W=g.onSubmitCode,O=Object(N.useReducer)(w,x),V=Object(M.a)(O,2),te=V[0],ae=V[1],me=te.visible,Re=te.tabIndex;Object(N.useEffect)(function(){ae({type:R.SET_VISIBLE,payload:!1})},[f]);function Oe(Ee){var be=Ee.target.id;ae({type:R.SET_TABINDEX,payload:be})}function Ce(){ae({type:R.SET_VISIBLE,payload:!me})}var Pe=Object(N.useMemo)(function(){if(j){var Ee=j.status;return n.a.createElement(n.a.Fragment,null,b(j))}return null},[j]);function He(){ae({type:R.SET_VISIBLE,payload:!0}),ae({type:R.SET_TABINDEX,payload:"1"}),G()}return n.a.createElement("div",{className:"test-case-panel"},n.a.createElement("div",{className:"test-case-panel-body ".concat(me?"active":"")},n.a.createElement("ul",{className:"s-navs"},n.a.createElement("li",null,n.a.createElement("a",{className:Re==="0"?"active":"",id:"0",onClick:Oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),n.a.createElement("li",null,n.a.createElement("a",{className:Re==="1"?"active":"",id:"1",onClick:Oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),n.a.createElement("div",{className:"tab-panel-body ".concat(Re==="0"?"":"hide")},n.a.createElement(S,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:C,onChange:A})),n.a.createElement("div",{className:"tab-panel-body ".concat(Re==="1"?"":"hide")},E?n.a.createElement(r.a,{message:U}):j?n.a.createElement("section",{style:{height:200}}," ",Pe," "):n.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"))),n.a.createElement("a",{className:"btn-collapse ".concat(me?"up":""),onClick:Ce},me?n.a.createElement(P.a,null):n.a.createElement(p.a,null)),n.a.createElement("footer",{className:"footer"},n.a.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),n.a.createElement("div",{className:"flex-container"},n.a.createElement(z.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),n.a.createElement(z.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),n.a.createElement(z.a,{className:"btn-green",type:"ghost",loading:E,onClick:He},"\u8C03\u8BD5\u4EE3\u7801"),n.a.createElement(z.a,{type:"primary",loading:y,disabled:y,onClick:function(){ae({type:R.SET_VISIBLE,payload:!1}),W()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},"S/kP":function(je,ce,D){je.exports=D.p+"static/time.a3dc82f3.svg"},"SA+Z":function(je,ce,D){var Z=D("wTVA"),z=D("EbDI"),M=D("ZhPi"),X=D("wkBT");function F(I){return Z(I)||z(I)||M(I)||X()}je.exports=F,je.exports.__esModule=!0,je.exports.default=je.exports},SJMd:function(je,ce){/** * @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 D,Z,z,M=!1,X,F;window.PR_SHOULD_USE_CONTINUATION=!0;var I,H;(function(){var N=window,n=["break,continue,do,else,for,if,return,while"],P=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],p=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[p,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],d=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[p,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="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",h=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",a=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[n,"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"],s=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[m,u,d,h,r,a,i,s],x=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",R="kwd",w="com",v="typ",b="lit",g="pun",f="pln",C="tag",E="dec",y="src",U="atn",j="atv",A="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function W(st){for(var ht=0,wt=!1,_e=!1,Me=0,ye=st.length;Me122||(ue<65||xe>90||at.push([Math.max(65,xe)|32,Math.min(ue,90)|32]),ue<97||xe>122||at.push([Math.max(97,xe)&~32,Math.min(ue,122)&~32]))}}at.sort(function(Le,ze){return Le[0]-ze[0]||ze[1]-Le[1]});for(var fe=[],de=[],et=0;etwe[0]&&(we[1]+1>we[0]&&Ge.push("-"),Ge.push(ot(we[1])))}return Ge.push("]"),Ge.join("")}function Ct(Ne){for(var ke=Ne.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")),at=ke.length,ct=[],Ge=0,et=0;Ge=2&&xe==="["?ke[Ge]=ft(Ae):xe!=="\\"&&(ke[Ge]=Ae.replace(/[a-zA-Z]/g,function(de){var we=de.charCodeAt(0);return"["+String.fromCharCode(we&~32,we|32)+"]"}))}return ke.join("")}for(var Ot=[],Me=0,ye=st.length;Me=0;)wt[Ot.charAt(Ne)]=Ct;var ke=Ct[1],at=""+ke;Ze.hasOwnProperty(at)||(Be.push(ke),Ze[at]=null)}Be.push(/[\0-\uffff]/),_e=W(Be)})();var Me=ht.length,ye=function(Se){for(var Be=Se.sourceCode,Ze=Se.basePos,ot=Se.sourceNode,ft=[Ze,f],Ct=0,Ot=Be.match(_e)||[],Ne={},ke=0,at=Ot.length;ke=5&&Ge.substring(0,5)==="lang-",Ae&&!(et&&typeof et[1]=="string")&&(Ae=!1,Ge=y),Ae||(Ne[ct]=Ge)}var ue=Ct;if(Ct+=ct.length,!Ae)ft.push(Ze+ue,Ge);else{var fe=et[1],de=ct.indexOf(fe),we=de+fe.length;et[2]&&(we=ct.length-et[2].length,de=we-fe.length);var Le=Ge.substring(5);V(ot,Ze+ue,ct.substring(0,de),ye,ft),V(ot,Ze+ue+de,fe,be(Le,fe),ft),V(ot,Ze+ue+we,ct.substring(we),ye,ft)}}Se.decorations=ft};return ye}function Re(st){var ht=[],wt=[];st.tripleQuotedStrings?ht.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):st.multiLineStrings?ht.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ht.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),st.verbatimStrings&&wt.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var _e=st.hashComments;_e&&(st.cStyleComments?(_e>1?ht.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ht.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),wt.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ht.push([w,/^#[^\r\n]*/,null,"#"])),st.cStyleComments&&(wt.push([w,/^\/\/[^\r\n]*/,null]),wt.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Me=st.regexLiterals;if(Me){var ye=Me>1?"":` \r`,Se=ye?".":"[\\S\\s]",Be="/(?=[^/*"+ye+"])(?:[^/\\x5B\\x5C"+ye+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+ye+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";wt.push(["lang-regex",RegExp("^"+G+"("+Be+")")])}var Ze=st.types;Ze&&wt.push([v,Ze]);var ot=(""+st.keywords).replace(/^ | $/g,"");ot.length&&wt.push([R,new RegExp("^(?:"+ot.replace(/[\s,]+/g,"|")+")\\b"),null]),ht.push([f,/^\s+/,null,` \r \xA0`]);var ft="^.[^\\s\\w.$@'\"`/\\\\]*";return st.regexLiterals&&(ft+="(?!s*/)"),wt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[g,new RegExp(ft),null]),me(ht,wt)}var Oe=Re({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(st,ht,wt){for(var _e=/(?:^|\s)nocode(?:\s|$)/,Me=/\r\n?|\n/,ye=st.ownerDocument,Se=ye.createElement("li");st.firstChild;)Se.appendChild(st.firstChild);var Be=[Se];function Ze(ke){var at=ke.nodeType;if(at==1&&!_e.test(ke.className))if(ke.nodeName==="br")ot(ke),ke.parentNode&&ke.parentNode.removeChild(ke);else for(var ct=ke.firstChild;ct;ct=ct.nextSibling)Ze(ct);else if((at==3||at==4)&&wt){var Ge=ke.nodeValue,et=Ge.match(Me);if(et){var Ae=Ge.substring(0,et.index);ke.nodeValue=Ae;var ve=Ge.substring(et.index+et[0].length);if(ve){var xe=ke.parentNode;xe.insertBefore(ye.createTextNode(ve),ke.nextSibling)}ot(ke),Ae||ke.parentNode.removeChild(ke)}}}function ot(ke){for(;!ke.nextSibling;)if(ke=ke.parentNode,!ke)return;function at(et,Ae){var ve=Ae?et.cloneNode(!1):et,xe=et.parentNode;if(xe){var ue=at(xe,1),fe=et.nextSibling;ue.appendChild(ve);for(var de=fe;de;de=fe)fe=de.nextSibling,ue.appendChild(de)}return ve}for(var ct=at(ke.nextSibling,0),Ge;(Ge=ct.parentNode)&&Ge.nodeType===1;)ct=Ge;Be.push(ct)}for(var ft=0;ft=xe&&(Ze+=2),ye>=ue&&(Ct+=2)}}finally{Ge&&(Ge.style.display=et)}}var He={};function Ee(st,ht){for(var wt=ht.length;--wt>=0;){var _e=ht[wt];He.hasOwnProperty(_e)?N.console&&console.warn("cannot override language handler %s",_e):He[_e]=st}}function be(st,ht){return st&&He.hasOwnProperty(st)||(st=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[g,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Ee(me([[f,/^[\s]+/,null,` \r `],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[g,/^[=<>\/]+/],["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"]),Ee(me([],[[j,/^[\s\S]+/]]),["uq.val"]),Ee(Re({keywords:m,hashComments:!0,cStyleComments:!0,types:x}),["c","cc","cpp","cxx","cyc","m"]),Ee(Re({keywords:"null,true,false"}),["json"]),Ee(Re({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:x}),["cs"]),Ee(Re({keywords:d,cStyleComments:!0}),["java"]),Ee(Re({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ee(Re({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ee(Re({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ee(Re({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ee(Re({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ee(Re({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ee(me([],[[T,/^[\s\S]+/]]),["regex"]);function Ke(st){var ht=st.langExtension;try{var wt=O(st.sourceNode,st.pre),_e=wt.sourceCode;st.sourceCode=_e,st.spans=wt.spans,st.basePos=0,be(ht,_e)(st),Pe(st)}catch(Me){N.console&&console.log(Me&&Me.stack||Me)}}function bt(st,ht,wt){var _e=wt||!1,Me=ht||null,ye=document.createElement("div");ye.innerHTML="
    "+st+"
    ",ye=ye.firstChild,_e&&Ce(ye,_e,!0);var Se={langExtension:Me,numberLines:_e,sourceNode:ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ke(Se),ye.innerHTML}function Et(st,ht){var wt=ht||document.body,_e=wt.ownerDocument||document;function Me(ve){return wt.getElementsByTagName(ve)}for(var ye=[Me("pre"),Me("code"),Me("xmp")],Se=[],Be=0;Be=0),F.set("isFirefox",X.indexOf("Firefox")>=0),F.set("isChrome",X.indexOf("Chrome")>=0),F.set("isSafari",X.indexOf("Safari")>=0);const I=Object.prototype.hasOwnProperty;class H{static has(A){return m.create(A)}static equals(A,G){return d.create(A,G)}static regex(A,G){return T.create(A,G)}static not(A){return r.create(A)}static and(...A){return v.create(A,null)}static or(...A){return b.create(A,null,!0)}static deserialize(A,G=!1){return A?this._deserializeOrExpression(A,G):void 0}static _deserializeOrExpression(A,G){let W=A.split("||");return b.create(W.map(O=>this._deserializeAndExpression(O,G)),null,!0)}static _deserializeAndExpression(A,G){let W=A.split("&&");return v.create(W.map(O=>this._deserializeOne(O,G)),null)}static _deserializeOne(A,G){if(A=A.trim(),A.indexOf("!=")>=0){let W=A.split("!=");return h.create(W[0].trim(),this._deserializeValue(W[1],G))}if(A.indexOf("==")>=0){let W=A.split("==");return d.create(W[0].trim(),this._deserializeValue(W[1],G))}if(A.indexOf("=~")>=0){let W=A.split("=~");return T.create(W[0].trim(),this._deserializeRegexValue(W[1],G))}if(A.indexOf(" in ")>=0){let W=A.split(" in ");return u.create(W[0].trim(),W[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const W=A.split(">=");return s.create(W[0].trim(),W[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const W=A.split(">");return i.create(W[0].trim(),W[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const W=A.split("<=");return x.create(W[0].trim(),W[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const W=A.split("<");return S.create(W[0].trim(),W[1].trim())}return/^\!\s*/.test(A)?r.create(A.substr(1).trim()):m.create(A)}static _deserializeValue(A,G){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let W=/^'([^']*)'$/.exec(A);return W?W[1].trim():A}static _deserializeRegexValue(A,G){if(Object(z.C)(A)){if(G)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let W=A.indexOf("/"),O=A.lastIndexOf("/");if(W===O||W<0){if(G)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let V=A.slice(W+1,O),te=A[O+1]==="i"?"i":"";try{return new RegExp(V,te)}catch(ae){if(G)throw new Error(`bad regexp-value '${A}', parse error: ${ae}`);return console.warn(`bad regexp-value '${A}', parse error: ${ae}`),null}}}function N(A,G){const W=A?A.substituteConstants():void 0,O=G?G.substituteConstants():void 0;return!W&&!O?!0:!W||!O?!1:W.equals(O)}function n(A,G){return A.cmp(G)}class P{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return p.INSTANCE}}P.INSTANCE=new P;class p{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return P.INSTANCE}}p.INSTANCE=new p;class m{constructor(A,G){this.key=A,this.negated=G,this.type=2}static create(A,G=null){const W=F.get(A);return typeof W=="boolean"?W?p.INSTANCE:P.INSTANCE:new m(A,G)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=F.get(this.key);return typeof A=="boolean"?A?p.INSTANCE:P.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this)),this.negated}}class d{constructor(A,G,W){this.key=A,this.value=G,this.negated=W,this.type=4}static create(A,G,W=null){if(typeof G=="boolean")return G?m.create(A,W):r.create(A,W);const O=F.get(A);if(typeof O=="boolean"){const V=O?"true":"false";return G===V?p.INSTANCE:P.INSTANCE}return new d(A,G,W)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=F.get(this.key);if(typeof A=="boolean"){const G=A?"true":"false";return this.value===G?p.INSTANCE:P.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class u{constructor(A,G){this.key=A,this.valueKey=G,this.type=10,this.negated=null}static create(A,G){return new u(A,G)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const G=A.getValue(this.valueKey),W=A.getValue(this.key);return Array.isArray(G)?G.indexOf(W)>=0:typeof W=="string"&&typeof G=="object"&&G!==null?I.call(G,W):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(A){this._actual=A,this.type=11}static create(A){return new o(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class h{constructor(A,G,W){this.key=A,this.value=G,this.negated=W,this.type=5}static create(A,G,W=null){if(typeof G=="boolean")return G?r.create(A,W):m.create(A,W);const O=F.get(A);if(typeof O=="boolean"){const V=O?"true":"false";return G===V?P.INSTANCE:p.INSTANCE}return new h(A,G,W)}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=F.get(this.key);if(typeof A=="boolean"){const G=A?"true":"false";return this.value===G?P.INSTANCE:p.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class r{constructor(A,G){this.key=A,this.negated=G,this.type=3}static create(A,G=null){const W=F.get(A);return typeof W=="boolean"?W?P.INSTANCE:p.INSTANCE:new r(A,G)}cmp(A){return A.type!==this.type?this.type-A.type:E(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=F.get(this.key);return typeof A=="boolean"?A?P.INSTANCE:p.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this)),this.negated}}function a(A,G){if(typeof A=="string"){const W=parseFloat(A);isNaN(W)||(A=W)}return typeof A=="string"||typeof A=="number"?G(A):P.INSTANCE}class i{constructor(A,G,W){this.key=A,this.value=G,this.negated=W,this.type=12}static create(A,G,W=null){return a(G,O=>new i(A,O,W))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this.key,this.value,this)),this.negated}}class s{constructor(A,G,W){this.key=A,this.value=G,this.negated=W,this.type=13}static create(A,G,W=null){return a(G,O=>new s(A,O,W))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class S{constructor(A,G,W){this.key=A,this.value=G,this.negated=W,this.type=14}static create(A,G,W=null){return a(G,O=>new S(A,O,W))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))new x(A,O,W))}cmp(A){return A.type!==this.type?this.type-A.type:y(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class T{constructor(A,G){this.key=A,this.regexp=G,this.type=7,this.negated=null}static create(A,G){return new T(A,G)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.keyA.key)return 1;const G=this.regexp?this.regexp.source:"",W=A.regexp?A.regexp.source:"";return GW?1:0}equals(A){if(A.type===this.type){const G=this.regexp?this.regexp.source:"",W=A.regexp?A.regexp.source:"";return this.key===A.key&&G===W}return!1}substituteConstants(){return this}evaluate(A){let G=A.getValue(this.key);return this.regexp?this.regexp.test(G):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function w(A){let G=null;for(let W=0,O=A.length;WA.expr.length)return 1;for(let G=0,W=this.expr.length;G1;){const V=W[W.length-1];if(V.type!==9)break;W.pop();const te=W.pop(),ae=W.length===0,me=b.create(V.expr.map(Re=>v.create([Re,te],null)),null,ae);me&&(W.push(me),W.sort(n))}return W.length===1?W[0]:new v(W,G)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let G of this.expr)A.push(...G.keys());return A}negate(){if(!this.negated){const A=[];for(let G of this.expr)A.push(G.negate());this.negated=b.create(A,this,!0)}return this.negated}}class b{constructor(A,G){this.expr=A,this.negated=G,this.type=9}static create(A,G,W){return b._normalizeArr(A,G,W)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.lengthA.expr.length)return 1;for(let G=0,W=this.expr.length;GA.serialize()).join(" || ")}keys(){const A=[];for(let G of this.expr)A.push(...G.keys());return A}negate(){if(!this.negated){let A=[];for(let G of this.expr)A.push(G.negate());for(;A.length>1;){const G=A.shift(),W=A.shift(),O=[];for(const te of j(G))for(const ae of j(W))O.push(v.create([te,ae],null));const V=A.length===0;A.unshift(b.create(O,null,V))}this.negated=A[0]}return this.negated}}class g extends m{constructor(A,G,W){super(A,null);this._defaultValue=G,typeof W=="object"?g._info.push(Object.assign(Object.assign({},W),{key:A})):W!==!0&&g._info.push({key:A,description:W,type:G!=null?typeof G:void 0})}static all(){return g._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return d.create(this.key,A)}}g._info=[];const f=Object(M.c)("contextKeyService"),C="setContext";function E(A,G){return AG?1:0}function y(A,G,W,O){return AW?1:GO?1:0}function U(A,G){if(G.type===6&&A.type!==9&&A.type!==6){for(const V of G.expr)if(A.equals(V))return!0}const W=A.negate(),O=j(W).concat(j(G));O.sort(n);for(let V=0;V=0;u--)if(this.__items[u].match(d))return!0;return!1},P.prototype.set_indent=function(d,u){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(d){this.__items.push(d);var u=d.lastIndexOf(` `);u!==-1?this.__character_count=d.length-u:this.__character_count+=d.length},P.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function p(d,u){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),u=u||"",d.indent_level>0&&(u=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}p.prototype.get_indent_size=function(d,u){var o=this.__base_string_length;return u=u||0,d<0&&(o=0),o+=d*this.__indent_size,o+=u,o},p.prototype.get_indent_string=function(d,u){var o=this.__base_string;return u=u||0,d<0&&(d=0,o=""),u+=d*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},p.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var d=this.__cache.length,u=0,o="";this.__indent_size&&d>=this.__indent_size&&(u=Math.floor(d/this.__indent_size),d-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),d&&(o+=new Array(d+1).join(" ")),this.__cache.push(o)};function m(d,u){this.__indent_cache=new p(d,u),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(d,u){return this.__indent_cache.get_indent_string(d,u)},m.prototype.get_indent_size=function(d,u){return this.__indent_cache.get_indent_size(d,u)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(d){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return d!==` `&&(o=o.replace(/[\n]/g,d)),o},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(d,u){return d=d||0,u=u||0,this.next_line.set_indent(d,u),this.__lines.length>1?(this.current_line.set_indent(d,u),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(d){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(d,u){for(var o=this.__lines.length-2;o>=0;){var h=this.__lines[o];if(h.is_empty())break;if(h.item(0).indexOf(d)!==0&&h.item(-1)!==u){this.__lines.splice(o+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=m},,,,function(n){function P(d,u){this.raw_options=p(d,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}P.prototype._get_array=function(d,u){var o=this.raw_options[d],h=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(h=o.concat()):typeof o=="string"&&(h=o.split(/[^a-zA-Z0-9_\/\-]+/)),h},P.prototype._get_boolean=function(d,u){var o=this.raw_options[d],h=o===void 0?!!u:!!o;return h},P.prototype._get_characters=function(d,u){var o=this.raw_options[d],h=u||"";return typeof o=="string"&&(h=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),h},P.prototype._get_number=function(d,u){var o=this.raw_options[d];u=parseInt(u,10),isNaN(u)&&(u=0);var h=parseInt(o,10);return isNaN(h)&&(h=u),h},P.prototype._get_selection=function(d,u,o){var h=this._get_selection_list(d,u,o);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values: `+u+` You passed in: '`+this.raw_options[d]+"'");return h[0]},P.prototype._get_selection_list=function(d,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var h=this._get_array(d,o);if(!this._is_valid_selection(h,u))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values: `+u+` You passed in: '`+this.raw_options[d]+"'");return h},P.prototype._is_valid_selection=function(d,u){return d.length&&u.length&&!d.some(function(o){return u.indexOf(o)===-1})};function p(d,u){var o={};d=m(d);var h;for(h in d)h!==u&&(o[h]=d[h]);if(u&&d[u])for(h in d[u])o[h]=d[u][h];return o}function m(d){var u={},o;for(o in d){var h=o.replace(/-/g,"_");u[h]=d[o]}return u}n.exports.Options=P,n.exports.normalizeOpts=m,n.exports.mergeOpts=p},,function(n){var P=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&m=0&&d=m.length&&this.__input.substring(d-m.length,d).toLowerCase()===m},n.exports.InputScanner=p},,,,,function(n){function P(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}P.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(p);d;)m[d[1]]=d[2],d=this.__directive_pattern.exec(p);return m},P.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=P},,function(n,P,p){var m=p(16).Beautifier,d=p(17).Options;function u(o,h){var r=new m(o,h);return r.beautify()}n.exports=u,n.exports.defaultOptions=function(){return new d}},function(n,P,p){var m=p(17).Options,d=p(2).Output,u=p(8).InputScanner,o=p(13).Directives,h=new o(/\/\*/,/\*\//),r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,i=/\s/,s=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,x=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(R,w){this._source_text=R||"",this._options=new m(w),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(R){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return w},T.prototype.eatWhitespace=function(R){for(var w=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===` `&&((v===0||v0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,w=this._options.eol;w==="auto"&&(w=` `,R&&r.test(R||"")&&(w=R.match(r)[0])),R=R.replace(a,` `);var v=R.match(/^[\t ]*/)[0];this._output=new d(this._options,v),this._input=new u(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,g=!1,f=!1,C=!1,E=!1,y=!1,U=!1,j=this._ch,A=!1,G,W,O;G=this._input.read(s),W=G!=="",O=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(S),te=h.get_directives(V);te&&te.ignore==="start"&&(V+=h.readIgnored(this._input)),this.print_string(V),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(x)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(W),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?E=!0:ae==="import"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!g&&b===0&&ae.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(W),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,g=this._indentLevel>=this._nestedLevel):g=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&g&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(O==="("?this._output.space_before_token=!1:O!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),O==="{"&&this._output.trim(!0),y=!1,E=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),g=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me"||this._ch==="+"||this._ch==="~")&&!f&&b===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(W),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ce=O==='"'||O==="'";this.preserveSingleSpace(Ce||W),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&A&&this._output.add_new_line()}var Pe=this._output.get_code(w);return Pe},n.exports.Beautifier=T},function(n,P,p){var m=p(6).Options;function d(u){m.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r` ${p} `).trim():""}class H{constructor(n,P,p){this.id=n,this.definition=P,this.description=p,M.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const P=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function p(u){if(u instanceof H)return["codicon","codicon-"+u.id];const o=P.exec(u.id);if(!o)return p(H.error);let[,h,r]=o;const a=["codicon","codicon-"+h];return r&&a.push("codicon-modifier-"+r.substr(1)),a}n.asClassNameArray=p;function m(u){return p(u).join(" ")}n.asClassName=m;function d(u){return"."+p(u).join(".")}n.asCSSSelector=d})(N||(N={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(H||(H={}))},"VrN/":function(je,ce,D){(function(Z,z){je.exports=z()})(this,function(){"use strict";var Z=navigator.userAgent,z=navigator.platform,M=/gecko\/\d/i.test(Z),X=/MSIE \d/.test(Z),F=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),I=/Edge\/(\d+)/.exec(Z),H=X||F||I,N=H&&(X?document.documentMode||6:+(I||F)[1]),n=!I&&/WebKit\//.test(Z),P=n&&/Qt\/\d+\.\d+/.test(Z),p=!I&&/Chrome\//.test(Z),m=/Opera\//.test(Z),d=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),o=/PhantomJS/.test(Z),h=!I&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),r=/Android/.test(Z),a=h||r||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),i=h||/Mac/.test(z),s=/\bCrOS\b/.test(Z),S=/win/i.test(z),x=m&&Z.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(m=!1,n=!0);var T=i&&(P||m&&(x==null||x<12.11)),R=M||H&&N>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var c=e.className,l=w(t).exec(c);if(l){var _=c.slice(l.index+l[0].length);e.className=c.slice(0,l.index)+(_?l[1]+_:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function g(e,t){return b(e).appendChild(t)}function f(e,t,c,l){var _=document.createElement(e);if(c&&(_.className=c),l&&(_.style.cssText=l),typeof t=="string")_.appendChild(document.createTextNode(t));else if(t)for(var K=0;K=t)return ee+(t-K);ee+=ie-K,ee+=c-ee%c,K=ie+1}}var te=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};te.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},te.prototype.set=function(e,t){this.f=t;var c=+new Date+e;(!this.id||c=t)return l+Math.min(ee,t-_);if(_+=K-l,_+=c-_%c,l=K+1,_>=t)return l}}var Ee=[""];function be(e){for(;Ee.length<=e;)Ee.push(Ke(Ee)+" ");return Ee[e]}function Ke(e){return e[e.length-1]}function bt(e,t){for(var c=[],l=0;l"\x80"&&(e.toUpperCase()!=e.toLowerCase()||st.test(e))}function wt(e,t){return t?t.source.indexOf("\\w")>-1&&ht(e)?!0:t.test(e):ht(e)}function _e(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Me=/[\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 ye(e){return e.charCodeAt(0)>=768&&Me.test(e)}function Se(e,t,c){for(;(c<0?t>0:tc?-1:1;;){if(t==c)return t;var _=(t+c)/2,K=l<0?Math.ceil(_):Math.floor(_);if(K==t)return e(K)?t:c;e(K)?c=K:t=K+l}}function Ze(e,t,c,l){if(!e)return l(t,c,"ltr",0);for(var _=!1,K=0;Kt||t==c&&ee.to==t)&&(l(Math.max(ee.from,t),Math.min(ee.to,c),ee.level==1?"rtl":"ltr",K),_=!0)}_||l(t,c,"ltr")}var ot=null;function ft(e,t,c){var l;ot=null;for(var _=0;_t)return _;K.to==t&&(K.from!=K.to&&c=="before"?l=_:ot=_),K.from==t&&(K.from!=K.to&&c!="before"?l=_:ot=_)}return l!=null?l:ot}var Ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function c(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?t.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,_=/[stwN]/,K=/[LRr]/,ee=/[Lb1n]/,ie=/[1n]/;function oe(he,Ie,Fe){this.level=he,this.from=Ie,this.to=Fe}return function(he,Ie){var Fe=Ie=="ltr"?"L":"R";if(he.length==0||Ie=="ltr"&&!l.test(he))return!1;for(var Qe=he.length,$e=[],Tt=0;Tt-1&&(l[t]=_.slice(0,K).concat(_.slice(K+1)))}}}function Ge(e,t){var c=at(e,t);if(!c.length)return;for(var l=Array.prototype.slice.call(arguments,2),_=0;_0}function xe(e){e.prototype.on=function(t,c){ke(this,t,c)},e.prototype.off=function(t,c){ct(this,t,c)}}function ue(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function we(e){ue(e),fe(e)}function Le(e){return e.target||e.srcElement}function ze(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var dt=function(){if(H&&N<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Lt;function Ft(e){if(Lt==null){var t=f("span","\u200B");g(e,f("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&N<8))}var c=Lt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}var kt;function St(e){if(kt!=null)return kt;var t=g(e,document.createTextNode("A\u062EA")),c=E(t,0,1).getBoundingClientRect(),l=E(t,1,2).getBoundingClientRect();return b(e),!c||c.left==c.right?!1:kt=l.right-c.right<3}var qe=` b`.split(/\n/).length!=3?function(e){for(var t=0,c=[],l=e.length;t<=l;){var _=e.indexOf(` `,t);_==-1&&(_=e.length);var K=e.slice(t,e.charAt(_-1)=="\r"?_-1:_),ee=K.indexOf("\r");ee!=-1?(c.push(K.slice(0,ee)),t+=ee+1):(c.push(K),t=_+1)}return c}:function(e){return e.split(/\r\n?|\n/)},rt=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(c){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Ye=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pe=null;function Te(e){if(pe!=null)return pe;var t=g(e,f("span","x")),c=t.getBoundingClientRect(),l=E(t,0,1).getBoundingClientRect();return pe=Math.abs(c.left-l.left)>1}var nt={},Xe={};function Pt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),nt[e]=t}function Mt(e,t){Xe[e]=t}function Ve(e){if(typeof e=="string"&&Xe.hasOwnProperty(e))e=Xe[e];else if(e&&typeof e.name=="string"&&Xe.hasOwnProperty(e.name)){var t=Xe[e.name];typeof t=="string"&&(t={name:t}),e=pt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gt(e,t){t=Ve(t);var c=nt[t.name];if(!c)return gt(e,"text/plain");var l=c(e,t);if(It.hasOwnProperty(t.name)){var _=It[t.name];for(var K in _){if(!_.hasOwnProperty(K))continue;l.hasOwnProperty(K)&&(l["_"+K]=l[K]),l[K]=_[K]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var ee in t.modeProps)l[ee]=t.modeProps[ee];return l}var It={};function Zt(e,t){var c=It.hasOwnProperty(e)?It[e]:It[e]={};O(t,c)}function le(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var c={};for(var l in t){var _=t[l];_ instanceof Array&&(_=_.concat([])),c[l]=_}return c}function re(e,t){for(var c;e.innerMode&&!(c=e.innerMode(t),!c||c.mode==e);)t=c.state,e=c.mode;return c||{mode:e,state:t}}function B(e,t,c){return e.startState?e.startState(t,c):!0}var $=function(e,t,c){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=c};$.prototype.eol=function(){return this.pos>=this.string.length},$.prototype.sol=function(){return this.pos==this.lineStart},$.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$.prototype.next=function(){if(this.post},$.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$.prototype.skipToEnd=function(){this.pos=this.string.length},$.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$.prototype.backUp=function(e){this.pos-=e},$.prototype.column=function(){return this.lastColumnPos0?null:(K&&t!==!1&&(this.pos+=K[0].length),K)}},$.prototype.current=function(){return this.string.slice(this.start,this.pos)},$.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function J(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 c=e;!c.lines;)for(var l=0;;++l){var _=c.children[l],K=_.chunkSize();if(t=e.first&&tc?tt(c,J(e,c).text.length):k(t,J(e,t.line).text.length)}function k(e,t){var c=e.ch;return c==null||c>t?tt(e.line,t):c<0?tt(e.line,0):e}function Y(e,t){for(var c=[],l=0;lthis.maxLookAhead&&(this.maxLookAhead=e),t},q.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},q.fromSaved=function(e,t,c){return t instanceof se?new q(e,le(e.mode,t.state),c,t.lookAhead):new q(e,le(e.mode,t),c)},q.prototype.save=function(e){var t=e!==!1?le(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new se(t,this.maxLookAhead):t};function De(e,t,c,l){var _=[e.state.modeGen],K={};ri(e,t.text,e.doc.mode,c,function(he,Ie){return _.push(he,Ie)},K,l);for(var ee=c.state,ie=function(he){c.baseTokens=_;var Ie=e.state.overlays[he],Fe=1,Qe=0;c.state=!0,ri(e,t.text,Ie.mode,c,function($e,Tt){for(var Ut=Fe;Qe<$e;){var Ht=_[Fe];Ht>$e&&_.splice(Fe,1,$e,_[Fe+1],Ht),Fe+=2,Qe=Math.min($e,Ht)}if(!Tt)return;if(Ie.opaque)_.splice(Ut,Fe-Ut,$e,"overlay "+Tt),Fe=Ut+2;else for(;Ute.options.maxHighlightLength&&le(e.doc.mode,l.state),K=De(e,t,l);_&&(l.state=_),t.stateAfter=l.save(!_),t.styles=K.styles,K.classes?t.styleClasses=K.classes:t.styleClasses&&(t.styleClasses=null),c===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Nt(e,t,c){var l=e.doc,_=e.display;if(!l.mode.startState)return new q(l,!0,t);var K=Nn(e,t,c),ee=K>l.first&&J(l,K-1).stateAfter,ie=ee?q.fromSaved(l,ee,K):new q(l,B(l.mode),K);return l.iter(K,t,function(oe){Qt(e,oe.text,ie);var he=ie.line;oe.stateAfter=he==t-1||he%5==0||he>=_.viewFrom&&he<_.viewTo?ie.save():null,ie.nextLine()}),c&&(l.modeFrontier=ie.line),ie}function Qt(e,t,c,l){var _=e.doc.mode,K=new $(t,e.options.tabSize,c);for(K.start=K.pos=l||0,t==""&&ut(_,c.state);!K.eol();)en(_,K,c.state),K.start=K.pos}function ut(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var c=re(e,t);if(c.mode.blankLine)return c.mode.blankLine(c.state)}function en(e,t,c,l){for(var _=0;_<10;_++){l&&(l[0]=re(e,c).mode);var K=e.token(t,c);if(t.pos>t.start)return K}throw new Error("Mode "+e.name+" failed to advance stream.")}var gn=function(e,t,c){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=c};function Yn(e,t,c,l){var _=e.doc,K=_.mode,ee;t=L(_,t);var ie=J(_,t.line),oe=Nt(e,t.line,c),he=new $(ie.text,e.options.tabSize,oe),Ie;for(l&&(Ie=[]);(l||he.pose.options.maxHighlightLength?(ie=!1,ee&&Qt(e,t,l,Ie.pos),Ie.pos=t.length,Fe=null):Fe=mi(en(c,Ie,l.state,Qe),K),Qe){var $e=Qe[0].name;$e&&(Fe="m-"+(Fe?$e+" "+Fe:$e))}if(!ie||he!=Fe){for(;oeee;--ie){if(ie<=K.first)return K.first;var oe=J(K,ie-1),he=oe.stateAfter;if(he&&(!c||ie+(he instanceof se?he.lookAhead:0)<=K.modeFrontier))return ie;var Ie=V(oe.text,null,e.options.tabSize);(_==null||l>Ie)&&(_=ie-1,l=Ie)}return _}function Gi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierc;l--){var _=J(e,l).stateAfter;if(_&&(!(_ instanceof se)||l+_.lookAhead=t:K.to>t);(l||(l=[])).push(new Mi(ee,K.from,oe?null:K.to))}}return l}function lr(e,t,c){var l;if(e)for(var _=0;_=t:K.to>t);if(ie||K.from==t&&ee.type=="bookmark"&&(!c||K.marker.insertLeft)){var oe=K.from==null||(ee.inclusiveLeft?K.from<=t:K.from0&&ie)for(var cn=0;cn0)continue;var Ie=[oe,1],Fe=Dt(he.from,ie.from),Qe=Dt(he.to,ie.to);(Fe<0||!ee.inclusiveLeft&&!Fe)&&Ie.push({from:he.from,to:ie.from}),(Qe>0||!ee.inclusiveRight&&!Qe)&&Ie.push({from:ie.to,to:he.to}),_.splice.apply(_,Ie),oe+=Ie.length-3}return _}function Mr(e){var t=e.markedSpans;if(!t)return;for(var c=0;ct)&&(!l||xi(l,K.marker)<0)&&(l=K.marker)}return l}function ki(e,t,c,l,_){var K=J(e,t),ee=ni&&K.markedSpans;if(ee)for(var ie=0;ie=0&&Fe<=0||Ie<=0&&Fe>=0)continue;if(Ie<=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?Dt(he.to,c)>=0:Dt(he.to,c)>0)||Ie>=0&&(oe.marker.inclusiveRight&&_.inclusiveLeft?Dt(he.from,l)<=0:Dt(he.from,l)<0))return!0}}function Xi(e){for(var t;t=Si(e);)e=t.find(-1,!0).line;return e}function cr(e){for(var t;t=ai(e);)e=t.find(1,!0).line;return e}function gr(e){for(var t,c;t=ai(e);)e=t.find(1,!0).line,(c||(c=[])).push(e);return c}function Hr(e,t){var c=J(e,t),l=Xi(c);return c==l?t:We(l)}function kr(e,t){if(t>e.lastLine())return t;var c=J(e,t),l;if(!wr(e,c))return t;for(;l=ai(c);)c=l.find(1,!0).line;return We(c)+1}function wr(e,t){var c=ni&&t.markedSpans;if(c)for(var l=void 0,_=0;_t.maxLineLength&&(t.maxLineLength=_,t.maxLine=l)})}var fr=function(e,t,c){this.text=e,Li(this,t),this.height=c?c(this):1};fr.prototype.lineNo=function(){return We(this)},xe(fr);function Qr(e,t,c,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Mr(e),Li(e,c);var _=l?l(e):1;_!=e.height&&Ue(e,_)}function pn(e){e.parent=null,Mr(e)}var Cn={},yn={};function jn(e,t){if(!e||/^\s*$/.test(e))return null;var c=t.addModeClass?yn:Cn;return c[e]||(c[e]=e.replace(/\S+/g,"cm-$&"))}function Qn(e,t){var c=C("span",null,null,n?"padding-right: .1px":null),l={pre:C("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var _=0;_<=(t.rest?t.rest.length:0);_++){var K=_?t.rest[_-1]:t.line,ee=void 0;l.pos=0,l.addToken=Bn,St(e.display.measure)&&(ee=Ot(K,e.doc.direction))&&(l.addToken=Yi(l.addToken,ee)),l.map=[];var ie=t!=e.display.externalMeasured&&We(K);yr(K,l,lt(e,K,ie)),K.styleClasses&&(K.styleClasses.bgClass&&(l.bgClass=A(K.styleClasses.bgClass,l.bgClass||"")),K.styleClasses.textClass&&(l.textClass=A(K.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Ft(e.display.measure))),_==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Ge(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function un(e){var t=f("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bn(e,t,c,l,_,K,ee){if(!t)return;var ie=e.splitSpaces?Oi(t,e.trailingSpace):t,oe=e.cm.state.specialChars,he=!1,Ie;if(!oe.test(t))e.col+=t.length,Ie=document.createTextNode(ie),e.map.push(e.pos,e.pos+t.length,Ie),H&&N<9&&(he=!0),e.pos+=t.length;else{Ie=document.createDocumentFragment();for(var Fe=0;;){oe.lastIndex=Fe;var Qe=oe.exec(t),$e=Qe?Qe.index-Fe:t.length-Fe;if($e){var Tt=document.createTextNode(ie.slice(Fe,Fe+$e));H&&N<9?Ie.appendChild(f("span",[Tt])):Ie.appendChild(Tt),e.map.push(e.pos,e.pos+$e,Tt),e.col+=$e,e.pos+=$e}if(!Qe)break;Fe+=$e+1;var Ut=void 0;if(Qe[0]==" "){var Ht=e.cm.options.tabSize,$t=Ht-e.col%Ht;Ut=Ie.appendChild(f("span",be($t),"cm-tab")),Ut.setAttribute("role","presentation"),Ut.setAttribute("cm-text"," "),e.col+=$t}else Qe[0]=="\r"||Qe[0]==` `?(Ut=Ie.appendChild(f("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ut.setAttribute("cm-text",Qe[0]),e.col+=1):(Ut=e.cm.options.specialCharPlaceholder(Qe[0]),Ut.setAttribute("cm-text",Qe[0]),H&&N<9?Ie.appendChild(f("span",[Ut])):Ie.appendChild(Ut),e.col+=1);e.map.push(e.pos,e.pos+1,Ut),e.pos++}}if(e.trailingSpace=ie.charCodeAt(t.length-1)==32,c||l||_||he||K||ee){var sn=c||"";l&&(sn+=l),_&&(sn+=_);var Jt=f("span",[Ie],sn,K);if(ee)for(var cn in ee)ee.hasOwnProperty(cn)&&cn!="style"&&cn!="class"&&Jt.setAttribute(cn,ee[cn]);return e.content.appendChild(Jt)}e.content.appendChild(Ie)}function Oi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var c=t,l="",_=0;_he&&Fe.from<=he);Qe++);if(Fe.to>=Ie)return e(c,l,_,K,ee,ie,oe);e(c,l.slice(0,Fe.to-he),_,K,null,ie,oe),K=null,l=l.slice(Fe.to-he),he=Fe.to}}}function Vn(e,t,c,l){var _=!l&&c.widgetNode;_&&e.map.push(e.pos,e.pos+t,_),!l&&e.cm.display.input.needsContentAttribute&&(_||(_=e.content.appendChild(document.createElement("span"))),_.setAttribute("cm-marker",c.id)),_&&(e.cm.display.input.setUneditable(_),e.content.appendChild(_)),e.pos+=t,e.trailingSpace=!1}function yr(e,t,c){var l=e.markedSpans,_=e.text,K=0;if(!l){for(var ee=1;eeoe||Jn.collapsed&&En.to==oe&&En.from==oe)){if(En.to!=null&&En.to!=oe&&$e>En.to&&($e=En.to,Ut=""),Jn.className&&(Tt+=" "+Jn.className),Jn.css&&(Qe=(Qe?Qe+";":"")+Jn.css),Jn.startStyle&&En.from==oe&&(Ht+=" "+Jn.startStyle),Jn.endStyle&&En.to==$e&&(cn||(cn=[])).push(Jn.endStyle,En.to),Jn.title&&((sn||(sn={})).title=Jn.title),Jn.attributes)for(var Ti in Jn.attributes)(sn||(sn={}))[Ti]=Jn.attributes[Ti];Jn.collapsed&&(!$t||xi($t.marker,Jn)<0)&&($t=En)}else En.from>oe&&$e>En.from&&($e=En.from)}if(cn)for(var ir=0;ir=ie)break;for(var Pr=Math.min(ie,$e);;){if(Ie){var Er=oe+Ie.length;if(!$t){var Hi=Er>Pr?Ie.slice(0,Pr-oe):Ie;t.addToken(t,Hi,Fe?Fe+Tt:Tt,Ht,oe+Hi.length==$e?Ut:"",Qe,sn)}if(Er>=Pr){Ie=Ie.slice(Pr-oe),oe=Pr;break}oe=Er,Ht=""}Ie=_.slice(K,K=c[he++]),Fe=jn(c[he++],t.cm.options)}}}function oi(e,t,c){this.line=t,this.rest=gr(t),this.size=this.rest?We(Ke(this.rest))-c+1:1,this.node=this.text=null,this.hidden=wr(e,t)}function Je(e,t,c){for(var l=[],_,K=t;K2&&K.push((oe.bottom+he.top)/2-c.top)}}K.push(c.bottom-c.top)}}function Tn(e,t,c){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;lc)return{map:e.measure.maps[_],cache:e.measure.caches[_],before:!0}}function li(e,t){t=Xi(t);var c=We(t),l=e.display.externalMeasured=new oi(e.doc,t,c);l.lineN=c;var _=l.built=Qn(e,l);return l.text=_.pre,g(e.display.lineMeasure,_.pre),l}function yi(e,t,c,l){return In(e,ti(e,t),c,l)}function ci(e,t){if(t>=e.display.viewFrom&&t=c.lineN&&tt)&&(K=oe-ie,_=K-1,t>=oe&&(ee="right")),_!=null){if(l=e[he+2],ie==oe&&c==(l.insertLeft?"left":"right")&&(ee=c),c=="left"&&_==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)l=e[(he-=3)+2],ee="left";if(c=="right"&&_==oe-ie)for(;he=0&&!((c=e[_]).left!=c.right);_--);return c}function Xt(e,t,c,l){var _=On(t.map,c,l),K=_.node,ee=_.start,ie=_.end,oe=_.collapse,he;if(K.nodeType==3){for(var Ie=0;Ie<4;Ie++){for(;ee&&ye(t.line.text.charAt(_.coverStart+ee));)--ee;for(;_.coverStart+ie<_.coverEnd&&ye(t.line.text.charAt(_.coverStart+ie));)++ie;if(H&&N<9&&ee==0&&ie==_.coverEnd-_.coverStart?he=K.parentNode.getBoundingClientRect():he=Gt(E(K,ee,ie).getClientRects(),l),he.left||he.right||ee==0)break;ie=ee,ee=ee-1,oe="right"}H&&N<11&&(he=on(e.display.measure,he))}else{ee>0&&(oe=l="right");var Fe;e.options.lineWrapping&&(Fe=K.getClientRects()).length>1?he=Fe[l=="right"?Fe.length-1:0]:he=K.getBoundingClientRect()}if(H&&N<9&&!ee&&(!he||!he.left&&!he.right)){var Qe=K.parentNode.getClientRects()[0];Qe?he={left:Qe.left,right:Qe.left+Xn(e.display),top:Qe.top,bottom:Qe.bottom}:he=_n}for(var $e=he.top-t.rect.top,Tt=he.bottom-t.rect.top,Ut=($e+Tt)/2,Ht=t.view.measure.heights,$t=0;$t=l.text.length?(oe=l.text.length,he="before"):oe<=0&&(oe=0,he="after"),!ie)return ee(he=="before"?oe-1:oe,he=="before");function Ie(Tt,Ut,Ht){var $t=ie[Ut],sn=$t.level==1;return ee(Ht?Tt-1:Tt,sn!=Ht)}var Fe=ft(ie,oe,he),Qe=ot,$e=Ie(oe,Fe,he=="before");return Qe!=null&&($e.other=Ie(oe,Qe,he!="before")),$e}function Or(e,t){var c=0;t=L(e.doc,t),e.options.lineWrapping||(c=Xn(e.display)*t.ch);var l=J(e.doc,t.line),_=vr(l)+gi(e.display);return{left:c,right:c,top:_,bottom:_+l.height}}function Nr(e,t,c,l,_){var K=tt(e,t,c);return K.xRel=_,l&&(K.outside=l),K}function Kr(e,t,c){var l=e.doc;if(c+=e.display.viewOffset,c<0)return Nr(l.first,0,null,-1,-1);var _=_t(l,c),K=l.first+l.size-1;if(_>K)return Nr(l.first+l.size-1,J(l,K).text.length,null,1,1);t<0&&(t=0);for(var ee=J(l,_);;){var ie=ta(e,ee,_,t,c),oe=Tr(ee,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!oe)return ie;var he=oe.find(1);if(he.line==_)return he;ee=J(l,_=he.line)}}function Ur(e,t,c,l){l-=Ri(t);var _=t.text.length,K=Be(function(ee){return In(e,c,ee-1).bottom<=l},_,0);return _=Be(function(ee){return In(e,c,ee).top>l},K,_),{begin:K,end:_}}function ca(e,t,c,l){c||(c=ti(e,t));var _=er(e,t,In(e,c,l),"line").top;return Ur(e,t,c,_)}function _r(e,t,c,l){return e.bottom<=c?!1:e.top>c?!0:(l?e.left:e.right)>t}function ta(e,t,c,l,_){_-=vr(t);var K=ti(e,t),ee=Ri(t),ie=0,oe=t.text.length,he=!0,Ie=Ot(t,e.doc.direction);if(Ie){var Fe=(e.options.lineWrapping?fi:Da)(e,t,c,K,Ie,l,_);he=Fe.level!=1,ie=he?Fe.from:Fe.to-1,oe=he?Fe.to:Fe.from-1}var Qe=null,$e=null,Tt=Be(function(Rn){var En=In(e,K,Rn);return En.top+=ee,En.bottom+=ee,_r(En,l,_,!1)?(En.top<=_&&En.left<=l&&(Qe=Rn,$e=En),!0):!1},ie,oe),Ut,Ht,$t=!1;if($e){var sn=l-$e.left<$e.right-l,Jt=sn==he;Tt=Qe+(Jt?0:1),Ht=Jt?"after":"before",Ut=sn?$e.left:$e.right}else{!he&&(Tt==oe||Tt==ie)&&Tt++,Ht=Tt==0?"after":Tt==t.text.length?"before":In(e,K,Tt-(he?1:0)).bottom+ee<=_==he?"after":"before";var cn=ui(e,tt(c,Tt,Ht),"line",t,K);Ut=cn.left,$t=_=cn.bottom?1:0}return Tt=Se(t.text,Tt,1),Nr(c,Tt,Ht,$t,l-Ut)}function Da(e,t,c,l,_,K,ee){var ie=Be(function(Fe){var Qe=_[Fe],$e=Qe.level!=1;return _r(ui(e,tt(c,$e?Qe.to:Qe.from,$e?"before":"after"),"line",t,l),K,ee,!0)},0,_.length-1),oe=_[ie];if(ie>0){var he=oe.level!=1,Ie=ui(e,tt(c,he?oe.from:oe.to,he?"after":"before"),"line",t,l);_r(Ie,K,ee,!0)&&Ie.top>ee&&(oe=_[ie-1])}return oe}function fi(e,t,c,l,_,K,ee){var ie=Ur(e,t,l,ee),oe=ie.begin,he=ie.end;/\s/.test(t.text.charAt(he-1))&&he--;for(var Ie=null,Fe=null,Qe=0;Qe<_.length;Qe++){var $e=_[Qe];if($e.from>=he||$e.to<=oe)continue;var Tt=$e.level!=1,Ut=In(e,l,Tt?Math.min(he,$e.to)-1:Math.max(oe,$e.from)).right,Ht=UtHt)&&(Ie=$e,Fe=Ht)}return Ie||(Ie=_[_.length-1]),Ie.fromhe&&(Ie={from:Ie.from,to:he,level:Ie.level}),Ie}var xn;function Gn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xn==null){xn=f("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xn.appendChild(document.createTextNode("x")),xn.appendChild(f("br"));xn.appendChild(document.createTextNode("x"))}g(e.measure,xn);var c=xn.offsetHeight/50;return c>3&&(e.cachedTextHeight=c),b(e.measure),c||1}function Xn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=f("span","xxxxxxxxxx"),c=f("pre",[t],"CodeMirror-line-like");g(e.measure,c);var l=t.getBoundingClientRect(),_=(l.right-l.left)/10;return _>2&&(e.cachedCharWidth=_),_||10}function Ni(e){for(var t=e.display,c={},l={},_=t.gutters.clientLeft,K=t.gutters.firstChild,ee=0;K;K=K.nextSibling,++ee){var ie=e.display.gutterSpecs[ee].className;c[ie]=K.offsetLeft+K.clientLeft+_,l[ie]=K.clientWidth}return{fixedPos:zn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:c,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function zn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(e){var t=Gn(e.display),c=e.options.lineWrapping,l=c&&Math.max(5,e.display.scroller.clientWidth/Xn(e.display)-3);return function(_){if(wr(e.doc,_))return 0;var K=0;if(_.widgets)for(var ee=0;ee<_.widgets.length;ee++)_.widgets[ee].height&&(K+=_.widgets[ee].height);return c?K+(Math.ceil(_.text.length/l)||1)*t:K+t}}function Br(e){var t=e.doc,c=Rr(e);t.iter(function(l){var _=c(l);_!=l.height&&Ue(l,_)})}function $i(e,t,c,l){var _=e.display;if(!c&&Le(t).getAttribute("cm-not-content")=="true")return null;var K,ee,ie=_.lineSpace.getBoundingClientRect();try{K=t.clientX-ie.left,ee=t.clientY-ie.top}catch(Fe){return null}var oe=Kr(e,K,ee),he;if(l&&oe.xRel>0&&(he=J(e.doc,oe.line).text).length==oe.ch){var Ie=V(he,he.length,e.options.tabSize)-he.length;oe=tt(oe.line,Math.max(0,Math.round((K-si(e.display).left)/Xn(e.display))-Ie))}return oe}function Ar(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var c=e.display.view,l=0;lt)&&(_.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=_.viewTo)ni&&Hr(e.doc,t)<_.viewTo&&Dn(e);else if(c<=_.viewFrom)ni&&kr(e.doc,c+l)>_.viewFrom?Dn(e):(_.viewFrom+=l,_.viewTo+=l);else if(t<=_.viewFrom&&c>=_.viewTo)Dn(e);else if(t<=_.viewFrom){var K=wn(e,c,c+l,1);K?(_.view=_.view.slice(K.index),_.viewFrom=K.lineN,_.viewTo+=l):Dn(e)}else if(c>=_.viewTo){var ee=wn(e,t,t,-1);ee?(_.view=_.view.slice(0,ee.index),_.viewTo=ee.lineN):Dn(e)}else{var ie=wn(e,t,t,-1),oe=wn(e,c,c+l,1);ie&&oe?(_.view=_.view.slice(0,ie.index).concat(Je(e,ie.lineN,oe.lineN)).concat(_.view.slice(oe.index)),_.viewTo+=l):Dn(e)}var he=_.externalMeasured;he&&(c=_.lineN&&t<_.lineN+_.size&&(l.externalMeasured=null),t=l.viewTo)return;var K=l.view[Ar(e,t)];if(K.node==null)return;var ee=K.changes||(K.changes=[]);ae(ee,c)==-1&&ee.push(c)}function Dn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function wn(e,t,c,l){var _=Ar(e,t),K,ee=e.display.view;if(!ni||c==e.doc.first+e.doc.size)return{index:_,lineN:c};for(var ie=e.display.viewFrom,oe=0;oe<_;oe++)ie+=ee[oe].size;if(ie!=t){if(l>0){if(_==ee.length-1)return null;K=ie+ee[_].size-t,_++}else K=ie-t;t+=K,c+=K}for(;Hr(e.doc,c)!=c;){if(_==(l<0?0:ee.length-1))return null;c+=l*ee[_-(l<0?1:0)].size,_+=l}return{index:_,lineN:c}}function $n(e,t,c){var l=e.display,_=l.view;_.length==0||t>=l.viewTo||c<=l.viewFrom?(l.view=Je(e,t,c),l.viewFrom=t):(l.viewFrom>t?l.view=Je(e,t,l.viewFrom).concat(l.view):l.viewFromc&&(l.view=l.view.slice(0,Ar(e,c)))),l.viewTo=c}function rn(e){for(var t=e.display.view,c=0,l=0;l=e.display.viewTo||ie.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Lr(e),t.cursorDiv.style.visibility=(c=!c)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function na(e){e.state.focused||(e.display.input.focus(),Wr(e))}function ya(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Lr(e))},100)}function Wr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ge(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(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bn(e)}function Lr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ge(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ir(e){for(var t=e.display,c=t.lineDiv.offsetTop,l=0;l.005||Ie<-.005)&&(Ue(_.line,ee),Zr(_.line),_.rest))for(var Fe=0;Fe<_.rest.length;Fe++)Zr(_.rest[Fe]);if(ie>e.display.sizerWidth){var Qe=Math.ceil(ie/Xn(e.display));Qe>e.display.maxLineLength&&(e.display.maxLineLength=Qe,e.display.maxLine=_.line,e.display.maxLineChanged=!0)}}}function Zr(e){if(e.widgets)for(var t=0;t=ee&&(K=_t(t,vr(J(t,oe))-e.wrapper.clientHeight),ee=oe)}return{from:K,to:Math.max(ee,K+1)}}function ia(e,t){if(et(e,"scrollCursorIntoView"))return;var c=e.display,l=c.sizer.getBoundingClientRect(),_=null;if(t.top+l.top<0?_=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(_=!1),_!=null&&!o){var K=f("div","\u200B",null,`position: absolute; top: `+(t.top-c.viewOffset-gi(e.display))+`px; height: `+(t.bottom-t.top+kn(e)+c.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(K),K.scrollIntoView(_),e.display.lineSpace.removeChild(K)}}function ms(e,t,c,l){l==null&&(l=0);var _;!e.options.lineWrapping&&t==c&&(t=t.ch?tt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,c=t.sticky=="before"?tt(t.line,t.ch+1,"before"):t);for(var K=0;K<5;K++){var ee=!1,ie=ui(e,t),oe=!c||c==t?ie:ui(e,c);_={left:Math.min(ie.left,oe.left),top:Math.min(ie.top,oe.top)-l,right:Math.max(ie.left,oe.left),bottom:Math.max(ie.bottom,oe.bottom)+l};var he=gs(e,_),Ie=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(he.scrollTop!=null&&(Ma(e,he.scrollTop),Math.abs(e.doc.scrollTop-Ie)>1&&(ee=!0)),he.scrollLeft!=null&&(da(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&(ee=!0)),!ee)break}return _}function Ji(e,t){var c=gs(e,t);c.scrollTop!=null&&Ma(e,c.scrollTop),c.scrollLeft!=null&&da(e,c.scrollLeft)}function gs(e,t){var c=e.display,l=Gn(e.display);t.top<0&&(t.top=0);var _=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:c.scroller.scrollTop,K=Kn(e),ee={};t.bottom-t.top>K&&(t.bottom=t.top+K);var ie=e.doc.height+vi(c),oe=t.topie-l;if(t.top<_)ee.scrollTop=oe?0:t.top;else if(t.bottom>_+K){var Ie=Math.min(t.top,(he?ie:t.bottom)-K);Ie!=_&&(ee.scrollTop=Ie)}var Fe=e.options.fixedGutter?0:c.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:c.scroller.scrollLeft-Fe,$e=ei(e)-c.gutters.offsetWidth,Tt=t.right-t.left>$e;return Tt&&(t.right=t.left+$e),t.left<10?ee.scrollLeft=0:t.left$e+Qe-3&&(ee.scrollLeft=t.right+(Tt?0:10)-$e),ee}function vs(e,t){if(t==null)return;qa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pa(e,t,c){(t!=null||c!=null)&&qa(e),t!=null&&(e.curOp.scrollLeft=t),c!=null&&(e.curOp.scrollTop=c)}function Qo(e,t){qa(e),e.curOp.scrollToPos=t}function qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var c=Or(e,t.from),l=Or(e,t.to);Bs(e,c,l,t.margin)}}function Bs(e,t,c,l){var _=gs(e,{left:Math.min(t.left,c.left),top:Math.min(t.top,c.top)-l,right:Math.max(t.right,c.right),bottom:Math.max(t.bottom,c.bottom)+l});Pa(e,_.scrollLeft,_.scrollTop)}function Ma(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||_s(e,{top:t}),Ws(e,t,!0),M&&_s(e),Ua(e,100)}function Ws(e,t,c){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!c)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function da(e,t,c,l){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(c?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!l)return;e.doc.scrollLeft=t,Vs(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ka(e){var t=e.display,c=t.gutters.offsetWidth,l=Math.round(e.doc.height+vi(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?c:0,docHeight:l,scrollHeight:l+kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:c}}var ha=function(e,t,c){this.cm=c;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),_=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=_.tabIndex=-1,e(l),e(_),ke(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),ke(_,"scroll",function(){_.clientWidth&&t(_.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ha.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,c=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var _=e.viewHeight-(t?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+_)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=c?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var K=e.viewWidth-e.barLeft-(c?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+K)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?l:0,bottom:t?l:0}},ha.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ha.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ha.prototype.zeroWidthHack=function(){var e=i&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new te,this.disableVert=new te},ha.prototype.enableZeroWidthBar=function(e,t,c){e.style.pointerEvents="auto";function l(){var _=e.getBoundingClientRect(),K=c=="vert"?document.elementFromPoint(_.right-1,(_.top+_.bottom)/2):document.elementFromPoint((_.right+_.left)/2,_.bottom-1);K!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},ha.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Na=function(){};Na.prototype.update=function(){return{bottom:0,right:0}},Na.prototype.setScrollLeft=function(){},Na.prototype.setScrollTop=function(){},Na.prototype.clear=function(){};function ba(e,t){t||(t=ka(e));var c=e.display.barWidth,l=e.display.barHeight;Hs(e,t);for(var _=0;_<4&&c!=e.display.barWidth||l!=e.display.barHeight;_++)c!=e.display.barWidth&&e.options.lineWrapping&&Ir(e),Hs(e,ka(e)),c=e.display.barWidth,l=e.display.barHeight}function Hs(e,t){var c=e.display,l=c.scrollbars.update(t);c.sizer.style.paddingRight=(c.barWidth=l.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=l.bottom)+"px",c.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=l.bottom+"px",c.scrollbarFiller.style.width=l.right+"px"):c.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=l.bottom+"px",c.gutterFiller.style.width=t.gutterWidth+"px"):c.gutterFiller.style.display=""}var Ks={native:ha,null:Na};function Gs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ks[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ke(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,c){c=="horizontal"?da(e,t):Ma(e,t)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Zo=0;function fa(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zo},Kt(e.curOp)}function pa(e){var t=e.curOp;t&&an(t,function(c){for(var l=0;l=c.viewTo)||c.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new es(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ys(e.cm,e.update)}function nl(e){var t=e.cm,c=t.display;e.updatedDisplay&&Ir(t),e.barMeasure=ka(t),c.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=yi(t,c.maxLine,c.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+e.adjustWidthTo+kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+e.adjustWidthTo-ei(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=c.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var c=+new Date+e.options.workTime,l=Nt(e,t.highlightFrontier),_=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(K){if(l.line>=e.display.viewFrom){var ee=K.styles,ie=K.text.length>e.options.maxHighlightLength?le(t.mode,l.state):null,oe=De(e,K,l,!0);ie&&(l.state=ie),K.styles=oe.styles;var he=K.styleClasses,Ie=oe.classes;Ie?K.styleClasses=Ie:he&&(K.styleClasses=null);for(var Fe=!ee||ee.length!=K.styles.length||he!=Ie&&(!he||!Ie||he.bgClass!=Ie.bgClass||he.textClass!=Ie.textClass),Qe=0;!Fe&&Qec)return Ua(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),_.length&&Dr(e,function(){for(var K=0;K<_.length;K++)sr(e,_[K],"text")})}var es=function(e,t,c){var l=e.display;this.viewport=t,this.visible=Gr(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=ei(e),this.force=c,this.dims=Ni(e),this.events=[]};es.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},es.prototype.finish=function(){for(var e=0;e=c.viewFrom&&t.visible.to<=c.viewTo&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&rn(e)==0)return!1;Xs(e)&&(Dn(e),t.dims=Ni(e));var _=l.first+l.size,K=Math.max(t.visible.from-e.options.viewportMargin,l.first),ee=Math.min(_,t.visible.to+e.options.viewportMargin);c.viewFromee&&c.viewTo-ee<20&&(ee=Math.min(_,c.viewTo)),ni&&(K=Hr(e.doc,K),ee=kr(e.doc,ee));var ie=K!=c.viewFrom||ee!=c.viewTo||c.lastWrapHeight!=t.wrapperHeight||c.lastWrapWidth!=t.wrapperWidth;$n(e,K,ee),c.viewOffset=vr(J(e.doc,c.viewFrom)),e.display.mover.style.top=c.viewOffset+"px";var oe=rn(e);if(!ie&&oe==0&&!t.force&&c.renderedView==c.view&&(c.updateLineNumbers==null||c.updateLineNumbers>=c.viewTo))return!1;var he=ol(e);return oe>4&&(c.lineDiv.style.display="none"),ul(e,c.updateLineNumbers,t.dims),oe>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,ll(he),b(c.cursorDiv),b(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,ie&&(c.lastWrapHeight=t.wrapperHeight,c.lastWrapWidth=t.wrapperWidth,Ua(e,400)),c.updateLineNumbers=null,!0}function zs(e,t){for(var c=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==ei(e)){if(c&&c.top!=null&&(c={top:Math.min(e.doc.height+vi(e.display)-Kn(e),c.top)}),t.visible=Gr(e.display,e.doc,c),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else l&&(t.visible=Gr(e.display,e.doc,c));if(!ys(e,t))break;Ir(e);var _=ka(e);Ln(e),ba(e,_),Es(e,_),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 _s(e,t){var c=new es(e,t);if(ys(e,c)){Ir(e),zs(e,c);var l=ka(e);Ln(e),ba(e,l),Es(e,l),c.finish()}}function ul(e,t,c){var l=e.display,_=e.options.lineNumbers,K=l.lineDiv,ee=K.firstChild;function ie(Tt){var Ut=Tt.nextSibling;return n&&i&&e.display.currentWheelTarget==Tt?Tt.style.display="none":Tt.parentNode.removeChild(Tt),Ut}for(var oe=l.view,he=l.viewFrom,Ie=0;Ie-1&&($e=!1),dn(e,Fe,he,c)),$e&&(b(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(Bt(e.options,he)))),ee=Fe.node.nextSibling}he+=Fe.size}for(;ee;)ee=ie(ee)}function bs(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Es(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+kn(e)+"px"}function Vs(e){var t=e.display,c=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=zn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,_=t.gutters.offsetWidth,K=l+"px",ee=0;eeee.clientWidth,oe=ee.scrollHeight>ee.clientHeight;if(!(l&&ie||_&&oe))return;if(_&&i&&n){e:for(var he=t.target,Ie=K.view;he!=ee;he=he.parentNode)for(var Fe=0;Fe=0&&Dt(e,l.to())<=0)return c}return-1};var pi=function(e,t){this.anchor=e,this.head=t};pi.prototype.from=function(){return Yt(this.anchor,this.head)},pi.prototype.to=function(){return qt(this.anchor,this.head)},pi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zr(e,t,c){var l=e&&e.options.selectionsMayTouch,_=t[c];t.sort(function(Qe,$e){return Dt(Qe.from(),$e.from())}),c=ae(t,_);for(var K=1;K0:oe>=0){var he=Yt(ie.from(),ee.from()),Ie=qt(ie.to(),ee.to()),Fe=ie.empty()?ee.from()==ee.head:ie.from()==ie.head;K<=c&&--c,t.splice(--K,2,new pi(Fe?Ie:he,Fe?he:Ie))}}return new jr(t,c)}function ra(e,t){return new jr([new pi(e,t||e)],0)}function aa(e){return e.text?tt(e.from.line+e.text.length-1,Ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Qs(e,t){if(Dt(e,t.from)<0)return e;if(Dt(e,t.to)<=0)return aa(t);var c=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=aa(t).ch-t.to.ch),tt(c,l)}function Ss(e,t){for(var c=[],l=0;l1&&e.remove(ie.line+1,Tt-1),e.insert(ie.line+1,$t)}it(e,"change",e,t)}function sa(e,t,c){function l(_,K,ee){if(_.linked)for(var ie=0;ie<_.linked.length;++ie){var oe=_.linked[ie];if(oe.doc==K)continue;var he=ee&&oe.sharedHist;if(c&&!he)continue;t(oe.doc,he),l(oe.doc,_,he)}}l(e,null,!0)}function eo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Br(e),Ts(e),to(e),e.options.lineWrapping||$r(e),e.options.mode=t.modeOption,Ii(e)}function to(e){(e.doc.direction=="rtl"?j:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Dr(e,function(){to(e),Ii(e)})}function ns(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 Cs(e,t){var c={from:nn(t.from),to:aa(t),text:ne(e,t.from,t.to)};return ro(e,c,t.from.line,t.to.line+1),sa(e,function(l){return ro(l,c,t.from.line,t.to.line+1)},!0),c}function no(e){for(;e.length;){var t=Ke(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return no(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 io(e,t,c,l){var _=e.history;_.undone.length=0;var K=+new Date,ee,ie;if((_.lastOp==l||_.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&_.lastModTime>K-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(ee=pl(_,_.lastOp==l)))ie=Ke(ee.changes),Dt(t.from,t.to)==0&&Dt(t.from,ie.to)==0?ie.to=aa(t):ee.changes.push(Cs(e,t));else{var oe=Ke(_.done);for((!oe||!oe.ranges)&&is(e.sel,_.done),ee={changes:[Cs(e,t)],generation:_.generation},_.done.push(ee);_.done.length>_.undoDepth;)_.done.shift(),_.done[0].ranges||_.done.shift()}_.done.push(c),_.generation=++_.maxGeneration,_.lastModTime=_.lastSelTime=K,_.lastOp=_.lastSelOp=l,_.lastOrigin=_.lastSelOrigin=t.origin,ie||Ge(e,"historyAdded")}function ml(e,t,c,l){var _=t.charAt(0);return _=="*"||_=="+"&&c.ranges.length==l.ranges.length&&c.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,c,l){var _=e.history,K=l&&l.origin;c==_.lastSelOp||K&&_.lastSelOrigin==K&&(_.lastModTime==_.lastSelTime&&_.lastOrigin==K||ml(e,K,Ke(_.done),t))?_.done[_.done.length-1]=t:is(t,_.done),_.lastSelTime=+new Date,_.lastSelOrigin=K,_.lastSelOp=c,l&&l.clearRedo!==!1&&no(_.undone)}function is(e,t){var c=Ke(t);c&&c.ranges&&c.equals(e)||t.push(e)}function ro(e,t,c,l){var _=t["spans_"+e.id],K=0;e.iter(Math.max(e.first,c),Math.min(e.first+e.size,l),function(ee){ee.markedSpans&&((_||(_=t["spans_"+e.id]={}))[K]=ee.markedSpans),++K})}function vl(e){if(!e)return null;for(var t,c=0;c-1&&(Ke(ie)[Fe]=he[Fe],delete he[Fe]))}}return l}function Os(e,t,c,l){if(l){var _=e.anchor;if(c){var K=Dt(t,_)<0;K!=Dt(c,_)<0?(_=t,t=c):K!=Dt(t,c)<0&&(t=c)}return new pi(_,t)}else return new pi(c||t,t)}function rs(e,t,c,l,_){_==null&&(_=e.cm&&(e.cm.display.shift||e.extend)),dr(e,new jr([Os(e.sel.primary(),t,c,_)],0),l)}function so(e,t,c){for(var l=[],_=e.cm&&(e.cm.display.shift||e.extend),K=0;K=t.ch:ie.to>t.ch))){if(_&&(Ge(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(K.markedSpans){--ee;continue}else break;if(!oe.atomic)continue;if(c){var Fe=oe.find(l<0?1:-1),Qe=void 0;if((l<0?Ie:he)&&(Fe=fo(e,Fe,-l,Fe&&Fe.line==t.line?K:null)),Fe&&Fe.line==t.line&&(Qe=Dt(Fe,c))&&(l<0?Qe<0:Qe>0))return xa(e,Fe,t,l,_)}var $e=oe.find(l<0?-1:1);return(l<0?he:Ie)&&($e=fo(e,$e,l,$e.line==t.line?K:null)),$e?xa(e,$e,t,l,_):null}}return t}function ss(e,t,c,l,_){var K=l||1,ee=xa(e,t,c,K,_)||!_&&xa(e,t,c,K,!0)||xa(e,t,c,-K,_)||!_&&xa(e,t,c,-K,!0);return ee||(e.cantEdit=!0,tt(e.first,0))}function fo(e,t,c,l){return c<0&&t.ch==0?t.line>e.first?L(e,tt(t.line-1)):null:c>0&&t.ch==(l||J(e,t.line)).text.length?t.line=0;--_)go(e,{from:l[_].from,to:l[_].to,text:_?[""]:t.text,origin:t.origin});else go(e,t)}function go(e,t){if(t.text.length==1&&t.text[0]==""&&Dt(t.from,t.to)==0)return;var c=Ss(e,t);io(e,t,c,e.cm?e.cm.curOp.id:NaN),Ba(e,t,c,Vi(e,t));var l=[];sa(e,function(_,K){!K&&ae(l,_.history)==-1&&(bo(_.history,t),l.push(_.history)),Ba(_,t,null,Vi(_,t))})}function os(e,t,c){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!c)return;for(var _=e.history,K,ee=e.sel,ie=t=="undo"?_.done:_.undone,oe=t=="undo"?_.undone:_.done,he=0;he=0;--$e){var Tt=Qe($e);if(Tt)return Tt.v}}function vo(e,t){if(t==0)return;if(e.first+=t,e.sel=new jr(bt(e.sel.ranges,function(_){return new pi(tt(_.anchor.line+t,_.anchor.ch),tt(_.head.line+t,_.head.ch))}),e.sel.primIndex),e.cm){Ii(e.cm,e.first,e.first-t,t);for(var c=e.cm.display,l=c.viewFrom;le.lastLine())return;if(t.from.lineK&&(t={from:t.from,to:tt(K,J(e,K).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ne(e,t.from,t.to),c||(c=Ss(e,t)),e.cm?bl(e.cm,t,l):ws(e,t,l),as(e,c,Oe),e.cantEdit&&ss(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,c){var l=e.doc,_=e.display,K=t.from,ee=t.to,ie=!1,oe=K.line;e.options.lineWrapping||(oe=We(Xi(J(l,K.line))),l.iter(oe,ee.line+1,function($e){if($e==_.maxLine)return ie=!0,!0})),l.sel.contains(t.from,t.to)>-1&&Ae(e),ws(l,t,c,Rr(e)),e.options.lineWrapping||(l.iter(oe,K.line+t.text.length,function($e){var Tt=Yr($e);Tt>_.maxLineLength&&(_.maxLine=$e,_.maxLineLength=Tt,_.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),Gi(l,K.line),Ua(e,400);var he=t.text.length-(ee.line-K.line)-1;t.full?Ii(e):K.line==ee.line&&t.text.length==1&&!qs(e.doc,t)?sr(e,K.line,"text"):Ii(e,K.line,ee.line+1,he);var Ie=ve(e,"changes"),Fe=ve(e,"change");if(Fe||Ie){var Qe={from:K,to:ee,text:t.text,removed:t.removed,origin:t.origin};Fe&&it(e,"change",e,Qe),Ie&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Qe)}e.display.selForContextMenu=null}function Ta(e,t,c,l,_){var K;l||(l=c),Dt(l,c)<0&&(K=[l,c],c=K[0],l=K[1]),typeof t=="string"&&(t=e.splitLines(t)),Sa(e,{from:c,to:l,text:t,origin:_})}function yo(e,t,c,l){c1||!(this.children[0]instanceof Ha))){var ie=[];this.collapse(ie),this.children=[new Ha(ie)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var ee=_.lines.length%25+25,ie=ee;ie<_.lines.length;){var oe=new Ha(_.lines.slice(ie,ie+=25));_.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}_.lines=_.lines.slice(0,ee),this.maybeSpill()}break}e-=K}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),c=new Ka(t);if(e.parent){e.size-=c.size,e.height-=c.height;var _=ae(e.parent.children,e);e.parent.children.splice(_+1,0,c)}else{var l=new Ka(e.children);l.parent=e,e.children=[l,c],e=l}c.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,c){for(var l=0;le.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=Ie,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Ii(e,l,_+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&co(e.doc)),e&&it(e,"markerCleared",e,this,l,_),t&&pa(e),this.parent&&this.parent.clear()},oa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var c,l,_=0;_0||ee==0&&K.clearWhenEmpty!==!1)return K;if(K.replacedWith&&(K.collapsed=!0,K.widgetNode=C("span",[K.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||K.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(K.widgetNode.insertLeft=!0)),K.collapsed){if(ki(e,t.line,t,c,K)||t.line!=c.line&&ki(e,c.line,t,c,K))throw new Error("Inserting collapsed marker partially overlapping an existing one");ji()}K.addToHistory&&io(e,{from:t,to:c,origin:"markText"},e.sel,NaN);var ie=t.line,oe=e.cm,he;if(e.iter(ie,c.line+1,function(Fe){oe&&K.collapsed&&!oe.options.lineWrapping&&Xi(Fe)==oe.display.maxLine&&(he=!0),K.collapsed&&ie!=t.line&&Ue(Fe,0),ar(Fe,new Mi(K,ie==t.line?t.ch:null,ie==c.line?c.ch:null)),++ie}),K.collapsed&&e.iter(t.line,c.line+1,function(Fe){wr(e,Fe)&&Ue(Fe,0)}),K.clearOnEnter&&ke(K,"beforeCursorEnter",function(){return K.clear()}),K.readOnly&&(di(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),K.collapsed&&(K.id=++xo,K.atomic=!0),oe){if(he&&(oe.curOp.updateMaxLine=!0),K.collapsed)Ii(oe,t.line,c.line+1);else if(K.className||K.startStyle||K.endStyle||K.css||K.attributes||K.title)for(var Ie=t.line;Ie<=c.line;Ie++)sr(oe,Ie,"text");K.atomic&&co(oe.doc),it(oe,"markerAdded",oe,K)}return K}var za=function(e,t){this.markers=e,this.primary=t;for(var c=0;c=0;oe--)Sa(this,l[oe]);ie?lo(this,ie):this.cm&&_a(this.cm)}),undo:nr(function(){os(this,"undo")}),redo:nr(function(){os(this,"redo")}),undoSelection:nr(function(){os(this,"undo",!0)}),redoSelection:nr(function(){os(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,c=0,l=0;l=e.ch)&&t.push(_.marker.parent||_.marker)}return t},findMarks:function(e,t,c){e=L(this,e),t=L(this,t);var l=[],_=e.line;return this.iter(e.line,t.line+1,function(K){var ee=K.markedSpans;if(ee)for(var ie=0;ie=oe.to||oe.from==null&&_!=e.line||oe.from!=null&&_==t.line&&oe.from>=t.ch)&&(!c||c(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++_}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var c=t.markedSpans;if(c)for(var l=0;le)return t=e,!0;e-=K,++c}),L(this,tt(c,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ie=e.dataTransfer.getData("Text");if(Ie){var Fe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Fe=t.listSelections()),as(t.doc,ra(c,c)),Fe)for(var Qe=0;Qe=0;ie--)Ta(e.doc,"",l[ie].from,l[ie].to,"+delete");_a(e)})}function As(e,t,c){var l=Se(e.text,t+c,c);return l<0||l>e.text.length?null:l}function Ls(e,t,c){var l=As(e,t.ch,c);return l==null?null:new tt(t.line,l,c<0?"after":"before")}function Is(e,t,c,l,_){if(e){t.doc.direction=="rtl"&&(_=-_);var K=Ot(c,t.doc.direction);if(K){var ee=_<0?Ke(K):K[0],ie=_<0==(ee.level==1),oe=ie?"after":"before",he;if(ee.level>0||t.doc.direction=="rtl"){var Ie=ti(t,c);he=_<0?c.text.length-1:0;var Fe=In(t,Ie,he).top;he=Be(function(Qe){return In(t,Ie,Qe).top==Fe},_<0==(ee.level==1)?ee.from:ee.to-1,he),oe=="before"&&(he=As(c,he,1))}else he=_<0?ee.to:ee.from;return new tt(l,he,oe)}}return new tt(l,_<0?c.text.length:0,_<0?"before":"after")}function Ml(e,t,c,l){var _=Ot(t,e.doc.direction);if(!_)return Ls(t,c,l);c.ch>=t.text.length?(c.ch=t.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var K=ft(_,c.ch,c.sticky),ee=_[K];if(e.doc.direction=="ltr"&&ee.level%2==0&&(l>0?ee.to>c.ch:ee.from=ee.from&&Qe>=Ie.begin)){var $e=Fe?"before":"after";return new tt(c.line,Qe,$e)}}var Tt=function($t,sn,Jt){for(var cn=function(Ti,ir){return ir?new tt(c.line,ie(Ti,1),"before"):new tt(c.line,Ti,"after")};$t>=0&&$t<_.length;$t+=sn){var Rn=_[$t],En=sn>0==(Rn.level!=1),Jn=En?Jt.begin:ie(Jt.end,-1);if(Rn.from<=Jn&&Jn0?Ie.end:ie(Ie.begin,-1);return Ht!=null&&!(l>0&&Ht==t.text.length)&&(Ut=Tt(l>0?0:_.length-1,l,he(Ht)),Ut)?Ut:null}var Ya={selectAll:po,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return Oa(e,function(t){if(t.empty()){var c=J(e.doc,t.head.line).text.length;return t.head.ch==c&&t.head.line0)_=new tt(_.line,_.ch+1),e.replaceRange(K.charAt(_.ch-1)+K.charAt(_.ch-2),tt(_.line,_.ch-2),_,"+transpose");else if(_.line>e.doc.first){var ee=J(e.doc,_.line-1).text;ee&&(_=new tt(_.line,1),e.replaceRange(K.charAt(0)+e.doc.lineSeparator()+ee.charAt(ee.length-1),tt(_.line-1,ee.length-1),_,"+transpose"))}}c.push(new pi(_,_))}e.setSelections(c)})},newlineAndIndent:function(e){return Dr(e,function(){for(var t=e.listSelections(),c=t.length-1;c>=0;c--)e.replaceRange(e.doc.lineSeparator(),t[c].anchor,t[c].head,"+input");t=e.listSelections();for(var l=0;le&&Dt(t,this.pos)==0&&c==this.button};var Ja,Qa;function Wl(e,t){var c=+new Date;return Qa&&Qa.compare(c,e,t)?(Ja=Qa=null,"triple"):Ja&&Ja.compare(c,e,t)?(Qa=new Ps(c,e,t),Ja=null,"double"):(Ja=new Ps(c,e,t),Qa=null,"single")}function Fo(e){var t=this,c=t.display;if(et(t,e)||c.activeTouch&&c.input.supportsTouch())return;if(c.input.ensurePolled(),c.shift=e.shiftKey,Un(c,e)){n||(c.scroller.draggable=!1,setTimeout(function(){return c.scroller.draggable=!0},100));return}if(Ms(t,e))return;var l=$i(t,e),_=ze(e),K=l?Wl(l,_):"single";if(window.focus(),_==1&&t.state.selectingText&&t.state.selectingText(e),l&&Hl(t,_,l,K,e))return;_==1?l?Gl(t,l,K,e):Le(e)==c.scroller&&ue(e):_==2?(l&&rs(t.doc,l),setTimeout(function(){return c.input.focus()},20)):_==3&&(R?t.display.input.onContextMenu(e):ya(t))}function Hl(e,t,c,l,_){var K="Click";return l=="double"?K="Double"+K:l=="triple"&&(K="Triple"+K),K=(t==1?"Left":t==2?"Middle":"Right")+K,$a(e,Ao(K,_),_,function(ee){if(typeof ee=="string"&&(ee=Ya[ee]),!ee)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=ee(e,c)!=Re}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,t,c){var l=e.getOption("configureMouse"),_=l?l(e,t,c):{};if(_.unit==null){var K=s?c.shiftKey&&c.metaKey:c.altKey;_.unit=K?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(_.extend==null||e.doc.extend)&&(_.extend=e.doc.extend||c.shiftKey),_.addNew==null&&(_.addNew=i?c.metaKey:c.ctrlKey),_.moveOnDrag==null&&(_.moveOnDrag=!(i?c.altKey:c.ctrlKey)),_}function Gl(e,t,c,l){H?setTimeout(W(na,e),0):e.curOp.focus=U();var _=Kl(e,c,l),K=e.doc.sel,ee;e.options.dragDrop&&dt&&!e.isReadOnly()&&c=="single"&&(ee=K.contains(t))>-1&&(Dt((ee=K.ranges[ee]).from(),t)<0||t.xRel>0)&&(Dt(ee.to(),t)>0||t.xRel<0)?zl(e,l,t,_):Vl(e,l,t,_)}function zl(e,t,c,l){var _=e.display,K=!1,ee=tr(e,function(he){n&&(_.scroller.draggable=!1),e.state.draggingText=!1,ct(_.wrapper.ownerDocument,"mouseup",ee),ct(_.wrapper.ownerDocument,"mousemove",ie),ct(_.scroller,"dragstart",oe),ct(_.scroller,"drop",ee),K||(ue(he),l.addNew||rs(e.doc,c,null,null,l.extend),n&&!d||H&&N==9?setTimeout(function(){_.wrapper.ownerDocument.body.focus({preventScroll:!0}),_.input.focus()},20):_.input.focus())}),ie=function(he){K=K||Math.abs(t.clientX-he.clientX)+Math.abs(t.clientY-he.clientY)>=10},oe=function(){return K=!0};n&&(_.scroller.draggable=!0),e.state.draggingText=ee,ee.copy=!l.moveOnDrag,_.scroller.dragDrop&&_.scroller.dragDrop(),ke(_.wrapper.ownerDocument,"mouseup",ee),ke(_.wrapper.ownerDocument,"mousemove",ie),ke(_.scroller,"dragstart",oe),ke(_.scroller,"drop",ee),ya(e),setTimeout(function(){return _.input.focus()},20)}function jo(e,t,c){if(c=="char")return new pi(t,t);if(c=="word")return e.findWordAt(t);if(c=="line")return new pi(tt(t.line,0),L(e.doc,tt(t.line+1,0)));var l=c(e,t);return new pi(l.from,l.to)}function Vl(e,t,c,l){var _=e.display,K=e.doc;ue(t);var ee,ie,oe=K.sel,he=oe.ranges;if(l.addNew&&!l.extend?(ie=K.sel.contains(c),ie>-1?ee=he[ie]:ee=new pi(c,c)):(ee=K.sel.primary(),ie=K.sel.primIndex),l.unit=="rectangle")l.addNew||(ee=new pi(c,c)),c=$i(e,t,!0,!0),ie=-1;else{var Ie=jo(e,c,l.unit);l.extend?ee=Os(ee,Ie.anchor,Ie.head,l.extend):ee=Ie}l.addNew?ie==-1?(ie=he.length,dr(K,zr(e,he.concat([ee]),ie),{scroll:!1,origin:"*mouse"})):he.length>1&&he[ie].empty()&&l.unit=="char"&&!l.extend?(dr(K,zr(e,he.slice(0,ie).concat(he.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),oe=K.sel):Rs(K,ie,ee,Ce):(ie=0,dr(K,new jr([ee],0),Ce),oe=K.sel);var Fe=c;function Qe(Jt){if(Dt(Fe,Jt)==0)return;if(Fe=Jt,l.unit=="rectangle"){for(var cn=[],Rn=e.options.tabSize,En=V(J(K,c.line).text,c.ch,Rn),Jn=V(J(K,Jt.line).text,Jt.ch,Rn),Ti=Math.min(En,Jn),ir=Math.max(En,Jn),Pi=Math.min(c.line,Jt.line),Pr=Math.min(e.lastLine(),Math.max(c.line,Jt.line));Pi<=Pr;Pi++){var Er=J(K,Pi).text,Hi=He(Er,Ti,Rn);Ti==ir?cn.push(new pi(tt(Pi,Hi),tt(Pi,Hi))):Er.length>Hi&&cn.push(new pi(tt(Pi,Hi),tt(Pi,He(Er,ir,Rn))))}cn.length||cn.push(new pi(c,c)),dr(K,zr(e,oe.ranges.slice(0,ie).concat(cn),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Jt)}else{var xr=ee,or=jo(e,Jt,l.unit),Qi=xr.anchor,Ki;Dt(or.anchor,Qi)>0?(Ki=or.head,Qi=Yt(xr.from(),or.anchor)):(Ki=or.anchor,Qi=qt(xr.to(),or.head));var Ui=oe.ranges.slice(0);Ui[ie]=Xl(e,new pi(L(K,Qi),Ki)),dr(K,zr(e,Ui,ie),Ce)}}var $e=_.wrapper.getBoundingClientRect(),Tt=0;function Ut(Jt){var cn=++Tt,Rn=$i(e,Jt,!0,l.unit=="rectangle");if(!Rn)return;if(Dt(Rn,Fe)!=0){e.curOp.focus=U(),Qe(Rn);var En=Gr(_,K);(Rn.line>=En.to||Rn.line$e.bottom?20:0;Jn&&setTimeout(tr(e,function(){if(Tt!=cn)return;_.scroller.scrollTop+=Jn,Ut(Jt)}),50)}}function Ht(Jt){e.state.selectingText=!1,Tt=Infinity,Jt&&(ue(Jt),_.input.focus()),ct(_.wrapper.ownerDocument,"mousemove",$t),ct(_.wrapper.ownerDocument,"mouseup",sn),K.history.lastSelOrigin=null}var $t=tr(e,function(Jt){Jt.buttons===0||!ze(Jt)?Ht(Jt):Ut(Jt)}),sn=tr(e,Ht);e.state.selectingText=sn,ke(_.wrapper.ownerDocument,"mousemove",$t),ke(_.wrapper.ownerDocument,"mouseup",sn)}function Xl(e,t){var c=t.anchor,l=t.head,_=J(e.doc,c.line);if(Dt(c,l)==0&&c.sticky==l.sticky)return t;var K=Ot(_);if(!K)return t;var ee=ft(K,c.ch,c.sticky),ie=K[ee];if(ie.from!=c.ch&&ie.to!=c.ch)return t;var oe=ee+(ie.from==c.ch==(ie.level!=1)?0:1);if(oe==0||oe==K.length)return t;var he;if(l.line!=c.line)he=(l.line-c.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ie=ft(K,l.ch,l.sticky),Fe=Ie-ee||(l.ch-c.ch)*(ie.level==1?-1:1);Ie==oe-1||Ie==oe?he=Fe<0:he=Fe>0}var Qe=K[oe+(he?-1:0)],$e=he==(Qe.level==1),Tt=$e?Qe.from:Qe.to,Ut=$e?"after":"before";return c.ch==Tt&&c.sticky==Ut?t:new pi(new tt(c.line,Tt,Ut),l)}function Bo(e,t,c,l){var _,K;if(t.touches)_=t.touches[0].clientX,K=t.touches[0].clientY;else try{_=t.clientX,K=t.clientY}catch(Qe){return!1}if(_>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ue(t);var ee=e.display,ie=ee.lineDiv.getBoundingClientRect();if(K>ie.bottom||!ve(e,c))return de(t);K-=ie.top-ee.viewOffset;for(var oe=0;oe=_){var Ie=_t(e.doc,K),Fe=e.display.gutterSpecs[oe];return Ge(e,c,e,Ie,Fe.className,t),de(t)}}}function Ms(e,t){return Bo(e,t,"gutterClick",!0)}function Wo(e,t){if(Un(e.display,t)||Yl(e,t))return;if(et(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return ve(e,"gutterContextMenu")?Bo(e,t,"gutterContextMenu",!1):!1}function Ho(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),tn(e)}var Ra={toString:function(){return"CodeMirror.Init"}},Ko={},ds={};function $l(e){var t=e.optionHandlers;function c(l,_,K,ee){e.defaults[l]=_,K&&(t[l]=ee?function(ie,oe,he){he!=Ra&&K(ie,oe,he)}:K)}e.defineOption=c,e.Init=Ra,c("value","",function(l,_){return l.setValue(_)},!0),c("mode",null,function(l,_){l.doc.modeOption=_,Ts(l)},!0),c("indentUnit",2,Ts,!0),c("indentWithTabs",!1),c("smartIndent",!0),c("tabSize",4,function(l){ja(l),tn(l),Ii(l)},!0),c("lineSeparator",null,function(l,_){if(l.doc.lineSep=_,!_)return;var K=[],ee=l.doc.first;l.doc.iter(function(oe){for(var he=0;;){var Ie=oe.text.indexOf(_,he);if(Ie==-1)break;he=Ie+_.length,K.push(tt(ee,Ie))}ee++});for(var ie=K.length-1;ie>=0;ie--)Ta(l.doc,_,K[ie],tt(K[ie].line,K[ie].ch+_.length))}),c("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,_,K){l.state.specialChars=new RegExp(_.source+(_.test(" ")?"":"| "),"g"),K!=Ra&&l.refresh()}),c("specialCharPlaceholder",un,function(l){return l.refresh()},!0),c("electricChars",!0),c("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),c("spellcheck",!1,function(l,_){return l.getInputField().spellcheck=_},!0),c("autocorrect",!1,function(l,_){return l.getInputField().autocorrect=_},!0),c("autocapitalize",!1,function(l,_){return l.getInputField().autocapitalize=_},!0),c("rtlMoveVisually",!S),c("wholeLineUpdateBefore",!0),c("theme","default",function(l){Ho(l),Fa(l)},!0),c("keyMap","default",function(l,_,K){var ee=us(_),ie=K!=Ra&&us(K);ie&&ie.detach&&ie.detach(l,ee),ee.attach&&ee.attach(l,ie||null)}),c("extraKeys",null),c("configureMouse",null),c("lineWrapping",!1,Ql,!0),c("gutters",[],function(l,_){l.display.gutterSpecs=xs(_,l.options.lineNumbers),Fa(l)},!0),c("fixedGutter",!0,function(l,_){l.display.gutters.style.left=_?zn(l.display)+"px":"0",l.refresh()},!0),c("coverGutterNextToScrollbar",!1,function(l){return ba(l)},!0),c("scrollbarStyle","native",function(l){Gs(l),ba(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),c("lineNumbers",!1,function(l,_){l.display.gutterSpecs=xs(l.options.gutters,_),Fa(l)},!0),c("firstLineNumber",1,Fa,!0),c("lineNumberFormatter",function(l){return l},Fa,!0),c("showCursorWhenSelecting",!1,Ln,!0),c("resetSelectionOnContextMenu",!0),c("lineWiseCopyCut",!0),c("pasteLinesPerSelection",!0),c("selectionsMayTouch",!1),c("readOnly",!1,function(l,_){_=="nocursor"&&(Lr(l),l.display.input.blur()),l.display.input.readOnlyChanged(_)}),c("screenReaderLabel",null,function(l,_){_=_===""?null:_,l.display.input.screenReaderLabelChanged(_)}),c("disableInput",!1,function(l,_){_||l.display.input.reset()},!0),c("dragDrop",!0,Jl),c("allowDropFileTypes",null),c("cursorBlinkRate",530),c("cursorScrollMargin",0),c("cursorHeight",1,Ln,!0),c("singleCursorHeightPerLine",!0,Ln,!0),c("workTime",100),c("workDelay",100),c("flattenSpans",!0,ja,!0),c("addModeClass",!1,ja,!0),c("pollInterval",100),c("undoDepth",200,function(l,_){return l.doc.history.undoDepth=_}),c("historyEventDelay",1250),c("viewportMargin",10,function(l){return l.refresh()},!0),c("maxHighlightLength",1e4,ja,!0),c("moveInputWithCursor",!0,function(l,_){_||l.display.input.resetPosition()}),c("tabindex",null,function(l,_){return l.display.input.getField().tabIndex=_||""}),c("autofocus",null),c("direction","ltr",function(l,_){return l.doc.setDirection(_)},!0),c("phrases",null)}function Jl(e,t,c){var l=c&&c!=Ra;if(!t!=!l){var _=e.display.dragFunctions,K=t?ke:ct;K(e.display.scroller,"dragstart",_.start),K(e.display.scroller,"dragenter",_.enter),K(e.display.scroller,"dragover",_.over),K(e.display.scroller,"dragleave",_.leave),K(e.display.scroller,"drop",_.drop)}}function Ql(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),$r(e)),Br(e),Ii(e),tn(e),setTimeout(function(){return ba(e)},100)}function Ai(e,t){var c=this;if(!(this instanceof Ai))return new Ai(e,t);this.options=t=t?O(t):{},O(Ko,t,!1);var l=t.value;typeof l=="string"?l=new br(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var _=new Ai.inputStyles[t.inputStyle](this),K=this.display=new cl(e,l,_,t);K.wrapper.CodeMirror=this,Ho(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gs(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 te,keySeq:null,specialChars:null},t.autofocus&&!a&&K.input.focus(),H&&N<11&&setTimeout(function(){return c.display.input.reset(!0)},20),Zl(this),Al(),fa(this),this.curOp.forceUpdate=!0,eo(this,l),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){c.hasFocus()&&!c.state.focused&&Wr(c)},20):Lr(this);for(var ee in ds)ds.hasOwnProperty(ee)&&ds[ee](this,t[ee],Ra);Xs(this),t.finishInit&&t.finishInit(this);for(var ie=0;ie20*20}ke(t.scroller,"touchstart",function(oe){if(!et(e,oe)&&!K(oe)&&!Ms(e,oe)){t.input.ensurePolled(),clearTimeout(c);var he=+new Date;t.activeTouch={start:he,moved:!1,prev:he-l.end<=300?l:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),ke(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ke(t.scroller,"touchend",function(oe){var he=t.activeTouch;if(he&&!Un(t,oe)&&he.left!=null&&!he.moved&&new Date-he.start<300){var Ie=e.coordsChar(t.activeTouch,"page"),Fe;!he.prev||ee(he,he.prev)?Fe=new pi(Ie,Ie):!he.prev.prev||ee(he,he.prev.prev)?Fe=e.findWordAt(Ie):Fe=new pi(tt(Ie.line,0),L(e.doc,tt(Ie.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),ue(oe)}_()}),ke(t.scroller,"touchcancel",_),ke(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ma(e,t.scroller.scrollTop),da(e,t.scroller.scrollLeft,!0),Ge(e,"scroll",e))}),ke(t.scroller,"mousewheel",function(oe){return Js(e,oe)}),ke(t.scroller,"DOMMouseScroll",function(oe){return Js(e,oe)}),ke(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){et(e,oe)||we(oe)},over:function(oe){et(e,oe)||(Rl(e,oe),we(oe))},start:function(oe){return Ol(e,oe)},drop:tr(e,Cl),leave:function(oe){et(e,oe)||wo(e)}};var ie=t.input.getField();ke(ie,"keyup",function(oe){return No.call(e,oe)}),ke(ie,"keydown",tr(e,ko)),ke(ie,"keypress",tr(e,Uo)),ke(ie,"focus",function(oe){return Wr(e,oe)}),ke(ie,"blur",function(oe){return Lr(e,oe)})}var ks=[];Ai.defineInitHook=function(e){return ks.push(e)};function Za(e,t,c,l){var _=e.doc,K;c==null&&(c="add"),c=="smart"&&(_.mode.indent?K=Nt(e,t).state:c="prev");var ee=e.options.tabSize,ie=J(_,t),oe=V(ie.text,null,ee);ie.stateAfter&&(ie.stateAfter=null);var he=ie.text.match(/^\s*/)[0],Ie;if(!l&&!/\S/.test(ie.text))Ie=0,c="not";else if(c=="smart"&&(Ie=_.mode.indent(K,ie.text.slice(he.length),ie.text),Ie==Re||Ie>150)){if(!l)return;c="prev"}c=="prev"?t>_.first?Ie=V(J(_,t-1).text,null,ee):Ie=0:c=="add"?Ie=oe+e.options.indentUnit:c=="subtract"?Ie=oe-e.options.indentUnit:typeof c=="number"&&(Ie=oe+c),Ie=Math.max(0,Ie);var Fe="",Qe=0;if(e.options.indentWithTabs)for(var $e=Math.floor(Ie/ee);$e;--$e)Qe+=ee,Fe+=" ";if(Qeee,oe=qe(t),he=null;if(ie&&l.ranges.length>1)if(Vr&&Vr.text.join(` `)==t){if(l.ranges.length%Vr.text.length==0){he=[];for(var Ie=0;Ie=0;Qe--){var $e=l.ranges[Qe],Tt=$e.from(),Ut=$e.to();$e.empty()&&(c&&c>0?Tt=tt(Tt.line,Tt.ch-c):e.state.overwrite&&!ie?Ut=tt(Ut.line,Math.min(J(K,Ut.line).text.length,Ut.ch+Ke(oe).length)):ie&&Vr&&Vr.lineWise&&Vr.text.join(` `)==oe.join(` `)&&(Tt=Ut=tt(Tt.line,0)));var Ht={from:Tt,to:Ut,text:he?he[Qe%he.length]:oe,origin:_||(ie?"paste":e.state.cutIncoming>ee?"cut":"+input")};Sa(e.doc,Ht),it(e,"inputRead",e,Ht)}t&&!ie&&zo(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Go(e,t){var c=e.clipboardData&&e.clipboardData.getData("Text");if(c)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Dr(t,function(){return Ns(t,c,0,null,"paste")}),!0}function zo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var c=e.doc.sel,l=c.ranges.length-1;l>=0;l--){var _=c.ranges[l];if(_.head.ch>100||l&&c.ranges[l-1].head.line==_.head.line)continue;var K=e.getModeAt(_.head),ee=!1;if(K.electricChars){for(var ie=0;ie-1){ee=Za(e,_.head.line,"smart");break}}else K.electricInput&&(K.electricInput.test(J(e.doc,_.head.line).text.slice(0,_.head.ch))&&(ee=Za(e,_.head.line,"smart")));ee&&it(e,"electricInput",e,_.head.line)}}function Vo(e){for(var t=[],c=[],l=0;lK&&(Za(this,ie.head.line,l,!0),K=ie.head.line,ee==this.doc.sel.primIndex&&_a(this));else{var oe=ie.from(),he=ie.to(),Ie=Math.max(K,oe.line);K=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var Fe=Ie;Fe0&&Rs(this.doc,ee,new pi(oe,Qe[ee].to()),Oe)}}}),getTokenAt:function(l,_){return Yn(this,l,_)},getLineTokens:function(l,_){return Yn(this,tt(l),_,!0)},getTokenTypeAt:function(l){l=L(this.doc,l);var _=lt(this,J(this.doc,l.line)),K=0,ee=(_.length-1)/2,ie=l.ch,oe;if(ie==0)oe=_[2];else for(;;){var he=K+ee>>1;if((he?_[he*2-1]:0)>=ie)ee=he;else if(_[he*2+1]oe&&(l=oe,ee=!0),ie=J(this.doc,l)}else ie=l;return er(this,ie,{top:0,left:0},_||"page",K||ee).top+(ee?this.doc.height-vr(ie):0)},defaultTextHeight:function(){return Gn(this.display)},defaultCharWidth:function(){return Xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,_,K,ee,ie){var oe=this.display;l=ui(this,L(this.doc,l));var he=l.bottom,Ie=l.left;if(_.style.position="absolute",_.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(_),oe.sizer.appendChild(_),ee=="over")he=l.top;else if(ee=="above"||ee=="near"){var Fe=Math.max(oe.wrapper.clientHeight,this.doc.height),Qe=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(ee=="above"||l.bottom+_.offsetHeight>Fe)&&l.top>_.offsetHeight?he=l.top-_.offsetHeight:l.bottom+_.offsetHeight<=Fe&&(he=l.bottom),Ie+_.offsetWidth>Qe&&(Ie=Qe-_.offsetWidth)}_.style.top=he+"px",_.style.left=_.style.right="",ie=="right"?(Ie=oe.sizer.clientWidth-_.offsetWidth,_.style.right="0px"):(ie=="left"?Ie=0:ie=="middle"&&(Ie=(oe.sizer.clientWidth-_.offsetWidth)/2),_.style.left=Ie+"px"),K&&Ji(this,{left:Ie,top:he,right:Ie+_.offsetWidth,bottom:he+_.offsetHeight})},triggerOnKeyDown:pr(ko),triggerOnKeyPress:pr(Uo),triggerOnKeyUp:No,triggerOnMouseDown:pr(Fo),execCommand:function(l){if(Ya.hasOwnProperty(l))return Ya[l].call(null,this)},triggerElectric:pr(function(l){zo(this,l)}),findPosH:function(l,_,K,ee){var ie=1;_<0&&(ie=-1,_=-_);for(var oe=L(this.doc,l),he=0;he<_&&!(oe=Us(this.doc,oe,ie,K,ee),oe.hitSide);++he);return oe},moveH:pr(function(l,_){var K=this;this.extendSelectionsBy(function(ee){return K.display.shift||K.doc.extend||ee.empty()?Us(K.doc,ee.head,l,_,K.options.rtlMoveVisually):l<0?ee.from():ee.to()},Pe)}),deleteH:pr(function(l,_){var K=this.doc.sel,ee=this.doc;K.somethingSelected()?ee.replaceSelection("",null,"+delete"):Oa(this,function(ie){var oe=Us(ee,ie.head,l,_,!1);return l<0?{from:oe,to:ie.head}:{from:ie.head,to:oe}})}),findPosV:function(l,_,K,ee){var ie=1,oe=ee;_<0&&(ie=-1,_=-_);for(var he=L(this.doc,l),Ie=0;Ie<_;++Ie){var Fe=ui(this,he,"div");if(oe==null?oe=Fe.left:Fe.left=oe,he=$o(this,Fe,ie,K),he.hitSide)break}return he},moveV:pr(function(l,_){var K=this,ee=this.doc,ie=[],oe=!this.display.shift&&!ee.extend&&ee.sel.somethingSelected();if(ee.extendSelectionsBy(function(Ie){if(oe)return l<0?Ie.from():Ie.to();var Fe=ui(K,Ie.head,"div");Ie.goalColumn!=null&&(Fe.left=Ie.goalColumn),ie.push(Fe.left);var Qe=$o(K,Fe,l,_);return _=="page"&&Ie==ee.sel.primary()&&vs(K,Cr(K,Qe,"div").top-Fe.top),Qe},Pe),ie.length)for(var he=0;he0&&Ie(K.charAt(ee-1));)--ee;for(;ie.5||this.options.lineWrapping)&&Br(this),Ge(this,"refresh",this)}),swapDoc:pr(function(l){var _=this.doc;return _.cm=null,this.state.selectingText&&this.state.selectingText(),eo(this,l),tn(this),this.display.input.reset(),Pa(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,it(this,"swapDoc",this,_),_}),phrase:function(l){var _=this.options.phrases;return _&&Object.prototype.hasOwnProperty.call(_,l)?_[l]:l},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}},xe(e),e.registerHelper=function(l,_,K){c.hasOwnProperty(l)||(c[l]=e[l]={_global:[]}),c[l][_]=K},e.registerGlobalHelper=function(l,_,K,ee){e.registerHelper(l,_,ee),c[l]._global.push({pred:K,val:ee})}}function Us(e,t,c,l,_){var K=t,ee=c,ie=J(e,t.line),oe=_&&e.direction=="rtl"?-c:c;function he(){var sn=t.line+oe;return sn=e.first+e.size?!1:(t=new tt(sn,t.ch,t.sticky),ie=J(e,sn))}function Ie(sn){var Jt;if(l=="codepoint"){var cn=ie.text.charCodeAt(t.ch+(l>0?0:-1));isNaN(cn)?Jt=null:Jt=new tt(t.line,Math.max(0,Math.min(ie.text.length,t.ch+c*(cn>=55296&&cn<56320?2:1))),-c)}else _?Jt=Ml(e.cm,ie,t,c):Jt=Ls(ie,t,c);if(Jt==null)if(!sn&&he())t=Is(_,e.cm,ie,t.line,oe);else return!1;else t=Jt;return!0}if(l=="char"||l=="codepoint")Ie();else if(l=="column")Ie(!0);else if(l=="word"||l=="group")for(var Fe=null,Qe=l=="group",$e=e.cm&&e.cm.getHelper(t,"wordChars"),Tt=!0;!(c<0&&!Ie(!Tt));Tt=!1){var Ut=ie.text.charAt(t.ch)||` `,Ht=wt(Ut,$e)?"w":Qe&&Ut==` `?"n":!Qe||/\s/.test(Ut)?null:"p";if(Qe&&!Tt&&!Ht&&(Ht="s"),Fe&&Fe!=Ht){c<0&&(c=1,Ie(),t.sticky="after");break}if(Ht&&(Fe=Ht),c>0&&!Ie(!Tt))break}var $t=ss(e,t,K,ee,!0);return At(K,$t)&&($t.hitSide=!0),$t}function $o(e,t,c,l){var _=e.doc,K=t.left,ee;if(l=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ie-.5*Gn(e.display),3);ee=(c>0?t.bottom:t.top)+c*oe}else l=="line"&&(ee=c>0?t.bottom+3:t.top-3);for(var he;!(he=Kr(e,K,ee),!he.outside);){if(c<0?ee<=0:ee>=_.height){he.hitSide=!0;break}ee+=c*5}return he}var Ei=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ei.prototype.init=function(e){var t=this,c=this,l=c.cm,_=c.div=e.lineDiv;Xo(_,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function K(ie){for(var oe=ie.target;oe;oe=oe.parentNode){if(oe==_)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}ke(_,"paste",function(ie){if(!K(ie)||et(l,ie)||Go(ie,l))return;N<=11&&setTimeout(tr(l,function(){return t.updateFromDOM()}),20)}),ke(_,"compositionstart",function(ie){t.composing={data:ie.data,done:!1}}),ke(_,"compositionupdate",function(ie){t.composing||(t.composing={data:ie.data,done:!1})}),ke(_,"compositionend",function(ie){t.composing&&(ie.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ke(_,"touchstart",function(){return c.forceCompositionEnd()}),ke(_,"input",function(){t.composing||t.readFromDOMSoon()});function ee(ie){if(!K(ie)||et(l,ie))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()}),ie.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=Vo(l);hs({lineWise:!0,text:oe.text}),ie.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,Oe),l.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var he=Vr.text.join(` `);if(ie.clipboardData.setData("Text",he),ie.clipboardData.getData("Text")==he){ie.preventDefault();return}}var Ie=Yo(),Fe=Ie.firstChild;l.display.lineSpace.insertBefore(Ie,l.display.lineSpace.firstChild),Fe.value=Vr.text.join(` `);var Qe=document.activeElement;G(Fe),setTimeout(function(){l.display.lineSpace.removeChild(Ie),Qe.focus(),Qe==_&&c.showPrimarySelection()},50)}ke(_,"copy",ee),ke(_,"cut",ee)},Ei.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ei.prototype.prepareSelection=function(){var e=bi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ei.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ei.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ei.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,c=t.doc.sel.primary(),l=c.from(),_=c.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||_.line=t.display.viewFrom&&Jo(t,l)||{node:ie[0].measure.map[2],offset:0},he=_.linee.firstLine()&&(l=tt(l.line-1,J(e.doc,l.line-1).length)),_.ch==J(e.doc,_.line).text.length&&_.linet.viewTo-1)return!1;var K,ee,ie;l.line==t.viewFrom||(K=Ar(e,l.line))==0?(ee=We(t.view[0].line),ie=t.view[0].node):(ee=We(t.view[K].line),ie=t.view[K-1].node.nextSibling);var oe=Ar(e,_.line),he,Ie;if(oe==t.view.length-1?(he=t.viewTo-1,Ie=t.lineDiv.lastChild):(he=We(t.view[oe+1].line)-1,Ie=t.view[oe+1].node.previousSibling),!ie)return!1;for(var Fe=e.doc.splitLines(tu(e,ie,Ie,ee,he)),Qe=ne(e.doc,tt(ee,0),tt(he,J(e.doc,he).text.length));Fe.length>1&&Qe.length>1;)if(Ke(Fe)==Ke(Qe))Fe.pop(),Qe.pop(),he--;else if(Fe[0]==Qe[0])Fe.shift(),Qe.shift(),ee++;else break;for(var $e=0,Tt=0,Ut=Fe[0],Ht=Qe[0],$t=Math.min(Ut.length,Ht.length);$e<$t&&Ut.charCodeAt($e)==Ht.charCodeAt($e);)++$e;for(var sn=Ke(Fe),Jt=Ke(Qe),cn=Math.min(sn.length-(Fe.length==1?$e:0),Jt.length-(Qe.length==1?$e:0));Ttl.ch&&sn.charCodeAt(sn.length-Tt-1)==Jt.charCodeAt(Jt.length-Tt-1);)$e--,Tt++;Fe[Fe.length-1]=sn.slice(0,sn.length-Tt).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice($e).replace(/\u200b+$/,"");var Rn=tt(ee,$e),En=tt(he,Qe.length?Ke(Qe).length-Tt:0);if(Fe.length>1||Fe[0]||Dt(Rn,En))return Ta(e.doc,Fe,Rn,En,"+input"),!0},Ei.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ei.prototype.reset=function(){this.forceCompositionEnd()},Ei.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ei.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)},Ei.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Dr(this.cm,function(){return Ii(e.cm)})},Ei.prototype.setUneditable=function(e){e.contentEditable="false"},Ei.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||tr(this.cm,Ns)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ei.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ei.prototype.onContextMenu=function(){},Ei.prototype.resetPosition=function(){},Ei.prototype.needsContentAttribute=!0;function Jo(e,t){var c=ci(e,t.line);if(!c||c.hidden)return null;var l=J(e.doc,t.line),_=Tn(c,l,t.line),K=Ot(l,e.doc.direction),ee="left";if(K){var ie=ft(K,t.ch);ee=ie%2?"right":"left"}var oe=On(_.map,t.ch,ee);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Aa(e,t){return t&&(e.bad=!0),e}function tu(e,t,c,l,_){var K="",ee=!1,ie=e.doc.lineSeparator(),oe=!1;function he($e){return function(Tt){return Tt.id==$e}}function Ie(){ee&&(K+=ie,oe&&(K+=ie),ee=oe=!1)}function Fe($e){$e&&(Ie(),K+=$e)}function Qe($e){if($e.nodeType==1){var Tt=$e.getAttribute("cm-text");if(Tt){Fe(Tt);return}var Ut=$e.getAttribute("cm-marker"),Ht;if(Ut){var $t=e.findMarks(tt(l,0),tt(_+1,0),he(+Ut));$t.length&&(Ht=$t[0].find(0))&&Fe(ne(e.doc,Ht.from,Ht.to).join(ie));return}if($e.getAttribute("contenteditable")=="false")return;var sn=/^(pre|div|p|li|table|br)$/i.test($e.nodeName);if(!/^br$/i.test($e.nodeName)&&$e.textContent.length==0)return;sn&&Ie();for(var Jt=0;Jt<$e.childNodes.length;Jt++)Qe($e.childNodes[Jt]);/^(pre|p)$/i.test($e.nodeName)&&(oe=!0),sn&&(ee=!0)}else $e.nodeType==3&&Fe($e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Qe(t),t==c);)t=t.nextSibling,oe=!1;return K}function fs(e,t,c){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[c],!l)return Aa(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,c=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var _=0;_=9&&t.hasSelection&&(t.hasSelection=null),c.poll()}),ke(_,"paste",function(ee){if(et(l,ee)||Go(ee,l))return;l.state.pasteIncoming=+new Date,c.fastPoll()});function K(ee){if(et(l,ee))return;if(l.somethingSelected())hs({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ie=Vo(l);hs({lineWise:!0,text:ie.text}),ee.type=="cut"?l.setSelections(ie.ranges,null,Oe):(c.prevInput="",_.value=ie.text.join(` `),G(_))}else return;ee.type=="cut"&&(l.state.cutIncoming=+new Date)}ke(_,"cut",K),ke(_,"copy",K),ke(e.scroller,"paste",function(ee){if(Un(e,ee)||et(l,ee))return;if(!_.dispatchEvent){l.state.pasteIncoming=+new Date,c.focus();return}var ie=new Event("paste");ie.clipboardData=ee.clipboardData,_.dispatchEvent(ie)}),ke(e.lineSpace,"selectstart",function(ee){Un(e,ee)||ue(ee)}),ke(_,"compositionstart",function(){var ee=l.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:ee,range:l.markText(ee,l.getCursor("to"),{className:"CodeMirror-composing"})}}),ke(_,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},Fi.prototype.createField=function(e){this.wrapper=Yo(),this.textarea=this.wrapper.firstChild},Fi.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Fi.prototype.prepareSelection=function(){var e=this.cm,t=e.display,c=e.doc,l=bi(e);if(e.options.moveInputWithCursor){var _=ui(e,c.sel.primary().head,"div"),K=t.wrapper.getBoundingClientRect(),ee=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,_.top+ee.top-K.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,_.left+ee.left-K.left))}return l},Fi.prototype.showSelection=function(e){var t=this.cm,c=t.display;g(c.cursorDiv,e.cursors),g(c.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Fi.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var c=t.getSelection();this.textarea.value=c,t.state.focused&&G(this.textarea),H&&N>=9&&(this.hasSelection=c)}else e||(this.prevInput=this.textarea.value="",H&&N>=9&&(this.hasSelection=null))},Fi.prototype.getField=function(){return this.textarea},Fi.prototype.supportsTouch=function(){return!1},Fi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},Fi.prototype.blur=function(){this.textarea.blur()},Fi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Fi.prototype.receivedFocus=function(){this.slowPoll()},Fi.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()})},Fi.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function c(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,c)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,c)},Fi.prototype.poll=function(){var e=this,t=this.cm,c=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||rt(c)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var _=c.value;if(_==l&&!t.somethingSelected())return!1;if(H&&N>=9&&this.hasSelection===_||i&&/[\uf700-\uf7ff]/.test(_))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var K=_.charCodeAt(0);if(K==8203&&!l&&(l="\u200B"),K==8666)return this.reset(),this.cm.execCommand("undo")}for(var ee=0,ie=Math.min(l.length,_.length);ee1e3||_.indexOf(` `)>-1?c.value=e.prevInput="":e.prevInput=_,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Fi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Fi.prototype.onKeyPress=function(){H&&N>=9&&(this.hasSelection=null),this.fastPoll()},Fi.prototype.onContextMenu=function(e){var t=this,c=t.cm,l=c.display,_=t.textarea;t.contextMenuPending&&t.contextMenuPending();var K=$i(c,e),ee=l.scroller.scrollTop;if(!K||m)return;var ie=c.options.resetSelectionOnContextMenu;ie&&c.doc.sel.contains(K)==-1&&tr(c,dr)(c.doc,ra(K),Oe);var oe=_.style.cssText,he=t.wrapper.style.cssText,Ie=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",_.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Ie.top-5)+"px; left: "+(e.clientX-Ie.left-5)+`px; z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Fe;n&&(Fe=window.scrollY),l.input.focus(),n&&window.scrollTo(null,Fe),l.input.reset(),c.somethingSelected()||(_.value=t.prevInput=" "),t.contextMenuPending=$e,l.selForContextMenu=c.doc.sel,clearTimeout(l.detectingSelectAll);function Qe(){if(_.selectionStart!=null){var Ut=c.somethingSelected(),Ht="\u200B"+(Ut?_.value:"");_.value="\u21DA",_.value=Ht,t.prevInput=Ut?"":"\u200B",_.selectionStart=1,_.selectionEnd=Ht.length,l.selForContextMenu=c.doc.sel}}function $e(){if(t.contextMenuPending!=$e)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=he,_.style.cssText=oe,H&&N<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=ee),_.selectionStart!=null){(!H||H&&N<9)&&Qe();var Ut=0,Ht=function(){l.selForContextMenu==c.doc.sel&&_.selectionStart==0&&_.selectionEnd>0&&t.prevInput=="\u200B"?tr(c,po)(c):Ut++<10?l.detectingSelectAll=setTimeout(Ht,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(Ht,200)}}if(H&&N>=9&&Qe(),R){we(e);var Tt=function(){ct(window,"mouseup",Tt),setTimeout($e,20)};ke(window,"mouseup",Tt)}else setTimeout($e,50)},Fi.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Fi.prototype.setUneditable=function(){},Fi.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?O(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 c=U();t.autofocus=c==e||e.getAttribute("autofocus")!=null&&c==document.body}function l(){e.value=ie.getValue()}var _;if(e.form&&(ke(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var K=e.form;_=K.submit;try{var ee=K.submit=function(){l(),K.submit=_,K.submit(),K.submit=ee}}catch(oe){}}t.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(ct(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=_))}},e.style.display="none";var ie=Ai(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return ie}function ru(e){e.off=ct,e.on=ke,e.wheelEventPixels=dl,e.Doc=br,e.splitLines=qe,e.countColumn=V,e.findColumn=He,e.isWordChar=ht,e.Pass=Re,e.signal=Ge,e.Line=fr,e.changeEnd=aa,e.scrollbarModel=Ks,e.Pos=tt,e.cmpPos=Dt,e.modes=nt,e.mimeModes=Xe,e.resolveMode=Ve,e.getMode=gt,e.modeExtensions=It,e.extendMode=Zt,e.copyState=le,e.startState=B,e.innerMode=re,e.commands=Ya,e.keyMap=qr,e.keyName=Lo,e.isModifierKey=Ro,e.lookupKey=Ca,e.normalizeKeyMap=Pl,e.StringStream=$,e.SharedTextMarker=za,e.TextMarker=oa,e.LineWidget=Ga,e.e_preventDefault=ue,e.e_stopPropagation=fe,e.e_stop=we,e.addClass=j,e.contains=y,e.rmClass=v,e.keyNames=la}$l(Ai),ql(Ai);var au="iter insert remove copy getEditor constructor".split(" ");for(var ps in br.prototype)br.prototype.hasOwnProperty(ps)&&ae(au,ps)<0&&(Ai.prototype[ps]=function(e){return function(){return e.apply(this.doc,arguments)}}(br.prototype[ps]));return xe(br),Ai.inputStyles={textarea:Fi,contenteditable:Ei},Ai.defineMode=function(e){!Ai.defaults.mode&&e!="null"&&(Ai.defaults.mode=e),Pt.apply(this,arguments)},Ai.defineMIME=Mt,Ai.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ai.defineMIME("text/plain","null"),Ai.defineExtension=function(e,t){Ai.prototype[e]=t},Ai.defineDocExtension=function(e,t){br.prototype[e]=t},Ai.fromTextArea=iu,ru(Ai),Ai.version="5.58.2",Ai})},W7jJ:function(je,ce,D){"use strict";D.r(ce);var Z=D("0Owb"),z=D("PpiC"),M=D("OaEy"),X=D("2fM7"),F=D("T2oS"),I=D("W9HT"),H=D("miYZ"),N=D("tsqr"),n=D("2qtc"),P=D("kLXV"),p=D("9og8"),m=D("tJVT"),d=D("k1fw"),u=D("aHsQ"),o=D("sGsY"),h=D("WmNS"),r=D.n(h),a=D("q1tI"),i=D.n(a),s=D("Fvcw"),S=D("GIiI"),x=D("Ty5D"),T=D("9kvl"),R=D("55Ip"),w=D("7qur"),v=D("cDPC"),b=D("m3rI"),g=D("RCxd"),f=D("EHPI"),C=D("J66h"),E=D("uMZB"),y=D.n(E),U=D("sNtx"),j=D("RpDr"),A=D("+L6B"),G=D("2/Rp"),W=D("y8nQ"),O=D("Vl3Y"),V=D("5NDa"),te=D("5rEg"),ae=te.a.TextArea,me=5e3,Re=function(Je){var vt=Je.callback,Kt=Je.onCancel,fn=Je.notes;function an(Vt){vt(Vt)}return i.a.createElement(O.a,{className:"note-form-panel",onFinish:an,initialValues:{notes:fn}},i.a.createElement(O.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:me,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(me)}]},i.a.createElement(ae,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),i.a.createElement(O.a.Item,{style:{textAlign:"right"}},i.a.createElement(G.a,{type:"ghost",onClick:Kt,style:{marginRight:10}}," ","\u53D6\u6D88"," "),i.a.createElement(G.a,{type:"primary",htmlType:"submit"}," ","\u63D0\u4EA4"," ")))},Oe=D("ZsLC"),Ce=D.n(Oe),Pe=D("DjyN"),He=D("NUBc"),Ee=D("g9YV"),be=D("wCAj"),Ke=D("Hw79"),bt=D.n(Ke),Et=D("ye1Q"),yt=D("lfch"),pt=D("bdLU"),st=D("1vsH"),ht=D("wd/R"),wt=D.n(ht),_e=be.a.Column,Me=function(Je){var vt=Je.submitResult,Kt=Je.submitting,fn=Je.submitRecords,an=Je.page,Vt=Je.onPageChange,it=Je.topicId,xt=vt||{},dn=xt.status,mt=xt.id,hn=xt.input,jt=xt.output,vn=xt.expected_output,Hn=xt.is_file,Mn=xt.input_file_url,Sn=xt.output_file_url,ii=xt.expected_output_file_url,An=xt.error_msg,Zn=fn||{},qn=Zn.records,_i=Zn.records_count,Un=Object(x.i)();function gi(){Hn?navigator.clipboard.writeText(C.Base64.decode(An)).then(function(){N.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(C.Base64.decode(jt)).then(function(){N.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return i.a.createElement(I.a,{spinning:Kt,tip:"\u8BC4\u6D4B\u4E2D...",indicator:i.a.createElement(Et.a,{style:{fontSize:24},spin:!0})},mt?i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:bt.a.info},i.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",i.a.createElement("span",{className:dn===pt.a.OK?"c-green":"c-red"},j.a[dn])),i.a.createElement("li",{className:bt.a.error},i.a.createElement("a",{onClick:gi},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",i.a.createElement(yt.a,null)," ")),i.a.createElement("li",null,i.a.createElement(R.a,{to:"/problems/".concat(it,"/record-detail/").concat(mt,"?backId=").concat(Un==null?void 0:Un.save_identifier)},"\u663E\u793A\u8BE6\u60C5 >"," "))),dn!==pt.a.OK?i.a.createElement(i.a.Fragment,null,i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),i.a.createElement("pre",null,!Hn&&hn,Hn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(st.A)(Mn,hn)}},hn)),i.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,(dn===4||dn===5)&&C.Base64.decode(An),dn!=4&&dn!=5&&(Hn?i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(st.A)(Sn,jt)}},jt):C.Base64.decode(jt))),i.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),i.a.createElement("pre",null,!Hn&&C.Base64.decode(vn),Hn&&i.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(st.A)(ii,vn)}},vn))):null):null,(qn==null?void 0:qn.length)>0?i.a.createElement(be.a,{dataSource:qn,rowKey:"id",pagination:!1},i.a.createElement(_e,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(si,kn){return i.a.createElement("span",null," ",wt()(si).format("YYYY-MM-DD HH:mm:ss"))}}),i.a.createElement(_e,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(si,kn){var ei;return i.a.createElement(R.a,{className:si===0?"c-green":"c-red",to:"/problems/".concat(it,"/record-detail/").concat(kn.id,"?backId=").concat(Un==null?void 0:Un.save_identifier)},(ei=j.a[si])===null||ei===void 0?void 0:ei.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),i.a.createElement(_e,{title:"\u6267\u884C\u7528\u65F6 (S)",dataIndex:"execute_time",key:"execute_time"}),i.a.createElement(_e,{title:"\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",dataIndex:"execute_memory",key:"execute_memory"}),i.a.createElement(_e,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"})):null,_i>15?i.a.createElement(He.a,{className:bt.a.pagination,current:an,pageSize:15,total:_i,onChange:Vt}):null)},ye=D("BdwD"),Se=D("DYRE"),Be=D("zeV3"),Ze=D("+BJd"),ot=D("mr32"),ft=D("TcMa"),Ct=D.n(ft),Ot=D("9Bee"),Ne={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u9002\u4E2D",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ke=function(Je){var vt=Je.hack,Kt=Je.onTriggerPraise,fn=Je.toDiscuss,an=vt.language,Vt=vt.difficulty,it=vt.time_limit,xt=vt.username,dn=vt.user_path,mt=vt.user_praise,hn=vt.comments_count,jt=vt.praises_count,vn=vt.description,Hn=vt.pass_count,Mn=vt.submit_count,Sn=Object(x.h)();console.log(vt.language,"language");var ii=Ne[Vt];return i.a.createElement(i.a.Fragment,null,i.a.createElement("ul",{className:Ct.a.info},i.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",i.a.createElement(ot.a,{color:ii.color},ii.name)),i.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",i.a.createElement("b",null,it,"\u79D2"))),i.a.createElement(Ot.a,{value:vn,className:Ct.a.desc}),i.a.createElement("ul",{className:Ct.a["commit-info"]},i.a.createElement("li",null,i.a.createElement(Be.a,{size:4},i.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",i.a.createElement("b",null,Hn))),i.a.createElement("li",null,i.a.createElement(Be.a,{size:4},i.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",i.a.createElement("b",null,Mn))," "),i.a.createElement("li",{style:{flex:"1 0 0"}}),i.a.createElement("li",null,i.a.createElement(Be.a,{size:4},i.a.createElement("i",{className:"iconfont icon-huifu1",onClick:fn})," ",i.a.createElement("b",null,hn))," ")))},at=D("dhSg"),ct=D("ps8w"),Ge=D.n(ct),et=D("oBTY"),Ae=D("M8RZ"),ve=D("OkW/"),xe=D("ErOA");function ue(Je){return Object(xe.c)("comments.json",Je)}function fe(Je){return Object(xe.f)("/discusses/".concat(Je,"/plus.json"),{container_type:"Discuss",type:1})}function de(Je){return Object(xe.f)("comments/reply.json",Je)}function we(Je){return Object(xe.f)("comments.json",Je)}function Le(Je){return Object(xe.f)("comments/".concat(Je==null?void 0:Je.id,"/hidden.json"),Je)}function ze(Je){return Object(xe.b)("comments/".concat(Je==null?void 0:Je.id,".json"))}var dt=D("GgEA"),Lt=D("AMnG"),Ft=D("xKgJ");function kt(Je){var vt=Je.author;return i.a.createElement("a",{href:"/users/".concat(vt.login),target:"_blank"},i.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(b.a.IMG_SERVER,"/images/").concat(vt.image_url),width:"50"}))}function St(Je){var vt=Je.data,Kt=Je.index,fn=Je.parentDiscussIndex,an=Je.user,Vt=Je.onSetActionType,it=vt.author,xt=vt.can_delete,dn=vt.content,mt=vt.id,hn=vt.time;function jt(){Vt({id:mt,index:Kt,type:"delete-discuss",parentDiscussIndex:fn,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var vn=an.admin||xt||it.user_id===an.user_id;return i.a.createElement("div",{className:"discuss-item-container second-discuss "},i.a.createElement(kt,{author:it}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(it.login),target:"_blank"},it.name),i.a.createElement("span",{className:"grey"},hn),i.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},vn?i.a.createElement("a",{onClick:jt,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),i.a.createElement(Ot.a,{className:"discuss-content",value:dn})))}var qe=function(Je){var vt=Je.user,Kt=Je.data,fn=Je.index,an=Je.onPlusDiscuss,Vt=Je.onSetActionType,it=Je.activeDiscussIndex,xt=Je.onReplyDiscuss,dn=Je.onSetActiveDiscussIndex,mt=Kt.content,hn=Kt.children,jt=Kt.hidden,vn=Kt.id,Hn=Kt.praise_count,Mn=Kt.time,Sn=Kt.user_praise,ii=Kt.can_delete,An=Kt.author;console.log(ii&&(!hn||hn.length==0),"children22");function Zn(){dn(vn)}function qn(){an(vn,!Sn,fn)}function _i(){Vt({id:vn,index:fn,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function Un(){Vt({id:vn,index:fn,params:{hidden:jt?"0":"1"},type:"hidden-discuss",message:jt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var gi=vt.admin||vt.user_id===An.user_id;return i.a.createElement("div",{className:"discuss-item-container",key:vn},i.a.createElement(kt,{author:An}),i.a.createElement("section",null,i.a.createElement("div",{className:"discuss-info"},i.a.createElement("a",{href:"/users/".concat(An.login),target:"_blank"}," ",An.name," "),i.a.createElement("span",{className:"grey"},Mn)),i.a.createElement(Ot.a,{className:"discuss-content",value:mt}),hn&&hn.length>0?i.a.createElement("div",{className:"reply-discuss-container"},hn.map(function(vi,si){return i.a.createElement(St,{key:vi.id,data:vi,index:si,user:vt,onSetActionType:Vt,parentDiscussIndex:fn})})):null,i.a.createElement("div",{className:"btn-group"},Object(Ft.v)()?i.a.createElement("a",{onClick:Un,title:jt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},i.a.createElement("i",{className:jt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,ii&&(!hn||hn.length==0)?i.a.createElement("a",{onClick:_i,title:"\u5220\u9664"},i.a.createElement("i",{className:"iconfont icon-shanchu"})):null,i.a.createElement("a",{onClick:Zn,title:"\u56DE\u590D"}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," "),i.a.createElement("a",{onClick:qn,className:Sn?"c-orange":""},i.a.createElement("i",{className:Sn?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),i.a.createElement("span",null,Hn||""))),i.a.createElement(Lt.a,{id:vn,activeDiscussIndex:it,onReplyDiscuss:xt})))},rt=D("kaH+"),Ye=D("Wx9E"),pe=D("Ot1p"),Te=function(Je){var vt=Je.user_praise,Kt=Je.praise_count,fn=Je.praisePlus,an=Je.onCreateDiscuss,Vt=Je.discuss_count,it=Object(a.useState)(!1),xt=Object(m.a)(it,2),dn=xt[0],mt=xt[1],hn=Object(a.useState)(""),jt=Object(m.a)(hn,2),vn=jt[0],Hn=jt[1];function Mn(qn){Hn(qn)}function Sn(){mt(!0)}function ii(){mt(!1)}function An(){return Zn.apply(this,arguments)}function Zn(){return Zn=Object(p.a)(r.a.mark(function qn(){return r.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:an(vn),Hn(""),mt(!1);case 3:case"end":return Un.stop()}},qn)})),Zn.apply(this,arguments)}return i.a.createElement("div",{className:"dis-input-editor-container ".concat(dn?"active":""," ")},i.a.createElement("div",{className:dn?"text-area hide":"text-area"},i.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Sn}),i.a.createElement("a",{style:{alignItems:"center"}}," ",i.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Vt," "),i.a.createElement("a",{className:"c-light-black",onClick:fn,style:{alignItems:"center"},title:vt?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},i.a.createElement("i",{className:"mr3 ".concat(vt?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),Kt?i.a.createElement("span",null,Kt):"")),dn?i.a.createElement("div",{className:"input-mask",onClick:ii}):null,i.a.createElement("div",{className:dn?"md-container":"md-container hide"},i.a.createElement(pe.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:vn,height:240,onChange:Mn}),i.a.createElement("div",{className:"tip-container",onClick:ii},i.a.createElement("a",{className:"btn-send",onClick:An}," ","\u53D1\u9001"," "))))},nt={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},Xe;(function(Je){Je[Je.GET_DISCUSSES=0]="GET_DISCUSSES",Je[Je.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",Je[Je.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",Je[Je.PLUS_DISCUSS=3]="PLUS_DISCUSS",Je[Je.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",Je[Je.SET_PAGE=5]="SET_PAGE",Je[Je.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(Xe||(Xe={}));function Pt(Je,vt){switch(vt.type){case Xe.SHOW_DISCUSSES_LOADING:return Object(d.a)(Object(d.a)({},Je),{},{loading:!0});case Xe.GET_DISCUSSES:return Object(d.a)(Object(d.a)({},Je),vt.payload);case Xe.TOP_OR_DOWN_DISCUSS:return Object(d.a)(Object(d.a)({},Je),vt.payload);case Xe.SET_ACTION_TYPE:return Object(d.a)(Object(d.a)({},Je),vt.payload);case Xe.PLUS_DISCUSS:return Object(d.a)(Object(d.a)({},Je),vt.payload);case Xe.SET_PAGE:return Object(d.a)(Object(d.a)({},Je),{},{page:vt.payload});case Xe.ACTIVE_DISCUSS_INDEX:return Object(d.a)(Object(d.a)({},Je),vt.payload);default:throw new Error}}var Mt=function(Je){var vt=Je.user,Kt=Je.identifier,fn=Je.hack,an=Je.onTriggerPraise,Vt=Je.setDiscussTotal,it=Object(a.useReducer)(Pt,nt),xt=Object(m.a)(it,2),dn=xt[0],mt=xt[1],hn=dn.loading,jt=dn.page,vn=dn.data,Hn=dn.count,Mn=dn.actionType,Sn=dn.activeDiscussIndex,ii=Object(a.useCallback)(Object(p.a)(r.a.mark(function Tn(){var li,yi,ci;return r.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return mt({type:Xe.SHOW_DISCUSSES_LOADING}),In.next=3,ue({container_type:"Practice",container_identifier:Kt,limit:10,page:jt});case 3:li=In.sent,yi=li.comments,ci=li.disscuss_count,mt({type:Xe.GET_DISCUSSES,payload:{data:yi,count:ci,loading:!1}}),Vt(ci);case 7:case"end":return In.stop()}},Tn)})),[jt,Kt]);Object(a.useEffect)(function(){ii()},[Kt,jt]);function An(Tn){mt({type:Xe.SET_PAGE,page:Tn})}function Zn(Tn){mt({type:Xe.SET_ACTION_TYPE,payload:{actionType:Tn}})}function qn(Tn){Sn===Tn?mt({type:Xe.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):mt({type:Xe.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:Tn}})}function _i(Tn,li,yi){return Un.apply(this,arguments)}function Un(){return Un=Object(p.a)(r.a.mark(function Tn(li,yi,ci){var ti;return r.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return _n.prev=0,_n.next=3,fe(li);case 3:ti=_n.sent,vn[ci].user_praise=yi,vn[ci].praise_count=ti.praise_count,mt({type:Xe.PLUS_DISCUSS,payload:{data:Object(et.a)(vn)}}),_n.next=12;break;case 9:_n.prev=9,_n.t0=_n.catch(0),console.log(_n.t0);case 12:case"end":return _n.stop()}},Tn,null,[[0,9]])})),Un.apply(this,arguments)}function gi(){return vi.apply(this,arguments)}function vi(){return vi=Object(p.a)(r.a.mark(function Tn(){var li,yi,ci,ti,In;return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(li=Mn.id,yi=Mn.params,ci=Mn.type,ti=Mn.index,In=Mn.parentDiscussIndex,!(ci==="hidden-discuss")){On.next=7;break}return console.log(yi,"params"),On.next=5,Le(Object(d.a)({id:li,container_type:"Practice",container_identifier:Kt},yi));case 5:In?vn[In].children[ti].hidden=yi.hidden==1:vn[ti].hidden=yi.hidden==1,mt({type:Xe.SET_ACTION_TYPE,payload:{actionType:null,data:Object(et.a)(vn)}});case 7:if(!(ci==="delete-discuss")){On.next=13;break}return On.next=10,ze({id:li,container_type:"Practice",container_identifier:Kt});case 10:return mt({type:Xe.SET_ACTION_TYPE,payload:{actionType:null}}),On.next=13,ii();case 13:case"end":return On.stop()}},Tn)})),vi.apply(this,arguments)}function si(){mt({type:Xe.SET_ACTION_TYPE,payload:{actionType:null}})}function kn(Tn,li){return ei.apply(this,arguments)}function ei(){return ei=Object(p.a)(r.a.mark(function Tn(li,yi){return r.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.prev=0,ti.next=3,de({container_type:"Practice",container_identifier:Kt,comments:{content:yi,parent_id:li}});case 3:ii(),ti.next=9;break;case 6:ti.prev=6,ti.t0=ti.catch(0),console.log(ti.t0);case 9:case"end":return ti.stop()}},Tn,null,[[0,6]])})),ei.apply(this,arguments)}function Kn(Tn){return zt.apply(this,arguments)}function zt(){return zt=Object(p.a)(r.a.mark(function Tn(li){return r.a.wrap(function(ci){for(;;)switch(ci.prev=ci.next){case 0:return mt({type:Xe.SHOW_DISCUSSES_LOADING}),ci.next=3,we({comments:{content:li},container_type:"Practice",container_identifier:Kt});case 3:ii();case 4:case"end":return ci.stop()}},Tn)})),zt.apply(this,arguments)}return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"discuss-panel"},vn.length===0?i.a.createElement(ye.a,null):vn.map(function(Tn,li){return i.a.createElement(qe,{onReplyDiscuss:kn,onPlusDiscuss:_i,onSetActiveDiscussIndex:qn,onSetActionType:Zn,data:Tn,index:li,user:vt,activeDiscussIndex:Sn})}),Hn>10?i.a.createElement("div",{className:"pagination-container"},i.a.createElement(He.a,{showQuickJumper:!0,onChange:An,current:jt,total:Hn})):null),i.a.createElement(Te,{user_praise:fn.user_praise,praise_count:fn.praises_count,praisePlus:an,discuss_count:fn.comments_count,onCreateDiscuss:Kn}),i.a.createElement(Ae.a,null,i.a.createElement(P.a,{centered:!0,title:"\u63D0\u793A",visible:!!Mn,onOk:gi,onCancel:si},i.a.createElement("p",null,Mn?Mn.message:"")),i.a.createElement(rt.a,null)))},Ve=D("1FX+"),gt=D.n(Ve),It=D("pYxM"),Zt=D.n(It),le=D("sB/4"),re=D.n(le),B=D("Wtmd"),$=D.n(B),J=D("CNDd"),ne=D.n(J),ge=D("nCk5"),Ue=D.n(ge),We=D("kovY"),_t=D.n(We),Rt=function(vt){var Kt=vt.style,fn=Kt===void 0?{}:Kt,an=vt.onClick,Vt=vt.onAssist,it=vt.onHide,xt=vt.data,dn=vt.active,mt=vt.showLine;return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:dn===(xt==null?void 0:xt.id)?"".concat(Zt.a.list," ").concat(Zt.a.active):Zt.a.list,style:fn,onClick:function(){return an(xt)}},(xt==null?void 0:xt.video)&&i.a.createElement("div",{className:Zt.a.left},i.a.createElement("img",{src:xt==null?void 0:xt.video_cover}),i.a.createElement("div",null,i.a.createElement("img",{src:re.a}),i.a.createElement("span",null,xt==null?void 0:xt.video_duration)),i.a.createElement("div",{className:Zt.a.mask})),i.a.createElement("div",{className:Zt.a.right},i.a.createElement("div",{className:Zt.a.name},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(xt==null?void 0:xt.image_url),width:30,height:30}),i.a.createElement("div",{title:xt==null?void 0:xt.name,className:Zt.a.title},xt==null?void 0:xt.name),(xt==null?void 0:xt.is_authority)&&i.a.createElement("div",{className:Zt.a.b},"\u5B98\u65B9"),(xt==null?void 0:xt.is_excellent)&&i.a.createElement("div",{className:Zt.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:Zt.a.des},i.a.createElement(Ot.a,{showLines:2,showTextOnly:!0,value:(xt==null?void 0:xt.content)||"\u6682\u65E0\u5185\u5BB9"})),i.a.createElement("div",{className:Zt.a.tag},i.a.createElement("span",{className:"current",onClick:function(jt){jt.stopPropagation(),Vt(xt)}},i.a.createElement("img",{src:xt!=null&&xt.user_liker?ne.a:$.a}),i.a.createElement("span",{style:{color:xt!=null&&xt.user_liker?"#0152d9":"#656f87"}},xt==null?void 0:xt.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:Ue.a}),i.a.createElement("span",null,xt==null?void 0:xt.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:_t.a}),i.a.createElement("span",null,xt==null?void 0:xt.viewed_count)),Object(Ft.v)()&&i.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(jt){jt.stopPropagation(),it(xt)}},xt!=null&&xt.is_hidden?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF")))),mt&&i.a.createElement("div",{className:Zt.a.line}))},Bt=Rt,tt=D("5Dmo"),Dt=D("3S7+"),At=D("Z8dc"),nn=D.n(At),qt=D("7+5b"),Yt=D.n(qt),Q=D("twBr"),L=D.n(Q),k=D("oE5q"),Y=D.n(k),se=D("9+Du"),q=function(vt){var Kt,fn=vt.onClose,an=vt.onOk,Vt=vt.identifier,it=vt.active,xt=O.a.useForm(),dn=Object(m.a)(xt,1),mt=dn[0],hn=Object(a.useState)({}),jt=Object(m.a)(hn,2),vn=jt[0],Hn=jt[1],Mn=Object(a.useState)(!1),Sn=Object(m.a)(Mn,2),ii=Sn[0],An=Sn[1],Zn=Object(a.useState)(!1),qn=Object(m.a)(Zn,2),_i=qn[0],Un=qn[1],gi=Object(a.useState)([]),vi=Object(m.a)(gi,2),si=vi[0],kn=vi[1],ei=Object(Ft.x)(),Kn=Object(x.i)();Object(a.useEffect)(function(){it&&zt()},[it]);var zt=function(){var ln=Object(p.a)(r.a.mark(function Wt(){var tn,mn,hi,Ri,er,Bi,Cr,ui,Or,Nr,Kr,Ur;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(w.k)(Vt,{active:it});case 2:tn=_r.sent,(tn==null?void 0:tn.status)===0&&(Bi={name:tn==null||((mn=tn.data)===null||mn===void 0)?void 0:mn.name,content:tn==null||((hi=tn.data)===null||hi===void 0)?void 0:hi.content},mt.setFieldsValue(Bi),Hn(Bi),tn!=null&&(Ri=tn.data)!==null&&Ri!==void 0&&(er=Ri.videos)!==null&&er!==void 0&&er[0]&&kn([{video_id:tn==null||((Cr=tn.data)===null||Cr===void 0||((ui=Cr.videos)===null||ui===void 0||((Or=ui[0])===null||Or===void 0)))?void 0:Or.video_id,name:tn==null||((Nr=tn.data)===null||Nr===void 0||((Kr=Nr.videos)===null||Kr===void 0||((Ur=Kr[0])===null||Ur===void 0)))?void 0:Ur.title,loaded:100}]));case 4:case"end":return _r.stop()}},Wt)}));return function(){return ln.apply(this,arguments)}}(),Tn=function(Wt,tn){Hn(Object(d.a)({},tn))},li=function(){var ln=Object(p.a)(r.a.mark(function Wt(tn){var mn,hi,Ri,er,Bi;return r.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:if(hi={videos:si,articles:tn},Un(!0),!it){ui.next=9;break}return hi.active=it,ui.next=6,Object(w.j)(Vt,hi);case 6:Ri=ui.sent,ui.next=12;break;case 9:return ui.next=11,Object(w.a)(Vt,hi);case 11:Ri=ui.sent;case 12:((mn=Ri)===null||mn===void 0?void 0:mn.status)===0&&(console.log(it||((er=Ri)===null||er===void 0?void 0:er.id),44),an(it||((Bi=Ri)===null||Bi===void 0?void 0:Bi.id))),Un(!1);case 14:case"end":return ui.stop()}},Wt)}));return function(tn){return ln.apply(this,arguments)}}(),yi=function(Wt){var tn=1024,mn=Wt.name.toLowerCase();return mn&&mn.indexOf(".avi")==-1&&mn.indexOf(".flv")==-1&&mn.indexOf(".f4v")==-1&&mn.indexOf(".m4v")==-1&&mn.indexOf(".mov")==-1&&mn.indexOf(".mp4")==-1&&mn.indexOf(".rmvb")==-1&&mn.indexOf(".swf")==-1&&mn.indexOf(".webm")==-1&&mn.indexOf(".wmv")==-1?(N.b.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F"),!0):Wt.size>tn*1024*1024?(N.b.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(tn,"M")),!0):si!=null&&si.find(function(hi){return hi.name===Wt.name})?(N.b.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"),!0):!1},ci=function(Wt,tn){P.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:i.a.createElement("div",{className:"tc"},"\u60A8\u786E\u8BA4\u8981",tn?"\u5220\u9664":"\u53D6\u6D88\u4E0A\u4F20","\u8BE5\u89C6\u9891\u5417\uFF1F"),onOk:function(){kn([])}})},ti={accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*",onBefore:yi,onBeginInitFile:function(Wt){An(!0),kn([{name:Wt.filename,loaded:0}])},onComplete:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent,video_id:Wt.id}]),An(!1)},onError:function(){kn([]),An(!1)},onProgress:function(Wt){kn([{name:Wt.filename,loaded:Wt.percent}])},chunkSize:1024*1024*2,options:{user_id:ei==null?void 0:ei.user_id}},In=function(){return i.a.createElement(se.a,ti,i.a.createElement("div",{className:nn.a.main},i.a.createElement("img",{src:Yt.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u89C6\u9891")))},_n=function(Wt){return i.a.createElement("div",{className:nn.a.mainLoading},i.a.createElement("div",{className:nn.a.proWarp},i.a.createElement("div",{className:nn.a.pro},i.a.createElement("div",{style:{width:Wt}})),i.a.createElement("span",null,Wt||0,"%")),i.a.createElement("aside",null,"\u4E0A\u4F20\u4E2D"),i.a.createElement("div",{className:nn.a.tip},i.a.createElement(Dt.a,{getPopupContainer:function(mn){return mn.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:Y.a,alt:""}))))},On=function(Wt){return i.a.createElement("div",{className:nn.a.mainSucceed},i.a.createElement("img",{src:L.a,alt:""}),i.a.createElement("span",null,"\u4E0A\u4F20\u6210\u529F"),i.a.createElement("div",{className:nn.a.tip},i.a.createElement(Dt.a,{getPopupContainer:function(mn){return mn.parentNode},title:i.a.createElement("div",null,i.a.createElement("div",null,"1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F",i.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"),"\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"),i.a.createElement("div",null,"2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"),i.a.createElement("div",null,"3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"))},i.a.createElement("img",{src:Y.a,alt:""}))),i.a.createElement("div",{className:nn.a.del,onClick:function(){return ci(Wt.name,Wt.loaded==100)}},i.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"\u5220\u9664\u89C6\u9891"))},Gt=function(){return i.a.createElement(i.a.Fragment,null,si==null?void 0:si.map(function(Wt,tn){return i.a.createElement(i.a.Fragment,{key:tn},Wt.loaded==100?On(Wt):_n(Wt.loaded))}))},Xt=function(){P.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u6CE8\u610F",icon:null,className:"custom-modal-divider",content:"\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",onOk:fn})},on=si==null?void 0:si.length;return i.a.createElement("div",{className:nn.a.listForm},i.a.createElement("header",null,it?"\u7F16\u8F91":"\u53D1\u5E03","\u9898\u89E3"),i.a.createElement("section",{className:nn.a.scroll,id:"sss"},i.a.createElement("div",{className:nn.a.formWrap}," ",i.a.createElement(O.a,{form:mt,scrollToFirstError:!0,layout:"vertical",onValuesChange:Tn,onFinish:li},i.a.createElement(O.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0"},{max:60,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},i.a.createElement(te.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((Kt=vn.name)===null||Kt===void 0?void 0:Kt.length)||0,"/60")})),i.a.createElement(O.a.Item,{name:"content",label:"\u5185\u5BB9:"},i.a.createElement(pe.a,{defaultValue:vn.content||"",watch:!0})))),i.a.createElement("div",{className:nn.a.upload},on?Gt():In())),i.a.createElement("div",{className:nn.a.btns},i.a.createElement(G.a,{onClick:Xt,type:"primary",ghost:!0},"\u5173\u95ED"),i.a.createElement(G.a,{loading:_i,disabled:ii,onClick:function(){return mt.submit()},type:"primary"},"\u53D1\u5E03\u9898\u89E3")))},De=q,lt=D("cWXX"),Nt=D("/ezw"),Qt=D("CaVn"),ut=D.n(Qt),en=D("s8/Y"),gn=D.n(en),Yn=D("JOrW"),mi=D.n(Yn),ri=D("gqXR"),Nn=D.n(ri),Gi=D("14J3"),zi=D("BMrR"),ni=D("jCWc"),di=D("kPKH"),ji=D("wW8i"),Mi=D.n(ji),wi=D("MVJL"),Ci=D.n(wi),ar=function(vt){var Kt=vt.id,fn=vt.cb,an=Object(a.useState)(""),Vt=Object(m.a)(an,2),it=Vt[0],xt=Vt[1];return i.a.createElement("aside",{className:"mt10"},i.a.createElement(pe.a,{defaultValue:it,id:"writeForumsReviewId",onChange:function(mt){xt(mt)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(zi.a,null,i.a.createElement(di.a,{flex:"1"}),i.a.createElement(di.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:Object(p.a)(r.a.mark(function dn(){return r.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:it===""?N.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"):fn(Kt,it);case 1:case"end":return hn.stop()}},dn)}))},"\u53D1\u9001"))))},Zi=function(vt){var Kt,fn=vt.data;return i.a.createElement("div",{className:Ci.a.thirdlyLevelDiscuss},i.a.createElement("span",{className:"c-grey-333"},i.a.createElement("span",{className:"font 14 c-light-primary"},fn==null||((Kt=fn.author)===null||Kt===void 0)?void 0:Kt.name),"@",i.a.createElement("span",{className:"font 14 c-light-primary"},fn==null?void 0:fn.parent_name),":"),i.a.createElement(Ot.a,{value:fn==null?void 0:fn.content}))},lr=function(vt){var Kt,fn,an,Vt,it=vt.data,xt=vt.onReplyDiscuss,dn=vt.thirdlyReply,mt=vt.setThirdlyReply,hn=Object(Ft.x)();return console.log(hn,"user"),i.a.createElement("div",{className:Ci.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(it==null||((Kt=it.author)===null||Kt===void 0)?void 0:Kt.image_url)}),i.a.createElement("div",{className:Ci.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333"},it==null||((fn=it.author)===null||fn===void 0)?void 0:fn.name),(hn==null?void 0:hn.login)!==(it==null||((an=it.author)===null||an===void 0)?void 0:an.login)&&i.a.createElement("span",{onClick:function(){return mt(it==null?void 0:it.id)},className:"c-grey-999 current",style:{float:"right"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),i.a.createElement("span",null,"\u56DE\u590D"))),i.a.createElement(Ot.a,{value:it==null?void 0:it.content}),it==null||((Vt=it.children)===null||Vt===void 0)?void 0:Vt.map(function(jt){return i.a.createElement(Zi,{key:jt.id,data:jt})}),dn===(it==null?void 0:it.id)&&i.a.createElement("div",null,i.a.createElement(ar,{id:it==null?void 0:it.id,cb:xt}),i.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return mt(null)},className:"c-light-primary current"},i.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"\u6536\u8D77\u56DE\u590D")),i.a.createElement("div",{className:Ci.a.line})))},Vi=function(vt){var Kt,fn,an,Vt,it=vt.data,xt=vt.onReplyDiscuss,dn=vt.secondReply,mt=vt.setSecondReply,hn=vt.thirdlyReply,jt=vt.setThirdlyReply,vn=vt.onPlusDiscuss,Hn=Object(a.useState)(!1),Mn=Object(m.a)(Hn,2),Sn=Mn[0],ii=Mn[1];return console.log(it,"data"),i.a.createElement("div",{className:Ci.a.discussItem},i.a.createElement("div",{className:Ci.a.list},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(it==null||((Kt=it.author)===null||Kt===void 0)?void 0:Kt.image_url)}),i.a.createElement("div",{className:Ci.a.wrap},i.a.createElement("div",{className:"font14",style:{marginBottom:6}},i.a.createElement("span",{className:"c-grey-333 mr30"},it==null||((fn=it.author)===null||fn===void 0)?void 0:fn.name),i.a.createElement("span",{className:"c-grey-999"},it==null?void 0:it.time)),i.a.createElement(Ot.a,{value:it==null?void 0:it.content}),i.a.createElement("div",{className:Ci.a.btns},i.a.createElement("div",{onClick:function(){return vn(it==null?void 0:it.id)},className:it!=null&&it.user_praise?"c-light-primary":"c-grey-999"},i.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),i.a.createElement("span",null,it==null?void 0:it.praise_count)),i.a.createElement("div",{onClick:function(){var Zn;if((it==null||((Zn=it.children)===null||Zn===void 0)?void 0:Zn.length)===0)return;mt(null),ii(!Sn)},style:{color:Sn?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),i.a.createElement("span",null,Sn?"\u6536\u8D77\u8BC4\u8BBA":it==null||((an=it.children)===null||an===void 0)?void 0:an.length)),i.a.createElement("div",{onClick:function(){ii(!1),mt(dn===(it==null?void 0:it.id)?null:it==null?void 0:it.id)},style:{color:dn===(it==null?void 0:it.id)?"#0152d9":"#999999"}},i.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),i.a.createElement("span",null,dn===(it==null?void 0:it.id)?"\u6536\u8D77\u56DE\u590D":"\u56DE\u590D"))),dn===(it==null?void 0:it.id)&&i.a.createElement(ar,{id:it==null?void 0:it.id,cb:function(Zn,qn){xt(Zn,qn),ii(!0)}}),Sn&&i.a.createElement("div",{className:Ci.a.secondLevelDiscuss},it==null||((Vt=it.children)===null||Vt===void 0)?void 0:Vt.map(function(An){return i.a.createElement(lr,{thirdlyReply:hn,setThirdlyReply:jt,key:An.id,data:An,onReplyDiscuss:xt})})))))},qi=Vi,ur=function(vt){var Kt=vt.identifier,fn=vt.active,an=vt.onOk,Vt=Object(a.useState)(""),it=Object(m.a)(Vt,2),xt=it[0],dn=it[1],mt=Object(a.useState)(1),hn=Object(m.a)(mt,2),jt=hn[0],vn=hn[1],Hn=Object(a.useState)([]),Mn=Object(m.a)(Hn,2),Sn=Mn[0],ii=Mn[1],An=Object(a.useState)(0),Zn=Object(m.a)(An,2),qn=Zn[0],_i=Zn[1],Un=Object(a.useState)(null),gi=Object(m.a)(Un,2),vi=gi[0],si=gi[1],kn=Object(a.useState)(null),ei=Object(m.a)(kn,2),Kn=ei[0],zt=ei[1];Object(a.useEffect)(function(){Tn(1),vn(1)},[fn]);var Tn=function(){var In=Object(p.a)(r.a.mark(function _n(On){var Gt;return r.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,ue({container_type:"QuestionSolutionArticle",container_identifier:fn,limit:5,page:On});case 2:Gt=on.sent,Gt!=null&&Gt.comments&&(ii((Gt==null?void 0:Gt.comments)||[]),vn(On),_i(Gt==null?void 0:Gt.disscuss_count));case 4:case"end":return on.stop()}},_n)}));return function(On){return In.apply(this,arguments)}}(),li=function(){var In=Object(p.a)(r.a.mark(function _n(){var On;return r.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(xt==="")){Xt.next=3;break}return N.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Xt.abrupt("return");case 3:return Xt.next=5,we({comments:{content:xt},container_type:"QuestionSolutionArticle",container_identifier:fn});case 5:On=Xt.sent,On!=null&&On.discuss&&(dn(""),Tn(jt),an());case 7:case"end":return Xt.stop()}},_n)}));return function(){return In.apply(this,arguments)}}(),yi=function(){var In=Object(p.a)(r.a.mark(function _n(On,Gt,Xt){var on;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,de({container_type:"QuestionSolutionArticle",container_identifier:fn,comments:{content:Gt,parent_id:On}});case 2:on=Wt.sent,si(null),zt(null),Tn(jt);case 6:case"end":return Wt.stop()}},_n)}));return function(On,Gt,Xt){return In.apply(this,arguments)}}(),ci=function(){var In=Object(p.a)(r.a.mark(function _n(On){var Gt;return r.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,fe(On);case 2:Gt=on.sent,Tn(jt);case 4:case"end":return on.stop()}},_n)}));return function(On){return In.apply(this,arguments)}}(),ti=function(_n){vn(_n),Tn(_n)};return i.a.createElement("div",{className:Mi.a.discuss},i.a.createElement("aside",{className:Mi.a.reply,style:{borderWidth:qn?1:0}},i.a.createElement(pe.a,{defaultValue:xt,id:"writeForumsReviewId",onChange:function(_n){dn(_n)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),i.a.createElement(zi.a,null,i.a.createElement(di.a,{flex:"1"}),i.a.createElement(di.a,null,i.a.createElement(G.a,{type:"primary",size:"large",onClick:function(){return li()}},"\u53D1\u9001")))),Sn==null?void 0:Sn.map(function(In){return i.a.createElement(qi,{secondReply:vi,setSecondReply:si,thirdlyReply:Kn,setThirdlyReply:zt,key:In.id,data:In,onReplyDiscuss:yi,onPlusDiscuss:ci})}),i.a.createElement(He.a,{className:Mi.a.pagination,showTotal:function(_n){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},_n),"\u6761\u6570\u636E")},current:jt,onChange:ti,total:qn,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},Mr=ur,Li=D("hgre"),Fn=function(vt){var Kt,fn,an,Vt,it,xt,dn,mt,hn,jt,vn=vt.active,Hn=vt.identifier,Mn=vt.onAssist,Sn=vt.onEdit,ii=vt.onArticlesSkip,An=vt.onClose,Zn=vt.onOk,qn=vt.onDelete,_i=vt.detailsIndex,Un=vt.btnShowStatus,gi=Object(a.useState)(!0),vi=Object(m.a)(gi,2),si=vi[0],kn=vi[1],ei=Object(a.useState)({}),Kn=Object(m.a)(ei,2),zt=Kn[0],Tn=Kn[1];Object(a.useEffect)(function(){vn&&li()},[vn,_i]);var li=function(){var _n=Object(p.a)(r.a.mark(function On(){var Gt,Xt,on=arguments;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Gt=on.length>0&&on[0]!==void 0?on[0]:!0,Gt&&kn(!0),Wt.next=4,Object(w.d)(Hn,{active:vn});case 4:Xt=Wt.sent,(Xt==null?void 0:Xt.status)===0&&Tn((Xt==null?void 0:Xt.data)||{}),kn(!1);case 7:case"end":return Wt.stop()}},On)}));return function(){return _n.apply(this,arguments)}}(),yi=function(){var _n=Object(p.a)(r.a.mark(function On(Gt){var Xt;return r.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(w.g)(Hn,Object(d.a)({active:vn},Gt));case 2:Xt=ln.sent,(Xt==null?void 0:Xt.status)===0&&(li(!1),Zn());case 4:case"end":return ln.stop()}},On)}));return function(Gt){return _n.apply(this,arguments)}}(),ci=function(){var _n=Object(p.a)(r.a.mark(function On(Gt){var Xt;return r.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(w.c)(Hn,{active:Gt==null?void 0:Gt.id});case 2:Xt=ln.sent,Xt.status===0&&(li(!1),Zn());case 4:case"end":return ln.stop()}},On)}));return function(Gt){return _n.apply(this,arguments)}}(),ti=function(On){P.a.confirm({centered:!0,width:500,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:null,className:"custom-modal-divider",content:"\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",onOk:function(){return qn(On)}})},In=function(){li(!1),Zn()};return i.a.createElement("div",{className:ut.a.listDetails},i.a.createElement(Nt.a,{className:"pt20 pl20 pr20",loading:si,active:!0,paragraph:{rows:5}},i.a.createElement("div",{className:ut.a.head},i.a.createElement("div",{className:ut.a.name},i.a.createElement("div",{title:zt==null?void 0:zt.name,className:ut.a.title},zt==null?void 0:zt.name),(zt==null?void 0:zt.is_authority)&&i.a.createElement("div",{className:ut.a.b},"\u5B98\u65B9"),(zt==null?void 0:zt.is_excellent)&&i.a.createElement("div",{className:ut.a.a},"\u7CBE\u9009")),i.a.createElement("div",{className:ut.a.tag},i.a.createElement("img",{src:b.a.IMG_SERVER+"/images/"+(zt==null?void 0:zt.image_url)}),i.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},zt==null?void 0:zt.username),i.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"\u53D1\u5E03\u4E8E",wt()(zt==null?void 0:zt.created_at).format("YYYY-MM-DD")),i.a.createElement("span",null,i.a.createElement("img",{src:$.a}),i.a.createElement("span",null,zt==null?void 0:zt.praises_count)),i.a.createElement("span",null,i.a.createElement("img",{src:Ue.a}),i.a.createElement("span",null,zt==null?void 0:zt.discusses_count)),i.a.createElement("span",null,i.a.createElement("img",{src:_t.a}),i.a.createElement("span",null,zt==null?void 0:zt.viewed_count)),i.a.createElement("div",{className:ut.a.btn},(Object(Ft.v)()||(zt==null?void 0:zt.is_self))&&i.a.createElement(i.a.Fragment,null,i.a.createElement(G.a,{onClick:function(){return ti(zt)},type:"primary",ghost:!0},"\u5220\u9664"),i.a.createElement(G.a,{onClick:function(){return Sn(zt)},type:"primary",ghost:!0},"\u7F16\u8F91")),Object(Ft.v)()&&i.a.createElement(G.a,{onClick:function(){return yi({is_authority:!(zt!=null&&zt.is_authority)})},type:"primary"},i.a.createElement("img",{src:mi.a}),zt!=null&&zt.is_authority?"\u53D6\u6D88":"\u8BBE\u4E3A","\u5B98\u65B9"),Object(Ft.v)()&&i.a.createElement(G.a,{onClick:function(){return yi({is_excellent:!(zt!=null&&zt.is_excellent)})},type:"primary"},i.a.createElement("img",{src:gn.a}),zt!=null&&zt.is_excellent?"\u53D6\u6D88":"\u8BBE\u4E3A","\u7CBE\u9009")))),i.a.createElement("div",{className:ut.a.scroll},(zt==null||((Kt=zt.videos)===null||Kt===void 0||((fn=Kt[0])===null||fn===void 0))?void 0:fn.id)&&i.a.createElement("div",{className:ut.a.video},i.a.createElement(I.a,{tip:"\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",spinning:!(zt!=null&&(an=zt.videos)!==null&&an!==void 0&&(Vt=an[0])!==null&&Vt!==void 0&&Vt.transcoded)},i.a.createElement(Li.a,{poster:zt==null||((it=zt.videos)===null||it===void 0||((xt=it[0])===null||xt===void 0))?void 0:xt.cover_url,src:(zt==null||((dn=zt.videos)===null||dn===void 0||((mt=dn[0])===null||mt===void 0))?void 0:mt.play_url)||"",videoId:zt==null||((hn=zt.videos)===null||hn===void 0||((jt=hn[0])===null||jt===void 0))?void 0:jt.id,logWatchHistory:function(){}}))),i.a.createElement(Ot.a,{className:ut.a.html,value:(zt==null?void 0:zt.content)||""}),i.a.createElement("div",{onClick:function(){return ci(zt)},className:ut.a.g},i.a.createElement("img",{className:"mr10",src:(zt!=null&&zt.user_liker,Nn.a)}),i.a.createElement("span",null,zt==null?void 0:zt.praises_count)),i.a.createElement(Mr,{onOk:In,active:vn,identifier:Hn})),i.a.createElement("div",{className:ut.a.btns},i.a.createElement(G.a,{onClick:function(){return An()},type:"primary",ghost:!0},"\u5173\u95ED"),Un[0]&&i.a.createElement(G.a,{onClick:function(On){return ii(On,"prev")},style:{marginLeft:20},type:"primary"},"\u4E0A\u4E00\u9898\u89E3"),Un[1]&&i.a.createElement(G.a,{onClick:function(On){return ii(On,"next")},style:{marginLeft:20},type:"primary"},"\u4E0B\u4E00\u9898\u89E3"))))},Pn=Fn,xi=D("3tLw"),Wn=D.n(xi),Si=D("ek7X"),ai=D("0NbB"),Tr=function(vt){var Kt=vt.identifier,fn=vt.tabStatus,an=vt.setFilterListTotal,Vt=vt.setListStatus,it={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},xt=Object(a.useState)(Object(d.a)({},it)),dn=Object(m.a)(xt,2),mt=dn[0],hn=dn[1],jt=Object(a.useState)(!1),vn=Object(m.a)(jt,2),Hn=vn[0],Mn=vn[1],Sn=Object(a.useState)(0),ii=Object(m.a)(Sn,2),An=ii[0],Zn=ii[1],qn=Object(a.useState)(1),_i=Object(m.a)(qn,2),Un=_i[0],gi=_i[1],vi=Object(a.useState)(null),si=Object(m.a)(vi,2),kn=si[0],ei=si[1],Kn=Object(a.useState)([]),zt=Object(m.a)(Kn,2),Tn=zt[0],li=zt[1],yi=Object(a.useState)([!0,!0]),ci=Object(m.a)(yi,2),ti=ci[0],In=ci[1],_n=Object(a.useState)(0),On=Object(m.a)(_n,2),Gt=On[0],Xt=On[1],on=Object(a.useRef)(null);Object(a.useEffect)(function(){ui()},[fn]),Object(a.useEffect)(function(){ln()},[kn]),Object(a.useEffect)(function(){tn(Object(d.a)({},it)),ui()},[Kt]),Object(a.useEffect)(function(){return window.addEventListener("resize",Wt),Vt(Gt),function(){window.removeEventListener("resize",Wt)}},[Gt]);var ln=function(){var fi=Object(p.a)(r.a.mark(function xn(){var Gn,Xn;return r.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(kn){zn.next=3;break}return In([!0,!0]),zn.abrupt("return");case 3:Gn=[!0,!0],Xn=Tn==null?void 0:Tn.findIndex(function(Rr){return Rr.id===kn}),Xn===0&&mt.page===1&&(Gn[0]=!1),(mt.page-1)*mt.limit+(Xn+1)===mt.total&&(Gn[1]=!1),In(Gn);case 8:case"end":return zn.stop()}},xn)}));return function(){return fi.apply(this,arguments)}}(),Wt=function(){if(Gt){var xn,Gn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(Gn)}},tn=function(){var fi=Object(p.a)(r.a.mark(function xn(Gn){var Xn,Ni,zn,Rr;return r.a.wrap(function($i){for(;;)switch($i.prev=$i.next){case 0:return Mn(!0),$i.next=3,Object(w.f)(Kt,Gn);case 3:return Xn=$i.sent,(Xn==null?void 0:Xn.status)===0&&(li((Xn==null||((Ni=Xn.data)===null||Ni===void 0)?void 0:Ni.articles)||[]),hn(Object(d.a)(Object(d.a)({},Gn),{},{total:Xn==null||((zn=Xn.data)===null||zn===void 0)?void 0:zn.articles_count})),an(Xn==null||((Rr=Xn.data)===null||Rr===void 0)?void 0:Rr.articles_count)),Mn(!1),$i.abrupt("return",Xn);case 7:case"end":return $i.stop()}},xn)}));return function(Gn){return fi.apply(this,arguments)}}(),mn=function(){(mt==null?void 0:mt.sort_direction)===null?mt.sort_direction="asc":(mt==null?void 0:mt.sort_direction)==="asc"?mt.sort_direction="desc":(mt==null?void 0:mt.sort_direction)==="desc"&&(mt.sort_direction=null),mt.page=1,ui(),hn(Object(d.a)({},mt)),tn(mt)},hi=function(){mt.page=1,mt.search=mt==null?void 0:mt.save_search,ui(),hn(Object(d.a)({},mt)),tn(mt)},Ri=function(){var xn,Gn=document.getElementsByClassName("btn-resize");Gn[0].style.visibility="hidden";var Xn=window.innerWidth-((xn=on.current)===null||xn===void 0?void 0:xn.clientWidth);Zn(Xn)},er=function(){Ri(),Xt(1)},Bi=function(xn){Ri(),ei(xn==null?void 0:xn.id),Xt(3)},Cr=function(xn){Ri(),ei(xn==null?void 0:xn.id),Xt(2)},ui=function(){var xn=document.getElementsByClassName("btn-resize");xn[0].style.visibility="visible",Zn(0),Xt(0),ei(null)},Or=function(xn){Xt(3),ei(xn),mt.page=1,hn(Object(d.a)({},mt)),tn(mt)},Nr=function(xn){Xt(3),ei(xn),hn(Object(d.a)({},mt)),tn(mt)},Kr=function(xn){hn(Object(d.a)({},mt)),tn(mt)},Ur=function(){var fi=Object(p.a)(r.a.mark(function xn(Gn){var Xn;return r.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return zn.next=2,Object(w.c)(Kt,{active:Gn==null?void 0:Gn.id});case 2:Xn=zn.sent,Xn.status===0&&(tn(mt),gi(Un+1));case 4:case"end":return zn.stop()}},xn)}));return function(Gn){return fi.apply(this,arguments)}}(),ca=function(){var fi=Object(p.a)(r.a.mark(function xn(Gn){var Xn;return r.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return zn.next=2,Object(w.e)(Kt,{active:Gn==null?void 0:Gn.id});case 2:Xn=zn.sent,Xn.status===0&&(tn(mt),gi(Un+1));case 4:case"end":return zn.stop()}},xn)}));return function(Gn){return fi.apply(this,arguments)}}(),_r=function(){var fi=Object(p.a)(r.a.mark(function xn(Gn){var Xn;return r.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return zn.next=2,Object(w.i)(Kt,{active:Gn==null?void 0:Gn.id});case 2:Xn=zn.sent,Xn.status===0&&(ui(),tn(mt));case 4:case"end":return zn.stop()}},xn)}));return function(Gn){return fi.apply(this,arguments)}}(),ta=function(xn){mt.page=xn,hn(Object(d.a)({},mt)),tn(mt)},Da=function(){var fi=Object(p.a)(r.a.mark(function xn(Gn,Xn){var Ni,zn,Rr,Br,$i,Ar,Ii,sr,Dn,wn,$n;return r.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(Ni=Tn==null?void 0:Tn.findIndex(function(bi){return bi.id===kn}),console.log(Ni,Xn,22),!(Xn==="prev")){Ln.next=21;break}if(!(Ni===void 0)){Ln.next=6;break}return N.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Ln.abrupt("return");case 6:if(!(Ni===0)){Ln.next=19;break}if(!(mt.page===1)){Ln.next=10;break}return N.b.warn("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Ln.abrupt("return");case 10:if(!(mt.page!==1)){Ln.next=17;break}return mt.page=mt.page-1,hn(Object(d.a)({},mt)),Ln.next=15,tn(mt);case 15:zn=Ln.sent,(zn==null?void 0:zn.status)===0&&(Ar=zn==null||((Rr=zn.data)===null||Rr===void 0)?void 0:Rr.articles[(zn==null||((Br=zn.data)===null||Br===void 0||(($i=Br.articles)===null||$i===void 0))?void 0:$i.length)-1],ei(Ar==null?void 0:Ar.id),console.log(Gn.target,555));case 17:Ln.next=21;break;case 19:Ii=Tn[Ni-1],ei(Ii==null?void 0:Ii.id);case 21:if(!(Xn==="next")){Ln.next=39;break}if(!(Ni===void 0)){Ln.next=25;break}return N.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Ln.abrupt("return");case 25:if(!((mt.page-1)*mt.limit+(Ni+1)===mt.total)){Ln.next=28;break}return N.b.warn("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728"),Ln.abrupt("return");case 28:if(!(Ni+1===mt.limit)){Ln.next=37;break}return mt.page=mt.page+1,hn(Object(d.a)({},mt)),Ln.next=33,tn(mt);case 33:sr=Ln.sent,(sr==null?void 0:sr.status)===0&&(wn=sr==null||((Dn=sr.data)===null||Dn===void 0)?void 0:Dn.articles[0],ei(wn==null?void 0:wn.id)),Ln.next=39;break;case 37:$n=Tn[Ni+1],ei($n==null?void 0:$n.id);case 39:case"end":return Ln.stop()}},xn)}));return function(Gn,Xn){return fi.apply(this,arguments)}}();return i.a.createElement("div",{className:gt.a.wrap,ref:on},i.a.createElement("div",{className:gt.a.head},i.a.createElement("div",{className:gt.a.sort,onClick:mn},i.a.createElement("span",null,"\u6700\u65B0"),i.a.createElement("aside",null,i.a.createElement(Si.a,{style:{color:(mt==null?void 0:mt.sort_direction)==="asc"?"#0152d9":"#bfbfbf"}}),i.a.createElement(ai.a,{style:{color:(mt==null?void 0:mt.sort_direction)==="desc"?"#0152d9":"#bfbfbf"}}))),i.a.createElement(te.a.Search,{value:mt.save_search,className:gt.a["oj-width-input"],placeholder:"\u641C\u7D22\u9898\u89E3",onChange:function(xn){mt.save_search=xn.target.value,hn(Object(d.a)({},mt))},onSearch:hi}),i.a.createElement("div",{onClick:er,className:gt.a.btn},i.a.createElement("img",{src:Wn.a}),"\u5199\u9898\u89E3")),i.a.createElement("div",{className:gt.a.listWarp},i.a.createElement(I.a,{spinning:Hn,className:"mt20"},Tn==null?void 0:Tn.map(function(fi,xn){var Gn=!0;return xn+1===Tn.length&&xn!==0&&(Gn=!1),i.a.createElement(Bt,{active:kn,key:fi.id,data:fi,showLine:Gn,onClick:Bi,onAssist:Ur,onHide:ca})}),(Tn==null?void 0:Tn.length)===0&&i.a.createElement(ye.a,{customText:"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"}))),i.a.createElement(He.a,{className:gt.a.pagination,showTotal:function(xn){return i.a.createElement("span",{style:{color:"#656F87"}},"\u5171",i.a.createElement("span",{className:"c-light-primary"},xn),"\u6761\u6570\u636E")},total:mt.total,showSizeChanger:!1,current:mt==null?void 0:mt.page,onChange:ta,hideOnSinglePage:!0,showQuickJumper:!0}),Gt>0&&i.a.createElement("div",{className:gt.a.fixedRight,style:{width:An}},Gt===1&&i.a.createElement(De,{identifier:Kt,onClose:ui,onOk:Or}),Gt===2&&i.a.createElement(De,{active:kn,identifier:Kt,onClose:ui,onOk:Nr}),Gt===3&&i.a.createElement(Pn,{btnShowStatus:ti,onArticlesSkip:Da,detailsIndex:Un,active:kn,identifier:Kt,onClose:ui,onOk:Kr,onEdit:Cr,onAssist:Ur,onDelete:_r})))},ki=Tr,Xi=D("VEzc"),cr=D.n(Xi),gr=function(vt){var Kt,fn=vt.visible,an=vt.onVisible,Vt=vt.value,it=vt.onChange,xt=vt.setIndex,dn={page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null},mt=Object(a.useState)(dn),hn=Object(m.a)(mt,2),jt=hn[0],vn=hn[1],Hn=Object(a.useState)([]),Mn=Object(m.a)(Hn,2),Sn=Mn[0],ii=Mn[1],An=Object(a.useState)([]),Zn=Object(m.a)(An,2),qn=Zn[0],_i=Zn[1],Un=Object(a.useState)(!1),gi=Object(m.a)(Un,2),vi=gi[0],si=gi[1],kn=Object(a.useRef)([]),ei=Object(a.useRef)(null),Kn=Object(x.i)();Object(a.useEffect)(function(){return Kn!=null&&Kn.id&&(ei.current=setInterval(function(){zt(30)},3e4)),function(){clearInterval(ei.current)}},[]);var zt=function(){var Gt=Object(p.a)(r.a.mark(function Xt(on){var ln;return r.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(w.r)(Kn==null?void 0:Kn.id,{practice_time:on});case 2:ln=tn.sent;case 3:case"end":return tn.stop()}},Xt)}));return function(on){return Gt.apply(this,arguments)}}();Object(a.useEffect)(function(){In(jt),ci()},[]),Object(a.useEffect)(function(){return window.addEventListener("click",li),function(){window.removeEventListener("click",li)}},[Kn==null?void 0:Kn.save_identifier,fn]),Object(a.useEffect)(function(){var Gt=kn.current.findIndex(function(tn){return tn.identifier===(Kn==null?void 0:Kn.save_identifier)}),Xt=kn.current[Gt-1],on=kn.current[Gt+1],ln=document.getElementById("oj-prev"),Wt=document.getElementById("oj-next");Xt?ln.style.display="block":ln.style.display="none",on?Wt.style.display="block":Wt.style.display="none"},[Kn==null?void 0:Kn.save_identifier,kn.current]);var Tn=function(Xt,on){if(Xt.id===on)return Xt;for(var ln=0,Wt=Xt;Wt=Wt.parentNode;ln++){if(Wt.id===on)return Wt;if(Wt==document.documentElement)return!1}},li=function(){var Gt=Object(p.a)(r.a.mark(function Xt(on){var ln,Wt,tn;return r.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:if(!Tn(on.target,"oj-drawer")&&fn&&an(!1),ln=kn.current.findIndex(function(Ri){return Ri.identifier===(Kn==null?void 0:Kn.save_identifier)}),Wt=kn.current[ln-1],tn=kn.current[ln+1],!(on.target.id==="oj-prev")){hi.next=14;break}if(!(!Wt||ln===-1)){hi.next=8;break}return N.b.warn("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728"),hi.abrupt("return");case 8:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",hi.next=12,_n(Wt==null?void 0:Wt.identifier);case 12:xt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 14:if(!(on.target.id==="oj-next"||on.target.id==="oj-modal-next")){hi.next=24;break}if(!(!tn||ln===-1)){hi.next=18;break}return N.b.warn("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728"),hi.abrupt("return");case 18:return on.target.style.pointerEvents="none",on.target.style.cursor="not-allowed",hi.next=22,_n(tn==null?void 0:tn.identifier);case 22:xt("0"),setTimeout(function(){on.target.style.pointerEvents="auto",on.target.style.cursor="pointer"},400);case 24:case"end":return hi.stop()}},Xt)}));return function(on){return Gt.apply(this,arguments)}}();Object(a.useEffect)(function(){it(Kn==null?void 0:Kn.save_identifier);var Gt=qn.findIndex(function(Xt){return Xt.some(function(on){return on.identifier===(Kn==null?void 0:Kn.save_identifier)})});Gt===-1?vn(Object(d.a)(Object(d.a)({},jt),{},{page:1})):vn(Object(d.a)(Object(d.a)({},jt),{},{page:Gt+1}))},[Kn==null?void 0:Kn.save_identifier,qn]);var yi=function(Xt){jt.page=1,jt.tag_discipline_id=Xt,vn(Object(d.a)({},jt)),In(jt)},ci=function(){var Gt=Object(p.a)(r.a.mark(function Xt(){var on;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(xe.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:on=Wt.sent,ii(on.tag_disciplines||[]);case 4:case"end":return Wt.stop()}},Xt)}));return function(){return Gt.apply(this,arguments)}}(),ti=function(Xt){jt.page=1,jt.difficulty=typeof Xt=="number"?Xt:null,vn(Object(d.a)({},jt)),In(jt)},In=function(){var Gt=Object(p.a)(r.a.mark(function Xt(on){var ln,Wt,tn,mn,hi,Ri;return r.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:return si(!0),Bi.next=3,Object(w.p)(on);case 3:if(ln=Bi.sent,ln!=null&&ln.practices_list){for(tn=ln==null||((Wt=ln.practices_list)===null||Wt===void 0)?void 0:Wt.length,mn=[],hi=0;hi(Ln+3)*1e3,Lr!==0&&!Gr&&setTimeout(Wi,1e3),!Gr){Ji.next=12;break}return P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),xt({type:un.SET_SUBMITING,payload:!1}),Ji.abrupt("return");case 12:if(!(Lr===0)){Ji.next=19;break}return Ir.status===2&&P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),Ji.next=16,Object(w.o)(mt,{limit:15,page:qn});case 16:ia=Ji.sent,xt({type:un.SET_SUBMIT_RESULT,payload:Object(d.a)(Object(d.a)({},it),{},{submitResult:Ir,submitting:!1,submitRecords:ia})}),(Ir==null?void 0:Ir.status)===0&&on(!0);case 19:case"end":return Ji.stop()}},ya)})),Di.apply(this,arguments)},Wi=function(){return Di.apply(this,arguments)},$n={},bn.next=14,Object(w.s)(mt,$n);case 14:if(rn=bn.sent,!(rn.status===-1)){bn.next=18;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),bn.abrupt("return");case 18:Ln=mn.time_limit,bi=Bn(),Wi();case 21:bn.next=26;break;case 23:bn.prev=23,bn.t0=bn.catch(3),xt({type:un.SET_SUBMITING,payload:!1});case 26:case"end":return bn.stop()}},Dn,null,[[3,23]])})),Ur.apply(this,arguments)}function ca(){return _r.apply(this,arguments)}function _r(){return _r=Object(p.a)(r.a.mark(function Dn(){var wn,$n,rn,Ln,bi,Wi,Di;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return it.debuging=!0,xt({type:un.SET_DEBUGING,payload:!0}),bn.prev=2,bn.next=5,Or();case 5:if(wn=bn.sent,!(wn.status===0)){bn.next=21;break}return Di=function(){return Di=Object(p.a)(r.a.mark(function ya(){var Wr,Lr,Ir,Zr,Gr,ia;return r.a.wrap(function(Ji){for(;;)switch(Ji.prev=Ji.next){case 0:return Ji.next=2,Object(w.l)(mt,"debug");case 2:if(Wr=Ji.sent,Lr=Wr.status,Ir=Wr.message,Zr=Wr.data,Gr=Bn(),ia=Gr-bi>($n+3)*1e3,Lr!==0&&!ia&&(xt({type:un.SET_EXECUTE_MESSAGE,payload:Ir}),setTimeout(Wi,1e3)),!ia){Ji.next=13;break}return P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),xt({type:un.SET_DEBUGING,payload:!1}),Ji.abrupt("return");case 13:Lr===0&&(xt({type:un.SET_DEBUGING,payload:!1}),Zr.status===2&&P.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),xt({type:un.SET_EXECUTE_RESULT,payload:Object(d.a)(Object(d.a)({},it),{},{debugResult:Zr,debuging:!1})}));case 14:case"end":return Ji.stop()}},ya)})),Di.apply(this,arguments)},Wi=function(){return Di.apply(this,arguments)},$n=mn.time_limit,rn={input:encodeURIComponent(Sn.test_case.input)},bn.next=13,Object(w.h)(mt,rn);case 13:if(Ln=bn.sent,!(Ln.status===-1)){bn.next=17;break}return window.parent.location.href="/classrooms/".concat(jt.query.coursesId,"/exercise/").concat(jt.query.exercisesId,"/detail"),bn.abrupt("return");case 17:bi=Bn(),Wi(),bn.next=22;break;case 21:xt({type:un.SET_DEBUGING,payload:!1});case 22:bn.next=27;break;case 24:bn.prev=24,bn.t0=bn.catch(2),console.log(bn.t0);case 27:return bn.prev=27,bn.finish(27);case 29:case"end":return bn.stop()}},Dn,null,[[2,24,27,29]])})),_r.apply(this,arguments)}function ta(Dn){var wn;clearTimeout(ln.current),ln.current=setTimeout(function(){var $n;Or({code:C.Base64.encode(Dn),language:Wt==null||(($n=Wt.current)===null||$n===void 0)?void 0:$n.language})},2e3),xt({type:un.SET_DATA,payload:Object(d.a)(Object(d.a)({},Wt==null?void 0:Wt.current),{},{hack:Object(d.a)(Object(d.a)({},Wt==null||((wn=Wt.current)===null||wn===void 0)?void 0:wn.hack),{},{code:Dn})})})}function Da(Dn){var wn=Dn.target.value;xt({type:un.SET_DATA,payload:Object(d.a)(Object(d.a)({},Sn),{},{test_case:{input:wn}})})}var fi=function(){var Dn=Object(p.a)(r.a.mark(function wn($n){var rn,Ln,bi,Wi,Di;return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return xt({type:un.SET_LOADING,payload:!0}),bn.next=3,Or();case 3:if(rn=bn.sent,!(rn.status===0)){bn.next=14;break}return xt({type:un.SET_SUBMIT_RESULT,payload:{languageValue:$n}}),Wt.current.language=$n,Ln="".concat(tn==null?void 0:tn.login,"-language"),localStorage.setItem(Ln,$n),bn.next=11,Object(w.w)(mt);case 11:bi=bn.sent,bi.status===0&&(Di=bi==null||((Wi=bi.data)===null||Wi===void 0)?void 0:Wi.find(function(na){return na.language===$n}),ta(C.Base64.decode(Di.code))),setTimeout(function(){xt({type:un.SET_LOADING,payload:!1})},300);case 14:case"end":return bn.stop()}},wn)}));return function($n){return Dn.apply(this,arguments)}}();function xn(){return Gn.apply(this,arguments)}function Gn(){return Gn=Object(p.a)(r.a.mark(function Dn(){var wn;return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.prev=0,rn.next=3,Object(w.q)(mt,{language:vn});case 3:wn=rn.sent,wn.status===401?hn.replace("/login",{from:jt.pathname}):(ta(C.Base64.decode(wn.code)),Bi()),rn.next=10;break;case 7:rn.prev=7,rn.t0=rn.catch(0),console.log(rn.t0);case 10:case"end":return rn.stop()}},Dn,null,[[0,7]])})),Gn.apply(this,arguments)}function Xn(){P.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:i.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",i.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(p.a)(r.a.mark(function wn(){var $n;return r.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Object(w.t)(mt,{language:vn});case 2:$n=Ln.sent,$n.status===401?hn.replace("/login",{from:jt.pathname}):ta(C.Base64.decode($n.code));case 4:case"end":return Ln.stop()}},wn)}))()}})}function Ni(){xt({type:un.SET_SHOW_NOTE,payload:!0})}function zn(){xt({type:un.SET_SHOW_NOTE,payload:!1})}function Rr(Dn){return Br.apply(this,arguments)}function Br(){return Br=Object(p.a)(r.a.mark(function Dn(wn){return r.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(w.b)(mt,wn);case 2:xt({type:un.GET_DATA,payload:{showNote:!1,data:Object(d.a)(Object(d.a)({},Sn),{},{hack:Object(d.a)(Object(d.a)({},mn),{},{notes:wn.notes})})}});case 3:case"end":return rn.stop()}},Dn)})),Br.apply(this,arguments)}var $i={input:Sn==null||((vt=Sn.test_case)===null||vt===void 0)?void 0:vt.input,language:mn==null?void 0:mn.language,code:mn==null?void 0:mn.code,title:"main."+Qn[mn==null?void 0:mn.language],modify_code:mn==null?void 0:mn.modify_code,notes:mn==null?void 0:mn.notes,debugResult:ii,debuging:Un,submitting:gi,executingMessage:vi,id:mt,languageValue:vn,languageList:Hn,onChangeLanguage:fi,onCancelNote:zn,onAddNote:Rr,showNote:_i,onShowNote:Ni,onSubmitCode:Kr,onChangeCode:ta,onChangeInput:Da,onDebugCode:ca,onResetCode:xn,onSyncCode:Xn,onUpdateCode:Or};function Ar(){return Ii.apply(this,arguments)}function Ii(){return Ii=Object(p.a)(r.a.mark(function Dn(){var wn,$n,rn;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,Object(w.u)(mn.id,{container_type:"Hack",type:1});case 2:wn=bi.sent,$n=wn.praise_count,rn=Object(d.a)(Object(d.a)({},Sn),{},{hack:Object(d.a)(Object(d.a)({},mn),{},{praises_count:$n,user_praise:!mn.user_praise})}),xt({type:un.SET_DATA,payload:rn});case 6:case"end":return bi.stop()}},Dn)})),Ii.apply(this,arguments)}var sr={topicId:mt,submitResult:An,submitRecords:Zn,submitting:gi,page:qn,onPageChange:ui,hack:mn,user:Sn==null?void 0:Sn.user,onTriggerPraise:Ar};return console.log(Sn,Wt==null?void 0:Wt.current,"data--------"),i.a.createElement(i.a.Fragment,null,i.a.createElement(I.a,{className:"oj-custom-large-spin",size:"large",spinning:Mn},Sn?i.a.createElement("div",{className:"oj-custom-warp"},i.a.createElement("header",{className:y.a.header,style:{minWidth:1200}},i.a.createElement("div",null,i.a.createElement("img",{src:"".concat(b.a.IMG_SERVER,"/images/").concat(tn.image_url),alt:"user",width:30}),i.a.createElement("span",null,tn.name)),i.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},i.a.createElement("div",null,mn.name),i.a.createElement(wr.a,{onChange:function(wn){},className:"font12 c-grey-999"})),i.a.createElement(yn.CopyToClipboard,{text:"".concat((Kt=window.location)===null||Kt===void 0?void 0:Kt.origin,"/problems/").concat(mn.identifier,"/share"),onCopy:function(){return N.b.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")}},i.a.createElement("span",{className:y.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",i.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"\u5206\u4EAB\u9898\u76EE")),mn.edit_privilege?i.a.createElement(R.a,{className:y.a.btn_back,to:"/problems/".concat(mn.identifier,"/ojedit"),style:{marginRight:10}}," ",i.a.createElement(s.a,null)," \u7F16\u8F91"):null,i.a.createElement(R.a,{className:y.a.btn_back,onClick:function(){},to:"/problems"}," ",i.a.createElement(S.a,null),"\u9000\u51FA")),i.a.createElement(v.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:i.a.createElement(kr,sr),rightChild:i.a.createElement(oi,$i)})):null),i.a.createElement(P.a,{centered:!0,closable:!1,width:680,footer:null,visible:Xt,className:"oj-modal"},i.a.createElement("section",{className:"oj-modal-content"},i.a.createElement("div",{className:"oj-modal-head"},i.a.createElement("img",{src:vr.a,alt:""}),i.a.createElement("i",{onClick:function(){return on(!1)},className:"iconfont icon-guanbi1"})),i.a.createElement("aside",null,i.a.createElement("img",{className:"mr30",src:Qr.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",i.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},An==null?void 0:An.execute_time,"s"),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(An==null?void 0:An.time_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("aside",{className:"mb50"},i.a.createElement("img",{src:$r.a,className:"mr30"}),i.a.createElement("span",{className:"oj-modal-tt"},i.a.createElement("span",null,i.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),i.a.createElement("span",{className:"c-light-primary"},An==null?void 0:An.execute_memory,"mb")),i.a.createElement("span",null,i.a.createElement("span",null))),"\u4F18\u4E8E",i.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(An==null?void 0:An.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),i.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"\u8FDB\u5165\u4E0B\u4E00\u9898"))))};function yr(Je){var vt=Je.languageValue,Kt=Je.languageList,fn=Je.onChangeLanguage,an=Je.title,Vt=Je.modify_code,it=Je.onSyncCode,xt=Je.onShowCodeSetting,dn=Je.onResetCode,mt=Object(x.h)(),hn=function(){P.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:i.a.createElement(g.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:dn})};return i.a.createElement("div",{className:"action-bar"},i.a.createElement(X.a,{className:"oj-select",value:vt,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:fn},Kt==null?void 0:Kt.map(function(jt){return i.a.createElement(X.a.Option,{key:jt.language,value:jt.language},jt.language)})),i.a.createElement("span",null),i.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:hn},i.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),i.a.createElement("a",{onClick:xt},i.a.createElement("i",{className:"iconfont icon-shezhi"})))}function oi(Je){var vt=Je.id,Kt=Je.input,fn=Je.showNote,an=Je.onShowNote,Vt=Je.notes,it=Je.onCancelNote,xt=Je.onAddNote,dn=Je.debugResult,mt=Je.language,hn=Je.debuging,jt=Je.submitting,vn=Je.executingMessage,Hn=Je.code,Mn=Je.onSubmitCode,Sn=Je.onDebugCode,ii=Je.onChangeCode,An=Je.onChangeInput,Zn=Je.onUpdateCode,qn=Object(z.a)(Je,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]);function _i(gi){return i.a.createElement(yr,Object(Z.a)({},qn,{onShowCodeSetting:gi}))}var Un={id:vt,input:Kt,debugResult:dn,debuging:hn,submitting:jt,executingMessage:vn,onDebugCode:Sn,onChangeCode:ii,onSubmitCode:Mn,onChangeInput:An};return i.a.createElement("div",{className:"right-panel"},i.a.createElement(f.a,{language:mt,value:Hn,onChange:ii,ActionBarRender:_i}),i.a.createElement("div",{className:"note-form-area ".concat(fn?"active":"")},i.a.createElement(Re,{onCancel:it,notes:Vt,callback:xt})),i.a.createElement(j.b,Un))}},WaYH:function(je,ce,D){"use strict";var Z=D("rePB"),z=D("Ff2n"),M=D("VTBJ"),X=D("1OyB"),F=D("vuIU"),I=D("JX7q"),H=D("Ji7U"),N=D("LK+K"),n=D("q1tI"),P=D("TSYQ"),p=D.n(P),m=D("sboe"),d=D("OZM5"),u=function(R){var w=R.prefixCls,v=R.level,b=R.isStart,g=R.isEnd;if(!v)return null;for(var f="".concat(w,"-indent-unit"),C=[],E=0;E1&&arguments[1]!==void 0?arguments[1]:!1,Pe=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(Ce&&U[Pe])return U[Pe];var He=window.getComputedStyle(Oe),Ee=He.getPropertyValue("box-sizing")||He.getPropertyValue("-moz-box-sizing")||He.getPropertyValue("-webkit-box-sizing"),be=parseFloat(He.getPropertyValue("padding-bottom"))+parseFloat(He.getPropertyValue("padding-top")),Ke=parseFloat(He.getPropertyValue("border-bottom-width"))+parseFloat(He.getPropertyValue("border-top-width")),bt=y.map(function(yt){return"".concat(yt,":").concat(He.getPropertyValue(yt))}).join(";"),Et={sizingStyle:bt,paddingSize:be,borderSize:Ke,boxSizing:Ee};return Ce&&Pe&&(U[Pe]=Et),Et}function G(Oe){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,He=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)),Oe.getAttribute("wrap")?j.setAttribute("wrap",Oe.getAttribute("wrap")):j.removeAttribute("wrap");var Ee=A(Oe,Ce),be=Ee.paddingSize,Ke=Ee.borderSize,bt=Ee.boxSizing,Et=Ee.sizingStyle;j.setAttribute("style","".concat(Et,";").concat(E)),j.value=Oe.value||Oe.placeholder||"";var yt=Number.MIN_SAFE_INTEGER,pt=Number.MAX_SAFE_INTEGER,st=j.scrollHeight,ht;if(bt==="border-box"?st+=Ke:bt==="content-box"&&(st-=be),Pe!==null||He!==null){j.value=" ";var wt=j.scrollHeight-be;Pe!==null&&(yt=wt*Pe,bt==="border-box"&&(yt=yt+be+Ke),st=Math.max(yt,st)),He!==null&&(pt=wt*He,bt==="border-box"&&(pt=pt+be+Ke),ht=st>pt?"":"hidden",st=Math.min(pt,st))}return{height:st,minHeight:yt,maxHeight:pt,overflowY:ht,resize:"none"}}var W=D("Gytx"),O=D.n(W),V;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(V||(V={}));var te=function(Oe){Object(X.a)(Pe,Oe);var Ce=Object(F.a)(Pe);function Pe(He){var Ee;return Object(z.a)(this,Pe),Ee=Ce.call(this,He),Ee.nextFrameActionId=void 0,Ee.resizeFrameId=void 0,Ee.textArea=void 0,Ee.saveTextArea=function(be){Ee.textArea=be},Ee.handleResize=function(be){var Ke=Ee.state.resizeStatus,bt=Ee.props,Et=bt.autoSize,yt=bt.onResize;if(Ke!==V.NONE)return;typeof yt=="function"&&yt(be),Et&&Ee.resizeOnNextFrame()},Ee.resizeOnNextFrame=function(){cancelAnimationFrame(Ee.nextFrameActionId),Ee.nextFrameActionId=requestAnimationFrame(Ee.resizeTextarea)},Ee.resizeTextarea=function(){var be=Ee.props.autoSize;if(!be||!Ee.textArea)return;var Ke=be.minRows,bt=be.maxRows,Et=G(Ee.textArea,!1,Ke,bt);Ee.setState({textareaStyles:Et,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(Ee.resizeFrameId),Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.RESIZED},function(){Ee.resizeFrameId=requestAnimationFrame(function(){Ee.setState({resizeStatus:V.NONE}),Ee.fixFirefoxAutoScroll()})})})})},Ee.renderTextArea=function(){var be=Ee.props,Ke=be.prefixCls,bt=Ke===void 0?"rc-textarea":Ke,Et=be.autoSize,yt=be.onResize,pt=be.className,st=be.disabled,ht=Ee.state,wt=ht.textareaStyles,_e=ht.resizeStatus,Me=Object(g.a)(Ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ye=C()(bt,pt,Object(N.a)({},"".concat(bt,"-disabled"),st));"value"in Me&&(Me.value=Me.value||"");var Se=Object(H.a)(Object(H.a)(Object(H.a)({},Ee.props.style),wt),_e===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(b,{onResize:Ee.handleResize,disabled:!(Et||yt)},I.createElement("textarea",Object(Z.a)({},Me,{className:ye,style:Se,ref:Ee.saveTextArea})))},Ee.state={textareaStyles:{},resizeStatus:V.NONE},Ee}return Object(M.a)(Pe,[{key:"componentDidUpdate",value:function(Ee){(Ee.value!==this.props.value||!O()(Ee.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 Ee=this.textArea.selectionStart,be=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ee,be)}}catch(Ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Pe}(I.Component),ae=te,me=function(Oe){Object(X.a)(Pe,Oe);var Ce=Object(F.a)(Pe);function Pe(He){var Ee;Object(z.a)(this,Pe),Ee=Ce.call(this,He),Ee.resizableTextArea=void 0,Ee.focus=function(){Ee.resizableTextArea.textArea.focus()},Ee.saveTextArea=function(Ke){Ee.resizableTextArea=Ke},Ee.handleChange=function(Ke){var bt=Ee.props.onChange;Ee.setValue(Ke.target.value,function(){Ee.resizableTextArea.resizeTextarea()}),bt&&bt(Ke)},Ee.handleKeyDown=function(Ke){var bt=Ee.props,Et=bt.onPressEnter,yt=bt.onKeyDown;Ke.keyCode===13&&Et&&Et(Ke),yt&&yt(Ke)};var be=typeof He.value=="undefined"||He.value===null?He.defaultValue:He.value;return Ee.state={value:be},Ee}return Object(M.a)(Pe,[{key:"setValue",value:function(Ee,be){"value"in this.props||this.setState({value:Ee},be)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(ae,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ee){return"value"in Ee?{value:Ee.value}:null}}]),Pe}(I.Component),Re=ce.default=me},Z8dc:function(je,ce,D){je.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:function(je,ce,D){"use strict";var Z=D("BoS7"),z=D("Sdc0"),M=D("OaEy"),X=D("2fM7"),F=D("q1tI"),I=D.n(F),H=D("lOMy"),N=D.n(H),n=X.a.Option;ce.a=function(P){var p=P.onFontSizeChange,m=P.cmFontSize,d=P.cmCodeMode,u=P.onCodeModeChange,o=P.onTabToSpace,h=P.className,r=h===void 0?"":h,a=P.tabToSpace,i=P.children;return I.a.createElement("div",{className:"tpi-code-setting ".concat(r)},I.a.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),I.a.createElement("section",null,I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),I.a.createElement(X.a,{bordered:!1,size:"small",value:d,onChange:u},I.a.createElement(n,{value:"vs"},"\u767D\u8272\u80CC\u666F"),I.a.createElement(n,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),I.a.createElement(X.a,{bordered:!1,size:"small",value:m,onChange:p},I.a.createElement(n,{value:12},"12px"),I.a.createElement(n,{value:14},"14px"),I.a.createElement(n,{value:16},"16px"),I.a.createElement(n,{value:18},"18px"),I.a.createElement(n,{value:20},"20px"),I.a.createElement(n,{value:22},"22px"))),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"Tab\u8F6C\u6362"),I.a.createElement(z.a,{checked:a,onChange:o}))),I.a.createElement("h3",null,"\u5FEB\u6377\u952E"),I.a.createElement("section",null,I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),I.a.createElement("span",null,"Ctrl + S")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),I.a.createElement("span",null,"F1 / Alt + F1")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),I.a.createElement("span",null,"Ctrl + ]/[")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),I.a.createElement("span",null,"Ctrl + Shift + \\")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),I.a.createElement("span",null,"Home")),I.a.createElement("div",{className:"file-item"},I.a.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),I.a.createElement("span",null,"End"))),i)}},ZW9T:function(je,ce,D){"use strict";D.d(ce,"a",function(){return W});var Z=D("k1fw"),z=D("oBTY"),M=D("miYZ"),X=D("tsqr"),F=D("rAM+"),I=D("tJVT"),H=D("PpiC"),N=D("q1tI"),n=D.n(N),P=D("bdgK"),p=D("9og8"),m=D("WmNS"),d=D.n(m),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},h={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"if",content:["if () {"," $0","}"].join(` `)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)}]},r={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},a=D("5VLF"),i=D.n(a),s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},S=function(V,te){return te.map(function(ae){return{label:ae,kind:V.languages.CompletionItemKind.Keyword,insertText:ae}})},x=function(V){return Object.keys(s.tables).map(function(te){return{label:te,kind:V.languages.CompletionItemKind.Variable,insertText:te}})},T=function(V,te){var ae=s.tables[V];return ae?ae.map(function(me){return{label:me,kind:te.languages.CompletionItemKind.Field,insertText:me}}):[]};function R(O,V,te,ae,me){var Re=V.getWordUntilPosition(te),Oe={startLineNumber:te.lineNumber,endLineNumber:te.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Ce=ae.map(function(Pe){return{label:Pe,kind:O.languages.CompletionItemKind.Keyword,insertText:Pe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}});return me.map(function(Pe){Ce.push(Object(Z.a)(Object(Z.a)({},Pe),{},{range:Oe}))}),Ce}var w=function(O){s.languages.map(function(me){return O.languages.registerDocumentFormattingEditProvider(me,{provideDocumentFormattingEdits:function(Oe,Ce,Pe){return Object(p.a)(d.a.mark(function He(){var Ee;return d.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Ee=i()(Oe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),Ke.abrupt("return",[{range:Oe.getFullModelRange(),text:Ee}]);case 2:case"end":return Ke.stop()}},He)}))()}}),me});var V=h.quickKey.map(function(me){return{label:me.label,kind:O.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=r.quickKey.map(function(me){return{label:me.label,kind:O.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=o.quickKey.map(function(me){return{label:me.label,kind:O.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Re,Oe){var Ce=Re.getWordUntilPosition(Oe),Pe={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},He=Re.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(h.keywords.map(function(Ee){return{label:Ee,kind:O.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})),Object(z.a)(h.quickKey.map(function(Ee){return{label:Ee.label,kind:O.languages.CompletionItemKind.Function,documentation:Ee.content,insertText:He.startsWith("#")?Ee.content.replace(/#/,""):Ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Re,Oe){var Ce=Re.getWordUntilPosition(Oe),Pe={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn};return{suggestions:Object(z.a)(u.keywords.map(function(He){return{label:He,kind:O.languages.CompletionItemKind.Function,documentation:He,insertText:He,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Re,Oe){var Ce=Re.getWordUntilPosition(Oe),Pe={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},He=Re.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(o.keywords.map(function(Ee){return{label:Ee,kind:O.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})),Object(z.a)(o.quickKey.map(function(Ee){return{label:Ee.label,kind:O.languages.CompletionItemKind.Function,documentation:Ee.content,insertText:He.startsWith("#")?Ee.content.replace(/#/,""):Ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Re,Oe){var Ce=Re.getWordUntilPosition(Oe),Pe={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},He=Re.getLineContent(Oe.lineNumber).substring(Ce.startColumn-2,Ce.endColumn);return{suggestions:[].concat(Object(z.a)(r.keywords.map(function(Ee){return{label:Ee,kind:O.languages.CompletionItemKind.Function,documentation:Ee,insertText:Ee,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})),Object(z.a)(r.quickKey.map(function(Ee){return{label:Ee.label,kind:O.languages.CompletionItemKind.Function,documentation:Ee.content,insertText:He.startsWith("#")?Ee.content.replace(/#/,""):Ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=D("fjLI"),g=D("LvDl"),f=D("+ua5");function C(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function E(){}var y=!1,U={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function j(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=O;if(Array.isArray(O)){for(var te=0;te0||J.target.offsetWidth>0)&&ve.current.instance.layout()}}catch(ne){B.e(ne)}finally{B.f()}}),le.observe(Ae.current)),le}function Ft(){X.b.warn(decodeURIComponent(v))}var kt=function(){var re=ve.current.instance;if(Re!=null&&re&&ze){var B=re.getModel();B&&Re!==B.getValue()&&(y=!0,B.setValue(Re),re.layout(),y=!1)}};Object(N.useEffect)(function(){ue.current&&clearTimeout(ue.current),ue.current=setTimeout(function(){kt()},500)},[Re,ze,ve.current]),Object(N.useEffect)(function(){if(Ne&&ve.current&&ve.current.instance){var le=ve.current.instance;le.changeViewZones(function(B){var $=document.createElement("div");$.style.padding="10px 20px",$.style.width="calc(100% - 20px)",$.className="my-error-line-wrp",$.innerHTML=at,B.addZone({afterLineNumber:Ne||11,heightInLines:3,domNode:$})});var re={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}};le.addOverlayWidget(re),le.revealPositionInCenter({lineNumber:20,column:1})}},[Ne,ve.current,ze]);function St(){var le=ve.current.instance;if(le){var re=le.getSelection(),B=ve.current.pastePos||{},$=new A.Range(B.startLineNumber||re.endLineNumber,B.startColumn||re.endColumn,B.endLineNumber||re.endLineNumber,B.endColumn||re.endColumn);setTimeout(function(){le.executeEdits("",[{range:$,text:""}])},300)}}function qe(le){(window.navigator.platform.match("Mac")?le.metaKey:le.ctrlKey)&&le.keyCode==83&&(le.preventDefault(),st())}var rt=function(){if(wt&&ve.current.instance){var re=ve.current.instance.getContentHeight();It(re0||Be.target.offsetWidth>0)&&wt.layout()}}catch(Ze){ye.e(Ze)}finally{ye.f()}}),_e.observe(Ee.current)),_e}Object(N.useEffect)(function(){Ee.current&&Promise.all([D.e(16),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(wt){A=wt;var _e=A.editor.createDiffEditor(Ee.current,Object(Z.a)(Object(Z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},He),{},{wordWrap:!0}));Et(_e);var Me=yt(_e);return function(){_e.dispose();var ye=_e.getModel();ye&&ye.dispose(),Me.unobserve(Ee.current)}})},[]),Object(N.useEffect)(function(){bt&&bt.setModel({original:A.editor.createModel(Re,Ce),modified:A.editor.createModel(Oe,Ce)})},[Re,Oe,Ce,bt]);var pt=C(te),st=C(me),ht={width:pt,height:st};return n.a.createElement("div",{className:"my-diff-editor",ref:Ee,style:ht})}},ZpRC:function(je,ce,D){"use strict";function Z(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function z(p,m){return(!m||p!=="hidden")&&p!=="visible"&&p!=="clip"}function M(p,m){if(p.clientHeightm||h>p&&r=m&&a>=d?h-p-u:r>m&&ad?r-m+o:0}var F=function(p,m){var d=window,u=m.scrollMode,o=m.block,h=m.inline,r=m.boundary,a=m.skipOverflowHiddenElements,i=typeof r=="function"?r:function(wt){return wt!==r};if(!Z(p))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,S=[],x=p;Z(x)&&i(x);){if((x=x.parentElement)===s){S.push(x);break}x!=null&&x===document.body&&M(x)&&!M(document.documentElement)||x!=null&&M(x,a)&&S.push(x)}for(var T=d.visualViewport?d.visualViewport.width:innerWidth,R=d.visualViewport?d.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,b=p.getBoundingClientRect(),g=b.height,f=b.width,C=b.top,E=b.right,y=b.bottom,U=b.left,j=o==="start"||o==="nearest"?C:o==="end"?y:C+g/2,A=h==="center"?U+f/2:h==="end"?E:U,G=[],W=0;W=0&&U>=0&&y<=R&&E<=T&&C>=me&&y<=Oe&&U>=Ce&&E<=Re)return G;var Pe=getComputedStyle(O),He=parseInt(Pe.borderLeftWidth,10),Ee=parseInt(Pe.borderTopWidth,10),be=parseInt(Pe.borderRightWidth,10),Ke=parseInt(Pe.borderBottomWidth,10),bt=0,Et=0,yt="offsetWidth"in O?O.offsetWidth-O.clientWidth-He-be:0,pt="offsetHeight"in O?O.offsetHeight-O.clientHeight-Ee-Ke:0;if(s===O)bt=o==="start"?j:o==="end"?j-R:o==="nearest"?X(v,v+R,R,Ee,Ke,v+j,v+j+g,g):j-R/2,Et=h==="start"?A:h==="center"?A-T/2:h==="end"?A-T:X(w,w+T,T,He,be,w+A,w+A+f,f),bt=Math.max(0,bt+v),Et=Math.max(0,Et+w);else{bt=o==="start"?j-me-Ee:o==="end"?j-Oe+Ke+pt:o==="nearest"?X(me,Oe,te,Ee,Ke+pt,j,j+g,g):j-(me+te/2)+pt/2,Et=h==="start"?A-Ce-He:h==="center"?A-(Ce+ae/2)+yt/2:h==="end"?A-Re+be+yt:X(Ce,Re,ae,He,be+yt,A,A+f,f);var st=O.scrollLeft,ht=O.scrollTop;j+=ht-(bt=Math.max(0,Math.min(ht+bt,O.scrollHeight-te+pt))),A+=st-(Et=Math.max(0,Math.min(st+Et,O.scrollWidth-ae+yt)))}G.push({el:O,top:bt,left:Et})}return G};function I(p){return p===Object(p)&&Object.keys(p).length!==0}function H(p,m){m===void 0&&(m="auto");var d="scrollBehavior"in document.body.style;p.forEach(function(u){var o=u.el,h=u.top,r=u.left;o.scroll&&d?o.scroll({top:h,left:r,behavior:m}):(o.scrollTop=h,o.scrollLeft=r)})}function N(p){return p===!1?{block:"end",inline:"nearest"}:I(p)?p:{block:"start",inline:"nearest"}}function n(p,m){var d=!p.ownerDocument.documentElement.contains(p);if(I(m)&&typeof m.behavior=="function")return m.behavior(d?[]:F(p,m));if(d)return;var u=N(m);return H(F(p,u),u.behavior)}var P=ce.a=n},ZsLC:function(je,ce,D){je.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},bCnd:function(je,ce,D){"use strict";D.d(ce,"b",function(){return X}),D.d(ce,"a",function(){return F});var Z=D("je13"),z=D.n(Z),M=!1;function X(I,H){var N=z.a.get("__ec");N||(N={}),N[I]=H,z.a.set("__ec",N)}function F(I,H){var N=z.a.get("__ec");return N?N[I]===void 0?H:N[I]:H}},bT9E:function(je,ce,D){"use strict";D.d(ce,"a",function(){return z});var Z=D("VTBJ");function z(M,X){var F=Object(Z.a)({},M);return Array.isArray(X)&&X.forEach(function(I){delete F[I]}),F}},bdLU:function(je,ce,D){"use strict";D.d(ce,"a",function(){return Z});var Z;(function(z){z[z.NOMATCH=-1]="NOMATCH",z[z.OK=0]="OK",z[z.TIMEOUT=2]="TIMEOUT",z[z.PODFAILURE=3]="PODFAILURE",z[z.COMPILEFAILURE=4]="COMPILEFAILURE",z[z.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(Z||(Z={}))},biw7:function(je,ce,D){"use strict";var Z=D("q1tI"),z=D.n(Z),M=Z.createContext(null);ce.a=M},c5Ni:function(je,ce,D){},cDPC:function(je,ce,D){"use strict";var Z=D("tJVT"),z=D("q1tI"),M=D.n(z),X=D("i3hx"),F=D.n(X);ce.a=function(I){var H=I.defaultX,N=H===void 0?"40%":H,n=I.leftChild,P=I.rightChild,p=I.className,m=I.hideResize,d=m===void 0?!1:m,u=Object(z.useState)(N),o=Object(Z.a)(u,2),h=o[0],r=o[1],a=Object(z.useRef)();function i(){a.current=!0}Object(z.useEffect)(function(){function x(R){a.current&&r(R.pageX)}function T(){a.current=!1}return window.addEventListener("mousemove",x),window.addEventListener("mouseup",T),function(){window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",T)}},[]);var s=typeof h=="number"&&h!==.01?"".concat(h,"px"):N,S="calc(100% - ".concat(d?"0px":"4px"," - ").concat(s,")");return M.a.createElement("div",{className:"split-panel-container ".concat(p)},M.a.createElement("section",{style:{width:s,display:h===.01?"none":""}},n),M.a.createElement("section",{className:"resize-x-bar",onMouseDown:i},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:S}},P))}},dejd:function(je,ce,D){},dmUQ:function(je,ce,D){"use strict";var Z=D("Ff2n"),z=D("rePB"),M=D("1OyB"),X=D("vuIU"),F=D("Ji7U"),I=D("md7G"),H=D("foSv"),N=D("q1tI"),n=D.n(N),P=D("TSYQ"),p=D.n(P),m=D("4IlW");function d(g,f){var C=Object.keys(g);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(g);f&&(E=E.filter(function(y){return Object.getOwnPropertyDescriptor(g,y).enumerable})),C.push.apply(C,E)}return C}function u(g){for(var f=1;f1?ae-1:0),Re=1;Re1?W-1:0),V=1;V=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var W=0;return G.indexOf(".")>=0&&(W=G.length-G.indexOf(".")-1),W},y.getInputDisplayValue=function(A){var G=A||y.state,W=G.focused,O=G.inputValue,V=G.value,te;W?te=O:te=y.toPrecisionAsStep(V),te==null&&(te="");var ae=y.formatWrapper(te);return T(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(A){}},y.restoreByAfter=function(A){if(A===void 0)return!1;var G=y.input.value,W=G.lastIndexOf(A);if(W===-1)return!1;var O=y.cursorBefore.length;return y.lastKeyCode===m.a.DELETE&&y.cursorBefore.charAt(O-1)===A[0]?(y.fixCaret(O,O),!0):W+A.length===G.length?(y.fixCaret(W,W),!0):!1},y.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(G,W){var O=A.substring(W);return y.restoreByAfter(O)})},y.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(A,G,W){y.pressingUpOrDown=!0,y.step("down",A,G,W)},y.up=function(A,G,W){y.pressingUpOrDown=!0,y.step("up",A,G,W)},y.saveInput=function(A){y.input=A};var U=E.value;U===void 0&&(U=E.defaultValue),y.state={focused:E.autoFocus};var j=y.getValidValue(y.toNumber(U));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(j),value:j}),y}return Object(X.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var U=this.props,j=U.value,A=U.onChange,G=U.max,W=U.min,O=this.state.focused;if(y){if(!R(y.value,j)||!R(y.max,G)||!R(y.min,W)){var V=O?j:this.getValidValue(j),te;this.pressingUpOrDown?te=V:this.inputting?te=this.rawInput:te=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:te})}var ae="value"in this.props?j:this.state.value;"max"in this.props&&y.max!==G&&typeof ae=="number"&&ae>G&&A&&A(G),"min"in this.props&&y.min!==W&&typeof ae=="number"&&ae1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(y);return isNaN(A)?y:(Aj&&(A=j),A)}},{key:"setValue",value:function(y,U){var j=this.props.precision,A=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),G=this.state.value,W=G===void 0?null:G,O=this.state.inputValue,V=O===void 0?null:O,te=typeof A=="number"?A.toFixed(j):"".concat(A),ae=A!==W||te!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},U)):this.setState({value:A,inputValue:this.toPrecisionAsStep(y)},U),ae&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(y){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,A=j.precision,G=j.step;if(T(A))return A;var W=this.getPrecision(U),O=this.getPrecision(G),V=this.getPrecision(y);return y?Math.max(V,W+O):W+O}},{key:"getPrecisionFactor",value:function(y){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(y,U);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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var U=Math.abs(this.getMaxPrecision(y));return isNaN(U)?y.toString():Number(y).toFixed(U)}},{key:"toNumber",value:function(y){var U=this.props.precision,j=this.state.focused,A=y&&y.length>16&&j;return this.isNotCompleteNumber(y)||A?y:T(U)?Math.round(y*Math.pow(10,U))/Math.pow(10,U):Number(y)}},{key:"upStep",value:function(y,U){var j=this.props.step,A=this.getPrecisionFactor(y,U),G=Math.abs(this.getMaxPrecision(y,U)),W=((A*y+A*j*U)/A).toFixed(G);return this.toNumber(W)}},{key:"downStep",value:function(y,U){var j=this.props.step,A=this.getPrecisionFactor(y,U),G=Math.abs(this.getMaxPrecision(y,U)),W=((A*y-A*j*U)/A).toFixed(G);return this.toNumber(W)}},{key:"step",value:function(y,U){var j=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var W=this.props;if(W.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var V=this["".concat(y,"Step")](O,A),te=V>W.max||VW.max?V=W.max:V=me),et=(Ct||Ct===0)&&(isNaN(Ct)||Number(Ct)<=Re),Ae=Ge||A||G,ve=et||A||G,xe=p()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(z.a)({},"".concat(j,"-handler-up-disabled"),Ae)),ue=p()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(z.a)({},"".concat(j,"-handler-down-disabled"),ve)),fe=W?{onTouchStart:Ae?r:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=W?{onTouchStart:ve?r:this.down,onTouchEnd:this.stop}:{onMouseDown:ve?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:Ne,style:Oe,title:Ce,onMouseEnter:Pe,onMouseLeave:He,onMouseOver:Ee,onMouseOut:be,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(j,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:xe}),V||n.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:a})),n.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":ve,className:ue}),te||n.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:a}))),n.a.createElement("div",{className:"".concat(j,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":me,"aria-valuenow":Ct,required:Ke,type:yt,placeholder:pt,onPaste:Be,onClick:bt,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:Et,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:at?this.onKeyDown:r,onKeyUp:at?this.onKeyUp:r,autoFocus:ye,maxLength:Me,readOnly:G,disabled:A,max:me,min:Re,step:_e,name:Se,title:Ce,id:st,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ct),pattern:wt,inputMode:ht,onInput:Ze},ke))))}}]),C}(n.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:i,required:!1,autoComplete:"off"};var v=w,b=ce.a=v},fcSX:function(je,ce,D){"use strict";var Z=D("Ff2n"),z=D("1OyB"),M=D("vuIU"),X=D("Ji7U"),F=D("md7G"),I=D("foSv"),H=D("1W/9"),N=D("q1tI"),n=D("rePB"),P=D("JX7q"),p=D("TSYQ"),m=D.n(p),d=D("qx4F"),u=D("4IlW");function o(A){return Array.isArray(A)?A:[A]}var h={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(h).filter(function(A){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return A in(G?G.style:{})})[0],a=h[r];function i(A,G,W,O){A.addEventListener?A.addEventListener(G,W,O):A.attachEvent&&A.attachEvent("on".concat(G),W)}function s(A,G,W,O){A.removeEventListener?A.removeEventListener(G,W,O):A.attachEvent&&A.detachEvent("on".concat(G),W)}function S(A,G){var W=typeof A=="function"?A(G):A;return Array.isArray(W)?W.length===2?W:[W[0],W[1]]:[W]}var x=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function A(G,W,O,V){if(!W||W===document||W instanceof Document)return!1;if(W===G.parentNode)return!0;var te=Math.max(Math.abs(O),Math.abs(V))===Math.abs(V),ae=Math.max(Math.abs(O),Math.abs(V))===Math.abs(O),me=W.scrollHeight-W.clientHeight,Re=W.scrollWidth-W.clientWidth,Oe=document.defaultView.getComputedStyle(W),Ce=Oe.overflowY==="auto"||Oe.overflowY==="scroll",Pe=Oe.overflowX==="auto"||Oe.overflowX==="scroll",He=me&&Ce,Ee=Re&&Pe;return te&&(!He||He&&(W.scrollTop>=me&&V<0||W.scrollTop<=0&&V>0))||ae&&(!Ee||Ee&&(W.scrollLeft>=Re&&O<0||W.scrollLeft<=0&&O>0))?A(G,W.parentNode,O,V):!1};function w(A){var G=v();return function(){var O=Object(I.a)(A),V;if(G){var te=Object(I.a)(this).constructor;V=Reflect.construct(O,arguments,te)}else V=O.apply(this,arguments);return Object(F.a)(this,V)}}function v(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(A){return!1}}var b={},g=function(A){Object(X.a)(W,A);var G=w(W);function W(O){var V;return Object(z.a)(this,W),V=G.call(this,O),V.domFocus=function(){V.dom&&V.dom.focus()},V.removeStartHandler=function(te){if(te.touches.length>1)return;V.startPos={x:te.touches[0].clientX,y:te.touches[0].clientY}},V.removeMoveHandler=function(te){if(te.changedTouches.length>1)return;var ae=te.currentTarget,me=te.changedTouches[0].clientX-V.startPos.x,Re=te.changedTouches[0].clientY-V.startPos.y;(ae===V.maskDom||ae===V.handlerDom||ae===V.contentDom&&R(ae,te.target,me,Re))&&te.cancelable&&te.preventDefault()},V.transitionEnd=function(te){var ae=te.target;s(ae,a,V.transitionEnd),ae.style.transition=""},V.onKeyDown=function(te){if(te.keyCode===u.a.ESC){var ae=V.props.onClose;te.stopPropagation(),ae&&ae(te)}},V.onWrapperTransitionEnd=function(te){var ae=V.props,me=ae.open,Re=ae.afterVisibleChange;te.target===V.contentWrapper&&te.propertyName.match(/transform$/)&&(V.dom.style.transition="",!me&&V.getCurrentDrawerSome()&&(document.body.style.overflowX="",V.maskDom&&(V.maskDom.style.left="",V.maskDom.style.width="")),Re&&Re(!!me))},V.openLevelTransition=function(){var te=V.props,ae=te.open,me=te.width,Re=te.height,Oe=V.getHorizontalBoolAndPlacementName(),Ce=Oe.isHorizontal,Pe=Oe.placementName,He=V.contentDom?V.contentDom.getBoundingClientRect()[Ce?"width":"height"]:0,Ee=(Ce?me:Re)||He;V.setLevelAndScrolling(ae,Pe,Ee)},V.setLevelTransform=function(te,ae,me,Re){var Oe=V.props,Ce=Oe.placement,Pe=Oe.levelMove,He=Oe.duration,Ee=Oe.ease,be=Oe.showMask;V.levelDom.forEach(function(Ke){Ke.style.transition="transform ".concat(He," ").concat(Ee),i(Ke,a,V.transitionEnd);var bt=te?me:0;if(Pe){var Et=S(Pe,{target:Ke,open:te});bt=te?Et[0]:Et[1]||0}var yt=typeof bt=="number"?"".concat(bt,"px"):bt,pt=Ce==="left"||Ce==="top"?yt:"-".concat(yt);pt=be&&Ce==="right"&&Re?"calc(".concat(pt," + ").concat(Re,"px)"):pt,Ke.style.transform=bt?"".concat(ae,"(").concat(pt,")"):""})},V.setLevelAndScrolling=function(te,ae,me){var Re=V.props.onChange;if(!T){var Oe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(d.a)(!0):0;V.setLevelTransform(te,ae,me,Oe),V.toggleScrollingToDrawerAndBody(Oe)}Re&&Re(te)},V.toggleScrollingToDrawerAndBody=function(te){var ae=V.props,me=ae.getOpenCount,Re=ae.getContainer,Oe=ae.showMask,Ce=ae.open,Pe=Re&&Re(),He=me&&me();if(Pe&&Pe.parentNode===document.body&&Oe){var Ee=["touchstart"],be=[document.body,V.maskDom,V.handlerDom,V.contentDom];Ce&&document.body.style.overflow!=="hidden"?(te&&V.addScrollingEffect(te),He===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",be.forEach(function(Ke,bt){if(!Ke)return;i(Ke,Ee[bt]||"touchmove",bt?V.removeMoveHandler:V.removeStartHandler,V.passive)})):V.getCurrentDrawerSome()&&(He||(document.body.style.overflow=""),document.body.style.touchAction="",te&&V.remScrollingEffect(te),be.forEach(function(Ke,bt){if(!Ke)return;s(Ke,Ee[bt]||"touchmove",bt?V.removeMoveHandler:V.removeStartHandler,V.passive)}))}},V.addScrollingEffect=function(te){var ae=V.props,me=ae.placement,Re=ae.duration,Oe=ae.ease,Ce=ae.getOpenCount,Pe=ae.switchScrollingEffect,He=Ce&&Ce();He===1&&Pe();var Ee="width ".concat(Re," ").concat(Oe),be="transform ".concat(Re," ").concat(Oe);V.dom.style.transition="none";switch(me){case"right":V.dom.style.transform="translateX(-".concat(te,"px)");break;case"top":case"bottom":V.dom.style.width="calc(100% - ".concat(te,"px)"),V.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(be,",").concat(Ee),V.dom.style.width="",V.dom.style.transform="")})},V.remScrollingEffect=function(te){var ae=V.props,me=ae.placement,Re=ae.duration,Oe=ae.ease,Ce=ae.getOpenCount,Pe=ae.switchScrollingEffect,He=Ce&&Ce();He||Pe(!0),r&&(document.body.style.overflowX="hidden"),V.dom.style.transition="none";var Ee,be="width ".concat(Re," ").concat(Oe),Ke="transform ".concat(Re," ").concat(Oe);switch(me){case"left":{V.dom.style.width="100%",be="width 0s ".concat(Oe," ").concat(Re);break}case"right":{V.dom.style.transform="translateX(".concat(te,"px)"),V.dom.style.width="100%",be="width 0s ".concat(Oe," ").concat(Re),V.maskDom&&(V.maskDom.style.left="-".concat(te,"px"),V.maskDom.style.width="calc(100% + ".concat(te,"px)"));break}case"top":case"bottom":{V.dom.style.width="calc(100% + ".concat(te,"px)"),V.dom.style.height="100%",V.dom.style.transform="translateZ(0)",Ee="height 0s ".concat(Oe," ").concat(Re);break}default:break}clearTimeout(V.timeout),V.timeout=setTimeout(function(){V.dom&&(V.dom.style.transition="".concat(Ke,",").concat(Ee?"".concat(Ee,","):"").concat(be),V.dom.style.transform="",V.dom.style.width="",V.dom.style.height="")})},V.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(te){return b[te]})},V.getLevelDom=function(te){var ae=te.level,me=te.getContainer;if(T)return;var Re=me&&me(),Oe=Re?Re.parentNode:null;if(V.levelDom=[],ae==="all"){var Ce=Oe?Array.prototype.slice.call(Oe.children):[];Ce.forEach(function(Pe){Pe.nodeName!=="SCRIPT"&&Pe.nodeName!=="STYLE"&&Pe.nodeName!=="LINK"&&Pe!==Re&&V.levelDom.push(Pe)})}else ae&&o(ae).forEach(function(Pe){document.querySelectorAll(Pe).forEach(function(He){V.levelDom.push(He)})})},V.getHorizontalBoolAndPlacementName=function(){var te=V.props.placement,ae=te==="left"||te==="right",me="translate".concat(ae?"X":"Y");return{isHorizontal:ae,placementName:me}},V.state={_self:Object(P.a)(V)},V}return Object(M.a)(W,[{key:"componentDidMount",value:function(){var V=this;if(!T){var te=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return te=!0,null}}))}catch(Ce){}this.passive=te?{passive:!1}:!1}var ae=this.props,me=ae.open,Re=ae.getContainer,Oe=Re&&Re();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),me&&(Oe&&Oe.parentNode===document.body&&(b[this.drawerId]=me),this.openLevelTransition(),this.forceUpdate(function(){V.domFocus()}))}},{key:"componentDidUpdate",value:function(V){var te=this.props,ae=te.open,me=te.getContainer,Re=me&&me();ae!==V.open&&(ae&&this.domFocus(),Re&&Re.parentNode===document.body&&(b[this.drawerId]=!!ae),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var V=this.props,te=V.getOpenCount,ae=V.open,me=V.switchScrollingEffect,Re=typeof te=="function"&&te();delete b[this.drawerId],ae&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Re||(document.body.style.overflow="",me(!0))}},{key:"render",value:function(){var V,te=this,ae=this.props,me=ae.className,Re=ae.children,Oe=ae.style,Ce=ae.width,Pe=ae.height,He=ae.defaultOpen,Ee=ae.open,be=ae.prefixCls,Ke=ae.placement,bt=ae.level,Et=ae.levelMove,yt=ae.ease,pt=ae.duration,st=ae.getContainer,ht=ae.handler,wt=ae.onChange,_e=ae.afterVisibleChange,Me=ae.showMask,ye=ae.maskClosable,Se=ae.maskStyle,Be=ae.onClose,Ze=ae.onHandleClick,ot=ae.keyboard,ft=ae.getOpenCount,Ct=ae.switchScrollingEffect,Ot=Object(Z.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"]),Ne=this.dom?Ee:!1,ke=m()(be,(V={},Object(n.a)(V,"".concat(be,"-").concat(Ke),!0),Object(n.a)(V,"".concat(be,"-open"),Ne),Object(n.a)(V,me||"",!!me),Object(n.a)(V,"no-mask",!Me),V)),at=this.getHorizontalBoolAndPlacementName(),ct=at.placementName,Ge=Ke==="left"||Ke==="top"?"-100%":"100%",et=Ne?"":"".concat(ct,"(").concat(Ge,")"),Ae=ht&&N.cloneElement(ht,{onClick:function(xe){ht.props.onClick&&ht.props.onClick(),Ze&&Ze(xe)},ref:function(xe){te.handlerDom=xe}});return N.createElement("div",Object.assign({},Ot,{tabIndex:-1,className:ke,style:Oe,ref:function(xe){te.dom=xe},onKeyDown:Ne&&ot?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Me&&N.createElement("div",{className:"".concat(be,"-mask"),onClick:ye?Be:void 0,style:Se,ref:function(xe){te.maskDom=xe}}),N.createElement("div",{className:"".concat(be,"-content-wrapper"),style:{transform:et,msTransform:et,width:x(Ce)?"".concat(Ce,"px"):Ce,height:x(Pe)?"".concat(Pe,"px"):Pe},ref:function(xe){te.contentWrapper=xe}},N.createElement("div",{className:"".concat(be,"-content"),ref:function(xe){te.contentDom=xe},onTouchStart:Ne&&Me?this.removeStartHandler:void 0,onTouchMove:Ne&&Me?this.removeMoveHandler:void 0},Re),Ae))}}],[{key:"getDerivedStateFromProps",value:function(V,te){var ae=te.prevProps,me=te._self,Re={prevProps:V};if(ae!==void 0){var Oe=V.placement,Ce=V.level;Oe!==ae.placement&&(me.contentDom=null),Ce!==ae.level&&me.getLevelDom(V)}return Re}}]),W}(N.Component);g.defaultProps={switchScrollingEffect:function(){}};var f=g;function C(A){var G=E();return function(){var O=Object(I.a)(A),V;if(G){var te=Object(I.a)(this).constructor;V=Reflect.construct(O,arguments,te)}else V=O.apply(this,arguments);return Object(F.a)(this,V)}}function E(){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(A){return!1}}var y=function(A){Object(X.a)(W,A);var G=C(W);function W(O){var V;Object(z.a)(this,W),V=G.call(this,O),V.onHandleClick=function(ae){var me=V.props,Re=me.onHandleClick,Oe=me.open;if(Re&&Re(ae),typeof Oe=="undefined"){var Ce=V.state.open;V.setState({open:!Ce})}},V.onClose=function(ae){var me=V.props,Re=me.onClose,Oe=me.open;Re&&Re(ae),typeof Oe=="undefined"&&V.setState({open:!1})};var te=typeof O.open!="undefined"?O.open:!!O.defaultOpen;return V.state={open:te},"onMaskClick"in O&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),V}return Object(M.a)(W,[{key:"render",value:function(){var V=this,te=this.props,ae=te.defaultOpen,me=te.getContainer,Re=te.wrapperClassName,Oe=te.forceRender,Ce=te.handler,Pe=Object(Z.a)(te,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),He=this.state.open;if(!me)return N.createElement("div",{className:Re,ref:function(Ke){V.dom=Ke}},N.createElement(f,Object.assign({},Pe,{open:He,handler:Ce,getContainer:function(){return V.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var Ee=!!Ce||Oe;return N.createElement(H.a,{visible:He,forceRender:Ee,getContainer:me,wrapperClassName:Re},function(be){var Ke=be.visible,bt=be.afterClose,Et=Object(Z.a)(be,["visible","afterClose"]);return N.createElement(f,Object.assign({},Pe,Et,{open:Ke!==void 0?Ke:He,afterVisibleChange:bt!==void 0?bt:Pe.afterVisibleChange,handler:Ce,onClose:V.onClose,onHandleClick:V.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(V,te){var ae=te.prevProps,me={prevProps:V};return typeof ae!="undefined"&&V.open!==ae.open&&(me.open=V.open),me}}]),W}(N.Component);y.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:N.createElement("div",{className:"drawer-handle"},N.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var U=y,j=ce.a=U},fcyK:function(je,ce,D){},fjLI:function(je,ce,D){"use strict";D.d(ce,"f",function(){return d}),D.d(ce,"b",function(){return u}),D.d(ce,"a",function(){return o}),D.d(ce,"d",function(){return h}),D.d(ce,"e",function(){return r}),D.d(ce,"c",function(){return a});var Z=D("8HAY"),z=D("Vhoy"),M=D("MI8n"),X=D("JYp7"),F=D("pmY6"),I=D("24hK"),H=D("nnTU"),N=D("T8No"),n=D("Cg/j"),P=D("t9D7"),p=function(i,s,S,x){var T=arguments.length,R=T<3?s:x===null?x=Object.getOwnPropertyDescriptor(s,S):x,w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,s,S,x);else for(var v=i.length-1;v>=0;v--)(w=i[v])&&(R=(T<3?w(R):T>3?w(s,S,R):w(s,S))||R);return T>3&&R&&Object.defineProperty(s,S,R),R},m=function(i,s){return function(S,x){s(S,x,i)}};function d(i){return i.command!==void 0}class u{constructor(i){this.id=u._idPool++,this._debugName=i}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const o=Object(n.c)("menuService"),h=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===u.CommandPalette}}addCommand(i){return this.addCommands(X.a.single(i))}addCommands(i){for(const s of i)this._commands.set(s.id,s);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(F.i)(()=>{let s=!1;for(const S of i)s=this._commands.delete(S.id)||s;s&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((s,S)=>i.set(S,s)),i}appendMenuItem(i,s){return this.appendMenuItems(X.a.single({id:i,item:s}))}appendMenuItems(i){const s=new Set,S=new I.a;for(const{id:x,item:T}of i){let R=this._menuItems.get(x);R||(R=new I.a,this._menuItems.set(x,R)),S.push(R.push(T)),s.add(x)}return this._onDidChangeMenu.fire(s),Object(F.i)(()=>{if(S.size>0){for(let x of S)x();this._onDidChangeMenu.fire(s),S.clear()}})}getMenuItems(i){let s;return this._menuItems.has(i)?s=[...this._menuItems.get(i)]:s=[],i===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(i){const s=new Set;for(const S of i)d(S)&&(s.add(S.command.id),S.alt&&s.add(S.alt.id));this._commands.forEach((S,x)=>{s.has(x)||i.push({command:S})})}};class r extends Z.e{constructor(i,s,S,x){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=s,this._contextKeyService=S,this._options=x}get actions(){const i=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),S=s.getActions(this._options);s.dispose();for(const[,x]of S)x.length>0&&(i.push(...x),i.push(new Z.d));return i.length&&i.pop(),i}}let a=class i{constructor(s,S,x,T,R){var w,v;if(this._commandService=R,this.id=s.id,this.label=(x==null?void 0:x.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(v=typeof s.tooltip=="string"?s.tooltip:(w=s.tooltip)===null||w===void 0?void 0:w.value)!==null&&v!==void 0?v:"",this.enabled=!s.precondition||T.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const b=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=T.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=s,this.alt=S?new i(S,void 0,x,T,R):void 0,this._options=x,P.d.isThemeIcon(s.icon)&&(this.class=z.a.asClassName(s.icon))}dispose(){}run(...s){var S,x;let T=[];return((S=this._options)===null||S===void 0?void 0:S.arg)&&(T=[...T,this._options.arg]),((x=this._options)===null||x===void 0?void 0:x.shouldForwardArgs)&&(T=[...T,...s]),this._commandService.executeCommand(this.id,...T)}};a=p([m(3,N.b),m(4,H.b)],a)},fyJ8:function(je,ce,D){"use strict";var Z=D("rePB"),z=D("VTBJ"),M=D("Ff2n"),X=D("U8pU"),F=D("q1tI"),I=D.n(F),H=D("TSYQ"),N=D.n(H),n=D("c+Xe"),P=D("sR1s");function p(h){return h&&Object(X.a)(h)==="object"&&!Array.isArray(h)&&!F.isValidElement(h)}function m(h){return typeof h=="string"?!0:Object(n.c)(h)}function d(h,r){var a,i=h.prefixCls,s=h.className,S=h.record,x=h.index,T=h.dataIndex,R=h.render,w=h.children,v=h.component,b=v===void 0?"td":v,g=h.colSpan,f=h.rowSpan,C=h.fixLeft,E=h.fixRight,y=h.firstFixLeft,U=h.lastFixLeft,j=h.firstFixRight,A=h.lastFixRight,G=h.appendNode,W=h.additionalProps,O=W===void 0?{}:W,V=h.ellipsis,te=h.align,ae=h.rowType,me=h.isSticky,Re="".concat(i,"-cell"),Oe,Ce;if(w)Ce=w;else{var Pe=Object(P.b)(S,T);if(Ce=Pe,R){var He=R(Pe,S,x);p(He)?(Ce=He.children,Oe=He.props):Ce=He}}Object(X.a)(Ce)==="object"&&!Array.isArray(Ce)&&!F.isValidElement(Ce)&&(Ce=null),V&&(U||j)&&(Ce=F.createElement("span",{className:"".concat(Re,"-content")},Ce));var Ee=Oe||{},be=Ee.colSpan,Ke=Ee.rowSpan,bt=Ee.style,Et=Ee.className,yt=Object(M.a)(Ee,["colSpan","rowSpan","style","className"]),pt=be!==void 0?be:g,st=Ke!==void 0?Ke:f;if(pt===0||st===0)return null;var ht={},wt=typeof C=="number",_e=typeof E=="number";wt&&(ht.position="sticky",ht.left=C),_e&&(ht.position="sticky",ht.right=E);var Me={};te&&(Me.textAlign=te);var ye,Se=V===!0?{showTitle:!0}:V;Se&&(Se.showTitle||ae==="header")&&(typeof Ce=="string"||typeof Ce=="number"?ye=Ce.toString():F.isValidElement(Ce)&&typeof Ce.props.children=="string"&&(ye=Ce.props.children));var Be=Object(z.a)(Object(z.a)(Object(z.a)({title:ye},yt),O),{},{colSpan:pt&&pt!==1?pt:null,rowSpan:st&&st!==1?st:null,className:N()(Re,s,(a={},Object(Z.a)(a,"".concat(Re,"-fix-left"),wt),Object(Z.a)(a,"".concat(Re,"-fix-left-first"),y),Object(Z.a)(a,"".concat(Re,"-fix-left-last"),U),Object(Z.a)(a,"".concat(Re,"-fix-right"),_e),Object(Z.a)(a,"".concat(Re,"-fix-right-first"),j),Object(Z.a)(a,"".concat(Re,"-fix-right-last"),A),Object(Z.a)(a,"".concat(Re,"-ellipsis"),V),Object(Z.a)(a,"".concat(Re,"-with-append"),G),Object(Z.a)(a,"".concat(Re,"-fix-sticky"),(wt||_e)&&me),a),O.className,Et),style:Object(z.a)(Object(z.a)(Object(z.a)(Object(z.a)({},O.style),Me),ht),bt),ref:m(b)?r:null});return F.createElement(b,Object.assign({},Be),G,Ce)}var u=F.forwardRef(d);u.displayName="Cell";var o=F.memo(u,function(h,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,h.record):!1});ce.a=o},gRFJ:function(je,ce,D){je.exports=[D("rdUC"),D("ynwM"),D("RELg"),D("DlR+"),D("CrYA"),D("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(je){return je<10?"0"+je:je}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(je){return rx_escapable.lastIndex=0,rx_escapable.test(je)?'"'+je.replace(rx_escapable,function(ce){var D=meta[ce];return typeof D=="string"?D:"\\u"+("0000"+ce.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+je+'"'}function str(je,ce){var D,Z,z,M,X=gap,F,I=ce[je];I&&typeof I=="object"&&typeof I.toJSON=="function"&&(I=I.toJSON(je)),typeof rep=="function"&&(I=rep.call(ce,je,I));switch(typeof I){case"string":return quote(I);case"number":return isFinite(I)?String(I):"null";case"boolean":case"null":return String(I);case"object":if(!I)return"null";if(gap+=indent,F=[],Object.prototype.toString.apply(I)==="[object Array]"){for(M=I.length,D=0;D0&&!this.paused&&!this.ended&&this.readyState>2}});function a(S,x){return S-x}function i(S){S.sort(a);for(var x=0,T=0;T1&&arguments[1]!==void 0?arguments[1]:!1,ue={point:ae.current.currentTime};Be?(ue.log_id=Be,ue.watch_duration=i(Ne),ue.total_duration=ye):(f?(ue.video_id=parseInt(v,10),ue.course_id=f):ue.video_id=v,ue.duration=Me,ue.device=ht),xe&&(ue.ed="1");function fe(){return de.apply(this,arguments)}function de(){return de=Object(M.a)(F.a.mark(function we(){var Le;return F.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return Ct=!0,dt.next=3,b(ue);case 3:Le=dt.sent,Be=Le,Ct=!1,ve&&ve();case 7:case"end":return dt.stop()}},we)})),de.apply(this,arguments)}fe()},[v,f]);Object(I.useEffect)(function(){z.b.destroy();var ve=null;return N.a.isSupported&&te&&R&&(R==null?void 0:R.indexOf(".m3u8"))<0?(ve=N.a.createPlayer({type:"flv",volume:.8,cors:!0,url:Ge(R),muted:!1}),ae.current&&(ve.attachMediaElement(ae.current),ve.load())):ae.current.setAttribute("src",Ge(R)),ct(),function(){ve&&(ve.unload(),ve.pause(),ve.destroy(),ve=null)}},[ae,te,R]);function at(){ae.current.paused?(Oe.current.style.display="none",Ce.current.style.display="block"):(Oe.current.style.display="block",Ce.current.style.display="none")}function ct(){bt.current.style.display="none",yt.current.style.display="none",Et.current.style.display="none",ae.current.muted||ae.current.volume===0?bt.current.style.display="block":ae.current.volume>0&&ae.current.volume<=.5?yt.current.style.display="block":Et.current.style.display="block"}Object(I.useEffect)(function(){var ve=document.getElementById("play"),xe=document.querySelectorAll(".playback-icons use");function ue(){j(),C&&!wt.current&&(ae.current.currentTime=C),wt.current=!0,Ne.push(ae.current.currentTime),Ze||(Ze=!0,w&&ke())}function fe(){return de.apply(this,arguments)}function de(){return de=Object(M.a)(F.a.mark(function pe(){return F.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:at(),Ne.push(ae.current.currentTime),w&&ke(function(){Be=null,Se=0,Ze=!1,Ct=!1,Ot=!1,Ne=[],ye=0,ft=1},!0);case 3:case"end":return nt.stop()}},pe)})),de.apply(this,arguments)}function we(){Pe.current.value=Math.round(ae.current.currentTime),He.current.value=Math.round(ae.current.currentTime)}function Le(){var pe=r(Math.round(ae.current.currentTime));be.current.innerText="".concat(pe.hour>0?pe.hour+":":"").concat(pe.minutes,":").concat(pe.seconds),be.current.setAttribute("datetime","".concat(pe.hour>0?" "+pe.hour+" ":"").concat(pe.minutes,"m ").concat(pe.seconds,"s"))}function ze(){var pe=Math.round(ae.current.duration);Pe.current.setAttribute("max",pe),He.current.setAttribute("max",pe);var Te=r(pe);Ee.current.innerText="".concat(Te.hour>0?Te.hour+":":"").concat(Te.minutes,":").concat(Te.seconds),Ee.current.setAttribute("datetime","".concat(Te.hour>0?" "+Te.hour+" ":"").concat(Te.minutes,"m ").concat(Te.seconds,"s"))}function dt(){var pe=Math.round(ae.current.duration);Pe.current.setAttribute("max",pe),He.current.setAttribute("max",pe);var Te=r(pe);Ee.current.innerText="".concat(Te.hour>0?Te.hour+":":"").concat(Te.minutes,":").concat(Te.seconds),Ee.current.setAttribute("datetime","".concat(Te.hour>0?" "+Te.hour+" ":"").concat(Te.minutes,"m ").concat(Te.seconds,"s")),we(),Le();var nt=me.current.getBoundingClientRect(),Xe=nt.width,Pt=nt.height,Mt=nt.x,Ve=nt.y;if(Mt<0||Ve<0||!Xe)return;if(!Ot){var gt=ae.current.currentTime,It=gt-Se;Math.abs(It)<10?(ye+=Math.abs(It),Se=gt,Ct||ye-ft*ot>=0&&(ft++,Ne.push(Se),w&&ke())):(Se=gt,w&&ke())}}function Lt(){Ot=!0}function Ft(){ae.current.playing&&Ne.push(ae.current.currentTime,Se),Se=ae.current.currentTime,Ot=!1}function kt(){Me=ae.current.duration,Me<=20&&(ot=Me/3),ae.current.addEventListener("play",ue)}function St(pe){pe.preventDefault(),Object(u.a)()?(ae.current.style.width="100%",ae.current.style.height="100%"):ae.current.style.cssText=""}function qe(){y()}function rt(pe){var Te=pe.target.dataset.seek?pe.target.dataset.seek:pe.target.value;ae.current.currentTime=Te,He.current.value=Te,Pe.current.value=Te}function Ye(pe){var Te=Math.round(pe.offsetX/pe.target.clientWidth*parseInt(pe.target.getAttribute("max"),10));Pe.current.setAttribute("data-seek",Te);var nt=r(Te);Ke.current.textContent="".concat(nt.hour>0?nt.hour+":":"").concat(nt.minutes,":").concat(nt.seconds);var Xe=ae.current.getBoundingClientRect();Ke.current.style.left="".concat(pe.pageX-Xe.left,"px")}return Re.current.addEventListener(Object(u.c)(),St),ae.current.addEventListener("canplay",kt),ae.current.addEventListener("ended",fe),ae.current.addEventListener("seeking",Lt),ae.current.addEventListener("seeked",Ft),ae.current.addEventListener("loadedmetadata",ze),Pe.current.addEventListener("mousemove",Ye),Pe.current.addEventListener("input",rt),ae.current.addEventListener("timeupdate",dt),ae.current.addEventListener("pause",qe),ae.current.addEventListener("volumechange",ct),function(){ae.current.removeEventListener("canplay",kt),ae.current.removeEventListener("play",ue),ae.current.removeEventListener("ended",fe),ae.current.removeEventListener("seeking",Lt),ae.current.removeEventListener("seeked",Ft),Pe.current.removeEventListener("mousemove",Ye),Pe.current.removeEventListener("input",rt),ae.current.removeEventListener("timeupdate",dt),ae.current.removeEventListener("pause",qe),ae.current.removeEventListener("loadedmetadata",ze),ae.current.removeEventListener("volumechange",ct),ae.current.playing&&(Ne.push(Se,ae.current.currentTime),w&&ke())}},[ae,R]),Object(I.useEffect)(function(){if(ae.current.onended=function(){G(ae)},ae.current.oncontextmenu=function(){return!1},(R==null?void 0:R.indexOf(".m3u8"))>-1){if(ae.current.canPlayType("application/vnd.apple.mpegurl"))ae.current.src=Ge(R);else if(P.a.isSupported()){var ve=new P.a;ve.loadSource(R),ve.attachMedia(ae.current)}}},[R]),Object(I.useEffect)(function(){ae.current.playbackRate=O},[O]);var Ge=function(xe){return xe.indexOf("disposition")>-1?xe:xe.indexOf("?")>-1?xe+"&disposition=MP4":xe+"?disposition=MP4"},et=function(){ae.current.paused||ae.current.ended?ae.current.play():ae.current.pause(),at()};function Ae(){ae.current.muted=!ae.current.muted,ae.current.muted?(pt.current.setAttribute("data-volume",volume.value),pt.current.value=0):pt.current.value=pt.current.dataset.volume}return H.a.createElement("div",{style:{position:"relative"},ref:Re},H.a.createElement("div",{ref:me,className:"".concat(h.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(h.a.animate__loop)}),H.a.createElement("div",{className:h.a.container},H.a.createElement("div",{className:h.a["video-container"],id:"video-container"},H.a.createElement("div",{className:h.a["playback-animation"],id:"playback-animation"},H.a.createElement("svg",{className:h.a["playback-icons"]},H.a.createElement("use",{className:"hidden",href:"#play-icon"}),H.a.createElement("use",{href:"#pause"}))),H.a.createElement("video",{className:h.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:ae,autoPlay:!1}),H.a.createElement("div",{className:"".concat(h.a["video-controls"]," "),id:"video-controls"},H.a.createElement("div",{className:h.a["bottom-controls"]},H.a.createElement("div",{className:h.a["left-controls"]},H.a.createElement("button",{"data-title":"\u64AD\u653E/\u6682\u505C",id:"play",onClick:et},H.a.createElement("svg",{className:h.a["playback-icons"]},H.a.createElement("use",{ref:Ce,href:"#play-icon"}),H.a.createElement("use",{ref:Oe,style:{display:"none"},href:"#pause"}))),H.a.createElement("div",{className:h.a.time},H.a.createElement("time",{id:"time-elapsed",ref:be},"00:00"),H.a.createElement("span",null," / "),H.a.createElement("time",{id:"duration",ref:Ee},"00:00"))),H.a.createElement("div",{className:h.a["right-controls"]},H.a.createElement(m.CopyToClipboard,{text:R,onCopy:function(){return z.b.success("\u590D\u5236\u6210\u529F")}},H.a.createElement("button",{"data-title":"\u590D\u5236\u94FE\u63A5"},H.a.createElement("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}}))),H.a.createElement("div",{className:h.a["volume-controls"]},H.a.createElement("button",{"data-title":"\u5F00\u542F/\u5173\u95ED\u58F0\u97F3",className:h.a["volume-button"],id:"volume-button",onClick:Ae},H.a.createElement("i",{ref:bt,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:yt,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),H.a.createElement("i",{ref:Et,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})),H.a.createElement("input",{className:h.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:pt,style:{display:"none"},onClick:ct})),H.a.createElement("button",{"data-title":"\u5168\u5C4F/\u9000\u51FA\u5168\u5C4F",className:h.a["fullscreen-button"],onClick:function(){Object(u.a)()?Object(u.b)():Object(u.d)(Re.current)}},H.a.createElement("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})))),H.a.createElement("div",{className:h.a["video-progress"]},H.a.createElement("progress",{ref:He,value:"0",min:"0"}),H.a.createElement("input",{className:h.a.seek,ref:Pe,value:"0",min:"0",type:"range",step:"1"}),H.a.createElement("div",{className:h.a["seek-tooltip"],ref:Ke,id:"seek-tooltip"},"00:00"))))),H.a.createElement("svg",{style:{display:"none"}},H.a.createElement("defs",null,H.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),H.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),H.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),H.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),H.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),H.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),H.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),H.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},H.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))})},i3hx:function(je,ce,D){},ic2d:function(je,ce,D){"use strict";D.d(ce,"a",function(){return X});var Z=D("FWmy"),z=D("746U");class M{constructor(){this.data=new Map}add(F,I){Z.a(z.l(F)),Z.a(z.k(I)),Z.a(!this.data.has(F),"There is already an extension with this id"),this.data.set(F,I)}as(F){return this.data.get(F)||null}}const X=new M},je13:function(je,ce,D){var Z=D("5nXd"),z=D("gRFJ"),M=[D("uQRt")];je.exports=Z.createStore(z,M)},kSUc:function(je,ce,D){},"kaH+":function(je,ce,D){"use strict";var Z=D("+L6B"),z=D("2/Rp"),M=D("tJVT"),X=D("q1tI"),F=D.n(X),I=D("UZu5"),H=D.n(I),N=D("dhSg"),n=D("rLCj"),P=D("dF/Y"),p=D("4i/N");ce.a=function(){var m=Object(X.useState)(""),d=Object(M.a)(m,2),u=d[0],o=d[1],h=Object(X.useState)(0),r=Object(M.a)(h,2),a=r[0],i=r[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var b=N.a.subscribe("preview-image",function(g){o(g),document.body.style.overflow="hidden"});return b},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",S),function(){document.removeEventListener("keydown",S)}},[]),Object(X.useEffect)(function(){s.current=u},[u]);function S(b){b.keyCode==27&&s.current&&x()}function x(){document.body.style.overflow="auto",o("")}function T(){i(a+90)}var R=Object(X.useRef)(),w=Object(X.useRef)(),v=function(g){(g.nativeEvent.target===R.current||g.nativeEvent.target===w.current)&&x()};return F.a.createElement(X.Fragment,null,u?F.a.createElement("div",{className:"image-preview-container",ref:R,onClick:v},F.a.createElement("div",{className:"button-group"},F.a.createElement(z.a,{onClick:T},"\u65CB\u8F6C",F.a.createElement(n.a,null)),F.a.createElement(z.a,{href:u},"\u4E0B\u8F7D",F.a.createElement(P.a,null)),F.a.createElement(z.a,{onClick:x},"\u5173\u95ED",F.a.createElement(p.a,null))),F.a.createElement("div",{className:"preview-wrp-group",ref:w},F.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(a,"deg)")}}))):null)}},kovY:function(je,ce,D){je.exports=D.p+"static/e.eabfa286.svg"},lOMy:function(je,ce,D){},lZu9:function(je,ce,D){(function(Z){Z(D("VrN/"),D("1eCo"),D("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(z,M){var X=Z.getMode(z,"text/html"),F=X.name=="null";function I(W){if(Z.findModeByName){var O=Z.findModeByName(W);O&&(W=O.mime||O.mimes[0])}var V=Z.getMode(z,W);return V.name=="null"?null:V}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 H={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var N in H)H.hasOwnProperty(N)&&M.tokenTypeOverrides[N]&&(H[N]=M.tokenTypeOverrides[N]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,P=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,m=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function i(W,O,V){return O.f=O.inline=V,V(W,O)}function s(W,O,V){return O.f=O.block=V,V(W,O)}function S(W){return!W||!/\S/.test(W.string)}function x(W){if(W.linkTitle=!1,W.linkHref=!1,W.linkText=!1,W.em=!1,W.strong=!1,W.strikethrough=!1,W.quote=0,W.indentedCode=!1,W.f==R){var O=F;if(!O){var V=Z.innerMode(X,W.htmlState);O=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}O&&(W.f=g,W.block=T,W.htmlState=null)}return W.trailingSpace=0,W.trailingSpaceNewLine=!1,W.prevLine=W.thisLine,W.thisLine={stream:null},null}function T(W,O){var V=W.column()===O.indentation,te=S(O.prevLine.stream),ae=O.indentedCode,me=O.prevLine.hr,Re=O.list!==!1,Oe=(O.listStack[O.listStack.length-1]||0)+3;O.indentedCode=!1;var Ce=O.indentation;if(O.indentationDiff===null&&(O.indentationDiff=O.indentation,Re)){for(O.list=null;Ce=4&&(ae||O.prevLine.fencedCodeEnd||O.prevLine.header||te))return W.skipToEnd(),O.indentedCode=!0,H.code;if(W.eatSpace())return null;if(V&&O.indentation<=Oe&&(Ee=W.match(m))&&Ee[1].length<=6)return O.quote=0,O.header=Ee[1].length,O.thisLine.header=!0,M.highlightFormatting&&(O.formatting="header"),O.f=O.inline,v(O);if(O.indentation<=Oe&&W.eat(">"))return O.quote=V?1:O.quote+1,M.highlightFormatting&&(O.formatting="quote"),W.eatSpace(),v(O);if(!He&&!O.setext&&V&&O.indentation<=Oe&&(Ee=W.match(P))){var be=Ee[1]?"ol":"ul";return O.indentation=Ce+W.current().length,O.list=!0,O.quote=0,O.listStack.push(O.indentation),O.em=!1,O.strong=!1,O.code=!1,O.strikethrough=!1,M.taskLists&&W.match(p,!1)&&(O.taskList=!0),O.f=O.inline,M.highlightFormatting&&(O.formatting=["list","list-"+be]),v(O)}else{if(V&&O.indentation<=Oe&&(Ee=W.match(o,!0)))return O.quote=0,O.fencedEndRE=new RegExp(Ee[1]+"+ *$"),O.localMode=M.fencedCodeBlockHighlighting&&I(Ee[2]||M.fencedCodeBlockDefaultMode),O.localMode&&(O.localState=Z.startState(O.localMode)),O.f=O.block=w,M.highlightFormatting&&(O.formatting="code-block"),O.code=-1,v(O);if(O.setext||(!Pe||!Re)&&!O.quote&&O.list===!1&&!O.code&&!He&&!h.test(W.string)&&(Ee=W.lookAhead(1))&&(Ee=Ee.match(d)))return O.setext?(O.header=O.setext,O.setext=0,W.skipToEnd(),M.highlightFormatting&&(O.formatting="header")):(O.header=Ee[0].charAt(0)=="="?1:2,O.setext=O.header),O.thisLine.header=!0,O.f=O.inline,v(O);if(He)return W.skipToEnd(),O.hr=!0,O.thisLine.hr=!0,H.hr;if(W.peek()==="[")return i(W,O,U)}return i(W,O,O.inline)}function R(W,O){var V=X.token(W,O.htmlState);if(!F){var te=Z.innerMode(X,O.htmlState);(te.mode.name=="xml"&&te.state.tagStart===null&&!te.state.context&&te.state.tokenize.isInText||O.md_inside&&W.current().indexOf(">")>-1)&&(O.f=g,O.block=T,O.htmlState=null)}return V}function w(W,O){var V=O.listStack[O.listStack.length-1]||0,te=O.indentation=W.quote?O.push(H.formatting+"-"+W.formatting[V]+"-"+W.quote):O.push("error"))}if(W.taskOpen)return O.push("meta"),O.length?O.join(" "):null;if(W.taskClosed)return O.push("property"),O.length?O.join(" "):null;if(W.linkHref?O.push(H.linkHref,"url"):(W.strong&&O.push(H.strong),W.em&&O.push(H.em),W.strikethrough&&O.push(H.strikethrough),W.emoji&&O.push(H.emoji),W.linkText&&O.push(H.linkText),W.code&&O.push(H.code),W.image&&O.push(H.image),W.imageAltText&&O.push(H.imageAltText,"link"),W.imageMarker&&O.push(H.imageMarker)),W.header&&O.push(H.header,H.header+"-"+W.header),W.quote&&(O.push(H.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=W.quote?O.push(H.quote+"-"+W.quote):O.push(H.quote+"-"+M.maxBlockquoteDepth)),W.list!==!1){var te=(W.listStack.length-1)%3;te?te===1?O.push(H.list2):O.push(H.list3):O.push(H.list1)}return W.trailingSpaceNewLine?O.push("trailing-space-new-line"):W.trailingSpace&&O.push("trailing-space-"+(W.trailingSpace%2?"a":"b")),O.length?O.join(" "):null}function b(W,O){return W.match(u,!0)?v(O):void 0}function g(W,O){var V=O.text(W,O);if(typeof V!="undefined")return V;if(O.list)return O.list=null,v(O);if(O.taskList){var te=W.match(p,!0)[1]===" ";return te?O.taskOpen=!0:O.taskClosed=!0,M.highlightFormatting&&(O.formatting="task"),O.taskList=!1,v(O)}if(O.taskOpen=!1,O.taskClosed=!1,O.header&&W.match(/^#+$/,!0))return M.highlightFormatting&&(O.formatting="header"),v(O);var ae=W.next();if(O.linkTitle){O.linkTitle=!1;var me=ae;ae==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(W.match(new RegExp(Re),!0))return H.linkHref}if(ae==="`"){var Oe=O.formatting;M.highlightFormatting&&(O.formatting="code"),W.eatWhile("`");var Ce=W.current().length;if(O.code==0&&(!O.quote||Ce==1))return O.code=Ce,v(O);if(Ce==O.code){var Pe=v(O);return O.code=0,Pe}else return O.formatting=Oe,v(O)}else if(O.code)return v(O);if(ae==="\\"&&(W.next(),M.highlightFormatting)){var He=v(O),Ee=H.formatting+"-escape";return He?He+" "+Ee:Ee}if(ae==="!"&&W.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return O.imageMarker=!0,O.image=!0,M.highlightFormatting&&(O.formatting="image"),v(O);if(ae==="["&&O.imageMarker&&W.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return O.imageMarker=!1,O.imageAltText=!0,M.highlightFormatting&&(O.formatting="image"),v(O);if(ae==="]"&&O.imageAltText){M.highlightFormatting&&(O.formatting="image");var He=v(O);return O.imageAltText=!1,O.image=!1,O.inline=O.f=C,He}if(ae==="["&&!O.image)return O.linkText&&W.match(/^.*?\]/)||(O.linkText=!0,M.highlightFormatting&&(O.formatting="link")),v(O);if(ae==="]"&&O.linkText){M.highlightFormatting&&(O.formatting="link");var He=v(O);return O.linkText=!1,O.inline=O.f=W.match(/\(.*?\)| ?\[.*?\]/,!1)?C:g,He}if(ae==="<"&&W.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=f,M.highlightFormatting&&(O.formatting="link");var He=v(O);return He?He+=" ":He="",He+H.linkInline}if(ae==="<"&&W.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=f,M.highlightFormatting&&(O.formatting="link");var He=v(O);return He?He+=" ":He="",He+H.linkEmail}if(M.xml&&ae==="<"&&W.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var be=W.string.indexOf(">",W.pos);if(be!=-1){var Ke=W.string.substring(W.start,be);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ke)&&(O.md_inside=!0)}return W.backUp(1),O.htmlState=Z.startState(X),s(W,O,R)}if(M.xml&&ae==="<"&&W.match(/^\/\w*?>/))return O.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var bt=1,Et=W.pos==1?" ":W.string.charAt(W.pos-2);bt<3&&W.eat(ae);)bt++;var yt=W.peek()||" ",pt=!/\s/.test(yt)&&(!r.test(yt)||/\s/.test(Et)||r.test(Et)),st=!/\s/.test(Et)&&(!r.test(Et)||/\s/.test(yt)||r.test(yt)),ht=null,wt=null;if(bt%2&&(!O.em&&pt&&(ae==="*"||!st||r.test(Et))?ht=!0:O.em==ae&&st&&(ae==="*"||!pt||r.test(yt))&&(ht=!1)),bt>1&&(!O.strong&&pt&&(ae==="*"||!st||r.test(Et))?wt=!0:O.strong==ae&&st&&(ae==="*"||!pt||r.test(yt))&&(wt=!1)),wt!=null||ht!=null){M.highlightFormatting&&(O.formatting=ht==null?"strong":wt==null?"em":"strong em"),ht===!0&&(O.em=ae),wt===!0&&(O.strong=ae);var Pe=v(O);return ht===!1&&(O.em=!1),wt===!1&&(O.strong=!1),Pe}}else if(ae===" "&&(W.eat("*")||W.eat("_"))){if(W.peek()===" ")return v(O);W.backUp(1)}if(M.strikethrough){if(ae==="~"&&W.eatWhile(ae)){if(O.strikethrough){M.highlightFormatting&&(O.formatting="strikethrough");var Pe=v(O);return O.strikethrough=!1,Pe}else if(W.match(/^[^\s]/,!1))return O.strikethrough=!0,M.highlightFormatting&&(O.formatting="strikethrough"),v(O)}else if(ae===" "&&W.match(/^~~/,!0)){if(W.peek()===" ")return v(O);W.backUp(2)}}if(M.emoji&&ae===":"&&W.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){O.emoji=!0,M.highlightFormatting&&(O.formatting="emoji");var _e=v(O);return O.emoji=!1,_e}return ae===" "&&(W.match(/^ +$/,!1)?O.trailingSpace++:O.trailingSpace&&(O.trailingSpaceNewLine=!0)),v(O)}function f(W,O){var V=W.next();if(V===">"){O.f=O.inline=g,M.highlightFormatting&&(O.formatting="link");var te=v(O);return te?te+=" ":te="",te+H.linkInline}return W.match(/^[^>]+/,!0),H.linkInline}function C(W,O){if(W.eatSpace())return null;var V=W.next();return V==="("||V==="["?(O.f=O.inline=y(V==="("?")":"]"),M.highlightFormatting&&(O.formatting="link-string"),O.linkHref=!0,v(O)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(W){return function(O,V){var te=O.next();if(te===W){V.f=V.inline=g,M.highlightFormatting&&(V.formatting="link-string");var ae=v(V);return V.linkHref=!1,ae}return O.match(E[W]),V.linkHref=!0,v(V)}}function U(W,O){return W.match(/^([^\]\\]|\\.)*\]:/,!1)?(O.f=j,W.next(),M.highlightFormatting&&(O.formatting="link"),O.linkText=!0,v(O)):i(W,O,g)}function j(W,O){if(W.match(/^\]:/,!0)){O.f=O.inline=A,M.highlightFormatting&&(O.formatting="link");var V=v(O);return O.linkText=!1,V}return W.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function A(W,O){return W.eatSpace()?null:(W.match(/^[^\s]+/,!0),W.peek()===void 0?O.linkTitle=!0:W.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),O.f=O.inline=g,H.linkHref+" url")}var G={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:g,text:b,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(W){return{f:W.f,prevLine:W.prevLine,thisLine:W.thisLine,block:W.block,htmlState:W.htmlState&&Z.copyState(X,W.htmlState),indentation:W.indentation,localMode:W.localMode,localState:W.localMode?Z.copyState(W.localMode,W.localState):null,inline:W.inline,text:W.text,formatting:!1,linkText:W.linkText,linkTitle:W.linkTitle,linkHref:W.linkHref,code:W.code,em:W.em,strong:W.strong,strikethrough:W.strikethrough,emoji:W.emoji,header:W.header,setext:W.setext,hr:W.hr,taskList:W.taskList,list:W.list,listStack:W.listStack.slice(0),quote:W.quote,indentedCode:W.indentedCode,trailingSpace:W.trailingSpace,trailingSpaceNewLine:W.trailingSpaceNewLine,md_inside:W.md_inside,fencedEndRE:W.fencedEndRE}},token:function(W,O){if(O.formatting=!1,W!=O.thisLine.stream){if(O.header=0,O.hr=!1,W.match(/^\s*$/,!0))return x(O),null;if(O.prevLine=O.thisLine,O.thisLine={stream:W},O.taskList=!1,O.trailingSpace=0,O.trailingSpaceNewLine=!1,!O.localState&&(O.f=O.block,O.f!=R)){var V=W.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(O.indentation=V,O.indentationDiff=null,V>0)return null}}return O.f(W,O)},innerMode:function(W){return W.block==R?{state:W.htmlState,mode:X}:W.localState?{state:W.localState,mode:W.localMode}:{state:W,mode:G}},indent:function(W,O,V){return W.block==R&&X.indent?X.indent(W.htmlState,O,V):W.localState&&W.localMode.indent?W.localMode.indent(W.localState,O,V):Z.Pass},blankLine:x,getType:v,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},n6Qo:function(je,ce,D){"use strict";D.d(ce,"a",function(){return N});var Z=D("q1tI"),z=D("biw7"),M=D("fyJ8");function X(n){var P=n.className,p=n.index,m=n.children,d=n.colSpan,u=n.rowSpan,o=Z.useContext(z.a),h=o.prefixCls,r=o.fixedInfoList,a=r[p];return Z.createElement(M.a,Object.assign({className:P,index:p,component:"td",prefixCls:h,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:d,rowSpan:u}}}},a))}function F(n){return Z.createElement("tr",Object.assign({},n))}function I(n){var P=n.children,p=Z.useContext(z.a),m=p.prefixCls;return Z.createElement("tfoot",{className:"".concat(m,"-summary")},P)}var H=ce.b=I,N={Cell:X,Row:F}},nCk5:function(je,ce,D){je.exports=D.p+"static/d.53bf6ae3.svg"},nEHx:function(je,ce,D){"use strict";D.d(ce,"a",function(){return Z});var Z;(function(z){z.DARK="dark",z.LIGHT="light",z.HIGH_CONTRAST="hc"})(Z||(Z={}))},nWbc:function(je,ce,D){},nnTU:function(je,ce,D){"use strict";D.d(ce,"b",function(){return H}),D.d(ce,"a",function(){return N});var Z=D("MI8n"),z=D("JYp7"),M=D("pmY6"),X=D("24hK"),F=D("746U"),I=D("Cg/j");const H=Object(I.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,P){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!P)throw new Error("invalid command");return this.registerCommand({id:n,handler:P})}if(n.description){const o=[];for(let r of n.description.args)o.push(r.constraint);const h=n.handler;n.handler=function(r,...a){return Object(F.o)(a,o),h(r,...a)}}const{id:p}=n;let m=this._commands.get(p);m||(m=new X.a,this._commands.set(p,m));let d=m.unshift(n),u=Object(M.i)(()=>{d();const o=this._commands.get(p);(o==null?void 0:o.isEmpty())&&this._commands.delete(p)});return this._onDidRegisterCommand.fire(p),u}registerCommandAlias(n,P){return N.registerCommand(n,(p,...m)=>p.get(H).executeCommand(P,...m))}getCommand(n){const P=this._commands.get(n);return!P||P.isEmpty()?void 0:z.a.first(P)}getCommands(){const n=new Map;for(const P of this._commands.keys()){const p=this.getCommand(P);p&&n.set(P,p)}return n}};N.registerCommand("noop",()=>{})},oE5q:function(je,ce,D){je.exports=D.p+"static/t.0b94c5c3.svg"},oFv4:function(je,ce,D){je.exports=D.p+"static/internal.da228387.png"},osHv:function(je,ce,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var z=Z.Pos;function M(r,a){return r.line-a.line||r.ch-a.ch}var X="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",F=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+X+"]["+F+"]*)","g");function H(r,a,i,s){this.line=a,this.ch=i,this.cm=r,this.text=r.getLine(a),this.min=s?Math.max(s.from,r.firstLine()):r.firstLine(),this.max=s?Math.min(s.to-1,r.lastLine()):r.lastLine()}function N(r,a){var i=r.cm.getTokenTypeAt(z(r.line,a));return i&&/\btag\b/.test(i)}function n(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function P(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function p(r){for(;;){var a=r.text.indexOf(">",r.ch);if(a==-1){if(n(r))continue;return}if(!N(r,a+1)){r.ch=a+1;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function m(r){for(;;){var a=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(a==-1){if(P(r))continue;return}if(!N(r,a+1)){r.ch=a;continue}I.lastIndex=a,r.ch=a;var i=I.exec(r.text);if(i&&i.index==a)return i}}function d(r){for(;;){I.lastIndex=r.ch;var a=I.exec(r.text);if(!a){if(n(r))continue;return}if(!N(r,a.index+1)){r.ch=a.index+1;continue}return r.ch=a.index+a[0].length,a}}function u(r){for(;;){var a=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(a==-1){if(P(r))continue;return}if(!N(r,a+1)){r.ch=a;continue}var i=r.text.lastIndexOf("/",a),s=i>-1&&!/\S/.test(r.text.slice(i+1,a));return r.ch=a+1,s?"selfClose":"regular"}}function o(r,a){for(var i=[];;){var s=d(r),S,x=r.line,T=r.ch-(s?s[0].length:0);if(!s||!(S=p(r)))return;if(S=="selfClose")continue;if(s[1]){for(var R=i.length-1;R>=0;--R)if(i[R]==s[2]){i.length=R;break}if(R<0&&(!a||a==s[2]))return{tag:s[2],from:z(x,T),to:z(r.line,r.ch)}}else i.push(s[2])}}function h(r,a){for(var i=[];;){var s=u(r);if(!s)return;if(s=="selfClose"){m(r);continue}var S=r.line,x=r.ch,T=m(r);if(!T)return;if(T[1])i.push(T[2]);else{for(var R=i.length-1;R>=0;--R)if(i[R]==T[2]){i.length=R;break}if(R<0&&(!a||a==T[2]))return{tag:T[2],from:z(r.line,r.ch),to:z(S,x)}}}}Z.registerHelper("fold","xml",function(r,a){for(var i=new H(r,a.line,0);;){var s=d(i);if(!s||i.line!=a.line)return;var S=p(i);if(!S)return;if(!s[1]&&S!="selfClose"){var x=z(i.line,i.ch),T=o(i,s[2]);return T&&M(T.from,x)>0?{from:x,to:T.from}:null}}}),Z.findMatchingTag=function(r,a,i){var s=new H(r,a.line,a.ch,i);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var S=p(s),x=S&&z(s.line,s.ch),T=S&&m(s);if(!S||!T||M(s,a)>0)return;var R={from:z(s.line,s.ch),to:x,tag:T[2]};return S=="selfClose"?{open:R,close:null,at:"open"}:T[1]?{open:h(s,T[2]),close:R,at:"close"}:(s=new H(r,x.line,x.ch,i),{open:R,close:o(s,T[2]),at:"open"})},Z.findEnclosingTag=function(r,a,i,s){for(var S=new H(r,a.line,a.ch,i);;){var x=h(S,s);if(!x)break;var T=new H(r,a.line,a.ch,i),R=o(T,x.tag);if(R)return{open:x,close:R}}},Z.scanForClosingTag=function(r,a,i,s){var S=new H(r,a.line,a.ch,s?{from:0,to:s}:null);return o(S,i)}})},p5ED:function(je,ce,D){"use strict";var Z=D("+L6B"),z=D("2/Rp"),M=D("5Dmo"),X=D("3S7+"),F=D("k1fw"),I=D("9og8"),H=D("tJVT"),N=D("WmNS"),n=D.n(N),P=D("q1tI"),p=D.n(P),m=D("vHTk"),d=D.n(m),u=D("yEEn"),o=D("ZW9T"),h=D("1vsH"),r=D("V0Rq"),a=D("m3rI");ce.a=function(i){var s,S,x,T,R,w,v,b=i.editOffice,g=b===void 0?"view":b,f=i.data,C=i.theme,E=i.type,y=i.filename,U=i.monacoEditor,j=i.className,A=i.style,G=i.close,W=i.onClose,O=i.hasMask,V=i.disabledDownload,te=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(H.a)(te,2),me=ae[0],Re=ae[1],Oe=Object(P.useState)(""),Ce=Object(H.a)(Oe,2),Pe=Ce[0],He=Ce[1],Ee=Object(P.useState)(),be=Object(H.a)(Ee,2),Ke=be[0],bt=be[1],Et=window.ENV==="build"?"/react/build":"",yt=a.a.PROXY_SERVER||location.origin,pt,st=1024*1024,ht=10*st,wt=Object(P.useRef)();(s=f)!==null&&s!==void 0&&s.startsWith("/api")&&E!=="txt"&&(f=a.a.API_SERVER+f),E==="office"&&(pt=Object(h.V)(f).filesize,pt>ht&&(E="other")),y&&U&&(U.filename=y),Object(P.useEffect)(function(){var Se,Be,Ze=(Se=document.cookie)===null||Se===void 0||((Be=Se.replace(/\s/g,""))===null||Be===void 0)?void 0:Be.split(";");Ze==null||Ze.map(function(ot){var ft=ot.split("=");ft[0]==="_educoder_session"&&He(ft[1])})},[]),Object(P.useEffect)(function(){E==="office"&&_e()},[E,f]);var _e=function(){var Se=Object(I.a)(n.a.mark(function Be(){var Ze,ot,ft;return n.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return console.log("data:",f),Ze=f,f.startsWith("http")||(Ze=location.origin+Ze),ot=new URL(Ze).pathname.split("/").pop(),Ot.next=6,Object(r.V)({attachment_id:ot});case 6:ft=Ot.sent,bt(ft);case 8:case"end":return Ot.stop()}},Be)}));return function(){return Se.apply(this,arguments)}}(),Me=function(){if(f.startsWith("http")||f.startsWith("blob:")){ye();return}Object(h.B)(y||"educoder",f,y)},ye=function(){Object(h.z)(y||"educoder",decodeURIComponent(f))};return p.a.createElement("div",{style:Object(F.a)({},A||{}),className:"".concat(O&&d.a.bgBlack," ").concat(E?d.a.wrp:"hide")},G&&p.a.createElement("div",{className:d.a.close,ref:wt},!V&&p.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return wt.current}},p.a.createElement("span",{onClick:ye},p.a.createElement("i",{className:"icon-quxiaozhiding"}))),p.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return wt.current}},p.a.createElement("span",{className:"",onClick:W},p.a.createElement("i",{className:"icon-guanbi1"})))),p.a.createElement("div",{className:"".concat(d.a[j]," ").concat(j," ").concat(d.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&p.a.createElement(o.b,U)),E==="audio"&&p.a.createElement("audio",{src:"".concat(((S=f)===null||S===void 0?void 0:S.indexOf("http://"))>-1||((x=f)===null||x===void 0?void 0:x.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(f),autoPlay:!0}),E==="video"&&p.a.createElement(p.a.Fragment,null,((T=f)===null||T===void 0?void 0:T.indexOf("http"))>-1?p.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):p.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),E==="office"&&Ke&&p.a.createElement("iframe",{src:"".concat(Et,"/office.html?key=").concat(Ke.key,"&url=").concat(yt+Ke.url,"&callbackUrl=").concat(yt+Ke.callbackUrl,"&fileType=").concat(Ke.fileType,"&title=").concat(Ke.title,"&model=").concat(g,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),E==="html"&&p.a.createElement("iframe",{src:f+"&disposition=inline"}),E==="pdf"&&p.a.createElement("iframe",{src:"".concat(Et,"/js/pdfview/index.html?url=").concat(f,"&disabledDownload=").concat(!!V)}),E==="image"&&p.a.createElement("img",{src:"".concat(((R=f)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((w=f)===null||w===void 0?void 0:w.indexOf("https://"))>-1||(v=f)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(f)}),E==="other"&&p.a.createElement("div",null,p.a.createElement(z.a,{type:"primary",size:"large",onClick:Me},p.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&p.a.createElement(z.a,{type:"primary",size:"large",onClick:Me},p.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(je,ce,D){},pYxM:function(je,ce,D){je.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},pmY6:function(je,ce,D){"use strict";D.d(ce,"h",function(){return P}),D.d(ce,"g",function(){return m}),D.d(ce,"f",function(){return d}),D.d(ce,"e",function(){return u}),D.d(ce,"i",function(){return o}),D.d(ce,"b",function(){return h}),D.d(ce,"a",function(){return r}),D.d(ce,"d",function(){return a}),D.d(ce,"c",function(){return i});var Z=D("C/vA"),z=D("JYp7");const M=!1;let X=null;function F(s){X=s}if(M){const s="__is_disposable_tracked__";F(new class{trackDisposable(S){const x=new Error("Potentially leaked disposable").stack;setTimeout(()=>{S[s]||console.log(x)},3e3)}setParent(S,x){if(S&&S!==r.None)try{S[s]=!0}catch(T){}}markAsDisposed(S){if(S&&S!==r.None)try{S[s]=!0}catch(x){}}markAsSingleton(S){}})}function I(s){return X==null||X.trackDisposable(s),s}function H(s){X==null||X.markAsDisposed(s)}function N(s,S){X==null||X.setParent(s,S)}function n(s,S){if(!X)return;for(const x of s)X.setParent(x,S)}function P(s){return X==null||X.markAsSingleton(s),s}class p extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function m(s){return typeof s.dispose=="function"&&s.dispose.length===0}function d(s){if(z.a.is(s)){let S=[];for(const x of s)if(x)try{x.dispose()}catch(T){S.push(T)}if(S.length===1)throw S[0];if(S.length>1)throw new p(S);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const S=o(()=>d(s));return n(s,S),S}function o(s){const S=I({dispose:Object(Z.a)(()=>{H(S),s()})});return S}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,I(this)}dispose(){if(this._isDisposed)return;H(this),this._isDisposed=!0,this.clear()}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(s){if(!s)return s;if(s===this)throw new Error("Cannot register a disposable on itself!");return N(s,this),this._isDisposed?h.DISABLE_DISPOSED_WARNING||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(s),s}}h.DISABLE_DISPOSED_WARNING=!1;class r{constructor(){this._store=new h,I(this),N(this._store,this)}dispose(){H(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}r.None=Object.freeze({dispose(){}});class a{constructor(){this._isDisposed=!1,I(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var S;if(this._isDisposed||s===this._value)return;(S=this._value)===null||S===void 0||S.dispose(),s&&N(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,H(this),(s=this._value)===null||s===void 0||s.dispose(),this._value=void 0}clearAndLeak(){const s=this._value;return this._value=void 0,s&&N(s,null),s}}class i{constructor(s){this.object=s}dispose(){}}},ps8w:function(je,ce,D){je.exports=D.p+"static/show.6268a056.svg"},psGv:function(je,ce,D){var Z,z;(function(){var M;(function(){"use strict";var H=[,,function(p){function m(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var o=new m(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},m.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},m.prototype.has_match=function(o){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(o))return!0;return!1},m.prototype.set_indent=function(o,h){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(o){this.__items.push(o);var h=o.lastIndexOf(` `);h!==-1?this.__character_count=o.length-h:this.__character_count+=o.length},m.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function d(o,h){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),h=h||"",o.indent_level>0&&(h=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}d.prototype.get_indent_size=function(o,h){var r=this.__base_string_length;return h=h||0,o<0&&(r=0),r+=o*this.__indent_size,r+=h,r},d.prototype.get_indent_string=function(o,h){var r=this.__base_string;return h=h||0,o<0&&(o=0,r=""),h+=o*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},d.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var o=this.__cache.length,h=0,r="";this.__indent_size&&o>=this.__indent_size&&(h=Math.floor(o/this.__indent_size),o-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function u(o,h){this.__indent_cache=new d(o,h),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(o,h){return this.__indent_cache.get_indent_string(o,h)},u.prototype.get_indent_size=function(o,h){return this.__indent_cache.get_indent_size(o,h)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(o){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(` `);return o!==` `&&(r=r.replace(/[\n]/g,o)),r},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(o,h){return o=o||0,h=h||0,this.next_line.set_indent(o,h),this.__lines.length>1?(this.current_line.set_indent(o,h),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(o){for(var h=0;h1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(o,h){for(var r=this.__lines.length-2;r>=0;){var a=this.__lines[r];if(a.is_empty())break;if(a.item(0).indexOf(o)!==0&&a.item(-1)!==h){this.__lines.splice(r+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},p.exports.Output=u},function(p){function m(d,u,o,h){this.type=d,this.text=u,this.comments_before=null,this.newlines=o||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=m},,,function(p){function m(o,h){this.raw_options=d(o,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(o,h){var r=this.raw_options[o],a=h||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(a=r.concat()):typeof r=="string"&&(a=r.split(/[^a-zA-Z0-9_\/\-]+/)),a},m.prototype._get_boolean=function(o,h){var r=this.raw_options[o],a=r===void 0?!!h:!!r;return a},m.prototype._get_characters=function(o,h){var r=this.raw_options[o],a=h||"";return typeof r=="string"&&(a=r.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),a},m.prototype._get_number=function(o,h){var r=this.raw_options[o];h=parseInt(h,10),isNaN(h)&&(h=0);var a=parseInt(r,10);return isNaN(a)&&(a=h),a},m.prototype._get_selection=function(o,h,r){var a=this._get_selection_list(o,h,r);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[o]+"'");return a[0]},m.prototype._get_selection_list=function(o,h,r){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[h[0]],!this._is_valid_selection(r,h))throw new Error("Invalid Default Value!");var a=this._get_array(o,r);if(!this._is_valid_selection(a,h))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[o]+"'");return a},m.prototype._is_valid_selection=function(o,h){return o.length&&h.length&&!o.some(function(r){return h.indexOf(r)===-1})};function d(o,h){var r={};o=u(o);var a;for(a in o)a!==h&&(r[a]=o[a]);if(h&&o[h])for(a in o[h])r[a]=o[h][a];return r}function u(o){var h={},r;for(r in o){var a=r.replace(/-/g,"_");h[a]=o[r]}return h}p.exports.Options=m,p.exports.normalizeOpts=u,p.exports.mergeOpts=d},,function(p){var m=RegExp.prototype.hasOwnProperty("sticky");function d(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}d.prototype.restart=function(){this.__position=0},d.prototype.back=function(){this.__position>0&&(this.__position-=1)},d.prototype.hasNext=function(){return this.__position=0&&u=0&&o=u.length&&this.__input.substring(o-u.length,o).toLowerCase()===u},p.exports.InputScanner=d},function(p,m,d){var u=d(8).InputScanner,o=d(3).Token,h=d(10).TokenStream,r=d(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(s,S){this._input=new u(s),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var s,S=new o(a.START,""),x=null,T=[],R=new h;S.type!==a.EOF;){for(s=this._get_next_token(S,x);this._is_comment(s);)R.add(s),s=this._get_next_token(S,x);R.isEmpty()||(s.comments_before=R,R=new h),s.parent=x,this._is_opening(s)?(T.push(x),x=s):x&&this._is_closing(s,x)&&(s.opened=x,x.closed=s,x=T.pop(),s.parent=x),s.previous=S,S.next=s,this.__tokens.add(s),S=s}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(s,S){this._readWhitespace();var x=this._input.read(/.+/g);return x?this._create_token(a.RAW,x):this._create_token(a.EOF,"")},i.prototype._is_comment=function(s){return!1},i.prototype._is_opening=function(s){return!1},i.prototype._is_closing=function(s,S){return!1},i.prototype._create_token=function(s,S){var x=new o(s,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return x},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=i,p.exports.TOKEN=a},function(p){function m(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position=0&&d/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new u,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(r){var a=this._create();return a._disabled[r]=!0,a._update(),a},h.prototype.read_options=function(r){var a=this._create();for(var i in o)a._disabled[i]=r.templating.indexOf(i)===-1;return a._update(),a},h.prototype.exclude=function(r){var a=this._create();return a._excluded[r]=!0,a._update(),a},h.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),r+=a,a=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},h.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},h.prototype._read_template=function(){var r="",a=this._input.peek();if(a==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(r=r||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},p.exports.TemplatablePattern=h},,,,function(p,m,d){var u=d(19).Beautifier,o=d(20).Options;function h(r,a,i,s){var S=new u(r,a,i,s);return S.beautify()}p.exports=h,p.exports.defaultOptions=function(){return new o}},function(p,m,d){var u=d(20).Options,o=d(2).Output,h=d(21).Tokenizer,r=d(21).TOKEN,a=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,s=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new o(C,E)};s.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},s.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},s.prototype.print_preserved_newlines=function(C){var E=0;C.type!==r.TEXT&&C.previous.type!==r.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines0);return E!==0},s.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(C){this._output.add_new_line(C)},s.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var S=function(C){for(var E=null,y=C.next;y.type!==r.EOF&&C.closed!==y;){if(y.type===r.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===r.EQUALS&&y.next.next&&y.next.next.type===r.VALUE&&(E=y.next.next.text);break}y=y.next}return E},x=function(C,E){var y=null,U=null;return E.closed?(C==="script"?y="text/javascript":C==="style"&&(y="text/css"),y=S(E)||y,y.search("text/css")>-1?U="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":y.search(/test\/null/)>-1&&(U="null"),U):null};function T(C,E){return E.indexOf(C)!==-1}function R(C,E,y){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=y||0,this.parser_token=E||null}function w(C){this._printer=C,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(C){var E=new R(this._current_frame,C,this._printer.indent_level);this._current_frame=E},w.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},w.prototype._get_frame=function(C,E){for(var y=this._current_frame;y&&!(C.indexOf(y.tag)!==-1);){if(E&&E.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},w.prototype.try_pop=function(C,E){var y=this._get_frame([C],E);return this._try_pop_frame(y)},w.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function v(C,E,y,U){this._source_text=C||"",E=E||{},this._js_beautify=y,this._css_beautify=U,this._tag_stack=null;var j=new u(E,"html");this._options=j,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=` `,C&&a.test(C)&&(E=C.match(a)[0])),C=C.replace(i,` `);var y=C.match(/^[\t ]*/)[0],U={text:"",type:""},j=new b,A=new s(this._options,y),G=new h(C,this._options).tokenize();this._tag_stack=new w(A);for(var W=null,O=G.next();O.type!==r.EOF;)O.type===r.TAG_OPEN||O.type===r.COMMENT?(W=this._handle_tag_open(A,O,j,U),j=W):O.type===r.ATTRIBUTE||O.type===r.EQUALS||O.type===r.VALUE||O.type===r.TEXT&&!j.tag_complete?W=this._handle_inside_tag(A,O,j,G):O.type===r.TAG_CLOSE?W=this._handle_tag_close(A,O,j):O.type===r.TEXT?W=this._handle_text(A,O,j):A.add_raw_token(O),U=W,O=G.next();var V=A._output.get_code(E);return V},v.prototype._handle_tag_close=function(C,E,y){var U={text:E.text,type:E.type};return C.alignment_size=0,y.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),y.is_unformatted?C.add_raw_token(E):(y.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(C.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&C.set_wrap_point(),U},v.prototype._handle_inside_tag=function(C,E,y,U){var j=y.has_wrapped_attrs,A={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),y.is_unformatted)C.add_raw_token(E);else if(y.tag_start_char==="{"&&E.type===r.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===r.ATTRIBUTE?(C.set_space_before_token(!0),y.attr_count+=1):(E.type===r.EQUALS||E.type===r.VALUE&&E.previous.type===r.EQUALS)&&C.set_space_before_token(!1),E.type===r.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),j=j||E.newlines!==0),this._is_wrap_attributes_force)){var G=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var W=!0,O=0,V;do{if(V=U.peek(O),V.type===r.ATTRIBUTE){W=!1;break}O+=1}while(O<4&&V.type!==r.EOF&&V.type!==r.TAG_CLOSE);G=!W}G&&(C.print_newline(!1),j=!0)}C.print_token(E),j=j||C.previous_token_wrapped(),y.has_wrapped_attrs=j}return A},v.prototype._handle_text=function(C,E,y){var U={text:E.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(C,E,y):y.is_unformatted||y.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),U},v.prototype._print_custom_beatifier_text=function(C,E,y){var U=this;if(E.text!==""){var j=E.text,A,G=1,W="",O="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:y.custom_beautifier_name==="html"&&(A=function(Oe,Ce){var Pe=new v(Oe,Ce,U._js_beautify,U._css_beautify);return Pe.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-C.indent_level);var V=C.get_full_indent(G);if(j=j.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(|]]>)$/.exec(j);if(!te){C.add_raw_token(E);return}W=V+te[1]+` `,j=te[4],te[5]&&(O=V+te[5]),j=j.replace(/\n[ \t]*$/,""),(te[2]||te[3].indexOf(` `)!==-1)&&(te=te[3].match(/[ \t]+$/),te&&(E.whitespace_before=te[0]))}if(j)if(A){var ae=function(){this.eol=` `};ae.prototype=this._options.raw_options;var me=new ae;j=A(V+j,me)}else{var Re=E.whitespace_before;Re&&(j=j.replace(new RegExp(` (`+Re+")?","g"),` `)),j=V+j.replace(/\n/g,` `+V)}W&&(j?j=W+j+` `+O:j=W+O),C.print_newline(!1),j&&(E.text=j,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},v.prototype._handle_tag_open=function(C,E,y,U){var j=this._get_tag_open_token(E);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&E.type===r.TAG_OPEN&&E.text.indexOf("]*)/),this.tag_check=y?y[1]:""):(y=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.closed.text==="/>";var U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};v.prototype._get_tag_open_token=function(C){var E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||T(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&T(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&T(E.tag_check,this._options.content_unformatted),E.is_inline_element=T(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},v.prototype._set_tag_position=function(C,E,y,U,j){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=x(y.tag_check,E)))),T(y.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var A=C.current_line_has_match(/{{#if/);A||C.print_newline(!1)}y.tag_name==="!--"&&j.type===r.TAG_CLOSE&&U.is_end_tag&&y.text.indexOf(` `)===-1||(y.is_inline_element||y.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,y))}else if(y.is_end_tag){var G=!1;G=y.start_tag_token&&y.start_tag_token.multiline_content,G=G||!y.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(j.type===r.TAG_CLOSE&&y.start_tag_token===U)&&j.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(G=!1),G&&C.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(j.type!=="TK_CONTENT"||y.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,y)},v.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var g=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&g.indexOf(C.tag_name)!==-1){var y=C.parent.parent;(!y||f.indexOf(y.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},p.exports.Beautifier=v},function(p,m,d){var u=d(6).Options;function o(h){u.call(this,h,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new u,p.exports.Options=o},function(p,m,d){var u=d(9).Tokenizer,o=d(9).TOKEN,h=d(13).Directives,r=d(14).TemplatablePattern,a=d(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},s=new h(/<\!--/,/-->/),S=function(x,T){u.call(this,x,T),this._current_tag_name="";var R=new r(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(//),cdata:w.starting_with(//),conditional_comment:w.starting_with(//),processing:w.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(v).until_after(v)}};S.prototype=new u,S.prototype._is_comment=function(x){return!1},S.prototype._is_opening=function(x){return x.type===i.TAG_OPEN},S.prototype._is_closing=function(x,T){return x.type===i.TAG_CLOSE&&T&&((x.text===">"||x.text==="/>")&&T.text[0]==="<"||x.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(x,T){var R=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(w,T),R=R||this._read_attribute(w,x,T),R=R||this._read_close(w,T),R=R||this._read_raw_content(w,x,T),R=R||this._read_content_word(w),R=R||this._read_comment_or_cdata(w),R=R||this._read_processing(w),R=R||this._read_open(w,T),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},S.prototype._read_comment_or_cdata=function(x){var T=null,R=null,w=null;if(x==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(w=s.get_directives(R),w&&w.ignore==="start"&&(R+=s.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(T=this._create_token(i.COMMENT,R),T.directives=w)}return T},S.prototype._read_processing=function(x){var T=null,R=null,w=null;if(x==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(T=this._create_token(i.COMMENT,R),T.directives=w)}return T},S.prototype._read_open=function(x,T){var R=null,w=null;return T||x==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),w=this._create_token(i.TAG_OPEN,R)),w},S.prototype._read_open_handlebars=function(x,T){var R=null,w=null;return T||this._options.indent_handlebars&&x==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),w=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),w=this._create_token(i.TAG_OPEN,R))),w},S.prototype._read_close=function(x,T){var R=null,w=null;return T&&(T.text[0]==="<"&&(x===">"||x==="/"&&this._input.peek(1)===">")?(R=this._input.next(),x==="/"&&(R+=this._input.next()),w=this._create_token(i.TAG_CLOSE,R)):T.text[0]==="{"&&x==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(i.TAG_CLOSE,"}}"))),w},S.prototype._read_attribute=function(x,T,R){var w=null,v="";if(R&&R.text[0]==="<")if(x==="=")w=this._create_token(i.EQUALS,this._input.next());else if(x==='"'||x==="'"){var b=this._input.next();x==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),w=this._create_token(i.VALUE,b)}else v=this.__patterns.attribute.read(),v&&(T.type===i.EQUALS?w=this._create_token(i.VALUE,v):w=this._create_token(i.ATTRIBUTE,v));return w},S.prototype._is_content_unformatted=function(x){return this._options.void_elements.indexOf(x)===-1&&(this._options.content_unformatted.indexOf(x)!==-1||this._options.unformatted.indexOf(x)!==-1)},S.prototype._read_raw_content=function(x,T,R){var w="";if(R&&R.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(T.type===i.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var v=T.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var b=this._read_comment_or_cdata(x);if(b)return b.type=i.TEXT,b;w=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(v)&&(w=this._input.readUntil(new RegExp("","ig")))}return w?this._create_token(i.TEXT,w):null},S.prototype._read_content_word=function(x){var T="";if(this._options.unformatted_content_delimiter&&(x===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(i.TEXT,T)},p.exports.Tokenizer=S,p.exports.TOKEN=i}],N={};function n(p){var m=N[p];if(m!==void 0)return m.exports;var d=N[p]={exports:{}};return H[p](d,d.exports,n),d.exports}var P=n(18);M=P})();var X=M;if(!0)!(Z=[D,D("6UM0"),D("TXwP")],z=function(H){var N=D("6UM0"),n=D("TXwP");return{html_beautify:function(P,p){return X(P,p,N.js_beautify,n.css_beautify)}}}.apply(ce,Z),z!==void 0&&(je.exports=z));else var F,I})()},rHrb:function(je,ce,D){"use strict";Object.defineProperty(ce,"__esModule",{value:!0}),ce.CopyToClipboard=void 0;var Z=M(D("q1tI")),z=M(D("+QRC"));function M(i){return i&&i.__esModule?i:{default:i}}function X(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?X=function(S){return typeof S}:X=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},X(i)}function F(i,s){var S=Object.keys(i);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(i);s&&(x=x.filter(function(T){return Object.getOwnPropertyDescriptor(i,T).enumerable})),S.push.apply(S,x)}return S}function I(i){for(var s=1;s=0)continue;if(!Object.prototype.propertyIsEnumerable.call(i,x))continue;S[x]=i[x]}}return S}function N(i,s){if(i==null)return{};var S={},x=Object.keys(i),T,R;for(R=0;R=0)continue;S[T]=i[T]}return S}function n(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function P(i,s){for(var S=0;S"']/,Z=/[&<>"']/g,z=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},F=w=>X[w];function I(w,v){if(v){if(D.test(w))return w.replace(Z,F)}else if(z.test(w))return w.replace(M,F);return w}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(w){return w.replace(H,(v,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const n=/(^|[^\[])\^/g;function P(w,v){w=w.source||w,v=v||"";const b={replace:(g,f)=>(f=f.source||f,f=f.replace(n,"$1"),w=w.replace(g,f),b),getRegex:()=>new RegExp(w,v)};return b}const p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(w,v,b){if(w){let g;try{g=decodeURIComponent(N(b)).replace(p,"").toLowerCase()}catch(f){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}v&&!m.test(b)&&(b=a(v,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(g){return null}return b}const u={},o=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,v){u[" "+w]||(o.test(w)?u[" "+w]=w+"/":u[" "+w]=x(w,"/",!0)),w=u[" "+w];const b=w.indexOf(":")===-1;return v.substring(0,2)==="//"?b?v:w.replace(h,"$1")+v:v.charAt(0)==="/"?b?v:w.replace(r,"$1")+v:w+v}const i={exec:function(){}};function s(w){let v=1,b,g;for(;v{let U=!1,j=E;for(;--j>=0&&y[j]==="\\";)U=!U;return U?"|":" |"}),g=b.split(/ \|/);let f=0;if(g.length>v)g.splice(v);else for(;g.length=0;P--){var p=M().key(P);n(X(p),p)}}function H(n){return M().removeItem(n)}function N(){return M().clear()}},"s8/Y":function(je,ce,D){je.exports=D.p+"static/jx.6713fc81.svg"},"sB/4":function(je,ce,D){je.exports=D.p+"static/b.7405990c.svg"},sNtx:function(je,ce,D){},sR1s:function(je,ce,D){"use strict";D.d(ce,"b",function(){return X}),D.d(ce,"a",function(){return F}),D.d(ce,"c",function(){return I}),D.d(ce,"d",function(){return H});var Z=D("U8pU"),z="RC_TABLE_KEY";function M(N){return N==null?[]:Array.isArray(N)?N:[N]}function X(N,n){if(!n&&typeof n!="number")return N;for(var P=M(n),p=N,m=0;m1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=s[0];if(I.isValidElement(S)&&Object(p.c)(S)){var x=S.ref;s[0]=I.cloneElement(S,{ref:Object(p.a)(x,this.setChildNode)})}return s.length===1?s[0]:s.map(function(T,R){return!I.isValidElement(T)||"key"in T&&T.key!==null?T:I.cloneElement(T,{key:"".concat(d,"-").concat(R)})})}}]),r}(I.Component);u.displayName="ResizeObserver",ce.a=u},t9D7:function(je,ce,D){"use strict";D.d(ce,"b",function(){return H}),D.d(ce,"g",function(){return n}),D.d(ce,"d",function(){return P}),D.d(ce,"e",function(){return p}),D.d(ce,"a",function(){return m}),D.d(ce,"f",function(){return o}),D.d(ce,"c",function(){return h});var Z=D("Vhoy"),z=D("MI8n"),M=D("pmY6"),X=D("Cg/j"),F=D("ic2d"),I=D("nEHx");const H=Object(X.c)("themeService");var N;(function(r){function a(i){return i&&typeof i=="object"&&typeof i.id=="string"}r.isThemeColor=a})(N||(N={}));function n(r){return{id:r}}var P;(function(r){function a(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||N.isThemeColor(R.color))}r.isThemeIcon=a;const i=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function s(R){const w=i.exec(R);if(!w)return;let[,v]=w;return{id:v}}r.fromString=s;function S(R,w){let v=R.id;const b=v.lastIndexOf("~");return b!==-1&&(v=v.substring(0,b)),w&&(v=`${v}~${w}`),{id:v}}r.modify=S;function x(R,w){var v,b;return R.id===w.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((b=w.color)===null||b===void 0?void 0:b.id)}r.isEqual=x;function T(R,w){return{id:R.id,color:w?n(w):void 0}}r.asThemeIcon=T,r.asClassNameArray=Z.a.asClassNameArray,r.asClassName=Z.a.asClassName,r.asCSSSelector=Z.a.asCSSSelector})(P||(P={}));function p(r){switch(r){case I.a.DARK:return"vs-dark";case I.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const m={ThemingContribution:"base.contributions.theming"};class d{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new z.b}onColorThemeChange(r){return this.themingParticipants.push(r),this.onThemingParticipantAddedEmitter.fire(r),Object(M.i)(()=>{const a=this.themingParticipants.indexOf(r);this.themingParticipants.splice(a,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new d;F.a.add(m.ThemingContribution,u);function o(r){return u.onColorThemeChange(r)}class h extends M.a{constructor(r){super();this.themeService=r,this.theme=r.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(a=>this.onThemeChange(a)))}onThemeChange(r){this.theme=r,this.updateStyles()}updateStyles(){}}},twBr:function(je,ce,D){je.exports=D.p+"static/s.1f286590.svg"},uMZB:function(je,ce,D){je.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(je,ce,D){je.exports=Z;function Z(){return D("gaXo"),{}}},ulZh:function(je,ce,D){typeof window!="undefined"&&function(z,M){je.exports=M()}(this,function(){return function(Z){var z={};function M(X){if(z[X])return z[X].exports;var F=z[X]={i:X,l:!1,exports:{}};return Z[X].call(F.exports,F,F.exports,M),F.l=!0,F.exports}return M.m=Z,M.c=z,M.d=function(X,F,I){M.o(X,F)||Object.defineProperty(X,F,{enumerable:!0,get:I})},M.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},M.t=function(X,F){if(F&1&&(X=M(X)),F&8)return X;if(F&4&&typeof X=="object"&&X&&X.__esModule)return X;var I=Object.create(null);if(M.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:X}),F&2&&typeof X!="string")for(var H in X)M.d(I,H,function(N){return X[N]}.bind(null,H));return I},M.n=function(X){var F=X&&X.__esModule?function(){return X.default}:function(){return X};return M.d(F,"a",F),F},M.o=function(X,F){return Object.prototype.hasOwnProperty.call(X,F)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,z,M){"use strict";var X=Object.prototype.hasOwnProperty,F="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(F=!1));function H(p,m,d){this.fn=p,this.context=m,this.once=d||!1}function N(p,m,d,u,o){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new H(d,u||p,o),r=F?F+m:m;return p._events[r]?p._events[r].fn?p._events[r]=[p._events[r],h]:p._events[r].push(h):(p._events[r]=h,p._eventsCount++),p}function n(p,m){--p._eventsCount===0?p._events=new I:delete p._events[m]}function P(){this._events=new I,this._eventsCount=0}P.prototype.eventNames=function(){var m=[],d,u;if(this._eventsCount===0)return m;for(u in d=this._events)X.call(d,u)&&m.push(F?u.slice(1):u);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(d)):m},P.prototype.listeners=function(m){var d=F?F+m:m,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var o=0,h=u.length,r=new Array(h);o0},!1)}function p(m,d){for(var u={main:[d]},o={main:[]},h={main:{}};P(u);)for(var r=Object.keys(u),a=0;a=2*R/v||y<=j)return;var A=Number.POSITIVE_INFINITY,G;for(G=r.level-1;G>g;G--){var W=b[G].maxBitrate;if(A=R*W/(8*.8*E),A=y)return;var O=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+r.sn+(a?" part "+a.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+` Current BW estimate: `+(Object(X.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+y.toFixed(3)+` s Estimated load time for the next fragment: `+A.toFixed(3)+` s Time to underbuffer: `+j.toFixed(3)+" s"),i.nextLoadLevel=G,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),i.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:a,stats:T})},o.onFragLoaded=function(r,a){var i=a.frag,s=a.part;if(i.type===n.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(i.sn)){var S=s?s.stats:i.stats,x=s?s.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[i.level],R=(T.loaded?T.loaded.bytes:0)+S.loaded,w=(T.loaded?T.loaded.duration:0)+x;T.loaded={bytes:R,duration:w},T.realBitrate=Math.round(8*R/w)}if(i.bitrateTest){var v={stats:S,frag:i,part:s,id:i.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},o.onFragBuffered=function(r,a){var i=a.frag,s=a.part,S=s?s.stats:i.stats;if(S.aborted)return;if(i.type!==n.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var x=S.parsing.end-S.loading.start;this.bwEstimator.sample(x,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=x/1e3:this.bitrateTestDelay=0},o.onError=function(r,a){switch(a.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var r=this.fragCurrent,a=this.partCurrent,i=this.hls,s=i.maxAutoLevel,S=i.config,x=i.minAutoLevel,T=i.media,R=a?a.duration:r?r.duration:0,w=T?T.currentTime:0,v=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,g=(H.BufferHelper.bufferInfo(T,w,S.maxBufferHole).end-w)/v,f=this.findBestLevel(b,x,s,g,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(f>=0)return f;P.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=R?Math.min(R,S.maxStarvationDelay):S.maxStarvationDelay,E=S.abrBandWidthFactor,y=S.abrBandWidthUpFactor;if(!g){var U=this.bitrateTestDelay;if(U){var j=R?Math.min(R,S.maxLoadingDelay):S.maxLoadingDelay;C=j-U,P.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=y=1}}return f=this.findBestLevel(b,x,s,g+C,E,y),Math.max(f,0)},o.findBestLevel=function(r,a,i,s,S,x){for(var T,R=this.fragCurrent,w=this.partCurrent,v=this.lastLoadedFragLevel,b=this.hls.levels,g=b[v],f=!!(g!=null&&(T=g.details)!==null&&T!==void 0&&T.live),C=g==null?void 0:g.codecSet,E=w?w.duration:R?R.duration:0,y=i;y>=a;y--){var U=b[y];if(!U||C&&U.codecSet!==C)continue;var j=U.details,A=(w?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||E,G=void 0;y<=v?G=S*r:G=x*r;var W=b[y].maxBitrate,O=W*A/G;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(G)+"/"+W+"/"+A+"/"+s+"/"+O),G>W&&(!O||f&&!this.bitrateTestDelay||O0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},v.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var g,f=this.levels,C=this.trackId,E=f==null||((g=f[C])===null||g===void 0)?void 0:g.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var y,U=performance.now(),j=this.retryDate;(!j||U>=j||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var G=A.frag,W=A.part,O=A.cache,V=A.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.FRAG_LOADING;var te=O.flush(),ae={frag:G,part:W,payload:te,networkDetails:null};this._handleFragmentLoadProgress(ae),V&&R.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var me=this.getLoadPosition(),Re=H.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),Oe=Object(o.fragmentWithinToleranceTest)(Re.end,this.config.maxFragLookUpTolerance,G);Oe<0&&(a.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Re.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.IDLE)},v.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:g,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},v.doTickIdle=function(){var g,f,C=this.hls,E=this.levels,y=this.media,U=this.trackId,j=C.config;if(!E||!E[U])return;if(!y&&(this.startFragRequested||!j.startFragPrefetch))return;var A=E[U],G=A.details;if(!G||G.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(G)){this.state=F.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(W===null)return;var O=W.len,V=this.getMaxBufferLength(),te=this.audioSwitch;if(O>=V&&!te)return;if(!te&&this._streamEnded(W,G)){C.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=F.State.ENDED;return}var ae=G.fragments,me=ae[0].start,Re=W.end;if(te){var Oe=this.getLoadPosition();Re=Oe,G.PTSKnown&&Oeme||W.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=me+.05))}var Ce=this.getNextFragment(Re,G);if(!Ce){this.bufferFlushed=!0;return}((g=Ce.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((f=Ce.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Ce,G):this.loadFragment(Ce,G,Re)},v.getMaxBufferLength=function(){var g=R.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return f===null?g:Math.max(g,f.len)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(g,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},v.onAudioTrackSwitching=function(g,f){var C=!!f.url;this.trackId=f.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(x):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(g,f){this.mainDetails=f.details},v.onAudioTrackLoaded=function(g,f){var C,E=this.levels,y=f.details,U=f.id;if(!E){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var j=E[U],A=0;if(y.live||(C=j.details)!==null&&C!==void 0&&C.live){var G=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!G)return;!j.details&&y.hasProgramDateTime&&G.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(y,G),A=y.fragments[0].start):A=this.alignPlaylists(y,j.details)}j.details=y,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(j.details,A),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=F.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(g){var f,C=g.frag,E=g.part,y=g.payload,U=this.config,j=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var G=A[j];console.assert(G,"Audio track is defined on fragment load progress");var W=G.details;console.assert(W,"Audio track details are defined on fragment load progress");var O=U.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new d.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var te=this.initPTS[C.cc],ae=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(te!==void 0){var me=!1,Re=E?E.index:-1,Oe=Re!==-1,Ce=new u.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,y.byteLength,Re,Oe);V.push(y,ae,O,"",C,E,W.totalduration,me,Ce,te)}else{a.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+W.startSN+" ,"+W.endSN+"],track "+j);var Pe=this.waitingData=this.waitingData||{frag:C,part:E,cache:new m.default,complete:!1},He=Pe.cache;He.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=F.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,g)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(g,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},v.onFragBuffered=function(g,f){var C=f.frag,E=f.part;if(C.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},v.onError=function(g,f){switch(f.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.AUDIO,f);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=f.fatal?F.State.ERROR:F.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(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}},v.onBufferFlushed=function(g,f){var C=f.type;C===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(g){var f,C="audio",E=this.hls,y=g.remuxResult,U=g.chunkMeta,j=this.getCurrentContext(U);if(!j){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var A=j.frag,G=j.part,W=y.audio,O=y.text,V=y.id3,te=y.initSegment;if(this.fragContextChanged(A))return;if(this.state=F.State.PARSING,this.audioSwitch&&W&&this.completeAudioSwitch(),te!=null&&te.tracks&&(this._bufferInitSegment(te.tracks,A,U),E.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:C,tracks:te.tracks})),W){var ae=W.startPTS,me=W.endPTS,Re=W.startDTS,Oe=W.endDTS;G&&(G.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:me,startDTS:Re,endDTS:Oe}),A.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ae,me,Re,Oe),this.bufferFragmentData(W,A,G,U)}if(V!=null&&(f=V.samples)!==null&&f!==void 0&&f.length){var Ce=i({frag:A,id:C},V);E.trigger(I.Events.FRAG_PARSING_METADATA,Ce)}if(O){var Pe=i({frag:A,id:C},O);E.trigger(I.Events.FRAG_PARSING_USERDATA,Pe)}},v._bufferInitSegment=function(g,f,C){if(this.state!==F.State.PARSING)return;g.video&&delete g.video;var E=g.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(I.Events.BUFFER_CODECS,g);var y=E.initSegment;if(y!=null&&y.byteLength){var U={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:y};this.hls.trigger(I.Events.BUFFER_APPENDING,U)}this.tick()},v.loadFragment=function(g,f,C){var E=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||E===N.FragmentState.NOT_LOADED||E===N.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):f.live&&!Object(X.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,g,f,C)))},v.completeAudioSwitch=function(){var g=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:C})},w}(F.default);z.default=T},"./src/controller/audio-track-controller.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function N(d,u){for(var o=0;o=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=a[this.trackId];this.log("Now switching to audio-track index "+r);var s=a[r],S=s.id,x=s.groupId,T=x===void 0?"":x,R=s.name,w=s.type,v=s.url;if(this.trackId=r,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:R,type:w,url:v}),s.details&&!s.details.live)return;var b=this.switchParams(s.url,i==null?void 0:i.details);this.loadPlaylist(b)},o.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,i=this.findTrackId(a)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(r){for(var a=this.tracksInGroup,i=0;iu.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(i))return new F.HlsUrlParameters(i,Object(X.isFiniteNumber)(s)?s:void 0,F.HlsSkip.No)}}},p.loadPlaylist=function(d){},p.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},p.playlistLoaded=function(d,u,o){var h=this,r=u.details,a=u.stats,i=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(r.advancedDateTime=Date.now()-i,r.live||o!=null&&o.live){if(r.reloaded(o),o&&this.log("live playlist "+d+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),o&&r.fragments.length>0&&Object(I.mergeDetails)(o,r),!this.canLoad||!r.live)return;var s,S=void 0,x=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var T=this.hls.config.lowLatencyMode,R=r.lastPartSn,w=r.endSN,v=r.lastPartIndex,b=v!==-1,g=R===w,f=T?0:v;b?(S=g?w+1:R,x=g?f:v+1):S=w+1;var C=r.age,E=C+r.ageHeader,y=Math.min(E-r.partTarget,r.targetduration*1.5);if(y>0){if(o&&y>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+y+" with playlist age: "+r.age),y=0;else{var U=Math.floor(y/r.targetduration);if(S+=U,x!==void 0){var j=Math.round(y%r.targetduration/r.partTarget);x+=j}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+y+" skip sn "+U+" to part "+x)}r.tuneInGoal=y}if(s=this.getDeliveryDirectives(r,u.deliveryDirectives,S,x),T||!g){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(r,u.deliveryDirectives,S,x);var A=Object(I.computeReloadInterval)(r,a);S!==void 0&&r.canBlockReload&&(A-=r.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(s)},A)}else this.clearTimer()},p.getDeliveryDirectives=function(d,u,o,h){var r=Object(F.getSkipValue)(d,o);return u!=null&&u.skip&&d.deltaUpdateFailed&&(o=u.msn,h=u.part,r=F.HlsSkip.No),new F.HlsUrlParameters(o,h,r)},p.retryLoadingOrFail=function(d){var u=this,o=this.hls.config,h=this.retryCount-1&&(r=d.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return h},P}()},"./src/controller/base-stream-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"State",function(){return w}),M.d(z,"default",function(){return v});var X=M("./src/polyfills/number.ts"),F=M("./src/task-loop.ts"),I=M("./src/controller/fragment-tracker.ts"),H=M("./src/utils/buffer-helper.ts"),N=M("./src/utils/logger.ts"),n=M("./src/events.ts"),P=M("./src/errors.ts"),p=M("./src/types/transmuxer.ts"),m=M("./src/utils/mp4-tools.ts"),d=M("./src/utils/discontinuities.ts"),u=M("./src/controller/fragment-finders.ts"),o=M("./src/controller/level-helper.ts"),h=M("./src/loader/fragment-loader.ts"),r=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),i=M("./src/types/loader.ts");function s(b,g){for(var f=0;fte;(G0&&G&&G.key&&G.iv&&G.method==="AES-128"){var W=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(A),G.key.buffer,G.iv.buffer).then(function(O){var V=self.performance.now();return j.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:O,stats:{tstart:W,tdecrypt:V}}),U.payload=O,U})}return U}).then(function(U){var j=y.fragCurrent,A=y.hls,G=y.levels;if(!G)throw new Error("init load aborted, missing levels");var W=G[E.level].details;console.assert(W,"Level details are defined when init segment is loaded");var O=E.stats;y.state=w.IDLE,y.fragLoadError=0,E.data=new Uint8Array(U.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),U.frag===j&&A.trigger(n.Events.FRAG_BUFFERED,{stats:O,frag:j,part:null,id:E.type}),y.tick()}).catch(function(U){y.warn(U),y.resetFragmentLoading(E)})},f.fragContextChanged=function(E){var y=this.fragCurrent;return!E||!y||E.level!==y.level||E.sn!==y.sn||E.urlId!==y.urlId},f.fragBufferedComplete=function(E,y){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+a.default.toString(H.BufferHelper.getBuffered(U))),this.state=w.IDLE,this.tick()},f._handleFragmentLoadComplete=function(E){var y=this.transmuxer;if(!y)return;var U=E.frag,j=E.part,A=E.partsLoaded,G=!A||A.length===0||A.some(function(O){return!O}),W=new p.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,j?j.index:-1,!G);y.flush(W)},f._handleFragmentLoadProgress=function(E){},f._doFragLoad=function(E,y,U,j){var A=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(E.start,U||0),this.config.lowLatencyMode&&y){var G=y.partList;if(G&&j){U>E.end&&y.fragmentHint&&(E=y.fragmentHint);var W=this.getNextPart(G,E,U);if(W>-1){var O=G[W];return this.log("Loading part sn: "+E.sn+" p: "+O.index+" cc: "+E.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+W+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:G[W],targetBufferTime:U}),this.doFragPartsLoad(E,G,W,j).catch(function(V){return A.handleFragLoadError(V)})}else if(!E.url||this.loadedEndOfParts(G,U))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(U.toFixed(3))),Object(X.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=w.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:U}),this.fragmentLoader.load(E,j).catch(function(V){return A.handleFragLoadError(V)})},f.doFragPartsLoad=function(E,y,U,j){var A=this;return new Promise(function(G,W){var O=[],V=function te(ae){var me=y[ae];A.fragmentLoader.loadPart(E,me,j).then(function(Re){O[me.index]=Re;var Oe=Re.part;A.hls.trigger(n.Events.FRAG_LOADED,Re);var Ce=y[ae+1];if(Ce&&Ce.fragment===E)te(ae+1);else return G({frag:E,part:Oe,partsLoaded:O})}).catch(W)};V(U)})},f.handleFragLoadError=function(E){var y=E.data;return y&&y.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(n.Events.ERROR,y),null},f._handleTransmuxerFlush=function(E){var y=this.getCurrentContext(E);if(!y||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var U=y.frag,j=y.part,A=y.level,G=self.performance.now();U.stats.parsing.end=G,j&&(j.stats.parsing.end=G),this.updateLevelTiming(U,j,A,E.partial)},f.getCurrentContext=function(E){var y=this.levels,U=E.level,j=E.sn,A=E.part;if(!y||!y[U])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+U+". The current chunk will not be buffered."),null;var G=y[U],W=A>-1?Object(o.getPartWith)(G,j,A):null,O=W?W.fragment:Object(o.getFragmentWithSN)(G,j,this.fragCurrent);return O?{frag:O,part:W,level:G}:null},f.bufferFragmentData=function(E,y,U,j){if(!E||this.state!==w.PARSING)return;var A=E.data1,G=E.data2,W=A;if(A&&G&&(W=Object(m.appendUint8Array)(A,G)),!W||!W.length)return;var O={type:E.type,frag:y,part:U,chunkMeta:j,parent:y.type,data:W};this.hls.trigger(n.Events.BUFFER_APPENDING,O),E.dropped&&E.independent&&!U&&this.flushBufferGap(y)},f.flushBufferGap=function(E){var y=this.media;if(!y)return;if(!H.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,E.start);return}var U=y.currentTime,j=H.BufferHelper.bufferInfo(y,U,0),A=E.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),W=Math.max(Math.min(E.start-G,j.end-G),U+G);E.start-W>G&&this.flushMainBuffer(W,E.start)},f.getFwdBufferInfo=function(E,y){var U=this.config,j=this.getLoadPosition();if(!Object(X.isFiniteNumber)(j))return null;var A=H.BufferHelper.bufferInfo(E,j,U.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(j,y);if(G&&A.nextStart=U?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(E,y){var U,j,A=y.fragments,G=A.length;if(!G)return null;var W=this.config,O=A[0].start,V;if(y.live){var te=W.initialLiveManifestSize;if(G-1&&UU.start&&U.loaded},f.getInitialLiveFragment=function(E,y){var U=this.fragPrevious,j=null;if(U){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),j=Object(u.findFragmentByPDT)(y,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var A=U.sn+1;if(A>=E.startSN&&A<=E.endSN){var G=y[A-E.startSN];U.cc===G.cc&&(j=G,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(u.findFragWithCC)(y,U.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(j=this.getFragmentAtPosition(W,this.bitrateTest?E.fragmentEnd:E.edge,E))}return j},f.getFragmentAtPosition=function(E,y,U){var j=this.config,A=this.fragPrevious,G=U.fragments,W=U.endSN,O=U.fragmentHint,V=j.maxFragLookUpTolerance,te=!!(j.lowLatencyMode&&U.partList&&O);te&&O&&!this.bitrateTest&&(G=G.concat(O),W=O.sn);var ae;if(Ey-V?0:V;ae=Object(u.findFragmentByPTS)(A,G,E,me)}else ae=G[G.length-1];if(ae){var Re=ae.sn-U.startSN,Oe=A&&ae.level===A.level,Ce=G[Re+1],Pe=this.fragmentTracker.getState(ae);if(Pe===I.FragmentState.BACKTRACKED){ae=null;for(var He=Re;G[He]&&this.fragmentTracker.getState(G[He])===I.FragmentState.BACKTRACKED;)A?ae=G[He--]:ae=G[--He];ae||(ae=Ce)}else A&&ae.sn===A.sn&&!te&&(Oe&&(ae.sn=G-y.maxFragLookUpTolerance&&A<=W;if(j!==null&&U.duration>j&&(A"+E.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+W),ae}return O},f.waitForCdnTuneIn=function(E){var y=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*y)},f.setStartPosition=function(E,y){var U=this.startPosition;if(U"+E))}}]),g}(F.default)},"./src/controller/buffer-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),I=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),N=M("./src/utils/buffer-helper.ts"),n=M("./src/utils/mediasource-helper.ts"),P=M("./src/loader/fragment.ts"),p=M("./src/controller/buffer-operation-queue.ts"),m=Object(n.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function o(r){var a=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 i=a.hls,s=a.media,S=a.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),i.trigger(F.Events.MEDIA_ATTACHED,{media:s})),S&&S.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var h=o.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var a=this.hls;a.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(F.Events.BUFFER_RESET,this.onBufferReset,this),a.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(F.Events.BUFFER_EOS,this.onBufferEos,this),a.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(F.Events.FRAG_PARSED,this.onFragParsed,this),a.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var a=this.hls;a.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(F.Events.BUFFER_RESET,this.onBufferReset,this),a.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(F.Events.BUFFER_EOS,this.onBufferEos,this),a.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(F.Events.FRAG_PARSED,this.onFragParsed,this),a.off(F.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(a,i){var s=2;(i.audio&&!i.video||!i.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(a,i){var s=this.media=i.media;if(s&&m){var S=this.mediaSource=new m;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(S),this._objectUrl=s.src}},h.onMediaDetaching=function(){var a=this.media,i=this.mediaSource,s=this._objectUrl;if(i){if(I.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(S){I.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):I.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(F.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(i){var s=a.sourceBuffer[i];try{s&&(a.removeBufferListeners(i),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[i]=void 0)}catch(S){I.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",S)}}),this._initSourceBuffer()},h.onBufferCodecs=function(a,i){var s=this,S=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(x){if(S){var T=s.tracks[x];if(T&&typeof T.buffer.changeType=="function"){var R=i[x],w=R.codec,v=R.levelCodec,b=R.container,g=(T.levelCodec||T.codec).replace(d,"$1"),f=(v||w).replace(d,"$1");if(g!==f){var C=b+";codecs="+(v||w);s.appendChangeType(x,C)}}}else s.pendingTracks[x]=i[x]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(a,i){var s=this,S=this.operationQueue,x={execute:function(){var R=s.sourceBuffer[a];R&&(I.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+i),R.changeType(i)),S.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(R){I.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",R)}};S.append(x,a)},h.onBufferAppending=function(a,i){var s=this,S=this.hls,x=this.operationQueue,T=this.tracks,R=i.data,w=i.type,v=i.frag,b=i.part,g=i.chunkMeta,f=g.buffering[w],C=self.performance.now();f.start=C;var E=v.stats.buffering,y=b?b.stats.buffering:null;E.start===0&&(E.start=C),y&&y.start===0&&(y.start=C);var U=T.audio,j=w==="audio"&&g.id===1&&(U==null?void 0:U.container)==="audio/mpeg",A={execute:function(){if(f.executeStart=self.performance.now(),j){var W=s.sourceBuffer[w];if(W){var O=v.start-W.timestampOffset;Math.abs(O)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+O+") sn: "+v.sn+")"),W.timestampOffset=v.start)}}s.appendExecutor(R,w)},onStart:function(){},onComplete:function(){var W=self.performance.now();f.executeEnd=f.end=W,E.first===0&&(E.first=W),y&&y.first===0&&(y.first=W);var O=s.sourceBuffer,V={};for(var te in O)V[te]=N.BufferHelper.getBuffered(O[te]);s.appendError=0,s.hls.trigger(F.Events.BUFFER_APPENDED,{type:w,frag:v,part:b,chunkMeta:g,parent:v.type,timeRanges:V})},onError:function(W){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",W);var O={type:H.ErrorTypes.MEDIA_ERROR,parent:v.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:W,fatal:!1};W.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=H.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,O.details=H.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>S.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),S.trigger(F.Events.ERROR,O)}};x.append(A,w)},h.onBufferFlushing=function(a,i){var s=this,S=this.operationQueue,x=function(R){return{execute:s.removeExecutor.bind(s,R,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(F.Events.BUFFER_FLUSHED,{type:R})},onError:function(v){I.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};i.type?S.append(x(i.type),i.type):this.getSourceBufferTypes().forEach(function(T){S.append(x(T),T)})},h.onFragParsed=function(a,i){var s=this,S=i.frag,x=i.part,T=[],R=x?x.elementaryStreams:S.elementaryStreams;R[P.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(R[P.ElementaryStreamTypes.AUDIO]&&T.push("audio"),R[P.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var b=self.performance.now();S.stats.buffering.end=b,x&&(x.stats.buffering.end=b);var g=x?x.stats:S.stats;s.hls.trigger(F.Events.FRAG_BUFFERED,{frag:S,part:x,stats:g,id:S.type})};T.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(w,T)},h.onFragChanged=function(a,i){this.flushBackBuffer()},h.onBufferEos=function(a,i){var s=this,S=this.getSourceBufferTypes().reduce(function(x,T){var R=s.sourceBuffer[T];return(!i.type||i.type===T)&&(R&&!R.ended&&(R.ended=!0,I.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),x&&!!(!R||R.ended)},!0);S&&this.blockBuffers(function(){var x=s.mediaSource;if(!x||x.readyState!=="open")return;x.endOfStream()})},h.onLevelUpdated=function(a,i){var s=i.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var a=this.hls,i=this.details,s=this.media,S=this.sourceBuffer;if(!s||i===null)return;var x=this.getSourceBufferTypes();if(!x.length)return;var T=i.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(X.isFiniteNumber)(T)||T<0)return;var R=s.currentTime,w=i.levelTargetDuration,v=Math.max(T,w),b=Math.floor(R/w)*w-v;x.forEach(function(g){var f=S[g];if(f){var C=N.BufferHelper.getBuffered(f);C.length>0&&b>C.start(0)&&(a.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),i.live&&a.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),a.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:g}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,i=this.hls,s=this.media,S=this.mediaSource,x=a.fragments[0].start+a.totalduration,T=s.duration,R=Object(X.isFiniteNumber)(S.duration)?S.duration:0;a.live&&i.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(a)):(x>R&&x>T||!Object(X.isFiniteNumber)(T))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+x.toFixed(3)),S.duration=x)},h.updateSeekableRange=function(a){var i=this.mediaSource,s=a.fragments,S=s.length;if(S&&a.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var x=Math.max(0,s[0].start),T=Math.max(x,x+a.totalduration);i.setLiveSeekableRange(x,T)}},h.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,i=this.operationQueue,s=this.pendingTracks,S=Object.keys(s).length;if(S&&!a||S===2){this.createSourceBuffers(s),this.pendingTracks={};var x=this.getSourceBufferTypes();if(x.length===0){this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}x.forEach(function(T){i.executeNext(T)})}},h.createSourceBuffers=function(a){var i=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var x in a)if(!i[x]){var T=a[x];if(!T)throw Error("source buffer exists for track "+x+", however track does not");var R=T.levelCodec||T.codec,w=T.container+";codecs="+R;I.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var v=i[x]=s.addSourceBuffer(w),b=x;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[x]={buffer:v,codec:R,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(g){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:w})}}S&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(a){var i=this.operationQueue,s=i.current(a);s.onStart()},h._onSBUpdateEnd=function(a){var i=this.operationQueue,s=i.current(a);s.onComplete(),i.shiftAndExecuteNext(a)},h._onSBUpdateError=function(a,i){I.logger.error("[buffer-controller]: "+a+" SourceBuffer error",i),this.hls.trigger(F.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(i)},h.removeExecutor=function(a,i,s){var S=this.media,x=this.mediaSource,T=this.operationQueue,R=this.sourceBuffer,w=R[a];if(!S||!x||!w){I.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var v=Object(X.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Object(X.isFiniteNumber)(x.duration)?x.duration:Infinity,g=Math.max(0,i),f=Math.min(s,v,b);f>g?(I.logger.log("[buffer-controller]: Removing ["+g+","+f+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(g,f)):T.shiftAndExecuteNext(a)},h.appendExecutor=function(a,i){var s=this.operationQueue,S=this.sourceBuffer,x=S[i];if(!x){I.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(i);return}x.ended=!1,console.assert(!x.updating,i+" sourceBuffer must not be updating"),x.appendBuffer(a)},h.blockBuffers=function(a,i){var s=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var S=this.operationQueue,x=i.map(function(T){return S.appendBlocker(T)});Promise.all(x).then(function(){a(),i.forEach(function(T){var R=s.sourceBuffer[T];(!R||!R.updating)&&S.shiftAndExecuteNext(T)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(a,i,s){var S=this.sourceBuffer[a];if(!S)return;var x=s.bind(this,a);this.listeners[a].push({event:i,listener:x}),S.addEventListener(i,x)},h.removeBufferListeners=function(a){var i=this.sourceBuffer[a];if(!i)return;this.listeners[a].forEach(function(s){i.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return F});var X=M("./src/utils/logger.ts"),F=function(){function I(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var H=I.prototype;return H.append=function(n,P){var p=this.queues[P];p.push(n),p.length===1&&this.buffers[P]&&this.executeNext(P)},H.insertAbort=function(n,P){var p=this.queues[P];p.unshift(n),this.executeNext(P)},H.appendBlocker=function(n){var P,p=new Promise(function(d){P=d}),m={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,n),p},H.executeNext=function(n){var P=this.buffers,p=this.queues,m=P[n],d=p[n];if(d.length){var u=d[0];try{u.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(o),(!m||!m.updating)&&(d.shift(),this.executeNext(n))}}},H.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},H.current=function(n){return this.queues[n][0]},I}()},"./src/controller/cap-level-controller.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/events.ts");function F(N,n){for(var P=0;P0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(p.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},n.getMaxLevel=function(p){var m=this,d=this.hls.levels;if(!d.length)return-1;var u=d.filter(function(o,h){return N.isLevelAllowed(h,m.restrictedLevels)&&h<=p});return this.clientRect=null,N.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,m={width:0,height:0};if(p){var d=p.getBoundingClientRect();m.width=d.width,m.height=d.height,!m.width&&!m.height&&(m.width=d.right-d.left||p.width||0,m.height=d.bottom-d.top||p.height||0)}return this.clientRect=m,m},N.isLevelAllowed=function(p,m){return m===void 0&&(m=[]),m.indexOf(p)===-1},N.getMaxLevelByMediaSize=function(p,m,d){if(!p||!p.length)return-1;for(var u=function(i,s){return s?i.width!==s.width||i.height!==s.height:!0},o=p.length-1,h=0;h=m||r.height>=d)&&u(r,p[h+1])){o=h;break}}return o},I(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(m){}return p}}]),N}();z.default=H},"./src/controller/cmcd-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./src/events.ts"),F=M("./src/types/cmcd.ts"),I=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts");function N(o,h){for(var r=0;r=o.length?{done:!0}:{done:!1,value:o[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(o,h){if(!o)return;if(typeof o=="string")return m(o,h);var r=Object.prototype.toString.call(o).slice(8,-1);if(r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set")return Array.from(o);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(o,h)}function m(o,h){(h==null||h>o.length)&&(h=o.length);for(var r=0,a=new Array(h);ri&&(i=T.bitrate)}return i>0?i:NaN},h.getBufferLength=function(a){var i=this.hls.media,s=a===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!i)return NaN;var S=I.BufferHelper.bufferInfo(s,i.currentTime,this.config.maxBufferHole);return S.len*1e3},h.createPlaylistLoader=function(){var a=this.config.pLoader,i=this.applyPlaylistData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(R,w,v){i(R),this.loader.load(R,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},h.createFragmentLoader=function(){var a=this.config.fLoader,i=this.applyFragmentData,s=a||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new s(T)}var x=S.prototype;return x.destroy=function(){this.loader.destroy()},x.abort=function(){this.loader.abort()},x.load=function(R,w,v){i(R),this.loader.load(R,w,v)},n(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},o.uuid=function(){var a=URL.createObjectURL(new Blob),i=a.toString();return URL.revokeObjectURL(a),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(a){for(var i=[],s=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},S=function(j){return Math.round(j)},x=function(j){return S(j/100)*100},T=function(j){return encodeURIComponent(j)},R={br:S,d:S,bl:x,dl:x,mtp:x,nor:T,rtp:x,tb:S},w=Object.keys(a||{}).sort(),v=P(w),b;!(b=v()).done;){var g=b.value,f=a[g];if(!s(f))continue;if(g==="v"&&f===1)continue;if(g=="pr"&&f===1)continue;var C=R[g];C&&(f=C(f));var E=typeof f,y=void 0;g==="ot"||g==="sf"||g==="st"?y=g+"="+f:E==="boolean"?y=g:E==="number"?y=g+"="+f:y=g+"="+JSON.stringify(f),i.push(y)}return i.join(",")},o.toHeaders=function(a){for(var i=Object.keys(a),s={},S=["Object","Request","Session","Status"],x=[{},{},{},{}],T={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,w=i;RP){this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=P-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(i,s)}break}},o._generateLicenseRequestChallenge=function(r,a){switch(r.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},o._requestLicense=function(r,a){I.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(i.mediaKeySystemDomain),S=this._createLicenseXhr(s,r,a);I.logger.log("Sending license request to URL: "+s);var x=this._generateLicenseRequestChallenge(i,r);S.send(x)}catch(T){I.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(r,a){if(!this._emeEnabled)return;var i=a.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var r=this._media,a=this._mediaKeysList;if(!r)return;r.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return r.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(r,a){if(!this._emeEnabled)return;var i=a.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),s=a.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,i,s)},n(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();z.default=d},"./src/controller/fps-controller.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/events.ts"),F=M("./src/utils/logger.ts"),I=function(){function H(n){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=n,this.registerListeners()}var N=H.prototype;return N.setStreamController=function(P){this.streamController=P},N.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(P,p){var m=this.hls.config;if(m.capLevelOnFPSDrop){var d=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(P,p,m){var d=performance.now();if(p){if(this.lastTime){var u=d-this.lastTime,o=m-this.lastDroppedFrames,h=p-this.lastDecodedFrames,r=1e3*o/u,a=this.hls;if(a.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:h,totalDroppedFrames:m}),r>0&&o>a.config.fpsDroppedMonitoringThreshold*h){var i=a.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=i)&&(i=i-1,a.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:a.currentLevel}),a.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=m,this.lastDecodedFrames=p}},N.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var p=P.getVideoPlaybackQuality();this.checkFPS(P,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},H}();z.default=I},"./src/controller/fragment-finders.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"findFragmentByPDT",function(){return I}),M.d(z,"findFragmentByPTS",function(){return H}),M.d(z,"fragmentWithinToleranceTest",function(){return N}),M.d(z,"pdtWithinToleranceTest",function(){return n}),M.d(z,"findFragWithCC",function(){return P});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/binary-search.ts");function I(p,m,d){if(m===null||!Array.isArray(p)||!p.length||!Object(X.isFiniteNumber)(m))return null;var u=p[0].programDateTime;if(m<(u||0))return null;var o=p[p.length-1].endProgramDateTime;if(m>=(o||0))return null;d=d||0;for(var h=0;hp&&d.start?-1:0}function n(p,m,d){var u=Math.min(m,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,o=d.endProgramDateTime||0;return o-u>p}function P(p,m){return F.default.search(p,function(d){return d.ccm?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"FragmentState",function(){return I}),M.d(z,"FragmentTracker",function(){return H});var X=M("./src/events.ts"),F=M("./src/types/loader.ts"),I;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(I||(I={}));var H=function(){function P(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var p=P.prototype;return p._registerListeners=function(){var d=this.hls;d.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var d=this.hls;d.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(d,u){if(u===F.PlaylistLevelType.MAIN){var o=this.activeFragment,h=this.activeParts;if(!o)return null;if(h)for(var r=h.length;r--;){var a=h[r],i=a?a.end:o.appendedPTS;if(a.start<=d&&i!==void 0&&d<=i)return r>9&&(this.activeParts=h.slice(r-9)),a}else if(o.start<=d&&o.appendedPTS!==void 0&&d<=o.appendedPTS)return o}return this.getBufferedFrag(d,u)},p.getBufferedFrag=function(d,u){for(var o=this.fragments,h=Object.keys(o),r=h.length;r--;){var a=o[h[r]];if((a==null?void 0:a.body.type)===u&&a.buffered){var i=a.body;if(i.start<=d&&d<=i.end)return i}}return null},p.detectEvictedFragments=function(d,u,o){var h=this;Object.keys(this.fragments).forEach(function(r){var a=h.fragments[r];if(!a)return;if(!a.buffered){a.body.type===o&&h.removeFragment(a.body);return}var i=a.range[d];if(!i)return;i.time.some(function(s){var S=!h.isTimeBuffered(s.startPTS,s.endPTS,u);return S&&h.removeFragment(a.body),S})})},p.detectPartialFragments=function(d){var u=this,o=this.timeRanges,h=d.frag,r=d.part;if(!o||h.sn==="initSegment")return;var a=n(h),i=this.fragments[a];if(!i)return;Object.keys(o).forEach(function(s){var S=h.elementaryStreams[s];if(!S)return;var x=o[s],T=r!==null||S.partial===!0;i.range[s]=u.getBufferedTimes(h,r,T,x)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},p.fragBuffered=function(d){var u=n(d),o=this.fragments[u];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},p.getBufferedTimes=function(d,u,o,h){for(var r={time:[],partial:o},a=u?u.start:d.start,i=u?u.end:d.end,s=d.minEndPTS||i,S=d.maxStartPTS||a,x=0;x=T&&s<=R){r.time.push({startPTS:Math.max(a,h.start(x)),endPTS:Math.min(i,h.end(x))});break}else if(aT)r.partial=!0,r.time.push({startPTS:Math.max(a,h.start(x)),endPTS:Math.min(i,h.end(x))});else if(i<=T)break}return r},p.getPartialFragment=function(d){var u=null,o,h,r,a=0,i=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(S){var x=s[S];if(!x)return;N(x)&&(h=x.body.start-i,r=x.body.end+i,d>=h&&d<=r&&(o=Math.min(d-h,r-d),a<=o&&(u=x.body,a=o)))}),u},p.getState=function(d){var u=n(d),o=this.fragments[u];return o?o.buffered?N(o)?I.PARTIAL:I.OK:o.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},p.backtrack=function(d,u){var o=n(d),h=this.fragments[o];if(!h||h.backtrack)return null;var r=h.backtrack=u||h.loaded;return h.loaded=null,r},p.getBacktrackData=function(d){var u=n(d),o=this.fragments[u];if(o){var h,r=o.backtrack;if(r!=null&&(h=r.payload)!==null&&h!==void 0&&h.byteLength)return r;this.removeFragment(d)}return null},p.isTimeBuffered=function(d,u,o){for(var h,r,a=0;a=h&&u<=r)return!0;if(u<=h)return!1}return!1},p.onFragLoaded=function(d,u){var o=u.frag,h=u.part;if(o.sn==="initSegment"||o.bitrateTest||h)return;var r=n(o);this.fragments[r]={body:o,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(d,u){var o=this,h=u.frag,r=u.part,a=u.timeRanges;if(h.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=h,r){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(r)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var S=a[s];if(o.detectEvictedFragments(s,S),!r)for(var x=0;xd&&h.removeFragment(i)}})},p.removeFragment=function(d){var u=n(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[u]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function N(P){var p,m;return P.buffered&&(((p=P.range.video)===null||p===void 0?void 0:p.partial)||((m=P.range.audio)===null||m===void 0?void 0:m.partial))}function n(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"STALL_MINIMUM_DURATION_MS",function(){return N}),M.d(z,"MAX_START_GAP_JUMP",function(){return n}),M.d(z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),M.d(z,"SKIP_BUFFER_RANGE_START",function(){return p}),M.d(z,"default",function(){return m});var X=M("./src/utils/buffer-helper.ts"),F=M("./src/errors.ts"),I=M("./src/events.ts"),H=M("./src/utils/logger.ts"),N=250,n=2,P=.1,p=.05,m=function(){function d(o,h,r,a){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=o,this.media=h,this.fragmentTracker=r,this.hls=a}var u=d.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(h){var r=this.config,a=this.media,i=this.stalled,s=a.currentTime,S=a.seeking,x=this.seeking&&!S,T=!this.seeking&&S;if(this.seeking=S,s!==h){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;H.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||x)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!X.BufferHelper.getBuffered(a).length)return;var w=X.BufferHelper.bufferInfo(a,s,0),v=w.len>0,b=w.nextStart||0;if(!v&&!b)return;if(S){var g=w.len>n,f=!b||b-s>n&&!this.fragmentTracker.getPartialFragment(s);if(g||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,w.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=y==null||((C=y.details)===null||C===void 0)?void 0:C.live,j=U?y.details.targetduration*2:n;if(E>0&&E<=j){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var G=A-i;!S&&G>=N&&this._reportStall(w.len);var W=X.BufferHelper.bufferInfo(a,s,r.maxBufferHole);this._tryFixBufferStall(W,G)},u._tryFixBufferStall=function(h,r){var a=this.config,i=this.fragmentTracker,s=this.media,S=s.currentTime,x=i.getPartialFragment(S);if(x){var T=this._trySkipBufferHole(x);if(T)return}h.len>a.maxBufferHole&&r>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(h){var r=this.hls,a=this.media,i=this.stallReported;i||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+h+")"),r.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},u._trySkipBufferHole=function(h){for(var r=this.config,a=this.hls,i=this.media,s=i.currentTime,S=0,x=X.BufferHelper.getBuffered(i),T=0;T=S&&s.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,a)),R=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;d.playbackRate=Math.min(T,Math.max(1,R))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},p.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},p.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},N(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,u=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:u?d.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var u=d.holdBack,o=d.partHoldBack,h=d.targetduration,r=this.config,a=r.liveSyncDuration,i=r.liveSyncDurationCount,s=r.lowLatencyMode,S=this.hls.userConfig,x=s&&o||u;(S.liveSyncDuration||S.liveSyncDurationCount||x===0)&&(x=a!==void 0?a:i*h);var T=h,R=1;return x+Math.min(this.stallCount*R,T)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),u=this.targetLatency,o=this.levelDetails;if(d===null||u===null||o===null)return null;var h=o.edge,r=d-u-this.edgeStalled,a=h-o.totalduration,i=h-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(a,r),i)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var u=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-u,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,u=this.levelDetails;if(!d||!u)return 0;var o=d.buffered.length;return o?d.buffered.end(o-1):u.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return r});var X=M("./src/types/level.ts"),F=M("./src/events.ts"),I=M("./src/errors.ts"),H=M("./src/utils/codecs.ts"),N=M("./src/controller/level-helper.ts"),n=M("./src/controller/base-playlist-controller.ts"),P=M("./src/types/loader.ts");function p(){return p=Object.assign||function(a){for(var i=1;i0){b=R[0].bitrate,R.sort(function(G,W){return G.bitrate-W.bitrate}),this._levels=R;for(var U=0;Uthis.hls.config.fragLoadingMaxRetry&&(g=T.frag.level)):g=T.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),g=R.level),v=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:g=T.level,v=!0;break}g!==void 0&&this.recoverLevel(T,g,v,b)},s.recoverLevel=function(x,T,R,w){var v=x.details,b=this._levels[T];if(b.loadError++,R){var g=this.retryLoadingOrFail(x);if(g)x.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var f=b.url.length;if(f>1&&b.loadError1){var w=(T.urlId+1)%R;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(v){v.urlId=w}),this.level=x}},s.onFragLoaded=function(x,T){var R=T.frag;if(R!==void 0&&R.type===P.PlaylistLevelType.MAIN){var w=this._levels[R.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},s.onLevelLoaded=function(x,T){var R,w=T.level,v=T.details,b=this._levels[w];if(!b){var g;this.warn("Invalid level index "+w),(g=T.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(v.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,b.details)):(R=T.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(x,T){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var w=-1,v=this.hls.audioTracks[T.id].groupId,b=0;b0){var w=R.urlId,v=R.url[w];if(x)try{v=x.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+T+(x?" at sn "+x.msn+" part "+x.part:"")+" with URL-id "+w+" "+v),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:v,level:T,id:w,deliveryDirectives:x||null})}},s.removeLevel=function(x,T){var R=function(b,g){return g!==T},w=this._levels.filter(function(v,b){return b!==x?!0:v.url.length>1&&T!==void 0?(v.url=v.url.filter(R),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(R)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(R)),v.urlId=0,!0):!1}).map(function(v,b){var g=v.details;return g!=null&&g.fragments&&g.fragments.forEach(function(f){f.level=b}),v});this._levels=w,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:w})},d(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(x){var T,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===x&&(T=R[x])!==null&&T!==void 0&&T.details)return;if(x<0||x>=R.length){var w=x<0;if(this.hls.trigger(F.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:x,fatal:w,reason:"invalid level idx"}),w)return;x=Math.min(x,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,b=R[v],g=R[x];this.log("switching to level "+x+" from "+v),this.currentLevelIndex=x;var f=p({},g,{level:x,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete f._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,f);var C=g.details;if(!C||C.live){var E=this.switchParams(g.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(x){this.manualLevelIndex=x,this._startLevel===void 0&&(this._startLevel=x),x!==-1&&(this.level=x)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(x){this._firstLevel=x}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var x=this.hls.config.startLevel;return x!==void 0?x:this._firstLevel}else return this._startLevel},set:function(x){this._startLevel=x}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(x){this.level=x,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=x)}}]),i}(n.default)},"./src/controller/level-helper.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"addGroupId",function(){return I}),M.d(z,"assignTrackIdsByGroup",function(){return H}),M.d(z,"updatePTS",function(){return N}),M.d(z,"updateFragPTSDTS",function(){return P}),M.d(z,"mergeDetails",function(){return p}),M.d(z,"mapPartIntersection",function(){return m}),M.d(z,"mapFragmentIntersection",function(){return d}),M.d(z,"adjustSliding",function(){return u}),M.d(z,"addSliding",function(){return o}),M.d(z,"computeReloadInterval",function(){return h}),M.d(z,"getFragmentWithSN",function(){return r}),M.d(z,"getPartWith",function(){return a});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts");function I(i,s,S){switch(s){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(S);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(S);break}}function H(i){var s={};i.forEach(function(S){var x=S.groupId||"";S.id=s[x]=s[x]||0,s[x]++})}function N(i,s,S){var x=i[s],T=i[S];n(x,T)}function n(i,s){var S=s.startPTS;if(Object(X.isFiniteNumber)(S)){var x=0,T;s.sn>i.sn?(x=S-i.start,T=i):(x=i.start-S,T=s),T.duration!==x&&(T.duration=x)}else if(s.sn>i.sn){var R=i.cc===s.cc;R&&i.minEndPTS?s.start=i.start+(i.minEndPTS-i.start):s.start=i.start+i.duration}else s.start=Math.max(i.start-s.duration,0)}function P(i,s,S,x,T,R){var w=x-S;w<=0&&(F.logger.warn("Fragment should have a positive duration",s),x=S+s.duration,R=T+s.duration);var v=S,b=x,g=s.startPTS,f=s.endPTS;if(Object(X.isFiniteNumber)(g)){var C=Math.abs(g-S);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(C,s.deltaPTS):s.deltaPTS=C,v=Math.max(S,g),S=Math.min(S,g),T=Math.min(T,s.startDTS),b=Math.min(x,f),x=Math.max(x,f),R=Math.max(R,s.endDTS)}s.duration=x-S;var E=S-s.start;s.appendedPTS=x,s.start=s.startPTS=S,s.maxStartPTS=v,s.startDTS=T,s.endPTS=x,s.minEndPTS=b,s.endDTS=R;var y=s.sn;if(!i||yi.endSN)return 0;var U,j=y-i.startSN,A=i.fragments;for(A[j]=s,U=j;U>0;U--)n(A[U],A[U-1]);for(U=j;U=0;T--){var R=x[T].initSegment;if(R){S=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var w=0,v;if(d(i,s,function(U,j){U.relurl&&(w=U.cc-j.cc),Object(X.isFiniteNumber)(U.startPTS)&&Object(X.isFiniteNumber)(U.endPTS)&&(j.start=j.startPTS=U.startPTS,j.startDTS=U.startDTS,j.appendedPTS=U.appendedPTS,j.maxStartPTS=U.maxStartPTS,j.endPTS=U.endPTS,j.endDTS=U.endDTS,j.minEndPTS=U.minEndPTS,j.duration=U.endPTS-U.startPTS,j.duration&&(v=j),s.PTSKnown=s.alignedSliding=!0),j.elementaryStreams=U.elementaryStreams,j.loader=U.loader,j.stats=U.stats,j.urlId=U.urlId,U.initSegment&&(j.initSegment=U.initSegment,S=U.initSegment)}),S){var b=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;b.forEach(function(U){var j;(!U.initSegment||U.initSegment.relurl===((j=S)===null||j===void 0?void 0:j.relurl))&&(U.initSegment=S)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(U){return!U}),s.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=s.skippedSegments;g--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var f=s.fragments;if(w){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C=x.length)return;o(s,x[S].start)}function o(i,s){if(s){for(var S=i.fragments,x=i.skippedSegments;x0&&T0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),b=g),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var b,g=this.levels,f=this.level,C=g==null||((b=g[f])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var E,y=self.performance.now(),U=this.retryDate;(!U||y>=U||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var b,g,f=this.hls,C=this.levelLastLoaded,E=this.levels,y=this.media,U=f.config,j=f.nextLoadLevel;if(C===null||!y&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[j])return;var A=E[j];this.level=f.nextLoadLevel=j;var G=A.details;if(!G||this.state===F.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==j){this.state=F.State.WAITING_LEVEL;return}var W=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,P.PlaylistLevelType.MAIN);if(W===null)return;var O=W.len,V=this.getMaxBufferLength(A.maxBitrate);if(O>=V)return;if(this._streamEnded(W,G)){var te={};this.altAudio&&(te.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,te),this.state=F.State.ENDED;return}var ae=W.end,me=this.getNextFragment(ae,G);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var Re=me.sn-G.startSN;Re>1&&(me=G.fragments[Re-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===n.FragmentState.OK&&this.nextLoadPosition>ae){var Oe=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Oe,P.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,G)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((b=me.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((g=me.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(me,G):this.loadFragment(me,G,ae)},w.loadFragment=function(b,g,f){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===n.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(b);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,b,g,f)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(b){var g=this.fragmentTracker.getAppendedFrag(b,P.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},w.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,P.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var b=this.levels,g=this.media;if(g!=null&&g.readyState){var f,C=this.getAppendedFrag(g.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!g.paused&&b){var E=this.hls.nextLoadLevel,y=b[E],U=this.fragLastKbps;U&&this.fragCurrent?f=this.fragCurrent.duration*y.maxBitrate/(1e3*U)+1:f=0}else f=0;var j=this.getBufferedFrag(g.currentTime+f);if(j){var A=this.followingBufferedFrag(j);if(A){this.abortCurrentFrag();var G=A.maxStartPTS?A.maxStartPTS:A.start,W=A.duration,O=Math.max(j.end,G+Math.min(Math.max(W-this.config.maxFragLookUpTolerance,W*.5),W*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(b,g){T.prototype.flushMainBuffer.call(this,b,g,this.altAudio?"video":null)},w.onMediaAttached=function(b,g){T.prototype.onMediaAttached.call(this,b,g);var f=g.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,f,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var b=this.media,g=b?b.currentTime:null;Object(X.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(b,g){var f=!1,C=!1,E;g.levels.forEach(function(y){E=y.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(f=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(I.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=g.levels,this.startFragRequested=!1},w.onLevelLoading=function(b,g){var f=this.levels;if(!f||this.state!==F.State.IDLE)return;var C=f[g.level];(!C.details||C.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(C.details))&&(this.state=F.State.WAITING_LEVEL)},w.onLevelLoaded=function(b,g){var f,C=this.levels,E=g.level,y=g.details,U=y.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+U);var j=this.fragCurrent;j&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==g.level&&j.loader&&(this.state=F.State.IDLE,j.loader.abort()));var A=C[E],G=0;if(y.live||(f=A.details)!==null&&f!==void 0&&f.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;G=this.alignPlaylists(y,A.details)}if(A.details=y,this.levelLastLoaded=E,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:y,level:E}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=F.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,G),this.tick()},w._handleFragmentLoadProgress=function(b){var g,f=b.frag,C=b.part,E=b.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var U=y[f.level],j=U.details;if(!j){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var A=U.videoCodec,G=j.PTSKnown||!j.live,W=(g=f.initSegment)===null||g===void 0?void 0:g.data,O=this._getAudioCodec(U),V=this.transmuxer=this.transmuxer||new m.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),te=C?C.index:-1,ae=te!==-1,me=new d.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,E.byteLength,te,ae),Re=this.initPTS[f.cc];V.push(E,W,O,A,f,C,j.totalduration,G,me,Re)},w.onAudioTrackSwitching=function(b,g){var f=this.altAudio,C=!!g.url,E=g.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;f&&U.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:E})}},w.onAudioTrackSwitched=function(b,g){var f=g.id,C=!!this.hls.audioTracks[f].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},w.onBufferCreated=function(b,g){var f=g.tracks,C,E,y=!1;for(var U in f){var j=f[U];if(j.id==="main"){if(E=U,C=j,U==="video"){var A=f[U];A&&(this.videoBuffer=A.buffer)}}else y=!0}y&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(b,g){var f=g.frag,C=g.part;if(f&&f.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var E=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},w.onError=function(b,g){switch(g.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=F.State.ERROR):!g.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var b=this.media,g=this.gapController;if(!b||!g||!b.readyState)return;var f=N.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(b,g){var f=g.type;if(f!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,P.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(b,g){this.levels=g.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var b=this.media,g=b.currentTime,f=this.startPosition;if(f>=0&&g0&&(y1&&b.seeking===!1){var f=b.currentTime;if(N.BufferHelper.isBuffered(b,f)?g=this.getAppendedFrag(f):N.BufferHelper.isBuffered(b,f+.1)&&(g=this.getAppendedFrag(f+.1)),g){var C=this.fragPlaying,E=g.level;(!C||g.sn!==C.sn||C.level!==E||g.urlId!==C.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:g}),(!C||C.level!==E)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=g)}}},a(R,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"SubtitleStreamController",function(){return i});var X=M("./src/events.ts"),F=M("./src/utils/logger.ts"),I=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-finders.ts"),N=M("./src/utils/discontinuities.ts"),n=M("./src/controller/level-helper.ts"),P=M("./src/controller/fragment-tracker.ts"),p=M("./src/controller/base-stream-controller.ts"),m=M("./src/types/loader.ts"),d=M("./src/types/level.ts");function u(s,S){for(var x=0;x=g[E].start&&C<=g[E].end){f=g[E];break}var y=v.start+v.duration;f?f.end=y:(f={start:C,end:y},g.push(f)),this.fragmentTracker.fragBuffered(v)},x.onBufferFlushing=function(R,w){var v=w.startOffset,b=w.endOffset;if(v===0&&b!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,f=this.levels;if(!f.length||!f[g]||!f[g].details)return;var C=f[g].details,E=C.targetduration,y=b-E;if(y<=0)return;w.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(U){for(var j=0;j=C.length||g!==f||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(v=E.details)!==null&&v!==void 0&&v.live){var y=this.mainDetails;if(b.deltaUpdateFailed||!y)return;var U=y.fragments[0];if(!E.details)b.hasProgramDateTime&&y.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(b,y):U&&Object(n.addSliding)(b,U.start);else{var j=this.alignPlaylists(b,E.details);j===0&&U&&Object(n.addSliding)(b,U.start)}}if(E.details=b,this.levelLastLoaded=g,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var A=Object(H.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},x._handleFragmentLoadComplete=function(R){var w=R.frag,v=R.payload,b=w.decryptdata,g=this.hls;if(this.fragContextChanged(w))return;if(v&&v.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();g.trigger(X.Events.FRAG_DECRYPTED,{frag:w,payload:C,stats:{tstart:f,tdecrypt:E}})})}},x.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var R,w=this.currentTrackId,v=this.levels;if(!v.length||!v[w]||!v[w].details)return;var b=v[w].details,g=b.targetduration,f=this.config,C=this.media,E=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-g,f.maxBufferHole),y=E.end,U=E.len,j=this.getMaxBufferLength()+g;if(U>j)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var A=b.fragments,G=A.length,W=b.edge,O,V=this.fragPrevious;if(y-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)},h.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},h.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 a=d(this.media.textTracks);a.forEach(function(i){Object(F.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(a,i){this.tracks=i.subtitleTracks},h.onSubtitleTrackLoaded=function(a,i){var s=i.id,S=i.details,x=this.trackId,T=this.tracksInGroup[x];if(!T){this.warn("Invalid subtitle track id "+s);return}var R=T.details;T.details=i.details,this.log("subtitle track "+s+" loaded ["+S.startSN+"-"+S.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,i,R))},h.onLevelLoading=function(a,i){this.switchLevel(i.level)},h.onLevelSwitching=function(a,i){this.switchLevel(i.level)},h.switchLevel=function(a){var i=this.hls.levels[a];if(!(i!=null&&i.textGroupIds))return;var s=i.textGroupIds[i.urlId];if(this.groupId!==s){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,x=this.tracks.filter(function(w){return!s||w.groupId===s});this.tracksInGroup=x;var T=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=s;var R={subtitleTracks:x};this.log("Updating subtitle tracks, "+x.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),T!==-1&&this.setSubtitleTrack(T,S)}},h.findTrackId=function(a){for(var i=this.tracksInGroup,s=0;s=S.length)return;this.clearTimer();var x=S[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,x){var T=x.id,R=x.groupId,w=R===void 0?"":R,v=x.name,b=x.type,g=x.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:v,type:b,url:g});var f=this.switchParams(x.url,i==null?void 0:i.details);this.loadPlaylist(f)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:a})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,i=d(this.media.textTracks),s=0;s=0&&(b[0]=Math.min(b[0],S),b[1]=Math.max(b[1],x),w=!0,g/(x-S)>.5))return}if(w||R.push([S,x]),this.config.renderTextTracksNatively){var f=this.captionsTracks[s];this.Cues.newCue(f,S,x,T)}else{var C=this.Cues.newCue(null,S,x,T);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:C,track:s})}},a.onInitPtsFound=function(s,S){var x=this,T=S.frag,R=S.id,w=S.initPTS,v=S.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=v),b.length&&(this.unparsedVttFrags=[],b.forEach(function(g){x.onFragLoaded(F.Events.FRAG_LOADED,g)}))},a.getExistingTrack=function(s){var S=this.media;if(S)for(var x=0;x>>8^v&255^99,P[T]=v,p[v]=T;var b=x[T],g=x[b],f=x[g],C=x[v]*257^v*16843008;d[T]=C<<24|C>>>8,u[T]=C<<16|C>>>16,o[T]=C<<8|C>>>24,h[T]=C,C=f*16843009^g*65537^b*257^T*16843008,a[v]=C<<24|C>>>8,i[v]=C<<16|C>>>16,s[v]=C<<8|C>>>24,S[v]=C,T?(T=b^x[x[x[f^b]]],R^=x[x[R]]):T=R=1}},N.expandKey=function(P){for(var p=this.uint8ArrayToUint32Array_(P),m=!0,d=0;d>>6)+1;var C=(s[S+2]&60)>>>2;if(C>f.length-1){i.trigger(I.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return w=(s[S+2]&1)<<2,w|=(s[S+3]&192)>>>6,X.logger.log("manifest codec:"+x+", ADTS type:"+T+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(T=5,v=new Array(4),R=C-3):(T=2,v=new Array(2),R=C):b.indexOf("android")!==-1?(T=2,v=new Array(2),R=C):(T=5,v=new Array(4),x&&(x.indexOf("mp4a.40.29")!==-1||x.indexOf("mp4a.40.5")!==-1)||!x&&C>=6?R=C-3:((x&&x.indexOf("mp4a.40.2")!==-1&&(C>=6&&w===1||/vivaldi/i.test(b))||!x&&w===1)&&(T=2,v=new Array(2)),R=C)),v[0]=T<<3,v[0]|=(C&14)>>1,v[1]|=(C&1)<<7,v[1]|=w<<3,T===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:f[C],channelCount:w,codec:"mp4a.40."+T,manifestCodec:g}}function N(i,s){return i[s]===255&&(i[s+1]&246)===240}function n(i,s){return i[s+1]&1?7:9}function P(i,s){return(i[s+3]&3)<<11|i[s+4]<<3|(i[s+5]&224)>>>5}function p(i,s){return s+5=i.length)return!1;var x=P(i,s);if(x<=S)return!1;var T=s+x;return T===i.length||m(i,T)}return!1}function o(i,s,S,x,T){if(!i.samplerate){var R=H(s,S,x,T);if(!R)return;i.config=R.config,i.samplerate=R.samplerate,i.channelCount=R.channelCount,i.codec=R.codec,i.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+i.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function h(i){return 1024*9e4/i}function r(i,s,S,x,T){var R=n(i,s),w=P(i,s);if(w-=R,w>0){var v=S+x*T;return{headerLength:R,frameLength:w,stamp:v}}}function a(i,s,S,x,T){var R=h(i.samplerate),w=r(s,S,x,T,R);if(w){var v=w.frameLength,b=w.headerLength,g=w.stamp,f=b+v,C=Math.max(0,S+f-s.length),E;C?(E=new Uint8Array(f-b),E.set(s.subarray(S+b,s.length),0)):E=s.subarray(S+b,S+f);var y={unit:E,pts:g};return C||i.samples.push(y),{sample:y,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"initPTSFn",function(){return P});var X=M("./src/polyfills/number.ts"),F=M("./src/demux/id3.ts"),I=M("./src/demux/dummy-demuxed-track.ts"),H=M("./src/utils/mp4-tools.ts"),N=M("./src/utils/typed-array.ts"),n=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=p.prototype;return m.resetInitSegment=function(u,o,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(u,o){return!1},m.appendFrame=function(u,o,h){},m.demux=function(u,o){this.cachedData&&(u=Object(H.appendUint8Array)(this.cachedData,u),this.cachedData=null);var h=F.getID3Data(u,0),r=h?h.length:0,a,i,s=this._audioTrack,S=this._id3Track,x=h?F.getTimeStamp(h):void 0,T=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(x,o)),h&&h.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),i=this.initPTS;rn?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,P=n>>3,n-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},H.readBits=function(n){var P=Math.min(this.bitsAvailable,n),p=this.word>>>32-P;return n>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=n-P,P>0&&this.bitsAvailable?p<>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},H.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(n){for(var P=8,p=8,m,d=0;d0?T.subarray(w,w+v):void 0},H=function(T,R){var w=0;return w=(T[R]&127)<<21,w|=(T[R+1]&127)<<14,w|=(T[R+2]&127)<<7,w|=T[R+3]&127,w},N=function(T,R){return X(T,R)&&H(T,R+6)+10<=T.length-R},n=function(T){for(var R=m(T),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(f);break;case 12:case 13:C=T[U++],y+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=T[U++],E=T[U++],y+=String.fromCharCode((f&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return y},i={decodeTextFrame:o},s;function S(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/demux/base-audio-demuxer.ts"),F=M("./src/demux/id3.ts"),I=M("./src/utils/logger.ts"),H=M("./src/demux/mpegaudio.ts");function N(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,n(p,m)}function n(p,m){return n=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},n(p,m)}var P=function(p){N(m,p);function m(){return p.apply(this,arguments)||this}var d=m.prototype;return d.resetInitSegment=function(o,h,r){p.prototype.resetInitSegment.call(this,o,h,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:r,inputTimeScale:9e4,dropped:0}},m.probe=function(o){if(!o)return!1;for(var h=F.getID3Data(o,0)||[],r=h.length,a=o.length;r0},N.demux=function(P){var p=P,m=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(X.appendUint8Array)(this.remainderData,P));var d=Object(X.segmentValidRange)(p);this.remainderData=d.remainder,m.samples=d.valid||new Uint8Array}else m.samples=p;return{audioTrack:Object(F.dummyTrack)(),avcTrack:m,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},N.flush=function(){var P=Object(F.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:P,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},N.demuxSampleAes=function(P,p,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},H}();I.minProbeByteLength=1024,z.default=I},"./src/demux/mpegaudio.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"appendFrame",function(){return n}),M.d(z,"parseHeader",function(){return P}),M.d(z,"isHeaderPattern",function(){return p}),M.d(z,"isHeader",function(){return m}),M.d(z,"canParse",function(){return d}),M.d(z,"probe",function(){return u});var X=null,F=[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],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function n(o,h,r,a,i){if(r+24>h.length)return;var s=P(h,r);if(s&&r+s.frameLength<=h.length){var S=s.samplesPerFrame*9e4/s.sampleRate,x=a+i*S,T={unit:h.subarray(r,r+s.frameLength),pts:x,dts:x};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(T),{sample:T,length:s.frameLength,missing:0}}}function P(o,h){var r=o[h+1]>>3&3,a=o[h+1]>>1&3,i=o[h+2]>>4&15,s=o[h+2]>>2&3;if(r!==1&&i!==0&&i!==15&&s!==3){var S=o[h+2]>>1&1,x=o[h+3]>>6,T=r===3?3-a:a===3?3:4,R=F[T*14+i-1]*1e3,w=r===3?0:r===2?1:2,v=I[w*3+s],b=x===3?1:2,g=H[r][a],f=N[a],C=g*8*f,E=Math.floor(g*R/v+S)*f;if(X===null){var y=navigator.userAgent||"",U=y.match(/Chrome\/(\d+)/i);X=U?parseInt(U[1]):0}var j=!!X&&X<=87;return j&&a===2&&R>=224e3&&x===0&&(o[h+3]=o[h+3]|128),{sampleRate:v,channelCount:b,frameLength:E,samplesPerFrame:C}}}function p(o,h){return o[h]===255&&(o[h+1]&224)===224&&(o[h+1]&6)!==0}function m(o,h){return h+1=P.length){m();return}if(P[p].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(P,p,m,d),!d)return}},N.getAvcEncryptedData=function(P){for(var p=Math.floor((P.length-48)/160)*16+16,m=new Int8Array(p),d=0,u=32;u<=P.length-16;u+=160,d+=16)m.set(P.subarray(u,u+16),d);return m},N.getAvcDecryptedUnit=function(P,p){for(var m=new Uint8Array(p),d=0,u=32;u<=P.length-16;u+=160,d+=16)P.set(m.subarray(d,d+16),u);return P},N.decryptAvcSample=function(P,p,m,d,u,o){var h=Object(F.discardEPB)(u.data),r=this.getAvcEncryptedData(h),a=this;this.decryptBuffer(r.buffer,function(i){u.data=a.getAvcDecryptedUnit(h,i),o||a.decryptAvcSamples(P,p,m+1,d)})},N.decryptAvcSamples=function(P,p,m,d){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,m=0){if(p>=P.length){d();return}for(var u=P[p].units;!(m>=u.length);m++){var o=u[m];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(P,p,m,d,o,h),!h)return}}},H}();z.default=I},"./src/demux/transmuxer-interface.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u});var X=M("./node_modules/webworkify-webpack/index.js"),F=M.n(X),I=M("./src/events.ts"),H=M("./src/demux/transmuxer.ts"),N=M("./src/utils/logger.ts"),n=M("./src/errors.ts"),P=M("./src/utils/mediasource-helper.ts"),p=M("./node_modules/eventemitter3/index.js"),m=M.n(p),d=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function o(r,a,i,s){var S=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=r,this.id=a,this.onTransmuxComplete=i,this.onFlush=s;var x=r.config,T=function(g,f){f=f||{},f.frag=S.frag,f.id=S.id,r.trigger(g,f)};this.observer=new p.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,T),this.observer.on(I.Events.ERROR,T);var R={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(x.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var v;try{v=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(b){r.trigger(I.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:w,id:a,config:JSON.stringify(x)})}catch(b){N.logger.warn("Error in worker:",b),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new H.default(this.observer,R,x,w,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,R,x,w,a)}var h=o.prototype;return h.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},h.push=function(a,i,s,S,x,T,R,w,v,b){var g=this;v.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,E=T?T.start:x.start,y=x.decryptdata,U=this.frag,j=!(U&&x.cc===U.cc),A=!(U&&v.level===U.level),G=U?v.sn-U.sn:-1,W=this.part?v.part-this.part.index:1,O=!A&&(G===1||G===0&&W===1),V=self.performance.now();(A||G||x.stats.parsing.start===0)&&(x.stats.parsing.start=V),T&&(W||!O)&&(T.stats.parsing.start=V);var te=new H.TransmuxState(j,O,w,A,E);if(!O||j){N.logger.log("[transmuxer-interface, "+x.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+` discontinuity: `+j+` trackSwitch: `+A+` contiguous: `+O+` accurateTimeOffset: `+w+` timeOffset: `+E);var ae=new H.TransmuxConfig(s,S,i,R,b);this.configureTransmuxer(ae)}if(this.frag=x,this.part=T,C)C.postMessage({cmd:"demux",data:a,decryptdata:y,chunkMeta:v,state:te},a instanceof ArrayBuffer?[a]:[]);else if(f){var me=f.push(a,y,v,te);Object(H.isPromise)(me)?me.then(function(Re){g.handleTransmuxComplete(Re)}):this.handleTransmuxComplete(me)}},h.flush=function(a){var i=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:a});else if(s){var x=s.flush(a);Object(H.isPromise)(x)?x.then(function(T){i.handleFlushResult(T,a)}):this.handleFlushResult(x,a)}},h.handleFlushResult=function(a,i){var s=this;a.forEach(function(S){s.handleTransmuxComplete(S)}),this.onFlush(i)},h.onWorkerMessage=function(a){var i=a.data,s=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,s.trigger(i.event,i.data);break}}},h.configureTransmuxer=function(a){var i=this.worker,s=this.transmuxer;i?i.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},h.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},o}()},"./src/demux/transmuxer-worker.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return n});var X=M("./src/demux/transmuxer.ts"),F=M("./src/events.ts"),I=M("./src/utils/logger.ts"),H=M("./node_modules/eventemitter3/index.js"),N=M.n(H);function n(u){var o=new H.EventEmitter,h=function(a,i){u.postMessage({event:a,data:i})};o.on(F.Events.FRAG_DECRYPTED,h),o.on(F.Events.ERROR,h),u.addEventListener("message",function(r){var a=r.data;switch(a.cmd){case"init":{var i=JSON.parse(a.config);u.transmuxer=new X.default(o,a.typeSupported,i,a.vendor,a.id),Object(I.enableLogs)(i.debug),h("init",null);break}case"configure":{u.transmuxer.configure(a.config);break}case"demux":{var s=u.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(X.isPromise)(s)?s.then(function(T){P(u,T)}):P(u,s);break}case"flush":{var S=a.chunkMeta,x=u.transmuxer.flush(S);Object(X.isPromise)(x)?x.then(function(T){m(u,T,S)}):m(u,x,S);break}default:break}})}function P(u,o){if(d(o.remuxResult))return;var h=[],r=o.remuxResult,a=r.audio,i=r.video;a&&p(h,a),i&&p(h,i),u.postMessage({event:"transmuxComplete",data:o},h)}function p(u,o){o.data1&&u.push(o.data1.buffer),o.data2&&u.push(o.data2.buffer)}function m(u,o,h){o.forEach(function(r){P(u,r)}),u.postMessage({event:"flush",data:h})}function d(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return i}),M.d(z,"isPromise",function(){return x}),M.d(z,"TransmuxConfig",function(){return T}),M.d(z,"TransmuxState",function(){return R});var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/crypt/decrypter.ts"),H=M("./src/demux/aacdemuxer.ts"),N=M("./src/demux/mp4demuxer.ts"),n=M("./src/demux/tsdemuxer.ts"),P=M("./src/demux/mp3demuxer.ts"),p=M("./src/remux/mp4-remuxer.ts"),m=M("./src/remux/passthrough-remuxer.ts"),d=M("./src/demux/chunk-cache.ts"),u=M("./src/utils/mp4-tools.ts"),o=M("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(w){o.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var r=[{demux:n.default,remux:p.default},{demux:N.default,remux:m.default},{demux:H.default,remux:p.default},{demux:P.default,remux:p.default}],a=1024;r.forEach(function(w){var v=w.demux;a=Math.max(a,v.minProbeByteLength)});var i=function(){function w(b,g,f,C,E){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 d.default,this.observer=b,this.typeSupported=g,this.config=f,this.vendor=C,this.id=E}var v=w.prototype;return v.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},v.push=function(g,f,C,E){var y=this,U=C.transmuxing;U.executeStart=h();var j=new Uint8Array(g),A=this.cache,G=this.config,W=this.currentTransmuxState,O=this.transmuxConfig;E&&(this.currentTransmuxState=E);var V=s(j,f);if(V&&V.method==="AES-128"){var te=this.getDecrypter();if(G.enableSoftwareAES){var ae=te.softwareDecrypt(j,V.key.buffer,V.iv.buffer);if(!ae)return U.executeEnd=h(),S(C);j=new Uint8Array(ae)}else return this.decryptionPromise=te.webCryptoDecrypt(j,V.key.buffer,V.iv.buffer).then(function(ht){var wt=y.push(ht,null,C);return y.decryptionPromise=null,wt}),this.decryptionPromise}var me=E||W,Re=me.contiguous,Oe=me.discontinuity,Ce=me.trackSwitch,Pe=me.accurateTimeOffset,He=me.timeOffset,Ee=O.audioCodec,be=O.videoCodec,Ke=O.defaultInitPts,bt=O.duration,Et=O.initSegmentData;if((Oe||Ce)&&this.resetInitSegment(Et,Ee,be,bt),Oe&&this.resetInitialTimestamp(Ke),Re||this.resetContiguity(),this.needsProbing(j,Oe,Ce)){if(A.dataLength){var yt=A.flush();j=Object(u.appendUint8Array)(yt,j)}this.configureTransmuxer(j,O)}var pt=this.transmux(j,V,He,Pe,C),st=this.currentTransmuxState;return st.contiguous=!0,st.discontinuity=!1,st.trackSwitch=!1,U.executeEnd=h(),pt},v.flush=function(g){var f=this,C=g.transmuxing;C.executeStart=h();var E=this.decrypter,y=this.cache,U=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return f.flush(g)});var A=[],G=U.timeOffset;if(E){var W=E.flush();W&&A.push(this.push(W,null,g))}var O=y.dataLength;y.reset();var V=this.demuxer,te=this.remuxer;if(!V||!te)return O>=a&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=h(),[S(g)];var ae=V.flush(G);return x(ae)?ae.then(function(me){return f.flushRemux(A,me,g),A}):(this.flushRemux(A,ae,g),A)},v.flushRemux=function(g,f,C){var E=f.audioTrack,y=f.avcTrack,U=f.id3Track,j=f.textTrack,A=this.currentTransmuxState,G=A.accurateTimeOffset,W=A.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var O=this.remuxer.remux(E,y,U,j,W,G,!0,this.id);g.push({remuxResult:O,chunkMeta:C}),C.transmuxing.executeEnd=h()},v.resetInitialTimestamp=function(g){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(g),C.resetTimeStamp(g)},v.resetContiguity=function(){var g=this.demuxer,f=this.remuxer;if(!g||!f)return;g.resetContiguity(),f.resetNextTimestamp()},v.resetInitSegment=function(g,f,C,E){var y=this.demuxer,U=this.remuxer;if(!y||!U)return;y.resetInitSegment(f,C,E),U.resetInitSegment(g,f,C)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(g,f,C,E,y){var U;return f&&f.method==="SAMPLE-AES"?U=this.transmuxSampleAes(g,f,C,E,y):U=this.transmuxUnencrypted(g,C,E,y),U},v.transmuxUnencrypted=function(g,f,C,E){var y=this.demuxer.demux(g,f,!1,!this.config.progressive),U=y.audioTrack,j=y.avcTrack,A=y.id3Track,G=y.textTrack,W=this.remuxer.remux(U,j,A,G,f,C,!1,this.id);return{remuxResult:W,chunkMeta:E}},v.transmuxSampleAes=function(g,f,C,E,y){var U=this;return this.demuxer.demuxSampleAes(g,f,C).then(function(j){var A=U.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,C,E,!1,U.id);return{remuxResult:A,chunkMeta:y}})},v.configureTransmuxer=function(g,f){for(var C=this.config,E=this.observer,y=this.typeSupported,U=this.vendor,j=f.audioCodec,A=f.defaultInitPts,G=f.duration,W=f.initSegmentData,O=f.videoCodec,V,te=0,ae=r.length;te0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(b=v),b}var S=function(v){return{remuxResult:{},chunkMeta:v}};function x(w){return"then"in w&&w.then instanceof Function}var T=function(v,b,g,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=b,this.initSegmentData=g,this.duration=f,this.defaultInitPts=C},R=function(v,b,g,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=b,this.accurateTimeOffset=g,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"discardEPB",function(){return S});var X=M("./src/demux/adts.ts"),F=M("./src/demux/mpegaudio.ts"),I=M("./src/demux/exp-golomb.ts"),H=M("./src/demux/id3.ts"),N=M("./src/demux/sample-aes.ts"),n=M("./src/events.ts"),P=M("./src/utils/mp4-tools.ts"),p=M("./src/utils/logger.ts"),m=M("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},u=function(){function x(R,w,v){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=w,this.typeSupported=v}x.probe=function(w){var v=x.syncOffset(w);return v<0?!1:(v&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},x.syncOffset=function(w){for(var v=Math.min(1e3,w.length-3*188),b=0;b>4,Ee=void 0;if(He>1){if(Ee=Oe+5+w[Oe+4],Ee===Oe+188)continue}else Ee=Oe+4;switch(Pe){case U:Ce&&(j&&(f=a(j))&&this.parseAVCPES(f,!1),j={data:[],size:0}),j&&(j.data.push(w.subarray(Ee,Oe+188)),j.size+=Oe+188-Ee);break;case A:Ce&&(W&&(f=a(W))&&(E.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),W={data:[],size:0}),W&&(W.data.push(w.subarray(Ee,Oe+188)),W.size+=Oe+188-Ee);break;case G:Ce&&(O&&(f=a(O))&&this.parseID3PES(f),O={data:[],size:0}),O&&(O.data.push(w.subarray(Ee,Oe+188)),O.size+=Oe+188-Ee);break;case 0:Ce&&(Ee+=w[Ee]+1),ae=this._pmtId=h(w,Ee);break;case ae:{Ce&&(Ee+=w[Ee]+1);var be=r(w,Ee,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);U=be.avc,U>0&&(C.pid=U),A=be.audio,A>0&&(E.pid=A,E.isAAC=be.isAAC),G=be.id3,G>0&&(y.pid=G),V&&!te&&(p.logger.log("reparse from beginning"),V=!1,Oe=Re-188),te=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=j,E.pesData=W,y.pesData=O;var Ke={audioTrack:E,avcTrack:C,id3Track:y,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(Ke),Ke},T.flush=function(){var w=this.remainderData;this.remainderData=null;var v;return w?v=this.demux(w,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},T.extractRemainingSamples=function(w){var v=w.audioTrack,b=w.avcTrack,g=w.id3Track,f=b.pesData,C=v.pesData,E=g.pesData,y;f&&(y=a(f))?(this.parseAVCPES(y,!0),b.pesData=null):b.pesData=f,C&&(y=a(C))?(v.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),v.pesData=null):(C!=null&&C.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=C),E&&(y=a(E))?(this.parseID3PES(y),g.pesData=null):g.pesData=E},T.demuxSampleAes=function(w,v,b){var g=this.demux(w,b,!0,!this.config.progressive),f=this.sampleAes=new N.default(this.observer,this.config,v);return this.decrypt(g,f)},T.decrypt=function(w,v){return new Promise(function(b){var g=w.audioTrack,f=w.avcTrack;g.samples&&g.isAAC?v.decryptAacSamples(g.samples,0,function(){f.samples?v.decryptAvcSamples(f.samples,0,0,function(){b(w)}):b(w)}):f.samples&&v.decryptAvcSamples(f.samples,0,0,function(){b(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,v){var b=this,g=this._avcTrack,f=this.parseAVCNALu(w.data),C=!1,E=this.avcSample,y,U=!1;w.data=null,E&&f.length&&!g.audFound&&(i(E,g),E=this.avcSample=o(!1,w.pts,w.dts,"")),f.forEach(function(j){switch(j.type){case 1:{y=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var A=j.data;if(U&&A.length>4){var G=new I.default(A).readSliceType();(G===2||G===4||G===7||G===9)&&(E.key=!0)}break}case 5:y=!0,E||(E=b.avcSample=o(!0,w.pts,w.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{y=!0,C&&E&&(E.debug+="SEI ");var W=new I.default(S(j.data));W.readUByte();for(var O=0,V=0,te=!1,ae=0;!te&&W.bytesAvailable>1;){O=0;do ae=W.readUByte(),O+=ae;while(ae===255);V=0;do ae=W.readUByte(),V+=ae;while(ae===255);if(O===4&&W.bytesAvailable!==0){te=!0;var me=W.readUByte();if(me===181){var Re=W.readUShort();if(Re===49){var Oe=W.readUInt();if(Oe===1195456820){var Ce=W.readUByte();if(Ce===3){for(var Pe=W.readUByte(),He=W.readUByte(),Ee=31&Pe,be=[Pe,He],Ke=0;Ke16){for(var bt=[],Et=0;Et<16;Et++)bt.push(W.readUByte().toString(16)),(Et===3||Et===5||Et===7||Et===9)&&bt.push("-");for(var yt=V-16,pt=new Uint8Array(yt),st=0;st=0){var W={data:w.subarray(A,E-g-1),type:G};C.push(W)}else{var O=this.getLastNalUnit();if(O&&(f&&E<=4-f&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-f))),U=E-g-1,U>0)){var V=new Uint8Array(O.data.byteLength+U);V.set(O.data,0),V.set(w.subarray(0,U),O.data.byteLength),O.data=V,O.state=0}}E=0&&g>=0){var te={data:w.subarray(A,v),type:G,state:g};C.push(te)}if(C.length===0){var ae=this.getLastNalUnit();if(ae){var me=new Uint8Array(ae.data.byteLength+w.byteLength);me.set(ae.data,0),me.set(w,ae.data.byteLength),ae.data=me}}return b.naluState=g,C},T.parseAACPES=function(w){var v=0,b=this._audioTrack,g=this.aacOverFlow,f=w.data;if(g){this.aacOverFlow=null;var C=g.sample.unit.byteLength,E=Math.min(g.missing,C),y=C-E;g.sample.unit.set(f.subarray(0,E),y),b.samples.push(g.sample),v=g.missing}var U,j;for(U=v,j=f.length;U1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}R=f[0];var E=(R[0]<<16)+(R[1]<<8)+R[2];if(E===1){if(w=(R[4]<<8)+R[5],w&&w>x.size-6)return null;var y=R[7];y&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,y&64?(g=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,b-g>60*9e4&&(p.logger.warn(Math.round((b-g)/9e4)+"s delta between PTS and DTS, align them"),b=g)):g=b),v=R[8];var U=v+9;if(x.size<=U)return null;x.size-=U;for(var j=new Uint8Array(x.size),A=0,G=f.length;AW){U-=W;continue}else R=R.subarray(U),W-=U,U=0;j.set(R,T),T+=W}return w&&(w-=v+3),{data:j,pts:b,dts:g,len:w}}return null}function i(x,T){if(x.units.length&&x.frame){if(x.pts===void 0){var R=T.samples,w=R.length;if(w){var v=R[w-1];x.pts=v.pts,x.dts=v.dts}else{T.dropped++;return}}T.samples.push(x)}x.debug.length&&p.logger.log(x.pts+"/"+x.dts+":"+x.debug)}function s(x,T){var R=x.length;if(R>0){if(T.pts>=x[R-1].pts)x.push(T);else for(var w=R-1;w>=0;w--)if(T.ptsb)return f;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,b=this.autoLevelCapping,g;return b===-1&&v&&v.length?g=v.length-1:g=b,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var b=this.audioTrackController;b&&(b.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:o.hlsDefaultConfig},set:function(v){T.defaultConfig=v}}]),T}();x.defaultConfig=void 0},"./src/is-supported.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"isSupported",function(){return I}),M.d(z,"changeTypeSupported",function(){return H});var X=M("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var N=Object(X.getMediaSource)();if(!N)return!1;var n=F(),P=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!P&&!!p}function H(){var N,n=F();return typeof(n==null||((N=n.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return u}),M.d(z,"LoadError",function(){return h});var X=M("./src/polyfills/number.ts"),F=M("./src/errors.ts");function I(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,p(r,a)}function H(r){var a=typeof Map=="function"?new Map:void 0;return H=function(s){if(s===null||!P(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,S)}function S(){return N(s,arguments,m(this).constructor)}return S.prototype=Object.create(s.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p(S,s)},H(r)}function N(r,a,i){return n()?N=Reflect.construct:N=function(S,x,T){var R=[null];R.push.apply(R,x);var w=Function.bind.apply(S,R),v=new w;return T&&p(v,T.prototype),v},N.apply(null,arguments)}function n(){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(r){return!1}}function P(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function p(r,a){return p=Object.setPrototypeOf||function(s,S){return s.__proto__=S,s},p(r,a)}function m(r){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},m(r)}var d=Math.pow(2,17),u=function(){function r(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var a=r.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,S){var x=this,T=s.url;if(!T)return Promise.reject(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var R=this.config,w=R.fLoader,v=R.loader;return new Promise(function(b,g){x.loader&&x.loader.destroy();var f=x.loader=s.loader=w?new w(R):new v(R),C=o(s),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:d};s.stats=f.stats,f.load(C,E,{onSuccess:function(U,j,A,G){x.resetLoader(s,f),b({frag:s,part:null,payload:U.data,networkDetails:G})},onError:function(U,j,A){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:U,networkDetails:A}))},onAbort:function(U,j,A){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:A}))},onTimeout:function(U,j,A){x.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:A}))},onProgress:function(U,j,A,G){S&&S({frag:s,part:null,payload:A,networkDetails:G})}})})},a.loadPart=function(s,S,x){var T=this;this.abort();var R=this.config,w=R.fLoader,v=R.loader;return new Promise(function(b,g){T.loader&&T.loader.destroy();var f=T.loader=s.loader=w?new w(R):new v(R),C=o(s,S),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:d};S.stats=f.stats,f.load(C,E,{onSuccess:function(U,j,A,G){T.resetLoader(s,f),T.updateStatsFromPart(s,S);var W={frag:s,part:S,payload:U.data,networkDetails:G};x(W),b(W)},onError:function(U,j,A){T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:S,response:U,networkDetails:A}))},onAbort:function(U,j,A){s.stats.aborted=S.stats.aborted,T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:S,networkDetails:A}))},onTimeout:function(U,j,A){T.resetLoader(s,f),g(new h({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:S,networkDetails:A}))}})})},a.updateStatsFromPart=function(s,S){var x=s.stats,T=S.stats,R=T.total;if(x.loaded+=T.loaded,R){var w=Math.round(s.duration/S.duration),v=Math.min(Math.round(x.loaded/R),w),b=w-v,g=b*Math.round(x.loaded/v);x.total=x.loaded+g}else x.total=Math.max(x.loaded,x.total);var f=x.loading,C=T.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},a.resetLoader=function(s,S){s.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},r}();function o(r,a){a===void 0&&(a=null);var i=a||r,s={frag:r,part:a,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},S=i.byteRangeStartOffset,x=i.byteRangeEndOffset;return Object(X.isFiniteNumber)(S)&&Object(X.isFiniteNumber)(x)&&(s.rangeStart=S,s.rangeEnd=x),s}var h=function(r){I(a,r);function a(i){for(var s,S=arguments.length,x=new Array(S>1?S-1:0),T=1;T>8*(15-R)&255;return T},s.setDecryptDataFromLevelKey=function(x,T){var R=x;return(x==null?void 0:x.method)==="AES-128"&&x.uri&&!x.iv&&(R=N.LevelKey.fromURI(x.uri),R.method=x.method,R.iv=this.createInitializationVector(T),R.keyFormat="identity"),R},s.setElementaryStreamInfo=function(x,T,R,w,v,b){b===void 0&&(b=!1);var g=this.elementaryStreams,f=g[x];if(!f){g[x]={startPTS:T,endPTS:R,startDTS:w,endDTS:v,partial:b};return}f.startPTS=Math.min(f.startPTS,T),f.endPTS=Math.max(f.endPTS,R),f.startDTS=Math.min(f.startDTS,w),f.endDTS=Math.max(f.endDTS,v)},s.clearElementaryStreamInfo=function(){var x=this.elementaryStreams;x[u.AUDIO]=null,x[u.VIDEO]=null,x[u.AUDIOVIDEO]=null},d(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var x=this.sn;typeof x!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),x=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,x)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var x=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+x*1e3}},{key:"encrypted",get:function(){var x;return!!((x=this.decryptdata)!==null&&x!==void 0&&x.keyFormat&&this.decryptdata.uri)}}]),i}(o),r=function(a){P(i,a);function i(s,S,x,T,R){var w;w=a.call(this,x)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new n.LoadStats,w.duration=s.decimalFloatingPoint("DURATION"),w.gap=s.bool("GAP"),w.independent=s.bool("INDEPENDENT"),w.relurl=s.enumeratedString("URI"),w.fragment=S,w.index=T;var v=s.enumeratedString("BYTERANGE");return v&&w.setByteRange(v,R),R&&(w.fragOffset=R.fragOffset+R.duration),w}return d(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return H});var X=M("./src/events.ts"),F=M("./src/errors.ts"),I=M("./src/utils/logger.ts"),H=function(){function N(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var n=N.prototype;return n._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var m=this.loaders[p];m&&m.destroy()}this.loaders={}},n.onKeyLoading=function(p,m){var d=m.frag,u=d.type,o=this.loaders[u];if(!d.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=d.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(o&&(I.logger.warn("abort previous key loader for type:"+u),o.abort()),!h){I.logger.warn("key uri is falsy");return}var a=r.loader,i=d.loader=this.loaders[u]=new a(r);this.decrypturl=h,this.decryptkey=null;var s={url:h,frag:d,responseType:"arraybuffer"},S={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(s,S,x)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:d}))},n.loadsuccess=function(p,m,d){var u=d.frag;if(!u.decryptdata){I.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(p.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},n.loaderror=function(p,m){var d=m.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:p})},n.loadtimeout=function(p,m){var d=m.frag,u=d.loader;u&&u.abort(),delete this.loaders[d.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},N}()},"./src/loader/level-details.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"LevelDetails",function(){return N});var X=M("./src/polyfills/number.ts");function F(n,P){for(var p=0;pm.endSN||d>0||d===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},I(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var d=this.driftEnd-this.driftStart;return d*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"LevelKey",function(){return N});var X=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(X);function I(n,P){for(var p=0;p2){var g=b.shift()+".";return g+=parseInt(b.shift()).toString(16),g+=("000"+parseInt(b.shift()).toString(16)).substr(-4),g}return v},R.resolve=function(v,b){return F.buildAbsoluteURL(b,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,b){var g=[],f={},C=!1;d.lastIndex=0;for(var E;(E=d.exec(v))!=null;)if(E[1]){var y=new P.AttrList(E[1]),U={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:R.resolve(E[2],b)},j=y.decimalResolution("RESOLUTION");j&&(U.width=j.width,U.height=j.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=R.convertAVC1ToAVCOTI(U.videoCodec)),g.push(U)}else if(E[3]){var A=new P.AttrList(E[3]);A["DATA-ID"]&&(C=!0,f[A["DATA-ID"]]=A)}return{levels:g,sessionData:C?f:null}},R.parseMasterPlaylistMedia=function(v,b,g,f){f===void 0&&(f=[]);var C,E=[],y=0;for(u.lastIndex=0;(C=u.exec(v))!==null;){var U=new P.AttrList(C[1]);if(U.TYPE===g){var j={attrs:U,bitrate:0,id:y++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:g,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?R.resolve(U.URI,b):""};if(f.length){var A=R.findGroup(f,j.groupId)||f[0];S(j,A,"audioCodec"),S(j,A,"textCodec")}E.push(j)}}return E},R.parseLevelPlaylist=function(v,b,g,f,C){var E=new N.LevelDetails(b),y=E.fragments,U=null,j=0,A=0,G=0,W=0,O=null,V=new H.Fragment(f,b),te,ae,me,Re=-1,Oe=!1;for(o.lastIndex=0,E.m3u8=v;(te=o.exec(v))!==null;){Oe&&(Oe=!1,V=new H.Fragment(f,b),V.start=G,V.sn=j,V.cc=W,V.level=g,U&&(V.initSegment=U,V.rawProgramDateTime=U.rawProgramDateTime));var Ce=te[1];if(Ce){V.duration=parseFloat(Ce);var Pe=(" "+te[2]).slice(1);V.title=Pe||null,V.tagList.push(Pe?["INF",Ce,Pe]:["INF",Ce])}else if(te[3])Object(X.isFiniteNumber)(V.duration)&&(V.start=G,me&&(V.levelkey=me),V.sn=j,V.level=g,V.cc=W,V.urlId=C,y.push(V),V.relurl=(" "+te[3]).slice(1),T(V,O),O=V,G+=V.duration,j++,A=0,Oe=!0);else if(te[4]){var He=(" "+te[4]).slice(1);O?V.setByteRange(He,O):V.setByteRange(He)}else if(te[5])V.rawProgramDateTime=(" "+te[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),Re===-1&&(Re=y.length);else{if(te=te[0].match(h),!te){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae-1){p.logger.warn("Keyformat "+Be+" is not supported from the manifest");continue}else if(Be!=="identity")continue;wt&&(me=n.LevelKey.fromURL(b,_e),_e&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(wt)>=0&&(me.method=wt,me.keyFormat=Be,Se&&(me.keyID=Se),ye&&(me.keyFormatVersions=ye),me.iv=Me));break}case"START":{var ot=new P.AttrList(be),ft=ot.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(ft)&&(E.startTimeOffset=ft);break}case"MAP":{var Ct=new P.AttrList(be);V.relurl=Ct.URI,Ct.BYTERANGE&&V.setByteRange(Ct.BYTERANGE),V.level=g,V.sn="initSegment",me&&(V.levelkey=me),V.initSegment=null,U=V,Oe=!0;break}case"SERVER-CONTROL":{var Ot=new P.AttrList(be);E.canBlockReload=Ot.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=Ot.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&Ot.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=Ot.optionalFloat("PART-HOLD-BACK",0),E.holdBack=Ot.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ne=new P.AttrList(be);E.partTarget=Ne.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ke=E.partList;ke||(ke=E.partList=[]);var at=A>0?ke[ke.length-1]:void 0,ct=A++,Ge=new H.Part(new P.AttrList(be),V,b,ct,at);ke.push(Ge),V.duration+=Ge.duration;break}case"PRELOAD-HINT":{var et=new P.AttrList(be);E.preloadHint=et;break}case"RENDITION-REPORT":{var Ae=new P.AttrList(be);E.renditionReports=E.renditionReports||[],E.renditionReports.push(Ae);break}default:p.logger.warn("line parsed but not handled: "+te);break}}}O&&!O.relurl?(y.pop(),G-=O.duration,E.partList&&(E.fragmentHint=O)):E.partList&&(T(V,O),V.cc=W,E.fragmentHint=V);var ve=y.length,xe=y[0],ue=y[ve-1];if(G+=E.skippedSegments*E.targetduration,G>0&&ve&&ue){E.averagetargetduration=G/ve;var fe=ue.sn;E.endSN=fe!=="initSegment"?fe:0,xe&&(E.startCC=xe.cc,xe.initSegment||E.fragments.every(function(de){return de.relurl&&a(de.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new H.Fragment(f,b),V.relurl=ue.relurl,V.level=g,V.sn="initSegment",xe.initSegment=V,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(G+=E.fragmentHint.duration),E.totalduration=G,E.endCC=W,Re>0&&x(y,Re),E},R}();function s(R,w){["video","audio","text"].forEach(function(v){var b=R.filter(function(f){return Object(m.isCodecType)(f,v)});if(b.length){var g=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});w[v+"Codec"]=g.length>0?g[0]:b[0],R=R.filter(function(f){return b.indexOf(f)===-1})}}),w.unknownCodecs=R}function S(R,w,v){var b=w[v];b&&(R[v]=b)}function x(R,w){for(var v=R[w],b=w;b--;){var g=R[b];if(!g)return;g.programDateTime=v.programDateTime-g.duration*1e3,v=g}}function T(R,w){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):w!=null&&w.programDateTime&&(R.programDateTime=w.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/polyfills/number.ts"),F=M("./src/events.ts"),I=M("./src/errors.ts"),H=M("./src/utils/logger.ts"),N=M("./src/utils/mp4-tools.ts"),n=M("./src/loader/m3u8-parser.ts"),P=M("./src/types/loader.ts"),p=M("./src/utils/attr-list.ts");function m(o){var h=o.type;switch(h){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function d(o,h){var r=o.url;return(r===void 0||r.indexOf("data:")===0)&&(r=h.url),r}var u=function(){function o(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var h=o.prototype;return h.registerListeners=function(){var a=this.hls;a.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var a=this.hls;a.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(a){var i=this.hls.config,s=i.pLoader,S=i.loader,x=s||S,T=new x(i);return a.loader=T,this.loaders[a.type]=T,T},h.getInternalLoader=function(a){return this.loaders[a.type]},h.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},h.destroyInternalLoaders=function(){for(var a in this.loaders){var i=this.loaders[a];i&&i.destroy(),this.resetInternalLoader(a)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(a,i){var s=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},h.onLevelLoading=function(a,i){var s=i.id,S=i.level,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:null,level:S,responseType:"text",type:P.PlaylistContextType.LEVEL,url:x,deliveryDirectives:T})},h.onAudioTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:x,deliveryDirectives:T})},h.onSubtitleTrackLoading=function(a,i){var s=i.id,S=i.groupId,x=i.url,T=i.deliveryDirectives;this.load({id:s,groupId:S,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:x,deliveryDirectives:T})},h.load=function(a){var i,s=this.hls.config,S=this.getInternalLoader(a);if(S){var x=S.context;if(x&&x.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),S.abort()}var T,R,w,v;switch(a.type){case P.PlaylistContextType.MANIFEST:T=s.manifestLoadingMaxRetry,R=s.manifestLoadingTimeOut,w=s.manifestLoadingRetryDelay,v=s.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:T=0,R=s.levelLoadingTimeOut;break;default:T=s.levelLoadingMaxRetry,R=s.levelLoadingTimeOut,w=s.levelLoadingRetryDelay,v=s.levelLoadingMaxRetryTimeout;break}if(S=this.createInternalLoader(a),(i=a.deliveryDirectives)!==null&&i!==void 0&&i.part){var b;if(a.type===P.PlaylistContextType.LEVEL&&a.level!==null?b=this.hls.levels[a.level].details:a.type===P.PlaylistContextType.AUDIO_TRACK&&a.id!==null?b=this.hls.audioTracks[a.id].details:a.type===P.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(b=this.hls.subtitleTracks[a.id].details),b){var g=b.partTarget,f=b.targetduration;g&&f&&(R=Math.min(Math.max(g*3,f*.8)*1e3,R))}}var C={timeout:R,maxRetry:T,retryDelay:w,maxRetryDelay:v,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(a,C,E)},h.loadsuccess=function(a,i,s,S){if(S===void 0&&(S=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,i,s,S);return}this.resetInternalLoader(s.type);var x=a.data;if(x.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",S);return}i.parsing.start=performance.now(),x.indexOf("#EXTINF:")>0||x.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,i,s,S):this.handleMasterPlaylist(a,i,s,S)},h.loaderror=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!1,a)},h.loadtimeout=function(a,i,s){s===void 0&&(s=null),this.handleNetworkError(i,s,!0)},h.handleMasterPlaylist=function(a,i,s,S){var x=this.hls,T=a.data,R=d(a,s),w=n.default.parseMasterPlaylist(T,R),v=w.levels,b=w.sessionData;if(!v.length){this.handleManifestParsingError(a,s,"no level found in manifest",S);return}var g=v.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),f=v.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),C=n.default.parseMasterPlaylistMedia(T,R,"AUDIO",g),E=n.default.parseMasterPlaylistMedia(T,R,"SUBTITLES",f),y=n.default.parseMasterPlaylistMedia(T,R,"CLOSED-CAPTIONS");if(C.length){var U=C.some(function(j){return!j.url});!U&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}x.trigger(F.Events.MANIFEST_LOADED,{levels:v,audioTracks:C,subtitles:E,captions:y,url:R,stats:i,networkDetails:S,sessionData:b})},h.handleTrackOrLevelPlaylist=function(a,i,s,S){var x=this.hls,T=s.id,R=s.level,w=s.type,v=d(a,s),b=Object(X.isFiniteNumber)(T)?T:0,g=Object(X.isFiniteNumber)(R)?R:b,f=m(s),C=n.default.parseLevelPlaylist(a.data,v,g,f,b);if(!C.fragments.length){x.trigger(F.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(w===P.PlaylistContextType.MANIFEST){var E={attrs:new p.AttrList({}),bitrate:0,details:C,name:"",url:v};x.trigger(F.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:v,stats:i,networkDetails:S,sessionData:null})}if(i.parsing.end=performance.now(),C.needSidxRanges){var y,U=(y=C.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:U,isSidxRequest:!0,type:w,level:R,levelDetails:C,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=C,this.handlePlaylistLoaded(a,i,s,S)},h.handleSidxRequest=function(a,i){var s=Object(N.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var S=s.references,x=i.levelDetails;S.forEach(function(T,R){var w=T.info,v=x.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),v.initSegment&&v.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(a,i,s,S){this.hls.trigger(F.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===P.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:i,networkDetails:S})},h.handleNetworkError=function(a,i,s,S){s===void 0&&(s=!1),H.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var x=I.ErrorDetails.UNKNOWN,T=!1,R=this.getInternalLoader(a);switch(a.type){case P.PlaylistContextType.MANIFEST:x=s?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case P.PlaylistContextType.LEVEL:x=s?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.AUDIO_TRACK:x=s?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:x=s?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}R&&this.resetInternalLoader(a.type);var w={type:I.ErrorTypes.NETWORK_ERROR,details:x,fatal:T,url:a.url,loader:R,context:a,networkDetails:i};S&&(w.response=S),this.hls.trigger(F.Events.ERROR,w)},h.handlePlaylistLoaded=function(a,i,s,S){var x=s.type,T=s.level,R=s.id,w=s.groupId,v=s.loader,b=s.levelDetails,g=s.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",S);return}if(!v)return;b.live&&(v.getCacheAge&&(b.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(x){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:b,level:T||0,id:R||0,stats:i,networkDetails:S,deliveryDirectives:g});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:g});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:i,networkDetails:S,deliveryDirectives:g});break}},o}();z.default=u},"./src/polyfills/number.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"isFiniteNumber",function(){return X}),M.d(z,"MAX_SAFE_INTEGER",function(){return F});var X=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,z,M){"use strict";M.r(z);var X=function(){function F(){}return F.getSilentFrame=function(H,N){switch(H){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===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(N===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(N===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(N===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(N===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},F}();z.default=X},"./src/remux/mp4-generator.ts":function(Z,z,M){"use strict";M.r(z);var X=Math.pow(2,32)-1,F=function(){function I(){}return I.init=function(){I.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 N;for(N in I.types)I.types.hasOwnProperty(N)&&(I.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.charCodeAt(3)]);var n=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]),P=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]);I.HDLR_TYPES={video:n,audio:P};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);I.STTS=I.STSC=I.STCO=m,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var d=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,d,o,d,u),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,p))},I.box=function(N){for(var n=8,P=arguments.length,p=new Array(P>1?P-1:0),m=1;m>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(N,4),d=0,n=8;d>24&255,N>>16&255,N>>8&255,N&255,P>>24,P>>16&255,P>>8&255,P&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},I.mdia=function(N){return I.box(I.types.mdia,I.mdhd(N.timescale,N.duration),I.hdlr(N.type),I.minf(N))},I.mfhd=function(N){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},I.minf=function(N){return N.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(N)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(N))},I.moof=function(N,n,P){return I.box(I.types.moof,I.mfhd(N),I.traf(P,n))},I.moov=function(N){for(var n=N.length,P=[];n--;)P[n]=I.trak(N[n]);return I.box.apply(null,[I.types.moov,I.mvhd(N[0].timescale,N[0].duration)].concat(P).concat(I.mvex(N)))},I.mvex=function(N){for(var n=N.length,P=[];n--;)P[n]=I.trex(N[n]);return I.box.apply(null,[I.types.mvex].concat(P))},I.mvhd=function(N,n){n*=N;var P=Math.floor(n/(X+1)),p=Math.floor(n%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,P>>24,P>>16&255,P>>8&255,P&255,p>>24,p>>16&255,p>>8&255,p&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return I.box(I.types.mvhd,m)},I.sdtp=function(N){var n=N.samples||[],P=new Uint8Array(4+n.length),p,m;for(p=0;p>>8&255),n.push(d&255),n=n.concat(Array.prototype.slice.call(m));for(p=0;p>>8&255),P.push(d&255),P=P.concat(Array.prototype.slice.call(m));var u=I.box(I.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|N.sps.length].concat(n).concat([N.pps.length]).concat(P))),o=N.width,h=N.height,r=N.pixelRatio[0],a=N.pixelRatio[1];return I.box(I.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,o>>8&255,o&255,h>>8&255,h&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]),u,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,a>>24,a>>16&255,a>>8&255,a&255])))},I.esds=function(N){var n=N.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(N.config).concat([6,1,2]))},I.mp4a=function(N){var n=N.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),I.box(I.types.esds,I.esds(N)))},I.mp3=function(N){var n=N.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},I.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(N)):I.box(I.types.stsd,I.STSD,I.mp4a(N)):I.box(I.types.stsd,I.STSD,I.avc1(N))},I.tkhd=function(N){var n=N.id,P=N.duration*N.timescale,p=N.width,m=N.height,d=Math.floor(P/(X+1)),u=Math.floor(P%(X+1));return I.box(I.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,p>>8&255,p&255,0,0,m>>8&255,m&255,0,0]))},I.traf=function(N,n){var P=I.sdtp(N),p=N.id,m=Math.floor(n/(X+1)),d=Math.floor(n%(X+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),I.box(I.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,d>>24,d>>16&255,d>>8&255,d&255])),I.trun(N,P.length+16+20+8+16+8+8),P)},I.trak=function(N){return N.duration=N.duration||4294967295,I.box(I.types.trak,I.tkhd(N),I.mdia(N))},I.trex=function(N){var n=N.id;return I.box(I.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},I.trun=function(N,n){var P=N.samples||[],p=P.length,m=12+16*p,d=new Uint8Array(m),u,o,h,r,a,i;for(n+=8+m,d.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),u=0;u>>24&255,h>>>16&255,h>>>8&255,h&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*u);return I.box(I.types.trun,d)},I.initSegment=function(N){I.types||I.init();var n=I.moov(N),P=new Uint8Array(I.FTYP.byteLength+n.byteLength);return P.set(I.FTYP),P.set(n,I.FTYP.byteLength),P},I}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,z.default=F},"./src/remux/mp4-remuxer.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return i}),M.d(z,"normalizePts",function(){return s});var X=M("./src/polyfills/number.ts"),F=M("./src/remux/aac-helper.ts"),I=M("./src/remux/mp4-generator.ts"),H=M("./src/events.ts"),N=M("./src/errors.ts"),n=M("./src/utils/logger.ts"),P=M("./src/types/loader.ts"),p=M("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(R){for(var w=1;w0?C:E.pts},b[0].pts);return g&&n.logger.debug("PTS rollover detected"),f},w.remux=function(b,g,f,C,E,y,U,j){var A,G,W,O,V,te,ae=E,me=E,Re=b.pid>-1,Oe=g.pid>-1,Ce=g.samples.length,Pe=b.samples.length>0,He=Ce>1,Ee=(!Re||Pe)&&(!Oe||He)||this.ISGenerated||U;if(Ee){this.ISGenerated||(W=this.generateIS(b,g,E));var be=this.isVideoContiguous,Ke=-1;if(He&&(Ke=S(g.samples),!be&&this.config.forceKeyFrameOnDiscontinuity))if(te=!0,Ke>0){n.logger.warn("[mp4-remuxer]: Dropped "+Ke+" out of "+Ce+" video samples due to a missing keyframe");var bt=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(Ke),g.dropped+=Ke,me+=(g.samples[0].pts-bt)/(g.timescale||9e4)}else Ke===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ce+" video samples"),te=!1);if(this.ISGenerated){if(Pe&&He){var Et=this.getVideoStartPts(g.samples),yt=s(b.samples[0].pts,Et)-Et,pt=yt/g.inputTimeScale;ae+=Math.max(0,pt),me+=Math.max(0,-pt)}if(Pe){if(b.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),W=this.generateIS(b,g,E)),G=this.remuxAudio(b,ae,this.isAudioContiguous,y,Oe||He||j===P.PlaylistLevelType.AUDIO?me:void 0),He){var st=G?G.endPTS-G.startPTS:0;g.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),W=this.generateIS(b,g,E)),A=this.remuxVideo(g,me,be,st)}}else He&&(A=this.remuxVideo(g,me,be,0));A&&(A.firstKeyFrame=Ke,A.independent=Ke!==-1)}}return this.ISGenerated&&(f.samples.length&&(V=this.remuxID3(f,E)),C.samples.length&&(O=this.remuxText(C,E))),{audio:G,video:A,initSegment:W,independent:te,text:O,id3:V}},w.generateIS=function(b,g,f){var C=b.samples,E=g.samples,y=this.typeSupported,U={},j=!Object(X.isFiniteNumber)(this._initPTS),A="audio/mp4",G,W,O;if(j&&(G=W=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(y.mpeg?(A="audio/mpeg",b.codec=""):y.mp3&&(b.codec="mp3")),U.audio={id:"audio",container:A,codec:b.codec,initSegment:!b.isAAC&&y.mpeg?new Uint8Array(0):I.default.initSegment([b]),metadata:{channelCount:b.channelCount}},j&&(O=b.inputTimeScale,G=W=C[0].pts-Math.round(O*f))),g.sps&&g.pps&&E.length&&(g.timescale=g.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:I.default.initSegment([g]),metadata:{width:g.width,height:g.height}},j)){O=g.inputTimeScale;var V=this.getVideoStartPts(E),te=Math.round(O*f);W=Math.min(W,s(E[0].dts,V)-te),G=Math.min(G,V-te)}if(Object.keys(U).length)return this.ISGenerated=!0,j&&(this._initPTS=G,this._initDTS=W),{tracks:U,initPTS:G,timescale:O}},w.remuxVideo=function(b,g,f,C){var E=b.inputTimeScale,y=b.samples,U=[],j=y.length,A=this._initPTS,G=this.nextAvcDts,W=8,O,V,te,ae=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,Re=0,Oe=!1;if(!f||G===null){var Ce=g*E,Pe=y[0].pts-s(y[0].dts,y[0].pts);G=Ce-Pe}for(var He=0;HeEe.pts){var be=9e4*.2;Re=Math.max(Math.min(Re,Ee.pts-Ee.dts),-1*be)}Ee.dts0?He-1:He].dts&&(Oe=!0)}Oe&&y.sort(function(St,qe){var rt=St.dts-qe.dts,Ye=St.pts-qe.pts;return rt||Ye}),V=y[0].dts,te=y[y.length-1].dts;var Ke=Math.round((te-V)/(j-1));if(Re<0){if(ReKe,ht=pt<-1;if(st||ht){st?n.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(pt,!0)+" ms ("+pt+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-pt,!0)+" ms ("+pt+"dts) overlapping between fragments detected"),V=G;var wt=y[0].pts-pt;y[0].dts=V,y[0].pts=wt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(wt,!0)+"/"+Object(p.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(pt,!0)+" ms")}}a&&(V=Math.max(0,V));for(var _e=0,Me=0,ye=0;ye0?ke-1:ke].dts;if(fe.stretchShortVideoTrack&&this.nextAudioPts!==null){var we=Math.floor(fe.maxBufferHole*E),Le=(C?ae+C*E:this.nextAudioPts)-at.pts;Le>we?(O=Le-de,O<0&&(O=de),n.logger.log("[mp4-remuxer]: It is approximately "+Le/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=de}else O=de}var ze=Math.round(at.pts-at.dts);U.push(new x(at.key,O,Ge,ze))}if(U.length&&h&&h<70){var dt=U[0].flags;dt.dependsOn=2,dt.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=te+O,this.isVideoContiguous=!0;var Lt=I.default.moof(b.sequenceNumber++,V,m({},b,{samples:U})),Ft="video",kt={data1:Lt,data2:Ot,startPTS:ae/E,endPTS:(me+O)/E,startDTS:V/E,endDTS:G/E,type:Ft,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(Ot.length,"MDAT length must not be zero"),kt},w.remuxAudio=function(b,g,f,C,E){var y=b.inputTimeScale,U=b.samplerate?b.samplerate:y,j=y/U,A=b.isAAC?u:o,G=A*j,W=this._initPTS,O=!b.isAAC&&this.typeSupported.mpeg,V=[],te=b.samples,ae=O?0:8,me=this.nextAudioPts||-1,Re=g*y;if(this.isAudioContiguous=f=f||te.length&&me>0&&(C&&Math.abs(Re-me)<9e3||Math.abs(s(te[0].pts-W,Re)-me)<20*G),te.forEach(function(xe){xe.pts=s(xe.pts-W,Re)}),!f||me<0){if(te=te.filter(function(xe){return xe.pts>=0}),!te.length)return;E===0?me=0:C?me=Math.max(0,Re):me=te[0].pts}if(b.isAAC)for(var Oe=E!==void 0,Ce=this.config.maxAudioFramesDrift,Pe=0,He=me;Pe=Ce*G&&bt0){Me+=ae;try{_e=new Uint8Array(Me)}catch(xe){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Me,reason:"fail allocating audio mdat "+Me});return}if(!O){var Ot=new DataView(_e.buffer);Ot.setUint32(0,Me),_e.set(I.default.types.mdat,4)}}else return;_e.set(ot,ae);var Ne=ot.byteLength;ae+=Ne,V.push(new x(!0,A,Ne,0)),wt=ft}var ke=V.length;if(!ke)return;var at=V[V.length-1];this.nextAudioPts=me=wt+j*at.duration;var ct=O?new Uint8Array(0):I.default.moof(b.sequenceNumber++,ht/j,m({},b,{samples:V}));b.samples=[];var Ge=ht/y,et=me/y,Ae="audio",ve={data1:ct,data2:_e,startPTS:Ge,endPTS:et,startDTS:Ge,endDTS:et,type:Ae,hasAudio:!0,hasVideo:!1,nb:ke};return this.isAudioContiguous=!0,console.assert(_e.length,"MDAT length must not be zero"),ve},w.remuxEmptyAudio=function(b,g,f,C){var E=b.inputTimeScale,y=b.samplerate?b.samplerate:E,U=E/y,j=this.nextAudioPts,A=(j!==null?j:C.startDTS*E)+this._initDTS,G=C.endDTS*E+this._initDTS,W=U*u,O=Math.ceil((G-A)/W),V=F.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var te=[],ae=0;ae4294967296;)R+=v;return R}function S(R){for(var w=0;w0?this.lastEndDTS=b:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!R.audio,f=!!R.video,C="";g&&(C+="audio"),f&&(C+="video");var E={data1:x,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:C,hasAudio:g,hasVideo:f,nb:1,dropped:0};return S.audio=E.type==="audio"?E:void 0,S.video=E.type!=="audio"?E:void 0,S.text=r,S.id3=h,S.initSegment=T,S},p}(),n=function(m,d,u){return Object(F.getStartDTS)(m,d)-u};function P(p,m){var d=p==null?void 0:p.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||m===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}z.default=N},"./src/task-loop.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"default",function(){return X});var X=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=F.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},F}()},"./src/types/cmcd.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"CMCDVersion",function(){return X}),M.d(z,"CMCDObjectType",function(){return F}),M.d(z,"CMCDStreamingFormat",function(){return I}),M.d(z,"CMCDStreamType",function(){return H});var X=1,F;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(F||(F={}));var I;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(I||(I={}));var H;(function(N){N.VOD="v",N.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"HlsSkip",function(){return I}),M.d(z,"getSkipValue",function(){return H}),M.d(z,"HlsUrlParameters",function(){return N}),M.d(z,"Level",function(){return n});function X(P,p){for(var m=0;mNumber.MAX_SAFE_INTEGER?Infinity:p},N.hexadecimalInteger=function(P){if(this[P]){var p=(this[P]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var m=new Uint8Array(p.length/2),d=0;dNumber.MAX_SAFE_INTEGER?Infinity:p},N.decimalFloatingPoint=function(P){return parseFloat(this[P])},N.optionalFloat=function(P,p){var m=this[P];return m?parseFloat(m):p},N.enumeratedString=function(P){return this[P]},N.bool=function(P){return this[P]==="YES"},N.decimalResolution=function(P){var p=X.exec(this[P]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},H.parseAttrList=function(P){var p,m={},d='"';for(F.lastIndex=0;(p=F.exec(P))!==null;){var u=p[2];u.indexOf(d)===0&&u.lastIndexOf(d)===u.length-1&&(u=u.slice(1,-1)),m[p[1]]=u}return m},H}()},"./src/utils/binary-search.ts":function(Z,z,M){"use strict";M.r(z);var X={search:function(I,H){for(var N=0,n=I.length-1,P=null,p=null;N<=n;){P=(N+n)/2|0,p=I[P];var m=H(p);if(m>0)N=P+1;else if(m<0)n=P-1;else return p}return null}};z.default=X},"./src/utils/buffer-helper.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"BufferHelper",function(){return I});var X=M("./src/utils/logger.ts"),F={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function H(){}return H.isBuffered=function(n,P){try{if(n){for(var p=H.getBuffered(n),m=0;m=p.start(m)&&P<=p.end(m))return!0}}catch(d){}return!1},H.bufferInfo=function(n,P,p){try{if(n){var m=H.getBuffered(n),d=[],u;for(u=0;uo&&(m[u-1].end=n[d].end):m.push(n[d])}else m.push(n[d])}else m=n;for(var h=0,r,a=P,i=P,s=0;s=S&&P=f&&X.logger.log(this.time+" ["+f+"] "+C)},v}(),h=function(b){for(var g=[],f=0;fN&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},b.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var E=this.pos+1;E=144&&this.backSpace();var C=I(f);if(this.pos>=N){this.logger.log(u.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var C;for(C=f;C0&&(f?E="["+C.join(" | ")+"]":E=C.join(` `)),E},b.getTextAndFormat=function(){return this.rows},v}(),S=function(){function v(g,f,C){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=g,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new s(C),this.nonDisplayedMemory=new s(C),this.lastOutputScreen=new s(C),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=v.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(u.INFO,"MODE="+f),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=f},b.insertChars=function(f){for(var C=0;C=46,C.italics)C.foreground="white";else{var E=Math.floor(f/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=y[E]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},v}(),x=function(){function v(g,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new S(g,f,E),new S(g+1,C,E)],this.cmdHistory=w(),this.logger=E}var b=v.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,C){this.channels[f].setHandler(C)},b.addData=function(f,C){var E,y,U,j=!1;this.logger.time=f;for(var A=0;A ("+h([y,U])+")"),E=this.parseCmd(y,U),E||(E=this.parseMidrow(y,U)),E||(E=this.parsePAC(y,U)),E||(E=this.parseBackgroundAttributes(y,U)),!E&&(j=this.parseChars(y,U),j)){var G=this.currentChannel;if(G&&G>0){var W=this.channels[G];W.insertChars(j)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!j&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+h([y,U])+" orig: "+h([C[A],C[A+1]]))}},b.parseCmd=function(f,C){var E=this.cmdHistory,y=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,U=(f===23||f===31)&&C>=33&&C<=35;if(!(y||U))return!1;if(R(f,C,E))return T(null,null,E),this.logger.log(u.DEBUG,"Repeated command ("+h([f,C])+") is dropped"),!0;var j=f===20||f===21||f===23?1:2,A=this.channels[j];return f===20||f===21||f===28||f===29?C===32?A.ccRCL():C===33?A.ccBS():C===34?A.ccAOF():C===35?A.ccAON():C===36?A.ccDER():C===37?A.ccRU(2):C===38?A.ccRU(3):C===39?A.ccRU(4):C===40?A.ccFON():C===41?A.ccRDC():C===42?A.ccTR():C===43?A.ccRTD():C===44?A.ccEDM():C===45?A.ccCR():C===46?A.ccENM():C===47&&A.ccEOC():A.ccTO(C-32),T(f,C,E),this.currentChannel=j,!0},b.parseMidrow=function(f,C){var E=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[E];return y?(y.ccMIDROW(C),this.logger.log(u.DEBUG,"MIDROW ("+h([f,C])+")"),!0):!1}return!1},b.parsePAC=function(f,C){var E,y=this.cmdHistory,U=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,j=(f===16||f===24)&&C>=64&&C<=95;if(!(U||j))return!1;if(R(f,C,y))return T(null,null,y),!0;var A=f<=23?1:2;C>=64&&C<=95?E=A===1?n[f]:p[f]:E=A===1?P[f]:m[f];var G=this.channels[A];return G?(G.setPAC(this.interpretPAC(E,C)),T(f,C,y),this.currentChannel=A,!0):!1},b.interpretPAC=function(f,C){var E,y={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?E=C-96:E=C-64,y.underline=(E&1)===1,E<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((E-16)/2)*4,y},b.parseChars=function(f,C){var E,y=null,U=null;if(f>=25?(E=2,U=f-8):(E=1,U=f),U>=17&&U<=19){var j;U===17?j=C+80:U===18?j=C+112:j=C+144,this.logger.log(u.INFO,"Special char '"+I(j)+"' in channel "+E),y=[j]}else f>=32&&f<=127&&(y=C===0?[f]:[f,C]);if(y){var A=h(y);this.logger.log(u.DEBUG,"Char codes = "+A.join(",")),T(f,C,this.cmdHistory)}return y},b.parseBackgroundAttributes=function(f,C){var E=(f===16||f===24)&&C>=32&&C<=47,y=(f===23||f===31)&&C>=45&&C<=47;if(!(E||y))return!1;var U,j={};f===16||f===24?(U=Math.floor((C-32)/2),j.background=d[U],C%2===1&&(j.background=j.background+"_semi")):C===45?j.background="transparent":(j.foreground="black",C===47&&(j.underline=!0));var A=f<=23?1:2,G=this.channels[A];return G.setBkgData(j),T(f,C,this.cmdHistory),!0},b.reset=function(){for(var f=0;f=16?a--:a++;var T=Object(X.fixLineBreaks)(i.trim()),R=Object(F.generateCueId)(p,m,T);(!P||!P.cues||!P.cues.getCueById(R))&&(h=new s(p,m,T),h.id=R,h.line=S+1,h.align="left",h.position=10+Math.min(80,Math.floor(a*8/32)*10),u.push(h))}return P&&u.length&&(u.sort(function(w,v){return w.line==="auto"||v.line==="auto"?0:w.line>8&&v.line>8?v.line-w.line:w.line-v.line}),u.forEach(function(w){return Object(I.addCueToTrack)(P,w)})),u}};z.default=N},"./src/utils/discontinuities.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"findFirstFragWithCC",function(){return H}),M.d(z,"shouldAlignOnDiscontinuities",function(){return N}),M.d(z,"findDiscontinuousReferenceFrag",function(){return n}),M.d(z,"adjustSlidingStart",function(){return p}),M.d(z,"alignStream",function(){return m}),M.d(z,"alignPDT",function(){return u}),M.d(z,"alignFragmentByPDTDelta",function(){return o}),M.d(z,"alignMediaPlaylistByPDT",function(){return h});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/logger.ts"),I=M("./src/controller/level-helper.ts");function H(r,a){for(var i=null,s=0,S=r.length;si.startCC||r&&r.cc=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},I}();z.default=F},"./src/utils/ewma.ts":function(Z,z,M){"use strict";M.r(z);var X=function(){function F(H,N,n){N===void 0&&(N=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=N,this.totalWeight_=n}var I=F.prototype;return I.sample=function(N,n){var P=Math.pow(this.alpha_,N);this.estimate_=n*(1-P)+P*this.estimate_,this.totalWeight_+=N},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},F}();z.default=X},"./src/utils/fetch-loader.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"fetchSupported",function(){return o});var X=M("./src/polyfills/number.ts"),F=M("./src/loader/load-stats.ts"),I=M("./src/demux/chunk-cache.ts");function H(s,S){s.prototype=Object.create(S.prototype),s.prototype.constructor=s,m(s,S)}function N(s){var S=typeof Map=="function"?new Map:void 0;return N=function(T){if(T===null||!p(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(T))return S.get(T);S.set(T,R)}function R(){return n(T,arguments,d(this).constructor)}return R.prototype=Object.create(T.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,T)},N(s)}function n(s,S,x){return P()?n=Reflect.construct:n=function(R,w,v){var b=[null];b.push.apply(b,w);var g=Function.bind.apply(R,b),f=new g;return v&&m(f,v.prototype),f},n.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function p(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function m(s,S){return m=Object.setPrototypeOf||function(T,R){return T.__proto__=R,T},m(s,S)}function d(s){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},d(s)}function u(){return u=Object.assign||function(s){for(var S=1;S=v&&b(R,w,g.flush(),T)):b(R,w,U,T),E()}).catch(function(){return Promise.reject()})};return C()},s}();function r(s,S){var x={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&x.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),x}function a(s,S){return new self.Request(s.url,S)}var i=function(s){H(S,s);function S(x,T,R){var w;return w=s.call(this,x)||this,w.code=void 0,w.details=void 0,w.code=T,w.details=R,w}return S}(N(Error));z.default=h},"./src/utils/imsc1-ttml-parser.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"IMSC1_CODEC",function(){return p}),M.d(z,"parseIMSC1",function(){return o});var X=M("./src/utils/mp4-tools.ts"),F=M("./src/utils/vttparser.ts"),I=M("./src/utils/vttcue.ts"),H=M("./src/demux/id3.ts"),N=M("./src/utils/timescale-conversion.ts"),n=M("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(v){for(var b=1;b"):X}function N(p){for(var m=arguments.length,d=new Array(m>1?m-1:0),u=1;u>24,S[x+1]=T>>16&255,S[x+2]=T>>8&255,S[x+3]=T&255}function m(S,x){var T=[];if(!x.length)return T;var R,w,v;"data"in S?(R=S.data,w=S.start,v=S.end):(R=S,w=0,v=R.byteLength);for(var b=w;b1?b+g:v;if(f===x[0])if(x.length===1)T.push({data:R,start:b+8,end:C});else{var E=m({data:R,start:b+8,end:C},x.slice(1));E.length&&H.apply(T,E)}b=C}return T}function d(S){var x=m(S,["moov"]),T=x[0],R=T?T.end:null,w=m(S,["sidx"]);if(!w||!w[0])return null;var v=[],b=w[0],g=b.data[0],f=g===0?8:16,C=P(b,f);f+=4;var E=0,y=0;g===0?f+=8:f+=16,f+=2;var U=b.end+y,j=n(b,f);f+=2;for(var A=0;A>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var te=P(b,G);G+=4,v.push({referenceSize:O,subsegmentDuration:te,info:{duration:te/C,start:U,end:U+O-1}}),U+=O,G+=4,f=G}return{earliestPresentationTime:E,timescale:C,version:g,referencesCount:j,references:v,moovEndOffset:R}}function u(S){for(var x=[],T=m(S,["moov","trak"]),R=0;RN)&&(this.startTime=N),this.endTime=n,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},F}()},"./src/utils/texttrack-utils.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"sendAddTrackEvent",function(){return F}),M.d(z,"addCueToTrack",function(){return I}),M.d(z,"clearCurrentCues",function(){return H}),M.d(z,"removeCuesInRange",function(){return N}),M.d(z,"getCuesInRange",function(){return P});var X=M("./src/utils/logger.ts");function F(p,m){var d;try{d=new Event("addtrack")}catch(u){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=p,m.dispatchEvent(d)}function I(p,m){var d=p.mode;if(d==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(m.id))try{if(p.addCue(m),!p.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(o){X.logger.debug("[texttrack-utils]: "+o);var u=new self.TextTrackCue(m.startTime,m.endTime,m.text);u.id=m.id,p.addCue(u)}d==="disabled"&&(p.mode=d)}function H(p){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues)for(var d=p.cues.length;d--;)p.removeCue(p.cues[d]);m==="disabled"&&(p.mode=m)}function N(p,m,d){var u=p.mode;if(u==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var o=P(p.cues,m,d),h=0;hp[d].endTime)return-1;for(var u=0,o=d;u<=o;){var h=Math.floor((o+u)/2);if(mp[h].startTime&&u-1)for(var h=o,r=p.length;h=m&&a.endTime<=d)u.push(a);else if(a.startTime>d)return u}return u}},"./src/utils/time-ranges.ts":function(Z,z,M){"use strict";M.r(z);var X={toString:function(I){for(var H="",N=I.length,n=0;n1?m-1:0),u=1;u100)throw new Error("Position must be between 0 and 100.");v=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",n({},o,{get:function(){return b},set:function(E){var y=N(E);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");b=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",n({},o,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",n({},o,{get:function(){return f},set:function(E){var y=N(E);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");f=y,this.hasBeenReset=!0}})),u.displayState=void 0}return P.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"parseTimeStamp",function(){return I}),M.d(z,"fixLineBreaks",function(){return m}),M.d(z,"VTTParser",function(){return d});var X=M("./src/utils/vttcue.ts"),F=function(){function u(){}var o=u.prototype;return o.decode=function(r,a){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},u}();function I(u){function o(r,a,i,s){return(r|0)*3600+(a|0)*60+(i|0)+parseFloat(s||0)}var h=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?o(h[2],h[3],0,h[4]):o(h[1],h[2],h[3],h[4]):null}var H=function(){function u(){this.values=Object.create(null)}var o=u.prototype;return o.set=function(r,a){!this.get(r)&&a!==""&&(this.values[r]=a)},o.get=function(r,a,i){return i?this.has(r)?this.values[r]:a[i]:this.has(r)?this.values[r]:a},o.has=function(r){return r in this.values},o.alt=function(r,a,i){for(var s=0;s=0&&i<=100)return this.set(r,i),!0}return!1},u}();function N(u,o,h,r){var a=r?u.split(r):[u];for(var i in a){if(typeof a[i]!="string")continue;var s=a[i].split(h);if(s.length!==2)continue;var S=s[0],x=s[1];o(S,x)}}var n=new X.default(0,0,""),P=n.align==="middle"?"middle":"center";function p(u,o,h){var r=u;function a(){var S=I(u);if(S===null)throw new Error("Malformed timestamp: "+r);return u=u.replace(/^[^\sa-zA-Z-]+/,""),S}function i(S,x){var T=new H;N(S,function(v,b){var g;switch(v){case"region":for(var f=h.length-1;f>=0;f--)if(h[f].id===b){T.set(v,h[f].region);break}break;case"vertical":T.alt(v,b,["rl","lr"]);break;case"line":g=b.split(","),T.integer(v,g[0]),T.percent(v,g[0])&&T.set("snapToLines",!1),T.alt(v,g[0],["auto"]),g.length===2&&T.alt("lineAlign",g[1],["start",P,"end"]);break;case"position":g=b.split(","),T.percent(v,g[0]),g.length===2&&T.alt("positionAlign",g[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":T.percent(v,b);break;case"align":T.alt(v,b,["start",P,"end","left","right"]);break}},/:/,/\s/),x.region=T.get("region",null),x.vertical=T.get("vertical","");var R=T.get("line","auto");R==="auto"&&n.line===-1&&(R=-1),x.line=R,x.lineAlign=T.get("lineAlign","start"),x.snapToLines=T.get("snapToLines",!0),x.size=T.get("size",100),x.align=T.get("align",P);var w=T.get("position","auto");w==="auto"&&n.position===50&&(w=x.align==="start"||x.align==="left"?0:x.align==="end"||x.align==="right"?100:50),x.position=w}function s(){u=u.replace(/^\s+/,"")}if(s(),o.startTime=a(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);u=u.substr(3),s(),o.endTime=a(),s(),i(u,o)}function m(u){return u.replace(//gi,` `)}var d=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new F,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=u.prototype;return o.parse=function(r){var a=this;r&&(a.buffer+=a.decoder.decode(r,{stream:!0}));function i(){var w=a.buffer,v=0;for(w=m(w);v")===-1){a.cue.id=S;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{p(S,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var R=S.indexOf("-->")!==-1;if(!S||R&&(T=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=` `),a.cue.text+=S}continue;case"BADCUE":S||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=` `,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){r.onparsingerror&&r.onparsingerror(a)}return r.onflush&&r.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(Z,z,M){"use strict";M.r(z),M.d(z,"generateCueId",function(){return d}),M.d(z,"parseWebVTT",function(){return o});var X=M("./src/polyfills/number.ts"),F=M("./src/utils/vttparser.ts"),I=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),N=M("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,P=function(r,a,i){return i===void 0&&(i=0),r.substr(i,a.length)===a},p=function(r){var a=parseInt(r.substr(-3)),i=parseInt(r.substr(-6,2)),s=parseInt(r.substr(-9,2)),S=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(i)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return a+=1e3*i,a+=60*1e3*s,a+=60*60*1e3*S,a},m=function(r){for(var a=5381,i=r.length;i;)a=a*33^r.charCodeAt(--i);return(a>>>0).toString()};function d(h,r,a){return m(h.toString())+m(r.toString())+m(a)}var u=function(r,a,i){var s=r[a],S=r[s.prevCC];if(!S||!S.new&&s.new){r.ccOffset=r.presentationOffset=s.start,s.new=!1;return}for(;(x=S)!==null&&x!==void 0&&x.new;){var x;r.ccOffset+=s.start-S.start,s.new=!1,s=S,S=r[s.prevCC]}r.presentationOffset=i};function o(h,r,a,i,s,S,x,T){var R=new F.VTTParser,w=Object(I.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(n,` `).split(` `),v=[],b=Object(H.toMpegTsClockFromTimescale)(r,a),g="00:00.000",f=0,C=0,E,y=!0,U=!1;R.oncue=function(j){var A=i[s],G=i.ccOffset,W=(f-b)/9e4;if(A!=null&&A.new&&(C!==void 0?G=i.ccOffset=A.start:u(i,s,W)),W&&(G=W-i.presentationOffset),U){var O=j.endTime-j.startTime,V=Object(N.normalizePts)((j.startTime+G-C)*9e4,S*9e4)/9e4;j.startTime=V,j.endTime=V+O}var te=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(te)),j.id||(j.id=d(j.startTime,j.endTime,te)),j.endTime>0&&v.push(j)},R.onparsingerror=function(j){E=j},R.onflush=function(){if(E){T(E);return}x(v)},w.forEach(function(j){if(y)if(P(j,"X-TIMESTAMP-MAP=")){y=!1,U=!0,j.substr(16).split(",").forEach(function(A){P(A,"LOCAL:")?g=A.substr(6):P(A,"MPEGTS:")&&(f=parseInt(A.substr(7)))});try{C=p(g)/1e3}catch(A){U=!1,E=A}return}else j===""&&(y=!1);R.parse(j+` `)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Z,z,M){"use strict";M.r(z);var X=M("./src/utils/logger.ts"),F=M("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,H=function(){function N(P){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=P?P.xhrSetup:null,this.stats=new F.LoadStats,this.retryDelay=0}var n=N.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},n.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(p,m,d){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=m,this.callbacks=d,this.retryDelay=m.retryDelay,this.loadInternal()},n.loadInternal=function(){var p=this.config,m=this.context;if(!p)return;var d=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var o=this.xhrSetup;try{if(o)try{o(d,m.url)}catch(a){d.open("GET",m.url,!0),o(d,m.url)}d.readyState||d.open("GET",m.url,!0);var h=this.context.headers;if(h)for(var r in h)d.setRequestHeader(r,h[r])}catch(a){this.callbacks.onError({code:d.status,text:a.message},m,d);return}m.rangeEnd&&d.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),d.send()},n.readystatechange=function(){var p=this.context,m=this.loader,d=this.stats;if(!p||!m)return;var u=m.readyState,o=this.config;if(d.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),u===4){m.onreadystatechange=null,m.onprogress=null;var h=m.status;if(h>=200&&h<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var r,a;if(p.responseType==="arraybuffer"?(r=m.response,a=r.byteLength):(r=m.responseText,a=r.length),d.loaded=d.total=a,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(d,p,r,m),!this.callbacks)return;var s={url:m.responseURL,data:r};this.callbacks.onSuccess(s,d,p,m)}else d.retry>=o.maxRetry||h>=400&&h<499?(X.logger.error(h+" while loading "+p.url),this.callbacks.onError({code:h,text:m.statusText},p,m)):(X.logger.warn(h+" while loading "+p.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(p){var m=this.stats;m.loaded=p.loaded,p.lengthComputable&&(m.total=p.total)},n.getCacheAge=function(){var p=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");p=m?parseFloat(m):null}return p},N}();z.default=H}}).default})},vHTk:function(je,ce,D){je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vef1:function(je,ce,D){je.exports={upload:"upload___3GNI5"}},w4Tj:function(je,ce,D){"use strict";D.d(ce,"a",function(){return M});var Z=D("oZsa");function z(X,F){for(;!Object.prototype.hasOwnProperty.call(X,F)&&!(X=Object(Z.a)(X),X===null););return X}function M(X,F,I){return typeof Reflect!="undefined"&&Reflect.get?M=Reflect.get:M=function(N,n,P){var p=z(N,n);if(!p)return;var m=Object.getOwnPropertyDescriptor(p,n);return m.get?m.get.call(P):m.value},M(X,F,I||X)}},wCXF:function(je,ce,D){"use strict";D.d(ce,"a",function(){return ot});var Z=D("rePB"),z=D("VTBJ"),M=D("KQm4"),X=D("U8pU"),F=D("ODXe"),I=D("q1tI"),H=D("TSYQ"),N=D.n(H),n=D("Gytx"),P=D.n(n),p=D("Kwbf"),m=D("t23M"),d=D("qx4F"),u=D("6eGT"),o=D("IBYe"),h=D("Ff2n"),r=D("c+Xe"),a=D("fyJ8"),i=D("biw7");function s(Ne,ke,at,ct,Ge){var et=at[Ne]||{},Ae=at[ke]||{},ve,xe;et.fixed==="left"?ve=ct.left[Ne]:Ae.fixed==="right"&&(xe=ct.right[ke]);var ue=!1,fe=!1,de=!1,we=!1,Le=at[ke+1],ze=at[Ne-1];if(Ge==="rtl"){if(ve!==void 0){var dt=ze&&ze.fixed==="left";we=!dt}else if(xe!==void 0){var Lt=Le&&Le.fixed==="right";de=!Lt}}else if(ve!==void 0){var Ft=Le&&Le.fixed==="left";ue=!Ft}else if(xe!==void 0){var kt=ze&&ze.fixed==="right";fe=!kt}return{fixLeft:ve,fixRight:xe,lastFixLeft:ue,firstFixRight:fe,lastFixRight:de,firstFixLeft:we,isSticky:ct.isSticky}}var S=D("sR1s");function x(Ne){var ke=Ne.cells,at=Ne.stickyOffsets,ct=Ne.flattenColumns,Ge=Ne.rowComponent,et=Ne.cellComponent,Ae=Ne.onHeaderRow,ve=Ne.index,xe=I.useContext(i.a),ue=xe.prefixCls,fe=xe.direction,de;Ae&&(de=Ae(ke.map(function(Le){return Le.column}),ve));var we=Object(S.a)(ke.map(function(Le){return Le.column}));return I.createElement(Ge,Object.assign({},de),ke.map(function(Le,ze){var dt=Le.column,Lt=s(Le.colStart,Le.colEnd,ct,at,fe),Ft;return dt&&dt.onHeaderCell&&(Ft=Le.column.onHeaderCell(dt)),I.createElement(a.a,Object.assign({},Le,{ellipsis:dt.ellipsis,align:dt.align,component:et,prefixCls:ue,key:we[ze]},Lt,{additionalProps:Ft,rowType:"header"}))}))}x.displayName="HeaderRow";var T=x;function R(Ne){var ke=[];function at(Ae,ve){var xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;ke[xe]=ke[xe]||[];var ue=ve,fe=Ae.filter(Boolean).map(function(de){var we={key:de.key,className:de.className||"",children:de.title,column:de,colStart:ue},Le=1,ze=de.children;return ze&&ze.length>0&&(Le=at(ze,ue,xe+1).reduce(function(dt,Lt){return dt+Lt},0),we.hasSubColumns=!0),"colSpan"in de&&(Le=de.colSpan),"rowSpan"in de&&(we.rowSpan=de.rowSpan),we.colSpan=Le,we.colEnd=we.colStart+Le-1,ke[xe].push(we),ue+=Le,Le});return fe}at(Ne,0);for(var ct=ke.length,Ge=function(ve){ke[ve].forEach(function(xe){!("rowSpan"in xe)&&!xe.hasSubColumns&&(xe.rowSpan=ct-ve)})},et=0;et=0;ve-=1){var xe=ke[ve],ue=at&&at[ve],fe=ue&&ue[b.a];(xe||fe||Ae)&&(Ge.unshift(I.createElement("col",Object.assign({key:ve,style:{width:xe,minWidth:xe}},fe))),Ae=!0)}return I.createElement("colgroup",null,Ge)}var f=g;function C(Ne,ke){return Object(I.useMemo)(function(){for(var at=[],ct=0;ct1?Y-1:0),q=1;q=de&&(le=de-we),Ae({scrollLeft:le/de*(fe+2)}),kt.current.x=Ve.pageX},Xe=function(){var Ve=Object(_e.b)(et.current).top,gt=Ve+et.current.offsetHeight,It=document.documentElement.scrollTop+window.innerHeight;gt-Object(d.a)()<=It||Ve>=It-ve?Ft(function(Zt){return Object(z.a)(Object(z.a)({},Zt),{},{isHiddenScrollBar:!0})}):Ft(function(Zt){return Object(z.a)(Object(z.a)({},Zt),{},{isHiddenScrollBar:!1})})},Pt=function(Ve){Ft(function(gt){return Object(z.a)(Object(z.a)({},gt),{},{scrollLeft:Ve/fe*de||0})})};return I.useImperativeHandle(at,function(){return{setScrollLeft:Pt}}),I.useEffect(function(){var Mt=Object(wt.a)(document.body,"mouseup",pe,!1),Ve=Object(wt.a)(document.body,"mousemove",nt,!1);return Xe(),function(){Mt.remove(),Ve.remove()}},[we,rt]),I.useEffect(function(){var Mt=Object(wt.a)(window,"scroll",Xe,!1),Ve=Object(wt.a)(window,"resize",Xe,!1);return function(){Mt.remove(),Ve.remove()}},[]),I.useEffect(function(){Lt.isHiddenScrollBar||Ft(function(Mt){var Ve,gt;return Object(z.a)(Object(z.a)({},Mt),{},{scrollLeft:et.current.scrollLeft/((Ve=et.current)===null||Ve===void 0?void 0:Ve.scrollWidth)*((gt=et.current)===null||gt===void 0?void 0:gt.clientWidth)})})},[Lt.isHiddenScrollBar]),fe<=de||!we||Lt.isHiddenScrollBar?null:I.createElement("div",{style:{height:Object(d.a)(),width:de,bottom:ve},className:"".concat(ue,"-sticky-scroll")},I.createElement("div",{onMouseDown:Te,ref:Le,className:N()("".concat(ue,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ue,"-sticky-scroll-bar-active"),rt)),style:{width:"".concat(we,"px"),transform:"translate3d(".concat(Lt.scrollLeft,"px, 0, 0)")}}))},ye=I.forwardRef(Me);function Se(Ne,ke){return I.useMemo(function(){var at=!!Ne;return{isSticky:at,stickyClassName:at?"".concat(ke,"-sticky-header"):"",offsetHeader:Object(X.a)(Ne)==="object"&&Ne.offsetHeader||0,offsetScroll:Object(X.a)(Ne)==="object"&&Ne.offsetScroll||0}},[Ne,ke])}var Be=[],Ze={},ot="rc-table-internal-hook",ft=I.memo(function(Ne){var ke=Ne.children;return ke},function(Ne,ke){return P()(Ne.props,ke.props)?Ne.pingLeft!==ke.pingLeft||Ne.pingRight!==ke.pingRight:!1});function Ct(Ne){var ke,at=Ne.prefixCls,ct=Ne.className,Ge=Ne.rowClassName,et=Ne.style,Ae=Ne.data,ve=Ne.rowKey,xe=Ne.scroll,ue=Ne.tableLayout,fe=Ne.direction,de=Ne.title,we=Ne.footer,Le=Ne.summary,ze=Ne.id,dt=Ne.showHeader,Lt=Ne.components,Ft=Ne.emptyText,kt=Ne.onRow,St=Ne.onHeaderRow,qe=Ne.internalHooks,rt=Ne.transformColumns,Ye=Ne.internalRefs,pe=Ne.sticky,Te=Ae||Be,nt=!!Te.length,Xe=I.useState(0),Pt=Object(F.a)(Xe,2),Mt=Pt[0],Ve=Pt[1];I.useEffect(function(){Ve(Object(d.a)())});var gt=I.useMemo(function(){return Object(S.c)(Lt,{})},[Lt]),It=I.useCallback(function(an,Vt){return Object(S.b)(gt,an)||Vt},[gt]),Zt=I.useMemo(function(){return typeof ve=="function"?ve:function(an){var Vt=an&&an[ve];return Vt}},[ve]),le=Object(b.c)(Ne),re=le.expandIcon,B=le.expandedRowKeys,$=le.defaultExpandedRowKeys,J=le.defaultExpandAllRows,ne=le.expandedRowRender,ge=le.onExpand,Ue=le.onExpandedRowsChange,We=le.expandRowByClick,_t=le.rowExpandable,Rt=le.expandIconColumnIndex,Bt=le.expandedRowClassName,tt=le.childrenColumnName,Dt=le.indentSize,At=re||st,nn=tt||"children",qt=I.useMemo(function(){return ne?"row":Ne.expandable&&qe===ot&&Ne.expandable.__PARENT_RENDER_ICON__||Te.some(function(an){return an&&Object(X.a)(an)==="object"&&an[nn]})?"nest":!1},[!!ne,Te]),Yt=I.useState(function(){return $||(J?ht(Te,Zt,nn):[])}),Q=Object(F.a)(Yt,2),L=Q[0],k=Q[1],Y=I.useMemo(function(){return new Set(B||L||[])},[B,L]),se=I.useCallback(function(an){var Vt=Zt(an,Te.indexOf(an)),it,xt=Y.has(Vt);xt?(Y.delete(Vt),it=Object(M.a)(Y)):it=[].concat(Object(M.a)(Y),[Vt]),k(it),ge&&ge(!xt,an),Ue&&Ue(it)},[Zt,Y,Te,ge,Ue]),q=I.useState(0),De=Object(F.a)(q,2),lt=De[0],Nt=De[1],Qt=Object(Ce.b)(Object(z.a)(Object(z.a)(Object(z.a)({},Ne),le),{},{expandable:!!ne,expandedKeys:Y,getRowKey:Zt,onTriggerExpand:se,expandIcon:At,expandIconColumnIndex:Rt,direction:fe}),qe===ot?rt:null),ut=Object(F.a)(Qt,2),en=ut[0],gn=ut[1],Yn=I.useMemo(function(){return{columns:en,flattenColumns:gn}},[en,gn]),mi=I.useRef(),ri=I.useRef(),Nn=I.useRef(),Gi=I.useState(!1),zi=Object(F.a)(Gi,2),ni=zi[0],di=zi[1],ji=I.useState(!1),Mi=Object(F.a)(ji,2),wi=Mi[0],Ci=Mi[1],ar=Ee(new Map),Zi=Object(F.a)(ar,2),lr=Zi[0],Vi=Zi[1],qi=Object(S.a)(gn),ur=qi.map(function(an){return lr.get(an)}),Mr=I.useMemo(function(){return ur},[ur.join("_")]),Li=bt(Mr,gn.length,fe),Fn=xe&&Object(S.d)(xe.y),Pn=xe&&Object(S.d)(xe.x),xi=Pn&&gn.some(function(an){var Vt=an.fixed;return Vt}),Wn=I.useRef(),Si=Se(pe,at),ai=Si.isSticky,Tr=Si.offsetHeader,ki=Si.offsetScroll,Xi=Si.stickyClassName,cr,gr,Hr;Fn&&(gr={overflowY:"scroll",maxHeight:xe.y}),Pn&&(cr={overflowX:"auto"},Fn||(gr={overflowY:"hidden"}),Hr={width:xe.x===!0?"auto":xe.x,minWidth:"100%"});var kr=I.useCallback(function(an,Vt){Vi(function(it){var xt=new Map(it);return xt.set(an,Vt),xt})},[]),wr=be(null),Xr=Object(F.a)(wr,2),vr=Xr[0],Yr=Xr[1];function $r(an,Vt){if(!Vt)return;typeof Vt=="function"?Vt(an):Vt.scrollLeft!==an&&(Vt.scrollLeft=an)}var fr=function(Vt){var it=Vt.currentTarget,xt=Vt.scrollLeft,dn=typeof xt=="number"?xt:it.scrollLeft,mt=it||Ze;if(!Yr()||Yr()===mt){var hn;vr(mt),$r(dn,ri.current),$r(dn,Nn.current),$r(dn,(hn=Wn.current)===null||hn===void 0?void 0:hn.setScrollLeft)}if(it){var jt=it.scrollWidth,vn=it.clientWidth;di(dn>0),Ci(dn0?[].concat(Object(z.a)(h),Object(z.a)(p(s).map(function(S){return Object(M.a)({fixed:i},S)}))):[].concat(Object(z.a)(h),[Object(M.a)(Object(M.a)({},r),{},{fixed:i})])},[])}function m(o){for(var h=!0,r=0;r=0;s-=1){var S=o[s];if(i&&S.fixed!=="right")i=!1;else if(!i&&S.fixed==="right"){Object(H.a)(!1,"Index ".concat(s+1," of `columns` missing `fixed='right'` prop."));break}}}function d(o){return o.map(function(h){var r=h.fixed,a=Object(X.a)(h,["fixed"]),i=r;return r==="left"?i="right":r==="right"&&(i="left"),Object(M.a)({fixed:i},a)})}function u(o,h){var r=o.prefixCls,a=o.columns,i=o.children,s=o.expandable,S=o.expandedKeys,x=o.getRowKey,T=o.onTriggerExpand,R=o.expandIcon,w=o.rowExpandable,v=o.expandIconColumnIndex,b=o.direction,g=o.expandRowByClick,f=F.useMemo(function(){return a||P(i)},[a,i]),C=F.useMemo(function(){if(s){var U,j=v||0,A=f[j],G=(U={},Object(Z.a)(U,n.a,{className:"".concat(r,"-expand-icon-col")}),Object(Z.a)(U,"title",""),Object(Z.a)(U,"fixed",A?A.fixed:null),Object(Z.a)(U,"className","".concat(r,"-row-expand-icon-cell")),Object(Z.a)(U,"render",function(V,te,ae){var me=x(te,ae),Re=S.has(me),Oe=w?w(te):!0,Ce=R({prefixCls:r,expanded:Re,expandable:Oe,record:te,onExpand:T});return g?F.createElement("span",{onClick:function(He){return He.stopPropagation()}},Ce):Ce}),U),W=f.slice();return j>=0&&W.splice(j,0,G),W}return f},[s,f,x,S,R,b]),E=F.useMemo(function(){var U=C;return h&&(U=h(U)),U.length||(U=[{render:function(){return null}}]),U},[h,C,b]),y=F.useMemo(function(){return b==="rtl"?d(p(E)):p(E)},[E,b]);return[E,y]}ce.b=u},wW8i:function(je,ce,D){je.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":function(je,ce,D){"use strict";D.d(ce,"a",function(){return p}),D.d(ce,"b",function(){return d});var Z=/margin|padding|width|height|max|min|offset/,z={left:!0,top:!0},M={cssFloat:1,styleFloat:1,float:1};function X(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function F(u,o,h){if(o=o.toLowerCase(),h==="auto"){if(o==="height")return u.offsetHeight;if(o==="width")return u.offsetWidth}return o in z||(z[o]=Z.test(o)),z[o]?parseFloat(h)||0:h}function I(u,o){var h=arguments.length,r=X(u);return o=M[o]?"cssFloat"in u.style?"cssFloat":"styleFloat":o,h===1?r:F(u,o,r[o]||u.style[o])}function H(u,o,h){var r=arguments.length;if(o=M[o]?"cssFloat"in u.style?"cssFloat":"styleFloat":o,r===3)return typeof h=="number"&&Z.test(o)&&(h="".concat(h,"px")),u.style[o]=h,h;for(var a in o)o.hasOwnProperty(a)&&H(u,a,o[a]);return X(u)}function N(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function n(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function P(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:o}}function p(){var u=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:o}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function d(u){var o=u.getBoundingClientRect(),h=document.documentElement;return{left:o.left+(window.pageXOffset||h.scrollLeft)-(h.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||h.scrollTop)-(h.clientTop||document.body.clientTop||0)}}},ynwM:function(je,ce,D){var Z=D("MFOe"),z=Z.Global;je.exports={name:"oldFF-globalStorage",read:X,write:F,each:I,remove:H,clearAll:N};var M=z.globalStorage;function X(n){return M[n]}function F(n,P){M[n]=P}function I(n){for(var P=M.length-1;P>=0;P--){var p=M.key(P);n(M[p],p)}}function H(n){return M.removeItem(n)}function N(){I(function(n,P){delete M[n]})}}}]);