(window.webpackJsonp=window.webpackJsonp||[]).push([[223,5,6,7,8,10],{"+NIl":function(pt,$e,G){(function(ee){ee(G("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function(K,R){"use strict";function j(O,E){O.cmdState.push(E)}function m(O){return O.cmdState.length>0?O.cmdState[O.cmdState.length-1]:null}function _(O){var E=O.cmdState.pop();E&&E.closeBracket()}function F(O){for(var E=O.cmdState,p=E.length-1;p>=0;p--){var f=E[p];if(f.name=="DEFAULT")continue;return f}return{styleIdentifier:function(){return null}}}function P(O,E,p){return function(){this.name=O,this.bracketNo=0,this.style=E,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var A={};A.importmodule=P("importmodule","tag",["string","builtin"]),A.documentclass=P("documentclass","tag",["","atom"]),A.usepackage=P("usepackage","tag",["atom"]),A.begin=P("begin","tag",["atom"]),A.end=P("end","tag",["atom"]),A.label=P("label","tag",["atom"]),A.ref=P("ref","tag",["atom"]),A.eqref=P("eqref","tag",["atom"]),A.cite=P("cite","tag",["atom"]),A.bibitem=P("bibitem","tag",["atom"]),A.Bibitem=P("Bibitem","tag",["atom"]),A.RBibitem=P("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(O,E){O.f=E}function C(O,E){var p;if(O.match(/^\\[a-zA-Z@]+/)){var f=O.current().slice(1);return p=A.hasOwnProperty(f)?A[f]:A.DEFAULT,p=new p,j(E,p),L(E,k),p.style}if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/\\]/))return"tag";if(O.match("\\["))return L(E,function(l,c){return w(l,c,"\\]")}),"keyword";if(O.match("\\("))return L(E,function(l,c){return w(l,c,"\\)")}),"keyword";if(O.match("$$"))return L(E,function(l,c){return w(l,c,"$$")}),"keyword";if(O.match("$"))return L(E,function(l,c){return w(l,c,"$")}),"keyword";var s=O.next();if(s=="%")return O.skipToEnd(),"comment";if(s=="}"||s=="]"){if(p=m(E),p)p.closeBracket(s),L(E,k);else return"error";return"bracket"}else return s=="{"||s=="["?(p=A.DEFAULT,p=new p,j(E,p),"bracket"):/\d/.test(s)?(O.eatWhile(/[\w.%]/),"atom"):(O.eatWhile(/[\w\-_]/),p=F(E),p.name=="begin"&&(p.argument=O.current()),p.styleIdentifier())}function w(O,E,p){if(O.eatSpace())return null;if(p&&O.match(p))return L(E,C),"keyword";if(O.match(/^\\[a-zA-Z@]+/))return"tag";if(O.match(/^[a-zA-Z]+/))return"variable-2";if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/]/))return"tag";if(O.match(/^[\^_&]/))return"tag";if(O.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(O.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var f=O.next();return f=="{"||f=="}"||f=="["||f=="]"||f=="("||f==")"?"bracket":f=="%"?(O.skipToEnd(),"comment"):"error"}function k(O,E){var p=O.peek(),f;return p=="{"||p=="["?(f=m(E),f.openBracket(p),O.eat(p),L(E,C),"bracket"):/[ \t\r]/.test(p)?(O.eat(p),null):(L(E,C),_(E),C(O,E))}return{startState:function(){var O=R.inMathMode?function(E,p){return w(E,p)}:C;return{cmdState:[],f:O}},copyState:function(O){return{cmdState:O.cmdState.slice(),f:O.f}},token:function(O,E){return E.f(O,E)},blankLine:function(O){O.f=C,O.cmdState.length=0},lineComment:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"19Vz":function(pt,$e,G){(function(ee){ee(G("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(P,A,L){var C=L&&L!=ee.Init;if(A&&!C)P.on("blur",m),P.on("change",_),P.on("swapDoc",_),ee.on(P.getInputField(),"compositionupdate",P.state.placeholderCompose=function(){j(P)}),_(P);else if(!A&&C){P.off("blur",m),P.off("change",_),P.off("swapDoc",_),ee.off(P.getInputField(),"compositionupdate",P.state.placeholderCompose),K(P);var w=P.getWrapperElement();w.className=w.className.replace(" CodeMirror-empty","")}A&&!P.hasFocus()&&m(P)});function K(P){P.state.placeholder&&(P.state.placeholder.parentNode.removeChild(P.state.placeholder),P.state.placeholder=null)}function R(P){K(P);var A=P.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=P.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var L=P.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),A.appendChild(L),P.display.lineSpace.insertBefore(A,P.display.lineSpace.firstChild)}function j(P){setTimeout(function(){var A=!1,L=P.getInputField();L.nodeName=="TEXTAREA"?A=!L.value:P.lineCount()==1&&(A=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),A?R(P):K(P)},20)}function m(P){F(P)&&R(P)}function _(P){var A=P.getWrapperElement(),L=F(P);A.className=A.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?R(P):K(P)}function F(P){return P.lineCount()===1&&P.getLine(0)===""}})},"1eCo":function(pt,$e,G){(function(ee){ee(G("VrN/"))})(function(ee){"use strict";var K={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ee.defineMode("xml",function(j,m){var _=j.indentUnit,F={},P=m.htmlMode?K:R;for(var A in P)F[A]=P[A];for(var A in m)F[A]=m[A];var L,C;function w(a,b){function g(U){return b.tokenize=U,U(a,b)}var T=a.next();if(T=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?g(E("atom","]]>")):null:a.match("--")?g(E("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(p(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=E("meta","?>"),"meta"):(L=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(T=="&"){var M;return a.eat("#")?a.eat("x")?M=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):M=a.eatWhile(/[\d]/)&&a.eat(";"):M=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),M?"atom":"error"}else return a.eatWhile(/[^&<]/),null}w.isInText=!0;function k(a,b){var g=a.next();if(g==">"||g=="/"&&a.eat(">"))return b.tokenize=w,L=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return L="equals",null;if(g=="<"){b.tokenize=w,b.state=c,b.tagName=b.tagStart=null;var T=b.tokenize(a,b);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(g)?(b.tokenize=O(g),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function O(a){var b=function(g,T){for(;!g.eol();)if(g.next()==a){T.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function E(a,b){return function(g,T){for(;!g.eol();){if(g.match(b)){T.tokenize=w;break}g.next()}return a}}function p(a){return function(b,g){for(var T;(T=b.next())!=null;){if(T=="<")return g.tokenize=p(a+1),g.tokenize(b,g);if(T==">")if(a==1){g.tokenize=w;break}else return g.tokenize=p(a-1),g.tokenize(b,g)}return"meta"}}function f(a,b,g){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=g,(F.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function s(a){a.context&&(a.context=a.context.prev)}function l(a,b){for(var g;;){if(!a.context)return;if(g=a.context.tagName,!F.contextGrabbers.hasOwnProperty(g)||!F.contextGrabbers[g].hasOwnProperty(b))return;s(a)}}function c(a,b,g){return a=="openTag"?(g.tagStart=b.column(),x):a=="closeTag"?v:c}function x(a,b,g){return a=="word"?(g.tagName=b.current(),C="tag",y):F.allowMissingTagName&&a=="endTag"?(C="tag bracket",y(a,b,g)):(C="error",x)}function v(a,b,g){if(a=="word"){var T=b.current();return g.context&&g.context.tagName!=T&&F.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==T||F.matchClosing===!1?(C="tag",h):(C="tag error",S)}else return F.allowMissingTagName&&a=="endTag"?(C="tag bracket",h(a,b,g)):(C="error",S)}function h(a,b,g){return a!="endTag"?(C="error",h):(s(g),c)}function S(a,b,g){return C="error",h(a,b,g)}function y(a,b,g){if(a=="word")return C="attribute",u;if(a=="endTag"||a=="selfcloseTag"){var T=g.tagName,M=g.tagStart;return g.tagName=g.tagStart=null,a=="selfcloseTag"||F.autoSelfClosers.hasOwnProperty(T)?l(g,T):(l(g,T),g.context=new f(g,T,M==g.indented)),c}return C="error",y}function u(a,b,g){return a=="equals"?d:(F.allowMissing||(C="error"),y(a,b,g))}function d(a,b,g){return a=="string"?o:a=="word"&&F.allowUnquoted?(C="string",y):(C="error",y(a,b,g))}function o(a,b,g){return a=="string"?o:y(a,b,g)}return{startState:function(a){var b={tokenize:w,state:c,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;L=null;var g=b.tokenize(a,b);return(g||L)&&g!="comment"&&(C=null,b.state=b.state(L||g,a,b),C&&(g=C=="error"?g+" error":C)),g},indent:function(a,b,g){var T=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(T&&T.noIndent)return ee.Pass;if(a.tokenize!=k&&a.tokenize!=w)return g?g.match(/^(\s*)/)[0].length:0;if(a.tagName)return F.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(F.multilineTagIndentFactor||1);if(F.alignCDATA&&/$/,blockCommentStart:"",configuration:F.htmlMode?"html":"xml",helperType:F.htmlMode?"html":"xml",skipAttribute:function(a){a.state==d&&(a.state=y)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],g=a.context;g;g=g.prev)g.tagName&&b.push(g.tagName);return b.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"5TE/":function(pt,$e,G){pt.exports={flexRow:"flexRow___1e_pE",flexJustifyCenter:"flexJustifyCenter___1dcCc",flexAlignEnd:"flexAlignEnd___jp_nX",flexAlignCenter:"flexAlignCenter___TdYi8",flexColumn:"flexColumn___1cFZ6",formWrap:"formWrap___3iYHB",JupyterFieldWrapElse:"JupyterFieldWrapElse___3QaiS",button:"button___fqsN2",buttonWrap:"buttonWrap___oucZC",width240:"width240___PJwk-",difficultyHint:"difficultyHint___1oQed",color888:"color888___31ptO",color0152d9:"color0152d9___1mMMX",installPackage:"installPackage___2QPz2",apply:"apply___3QwzA",p1:"p1___1W7Dn",p2:"p2___2zF1s",radio:"radio___2YyKw"}},"6+eU":function(pt,$e,G){"use strict";G.d($e,"a",function(){return h});var ee=G("wx14"),K=G("rePB"),R=G("VTBJ"),j=G("1OyB"),m=G("vuIU"),_=G("Ji7U"),F=G("LK+K"),P=G("q1tI"),A=G.n(P),L=G("TSYQ"),C=G.n(L),w=function(y){var u,d="".concat(y.rootPrefixCls,"-item"),o=C()(d,"".concat(d,"-").concat(y.page),(u={},Object(K.a)(u,"".concat(d,"-active"),y.active),Object(K.a)(u,y.className,!!y.className),Object(K.a)(u,"".concat(d,"-disabled"),!y.page),u)),a=function(){y.onClick(y.page)},b=function(T){y.onKeyPress(T,y.onClick,y.page)};return A.a.createElement("li",{title:y.showTitle?y.page:null,className:o,onClick:a,onKeyPress:b,tabIndex:"0"},y.itemRender(y.page,"page",A.a.createElement("a",{rel:"nofollow"},y.page)))},k=w,O={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},E=function(S){Object(_.a)(u,S);var y=Object(F.a)(u);function u(){var d;Object(j.a)(this,u);for(var o=arguments.length,a=new Array(o),b=0;b=0||g.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;d.setState({goInputText:""}),U(d.getValidValue())},d.go=function(g){var T=d.state.goInputText;if(T==="")return;(g.keyCode===O.ENTER||g.type==="click")&&(d.setState({goInputText:""}),d.props.quickGo(d.getValidValue()))},d}return Object(m.a)(u,[{key:"getValidValue",value:function(){var o=this.state,a=o.goInputText,b=o.current;return!a||isNaN(a)?b:Number(a)}},{key:"getPageSizeOptions",value:function(){var o=this.props,a=o.pageSize,b=o.pageSizeOptions;return b.some(function(g){return g.toString()===a.toString()})?b:b.concat([a.toString()]).sort(function(g,T){var M=isNaN(Number(g))?0:Number(g),U=isNaN(Number(T))?0:Number(T);return M-U})}},{key:"render",value:function(){var o=this,a=this.props,b=a.pageSize,g=a.locale,T=a.rootPrefixCls,M=a.changeSize,U=a.quickGo,W=a.goButton,H=a.selectComponentClass,I=a.buildOptionText,N=a.selectPrefixCls,z=a.disabled,$=this.state.goInputText,ae="".concat(T,"-options"),le=H,De=null,xe=null,Pe=null;if(!M&&!U)return null;var Le=this.getPageSizeOptions();if(M&&le){var we=Le.map(function(me,pe){return A.a.createElement(le.Option,{key:pe,value:me.toString()},(I||o.buildOptionText)(me))});De=A.a.createElement(le,{disabled:z,prefixCls:N,showSearch:!1,className:"".concat(ae,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||Le[0]).toString(),onChange:this.changeSize,getPopupContainer:function(pe){return pe.parentNode}},we)}return U&&(W&&(Pe=typeof W=="boolean"?A.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(ae,"-quick-jumper-button")},g.jump_to_confirm):A.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),xe=A.a.createElement("div",{className:"".concat(ae,"-quick-jumper")},g.jump_to,A.a.createElement("input",{disabled:z,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Pe)),A.a.createElement("li",{className:"".concat(ae)},De,xe)}}]),u}(A.a.Component);E.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=E,f=G("N2Kk");function s(){}function l(S){return typeof S=="number"&&isFinite(S)&&Math.floor(S)===S}function c(S,y,u){return u}function x(S,y,u){var d=typeof S=="undefined"?y.pageSize:S;return Math.floor((u.total-1)/d)+1}var v=function(S){Object(_.a)(u,S);var y=Object(F.a)(u);function u(d){var o;Object(j.a)(this,u),o=y.call(this,d),o.getJumpPrevPage=function(){return Math.max(1,o.state.current-(o.props.showLessItems?3:5))},o.getJumpNextPage=function(){return Math.min(x(void 0,o.state,o.props),o.state.current+(o.props.showLessItems?3:5))},o.getItemIcon=function(M,U){var W=o.props.prefixCls,H=M||A.a.createElement("button",{type:"button","aria-label":U,className:"".concat(W,"-item-link")});return typeof M=="function"&&(H=A.a.createElement(M,Object(R.a)({},o.props))),H},o.savePaginationNode=function(M){o.paginationNode=M},o.isValid=function(M){return l(M)&&M!==o.state.current},o.shouldDisplayQuickJumper=function(){var M=o.props,U=M.showQuickJumper,W=M.pageSize,H=M.total;return H<=W?!1:U},o.handleKeyDown=function(M){(M.keyCode===O.ARROW_UP||M.keyCode===O.ARROW_DOWN)&&M.preventDefault()},o.handleKeyUp=function(M){var U=o.getValidValue(M),W=o.state.currentInputValue;U!==W&&o.setState({currentInputValue:U}),M.keyCode===O.ENTER?o.handleChange(U):M.keyCode===O.ARROW_UP?o.handleChange(U-1):M.keyCode===O.ARROW_DOWN&&o.handleChange(U+1)},o.changePageSize=function(M){var U=o.state.current,W=x(M,o.state,o.props);U=U>W?W:U,W===0&&(U=o.state.current),typeof M=="number"&&("pageSize"in o.props||o.setState({pageSize:M}),"current"in o.props||o.setState({current:U,currentInputValue:U})),o.props.onShowSizeChange(U,M),"onChange"in o.props&&o.props.onChange&&o.props.onChange(U,M)},o.handleChange=function(M){var U=o.props.disabled,W=M;if(o.isValid(W)&&!U){var H=x(void 0,o.state,o.props);W>H?W=H:W<1&&(W=1),"current"in o.props||o.setState({current:W,currentInputValue:W});var I=o.state.pageSize;return o.props.onChange(W,I),W}return o.state.current},o.prev=function(){o.hasPrev()&&o.handleChange(o.state.current-1)},o.next=function(){o.hasNext()&&o.handleChange(o.state.current+1)},o.jumpPrev=function(){o.handleChange(o.getJumpPrevPage())},o.jumpNext=function(){o.handleChange(o.getJumpNextPage())},o.hasPrev=function(){return o.state.current>1},o.hasNext=function(){return o.state.current2?W-2:0),I=2;I=b?T=b:T=Number(a),T}},{key:"getShowSizeChanger",value:function(){var o=this.props,a=o.showSizeChanger,b=o.total,g=o.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:b>g}},{key:"renderPrev",value:function(o){var a=this.props,b=a.prevIcon,g=a.itemRender,T=g(o,"prev",this.getItemIcon(b,"prev page")),M=!this.hasPrev();return Object(P.isValidElement)(T)?Object(P.cloneElement)(T,{disabled:M}):T}},{key:"renderNext",value:function(o){var a=this.props,b=a.nextIcon,g=a.itemRender,T=g(o,"next",this.getItemIcon(b,"next page")),M=!this.hasNext();return Object(P.isValidElement)(T)?Object(P.cloneElement)(T,{disabled:M}):T}},{key:"render",value:function(){var o=this,a=this.props,b=a.prefixCls,g=a.className,T=a.style,M=a.disabled,U=a.hideOnSinglePage,W=a.total,H=a.locale,I=a.showQuickJumper,N=a.showLessItems,z=a.showTitle,$=a.showTotal,ae=a.simple,le=a.itemRender,De=a.showPrevNextJumpers,xe=a.jumpPrevIcon,Pe=a.jumpNextIcon,Le=a.selectComponentClass,we=a.selectPrefixCls,me=a.pageSizeOptions,pe=this.state,Q=pe.current,de=pe.pageSize,te=pe.currentInputValue;if(U===!0&&W<=de)return null;var fe=x(void 0,this.state,this.props),Ae=[],_e=null,Ne=null,Ge=null,et=null,Ze=null,Ke=I&&I.goButton,He=N?1:2,rt=Q-1>0?Q-1:0,at=Q+1=He*2&&Q!==1+2&&(Ae[0]=Object(P.cloneElement)(Ae[0],{className:"".concat(b,"-item-after-jump-prev")}),Ae.unshift(_e)),fe-Q>=He*2&&Q!==fe-2&&(Ae[Ae.length-1]=Object(P.cloneElement)(Ae[Ae.length-1],{className:"".concat(b,"-item-before-jump-next")}),Ae.push(Ne)),Be!==1&&Ae.unshift(Ge),ze!==fe&&Ae.push(et)}var he=null;$&&(he=A.a.createElement("li",{className:"".concat(b,"-total-text")},$(W,[W===0?0:(Q-1)*de+1,Q*de>W?W:Q*de])));var ue=!this.hasPrev()||!fe,ie=!this.hasNext()||!fe;return A.a.createElement("ul",Object(ee.a)({className:C()(b,g,Object(K.a)({},"".concat(b,"-disabled"),M)),style:T,unselectable:"unselectable",ref:this.savePaginationNode},ut),he,A.a.createElement("li",{title:z?H.prev_page:null,onClick:this.prev,tabIndex:ue?null:0,onKeyPress:this.runIfEnterPrev,className:C()("".concat(b,"-prev"),Object(K.a)({},"".concat(b,"-disabled"),ue)),"aria-disabled":ue},this.renderPrev(rt)),Ae,A.a.createElement("li",{title:z?H.next_page:null,onClick:this.next,tabIndex:ie?null:0,onKeyPress:this.runIfEnterNext,className:C()("".concat(b,"-next"),Object(K.a)({},"".concat(b,"-disabled"),ie)),"aria-disabled":ie},this.renderNext(at)),A.a.createElement(p,{disabled:M,locale:H,rootPrefixCls:b,selectComponentClass:Le,selectPrefixCls:we,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Q,pageSize:de,pageSizeOptions:me,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ke}))}}],[{key:"getDerivedStateFromProps",value:function(o,a){var b={};if("current"in o&&(b.current=o.current,o.current!==a.current&&(b.currentInputValue=b.current)),"pageSize"in o&&o.pageSize!==a.pageSize){var g=a.current,T=x(o.pageSize,a,o);g=g>T?T:g,"current"in o||(b.current=g,b.currentInputValue=g),b.pageSize=o.pageSize}return b}}]),u}(A.a.Component);v.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:f.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var h=v},"6RRn":function(pt,$e,G){"use strict";var ee=G("wCXF"),K=G("n6Qo");G.d($e,"b",function(){return K.a});var R=G("IBYe"),j=G("6eGT"),m=G("hW8S");G.d($e,"a",function(){return m.a}),$e.c=ee.b},"6eGT":function(pt,$e,G){"use strict";function ee(K){return null}$e.a=ee},"6f40":function(pt,$e,G){pt.exports={practicalTraining:"practicalTraining___14zoU",titleWrap:"titleWrap___2awze",title:"title___3BF26",line:"line___wXl6Y",dec:"dec___ZXNkn"}},"7ahc":function(pt,$e,G){"use strict";G.d($e,"a",function(){return x});var ee=G("k1fw"),K=G("0Owb"),R=G("+L6B"),j=G("2/Rp"),m=G("y8nQ"),_=G("Vl3Y"),F=G("tJVT"),P=G("OaEy"),A=G("2fM7"),L=G("q1tI"),C=G.n(L),w=G("VrN/"),k=G.n(w),O=G("p77/"),E=G.n(O),p=G("c5Ni"),f=G.n(p),s=A.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},c={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"]};$e.b=function(v){var h=v.callback,S=v.onCancel,y=Object(L.useState)("python"),u=Object(F.a)(y,2),d=u[0],o=u[1];function a(g){o(c[g][1])}function b(g){h(g)}return C.a.createElement(_.a,Object(K.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),C.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},C.a.createElement(A.a,{onChange:a},Object.keys(c).map(function(g){return C.a.createElement(s,{key:g,value:g},c[g][0])}))),C.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},C.a.createElement(x,{mode:d})),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(j.a,{type:"ghost",onClick:S},"\u53D6\u6D88")))};function x(v){var h=v.value,S=v.onChange,y=v.mode,u=v.options,d=u===void 0?{}:u,o=Object(L.useRef)(),a=Object(L.useState)(),b=Object(F.a)(a,2),g=b[0],T=b[1];return Object(L.useEffect)(function(){if(g){function M(U){var W=U.getValue();S&&S(W)}return g.on("change",M),function(){g.off("change",M)}}},[g,S]),Object(L.useEffect)(function(){g&&g.setOption("mode",y)},[g,y]),Object(L.useEffect)(function(){g&&((h!==g.getValue()||h==="")&&setTimeout(function(){g.setValue(h||" ")},300))},[g,h]),Object(L.useEffect)(function(){if(o.current&&!g){var M=k.a.fromTextArea(o.current,Object(ee.a)({mode:y,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},d));T(M)}},[o.current,g]),C.a.createElement("div",{className:"my-codemirror-container"},C.a.createElement("textarea",{ref:o}))}},"815F":function(pt,$e,G){"use strict";G.d($e,"e",function(){return F}),G.d($e,"c",function(){return A}),G.d($e,"d",function(){return L}),G.d($e,"a",function(){return w}),G.d($e,"f",function(){return k}),G.d($e,"b",function(){return O});var ee=G("KQm4"),K=G("VTBJ"),R=G("Ff2n"),j=G("Zm9Q"),m=G("Kwbf"),_=G("OZM5");function F(E,p){return E!=null?E:p}function P(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=new Map;function f(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(c){var x=c.key,v=c.children;Object(m.a)(x!=null,"Tree node must have a certain key: [".concat(l).concat(x,"]"));var h=String(x);Object(m.a)(!p.has(h)||x===null||x===void 0,"Same 'key' exist in the Tree: ".concat(h)),p.set(h,!0),f(v,"".concat(l).concat(h," > "))})}f(E)}function A(E){function p(f){var s=Object(j.a)(f);return s.map(function(l){if(!Object(_.i)(l))return Object(m.a)(!l,"Tree/TreeNode can only accept TreeNode as children."),null;var c=l.key,x=l.props,v=x.children,h=Object(R.a)(x,["children"]),S=Object(K.a)({key:c},h),y=p(v);return y.length&&(S.children=y),S}).filter(function(l){return l})}return p(E)}function L(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],f=new Set(p===!0?[]:p),s=[];function l(c){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(v,h){var S=Object(_.h)(x?x.pos:"0",h),y=F(v.key,S),u=Object(K.a)(Object(K.a)({},v),{},{parent:x,pos:S,children:null,data:v,isStart:[].concat(Object(ee.a)(x?x.isStart:[]),[h===0]),isEnd:[].concat(Object(ee.a)(x?x.isEnd:[]),[h===c.length-1])});return s.push(u),p===!0||f.has(y)?u.children=l(v.children||[],u):u.children=[],u})}return l(E),s}function C(E,p,f){var s;f?typeof f=="string"?s=function(x){return x[f]}:typeof f=="function"&&(s=function(x){return f(x)}):s=function(x,v){return F(x.key,v)};function l(c,x,v){var h=c?c.children:E,S=c?Object(_.h)(v.pos,x):"0";if(c){var y=s(c,S),u={node:c,index:x,pos:S,key:y,parentPos:v.node?v.pos:null,level:v.level+1};p(u)}h&&h.forEach(function(d,o){l(d,o,{node:c,pos:S,level:v?v.level+1:-1})})}l(null)}function w(E){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=p.initWrapper,s=p.processEntity,l=p.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,x={},v={},h={posEntities:x,keyEntities:v};return f&&(h=f(h)||h),C(E,function(S){var y=S.node,u=S.index,d=S.pos,o=S.key,a=S.parentPos,b=S.level,g={node:y,index:u,key:o,pos:d,level:b},T=F(o,d);x[d]=g,v[T]=g,g.parent=x[a],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),s&&s(g,h)},c),l&&l(h),h}function k(E,p){var f=p.expandedKeys,s=p.selectedKeys,l=p.loadedKeys,c=p.loadingKeys,x=p.checkedKeys,v=p.halfCheckedKeys,h=p.dragOverNodeKey,S=p.dropPosition,y=p.keyEntities,u=y[E],d={eventKey:E,expanded:f.indexOf(E)!==-1,selected:s.indexOf(E)!==-1,loaded:l.indexOf(E)!==-1,loading:c.indexOf(E)!==-1,checked:x.indexOf(E)!==-1,halfChecked:v.indexOf(E)!==-1,pos:String(u?u.pos:""),dragOver:h===E&&S===0,dragOverGapTop:h===E&&S===-1,dragOverGapBottom:h===E&&S===1};return d}function O(E){var p=E.data,f=E.expanded,s=E.selected,l=E.checked,c=E.loaded,x=E.loading,v=E.halfChecked,h=E.dragOver,S=E.dragOverGapTop,y=E.dragOverGapBottom,u=E.pos,d=E.active,o=Object(K.a)(Object(K.a)({},p),{},{expanded:f,selected:s,checked:l,loaded:c,loading:x,halfChecked:v,dragOver:h,dragOverGapTop:S,dragOverGapBottom:y,pos:u,active:d});return"props"in o||Object.defineProperty(o,"props",{get:function(){return Object(m.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),E}}),o}},"8EBN":function(pt,$e,G){(function(ee){ee(G("VrN/"))})(function(ee){"use strict";ee.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var K=0;K-1&&j.substring(F+1,j.length);if(P)return ee.findModeByExtension(P)},ee.findModeByName=function(j){j=j.toLowerCase();for(var m=0;m=le.length?De.slice(le.length):De}).join(` `)}var L=[],C=["
    "],w=new F.a.Renderer,k=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){L.length=0,C=["
      "]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(z,$,ae,le){if($>=z.length||z[$].level<=ae)return $;var De=z[$];le.push("
    • "+De.text+""),$++;var xe=[];return $=p(z,$,De.level,xe),xe.length>0&&(le.push("
        "),xe.forEach(function(Pe){le.push(Pe)}),le.push("
      ")),le.push("
    • "),$=p(z,$,ae,le),$}function f(){return p(L,0,0,C),C.push("
    "),C.join("")}var s={heading:function($){var ae=k.exec($);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},fences:function($){var ae=this.rules.block.fences.exec($);if(ae){var le=ae[0],De=A(le,ae[3]||""),xe=ae[2]?ae[2].trim():ae[2];if(["latex","katex","math"].indexOf(xe)>=0){var Pe=x(),Le=De;De=Pe,v[Pe]={type:"block",expression:Le}}return{type:"code",raw:le,lang:xe,text:De}}}},l=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,x=function(){return"__special_katext_id_".concat(c++,"__")},v={};function h(){return v}function S(){c=0,v={}}function y(z){return z=z.replace(l,function($,ae){var le=x();return v[le]={type:"inline",expression:ae},le}),z}var u=w.listitem;w.listitem=function(z){return u(y(z))};var d=w.paragraph;w.paragraph=function(z){return d(y(z))};var o=w.tablecell;w.tablecell=function(z,$){return o(y(z),$)},w.code=function(z,$,ae){var le=($||"").match(/\S*/)[0];return le?["latex","katex","math"].indexOf(le)>=0?"

    ".concat(z,"

    "):'
    ').concat(ae?z:Object(P.escape)(z,!0),`
    `):'
    '+(ae?z:Object(P.escape)(z,!0))+"
    "},w.heading=function(z,$,ae){var le=this.options.headerPrefix+ae.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return L.push({anchor:le,level:$,text:z}),"'+z+""},F.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),F.a.use({tokenizer:s,renderer:w});var a=F.a,b=G("SJMd"),g=G("ulZh"),T=G.n(g),M=G("m3rI"),U=G("Oy/b"),W=G("p5ED"),H=/]*>/g;function I(z){var $=document.createElement("div");return $.innerHTML=z,$.childNodes.length===0?"":$.childNodes[0].nodeValue}var N=$e.a=function(z){var $,ae=z.value,le=ae===void 0?"":ae,De=z.className,xe=z.showTextOnly,Pe=z.showLines,Le=z.style,we=Le===void 0?{}:Le,me=z.stylesPrev,pe=me===void 0?{}:me,Q=($=String(le))===null||$===void 0?void 0:$.replace(/|<\/script>/gi,"").replace(/on\w+="[^"]*"/gi,""),de=Object(R.useState)(""),te=Object(K.a)(de,2),fe=te[0],Ae=te[1],_e=Object(R.useMemo)(function(){try{var Ze=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ke=/\"\/api\/attachments\/|\"\/attachments\/download\//g,He=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Q=Q.replace(Ze,"("+M.a.API_SERVER+"/api/attachments/").replace(Ke,'"'+M.a.API_SERVER+"/api/attachments/").replace(He,'"'+M.a.API_SERVER+"/files/uploads/").replace(/\r\n/g,` `),Q=Q.replace(new RegExp("(?[TOC]

    ",f()),O()),rt=rt.replace(/(__special_katext_id_\d+__)/g,function(ot,nt){var Je=at[nt],Te=Je.type,be=Je.expression;return Object(U.renderToString)(I(be)||"",{displayMode:Te==="block",throwOnError:!1,output:"html"})}),rt=rt.replace(/▁/g,"\u2581\u2581\u2581"),S(),xe){var ut=document.createElement("div");return ut.innerHTML=rt,ut.innerText}return setTimeout(function(){return et()},500),rt},[Q]),Ne=Object(R.useRef)();E.WebkitLineClamp=Pe,Pe&&(we=Object(ee.a)(Object(ee.a)({},we),E));function Ge(Ze){var Ke=Ze.target;if(Ke.tagName.toUpperCase()==="A"){var He=Ke.getAttribute("href");if(He.indexOf("office")>-1)Ze.preventDefault(),Ae(He);else if(He.startsWith("#")){Ze.preventDefault();var rt=document.getElementById(He.replace("#",""));rt&&rt.scrollIntoView(!0)}}}var et=function(){var Ke,He=(Ke=Ne.current)===null||Ke===void 0?void 0:Ke.querySelectorAll("video");He==null||He.forEach(function(rt){if(rt.oncontextmenu=function(){return!1},rt.src.indexOf(".m3u8")>-1&&!rt.canPlayType("application/vnd.apple.mpegurl")){if(T.a.isSupported()){var at=new T.a;at.loadSource(rt.src),at.attachMedia(rt)}}})};return Object(R.useEffect)(function(){if(Ne.current&&_e&&(_e.match(H)&&window.PR.prettyPrint()),Ne.current)return Ne.current.addEventListener("click",Ge),function(){Ne.current.removeEventListener("click",Ge),S(),O()}},[_e,Ne.current,Ge]),j.a.createElement(j.a.Fragment,null,j.a.createElement("div",{ref:Ne,style:Object(ee.a)({},we),className:"".concat(De||""," markdown-body "),dangerouslySetInnerHTML:{__html:_e}}),j.a.createElement(W.a,{close:!0,data:fe,type:fe!=null&&fe.length?"office":"",style:Object(ee.a)({},pe),onClose:function(){return Ae("")}}))}},"9VGf":function(pt,$e,G){"use strict";G.d($e,"a",function(){return R});var ee=G("q1tI"),K=G.n(ee);function R(j,m){var _=Object(ee.useRef)();Object(ee.useEffect)(function(){_.current=j}),Object(ee.useEffect)(function(){function F(){_.current()}if(m!==null){var P=setInterval(F,m);return function(){return clearInterval(P)}}},[m])}},BU3w:function(pt,$e,G){"use strict";G.d($e,"a",function(){return _});var ee=G("MNnm"),K="rc-util-key";function R(F){if(F.attachTo)return F.attachTo;var P=document.querySelector("head");return P||document.body}function j(F){var P,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var L=document.createElement("style");if((P=A.csp)===null||P===void 0?void 0:P.nonce){var C;L.nonce=(C=A.csp)===null||C===void 0?void 0:C.nonce}L.innerHTML=F;var w=R(A),k=w.firstChild;return A.prepend&&w.prepend?w.prepend(L):A.prepend&&k?w.insertBefore(L,k):w.appendChild(L),L}var m=new Map;function _(F,P){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=R(A);if(!m.has(L)){var C=j("",A),w=C.parentNode;m.set(L,w),w.removeChild(C)}var k=Array.from(m.get(L).children).find(function(s){return s.tagName==="STYLE"&&s[K]===P});if(k){var O,E;if(((O=A.csp)===null||O===void 0?void 0:O.nonce)&&k.nonce!==((E=A.csp)===null||E===void 0?void 0:E.nonce)){var p;k.nonce=(p=A.csp)===null||p===void 0?void 0:p.nonce}return k.innerHTML!==F&&(k.innerHTML=F),k}var f=j(F,A);return f[K]=P,f}},Bd2K:function(pt,$e,G){(function(ee){ee(G("VrN/"),G("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(A,L,C){if(C!=ee.Init&&C&&A.removeKeyMap("autoCloseTags"),!L)return;var w={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(w["'/'"]=function(k){return _(k)}),(typeof L!="object"||L.whenOpening!==!1)&&(w["'>'"]=function(k){return j(k)}),A.addKeyMap(w)});var K=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function j(A){if(A.getOption("disableInput"))return ee.Pass;for(var L=A.listSelections(),C=[],w=A.getOption("autoCloseTags"),k=0;kO.ch&&(l=l.slice(0,l.length-E.end+O.ch));var h=l.toLowerCase();if(!l||E.type=="string"&&(E.end!=O.ch||!/[\"\']/.test(E.string.charAt(E.string.length-1))||E.string.length==1)||E.type=="tag"&&s.close||E.string.indexOf("/")==O.ch-E.start-1||x&&F(x,h)>-1||P(A,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(f)||[],l,O,!0))return ee.Pass;var S=typeof w=="object"&&w.emptyTags;if(S&&F(S,l)>-1){C[k]={text:"/>",newPos:ee.Pos(O.line,O.ch+2)};continue}var y=v&&F(v,h)>-1;C[k]={indent:y,text:">"+(y?` `:"")+"",newPos:y?ee.Pos(O.line+1,0):ee.Pos(O.line,O.ch+1)}}for(var u=typeof w=="object"&&w.dontIndentOnAutoClose,k=L.length-1;k>=0;k--){var d=C[k];A.replaceRange(d.text,L[k].head,L[k].anchor,"+insert");var o=A.listSelections().slice(0);o[k]={head:d.newPos,anchor:d.newPos},A.setSelections(o),!u&&d.indent&&(A.indentLine(d.newPos.line,null,!0),A.indentLine(d.newPos.line+1,null,!0))}}function m(A,L){for(var C=A.listSelections(),w=[],k=L?"/":""&&(x+=">"),w[p]=x}if(A.replaceSelections(w),C=A.listSelections(),!E)for(var p=0;p=0&&L[f]==C;f--)++p;w=E.to;for(var f=1;f0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],C=0;Che.length)&&(ue=he.length);for(var ie=0,Y=new Array(ue);ie=he.length?{done:!0}:{done:!1,value:he[Y++]}}}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 ie=he[Symbol.iterator](),ie.next.bind(ie)}function _(he,ue){return ue={exports:{}},he(ue,ue.exports),ue.exports}var F=_(function(he){function ue(){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 ie(Y){he.exports.defaults=Y}he.exports={defaults:ue(),getDefaults:ue,changeDefaults:ie}}),P=F.defaults,A=F.getDefaults,L=F.changeDefaults,C=/[&<>"']/,w=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,E={"&":"&","<":"<",">":">",'"':""","'":"'"},p=function(ue){return E[ue]};function f(he,ue){if(ue){if(C.test(he))return he.replace(w,p)}else if(k.test(he))return he.replace(O,p);return he}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(he){return he.replace(s,function(ue,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var c=/(^|[^\[])\^/g;function x(he,ue){he=he.source||he,ue=ue||"";var ie={replace:function(q,re){return re=re.source||re,re=re.replace(c,"$1"),he=he.replace(q,re),ie},getRegex:function(){return new RegExp(he,ue)}};return ie}var v=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function S(he,ue,ie){if(he){var Y;try{Y=decodeURIComponent(l(ie)).replace(v,"").toLowerCase()}catch(q){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ue&&!h.test(ie)&&(ie=a(ue,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(q){return null}return ie}var y={},u=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(he,ue){y[" "+he]||(u.test(he)?y[" "+he]=he+"/":y[" "+he]=M(he,"/",!0)),he=y[" "+he];var ie=he.indexOf(":")===-1;return ue.substring(0,2)==="//"?ie?ue:he.replace(d,"$1")+ue:ue.charAt(0)==="/"?ie?ue:he.replace(o,"$1")+ue:he+ue}var b={exec:function(){}};function g(he){for(var ue=1,ie,Y;ue=0&&Se[Ye]==="\\";)Ue=!Ue;return Ue?"|":" |"}),Y=ie.split(/ \|/),q=0;if(Y.length>ue)Y.splice(ue);else for(;Y.length=Y.length?q.slice(Y.length):q}).join(` `)}var xe=function(){function he(ie){this.options=ie||I}var ue=he.prototype;return ue.space=function(Y){var q=this.rules.block.newline.exec(Y);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:` `}},ue.code=function(Y,q){var re=this.rules.block.code.exec(Y);if(re){var oe=q[q.length-1];if(oe&&oe.type==="paragraph")return{raw:re[0],text:re[0].trimRight()};var Se=re[0].replace(/^ {4}/gm,"");return{type:"code",raw:re[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:N(Se,` `)}}},ue.fences=function(Y){var q=this.rules.block.fences.exec(Y);if(q){var re=q[0],oe=De(re,q[3]||"");return{type:"code",raw:re,lang:q[2]?q[2].trim():q[2],text:oe}}},ue.heading=function(Y){var q=this.rules.block.heading.exec(Y);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},ue.nptable=function(Y){var q=this.rules.block.nptable.exec(Y);if(q){var re={type:"table",header:z(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(` `):[],raw:q[0]};if(re.header.length===re.align.length){var oe=re.align.length,Se;for(Se=0;Se ?/gm,"");return{type:"blockquote",raw:q[0],text:re}}},ue.list=function(Y){var q=this.rules.block.list.exec(Y);if(q){for(var re=q[0],oe=q[2],Se=oe.length>1,Ue=oe[oe.length-1]===")",Ye={type:"list",raw:re,ordered:Se,start:Se?+oe.slice(0,-1):"",loose:!1,items:[]},dt=q[0].match(this.rules.block.item),ht=!1,st,Dt,Mt,Tt,zt,Xt,St,Bt=dt.length,gt=0;gt1||this.options.smartLists&&Mt!==oe)&&(Tt=dt.slice(gt+1).join(` `),Ye.raw=Ye.raw.substring(0,Ye.raw.length-Tt.length),gt=Bt-1)),zt=ht||/\n\n(?!\s*$)/.test(st),gt!==Bt-1&&(ht=st.charAt(st.length-1)===` `,zt||(zt=ht)),zt&&(Ye.loose=!0),Xt=/^\[[ xX]\] /.test(st),St=void 0,Xt&&(St=st[1]!==" ",st=st.replace(/^\[[ xX]\] +/,"")),Ye.items.push({type:"list_item",raw:re,task:Xt,checked:St,loose:zt,text:st});return Ye}},ue.html=function(Y){var q=this.rules.block.html.exec(Y);if(q)return{type:this.options.sanitize?"paragraph":"html",raw:q[0],pre:!this.options.sanitizer&&(q[1]==="pre"||q[1]==="script"||q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):$(q[0]):q[0]}},ue.def=function(Y){var q=this.rules.block.def.exec(Y);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var re=q[1].toLowerCase().replace(/\s+/g," ");return{tag:re,raw:q[0],href:q[2],title:q[3]}}},ue.table=function(Y){var q=this.rules.block.table.exec(Y);if(q){var re={type:"table",header:z(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(` `):[]};if(re.header.length===re.align.length){re.raw=q[0];var oe=re.align.length,Se;for(Se=0;Se/i.test(oe[0])&&(q=!1),!re&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?re=!0:re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(re=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:q,inRawBlock:re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):$(oe[0]):oe[0]}},ue.link=function(Y){var q=this.rules.inline.link.exec(Y);if(q){var re=ae(q[2],"()");if(re>-1){var oe=q[0].indexOf("!")===0?5:4,Se=oe+q[1].length+re;q[2]=q[2].substring(0,re),q[0]=q[0].substring(0,Se).trim(),q[3]=""}var Ue=q[2],Ye="";if(this.options.pedantic){var dt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);dt?(Ue=dt[1],Ye=dt[3]):Ye=""}else Ye=q[3]?q[3].slice(1,-1):"";Ue=Ue.trim().replace(/^<([\s\S]*)>$/,"$1");var ht=le(q,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:Ye&&Ye.replace(this.rules.inline._escapes,"$1")},q[0]);return ht}},ue.reflink=function(Y,q){var re;if((re=this.rules.inline.reflink.exec(Y))||(re=this.rules.inline.nolink.exec(Y))){var oe=(re[2]||re[1]).replace(/\s+/g," ");if(oe=q[oe.toLowerCase()],!oe||!oe.href){var Se=re[0].charAt(0);return{type:"text",raw:Se,text:Se}}var Ue=le(re,oe,re[0]);return Ue}},ue.strong=function(Y,q,re){re===void 0&&(re="");var oe=this.rules.inline.strong.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){q=q.slice(-1*Y.length);var Se=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Se.lastIndex=0;for(var Ue;(oe=Se.exec(q))!=null;)if(Ue=this.rules.inline.strong.middle.exec(q.slice(0,oe.index+3)),Ue)return{type:"strong",raw:Y.slice(0,Ue[0].length),text:Y.slice(2,Ue[0].length-2)}}},ue.em=function(Y,q,re){re===void 0&&(re="");var oe=this.rules.inline.em.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(re===""||this.rules.inline.punctuation.exec(re)))){q=q.slice(-1*Y.length);var Se=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Se.lastIndex=0;for(var Ue;(oe=Se.exec(q))!=null;)if(Ue=this.rules.inline.em.middle.exec(q.slice(0,oe.index+2)),Ue)return{type:"em",raw:Y.slice(0,Ue[0].length),text:Y.slice(1,Ue[0].length-1)}}},ue.codespan=function(Y){var q=this.rules.inline.code.exec(Y);if(q){var re=q[2].replace(/\n/g," "),oe=/[^ ]/.test(re),Se=re.startsWith(" ")&&re.endsWith(" ");return oe&&Se&&(re=re.substring(1,re.length-1)),re=$(re,!0),{type:"codespan",raw:q[0],text:re}}},ue.br=function(Y){var q=this.rules.inline.br.exec(Y);if(q)return{type:"br",raw:q[0]}},ue.del=function(Y){var q=this.rules.inline.del.exec(Y);if(q)return{type:"del",raw:q[0],text:q[1]}},ue.autolink=function(Y,q){var re=this.rules.inline.autolink.exec(Y);if(re){var oe,Se;return re[2]==="@"?(oe=$(this.options.mangle?q(re[1]):re[1]),Se="mailto:"+oe):(oe=$(re[1]),Se=oe),{type:"link",raw:re[0],text:oe,href:Se,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.url=function(Y,q){var re;if(re=this.rules.inline.url.exec(Y)){var oe,Se;if(re[2]==="@")oe=$(this.options.mangle?q(re[0]):re[0]),Se="mailto:"+oe;else{var Ue;do Ue=re[0],re[0]=this.rules.inline._backpedal.exec(re[0])[0];while(Ue!==re[0]);oe=$(re[0]),re[1]==="www."?Se="http://"+oe:Se=oe}return{type:"link",raw:re[0],text:oe,href:Se,tokens:[{type:"text",raw:oe,text:oe}]}}},ue.inlineText=function(Y,q,re){var oe=this.rules.inline.text.exec(Y);if(oe){var Se;return q?Se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):$(oe[0]):oe[0]:Se=$(this.options.smartypants?re(oe[0]):oe[0]),{type:"text",raw:oe[0],text:Se}}},he}(),Pe=H.noopTest,Le=H.edit,we=H.merge,me={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Le(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Le(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Le(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",me._comment=//,me.html=Le(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Le(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.blockquote=Le(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=we({},me),me.gfm=we({},me.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),me.gfm.nptable=Le(me.gfm.nptable).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.gfm.table=Le(me.gfm.table).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",me._tag).getRegex(),me.pedantic=we({},me.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Pe,paragraph:Le(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var pe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,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:Pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",pe.punctuation=Le(pe.punctuation).replace(/punctuation/g,pe._punctuation).getRegex(),pe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",pe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",pe.em.start=Le(pe.em.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.middle=Le(pe.em.middle).replace(/punctuation/g,pe._punctuation).replace(/overlapSkip/g,pe._overlapSkip).getRegex(),pe.em.endAst=Le(pe.em.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.em.endUnd=Le(pe.em.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.start=Le(pe.strong.start).replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.middle=Le(pe.strong.middle).replace(/punctuation/g,pe._punctuation).replace(/blockSkip/g,pe._blockSkip).getRegex(),pe.strong.endAst=Le(pe.strong.endAst,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.strong.endUnd=Le(pe.strong.endUnd,"g").replace(/punctuation/g,pe._punctuation).getRegex(),pe.blockSkip=Le(pe._blockSkip,"g").getRegex(),pe.overlapSkip=Le(pe._overlapSkip,"g").getRegex(),pe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,pe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,pe._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])?)+(?![-_])/,pe.autolink=Le(pe.autolink).replace("scheme",pe._scheme).replace("email",pe._email).getRegex(),pe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,pe.tag=Le(pe.tag).replace("comment",me._comment).replace("attribute",pe._attribute).getRegex(),pe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,pe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,pe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,pe.link=Le(pe.link).replace("label",pe._label).replace("href",pe._href).replace("title",pe._title).getRegex(),pe.reflink=Le(pe.reflink).replace("label",pe._label).getRegex(),pe.reflinkSearch=Le(pe.reflinkSearch,"g").replace("reflink",pe.reflink).replace("nolink",pe.nolink).getRegex(),pe.normal=we({},pe),pe.pedantic=we({},pe.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",pe._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",pe._label).getRegex()}),pe.gfm=we({},pe.normal,{escape:Le(pe.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&&(Y="x"+Y.toString(16)),ue+="&#"+Y+";";return ue}var Ne=function(){function he(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||de,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:te.normal,inline:fe.normal};this.options.pedantic?(Y.block=te.pedantic,Y.inline=fe.pedantic):this.options.gfm&&(Y.block=te.gfm,this.options.breaks?Y.inline=fe.breaks:Y.inline=fe.gfm),this.tokenizer.rules=Y}he.lex=function(Y,q){var re=new he(q);return re.lex(Y)};var ue=he.prototype;return ue.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},ue.blockTokens=function(Y,q,re){q===void 0&&(q=[]),re===void 0&&(re=!0),Y=Y.replace(/^ +$/gm,"");for(var oe,Se,Ue,Ye;Y;){if(oe=this.tokenizer.space(Y)){Y=Y.substring(oe.raw.length),oe.type&&q.push(oe);continue}if(oe=this.tokenizer.code(Y,q)){Y=Y.substring(oe.raw.length),oe.type?q.push(oe):(Ye=q[q.length-1],Ye.raw+=` `+oe.raw,Ye.text+=` `+oe.text);continue}if(oe=this.tokenizer.fences(Y)){Y=Y.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.heading(Y)){Y=Y.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.nptable(Y)){Y=Y.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.hr(Y)){Y=Y.substring(oe.raw.length),q.push(oe);continue}if(oe=this.tokenizer.blockquote(Y)){Y=Y.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],re),q.push(oe);continue}if(oe=this.tokenizer.list(Y)){for(Y=Y.substring(oe.raw.length),Ue=oe.items.length,Se=0;Se0)for(;(dt=this.tokenizer.rules.inline.reflinkSearch.exec(Ye))!=null;)ht.includes(dt[0].slice(dt[0].lastIndexOf("[")+1,-1))&&(Ye=Ye.slice(0,dt.index)+"["+"a".repeat(dt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(dt=this.tokenizer.rules.inline.blockSkip.exec(Ye))!=null;)Ye=Ye.slice(0,dt.index)+"["+"a".repeat(dt[0].length-2)+"]"+Ye.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(Ue=this.tokenizer.escape(Y)){Y=Y.substring(Ue.raw.length),q.push(Ue);continue}if(Ue=this.tokenizer.tag(Y,re,oe)){Y=Y.substring(Ue.raw.length),re=Ue.inLink,oe=Ue.inRawBlock,q.push(Ue);continue}if(Ue=this.tokenizer.link(Y)){Y=Y.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,oe)),q.push(Ue);continue}if(Ue=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(Ue.raw.length),Ue.type==="link"&&(Ue.tokens=this.inlineTokens(Ue.text,[],!0,oe)),q.push(Ue);continue}if(Ue=this.tokenizer.strong(Y,Ye,Se)){Y=Y.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],re,oe),q.push(Ue);continue}if(Ue=this.tokenizer.em(Y,Ye,Se)){Y=Y.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],re,oe),q.push(Ue);continue}if(Ue=this.tokenizer.codespan(Y)){Y=Y.substring(Ue.raw.length),q.push(Ue);continue}if(Ue=this.tokenizer.br(Y)){Y=Y.substring(Ue.raw.length),q.push(Ue);continue}if(Ue=this.tokenizer.del(Y)){Y=Y.substring(Ue.raw.length),Ue.tokens=this.inlineTokens(Ue.text,[],re,oe),q.push(Ue);continue}if(Ue=this.tokenizer.autolink(Y,_e)){Y=Y.substring(Ue.raw.length),q.push(Ue);continue}if(!re&&(Ue=this.tokenizer.url(Y,_e))){Y=Y.substring(Ue.raw.length),q.push(Ue);continue}if(Ue=this.tokenizer.inlineText(Y,oe,Ae)){Y=Y.substring(Ue.raw.length),Se=Ue.raw.slice(-1),q.push(Ue);continue}if(Y){var st="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return q},K(he,null,[{key:"rules",get:function(){return{block:te,inline:fe}}}]),he}(),Ge=F.defaults,et=H.cleanUrl,Ze=H.escape,Ke=function(){function he(ie){this.options=ie||Ge}var ue=he.prototype;return ue.code=function(Y,q,re){var oe=(q||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(Y,oe);Se!=null&&Se!==Y&&(re=!0,Y=Se)}return oe?'
    '+(re?Y:Ze(Y,!0))+`
    `:"
    "+(re?Y:Ze(Y,!0))+`
    `},ue.blockquote=function(Y){return`
    `+Y+`
    `},ue.html=function(Y){return Y},ue.heading=function(Y,q,re,oe){return this.options.headerIds?"'+Y+" `:""+Y+" `},ue.hr=function(){return this.options.xhtml?`
    `:`
    `},ue.list=function(Y,q,re){var oe=q?"ol":"ul",Se=q&&re!==1?' start="'+re+'"':"";return"<"+oe+Se+`> `+Y+" `},ue.listitem=function(Y){return"
  • "+Y+`
  • `},ue.checkbox=function(Y){return" "},ue.paragraph=function(Y){return"

    "+Y+`

    `},ue.table=function(Y,q){return q&&(q=""+q+""),` `+Y+` `+q+`
    `},ue.tablerow=function(Y){return` `+Y+` `},ue.tablecell=function(Y,q){var re=q.header?"th":"td",oe=q.align?"<"+re+' align="'+q.align+'">':"<"+re+">";return oe+Y+" `},ue.strong=function(Y){return""+Y+""},ue.em=function(Y){return""+Y+""},ue.codespan=function(Y){return""+Y+""},ue.br=function(){return this.options.xhtml?"
    ":"
    "},ue.del=function(Y){return""+Y+""},ue.link=function(Y,q,re){if(Y=et(this.options.sanitize,this.options.baseUrl,Y),Y===null)return re;var oe='",oe},ue.image=function(Y,q,re){if(Y=et(this.options.sanitize,this.options.baseUrl,Y),Y===null)return re;var oe=''+re+'":">",oe},ue.text=function(Y){return Y},he}(),He=function(){function he(){}var ue=he.prototype;return ue.strong=function(Y){return Y},ue.em=function(Y){return Y},ue.codespan=function(Y){return Y},ue.del=function(Y){return Y},ue.html=function(Y){return Y},ue.text=function(Y){return Y},ue.link=function(Y,q,re){return""+re},ue.image=function(Y,q,re){return""+re},ue.br=function(){return""},he}(),rt=function(){function he(){this.seen={}}var ue=he.prototype;return ue.slug=function(Y){var q=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(q)){var re=q;do this.seen[re]++,q=re+"-"+this.seen[re];while(this.seen.hasOwnProperty(q))}return this.seen[q]=0,q},he}(),at=F.defaults,ut=H.unescape,ot=function(){function he(ie){this.options=ie||at,this.options.renderer=this.options.renderer||new Ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new He,this.slugger=new rt}he.parse=function(Y,q){var re=new he(q);return re.parse(Y)};var ue=he.prototype;return ue.parse=function(Y,q){q===void 0&&(q=!0);var re="",oe,Se,Ue,Ye,dt,ht,st,Dt,Mt,Tt,zt,Xt,St,Bt,gt,Nt,Wt,Rt,Jt=Y.length;for(oe=0;oe0&>.tokens[0].type==="text"?(gt.tokens[0].text=Rt+" "+gt.tokens[0].text,gt.tokens[0].tokens&>.tokens[0].tokens.length>0&>.tokens[0].tokens[0].type==="text"&&(gt.tokens[0].tokens[0].text=Rt+" "+gt.tokens[0].tokens[0].text)):gt.tokens.unshift({type:"text",text:Rt}):Bt+=Rt),Bt+=this.parse(gt.tokens,St),Mt+=this.renderer.listitem(Bt,Wt,Nt);re+=this.renderer.list(Mt,zt,Xt);continue}case"html":{re+=this.renderer.html(Tt.text);continue}case"paragraph":{re+=this.renderer.paragraph(this.parseInline(Tt.tokens));continue}case"text":{for(Mt=Tt.tokens?this.parseInline(Tt.tokens):Tt.text;oe+1An error occurred:

    "+Te(Ue.message+"",!0)+"
    ";throw Ue}}ke.options=ke.setOptions=function(he){return nt(ke.defaults,he),Be(ke.defaults),ke},ke.getDefaults=be,ke.defaults=ze,ke.use=function(he){var ue=nt({},he);if(he.renderer&&function(){var Y=ke.defaults.renderer||new Ke,q=function(Se){var Ue=Y[Se];Y[Se]=function(){for(var Ye=arguments.length,dt=new Array(Ye),ht=0;ht"+ze+""}),Je},Ae=function(Je,Te){if(Je===""){xe([]);return}var be=[];u.forEach(function(ze){ze.image.length&&ze.image.forEach(function(ke){be.push(ke)})});var Be=be.concat(o).filter(function(ze){var ke;return(ke=ze.name)===null||ke===void 0?void 0:ke.toLocaleLowerCase().includes(Je==null?void 0:Je.toLocaleLowerCase())}).map(function(ze,ke){var Ve=ze.id,he=ze.name,ue=Object(m.a)(Object(m.a)({},ze),{},{label:P.a.createElement("ul",{id:"search-".concat(Q,"-").concat(ke),onClick:function(){return Ze(Ve,ue)},className:ke===Te?w.a.searchListActive:w.a.searchList},P.a.createElement("li",{className:w.a.name,dangerouslySetInnerHTML:{__html:fe(he,Je)}}),ze.private&&P.a.createElement("li",{className:w.a.tag},"\u79C1\u6709"))});return ue});xe(Be)},_e=function(Je){var Te=document.getElementById("scroll-".concat(Q,"-").concat(Je));if(!Te)return;var be=document.getElementById("scroll-".concat(Q));be.scrollTo(0,Te.offsetTop)},Ne=function(Je,Te){var be=document.getElementById("search-".concat(Q,"-").concat(Je));if(!be)return;var Be=document.getElementById("search-".concat(Q)),ze=be.offsetTop-Be.scrollTop>0&&be.offsetTop-Be.scrollTop`,triples:"",explode:"[]{}"},R=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(E,p,f){f&&f!=ee.Init&&(E.removeKeyMap(m),E.state.closeBrackets=null),p&&(_(j(p,"pairs")),E.state.closeBrackets=p,E.addKeyMap(m))});function j(E,p){return p=="pairs"&&typeof E=="string"?E:typeof E=="object"&&E[p]!=null?E[p]:K[p]}var m={Backspace:A,Enter:L};function _(E){for(var p=0;p=0;l--){var x=s[l].head;E.replaceRange("",R(x.line,x.ch-1),R(x.line,x.ch+1),"+delete")}}function L(E){var p=P(E),f=p&&j(p,"explode");if(!f||E.getOption("disableInput"))return ee.Pass;for(var s=E.listSelections(),l=0;l0;return{anchor:new R(E.anchor.line,E.anchor.ch+(p?-1:1)),head:new R(E.head.line,E.head.ch+(p?1:-1))}}function w(E,p){var f=P(E);if(!f||E.getOption("disableInput"))return ee.Pass;var s=j(f,"pairs"),l=s.indexOf(p);if(l==-1)return ee.Pass;for(var c=j(f,"closeBefore"),x=j(f,"triples"),v=s.charAt(l+1)==p,h=E.listSelections(),S=l%2==0,y,u=0;u=0&&E.getRange(o,R(o.line,o.ch+3))==p+p+p?a="skipThree":a="skip";else if(v&&o.ch>1&&x.indexOf(p)>=0&&E.getRange(R(o.line,o.ch-2),o)==p+p){if(o.ch>2&&/\bstring/.test(E.getTokenTypeAt(R(o.line,o.ch-2))))return ee.Pass;a="addFour"}else if(v){var g=o.ch==0?" ":E.getRange(R(o.line,o.ch-1),o);if(!ee.isWordChar(b)&&g!=p&&!ee.isWordChar(g))a="both";else return ee.Pass}else if(S&&(b.length===0||/\s/.test(b)||c.indexOf(b)>-1))a="both";else return ee.Pass;if(!y)y=a;else if(y!=a)return ee.Pass}var T=l%2?s.charAt(l-1):p,M=l%2?p:s.charAt(l+1);E.operation(function(){if(y=="skip")E.execCommand("goCharRight");else if(y=="skipThree")for(var U=0;U<3;U++)E.execCommand("goCharRight");else if(y=="surround"){for(var W=E.getSelections(),U=0;U50;return pe?(_.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E50MB"),!1):!0},Pe=function(){var we=Object(F.a)(f.a.mark(function me(pe){var Q,de,te,fe,Ae,_e,Ne,Ge;return f.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return te=pe||{},fe=te.language,Ae=te.env,_e=te.mode,Ne=te.code,Ze.next=3,M({type:"newShixuns/applyShixunMirror",payload:{language:fe,runtime:Ae,run_method:_e,attachment_id:$==null||((Q=$[0])===null||Q===void 0||((de=Q.response)===null||de===void 0))?void 0:de.id}});case 3:Ge=Ze.sent,M({type:"newShixuns/setActionTabs",payload:{}}),Ge&&_.b.success("\u65B0\u5EFA\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u5BA1\u6838\u3002");case 6:case"end":return Ze.stop()}},me)}));return function(pe){return we.apply(this,arguments)}}(),Le=function(){I.resetFields(),ae([])};return l.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:b.actionTabs.key==="NewShixuns-Apply",title:"\u7533\u8BF7\u65B0\u5EFA",width:"1000px",footer:null,afterClose:Le},l.a.createElement("section",{className:y.a.qrCode},l.a.createElement("aside",{className:y.a.a1},l.a.createElement("div",{className:y.a.code},l.a.createElement("img",{width:120,height:120,src:h.a,alt:"\u4E8C\u7EF4\u7801"})),l.a.createElement("div",{className:y.a.group},"\u5B9E\u9A8C\u73AF\u5883\u7533\u8BF7QQ\u7FA4"),l.a.createElement("div",{className:y.a.groupNumber},"\u7FA4\u53F7\uFF1A740157011")),l.a.createElement("aside",{className:y.a.a2},"\u5C0A\u656C\u7684\u8001\u5E08/\u540C\u5B66\u60A8\u597D\uFF0C",l.a.createElement("br",null),"\u5982\u679C\u60A8\u60F3\u65B0\u5EFA\u5B9E\u9A8C\u73AF\u5883\uFF0C\u53EF\u4EE5\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801\u8FDB\u7FA4\uFF0C\u76F4\u63A5\u5411\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u7533\u8BF7\u54E6~ \u4E5F\u53EF\u4EE5\u63D0\u4EA4\u4E0B\u9762\u7684\u8868\u5355\u7533\u8BF7\uFF0C\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u6536\u5230\u7533\u8BF7\u4FE1\u606F\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8054\u7CFB\u60A8\uFF01")),l.a.createElement(C.a,{className:y.a.formWrap,form:I,labelCol:{span:4},wrapperCol:{span:20},onFinish:Pe},l.a.createElement(C.a.Item,{label:"\u8BED\u8A00\uFF1A",name:"language",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00"}]},l.a.createElement(u,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48\u8BED\u8A00\uFF1A\u793A\u4F8B\uFF1APython",rows:4})),l.a.createElement(C.a.Item,{label:"\u7CFB\u7EDF\u73AF\u5883\uFF1A",name:"env",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u8BED\u8A00\u7CFB\u7EDF\u73AF\u5883"}]},l.a.createElement(u,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48linux\u7CFB\u7EDF\u73AF\u5883,\u4EE3\u7801\u8FD0\u884C\u73AF\u5883",rows:4})),l.a.createElement(C.a.Item,{label:"\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F\uFF1A",name:"mode",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F"}]},l.a.createElement(u,{placeholder:"\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u4E2D\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F",rows:4})),l.a.createElement(C.a.Item,{label:"\u6D4B\u8BD5\u4EE3\u7801\uFF1A",name:"code",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},l.a.createElement("div",{className:y.a.upload},l.a.createElement(j.a,{fileList:$,action:"".concat(x.a.API_SERVER,"/api/attachments.json?client_key=6d57f8c3dd186c5ada392546ace9620a"),onChange:le,onRemove:De,beforeUpload:xe,withCredentials:!0},l.a.createElement("span",{className:"".concat(y.a.color0152d9," current")},"\u4E0A\u4F20\u9644\u4EF6"),l.a.createElement("span",{className:"".concat(y.a.colorCCC," ml10")},"(\u5355\u4E2A\u6587\u4EF650M\u4EE5\u5185)")))),l.a.createElement("div",{className:y.a.footerWrap},l.a.createElement(C.a.Item,null,l.a.createElement(K.a,{className:"mr5",size:"large",onClick:function(){M({type:"newShixuns/setActionTabs",payload:{}})}},"\u53D6\u6D88"),l.a.createElement(K.a,{size:"large",type:"primary",htmlType:"submit",loading:T["newShixuns/applyShixunMirror"]},"\u4FDD\u5B58")))))};$e.a=Object(c.a)(function(o){var a=o.newShixuns,b=o.loading,g=o.globalSetting;return{newShixuns:a,globalSetting:g,loading:b.effects}})(d)},GfqC:function(pt,$e,G){"use strict";var ee=G("q1tI"),K=G.n(ee),R=G("TSYQ"),j=G.n(R);function m(H,I){var N="cannot "+H.method+" "+H.action+" "+I.status+"'",z=new Error(N);return z.status=I.status,z.method=H.method,z.url=H.action,z}function _(H){var I=H.responseText||H.response;if(!I)return I;try{return JSON.parse(I)}catch(N){return I}}function F(H){var I=new XMLHttpRequest;H.onProgress&&I.upload&&(I.upload.onprogress=function(ae){ae.total>0&&(ae.percent=ae.loaded/ae.total*100),H.onProgress(ae)});var N=new FormData;H.data&&Object.keys(H.data).forEach(function($){var ae=H.data[$];if(Array.isArray(ae)){ae.forEach(function(le){N.append($+"[]",le)});return}N.append($,H.data[$])}),H.file instanceof Blob?N.append(H.filename,H.file,H.file.name):N.append(H.filename,H.file),I.onerror=function(ae){H.onError(ae)},I.onload=function(){return I.status<200||I.status>=300?H.onError(m(H,I),_(I)):H.onSuccess(_(I),I)},I.open(H.method,H.action,!0),H.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var z=H.headers||{};return z["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(z).forEach(function($){z[$]!==null&&I.setRequestHeader($,z[$])}),I.send(N),{abort:function(){I.abort()}}}var P=+new Date,A=0;function L(){return"rc-upload-"+P+"-"+ ++A}function C(H,I){return H.indexOf(I,H.length-I.length)!==-1}var w=function(H,I){if(H&&I){var N=Array.isArray(I)?I:I.split(","),z=H.name||"",$=H.type||"",ae=$.replace(/\/.*$/,"");return N.some(function(le){var De=le.trim();return De.charAt(0)==="."?C(z.toLowerCase(),De.toLowerCase()):/\/\*$/.test(De)?ae===De.replace(/\/.*$/,""):$===De})}return!0};function k(H,I){var N=H.createReader(),z=[];function $(){N.readEntries(function(ae){var le=Array.prototype.slice.apply(ae);z=z.concat(le);var De=!le.length;De?I(z):$()})}$()}var O=function(I,N,z){var $=function ae(le,De){De=De||"",le.isFile?le.file(function(xe){z(xe)&&(le.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=le.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),N([xe]))}):le.isDirectory&&k(le,function(xe){xe.forEach(function(Pe){ae(Pe,""+De+le.name+"/")})})};I.forEach(function(ae){$(ae.webkitGetAsEntry())})},E=O,p=Object.assign||function(H){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(H,z))continue;N[z]=H[z]}return N}function x(H,I){if(!(H instanceof I))throw new TypeError("Cannot call a class as a function")}function v(H,I){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:H}function h(H,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);H.prototype=Object.create(I&&I.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(H,I):H.__proto__=I)}var S=function(I){return Object.keys(I).reduce(function(N,z){return(z.substr(0,5)==="data-"||z.substr(0,5)==="aria-"||z==="role")&&(N[z]=I[z]),N},{})},y=function(H){h(I,H);function I(){var N,z,$,ae;x(this,I);for(var le=arguments.length,De=Array(le),xe=0;xe1&&arguments[1]!==void 0?arguments[1]:1,ie=He.length,Y=0;Y1&&arguments[1]!==void 0?arguments[1]:!1;return Object(S.a)(N).map(function($,ae){if(!m.isValidElement($)||!$.type)return null;var le=$.type.isSelectOptGroup,De=$.key,xe=$.props,Pe=xe.children,Le=Object(F.a)(xe,["children"]);return z||!le?y($):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(De===null?ae:De,"__"),label:De},Le),{},{options:u(Pe)})}).filter(function($){return $})}var d=G("2Qr1"),o=G("qNPg"),a=G("U8pU"),b=G("Kwbf"),g=G("WKfj");function T(N){var z=N.mode,$=N.options,ae=N.children,le=N.backfill,De=N.allowClear,xe=N.placeholder,Pe=N.getInputElement,Le=N.showSearch,we=N.onSearch,me=N.defaultOpen,pe=N.autoFocus,Q=N.labelInValue,de=N.value,te=N.inputValue,fe=N.optionLabelProp,Ae=z==="multiple"||z==="tags",_e=Le!==void 0?Le:Ae||z==="combobox",Ne=$||u(ae);if(Object(b.a)(z!=="tags"||Ne.every(function(Ke){return!Ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Ge=Ne.some(function(Ke){return Ke.options?Ke.options.some(function(He){return typeof("value"in He?He.value:He.key)=="number"}):typeof("value"in Ke?Ke.value:Ke.key)=="number"});Object(b.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(z!=="combobox"||!fe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(z==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(b.a)(z==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(b.b)(z!=="combobox"||!Pe||!De||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!_e&&z!=="combobox"&&z!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!me||pe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var et=Object(g.d)(de);Object(b.a)(!Q||et.every(function(Ke){return Object(a.a)(Ke)==="object"&&("key"in Ke||"value"in Ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ae||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var Ze=null;Object(S.a)(ae).some(function(Ke){if(!m.isValidElement(Ke)||!Ke.type)return!1;var He=Ke.type;if(He.isSelectOption)return!1;if(He.isSelectOptGroup){var rt=Object(S.a)(Ke.props.children).every(function(at){return!m.isValidElement(at)||!Ke.type||at.type.isSelectOption?!0:(Ze=at.type,!1)});return!rt}return Ze=He,!0}),Ze&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ze.displayName||Ze.name||Ze,"`.")),Object(b.a)(te===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=T,U=Object(o.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:u,flattenOptions:d.d,getLabeledValue:d.e,filterOptions:d.b,isValueDisabled:d.g,findValueOption:d.c,warningProps:M,fillOptionsWithMissingValue:d.a}),W=function(N){Object(R.a)($,N);var z=Object(j.a)($);function $(){var ae;return Object(ee.a)(this,$),ae=z.apply(this,arguments),ae.selectRef=m.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object(K.a)($,[{key:"render",value:function(){return m.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),$}(m.Component);W.Option=c,W.OptGroup=v;var H=W,I=$e.c=H},M8RZ:function(pt,$e,G){"use strict";G.d($e,"a",function(){return A});var ee=G("fWQN"),K=G("mtLc"),R=G("yKVA"),j=G("879j"),m=G("q1tI"),_=G.n(m),F=G("i8i4"),P=G.n(F),A=function(L){Object(R.a)(w,L);var C=Object(j.a)(w);function w(k){var O;Object(ee.a)(this,w),O=C.call(this,k);var E=window.document;return O.node=E.createElement("div"),E.body.appendChild(O.node),O}return Object(K.a)(w,[{key:"render",value:function(){var O=this.props.children;return Object(F.createPortal)(O,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),w}(_.a.Component)},N3QO:function(pt,$e,G){"use strict";var ee=G("2qtc"),K=G("kLXV"),R=G("tJVT"),j=G("q1tI"),m=G.n(j),_=G("9kvl"),F=G("FPkq"),P=G.n(F),A=function(C){var w,k=C.newShixuns,O=C.dispatch,E=C.user,p=Object(j.useState)(!1),f=Object(R.a)(p,2),s=f[0],l=f[1];Object(j.useEffect)(function(){k.actionTabs.key==="Create-Environment"&&x()},[k==null||((w=k.actionTabs)===null||w===void 0)?void 0:w.key]);var c=function(){O({type:"newShixuns/setActionTabs",payload:{}})},x=function(){var h,S,y;c(),((h=E.userInfo)===null||h===void 0?void 0:h.mirror_marker_status)===0?l(!0):((S=E.userInfo)===null||S===void 0?void 0:S.mirror_marker_status)===1?_.d.push("/shixuns/new/CreateImg"):((y=E.userInfo)===null||y===void 0?void 0:y.mirror_marker_status)===2&&K.a.confirm({title:"\u60A8\u4ECA\u65E5\u5DF2\u8FBE\u5230\u7533\u8BF7\u4E0A\u9650\uFF0C\u662F\u5426\u8DF3\u8F6C\u81F3\u4E91\u4E3B\u673A\u5217\u8868\uFF1F",content:"\u63D0\u793A\uFF1A\u6BCF\u5929\u6700\u591A\u5141\u8BB8\u7533\u8BF7\u4E00\u53F0\u4E91\u4E3B\u673A",okText:"\u8DF3\u8F6C",cancelText:"\u53D6\u6D88",onOk:function(){var d;_.d.push("/users/".concat((d=E.userInfo)===null||d===void 0?void 0:d.login,"/experiment-img"))}})};return m.a.createElement(K.a,{title:"\u52A0\u5165qq\u7FA4\u63D0\u793A",visible:s,footer:null,onCancel:function(){l(!1)}},m.a.createElement("div",{style:{textAlign:"center"}},m.a.createElement("br",null),m.a.createElement("img",{width:120,height:120,style:{marginTop:"20px"},src:P.a,alt:"\u4E8C\u7EF4\u7801"})),m.a.createElement("img",null))};$e.a=Object(_.a)(function(L){var C=L.newShixuns,w=L.user,k=L.globalSetting;return{newShixuns:C,globalSetting:k,user:w}})(A)},NvD2:function(pt,$e,G){"use strict";G.d($e,"a",function(){return _});var ee=G("Kwbf");function K(F,P){var A=new Set;return F.forEach(function(L){P.has(L)||A.add(L)}),A}function R(F){var P=F||{},A=P.disabled,L=P.disableCheckbox,C=P.checkable;return!!(A||L)||C===!1}function j(F,P,A,L){for(var C=new Set(F),w=new Set,k=0;k<=A;k+=1){var O=P.get(k)||new Set;O.forEach(function(s){var l=s.key,c=s.node,x=s.children,v=x===void 0?[]:x;C.has(l)&&!L(c)&&v.filter(function(h){return!L(h.node)}).forEach(function(h){C.add(h.key)})})}for(var E=new Set,p=A;p>=0;p-=1){var f=P.get(p)||new Set;f.forEach(function(s){var l=s.parent,c=s.node;if(L(c)||!s.parent||E.has(s.parent.key))return;if(L(s.parent.node)){E.add(l.key);return}var x=!0,v=!1;(l.children||[]).filter(function(h){return!L(h.node)}).forEach(function(h){var S=h.key,y=C.has(S);x&&!y&&(x=!1),!v&&(y||w.has(S))&&(v=!0)}),x&&C.add(l.key),v&&w.add(l.key),E.add(l.key)})}return{checkedKeys:Array.from(C),halfCheckedKeys:Array.from(K(w,C))}}function m(F,P,A,L,C){for(var w=new Set(F),k=new Set(P),O=0;O<=L;O+=1){var E=A.get(O)||new Set;E.forEach(function(l){var c=l.key,x=l.node,v=l.children,h=v===void 0?[]:v;!w.has(c)&&!k.has(c)&&!C(x)&&h.filter(function(S){return!C(S.node)}).forEach(function(S){w.delete(S.key)})})}k=new Set;for(var p=new Set,f=L;f>=0;f-=1){var s=A.get(f)||new Set;s.forEach(function(l){var c=l.parent,x=l.node;if(C(x)||!l.parent||p.has(l.parent.key))return;if(C(l.parent.node)){p.add(c.key);return}var v=!0,h=!1;(c.children||[]).filter(function(S){return!C(S.node)}).forEach(function(S){var y=S.key,u=w.has(y);v&&!u&&(v=!1),!h&&(u||k.has(y))&&(h=!0)}),v||w.delete(c.key),h&&k.add(c.key),p.add(c.key)})}return{checkedKeys:Array.from(w),halfCheckedKeys:Array.from(K(k,w))}}function _(F,P,A,L){var C=[],w;L?w=L:w=R;var k=new Set(F.filter(function(f){var s=!!A[f];return s||C.push(f),s})),O=new Map,E=0;Object.keys(A).forEach(function(f){var s=A[f],l=s.level,c=O.get(l);c||(c=new Set,O.set(l,c)),c.add(s),E=Math.max(E,l)}),Object(ee.a)(!C.length,"Tree missing follow keys: ".concat(C.slice(0,100).map(function(f){return"'".concat(f,"'")}).join(", ")));var p;return P===!0?p=j(k,O,E,w):p=m(k,P.halfCheckedKeys,O,E,w),p}},OZM5:function(pt,$e,G){"use strict";G.d($e,"b",function(){return L}),G.d($e,"a",function(){return C}),G.d($e,"k",function(){return w}),G.d($e,"h",function(){return k}),G.d($e,"i",function(){return O}),G.d($e,"g",function(){return E}),G.d($e,"c",function(){return p}),G.d($e,"d",function(){return f}),G.d($e,"j",function(){return c}),G.d($e,"e",function(){return x}),G.d($e,"f",function(){return v});var ee=G("KQm4"),K=G("U8pU"),R=G("Ff2n"),j=G("q1tI"),m=G.n(j),_=G("Kwbf"),F=G("WaYH"),P=.25,A=2;function L(h,S){var y=h.slice(),u=y.indexOf(S);return u>=0&&y.splice(u,1),y}function C(h,S){var y=h.slice();return y.indexOf(S)===-1&&y.push(S),y}function w(h){return h.split("-")}function k(h,S){return"".concat(h,"-").concat(S)}function O(h){return h&&h.type&&h.type.isTreeNode}function E(h,S){var y=[h],u=S[h];function d(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(a){var b=a.key,g=a.children;y.push(b),d(g)})}return d(u.children),y}function p(h,S){var y=h.clientY,u=S.selectHandle.getBoundingClientRect(),d=u.top,o=u.bottom,a=u.height,b=Math.max(a*P,A);return y<=d+b?-1:y>=o-b?1:0}function f(h,S){if(!h)return;var y=S.multiple;return y?h.slice():h.length?[h[0]]:h}var s=function(S){return S};function l(h,S){if(!h)return[];var y=S||{},u=y.processProps,d=u===void 0?s:u,o=Array.isArray(h)?h:[h];return o.map(function(a){var b=a.children,g=Object(R.a)(a,["children"]),T=l(b,S);return m.a.createElement(F.a,Object.assign({},d(g)),T)})}function c(h){if(!h)return null;var S;if(Array.isArray(h))S={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(K.a)(h)==="object")S={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(_.a)(!1,"`checkedKeys` is not an array or an object"),null;return S}function x(h,S){var y=new Set;function u(d){if(y.has(d))return;var o=S[d];if(!o)return;y.add(d);var a=o.parent,b=o.node;if(b.disabled)return;a&&u(a.key)}return(h||[]).forEach(function(d){u(d)}),Object(ee.a)(y)}function v(h){var S={};return Object.keys(h).forEach(function(y){(y.startsWith("data-")||y.startsWith("aria-"))&&(S[y]=h[y])}),S}},Ot1p:function(pt,$e,G){"use strict";var ee=G("2qtc"),K=G("kLXV"),R=G("rAM+"),j=G("miYZ"),m=G("tsqr"),_=G("tJVT"),F=G("jrin"),P=G("q1tI"),A=G.n(P),L=G("VrN/"),C=G.n(L),w=G("bdgK"),k=G("p77/"),O=G("Bd2K"),E=G("ELLl"),p=G("19Vz"),f=G("lZu9"),s=G("+NIl"),l=G("kSUc"),c=G("9Bee"),x=function(ie){var Y=ie.value,q=Y===void 0?"":Y,re=ie.className,oe=ie.showTextOnly,Se=ie.showLines,Ue=ie.style,Ye=Ue===void 0?{}:Ue,dt=Object(P.useMemo)(function(){return""},[q]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:dt}}))},v=G("0Owb"),h=G("dejd"),S=G("C+DQ"),y=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function u(ie){var Y=ie.onActionCallback,q=ie.title,re=ie.icon,oe=ie.actionName,Se=ie.className,Ue=Se===void 0?"":Se,Ye=ie.children;function dt(){Y(oe)}return A.a.createElement("a",{title:q,className:Ue,onClick:dt},A.a.createElement("i",{className:"md-iconfont ".concat(re)}),Ye)}var d=function(ie){var Y=ie.watch,q=ie.showNullButton,re=ie.onActionCallback,oe=ie.fullScreen,Se=ie.insertTemp,Ue=ie.hidetoolBar,Ye=[].concat(y,[{title:"".concat(Y?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Y?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!Ue&&Ye.map(function(dt,ht){return A.a.createElement("li",{key:ht},dt.actionName?A.a.createElement(u,Object(v.a)({},dt,{onActionCallback:re})):A.a.createElement("span",{className:"v-line"}))}),q?A.a.createElement("li",null,A.a.createElement(u,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:re},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Se&&A.a.createElement("li",null,A.a.createElement(u,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Se),onActionCallback:re},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(u,{icon:"".concat(oe?"icon-shrink":"icon-enlarge"),title:oe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:re})))},o=G("M8RZ"),a=G("+L6B"),b=G("2/Rp"),g=G("y8nQ"),T=G("Vl3Y"),M=G("5NDa"),U=G("5rEg"),W={labelCol:{span:4},wrapperCol:{span:20}},H=function(ie){var Y=ie.callback,q=ie.onCancel;function re(oe){Y(oe)}return A.a.createElement(T.a,Object(v.a)({},W,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:re}),A.a.createElement(T.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(U.a,null)),A.a.createElement(T.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(U.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(b.a,{type:"ghost",onClick:q},"\u53D6\u6D88")))},I=G("7ahc"),N=G("HmJG"),z=G("BjJ7"),$=T.a.useForm,ae={width:280,marginRight:10},le={labelCol:{span:5},wrapperCol:{span:19}},De=function(ie){var Y=ie.callback,q=ie.onCancel,re=$(),oe=Object(_.a)(re,1),Se=oe[0];function Ue(ht){Y(ht)}function Ye(ht,st){Se.setFieldsValue({src:"/api/attachments/".concat(ht.id),type:st.type})}function dt(ht){var st=ht.target.files[0];Pe(st,Ye)}return A.a.createElement(T.a,Object(v.a)({form:Se},le,{className:"upload-image-panel",onFinish:Ue}),A.a.createElement(T.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(T.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},A.a.createElement(U.a,{style:ae})),A.a.createElement(xe,{onFileChange:dt}))),A.a.createElement(T.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},A.a.createElement(U.a,{style:{width:264}})),A.a.createElement(T.a.Item,{style:{textAlign:"right"}},A.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(b.a,{type:"ghost",onClick:q},"\u53D6\u6D88")))};function xe(ie){var Y=ie.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:Y}))}function Pe(ie,Y){if(!ie)throw new String("\u6CA1\u6709\u6587\u4EF6");var q=new FormData;q.append("editormd-image-file",ie),q.append("file_param_name","editormd-image-file"),q.append("byxhr","true");var re=new window.XMLHttpRequest;re.withCredentials=!0,re.addEventListener("load",function(oe){Y(JSON.parse(oe.target.responseText),ie)},!1),re.addEventListener("error",function(oe){console.error(oe)},!1),re.open("POST","".concat(z.a,"/api/attachments.json")),re.send(q)}var Le=G("giR+"),we=G("fyUT"),me=G("7Kak"),pe=G("9yH6"),Q=pe.a.Group,de={margin:"0 8px"},te=function(ie){var Y=ie.callback,q=ie.onCancel;function re(oe){Y(oe)}return A.a.createElement(T.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:re},A.a.createElement("div",{className:"flex-container"},A.a.createElement("span",{style:de},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:de},"\u884C\u6570"),A.a.createElement(T.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(we.a,null)),A.a.createElement("span",{style:de},"\u5217\u6570"),A.a.createElement(T.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(we.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12}},A.a.createElement("span",{style:de},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(T.a.Item,{name:"align"},A.a.createElement(Q,null,A.a.createElement(pe.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(pe.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(pe.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(pe.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(b.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(b.a,{type:"ghost",onClick:q},"\u53D6\u6D88")))},fe=G("m3rI"),Ae=G("wMS7"),_e=G.n(Ae),Ne="link",Ge="upload-image",et="code-block",Ze="add-table",Ke="------------",He={default:Ke,left:":".concat(Ke),center:":".concat(Ke,":"),right:"".concat(Ke,":")},rt=G("9VGf"),at,ut;function ot(){}var nt=0,Je=1e4,Te="\u2581",be=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Be(ie){return/^\d+$/.test(ie)?"".concat(ie,"px"):ie}var ze=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=ze?"Cmd":"Ctrl",Ve=(at={},Object(F.a)(at,ke+"-B","bold"),Object(F.a)(at,ke+"-I","italic"),at),he=(ut={},Object(F.a)(ut,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(ut,et,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(ut,Ge,"\u6DFB\u52A0\u56FE\u7247"),Object(F.a)(ut,Ze,"\u6DFB\u52A0\u8868\u683C"),ut),ue=$e.a=function(ie){var Y=ie.defaultValue,q=Y===void 0?"":Y,re=ie.onChange,oe=ie.width,Se=oe===void 0?"100%":oe,Ue=ie.height,Ye=Ue===void 0?400:Ue,dt=ie.miniToolbar,ht=dt===void 0?!1:dt,st=ie.isFocus,Dt=st===void 0?!1:st,Mt=ie.watch,Tt=ie.insertTemp,zt=ie.mode,Xt=zt===void 0?"markdown":zt,St=ie.id,Bt=St===void 0?"markdown-editor-id":St,gt=ie.showResizeBar,Nt=gt===void 0?!1:gt,Wt=ie.noStorage,Rt=Wt===void 0?!1:Wt,Jt=ie.showNullButton,nn=Jt===void 0?!1:Jt,Tn=ie.hidetoolBar,Qt=Tn===void 0?!1:Tn,Gn=ie.fullScreen,Wn=Gn===void 0?!1:Gn,kt=ie.onBlur,ct=ie.onCMBeforeChange,qt=ie.onFullScreen,Mn=ie.className,an=Mn===void 0?"":Mn,Ut=ie.disablePaste,An=Ut===void 0?!1:Ut,It=ie.placeholder,on=It===void 0?"":It,Qe=ie.values,yt=Qe===void 0?"":Qe,Dn=Object(P.useState)(null),bn=Object(_.a)(Dn,2),lt=bn[0],ur=bn[1],Un=Object(P.useState)(q),_t=Object(_.a)(Un,2),Pn=_t[0],Vn=_t[1],Zn=Object(P.useState)(Mt),Rn=Object(_.a)(Zn,2),hr=Rn[0],At=Rn[1],Xe=Object(P.useState)(Wn),Ct=Object(_.a)(Xe,2),Pt=Ct[0],mn=Ct[1],gn=Object(P.useState)(""),qn=Object(_.a)(gn,2),Fn=qn[0],kn=qn[1],Rr=Object(P.useState)(0),Lr=Object(_.a)(Rr,2),Br=Lr[0],gr=Lr[1],Ha=Object(P.useState)(Ye),za=Object(_.a)(Ha,2),aa=za[0],Xr=za[1],ii=Object(P.useState)(!1),Ga=Object(_.a)(ii,2),oi=Ga[0],Ia=Ga[1],ia=Object(P.useRef)(),kr=Object(P.useRef)(),fa=Object(P.useRef)(),ha=Object(P.useRef)();Object(P.useEffect)(function(){Vn(yt),lt==null||lt.setValue(yt)},[yt]),Object(P.useEffect)(function(){qt==null||qt(Pt)},[Pt]),Object(P.useEffect)(function(){if(ia.current){var Kt=C.a.fromTextArea(ia.current,{mode:Xt,lineNumbers:!ht,lineWrapping:!0,value:q,autoCloseTags:!0,autoCloseBrackets:!0});Dt&&Kt.focus();function Gt(Vt,dn){if(An){dn.preventDefault();return}var _n=dn.clipboardData;if(_n){var In=_n.types.toString(),$n=_n.items,er=["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"];if(In==="Files"||_n.types.indexOf("Files")>-1){if(dn.preventDefault(),Xt=="stex")return;try{var Yn,$r=$n[1];((Yn=$n[0])===null||Yn===void 0?void 0:Yn.kind)==="file"&&($r=$n[0]);var tr=$r.getAsFile(),oa=tr.name.split(".").pop();Pe(tr,function(nr){if(nr.id){var Yr,Jr,ga;(tr==null||((Yr=tr.type)===null||Yr===void 0)?void 0:Yr.indexOf("image"))>-1?Kt.replaceSelection("![,](/api/attachments/".concat(nr.id,"?type=").concat(nr.content_type,")")):(tr==null||((Jr=tr.type)===null||Jr===void 0)?void 0:Jr.indexOf("video"))>-1?Kt.replaceSelection('')):(tr==null||((ga=tr.type)===null||ga===void 0)?void 0:ga.indexOf("pdf"))>-1?Kt.replaceSelection('
    ').concat(tr.name,"")):er.includes(oa)?Kt.replaceSelection('').concat(tr.name,"")):Kt.replaceSelection("[".concat(tr.name,"](").concat(fe.a.API_SERVER,"/api/attachments/").concat(nr.id,"?type=").concat(nr.content_type,")"))}else(nr==null?void 0:nr.status)===401&&(document.location.href="/user/login")})}catch(nr){m.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Kt.on("paste",Gt),ur(Kt),function(){Kt.off("paste",Gt)}}},[]);var va=Object(P.useCallback)(function(){if(kr.current)try{}catch(Kt){console.log(Kt,"---- to set md editor body height")}},[aa,kr,Pt]);Object(P.useEffect)(function(){function Kt(){var Vt=new w.default(function(dn){var _n=Object(R.a)(dn),In;try{for(_n.s();!(In=_n.n()).done;){var $n=In.value;($n.target.offsetHeight>0||$n.target.offsetWidth>0)&&(va(),lt.setSize("100%","100%"),lt.refresh())}}catch(er){_n.e(er)}finally{_n.f()}});return Vt.observe(ia.current.parentElement),Vt}if(lt){var Gt=Kt();return function(){Gt.unobserve(ia.current.parentElement)}}},[lt,va]),Object(P.useEffect)(function(){if(lt){for(var Kt=[],Gt=function(){var $n=dn[Vt];_n=Object(_.a)($n,2);var er=_n[0],Yn=_n[1],$r=Object(F.a)({},er,function(){yr(Yn)});Kt.push($r),lt.addKeyMap($r)},Vt=0,dn=Object.entries(Ve);Vt0){var Kt=new Date().getTime(),Gt=window.sessionStorage.getItem(Bt);Kt>=Br+Je&&(!Gt||Gt!==Pn)&&(window.sessionStorage.setItem(Bt,Pn),Ia(!0))}},Je),Object(P.useEffect)(function(){At(Mt)},[lt,Mt]),Object(P.useEffect)(function(){lt&&(Dt&<.focus())},[lt,Dt]),Object(P.useEffect)(function(){if(hr&<){var Kt=lt.getScrollerElement();function Gt(Vt){var dn=Vt.target;if(ha.current){var _n=dn.scrollTop/dn.scrollHeight;ha.current.scrollTop=ha.current.scrollHeight*_n}}return Kt.addEventListener("scroll",Gt),function(){Kt.removeEventListener("scroll",Gt)}}},[lt,hr]),Object(P.useEffect)(function(){if(lt&&ct){function Kt(Gt,Vt){ct(Gt,Vt)}return lt.on("beforeChange",Kt),function(){lt.off("beforeChange",Kt)}}},[lt,ct]),Object(P.useEffect)(function(){if(lt&&kt){function Kt(){kt(lt.getValue())}return lt.on("blur",Kt),function(){lt.off("blur",Kt)}}},[lt,kt]),Object(P.useEffect)(function(){if(lt){function Kt(Gt){var Vt=_e.a.sanitize(Gt.getValue());Vn(Vt),gr(new Date().getTime()),Gt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),re&&re(Vt)}return lt.on("change",Kt),function(){lt.off("change",Kt)}}},[lt,re]),Object(P.useEffect)(function(){lt&&(q==null?(lt.setValue(""),Vn("")):q!==lt.getValue()&&(lt.setValue(q),Vn(q),lt.setCursor(lt.lineCount(),0)))},[lt,q]);var yr=Object(P.useCallback)(function(Kt){var Gt=lt.getCursor(),Vt=lt.getSelection(),dn=Vt.split(` `);switch(Kt){case"bold":return lt.replaceSelection("**"+Vt+"**"),Vt===""&<.setCursor(Gt.line,Gt.ch+2),lt.focus();case"italic":return lt.replaceSelection("*"+Vt+"*"),Vt===""&<.setCursor(Gt.line,Gt.ch+1),lt.focus();case"code":return lt.replaceSelection("`"+Vt+"`"),Vt===""&<.setCursor(Gt.line,Gt.ch+1),lt.focus();case"inline-latex":return lt.replaceSelection("`$$"+Vt+"$$`"),Vt===""&<.setCursor(Gt.line,Gt.ch+3),lt.focus();case"latex":return lt.replaceSelection("```latex\n"+Vt+"\n```"),lt.setCursor(Gt.line+1,Vt.length+1),lt.focus();case"line-break":return lt.replaceSelection(`
    `),lt.focus();case"list-ul":return Vt===""?lt.replaceSelection("- "+Vt):lt.replaceSelection(dn.map(function(_n){return _n===""?"":"- ".concat(_n)}).join(` `)),lt.focus();case"list-ol":return Vt===""?lt.replaceSelection("1. "+Vt):lt.replaceSelection(dn.map(function(_n,In){return _n===""?"":"".concat(In+1,". ").concat(_n)}).join(` `)),lt.focus();case"add-null-ch":return Vt===""&<.setCursor(Gt.line,Gt.ch+1),lt.replaceSelection(Te),lt.focus();case"inster-template-1":return Vt===""&<.setCursor(Gt.line,Gt.ch),lt.replaceSelection(be),lt.focus();case"eraser":return lt.setValue(""),lt.focus();case"trigger-watch":return At(!hr),lt.focus();case"trigger-full-screen":return mn(!Pt),lt.focus();case Ne:kn(Ne);return;case et:kn(et);return;case Ge:kn(Ge);return;case Ze:kn(Ze);return;default:throw new Error}},[lt,hr,Pt]),br=Object(P.useCallback)(function(Kt){kn("");switch(Fn){case Ne:var Gt=Kt.title,Vt=Kt.link;return lt.replaceSelection("[".concat(Gt,"](").concat(Vt,")")),lt.focus();case et:var dn=Kt.language,_n=Kt.content;return lt.replaceSelection(["```"+dn,_n,"```"].join(` `)),lt.focus();case Ge:var In=Kt.src,$n=Kt.alt;return lt.replaceSelection("![ ".concat($n," ]( ").concat(In,' "').concat($n,'" )')),lt.focus();case Ze:for(var er=Kt.row,Yn=Kt.col,$r=Kt.align,tr=` `,oa=0;oa300&&(er=300);var Yn=Ye+er+"px";Xr(Yn)}}return Kt.addEventListener("mousedown",dn),document.addEventListener("mousemove",In),document.addEventListener("mouseup",_n),function(){Kt.removeEventListener("mousedown",dn),document.removeEventListener("mousemove",In),document.removeEventListener("mouseup",_n)}}},[lt,fa]),Object(P.useEffect)(function(){Xr(Ye)},[Ye]);var ma=Be(Se),na=Be(aa),Va={width:ma,height:na},si=Object(P.useMemo)(function(){if(Br){var Kt=new Date(Br),Gt=Kt.getHours(),Vt=Kt.getMinutes(),dn=Kt.getSeconds();return Gt=Gt<10?"0"+Gt:Gt,Vt=Vt<10?"0"+Vt:Vt,dn=dn<10?"0"+dn:dn,"".concat(Gt,":").concat(Vt,":").concat(dn)}return 0},[Br]);function Wr(){window.sessionStorage.removeItem(Bt),Ia(!1),gr(0)}function Xa(){Ia(!1),gr(0),lt.setValue(window.sessionStorage.getItem(Bt))}return A.a.createElement(P.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:kr},A.a.createElement("div",{className:"markdown-editor-container ".concat(an," ").concat(hr?"on-preview":""," ").concat(ht?"mini":""," ").concat(Pt?"full-screen":""),style:Va},A.a.createElement(d,{insertTemp:Tt,watch:hr,fullScreen:Pt,showNullButton:nn,onActionCallback:yr,hidetoolBar:Qt}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:ia,placeholder:on})),hr?A.a.createElement("div",{ref:ha,className:"preview-container"},Xt==="stex"&&A.a.createElement(x,{value:Pn}),Xt!=="stex"&&A.a.createElement(c.a,{value:Pn})):null))),Nt?A.a.createElement("a",{ref:fa,className:"editor-resize"}):null,A.a.createElement(o.a,null,he[Fn]?A.a.createElement(K.a,{centered:!0,title:he[Fn],visible:!0,onCancel:ta,footer:null},Ir):null))}},QXZ7:function(pt,$e,G){"use strict";var ee=G("2qtc"),K=G("kLXV"),R=G("q1tI"),j=G.n(R),m=G("9Bee"),_=G("IH3J"),F=G.n(_),P=function(L){var C,w,k=L.installPackage,O=L.visible,E=L.setVisible;return Object(R.useEffect)(function(){return O?document.body.setAttribute("class",F.a.bodyHeight):document.body.removeAttribute("class"),function(){document.body.removeAttribute("class")}},[O]),j.a.createElement(K.a,{centered:!0,keyboard:!1,destroyOnClose:!0,visible:O,title:"\u73AF\u5883\u4ECB\u7ECD",width:"1000px",wrapClassName:F.a.wrapInstallPackageStyle,footer:null,onCancel:function(){return E(!1)}},j.a.createElement("div",{className:F.a.installPackageStyle},j.a.createElement("div",{className:"mb30"},j.a.createElement("div",{className:F.a.title},k.mainTypeName),j.a.createElement("div",null,j.a.createElement(m.a,{value:k.mainTypeDescription}))),!!(k!=null&&(C=k.smallType)!==null&&C!==void 0&&C.length)&&j.a.createElement("div",{className:F.a.line}),j.a.createElement("div",null,k==null||((w=k.smallType)===null||w===void 0)?void 0:w.map(function(p,f){return j.a.createElement(j.a.Fragment,{key:f},j.a.createElement("div",{className:F.a.title,style:{marginBottom:14}},p.name),j.a.createElement("div",{className:"mb30"},j.a.createElement(m.a,{value:p.des})))}))))};$e.a=P},"SA+Z":function(pt,$e,G){var ee=G("wTVA"),K=G("EbDI"),R=G("ZhPi"),j=G("wkBT");function m(_){return ee(_)||K(_)||R(_)||j()}pt.exports=m,pt.exports.__esModule=!0,pt.exports.default=pt.exports},SJMd:function(pt,$e){/** * @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 G,ee,K,R=!1,j,m;window.PR_SHOULD_USE_CONTINUATION=!0;var _,F;(function(){var P=window,A=["break,continue,do,else,for,if,return,while"],L=[A,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],C=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],w=[C,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],k=[C,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],O=[C,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],E="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",p=[C,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],f="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",s=[A,"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"],l=[A,"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"],c=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],x=[w,O,k,p,f,s,l,c],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,h="str",S="kwd",y="com",u="typ",d="lit",o="pun",a="pln",b="tag",g="dec",T="src",M="atn",U="atv",W="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(_e){for(var Ne=0,Ge=!1,et=!1,Ze=0,Ke=_e.length;Ze122||(Y<65||ie>90||Be.push([Math.max(65,ie)|32,Math.min(Y,90)|32]),Y<97||ie>122||Be.push([Math.max(97,ie)&~32,Math.min(Y,122)&~32]))}}Be.sort(function(Se,Ue){return Se[0]-Ue[0]||Ue[1]-Se[1]});for(var q=[],re=[],Ve=0;Veoe[0]&&(oe[1]+1>oe[0]&&ke.push("-"),ke.push(ut(oe[1])))}return ke.push("]"),ke.join("")}function nt(Te){for(var be=Te.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Be=be.length,ze=[],ke=0,Ve=0;ke=2&&ie==="["?be[ke]=ot(he):ie!=="\\"&&(be[ke]=he.replace(/[a-zA-Z]/g,function(re){var oe=re.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return be.join("")}for(var Je=[],Ze=0,Ke=_e.length;Ze=0;)Ge[Je.charAt(Te)]=nt;var be=nt[1],Be=""+be;at.hasOwnProperty(Be)||(rt.push(be),at[Be]=null)}rt.push(/[\0-\uffff]/),et=I(rt)})();var Ze=Ne.length,Ke=function(He){for(var rt=He.sourceCode,at=He.basePos,ut=He.sourceNode,ot=[at,a],nt=0,Je=rt.match(et)||[],Te={},be=0,Be=Je.length;be=5&&ke.substring(0,5)==="lang-",he&&!(Ve&&typeof Ve[1]=="string")&&(he=!1,ke=T),he||(Te[ze]=ke)}var Y=nt;if(nt+=ze.length,!he)ot.push(at+Y,ke);else{var q=Ve[1],re=ze.indexOf(q),oe=re+q.length;Ve[2]&&(oe=ze.length-Ve[2].length,re=oe-q.length);var Se=ke.substring(5);z(ut,at+Y,ze.substring(0,re),Ke,ot),z(ut,at+Y+re,q,pe(Se,q),ot),z(ut,at+Y+oe,ze.substring(oe),Ke,ot)}}He.decorations=ot};return Ke}function De(_e){var Ne=[],Ge=[];_e.tripleQuotedStrings?Ne.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_e.multiLineStrings?Ne.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ne.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_e.verbatimStrings&&Ge.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var et=_e.hashComments;et&&(_e.cStyleComments?(et>1?Ne.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ne.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ne.push([y,/^#[^\r\n]*/,null,"#"])),_e.cStyleComments&&(Ge.push([y,/^\/\/[^\r\n]*/,null]),Ge.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ze=_e.regexLiterals;if(Ze){var Ke=Ze>1?"":` \r`,He=Ke?".":"[\\S\\s]",rt="/(?=[^/*"+Ke+"])(?:[^/\\x5B\\x5C"+Ke+"]|\\x5C"+He+"|\\x5B(?:[^\\x5C\\x5D"+Ke+"]|\\x5C"+He+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+H+"("+rt+")")])}var at=_e.types;at&&Ge.push([u,at]);var ut=(""+_e.keywords).replace(/^ | $/g,"");ut.length&&Ge.push([S,new RegExp("^(?:"+ut.replace(/[\s,]+/g,"|")+")\\b"),null]),Ne.push([a,/^\s+/,null,` \r \xA0`]);var ot="^.[^\\s\\w.$@'\"`/\\\\]*";return _e.regexLiterals&&(ot+="(?!s*/)"),Ge.push([d,/^@[a-z_$][a-z_$@0-9]*/i,null],[u,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[d,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[o,new RegExp(ot),null]),le(Ne,Ge)}var xe=De({keywords:x,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(_e,Ne,Ge){for(var et=/(?:^|\s)nocode(?:\s|$)/,Ze=/\r\n?|\n/,Ke=_e.ownerDocument,He=Ke.createElement("li");_e.firstChild;)He.appendChild(_e.firstChild);var rt=[He];function at(be){var Be=be.nodeType;if(Be==1&&!et.test(be.className))if(be.nodeName==="br")ut(be),be.parentNode&&be.parentNode.removeChild(be);else for(var ze=be.firstChild;ze;ze=ze.nextSibling)at(ze);else if((Be==3||Be==4)&&Ge){var ke=be.nodeValue,Ve=ke.match(Ze);if(Ve){var he=ke.substring(0,Ve.index);be.nodeValue=he;var ue=ke.substring(Ve.index+Ve[0].length);if(ue){var ie=be.parentNode;ie.insertBefore(Ke.createTextNode(ue),be.nextSibling)}ut(be),he||be.parentNode.removeChild(be)}}}function ut(be){for(;!be.nextSibling;)if(be=be.parentNode,!be)return;function Be(Ve,he){var ue=he?Ve.cloneNode(!1):Ve,ie=Ve.parentNode;if(ie){var Y=Be(ie,1),q=Ve.nextSibling;Y.appendChild(ue);for(var re=q;re;re=q)q=re.nextSibling,Y.appendChild(re)}return ue}for(var ze=Be(be.nextSibling,0),ke;(ke=ze.parentNode)&&ke.nodeType===1;)ze=ke;rt.push(ze)}for(var ot=0;ot=ie&&(at+=2),Ke>=Y&&(nt+=2)}}finally{ke&&(ke.style.display=Ve)}}var we={};function me(_e,Ne){for(var Ge=Ne.length;--Ge>=0;){var et=Ne[Ge];we.hasOwnProperty(et)?P.console&&console.warn("cannot override language handler %s",et):we[et]=_e}}function pe(_e,Ne){return _e&&we.hasOwnProperty(_e)||(_e=/^\s*]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),me(le([[a,/^[\s]+/,null,` \r `],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[b,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),me(le([],[[U,/^[\s\S]+/]]),["uq.val"]),me(De({keywords:w,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),me(De({keywords:"null,true,false"}),["json"]),me(De({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),me(De({keywords:k,cStyleComments:!0}),["java"]),me(De({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),me(De({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),me(De({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),me(De({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),me(De({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),me(De({keywords:E,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),me(le([],[[h,/^[\s\S]+/]]),["regex"]);function Q(_e){var Ne=_e.langExtension;try{var Ge=N(_e.sourceNode,_e.pre),et=Ge.sourceCode;_e.sourceCode=et,_e.spans=Ge.spans,_e.basePos=0,pe(Ne,et)(_e),Le(_e)}catch(Ze){P.console&&console.log(Ze&&Ze.stack||Ze)}}function de(_e,Ne,Ge){var et=Ge||!1,Ze=Ne||null,Ke=document.createElement("div");Ke.innerHTML="
    "+_e+"
    ",Ke=Ke.firstChild,et&&Pe(Ke,et,!0);var He={langExtension:Ze,numberLines:et,sourceNode:Ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Q(He),Ke.innerHTML}function te(_e,Ne){var Ge=Ne||document.body,et=Ge.ownerDocument||document;function Ze(ue){return Ge.getElementsByTagName(ue)}for(var Ke=[Ze("pre"),Ze("code"),Ze("xmp")],He=[],rt=0;rt=15&&(w=!1,A=!0);var h=l&&(L||w&&(v==null||v<12.11)),S=R||F&&P>=9;function y(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var u=function(e,t){var r=e.className,n=y(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function d(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function o(e,t){return d(e).appendChild(t)}function a(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var D=0;D=t)return B+(t-D);B+=V-D,B+=r-B%r,D=V+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r=t)return n+Math.min(B,t-i);if(i+=D-n,i+=r-i%r,n=D+1,i>=t)return n}}var me=[""];function pe(e){for(;me.length<=e;)me.push(Q(me)+" ");return me[e]}function Q(e){return e[e.length-1]}function de(e,t){for(var r=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||_e.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Ne(e)?!0:t.test(e):Ne(e)}function et(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ze=/[\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 Ke(e){return e.charCodeAt(0)>=768&&Ze.test(e)}function He(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,D=n<0?Math.ceil(i):Math.floor(i);if(D==t)return e(D)?t:r;e(D)?r=D:t=D+n}}function at(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,D=0;Dt||t==r&&B.to==t)&&(n(Math.max(B.from,t),Math.min(B.to,r),B.level==1?"rtl":"ltr",D),i=!0)}i||n(t,r,"ltr")}var ut=null;function ot(e,t,r){var n;ut=null;for(var i=0;it)return i;D.to==t&&(D.from!=D.to&&r=="before"?n=i:ut=i),D.from==t&&(D.from!=D.to&&r!="before"?n=i:ut=i)}return n!=null?n:ut}var nt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?t.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,D=/[LRr]/,B=/[Lb1n]/,V=/[1n]/;function X(Z,ge,Ce){this.level=Z,this.from=ge,this.to=Ce}return function(Z,ge){var Ce=ge=="ltr"?"L":"R";if(Z.length==0||ge=="ltr"&&!n.test(Z))return!1;for(var We=Z.length,Fe=[],tt=0;tt-1&&(n[t]=i.slice(0,D).concat(i.slice(D+1)))}}}function ke(e,t){var r=Be(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function ie(e){e.prototype.on=function(t,r){be(this,t,r)},e.prototype.off=function(t,r){ze(this,t,r)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function q(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function re(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function oe(e){Y(e),q(e)}function Se(e){return e.target||e.srcElement}function Ue(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var Ye=function(){if(F&&P<9)return!1;var e=a("div");return"draggable"in e||"dragDrop"in e}(),dt;function ht(e){if(dt==null){var t=a("span","\u200B");o(e,a("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(dt=t.offsetWidth<=1&&t.offsetHeight>2&&!(F&&P<8))}var r=dt?a("span","\u200B"):a("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var st;function Dt(e){if(st!=null)return st;var t=o(e,document.createTextNode("A\u062EA")),r=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return d(e),!r||r.left==r.right?!1:st=n.right-r.right<3}var Mt=` b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var D=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),B=D.indexOf("\r");B!=-1?(r.push(D.slice(0,B)),t+=B+1):(r.push(D),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Tt=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},zt=function(){var e=a("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Xt=null;function St(e){if(Xt!=null)return Xt;var t=o(e,a("span","x")),r=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return Xt=Math.abs(r.left-n.left)>1}var Bt={},gt={};function Nt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function Wt(e,t){gt[e]=t}function Rt(e){if(typeof e=="string"&>.hasOwnProperty(e))e=gt[e];else if(e&&typeof e.name=="string"&>.hasOwnProperty(e.name)){var t=gt[e.name];typeof t=="string"&&(t={name:t}),e=Ae(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Jt(e,t){t=Rt(t);var r=Bt[t.name];if(!r)return Jt(e,"text/plain");var n=r(e,t);if(nn.hasOwnProperty(t.name)){var i=nn[t.name];for(var D in i){if(!i.hasOwnProperty(D))continue;n.hasOwnProperty(D)&&(n["_"+D]=n[D]),n[D]=i[D]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var B in t.modeProps)n[B]=t.modeProps[B];return n}var nn={};function Tn(e,t){var r=nn.hasOwnProperty(e)?nn[e]:nn[e]={};N(t,r)}function Qt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Gn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Wn(e,t,r){return e.startState?e.startState(t,r):!0}var kt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};kt.prototype.eol=function(){return this.pos>=this.string.length},kt.prototype.sol=function(){return this.pos==this.lineStart},kt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},kt.prototype.next=function(){if(this.post},kt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},kt.prototype.skipToEnd=function(){this.pos=this.string.length},kt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},kt.prototype.backUp=function(e){this.pos-=e},kt.prototype.column=function(){return this.lastColumnPos0?null:(D&&t!==!1&&(this.pos+=D[0].length),D)}},kt.prototype.current=function(){return this.string.slice(this.start,this.pos)},kt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},kt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},kt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(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 r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],D=i.chunkSize();if(t=e.first&&tr?Qe(r,ct(e,r).text.length):Pn(t,ct(e,t.line).text.length)}function Pn(e,t){var r=e.ch;return r==null||r>t?Qe(e.line,t):r<0?Qe(e.line,0):e}function Vn(e,t){for(var r=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},Rn.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}},Rn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Rn.fromSaved=function(e,t,r){return t instanceof Zn?new Rn(e,Qt(e.mode,t.state),r,t.lookAhead):new Rn(e,Qt(e.mode,t),r)},Rn.prototype.save=function(e){var t=e!==!1?Qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Zn(t,this.maxLookAhead):t};function hr(e,t,r,n){var i=[e.state.modeGen],D={};kn(e,t.text,e.doc.mode,r,function(Z,ge){return i.push(Z,ge)},D,n);for(var B=r.state,V=function(Z){r.baseTokens=i;var ge=e.state.overlays[Z],Ce=1,We=0;r.state=!0,kn(e,t.text,ge.mode,r,function(Fe,tt){for(var it=Ce;WeFe&&i.splice(Ce,1,Fe,i[Ce+1],vt),Ce+=2,We=Math.min(Fe,vt)}if(!tt)return;if(ge.opaque)i.splice(it,Ce-it,Fe,"overlay "+tt),Ce=it+2;else for(;ite.options.maxHighlightLength&&Qt(e.doc.mode,n.state),D=hr(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=D.styles,D.classes?t.styleClasses=D.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xe(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Rn(n,!0,t);var D=Rr(e,t,r),B=D>n.first&&ct(n,D-1).stateAfter,V=B?Rn.fromSaved(n,B,D):new Rn(n,Wn(n.mode),D);return n.iter(D,t,function(X){Ct(e,X.text,V);var Z=V.line;X.stateAfter=Z==t-1||Z%5==0||Z>=i.viewFrom&&Zt.start)return D}throw new Error("Mode "+e.name+" failed to advance stream.")}var gn=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function qn(e,t,r,n){var i=e.doc,D=i.mode,B;t=_t(i,t);var V=ct(i,t.line),X=Xe(e,t.line,r),Z=new kt(V.text,e.options.tabSize,X),ge;for(n&&(ge=[]);(n||Z.pose.options.maxHighlightLength?(V=!1,B&&Ct(e,t,n,ge.pos),ge.pos=t.length,Ce=null):Ce=Fn(mn(r,ge,n.state,We),D),We){var Fe=We[0].name;Fe&&(Ce="m-"+(Ce?Fe+" "+Ce:Fe))}if(!V||Z!=Ce){for(;XB;--V){if(V<=D.first)return D.first;var X=ct(D,V-1),Z=X.stateAfter;if(Z&&(!r||V+(Z instanceof Zn?Z.lookAhead:0)<=D.modeFrontier))return V;var ge=z(X.text,null,e.options.tabSize);(i==null||n>ge)&&(i=V-1,n=ge)}return i}function Lr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierr;n--){var i=ct(e,n).stateAfter;if(i&&(!(i instanceof Zn)||n+i.lookAhead=t:D.to>t);(n||(n=[])).push(new aa(B,D.from,X?null:D.to))}}return n}function Ia(e,t,r){var n;if(e)for(var i=0;i=t:D.to>t);if(V||D.from==t&&B.type=="bookmark"&&(!r||D.marker.insertLeft)){var X=D.from==null||(B.inclusiveLeft?D.from<=t:D.from0&&V)for(var Ot=0;Ot0)continue;var ge=[X,1],Ce=yt(Z.from,V.from),We=yt(Z.to,V.to);(Ce<0||!B.inclusiveLeft&&!Ce)&&ge.push({from:Z.from,to:V.from}),(We>0||!B.inclusiveRight&&!We)&&ge.push({from:V.to,to:Z.to}),i.splice.apply(i,ge),X+=ge.length-3}return i}function ha(e){var t=e.markedSpans;if(!t)return;for(var r=0;rt)&&(!n||Ir(n,D.marker)<0)&&(n=D.marker)}return n}function si(e,t,r,n,i){var D=ct(e,t),B=gr&&D.markedSpans;if(B)for(var V=0;V=0&&Ce<=0||ge<=0&&Ce>=0)continue;if(ge<=0&&(X.marker.inclusiveRight&&i.inclusiveLeft?yt(Z.to,r)>=0:yt(Z.to,r)>0)||ge>=0&&(X.marker.inclusiveRight&&i.inclusiveLeft?yt(Z.from,n)<=0:yt(Z.from,n)<0))return!0}}function Wr(e){for(var t;t=ma(e);)e=t.find(-1,!0).line;return e}function Xa(e){for(var t;t=na(e);)e=t.find(1,!0).line;return e}function Kt(e){for(var t,r;t=na(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Gt(e,t){var r=ct(e,t),n=Wr(r);return r==n?t:Ut(n)}function Vt(e,t){if(t>e.lastLine())return t;var r=ct(e,t),n;if(!dn(e,r))return t;for(;n=na(r);)r=n.find(1,!0).line;return Ut(r)+1}function dn(e,t){var r=gr&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var Yn=function(e,t,r){this.text=e,va(this,t),this.height=r?r(this):1};Yn.prototype.lineNo=function(){return Ut(this)},ie(Yn);function $r(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ha(e),va(e,r);var i=n?n(e):1;i!=e.height&&an(e,i)}function tr(e){e.parent=null,ha(e)}var oa={},nr={};function Yr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?nr:oa;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Jr(e,t){var r=b("span",null,null,A?"padding-right: .1px":null),n={pre:b("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var D=i?t.rest[i-1]:t.line,B=void 0;n.pos=0,n.addToken=Hi,Dt(e.display.measure)&&(B=Je(D,e.doc.direction))&&(n.addToken=zi(n.addToken,B)),n.map=[];var V=t!=e.display.externalMeasured&&Ut(D);di(D,n,At(e,D,V)),D.styleClasses&&(D.styleClasses.bgClass&&(n.bgClass=W(D.styleClasses.bgClass,n.bgClass||"")),D.styleClasses.textClass&&(n.textClass=W(D.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(ht(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(A){var X=n.content.lastChild;(/\bcm-tab\b/.test(X.className)||X.querySelector&&X.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=W(n.pre.className,n.textClass||"")),n}function ga(e){var t=a("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hi(e,t,r,n,i,D,B){if(!t)return;var V=e.splitSpaces?li(t,e.trailingSpace):t,X=e.cm.state.specialChars,Z=!1,ge;if(!X.test(t))e.col+=t.length,ge=document.createTextNode(V),e.map.push(e.pos,e.pos+t.length,ge),F&&P<9&&(Z=!0),e.pos+=t.length;else{ge=document.createDocumentFragment();for(var Ce=0;;){X.lastIndex=Ce;var We=X.exec(t),Fe=We?We.index-Ce:t.length-Ce;if(Fe){var tt=document.createTextNode(V.slice(Ce,Ce+Fe));F&&P<9?ge.appendChild(a("span",[tt])):ge.appendChild(tt),e.map.push(e.pos,e.pos+Fe,tt),e.col+=Fe,e.pos+=Fe}if(!We)break;Ce+=Fe+1;var it=void 0;if(We[0]==" "){var vt=e.cm.options.tabSize,Et=vt-e.col%vt;it=ge.appendChild(a("span",pe(Et),"cm-tab")),it.setAttribute("role","presentation"),it.setAttribute("cm-text"," "),e.col+=Et}else We[0]=="\r"||We[0]==` `?(it=ge.appendChild(a("span",We[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),it.setAttribute("cm-text",We[0]),e.col+=1):(it=e.cm.options.specialCharPlaceholder(We[0]),it.setAttribute("cm-text",We[0]),F&&P<9?ge.appendChild(a("span",[it])):ge.appendChild(it),e.col+=1);e.map.push(e.pos,e.pos+1,it),e.pos++}}if(e.trailingSpace=V.charCodeAt(t.length-1)==32,r||n||i||Z||D||B){var wt=r||"";n&&(wt+=n),i&&(wt+=i);var xt=a("span",[ge],wt,D);if(B)for(var Ot in B)B.hasOwnProperty(Ot)&&Ot!="style"&&Ot!="class"&&xt.setAttribute(Ot,B[Ot]);return e.content.appendChild(xt)}e.content.appendChild(ge)}function li(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iZ&&Ce.from<=Z);We++);if(Ce.to>=ge)return e(r,n,i,D,B,V,X);e(r,n.slice(0,Ce.to-Z),i,D,null,V,X),D=null,n=n.slice(Ce.to-Z),Z=Ce.to}}}function ui(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function di(e,t,r){var n=e.markedSpans,i=e.text,D=0;if(!n){for(var B=1;BX||un.collapsed&&jt.to==X&&jt.from==X)){if(jt.to!=null&&jt.to!=X&&Fe>jt.to&&(Fe=jt.to,it=""),un.className&&(tt+=" "+un.className),un.css&&(We=(We?We+";":"")+un.css),un.startStyle&&jt.from==X&&(vt+=" "+un.startStyle),un.endStyle&&jt.to==Fe&&(Ot||(Ot=[])).push(un.endStyle,jt.to),un.title&&((wt||(wt={})).title=un.title),un.attributes)for(var Qn in un.attributes)(wt||(wt={}))[Qn]=un.attributes[Qn];un.collapsed&&(!Et||Ir(Et.marker,un)<0)&&(Et=jt)}else jt.from>X&&Fe>jt.from&&(Fe=jt.from)}if(Ot)for(var Ar=0;Ar=V)break;for(var ra=Math.min(V,Fe);;){if(ge){var Zr=X+ge.length;if(!Et){var Er=Zr>ra?ge.slice(0,ra-X):ge;t.addToken(t,Er,Ce?Ce+tt:tt,vt,X+Er.length==Fe?it:"",We,wt)}if(Zr>=ra){ge=ge.slice(ra-X),X=ra;break}X=Zr,vt=""}ge=i.slice(D,D=r[Z++]),Ce=Yr(r[Z++],t.cm.options)}}}function xi(e,t,r){this.line=t,this.rest=Kt(t),this.size=this.rest?Ut(Q(this.rest))-r+1:1,this.node=this.text=null,this.hidden=dn(e,t)}function ya(e,t,r){for(var n=[],i,D=t;D2&&D.push((X.bottom+Z.top)/2-r.top)}}D.push(r.bottom-r.top)}}function ne(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function ye(e,t){t=Wr(t);var r=Ut(t),n=e.display.externalMeasured=new xi(e.doc,t,r);n.lineN=r;var i=n.built=Jr(e,n);return n.text=i.pre,o(e.display.lineMeasure,i.pre),n}function Ee(e,t,r,n){return je(e,Re(e,t),r,n)}function Ie(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(D=X-V,i=D-1,t>=X&&(B="right")),i!=null){if(n=e[Z+2],V==X&&r==(n.insertLeft?"left":"right")&&(B=r),r=="left"&&i==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)n=e[(Z-=3)+2],B="left";if(r=="right"&&i==X-V)for(;Z=0&&!((r=e[i]).left!=r.right);i--);return r}function bt(e,t,r,n){var i=mt(t.map,r,n),D=i.node,B=i.start,V=i.end,X=i.collapse,Z;if(D.nodeType==3){for(var ge=0;ge<4;ge++){for(;B&&Ke(t.line.text.charAt(i.coverStart+B));)--B;for(;i.coverStart+V0&&(X=n="right");var Ce;e.options.lineWrapping&&(Ce=D.getClientRects()).length>1?Z=Ce[n=="right"?Ce.length-1:0]:Z=D.getBoundingClientRect()}if(F&&P<9&&!B&&(!Z||!Z.left&&!Z.right)){var We=D.parentNode.getClientRects()[0];We?Z={left:We.left,right:We.left+Tr(e.display),top:We.top,bottom:We.bottom}:Z=qe}for(var Fe=Z.top-t.rect.top,tt=Z.bottom-t.rect.top,it=(Fe+tt)/2,vt=t.view.measure.heights,Et=0;Et=n.text.length?(X=n.text.length,Z="before"):X<=0&&(X=0,Z="after"),!V)return B(Z=="before"?X-1:X,Z=="before");function ge(tt,it,vt){var Et=V[it],wt=Et.level==1;return B(vt?tt-1:tt,wt!=vt)}var Ce=ot(V,X,Z),We=ut,Fe=ge(X,Ce,Z=="before");return We!=null&&(Fe.other=ge(X,We,Z!="before")),Fe}function Ht(e,t){var r=0;t=_t(e.doc,t),e.options.lineWrapping||(r=Tr(e.display)*t.ch);var n=ct(e.doc,t.line),i=In(n)+Yi(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Ft(e,t,r,n,i){var D=Qe(e,t,r);return D.xRel=i,n&&(D.outside=n),D}function vn(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Ft(n.first,0,null,-1,-1);var i=An(n,r),D=n.first+n.size-1;if(i>D)return Ft(n.first+n.size-1,ct(n,D).text.length,null,1,1);t<0&&(t=0);for(var B=ct(n,i);;){var V=ar(e,B,i,t,r),X=Va(B,V.ch+(V.xRel>0||V.outside>0?1:0));if(!X)return V;var Z=X.find(1);if(Z.line==i)return Z;B=ct(n,i=Z.line)}}function xn(e,t,r,n){n-=tn(t);var i=t.text.length,D=rt(function(B){return je(e,r,B-1).bottom<=n},i,0);return i=rt(function(B){return je(e,r,B).top>n},D,i),{begin:D,end:i}}function Lt(e,t,r,n){r||(r=Re(e,t));var i=En(e,t,je(e,r,n),"line").top;return xn(e,t,r,i)}function Cn(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function ar(e,t,r,n,i){i-=In(t);var D=Re(e,t),B=tn(t),V=0,X=t.text.length,Z=!0,ge=Je(t,e.doc.direction);if(ge){var Ce=(e.options.lineWrapping?Kn:wn)(e,t,r,D,ge,n,i);Z=Ce.level!=1,V=Z?Ce.from:Ce.to-1,X=Z?Ce.to:Ce.from-1}var We=null,Fe=null,tt=rt(function(Yt){var jt=je(e,D,Yt);return jt.top+=B,jt.bottom+=B,Cn(jt,n,i,!1)?(jt.top<=i&&jt.left<=n&&(We=Yt,Fe=jt),!0):!1},V,X),it,vt,Et=!1;if(Fe){var wt=n-Fe.left=Ot.bottom?1:0}return tt=He(t.text,tt,1),Ft(r,tt,vt,Et,n-it)}function wn(e,t,r,n,i,D,B){var V=rt(function(Ce){var We=i[Ce],Fe=We.level!=1;return Cn(hn(e,Qe(r,Fe?We.to:We.from,Fe?"before":"after"),"line",t,n),D,B,!0)},0,i.length-1),X=i[V];if(V>0){var Z=X.level!=1,ge=hn(e,Qe(r,Z?X.from:X.to,Z?"after":"before"),"line",t,n);Cn(ge,D,B,!0)&&ge.top>B&&(X=i[V-1])}return X}function Kn(e,t,r,n,i,D,B){var V=xn(e,t,n,B),X=V.begin,Z=V.end;/\s/.test(t.text.charAt(Z-1))&&Z--;for(var ge=null,Ce=null,We=0;We=Z||Fe.to<=X)continue;var tt=Fe.level!=1,it=je(e,n,tt?Math.min(Z,Fe.to)-1:Math.max(X,Fe.from)).right,vt=itvt)&&(ge=Fe,Ce=vt)}return ge||(ge=i[i.length-1]),ge.fromZ&&(ge={from:ge.from,to:Z,level:ge.level}),ge}var jn;function cr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jn==null){jn=a("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)jn.appendChild(document.createTextNode("x")),jn.appendChild(a("br"));jn.appendChild(document.createTextNode("x"))}o(e.measure,jn);var r=jn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),d(e.measure),r||1}function Tr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=a("span","xxxxxxxxxx"),r=a("pre",[t],"CodeMirror-line-like");o(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,D=t.gutters.firstChild,B=0;D;D=D.nextSibling,++B){var V=e.display.gutterSpecs[B].className;r[V]=D.offsetLeft+D.clientLeft+i,n[V]=D.clientWidth}return{fixedPos:Ur(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Ur(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sa(e){var t=cr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Tr(e.display)-3);return function(i){if(dn(e.doc,i))return 0;var D=0;if(i.widgets)for(var B=0;B0&&(Z=ct(e.doc,X.line).text).length==X.ch){var ge=z(Z,Z.length,e.options.tabSize)-Z.length;X=Qe(X.line,Math.max(0,Math.round((D-Oe(e.display).left)/Tr(e.display))-ge))}return X}function Jn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)gr&&Gt(e.doc,t)i.viewFrom?ir(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)ir(e);else if(t<=i.viewFrom){var D=la(e,r,r+n,1);D?(i.view=i.view.slice(D.index),i.viewFrom=D.lineN,i.viewTo+=n):ir(e)}else if(r>=i.viewTo){var B=la(e,t,t,-1);B?(i.view=i.view.slice(0,B.index),i.viewTo=B.lineN):ir(e)}else{var V=la(e,t,t,-1),X=la(e,r,r+n,1);V&&X?(i.view=i.view.slice(0,V.index).concat(ya(e,V.lineN,X.lineN)).concat(i.view.slice(X.index)),i.viewTo+=n):ir(e)}var Z=i.externalMeasured;Z&&(r=i.lineN&&t=n.viewTo)return;var D=n.view[Jn(e,t)];if(D.node==null)return;var B=D.changes||(D.changes=[]);ae(B,r)==-1&&B.push(r)}function ir(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function la(e,t,r,n){var i=Jn(e,t),D,B=e.display.view;if(!gr||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var V=e.display.viewFrom,X=0;X0){if(i==B.length-1)return null;D=V+B[i].size-t,i++}else D=V-t;t+=D,r+=D}for(;Gt(e.doc,r)!=r;){if(i==(n<0?0:B.length-1))return null;r+=n*B[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Oa(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=ya(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ya(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Jn(e,r)))),n.viewTo=r}function Aa(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||V.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ya(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Co(e){e.state.focused||(e.display.input.focus(),Ra(e))}function Ji(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ya(e))},100)}function Ra(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),A&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sr(e)}function Ya(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,u(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ci(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||ge<-.005)&&(an(i.line,B),Qi(i.line),i.rest))for(var Ce=0;Cee.display.sizerWidth){var We=Math.ceil(V/Tr(e.display));We>e.display.maxLineLength&&(e.display.maxLineLength=We,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Qi(e){if(e.widgets)for(var t=0;t=B&&(D=An(t,In(ct(t,X))-e.wrapper.clientHeight),B=X)}return{from:D,to:Math.max(B,D+1)}}function Xo(e,t){if(Ve(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!E){var D=a("div","\u200B",null,`position: absolute; top: `+(t.top-r.viewOffset-Yi(e.display))+`px; height: `+(t.bottom-t.top+Me(e)+r.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(D),D.scrollIntoView(i),e.display.lineSpace.removeChild(D)}}function $o(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?Qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Qe(t.line,t.ch+1,"before"):t);for(var D=0;D<5;D++){var B=!1,V=hn(e,t),X=!r||r==t?V:hn(e,r);i={left:Math.min(V.left,X.left),top:Math.min(V.top,X.top)-n,right:Math.max(V.left,X.left),bottom:Math.max(V.bottom,X.bottom)+n};var Z=Zi(e,i),ge=e.doc.scrollTop,Ce=e.doc.scrollLeft;if(Z.scrollTop!=null&&(Za(e,Z.scrollTop),Math.abs(e.doc.scrollTop-ge)>1&&(B=!0)),Z.scrollLeft!=null&&(ua(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ce)>1&&(B=!0)),!B)break}return i}function So(e,t){var r=Zi(e,t);r.scrollTop!=null&&Za(e,r.scrollTop),r.scrollLeft!=null&&ua(e,r.scrollLeft)}function Zi(e,t){var r=e.display,n=cr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,D=J(e),B={};t.bottom-t.top>D&&(t.bottom=t.top+D);var V=e.doc.height+ce(r),X=t.topV-n;if(t.topi+D){var ge=Math.min(t.top,(Z?V:t.bottom)-D);ge!=i&&(B.scrollTop=ge)}var Ce=e.options.fixedGutter?0:r.gutters.offsetWidth,We=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-Ce,Fe=ve(e)-r.gutters.offsetWidth,tt=t.right-t.left>Fe;return tt&&(t.right=t.left+Fe),t.left<10?B.scrollLeft=0:t.leftFe+We-3&&(B.scrollLeft=t.right+(tt?0:10)-Fe),B}function qi(e,t){if(t==null)return;_i(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Ja(e){_i(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Qa(e,t,r){(t!=null||r!=null)&&_i(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Yo(e,t){_i(e),e.curOp.scrollToPos=t}function _i(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Ht(e,t.from),n=Ht(e,t.to);mi(e,r,n,t.margin)}}function mi(e,t,r,n){var i=Zi(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Qa(e,i.scrollLeft,i.scrollTop)}function Za(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;R||gi(e,{top:t}),qa(e,t,!0),R&&gi(e),vi(e,100)}function qa(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ua(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,yn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Na(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ce(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?r:0,docHeight:n,scrollHeight:n+Me(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var La=function(e,t,r){this.cm=r;var n=this.vert=a("div",[a("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=a("div",[a("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),be(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),be(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,F&&P<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};La.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var D=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+D)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},La.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},La.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},La.prototype.zeroWidthHack=function(){var e=l&&!O?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},La.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),D=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);D!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},La.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var pi=function(){};pi.prototype.update=function(){return{bottom:0,right:0}},pi.prototype.setScrollLeft=function(){},pi.prototype.setScrollTop=function(){},pi.prototype.clear=function(){};function Ua(e,t){t||(t=Na(e));var r=e.display.barWidth,n=e.display.barHeight;wi(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Ci(e),wi(e,Na(e)),r=e.display.barWidth,n=e.display.barHeight}function wi(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var eo={native:La,null:pi};function Oi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&u(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?ua(e,t):Za(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function Ma(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:++to},Gi(e.curOp)}function Fa(e){var t=e.curOp;t&&Sn(t,function(r){for(var n=0;n=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new da(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qo(e){e.updatedDisplay=e.mustUpdate&&ja(e.cm,e.update)}function Zo(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ci(t),e.barMeasure=Na(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ee(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Me(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-ve(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function no(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=Xe(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(D){if(n.line>=e.display.viewFrom){var B=D.styles,V=D.text.length>e.options.maxHighlightLength?Qt(t.mode,n.state):null,X=hr(e,D,n,!0);V&&(n.state=V),D.styles=X.styles;var Z=D.styleClasses,ge=X.classes;ge?D.styleClasses=ge:Z&&(D.styleClasses=null);for(var Ce=!B||B.length!=D.styles.length||Z!=ge&&(!Z||!ge||Z.bgClass!=ge.bgClass||Z.textClass!=ge.textClass),We=0;!Ce&&Wer)return vi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Hr(e,function(){for(var D=0;D=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&Aa(e)==0)return!1;_r(e)&&(ir(e),t.dims=or(e));var i=n.first+n.size,D=Math.max(t.visible.from-e.options.viewportMargin,n.first),B=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFromB&&r.viewTo-B<20&&(B=Math.min(i,r.viewTo)),gr&&(D=Gt(e.doc,D),B=Vt(e.doc,B));var V=D!=r.viewFrom||B!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Oa(e,D,B),r.viewOffset=In(ct(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var X=Aa(e);if(!V&&X==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var Z=Oo(e);return X>4&&(r.lineDiv.style.display="none"),Do(e,r.updateLineNumbers,t.dims),X>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Ao(Z),d(r.cursorDiv),d(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,V&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,vi(e,400)),r.updateLineNumbers=null,!0}function Ai(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ve(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ce(e.display)-J(e),r.top)}),t.visible=Si(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Si(e.display,e.doc,r));if(!ja(e,t))break;Ci(e);var i=Na(e);Bn(e),Ua(e,i),Ln(e,i),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 gi(e,t){var r=new da(e,t);if(ja(e,r)){Ci(e),Ai(e,r);var n=Na(e);Bn(e),Ua(e,n),Ln(e,n),r.finish()}}function Do(e,t,r){var n=e.display,i=e.options.lineNumbers,D=n.lineDiv,B=D.firstChild;function V(tt){var it=tt.nextSibling;return A&&l&&e.display.currentWheelTarget==tt?tt.style.display="none":tt.parentNode.removeChild(tt),it}for(var X=n.view,Z=n.viewFrom,ge=0;ge-1&&(Fe=!1),_a(e,Ce,Z,r)),Fe&&(d(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(on(e.options,Z)))),B=Ce.node.nextSibling}Z+=Ce.size}for(;B;)B=V(B)}function Di(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ln(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+Me(e)+"px"}function yn(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Ur(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,D=n+"px",B=0;BB.clientWidth,X=B.scrollHeight>B.clientHeight;if(!(n&&V||i&&X))return;if(i&&l&&A){e:for(var Z=t.target,ge=D.view;Z!=B;Z=Z.parentNode)for(var Ce=0;Ce=0&&yt(e,n.to())<=0)return r}return-1};var On=function(e,t){this.anchor=e,this.head=t};On.prototype.from=function(){return ur(this.anchor,this.head)},On.prototype.to=function(){return lt(this.anchor,this.head)},On.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ca(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(We,Fe){return yt(We.from(),Fe.from())}),r=ae(t,i);for(var D=1;D0:X>=0){var Z=ur(V.from(),B.from()),ge=lt(V.to(),B.to()),Ce=V.empty()?B.from()==B.head:V.from()==V.head;D<=r&&--r,t.splice(--D,2,new On(Ce?ge:Z,Ce?Z:ge))}}return new Gr(t,r)}function xa(e,t){return new Gr([new On(e,t||e)],0)}function Ta(e){return e.text?Qe(e.from.line+e.text.length-1,Q(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function io(e,t){if(yt(e,t.from)<0)return e;if(yt(e,t.to)<=0)return Ta(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ta(t).ch-t.to.ch),Qe(r,n)}function Li(e,t){for(var r=[],n=0;n1&&e.remove(V.line+1,tt-1),e.insert(V.line+1,Et)}cn(e,"change",e,t)}function ti(e,t,r){function n(i,D,B){if(i.linked)for(var V=0;V1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Q(e.done)}function Es(e,t,r,n){var i=e.history;i.undone.length=0;var D=+new Date,B,V;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>D-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(B=ml(i,i.lastOp==n)))V=Q(B.changes),yt(t.from,t.to)==0&&yt(t.from,V.to)==0?V.to=Ta(t):B.changes.push(ns(e,t));else{var X=Q(i.done);for((!X||!X.ranges)&&Po(e.sel,i.done),B={changes:[ns(e,t)],generation:i.generation},i.done.push(B);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=D,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,V||ke(e,"historyAdded")}function pl(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,t,r,n){var i=e.history,D=n&&n.origin;r==i.lastSelOp||D&&i.lastSelOrigin==D&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==D||pl(e,D,Q(i.done),t))?i.done[i.done.length-1]=t:Po(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=D,i.lastSelOp=r,n&&n.clearRedo!==!1&&bs(i.undone)}function Po(e,t){var r=Q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function xs(e,t,r,n){var i=t["spans_"+e.id],D=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(B){B.markedSpans&&((i||(i=t["spans_"+e.id]={}))[D]=B.markedSpans),++D})}function gl(e){if(!e)return null;for(var t,r=0;r-1&&(Q(V)[Ce]=Z[Ce],delete Z[Ce]))}}return n}function rs(e,t,r,n){if(n){var i=e.anchor;if(r){var D=yt(t,i)<0;D!=yt(r,i)<0?(i=t,t=r):D!=yt(t,r)<0&&(t=r)}return new On(i,t)}else return new On(r||t,t)}function ko(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Fr(e,new Gr([rs(e.sel.primary(),t,r,i)],0),n)}function Cs(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),D=0;D=t.ch:V.to>t.ch))){if(i&&(ke(X,"beforeCursorEnter"),X.explicitlyCleared))if(D.markedSpans){--B;continue}else break;if(!X.atomic)continue;if(r){var Ce=X.find(n<0?1:-1),We=void 0;if((n<0?ge:Z)&&(Ce=Ds(e,Ce,-n,Ce&&Ce.line==t.line?D:null)),Ce&&Ce.line==t.line&&(We=yt(Ce,r))&&(n<0?We<0:We>0))return Pi(e,Ce,t,n,i)}var Fe=X.find(n<0?-1:1);return(n<0?Z:ge)&&(Fe=Ds(e,Fe,n,Fe.line==t.line?D:null)),Fe?Pi(e,Fe,t,n,i):null}}return t}function No(e,t,r,n,i){var D=n||1,B=Pi(e,t,r,D,i)||!i&&Pi(e,t,r,D,!0)||Pi(e,t,r,-D,i)||!i&&Pi(e,t,r,-D,!0);return B||(e.cantEdit=!0,Qe(e.first,0))}function Ds(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?_t(e,Qe(t.line-1)):null:r>0&&t.ch==(n||ct(e,t.line)).text.length?t.line=0;--i)Ms(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ms(e,t)}function Ms(e,t){if(t.text.length==1&&t.text[0]==""&&yt(t.from,t.to)==0)return;var r=Li(e,t);Es(e,t,r,e.cm?e.cm.curOp.id:NaN),so(e,t,r,ia(e,t));var n=[];ti(e,function(i,D){!D&&ae(n,i.history)==-1&&(Ns(i.history,t),n.push(i.history)),so(i,t,null,ia(i,t))})}function Uo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var i=e.history,D,B=e.sel,V=t=="undo"?i.done:i.undone,X=t=="undo"?i.undone:i.done,Z=0;Z=0;--Fe){var tt=We(Fe);if(tt)return tt.v}}function Ps(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gr(de(e.sel.ranges,function(i){return new On(Qe(i.anchor.line+t,i.anchor.ch),Qe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Hn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())return;if(t.from.lineD&&(t={from:t.from,to:Qe(D,ct(e,D).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qt(e,t.from,t.to),r||(r=Li(e,t)),e.cm?El(e.cm,t,n):ts(e,t,n),Io(e,r,xe),e.cantEdit&&No(e,Qe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,r){var n=e.doc,i=e.display,D=t.from,B=t.to,V=!1,X=D.line;e.options.lineWrapping||(X=Ut(Wr(ct(n,D.line))),n.iter(X,B.line+1,function(Fe){if(Fe==i.maxLine)return V=!0,!0})),n.sel.contains(t.from,t.to)>-1&&he(e),ts(n,t,r,sa(e)),e.options.lineWrapping||(n.iter(X,D.line+t.text.length,function(Fe){var tt=$n(Fe);tt>i.maxLineLength&&(i.maxLine=Fe,i.maxLineLength=tt,i.maxLineChanged=!0,V=!1)}),V&&(e.curOp.updateMaxLine=!0)),Lr(n,D.line),vi(e,400);var Z=t.text.length-(B.line-D.line)-1;t.full?Hn(e):D.line==B.line&&t.text.length==1&&!vs(e.doc,t)?sr(e,D.line,"text"):Hn(e,D.line,B.line+1,Z);var ge=ue(e,"changes"),Ce=ue(e,"change");if(Ce||ge){var We={from:D,to:B,text:t.text,removed:t.removed,origin:t.origin};Ce&&cn(e,"change",e,We),ge&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(We)}e.display.selForContextMenu=null}function Ii(e,t,r,n,i){var D;n||(n=r),yt(n,r)<0&&(D=[n,r],r=D[0],n=D[1]),typeof t=="string"&&(t=e.splitLines(t)),ki(e,{from:r,to:n,text:t,origin:i})}function ks(e,t,r,n){r1||!(this.children[0]instanceof uo))){var V=[];this.collapse(V),this.children=[new uo(V)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var B=i.lines.length%25+25,V=B;V10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=ge,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Hn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&cn(e,"markerCleared",e,this,n,i),t&&Fa(e),this.parent&&this.parent.clear()},ni.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i0||B==0&&D.clearWhenEmpty!==!1)return D;if(D.replacedWith&&(D.collapsed=!0,D.widgetNode=b("span",[D.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||D.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(D.widgetNode.insertLeft=!0)),D.collapsed){if(si(e,t.line,t,r,D)||t.line!=r.line&&si(e,r.line,t,r,D))throw new Error("Inserting collapsed marker partially overlapping an existing one");za()}D.addToHistory&&Es(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var V=t.line,X=e.cm,Z;if(e.iter(V,r.line+1,function(Ce){X&&D.collapsed&&!X.options.lineWrapping&&Wr(Ce)==X.display.maxLine&&(Z=!0),D.collapsed&&V!=t.line&&an(Ce,0),Ga(Ce,new aa(D,V==t.line?t.ch:null,V==r.line?r.ch:null)),++V}),D.collapsed&&e.iter(t.line,r.line+1,function(Ce){dn(e,Ce)&&an(Ce,0)}),D.clearOnEnter&&be(D,"beforeCursorEnter",function(){return D.clear()}),D.readOnly&&(Ha(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),D.collapsed&&(D.id=++Fs,D.atomic=!0),X){if(Z&&(X.curOp.updateMaxLine=!0),D.collapsed)Hn(X,t.line,r.line+1);else if(D.className||D.startStyle||D.endStyle||D.css||D.attributes||D.title)for(var ge=t.line;ge<=r.line;ge++)sr(X,ge,"text");D.atomic&&Os(X.doc),cn(X,"markerAdded",X,D)}return D}var ho=function(e,t){this.markers=e,this.primary=t;for(var r=0;r=0;X--)ki(this,n[X]);V?_s(this,V):this.cm&&Ja(this.cm)}),undo:pr(function(){Uo(this,"undo")}),redo:pr(function(){Uo(this,"redo")}),undoSelection:pr(function(){Uo(this,"undo",!0)}),redoSelection:pr(function(){Uo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=_t(this,e),t=_t(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(D){var B=D.markedSpans;if(B)for(var V=0;V=X.to||X.from==null&&i!=e.line||X.from!=null&&i==t.line&&X.from>=t.ch)&&(!r||r(X.marker))&&n.push(X.marker.parent||X.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=D,++r}),_t(this,Qe(r,t))},indexFromPos:function(e){e=_t(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 ge=e.dataTransfer.getData("Text");if(ge){var Ce;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ce=t.listSelections()),Io(t.doc,xa(r,r)),Ce)for(var We=0;We=0;V--)Ii(e.doc,"",n[V].from,n[V].to,"+delete");Ja(e)})}function is(e,t,r){var n=He(e.text,t+r,r);return n<0||n>e.text.length?null:n}function os(e,t,r){var n=is(e,t.ch,r);return n==null?null:new Qe(t.line,n,r<0?"after":"before")}function ss(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var D=Je(r,t.doc.direction);if(D){var B=i<0?Q(D):D[0],V=i<0==(B.level==1),X=V?"after":"before",Z;if(B.level>0||t.doc.direction=="rtl"){var ge=Re(t,r);Z=i<0?r.text.length-1:0;var Ce=je(t,ge,Z).top;Z=rt(function(We){return je(t,ge,We).top==Ce},i<0==(B.level==1)?B.from:B.to-1,Z),X=="before"&&(Z=is(r,Z,1))}else Z=i<0?B.to:B.from;return new Qe(n,Z,X)}}return new Qe(n,i<0?r.text.length:0,i<0?"before":"after")}function kl(e,t,r,n){var i=Je(t,e.doc.direction);if(!i)return os(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var D=ot(i,r.ch,r.sticky),B=i[D];if(e.doc.direction=="ltr"&&B.level%2==0&&(n>0?B.to>r.ch:B.from=B.from&&We>=ge.begin)){var Fe=Ce?"before":"after";return new Qe(r.line,We,Fe)}}var tt=function(Et,wt,xt){for(var Ot=function(Qn,Ar){return Ar?new Qe(r.line,V(Qn,1),"before"):new Qe(r.line,Qn,"after")};Et>=0&&Et0==(Yt.level!=1),un=jt?xt.begin:V(xt.end,-1);if(Yt.from<=un&&un0?ge.end:V(ge.begin,-1);return vt!=null&&!(n>0&&vt==t.text.length)&&(it=tt(n>0?0:i.length-1,n,Z(vt)),it)?it:null}var vo={selectAll:Rs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return Fi(e,function(t){if(t.empty()){var r=ct(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Qe(i.line,i.ch+1),e.replaceRange(D.charAt(i.ch-1)+D.charAt(i.ch-2),Qe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var B=ct(e.doc,i.line-1).text;B&&(i=new Qe(i.line,1),e.replaceRange(D.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),Qe(i.line-1,B.length-1),i,"+transpose"))}}r.push(new On(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Hr(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&yt(t,this.pos)==0&&r==this.button};var yo,bo;function Wl(e,t){var r=+new Date;return bo&&bo.compare(r,e,t)?(yo=bo=null,"triple"):yo&&yo.compare(r,e,t)?(bo=new us(r,e,t),yo=null,"double"):(yo=new us(r,e,t),bo=null,"single")}function el(e){var t=this,r=t.display;if(Ve(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,ba(r,e)){A||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(ds(t,e))return;var n=Cr(t,e),i=Ue(e),D=n?Wl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&Kl(t,i,n,D,e))return;i==1?n?zl(t,n,D,e):Se(e)==r.scroller&&Y(e):i==2?(n&&ko(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(S?t.display.input.onContextMenu(e):Ji(t))}function Kl(e,t,r,n,i){var D="Click";return n=="double"?D="Double"+D:n=="triple"&&(D="Triple"+D),D=(t==1?"Left":t==2?"Middle":"Right")+D,go(e,Gs(D,i),i,function(B){if(typeof B=="string"&&(B=vo[B]),!B)return!1;var V=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),V=B(e,r)!=De}finally{e.state.suppressEdits=!1}return V})}function Hl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var D=c?r.shiftKey&&r.metaKey:r.altKey;i.unit=D?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=l?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(l?r.altKey:r.ctrlKey)),i}function zl(e,t,r,n){F?setTimeout(I(Co,e),0):e.curOp.focus=M();var i=Hl(e,r,n),D=e.doc.sel,B;e.options.dragDrop&&Ye&&!e.isReadOnly()&&r=="single"&&(B=D.contains(t))>-1&&(yt((B=D.ranges[B]).from(),t)<0||t.xRel>0)&&(yt(B.to(),t)>0||t.xRel<0)?Gl(e,n,t,i):Vl(e,n,t,i)}function Gl(e,t,r,n){var i=e.display,D=!1,B=mr(e,function(Z){A&&(i.scroller.draggable=!1),e.state.draggingText=!1,ze(i.wrapper.ownerDocument,"mouseup",B),ze(i.wrapper.ownerDocument,"mousemove",V),ze(i.scroller,"dragstart",X),ze(i.scroller,"drop",B),D||(Y(Z),n.addNew||ko(e.doc,r,null,null,n.extend),A&&!k||F&&P==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),V=function(Z){D=D||Math.abs(t.clientX-Z.clientX)+Math.abs(t.clientY-Z.clientY)>=10},X=function(){return D=!0};A&&(i.scroller.draggable=!0),e.state.draggingText=B,B.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),be(i.wrapper.ownerDocument,"mouseup",B),be(i.wrapper.ownerDocument,"mousemove",V),be(i.scroller,"dragstart",X),be(i.scroller,"drop",B),Ji(e),setTimeout(function(){return i.input.focus()},20)}function tl(e,t,r){if(r=="char")return new On(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new On(Qe(t.line,0),_t(e.doc,Qe(t.line+1,0)));var n=r(e,t);return new On(n.from,n.to)}function Vl(e,t,r,n){var i=e.display,D=e.doc;Y(t);var B,V,X=D.sel,Z=X.ranges;if(n.addNew&&!n.extend?(V=D.sel.contains(r),V>-1?B=Z[V]:B=new On(r,r)):(B=D.sel.primary(),V=D.sel.primIndex),n.unit=="rectangle")n.addNew||(B=new On(r,r)),r=Cr(e,t,!0,!0),V=-1;else{var ge=tl(e,r,n.unit);n.extend?B=rs(B,ge.anchor,ge.head,n.extend):B=ge}n.addNew?V==-1?(V=Z.length,Fr(D,ca(e,Z.concat([B]),V),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[V].empty()&&n.unit=="char"&&!n.extend?(Fr(D,ca(e,Z.slice(0,V).concat(Z.slice(V+1)),0),{scroll:!1,origin:"*mouse"}),X=D.sel):as(D,V,B,Pe):(V=0,Fr(D,new Gr([B],0),Pe),X=D.sel);var Ce=r;function We(xt){if(yt(Ce,xt)==0)return;if(Ce=xt,n.unit=="rectangle"){for(var Ot=[],Yt=e.options.tabSize,jt=z(ct(D,r.line).text,r.ch,Yt),un=z(ct(D,xt.line).text,xt.ch,Yt),Qn=Math.min(jt,un),Ar=Math.max(jt,un),dr=Math.min(r.line,xt.line),ra=Math.min(e.lastLine(),Math.max(r.line,xt.line));dr<=ra;dr++){var Zr=ct(D,dr).text,Er=we(Zr,Qn,Yt);Qn==Ar?Ot.push(new On(Qe(dr,Er),Qe(dr,Er))):Zr.length>Er&&Ot.push(new On(Qe(dr,Er),Qe(dr,we(Zr,Ar,Yt))))}Ot.length||Ot.push(new On(r,r)),Fr(D,ca(e,X.ranges.slice(0,V).concat(Ot),V),{origin:"*mouse",scroll:!1}),e.scrollIntoView(xt)}else{var qr=B,Pr=tl(e,xt,n.unit),Or=qr.anchor,xr;yt(Pr.anchor,Or)>0?(xr=Pr.head,Or=ur(qr.from(),Pr.anchor)):(xr=Pr.anchor,Or=lt(qr.to(),Pr.head));var fr=X.ranges.slice(0);fr[V]=Xl(e,new On(_t(D,Or),xr)),Fr(D,ca(e,fr,V),Pe)}}var Fe=i.wrapper.getBoundingClientRect(),tt=0;function it(xt){var Ot=++tt,Yt=Cr(e,xt,!0,n.unit=="rectangle");if(!Yt)return;if(yt(Yt,Ce)!=0){e.curOp.focus=M(),We(Yt);var jt=Si(i,D);(Yt.line>=jt.to||Yt.lineFe.bottom?20:0;un&&setTimeout(mr(e,function(){if(tt!=Ot)return;i.scroller.scrollTop+=un,it(xt)}),50)}}function vt(xt){e.state.selectingText=!1,tt=Infinity,xt&&(Y(xt),i.input.focus()),ze(i.wrapper.ownerDocument,"mousemove",Et),ze(i.wrapper.ownerDocument,"mouseup",wt),D.history.lastSelOrigin=null}var Et=mr(e,function(xt){xt.buttons===0||!Ue(xt)?vt(xt):it(xt)}),wt=mr(e,vt);e.state.selectingText=wt,be(i.wrapper.ownerDocument,"mousemove",Et),be(i.wrapper.ownerDocument,"mouseup",wt)}function Xl(e,t){var r=t.anchor,n=t.head,i=ct(e.doc,r.line);if(yt(r,n)==0&&r.sticky==n.sticky)return t;var D=Je(i);if(!D)return t;var B=ot(D,r.ch,r.sticky),V=D[B];if(V.from!=r.ch&&V.to!=r.ch)return t;var X=B+(V.from==r.ch==(V.level!=1)?0:1);if(X==0||X==D.length)return t;var Z;if(n.line!=r.line)Z=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ge=ot(D,n.ch,n.sticky),Ce=ge-B||(n.ch-r.ch)*(V.level==1?-1:1);ge==X-1||ge==X?Z=Ce<0:Z=Ce>0}var We=D[X+(Z?-1:0)],Fe=Z==(We.level==1),tt=Fe?We.from:We.to,it=Fe?"after":"before";return r.ch==tt&&r.sticky==it?t:new On(new Qe(r.line,tt,it),n)}function nl(e,t,r,n){var i,D;if(t.touches)i=t.touches[0].clientX,D=t.touches[0].clientY;else try{i=t.clientX,D=t.clientY}catch(We){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Y(t);var B=e.display,V=B.lineDiv.getBoundingClientRect();if(D>V.bottom||!ue(e,r))return re(t);D-=V.top-B.viewOffset;for(var X=0;X=i){var ge=An(e.doc,D),Ce=e.display.gutterSpecs[X];return ke(e,r,e,ge,Ce.className,t),re(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(ba(e.display,t)||$l(e,t))return;if(Ve(e,t,"contextmenu"))return;S||e.display.input.onContextMenu(t)}function $l(e,t){return ue(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),en(e)}var ji={toString:function(){return"CodeMirror.Init"}},il={},Wo={};function Yl(e){var t=e.optionHandlers;function r(n,i,D,B){e.defaults[n]=i,D&&(t[n]=B?function(V,X,Z){Z!=ji&&D(V,X,Z)}:D)}e.defineOption=r,e.Init=ji,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,Ba(n)},!0),r("indentUnit",2,Ba,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){oo(n),en(n),Hn(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!i)return;var D=[],B=n.doc.first;n.doc.iter(function(X){for(var Z=0;;){var ge=X.text.indexOf(i,Z);if(ge==-1)break;Z=ge+i.length,D.push(Qe(B,ge))}B++});for(var V=D.length-1;V>=0;V--)Ii(n.doc,i,D[V],Qe(D[V].line,D[V].ch+i.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,D){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),D!=ji&&n.refresh()}),r("specialCharPlaceholder",ga,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!x),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){al(n),Ea(n)},!0),r("keyMap","default",function(n,i,D){var B=jo(i),V=D!=ji&&jo(D);V&&V.detach&&V.detach(n,B),B.attach&&B.attach(n,V||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ql,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=zr(i,n.options.lineNumbers),Ea(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?Ur(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Ua(n)},!0),r("scrollbarStyle","native",function(n){Oi(n),Ua(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=zr(n.options.gutters,i),Ea(n)},!0),r("firstLineNumber",1,Ea,!0),r("lineNumberFormatter",function(n){return n},Ea,!0),r("showCursorWhenSelecting",!1,Bn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Ya(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Bn,!0),r("singleCursorHeightPerLine",!0,Bn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,oo,!0),r("addModeClass",!1,oo,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,oo,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=ji;if(!t!=!n){var i=e.display.dragFunctions,D=t?be:ze;D(e.display.scroller,"dragstart",i.start),D(e.display.scroller,"dragenter",i.enter),D(e.display.scroller,"dragover",i.over),D(e.display.scroller,"dragleave",i.leave),D(e.display.scroller,"drop",i.drop)}}function Ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(u(e.display.wrapper,"CodeMirror-wrap"),er(e)),Kr(e),Hn(e),en(e),setTimeout(function(){return Ua(e)},100)}function lr(e,t){var r=this;if(!(this instanceof lr))return new lr(e,t);this.options=t=t?N(t):{},N(il,t,!1);var n=t.value;typeof n=="string"?n=new Qr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new lr.inputStyles[t.inputStyle](this),D=this.display=new yi(e,n,i,t);D.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oi(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 $,keySeq:null,specialChars:null},t.autofocus&&!s&&D.input.focus(),F&&P<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Dl(),Ma(this),this.curOp.forceUpdate=!0,gs(this,n),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ra(r)},20):Ya(this);for(var B in Wo)Wo.hasOwnProperty(B)&&Wo[B](this,t[B],ji);_r(this),t.finishInit&&t.finishInit(this);for(var V=0;V20*20}be(t.scroller,"touchstart",function(X){if(!Ve(e,X)&&!D(X)&&!ds(e,X)){t.input.ensurePolled(),clearTimeout(r);var Z=+new Date;t.activeTouch={start:Z,moved:!1,prev:Z-n.end<=300?n:null},X.touches.length==1&&(t.activeTouch.left=X.touches[0].pageX,t.activeTouch.top=X.touches[0].pageY)}}),be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),be(t.scroller,"touchend",function(X){var Z=t.activeTouch;if(Z&&!ba(t,X)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var ge=e.coordsChar(t.activeTouch,"page"),Ce;!Z.prev||B(Z,Z.prev)?Ce=new On(ge,ge):!Z.prev.prev||B(Z,Z.prev.prev)?Ce=e.findWordAt(ge):Ce=new On(Qe(ge.line,0),_t(e.doc,Qe(ge.line+1,0))),e.setSelection(Ce.anchor,Ce.head),e.focus(),Y(X)}i()}),be(t.scroller,"touchcancel",i),be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Za(e,t.scroller.scrollTop),ua(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),be(t.scroller,"mousewheel",function(X){return ao(e,X)}),be(t.scroller,"DOMMouseScroll",function(X){return ao(e,X)}),be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(X){Ve(e,X)||oe(X)},over:function(X){Ve(e,X)||(Al(e,X),oe(X))},start:function(X){return Ol(e,X)},drop:mr(e,wl),leave:function(X){Ve(e,X)||Ws(e)}};var V=t.input.getField();be(V,"keyup",function(X){return Zs.call(e,X)}),be(V,"keydown",mr(e,Qs)),be(V,"keypress",mr(e,qs)),be(V,"focus",function(X){return Ra(e,X)}),be(V,"blur",function(X){return Ya(e,X)})}var cs=[];lr.defineInitHook=function(e){return cs.push(e)};function Eo(e,t,r,n){var i=e.doc,D;r==null&&(r="add"),r=="smart"&&(i.mode.indent?D=Xe(e,t).state:r="prev");var B=e.options.tabSize,V=ct(i,t),X=z(V.text,null,B);V.stateAfter&&(V.stateAfter=null);var Z=V.text.match(/^\s*/)[0],ge;if(!n&&!/\S/.test(V.text))ge=0,r="not";else if(r=="smart"&&(ge=i.mode.indent(D,V.text.slice(Z.length),V.text),ge==De||ge>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?ge=z(ct(i,t-1).text,null,B):ge=0:r=="add"?ge=X+e.options.indentUnit:r=="subtract"?ge=X-e.options.indentUnit:typeof r=="number"&&(ge=X+r),ge=Math.max(0,ge);var Ce="",We=0;if(e.options.indentWithTabs)for(var Fe=Math.floor(ge/B);Fe;--Fe)We+=B,Ce+=" ";if(WeB,X=Mt(t),Z=null;if(V&&n.ranges.length>1)if(Ca&&Ca.text.join(` `)==t){if(n.ranges.length%Ca.text.length==0){Z=[];for(var ge=0;ge=0;We--){var Fe=n.ranges[We],tt=Fe.from(),it=Fe.to();Fe.empty()&&(r&&r>0?tt=Qe(tt.line,tt.ch-r):e.state.overwrite&&!V?it=Qe(it.line,Math.min(ct(D,it.line).text.length,it.ch+Q(X).length)):V&&Ca&&Ca.lineWise&&Ca.text.join(` `)==X.join(` `)&&(tt=it=Qe(tt.line,0)));var vt={from:tt,to:it,text:Z?Z[We%Z.length]:X,origin:i||(V?"paste":e.state.cutIncoming>B?"cut":"+input")};ki(e.doc,vt),cn(e,"inputRead",e,vt)}t&&!V&&sl(e,t),Ja(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ce),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Hr(t,function(){return fs(t,r,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)continue;var D=e.getModeAt(i.head),B=!1;if(D.electricChars){for(var V=0;V-1){B=Eo(e,i.head.line,"smart");break}}else D.electricInput&&(D.electricInput.test(ct(e.doc,i.head.line).text.slice(0,i.head.ch))&&(B=Eo(e,i.head.line,"smart")));B&&cn(e,"electricInput",e,i.head.line)}}function ll(e){for(var t=[],r=[],n=0;nD&&(Eo(this,V.head.line,n,!0),D=V.head.line,B==this.doc.sel.primIndex&&Ja(this));else{var X=V.from(),Z=V.to(),ge=Math.max(D,X.line);D=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ce=ge;Ce0&&as(this.doc,B,new On(X,We[B].to()),xe)}}}),getTokenAt:function(n,i){return qn(this,n,i)},getLineTokens:function(n,i){return qn(this,Qe(n),i,!0)},getTokenTypeAt:function(n){n=_t(this.doc,n);var i=At(this,ct(this.doc,n.line)),D=0,B=(i.length-1)/2,V=n.ch,X;if(V==0)X=i[2];else for(;;){var Z=D+B>>1;if((Z?i[Z*2-1]:0)>=V)B=Z;else if(i[Z*2+1]X&&(n=X,B=!0),V=ct(this.doc,n)}else V=n;return En(this,V,{top:0,left:0},i||"page",D||B).top+(B?this.doc.height-In(V):0)},defaultTextHeight:function(){return cr(this.display)},defaultCharWidth:function(){return Tr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,D,B,V){var X=this.display;n=hn(this,_t(this.doc,n));var Z=n.bottom,ge=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),X.sizer.appendChild(i),B=="over")Z=n.top;else if(B=="above"||B=="near"){var Ce=Math.max(X.wrapper.clientHeight,this.doc.height),We=Math.max(X.sizer.clientWidth,X.lineSpace.clientWidth);(B=="above"||n.bottom+i.offsetHeight>Ce)&&n.top>i.offsetHeight?Z=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=Ce&&(Z=n.bottom),ge+i.offsetWidth>We&&(ge=We-i.offsetWidth)}i.style.top=Z+"px",i.style.left=i.style.right="",V=="right"?(ge=X.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(V=="left"?ge=0:V=="middle"&&(ge=(X.sizer.clientWidth-i.offsetWidth)/2),i.style.left=ge+"px"),D&&So(this,{left:ge,top:Z,right:ge+i.offsetWidth,bottom:Z+i.offsetHeight})},triggerOnKeyDown:Mr(Qs),triggerOnKeyPress:Mr(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Mr(el),execCommand:function(n){if(vo.hasOwnProperty(n))return vo[n].call(null,this)},triggerElectric:Mr(function(n){sl(this,n)}),findPosH:function(n,i,D,B){var V=1;i<0&&(V=-1,i=-i);for(var X=_t(this.doc,n),Z=0;Z0&&ge(D.charAt(B-1));)--B;for(;V.5||this.options.lineWrapping)&&Kr(this),ke(this,"refresh",this)}),swapDoc:Mr(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),gs(this,n),en(this),this.display.input.reset(),Qa(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},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}},ie(e),e.registerHelper=function(n,i,D){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=D},e.registerGlobalHelper=function(n,i,D,B){e.registerHelper(n,i,B),r[n]._global.push({pred:D,val:B})}}function hs(e,t,r,n,i){var D=t,B=r,V=ct(e,t.line),X=i&&e.direction=="rtl"?-r:r;function Z(){var wt=t.line+X;return wt=e.first+e.size?!1:(t=new Qe(wt,t.ch,t.sticky),V=ct(e,wt))}function ge(wt){var xt;if(n=="codepoint"){var Ot=V.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ot)?xt=null:xt=new Qe(t.line,Math.max(0,Math.min(V.text.length,t.ch+r*(Ot>=55296&&Ot<56320?2:1))),-r)}else i?xt=kl(e.cm,V,t,r):xt=os(V,t,r);if(xt==null)if(!wt&&Z())t=ss(i,e.cm,V,t.line,X);else return!1;else t=xt;return!0}if(n=="char"||n=="codepoint")ge();else if(n=="column")ge(!0);else if(n=="word"||n=="group")for(var Ce=null,We=n=="group",Fe=e.cm&&e.cm.getHelper(t,"wordChars"),tt=!0;!(r<0&&!ge(!tt));tt=!1){var it=V.text.charAt(t.ch)||` `,vt=Ge(it,Fe)?"w":We&&it==` `?"n":!We||/\s/.test(it)?null:"p";if(We&&!tt&&!vt&&(vt="s"),Ce&&Ce!=vt){r<0&&(r=1,ge(),t.sticky="after");break}if(vt&&(Ce=vt),r>0&&!ge(!tt))break}var Et=No(e,t,D,B,!0);return Dn(D,Et)&&(Et.hitSide=!0),Et}function cl(e,t,r,n){var i=e.doc,D=t.left,B;if(n=="page"){var V=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),X=Math.max(V-.5*cr(e.display),3);B=(r>0?t.bottom:t.top)+r*X}else n=="line"&&(B=r>0?t.bottom+3:t.top-3);for(var Z;!(Z=vn(e,D,B),!Z.outside);){if(r<0?B<=0:B>=i.height){Z.hitSide=!0;break}B+=r*5}return Z}var zn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zn.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;ul(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function D(V){for(var X=V.target;X;X=X.parentNode){if(X==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(X.className))break}return!1}be(i,"paste",function(V){if(!D(V)||Ve(n,V)||ol(V,n))return;P<=11&&setTimeout(mr(n,function(){return t.updateFromDOM()}),20)}),be(i,"compositionstart",function(V){t.composing={data:V.data,done:!1}}),be(i,"compositionupdate",function(V){t.composing||(t.composing={data:V.data,done:!1})}),be(i,"compositionend",function(V){t.composing&&(V.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),be(i,"touchstart",function(){return r.forceCompositionEnd()}),be(i,"input",function(){t.composing||t.readFromDOMSoon()});function B(V){if(!D(V)||Ve(n,V))return;if(n.somethingSelected())Ko({lineWise:!1,text:n.getSelections()}),V.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var X=ll(n);Ko({lineWise:!0,text:X.text}),V.type=="cut"&&n.operation(function(){n.setSelections(X.ranges,0,xe),n.replaceSelection("",null,"cut")})}else return;if(V.clipboardData){V.clipboardData.clearData();var Z=Ca.text.join(` `);if(V.clipboardData.setData("Text",Z),V.clipboardData.getData("Text")==Z){V.preventDefault();return}}var ge=dl(),Ce=ge.firstChild;n.display.lineSpace.insertBefore(ge,n.display.lineSpace.firstChild),Ce.value=Ca.text.join(` `);var We=document.activeElement;H(Ce),setTimeout(function(){n.display.lineSpace.removeChild(ge),We.focus(),We==i&&r.showPrimarySelection()},50)}be(i,"copy",B),be(i,"cut",B)},zn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zn.prototype.prepareSelection=function(){var e=pa(this.cm,!1);return e.focus=document.activeElement==this.div,e},zn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line=t.display.viewFrom&&fl(t,n)||{node:V[0].measure.map[2],offset:0},Z=i.linee.firstLine()&&(n=Qe(n.line-1,ct(e.doc,n.line-1).length)),i.ch==ct(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var D,B,V;n.line==t.viewFrom||(D=Jn(e,n.line))==0?(B=Ut(t.view[0].line),V=t.view[0].node):(B=Ut(t.view[D].line),V=t.view[D-1].node.nextSibling);var X=Jn(e,i.line),Z,ge;if(X==t.view.length-1?(Z=t.viewTo-1,ge=t.lineDiv.lastChild):(Z=Ut(t.view[X+1].line)-1,ge=t.view[X+1].node.previousSibling),!V)return!1;for(var Ce=e.doc.splitLines(tu(e,V,ge,B,Z)),We=qt(e.doc,Qe(B,0),Qe(Z,ct(e.doc,Z).text.length));Ce.length>1&&We.length>1;)if(Q(Ce)==Q(We))Ce.pop(),We.pop(),Z--;else if(Ce[0]==We[0])Ce.shift(),We.shift(),B++;else break;for(var Fe=0,tt=0,it=Ce[0],vt=We[0],Et=Math.min(it.length,vt.length);Fen.ch&&wt.charCodeAt(wt.length-tt-1)==xt.charCodeAt(xt.length-tt-1);)Fe--,tt++;Ce[Ce.length-1]=wt.slice(0,wt.length-tt).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(Fe).replace(/\u200b+$/,"");var Yt=Qe(B,Fe),jt=Qe(Z,We.length?Q(We).length-tt:0);if(Ce.length>1||Ce[0]||yt(Yt,jt))return Ii(e.doc,Ce,Yt,jt,"+input"),!0},zn.prototype.ensurePolled=function(){this.forceCompositionEnd()},zn.prototype.reset=function(){this.forceCompositionEnd()},zn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zn.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)},zn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hr(this.cm,function(){return Hn(e.cm)})},zn.prototype.setUneditable=function(e){e.contentEditable="false"},zn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||mr(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zn.prototype.onContextMenu=function(){},zn.prototype.resetPosition=function(){},zn.prototype.needsContentAttribute=!0;function fl(e,t){var r=Ie(e,t.line);if(!r||r.hidden)return null;var n=ct(e.doc,t.line),i=ne(r,n,t.line),D=Je(n,e.doc.direction),B="left";if(D){var V=ot(D,t.ch);B=V%2?"right":"left"}var X=mt(i.map,t.ch,B);return X.offset=X.collapse=="right"?X.end:X.start,X}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Bi(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var D="",B=!1,V=e.doc.lineSeparator(),X=!1;function Z(Fe){return function(tt){return tt.id==Fe}}function ge(){B&&(D+=V,X&&(D+=V),B=X=!1)}function Ce(Fe){Fe&&(ge(),D+=Fe)}function We(Fe){if(Fe.nodeType==1){var tt=Fe.getAttribute("cm-text");if(tt){Ce(tt);return}var it=Fe.getAttribute("cm-marker"),vt;if(it){var Et=e.findMarks(Qe(n,0),Qe(i+1,0),Z(+it));Et.length&&(vt=Et[0].find(0))&&Ce(qt(e.doc,vt.from,vt.to).join(V));return}if(Fe.getAttribute("contenteditable")=="false")return;var wt=/^(pre|div|p|li|table|br)$/i.test(Fe.nodeName);if(!/^br$/i.test(Fe.nodeName)&&Fe.textContent.length==0)return;wt&&ge();for(var xt=0;xt=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),be(i,"paste",function(B){if(Ve(n,B)||ol(B,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function D(B){if(Ve(n,B))return;if(n.somethingSelected())Ko({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var V=ll(n);Ko({lineWise:!0,text:V.text}),B.type=="cut"?n.setSelections(V.ranges,null,xe):(r.prevInput="",i.value=V.text.join(` `),H(i))}else return;B.type=="cut"&&(n.state.cutIncoming=+new Date)}be(i,"cut",D),be(i,"copy",D),be(e.scroller,"paste",function(B){if(ba(e,B)||Ve(n,B))return;if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var V=new Event("paste");V.clipboardData=B.clipboardData,i.dispatchEvent(V)}),be(e.lineSpace,"selectstart",function(B){ba(e,B)||Y(B)}),be(i,"compositionstart",function(){var B=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:B,range:n.markText(B,n.getCursor("to"),{className:"CodeMirror-composing"})}}),be(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},vr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},vr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},vr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=pa(e);if(e.options.moveInputWithCursor){var i=hn(e,r.sel.primary().head,"div"),D=t.wrapper.getBoundingClientRect(),B=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+B.top-D.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+B.left-D.left))}return n},vr.prototype.showSelection=function(e){var t=this.cm,r=t.display;o(r.cursorDiv,e.cursors),o(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},vr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&H(this.textarea),F&&P>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",F&&P>=9&&(this.hasSelection=null))},vr.prototype.getField=function(){return this.textarea},vr.prototype.supportsTouch=function(){return!1},vr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},vr.prototype.blur=function(){this.textarea.blur()},vr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},vr.prototype.receivedFocus=function(){this.slowPoll()},vr.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()})},vr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},vr.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Tt(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(F&&P>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var D=i.charCodeAt(0);if(D==8203&&!n&&(n="\u200B"),D==8666)return this.reset(),this.cm.execCommand("undo")}for(var B=0,V=Math.min(n.length,i.length);B1e3||i.indexOf(` `)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},vr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},vr.prototype.onKeyPress=function(){F&&P>=9&&(this.hasSelection=null),this.fastPoll()},vr.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var D=Cr(r,e),B=n.scroller.scrollTop;if(!D||w)return;var V=r.options.resetSelectionOnContextMenu;V&&r.doc.sel.contains(D)==-1&&mr(r,Fr)(r.doc,xa(D),xe);var X=i.style.cssText,Z=t.wrapper.style.cssText,ge=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-ge.top-5)+"px; left: "+(e.clientX-ge.left-5)+`px; z-index: 1000; background: `+(F?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;A&&(Ce=window.scrollY),n.input.focus(),A&&window.scrollTo(null,Ce),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Fe,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function We(){if(i.selectionStart!=null){var it=r.somethingSelected(),vt="\u200B"+(it?i.value:"");i.value="\u21DA",i.value=vt,t.prevInput=it?"":"\u200B",i.selectionStart=1,i.selectionEnd=vt.length,n.selForContextMenu=r.doc.sel}}function Fe(){if(t.contextMenuPending!=Fe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=Z,i.style.cssText=X,F&&P<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=B),i.selectionStart!=null){(!F||F&&P<9)&&We();var it=0,vt=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?mr(r,Rs)(r):it++<10?n.detectingSelectAll=setTimeout(vt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(vt,200)}}if(F&&P>=9&&We(),S){oe(e);var tt=function(){ze(window,"mouseup",tt),setTimeout(Fe,20)};be(window,"mouseup",tt)}else setTimeout(Fe,50)},vr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},vr.prototype.setUneditable=function(){},vr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?N(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 r=M();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=V.getValue()}var i;if(e.form&&(be(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var D=e.form;i=D.submit;try{var B=D.submit=function(){n(),D.submit=i,D.submit(),D.submit=B}}catch(X){}}t.finishInit=function(X){X.save=n,X.getTextArea=function(){return e},X.toTextArea=function(){X.toTextArea=isNaN,n(),e.parentNode.removeChild(X.getWrapperElement()),e.style.display="",e.form&&(ze(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var V=lr(function(X){return e.parentNode.insertBefore(X,e.nextSibling)},t);return V}function au(e){e.off=ze,e.on=be,e.wheelEventPixels=ro,e.Doc=Qr,e.splitLines=Mt,e.countColumn=z,e.findColumn=we,e.isWordChar=Ne,e.Pass=De,e.signal=ke,e.Line=Yn,e.changeEnd=Ta,e.scrollbarModel=eo,e.Pos=Qe,e.cmpPos=yt,e.modes=Bt,e.mimeModes=gt,e.resolveMode=Rt,e.getMode=Jt,e.modeExtensions=nn,e.extendMode=Tn,e.copyState=Qt,e.startState=Wn,e.innerMode=Gn,e.commands=vo,e.keyMap=Wa,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=Ui,e.normalizeKeyMap=Pl,e.StringStream=kt,e.SharedTextMarker=ho,e.TextMarker=ni,e.LineWidget=fo,e.e_preventDefault=Y,e.e_stopPropagation=q,e.e_stop=oe,e.addClass=U,e.contains=T,e.rmClass=u,e.keyNames=ri}Yl(lr),ql(lr);var iu="iter insert remove copy getEditor constructor".split(" ");for(var zo in Qr.prototype)Qr.prototype.hasOwnProperty(zo)&&ae(iu,zo)<0&&(lr.prototype[zo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Qr.prototype[zo]));return ie(Qr),lr.inputStyles={textarea:vr,contenteditable:zn},lr.defineMode=function(e){!lr.defaults.mode&&e!="null"&&(lr.defaults.mode=e),Nt.apply(this,arguments)},lr.defineMIME=Wt,lr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),lr.defineMIME("text/plain","null"),lr.defineExtension=function(e,t){lr.prototype[e]=t},lr.defineDocExtension=function(e,t){Qr.prototype[e]=t},lr.fromTextArea=ru,au(lr),lr.version="5.58.2",lr})},WaYH:function(pt,$e,G){"use strict";var ee=G("rePB"),K=G("Ff2n"),R=G("VTBJ"),j=G("1OyB"),m=G("vuIU"),_=G("JX7q"),F=G("Ji7U"),P=G("LK+K"),A=G("q1tI"),L=G("TSYQ"),C=G.n(L),w=G("sboe"),k=G("OZM5"),O=function(S){var y=S.prefixCls,u=S.level,d=S.isStart,o=S.isEnd;if(!u)return null;for(var a="".concat(y,"-indent-unit"),b=[],g=0;g1&&arguments[1]!==void 0?arguments[1]:!1,Le=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Pe&&M[Le])return M[Le];var we=window.getComputedStyle(xe),me=we.getPropertyValue("box-sizing")||we.getPropertyValue("-moz-box-sizing")||we.getPropertyValue("-webkit-box-sizing"),pe=parseFloat(we.getPropertyValue("padding-bottom"))+parseFloat(we.getPropertyValue("padding-top")),Q=parseFloat(we.getPropertyValue("border-bottom-width"))+parseFloat(we.getPropertyValue("border-top-width")),de=T.map(function(fe){return"".concat(fe,":").concat(we.getPropertyValue(fe))}).join(";"),te={sizingStyle:de,paddingSize:pe,borderSize:Q,boxSizing:me};return Pe&&Le&&(M[Le]=te),te}function H(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),xe.getAttribute("wrap")?U.setAttribute("wrap",xe.getAttribute("wrap")):U.removeAttribute("wrap");var me=W(xe,Pe),pe=me.paddingSize,Q=me.borderSize,de=me.boxSizing,te=me.sizingStyle;U.setAttribute("style","".concat(te,";").concat(g)),U.value=xe.value||xe.placeholder||"";var fe=Number.MIN_SAFE_INTEGER,Ae=Number.MAX_SAFE_INTEGER,_e=U.scrollHeight,Ne;if(de==="border-box"?_e+=Q:de==="content-box"&&(_e-=pe),Le!==null||we!==null){U.value=" ";var Ge=U.scrollHeight-pe;Le!==null&&(fe=Ge*Le,de==="border-box"&&(fe=fe+pe+Q),_e=Math.max(fe,_e)),we!==null&&(Ae=Ge*we,de==="border-box"&&(Ae=Ae+pe+Q),Ne=_e>Ae?"":"hidden",_e=Math.min(Ae,_e))}return{height:_e,minHeight:fe,maxHeight:Ae,overflowY:Ne,resize:"none"}}var I=G("Gytx"),N=G.n(I),z;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(z||(z={}));var $=function(xe){Object(j.a)(Le,xe);var Pe=Object(m.a)(Le);function Le(we){var me;return Object(K.a)(this,Le),me=Pe.call(this,we),me.nextFrameActionId=void 0,me.resizeFrameId=void 0,me.textArea=void 0,me.saveTextArea=function(pe){me.textArea=pe},me.handleResize=function(pe){var Q=me.state.resizeStatus,de=me.props,te=de.autoSize,fe=de.onResize;if(Q!==z.NONE)return;typeof fe=="function"&&fe(pe),te&&me.resizeOnNextFrame()},me.resizeOnNextFrame=function(){cancelAnimationFrame(me.nextFrameActionId),me.nextFrameActionId=requestAnimationFrame(me.resizeTextarea)},me.resizeTextarea=function(){var pe=me.props.autoSize;if(!pe||!me.textArea)return;var Q=pe.minRows,de=pe.maxRows,te=H(me.textArea,!1,Q,de);me.setState({textareaStyles:te,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(me.resizeFrameId),me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:z.RESIZED},function(){me.resizeFrameId=requestAnimationFrame(function(){me.setState({resizeStatus:z.NONE}),me.fixFirefoxAutoScroll()})})})})},me.renderTextArea=function(){var pe=me.props,Q=pe.prefixCls,de=Q===void 0?"rc-textarea":Q,te=pe.autoSize,fe=pe.onResize,Ae=pe.className,_e=pe.disabled,Ne=me.state,Ge=Ne.textareaStyles,et=Ne.resizeStatus,Ze=Object(o.a)(me.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ke=b()(de,Ae,Object(P.a)({},"".concat(de,"-disabled"),_e));"value"in Ze&&(Ze.value=Ze.value||"");var He=Object(F.a)(Object(F.a)(Object(F.a)({},me.props.style),Ge),et===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return _.createElement(d,{onResize:me.handleResize,disabled:!(te||fe)},_.createElement("textarea",Object(ee.a)({},Ze,{className:Ke,style:He,ref:me.saveTextArea})))},me.state={textareaStyles:{},resizeStatus:z.NONE},me}return Object(R.a)(Le,[{key:"componentDidUpdate",value:function(me){(me.value!==this.props.value||!N()(me.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var me=this.textArea.selectionStart,pe=this.textArea.selectionEnd;this.textArea.setSelectionRange(me,pe)}}catch(Q){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(_.Component),ae=$,le=function(xe){Object(j.a)(Le,xe);var Pe=Object(m.a)(Le);function Le(we){var me;Object(K.a)(this,Le),me=Pe.call(this,we),me.resizableTextArea=void 0,me.focus=function(){me.resizableTextArea.textArea.focus()},me.saveTextArea=function(Q){me.resizableTextArea=Q},me.handleChange=function(Q){var de=me.props.onChange;me.setValue(Q.target.value,function(){me.resizableTextArea.resizeTextarea()}),de&&de(Q)},me.handleKeyDown=function(Q){var de=me.props,te=de.onPressEnter,fe=de.onKeyDown;Q.keyCode===13&&te&&te(Q),fe&&fe(Q)};var pe=typeof we.value=="undefined"||we.value===null?we.defaultValue:we.value;return me.state={value:pe},me}return Object(R.a)(Le,[{key:"setValue",value:function(me,pe){"value"in this.props||this.setState({value:me},pe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return _.createElement(ae,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(me){return"value"in me?{value:me.value}:null}}]),Le}(_.Component),De=$e.default=le},YiCM:function(pt,$e,G){pt.exports={flexRow:"flexRow___1gyd-",flexJustifyCenter:"flexJustifyCenter___19NSh",flexAlignEnd:"flexAlignEnd___3THeK",flexAlignCenter:"flexAlignCenter___1yurC",flexColumn:"flexColumn___3l0VS",formWrap:"formWrap___28DyB",JupyterFieldWrapElse:"JupyterFieldWrapElse___9ONZN",button:"button___3DTwc",buttonWrap:"buttonWrap___n_juQ",width240:"width240___3x3F-",difficultyHint:"difficultyHint___bU8gT",color888:"color888___3aAYi",color0152d9:"color0152d9___2qsP8",installPackage:"installPackage___3uqSL",apply:"apply___1rKfU",p1:"p1___tgl6j",p2:"p2___1P24b"}},ZW9T:function(pt,$e,G){"use strict";G.d($e,"a",function(){return x});var ee=G("k1fw"),K=G("miYZ"),R=G("tsqr"),j=G("rAM+"),m=G("tJVT"),_=G("PpiC"),F=G("q1tI"),P=G.n(F),A=G("bdgK");function L(v,h,S,y,u){var d=h.getWordUntilPosition(S),o={startLineNumber:S.lineNumber,endLineNumber:S.lineNumber,startColumn:d.startColumn,endColumn:d.endColumn},a=y.map(function(b){return{label:b,kind:v.languages.CompletionItemKind.Keyword,insertText:b,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}});return u.map(function(b){a.push(Object(ee.a)(Object(ee.a)({},b),{},{range:o}))}),a}var C=function(v){var h={label:"ifelse",kind:v.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `),insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet},S=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];v.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(o,a){var b=L(v,o,a,S,[h]);return{suggestions:b}}});var y=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];v.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(o,a){var b=[{label:"print",kind:v.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` `),insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}],g=L(v,o,a,y,b);return{suggestions:g}}});var u=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];v.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(o,a){var b=[h,{label:"main",kind:v.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` `),insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:v.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` `),insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}],g=L(v,o,a,u,b);return{suggestions:g}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",k=G("LvDl");function O(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function E(){}var p=!1,f={"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 s(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=v;if(Array.isArray(v)){for(var S=0;S0||Ye.target.offsetWidth>0)&&Ae.current.instance.layout()}}catch(dt){Se.e(dt)}finally{Se.f()}}),re.observe(fe.current)),re}function at(){R.b.warn(decodeURIComponent(w))}var ut=function(){var oe=Ae.current.instance;if(d!=null&&oe&&Ke){var Se=oe.getModel();Se&&d!==Se.getValue()&&(p=!0,Se.setValue(d),oe.layout(),p=!1)}};Object(F.useEffect)(function(){_e.current&&clearTimeout(_e.current),_e.current=setTimeout(function(){ut()},500)},[d,Ke,Ae.current]);function ot(){var re=Ae.current.instance;if(re){var oe=re.getSelection(),Se=Ae.current.pastePos||{},Ue=new l.Range(Se.startLineNumber||oe.endLineNumber,Se.startColumn||oe.endColumn,Se.endLineNumber||oe.endLineNumber,Se.endColumn||oe.endColumn);setTimeout(function(){re.executeEdits("",[{range:Ue,text:""}])},300)}}function nt(re){(window.navigator.platform.match("Mac")?re.metaKey:re.ctrlKey)&&re.keyCode==83&&(re.preventDefault(),z())}var Je=function(){if(ae&&Ae.current.instance){var oe=Ae.current.instance.getContentHeight();Y(oe0||Le.target.offsetWidth>0)&&ae.layout()}}catch(we){xe.e(we)}finally{xe.f()}}),le.observe(T.current)),le}Object(F.useEffect)(function(){T.current&&G.e(26).then(G.t.bind(null,"M/lh",7)).then(function(ae){l=ae;var le=l.editor.createDiffEditor(T.current,Object(ee.a)(Object(ee.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},g),{},{wordWrap:!0}));H(le);var De=I(le);return function(){le.dispose();var xe=le.getModel();xe&&xe.dispose(),De.unobserve(T.current)}})},[]),Object(F.useEffect)(function(){W&&W.setModel({original:l.editor.createModel(d,a),modified:l.editor.createModel(o,a)})},[d,o,a,W]);var N=O(S),z=O(u),$={width:N,height:z};return P.a.createElement("div",{className:"my-diff-editor",ref:T,style:$})}},ZpRC:function(pt,$e,G){"use strict";function ee(C){return typeof C=="object"&&C!=null&&C.nodeType===1}function K(C,w){return(!w||C!=="hidden")&&C!=="visible"&&C!=="clip"}function R(C,w){if(C.clientHeightw||p>C&&f=w&&s>=k?p-C-O:f>w&&sk?f-w+E:0}var m=function(C,w){var k=window,O=w.scrollMode,E=w.block,p=w.inline,f=w.boundary,s=w.skipOverflowHiddenElements,l=typeof f=="function"?f:function(Ge){return Ge!==f};if(!ee(C))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,x=[],v=C;ee(v)&&l(v);){if((v=v.parentElement)===c){x.push(v);break}v!=null&&v===document.body&&R(v)&&!R(document.documentElement)||v!=null&&R(v,s)&&x.push(v)}for(var h=k.visualViewport?k.visualViewport.width:innerWidth,S=k.visualViewport?k.visualViewport.height:innerHeight,y=window.scrollX||pageXOffset,u=window.scrollY||pageYOffset,d=C.getBoundingClientRect(),o=d.height,a=d.width,b=d.top,g=d.right,T=d.bottom,M=d.left,U=E==="start"||E==="nearest"?b:E==="end"?T:b+o/2,W=p==="center"?M+a/2:p==="end"?g:M,H=[],I=0;I=0&&M>=0&&T<=S&&g<=h&&b>=le&&T<=xe&&M>=Pe&&g<=De)return H;var Le=getComputedStyle(N),we=parseInt(Le.borderLeftWidth,10),me=parseInt(Le.borderTopWidth,10),pe=parseInt(Le.borderRightWidth,10),Q=parseInt(Le.borderBottomWidth,10),de=0,te=0,fe="offsetWidth"in N?N.offsetWidth-N.clientWidth-we-pe:0,Ae="offsetHeight"in N?N.offsetHeight-N.clientHeight-me-Q:0;if(c===N)de=E==="start"?U:E==="end"?U-S:E==="nearest"?j(u,u+S,S,me,Q,u+U,u+U+o,o):U-S/2,te=p==="start"?W:p==="center"?W-h/2:p==="end"?W-h:j(y,y+h,h,we,pe,y+W,y+W+a,a),de=Math.max(0,de+u),te=Math.max(0,te+y);else{de=E==="start"?U-le-me:E==="end"?U-xe+Q+Ae:E==="nearest"?j(le,xe,$,me,Q+Ae,U,U+o,o):U-(le+$/2)+Ae/2,te=p==="start"?W-Pe-we:p==="center"?W-(Pe+ae/2)+fe/2:p==="end"?W-De+pe+fe:j(Pe,De,ae,we,pe+fe,W,W+a,a);var _e=N.scrollLeft,Ne=N.scrollTop;U+=Ne-(de=Math.max(0,Math.min(Ne+de,N.scrollHeight-$+Ae))),W+=_e-(te=Math.max(0,Math.min(_e+te,N.scrollWidth-ae+fe)))}H.push({el:N,top:de,left:te})}return H};function _(C){return C===Object(C)&&Object.keys(C).length!==0}function F(C,w){w===void 0&&(w="auto");var k="scrollBehavior"in document.body.style;C.forEach(function(O){var E=O.el,p=O.top,f=O.left;E.scroll&&k?E.scroll({top:p,left:f,behavior:w}):(E.scrollTop=p,E.scrollLeft=f)})}function P(C){return C===!1?{block:"end",inline:"nearest"}:_(C)?C:{block:"start",inline:"nearest"}}function A(C,w){var k=!C.ownerDocument.documentElement.contains(C);if(_(w)&&typeof w.behavior=="function")return w.behavior(k?[]:m(C,w));if(k)return;var O=P(w);return F(m(C,O),O.behavior)}var L=$e.a=A},Zss7:function(pt,$e,G){var ee;(function(K){var R=/^\s+/,j=/\s+$/,m=0,_=K.round,F=K.min,P=K.max,A=K.random;function L(Q,de){if(Q=Q||"",de=de||{},Q instanceof L)return Q;if(!(this instanceof L))return new L(Q,de);var te=C(Q);this._originalInput=Q,this._r=te.r,this._g=te.g,this._b=te.b,this._a=te.a,this._roundA=_(100*this._a)/100,this._format=de.format||te.format,this._gradientType=de.gradientType,this._r<1&&(this._r=_(this._r)),this._g<1&&(this._g=_(this._g)),this._b<1&&(this._b=_(this._b)),this._ok=te.ok,this._tc_id=m++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var Q=this.toRgb();return(Q.r*299+Q.g*587+Q.b*114)/1e3},getLuminance:function(){var Q=this.toRgb(),de,te,fe,Ae,_e,Ne;return de=Q.r/255,te=Q.g/255,fe=Q.b/255,de<=.03928?Ae=de/12.92:Ae=K.pow((de+.055)/1.055,2.4),te<=.03928?_e=te/12.92:_e=K.pow((te+.055)/1.055,2.4),fe<=.03928?Ne=fe/12.92:Ne=K.pow((fe+.055)/1.055,2.4),.2126*Ae+.7152*_e+.0722*Ne},setAlpha:function(Q){return this._a=H(Q),this._roundA=_(100*this._a)/100,this},toHsv:function(){var Q=E(this._r,this._g,this._b);return{h:Q.h*360,s:Q.s,v:Q.v,a:this._a}},toHsvString:function(){var Q=E(this._r,this._g,this._b),de=_(Q.h*360),te=_(Q.s*100),fe=_(Q.v*100);return this._a==1?"hsv("+de+", "+te+"%, "+fe+"%)":"hsva("+de+", "+te+"%, "+fe+"%, "+this._roundA+")"},toHsl:function(){var Q=k(this._r,this._g,this._b);return{h:Q.h*360,s:Q.s,l:Q.l,a:this._a}},toHslString:function(){var Q=k(this._r,this._g,this._b),de=_(Q.h*360),te=_(Q.s*100),fe=_(Q.l*100);return this._a==1?"hsl("+de+", "+te+"%, "+fe+"%)":"hsla("+de+", "+te+"%, "+fe+"%, "+this._roundA+")"},toHex:function(Q){return f(this._r,this._g,this._b,Q)},toHexString:function(Q){return"#"+this.toHex(Q)},toHex8:function(Q){return s(this._r,this._g,this._b,this._a,Q)},toHex8String:function(Q){return"#"+this.toHex8(Q)},toRgb:function(){return{r:_(this._r),g:_(this._g),b:_(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+_(this._r)+", "+_(this._g)+", "+_(this._b)+")":"rgba("+_(this._r)+", "+_(this._g)+", "+_(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:_(I(this._r,255)*100)+"%",g:_(I(this._g,255)*100)+"%",b:_(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+_(I(this._r,255)*100)+"%, "+_(I(this._g,255)*100)+"%, "+_(I(this._b,255)*100)+"%)":"rgba("+_(I(this._r,255)*100)+"%, "+_(I(this._g,255)*100)+"%, "+_(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[f(this._r,this._g,this._b,!0)]||!1},toFilter:function(Q){var de="#"+l(this._r,this._g,this._b,this._a),te=de,fe=this._gradientType?"GradientType = 1, ":"";if(Q){var Ae=L(Q);te="#"+l(Ae._r,Ae._g,Ae._b,Ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+fe+"startColorstr="+de+",endColorstr="+te+")"},toString:function(Q){var de=!!Q;Q=Q||this._format;var te=!1,fe=this._a<1&&this._a>=0,Ae=!de&&fe&&(Q==="hex"||Q==="hex6"||Q==="hex3"||Q==="hex4"||Q==="hex8"||Q==="name");return Ae?Q==="name"&&this._a===0?this.toName():this.toRgbString():(Q==="rgb"&&(te=this.toRgbString()),Q==="prgb"&&(te=this.toPercentageRgbString()),(Q==="hex"||Q==="hex6")&&(te=this.toHexString()),Q==="hex3"&&(te=this.toHexString(!0)),Q==="hex4"&&(te=this.toHex8String(!0)),Q==="hex8"&&(te=this.toHex8String()),Q==="name"&&(te=this.toName()),Q==="hsl"&&(te=this.toHslString()),Q==="hsv"&&(te=this.toHsvString()),te||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(Q,de){var te=Q.apply(null,[this].concat([].slice.call(de)));return this._r=te._r,this._g=te._g,this._b=te._b,this.setAlpha(te._a),this},lighten:function(){return this._applyModification(h,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(c,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(u,arguments)},_applyCombination:function(Q,de){return Q.apply(null,[this].concat([].slice.call(de)))},analogous:function(){return this._applyCombination(g,arguments)},complement:function(){return this._applyCombination(d,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(b,arguments)},triad:function(){return this._applyCombination(o,arguments)},tetrad:function(){return this._applyCombination(a,arguments)}},L.fromRatio=function(Q,de){if(typeof Q=="object"){var te={};for(var fe in Q)Q.hasOwnProperty(fe)&&(fe==="a"?te[fe]=Q[fe]:te[fe]=De(Q[fe]));Q=te}return L(Q,de)};function C(Q){var de={r:0,g:0,b:0},te=1,fe=null,Ae=null,_e=null,Ne=!1,Ge=!1;return typeof Q=="string"&&(Q=me(Q)),typeof Q=="object"&&(we(Q.r)&&we(Q.g)&&we(Q.b)?(de=w(Q.r,Q.g,Q.b),Ne=!0,Ge=String(Q.r).substr(-1)==="%"?"prgb":"rgb"):we(Q.h)&&we(Q.s)&&we(Q.v)?(fe=De(Q.s),Ae=De(Q.v),de=p(Q.h,fe,Ae),Ne=!0,Ge="hsv"):we(Q.h)&&we(Q.s)&&we(Q.l)&&(fe=De(Q.s),_e=De(Q.l),de=O(Q.h,fe,_e),Ne=!0,Ge="hsl"),Q.hasOwnProperty("a")&&(te=Q.a)),te=H(te),{ok:Ne,format:Q.format||Ge,r:F(255,P(de.r,0)),g:F(255,P(de.g,0)),b:F(255,P(de.b,0)),a:te}}function w(Q,de,te){return{r:I(Q,255)*255,g:I(de,255)*255,b:I(te,255)*255}}function k(Q,de,te){Q=I(Q,255),de=I(de,255),te=I(te,255);var fe=P(Q,de,te),Ae=F(Q,de,te),_e,Ne,Ge=(fe+Ae)/2;if(fe==Ae)_e=Ne=0;else{var et=fe-Ae;Ne=Ge>.5?et/(2-fe-Ae):et/(fe+Ae);switch(fe){case Q:_e=(de-te)/et+(de1&&(He-=1),He<1/6?Ze+(Ke-Ze)*6*He:He<1/2?Ke:He<2/3?Ze+(Ke-Ze)*(2/3-He)*6:Ze}if(de===0)fe=Ae=_e=te;else{var Ge=te<.5?te*(1+de):te+de-te*de,et=2*te-Ge;fe=Ne(et,Ge,Q+1/3),Ae=Ne(et,Ge,Q),_e=Ne(et,Ge,Q-1/3)}return{r:fe*255,g:Ae*255,b:_e*255}}function E(Q,de,te){Q=I(Q,255),de=I(de,255),te=I(te,255);var fe=P(Q,de,te),Ae=F(Q,de,te),_e,Ne,Ge=fe,et=fe-Ae;if(Ne=fe===0?0:et/fe,fe==Ae)_e=0;else{switch(fe){case Q:_e=(de-te)/et+(de>1)+720)%360;--de;)fe.h=(fe.h+Ae)%360,_e.push(L(fe));return _e}function T(Q,de){de=de||6;for(var te=L(Q).toHsv(),fe=te.h,Ae=te.s,_e=te.v,Ne=[],Ge=1/de;de--;)Ne.push(L({h:fe,s:Ae,v:_e})),_e=(_e+Ge)%1;return Ne}L.mix=function(Q,de,te){te=te===0?0:te||50;var fe=L(Q).toRgb(),Ae=L(de).toRgb(),_e=te/100,Ne={r:(Ae.r-fe.r)*_e+fe.r,g:(Ae.g-fe.g)*_e+fe.g,b:(Ae.b-fe.b)*_e+fe.b,a:(Ae.a-fe.a)*_e+fe.a};return L(Ne)},L.readability=function(Q,de){var te=L(Q),fe=L(de);return(K.max(te.getLuminance(),fe.getLuminance())+.05)/(K.min(te.getLuminance(),fe.getLuminance())+.05)},L.isReadable=function(Q,de,te){var fe=L.readability(Q,de),Ae,_e;_e=!1,Ae=pe(te);switch(Ae.level+Ae.size){case"AAsmall":case"AAAlarge":_e=fe>=4.5;break;case"AAlarge":_e=fe>=3;break;case"AAAsmall":_e=fe>=7;break}return _e},L.mostReadable=function(Q,de,te){var fe=null,Ae=0,_e,Ne,Ge,et;te=te||{},Ne=te.includeFallbackColors,Ge=te.level,et=te.size;for(var Ze=0;ZeAe&&(Ae=_e,fe=L(de[Ze]));return L.isReadable(Q,fe,{level:Ge,size:et})||!Ne?fe:(te.includeFallbackColors=!1,L.mostReadable(Q,["#fff","#000"],te))};var M=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},U=L.hexNames=W(M);function W(Q){var de={};for(var te in Q)Q.hasOwnProperty(te)&&(de[Q[te]]=te);return de}function H(Q){return Q=parseFloat(Q),(isNaN(Q)||Q<0||Q>1)&&(Q=1),Q}function I(Q,de){$(Q)&&(Q="100%");var te=ae(Q);return Q=F(de,P(0,parseFloat(Q))),te&&(Q=parseInt(Q*de,10)/100),K.abs(Q-de)<1e-6?1:Q%de/parseFloat(de)}function N(Q){return F(1,P(0,Q))}function z(Q){return parseInt(Q,16)}function $(Q){return typeof Q=="string"&&Q.indexOf(".")!=-1&&parseFloat(Q)===1}function ae(Q){return typeof Q=="string"&&Q.indexOf("%")!=-1}function le(Q){return Q.length==1?"0"+Q:""+Q}function De(Q){return Q<=1&&(Q=Q*100+"%"),Q}function xe(Q){return K.round(parseFloat(Q)*255).toString(16)}function Pe(Q){return z(Q)/255}var Le=function(){var Q="[-\\+]?\\d+%?",de="[-\\+]?\\d*\\.\\d+%?",te="(?:"+de+")|(?:"+Q+")",fe="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?",Ae="[\\s|\\(]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")[,|\\s]+("+te+")\\s*\\)?";return{CSS_UNIT:new RegExp(te),rgb:new RegExp("rgb"+fe),rgba:new RegExp("rgba"+Ae),hsl:new RegExp("hsl"+fe),hsla:new RegExp("hsla"+Ae),hsv:new RegExp("hsv"+fe),hsva:new RegExp("hsva"+Ae),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function we(Q){return!!Le.CSS_UNIT.exec(Q)}function me(Q){Q=Q.replace(R,"").replace(j,"").toLowerCase();var de=!1;if(M[Q])Q=M[Q],de=!0;else if(Q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var te;return(te=Le.rgb.exec(Q))?{r:te[1],g:te[2],b:te[3]}:(te=Le.rgba.exec(Q))?{r:te[1],g:te[2],b:te[3],a:te[4]}:(te=Le.hsl.exec(Q))?{h:te[1],s:te[2],l:te[3]}:(te=Le.hsla.exec(Q))?{h:te[1],s:te[2],l:te[3],a:te[4]}:(te=Le.hsv.exec(Q))?{h:te[1],s:te[2],v:te[3]}:(te=Le.hsva.exec(Q))?{h:te[1],s:te[2],v:te[3],a:te[4]}:(te=Le.hex8.exec(Q))?{r:z(te[1]),g:z(te[2]),b:z(te[3]),a:Pe(te[4]),format:de?"name":"hex8"}:(te=Le.hex6.exec(Q))?{r:z(te[1]),g:z(te[2]),b:z(te[3]),format:de?"name":"hex"}:(te=Le.hex4.exec(Q))?{r:z(te[1]+""+te[1]),g:z(te[2]+""+te[2]),b:z(te[3]+""+te[3]),a:Pe(te[4]+""+te[4]),format:de?"name":"hex8"}:(te=Le.hex3.exec(Q))?{r:z(te[1]+""+te[1]),g:z(te[2]+""+te[2]),b:z(te[3]+""+te[3]),format:de?"name":"hex"}:!1}function pe(Q){var de,te;return Q=Q||{level:"AA",size:"small"},de=(Q.level||"AA").toUpperCase(),te=(Q.size||"small").toLowerCase(),de!=="AA"&&de!=="AAA"&&(de="AA"),te!=="small"&&te!=="large"&&(te="small"),{level:de,size:te}}pt.exports?pt.exports=L:!(ee=function(){return L}.call($e,G,$e,pt),ee!==void 0&&(pt.exports=ee))})(Math)},bT9E:function(pt,$e,G){"use strict";G.d($e,"a",function(){return K});var ee=G("VTBJ");function K(R,j){var m=Object(ee.a)({},R);return Array.isArray(j)&&j.forEach(function(_){delete m[_]}),m}},biw7:function(pt,$e,G){"use strict";var ee=G("q1tI"),K=G.n(ee),R=ee.createContext(null);$e.a=R},c5Ni:function(pt,$e,G){},dGDm:function(pt,$e,G){pt.exports={selectEnvironment:"selectEnvironment___1zrTT",search:"search___2Sku-",searchListWrap:"searchListWrap___30F5Q",searchList:"searchList___dxlP6",name:"name___28Ilk",tag:"tag___GYHhS",searchListActive:"searchListActive___1H-dL",spin:"spin___2GYcy",common:"common___JE3ZS",title:"title___11-q3",tags:"tags___3vE7b",tagActive:"tagActive___1c0bT",wrap:"wrap___fFVWs",allList:"allList___2mVBv",item:"item___2NPtB",itemActive:"itemActive___2aQTm",line:"line___yjjYk",apply:"apply___3NyxD",p1:"p1___2xNuY",p2:"p2___uGM8U",list:"list___1jtVf",items:"items___3gafm",darklySelectEnvironment:"darklySelectEnvironment___2KS0W"}},dejd:function(pt,$e,G){},dmUQ:function(pt,$e,G){"use strict";var ee=G("Ff2n"),K=G("rePB"),R=G("1OyB"),j=G("vuIU"),m=G("Ji7U"),_=G("md7G"),F=G("foSv"),P=G("q1tI"),A=G.n(P),L=G("TSYQ"),C=G.n(L),w=G("4IlW");function k(o,a){var b=Object.keys(o);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(o);a&&(g=g.filter(function(T){return Object.getOwnPropertyDescriptor(o,T).enumerable})),b.push.apply(b,g)}return b}function O(o){for(var a=1;a1?ae-1:0),De=1;De1?I-1:0),z=1;z=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var I=0;return H.indexOf(".")>=0&&(I=H.length-H.indexOf(".")-1),I},T.getInputDisplayValue=function(W){var H=W||T.state,I=H.focused,N=H.inputValue,z=H.value,$;I?$=N:$=T.toPrecisionAsStep(z),$==null&&($="");var ae=T.formatWrapper($);return h(T.props.decimalSeparator)&&(ae=ae.toString().replace(".",T.props.decimalSeparator)),ae},T.recordCursorPosition=function(){try{T.cursorStart=T.input.selectionStart,T.cursorEnd=T.input.selectionEnd,T.currentValue=T.input.value,T.cursorBefore=T.input.value.substring(0,T.cursorStart),T.cursorAfter=T.input.value.substring(T.cursorEnd)}catch(W){}},T.restoreByAfter=function(W){if(W===void 0)return!1;var H=T.input.value,I=H.lastIndexOf(W);if(I===-1)return!1;var N=T.cursorBefore.length;return T.lastKeyCode===w.a.DELETE&&T.cursorBefore.charAt(N-1)===W[0]?(T.fixCaret(N,N),!0):I+W.length===H.length?(T.fixCaret(I,I),!0):!1},T.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(H,I){var N=W.substring(I);return T.restoreByAfter(N)})},T.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},T.stop=function(){T.autoStepTimer&&clearTimeout(T.autoStepTimer)},T.down=function(W,H,I){T.pressingUpOrDown=!0,T.step("down",W,H,I)},T.up=function(W,H,I){T.pressingUpOrDown=!0,T.step("up",W,H,I)},T.saveInput=function(W){T.input=W};var M=g.value;M===void 0&&(M=g.defaultValue),T.state={focused:g.autoFocus};var U=T.getValidValue(T.toNumber(M));return T.state=O(O({},T.state),{},{inputValue:T.toPrecisionAsStep(U),value:U}),T}return Object(j.a)(b,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(T){var M=this.props,U=M.value,W=M.onChange,H=M.max,I=M.min,N=this.state.focused;if(T){if(!S(T.value,U)||!S(T.max,H)||!S(T.min,I)){var z=N?U:this.getValidValue(U),$;this.pressingUpOrDown?$=z:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:$})}var ae="value"in this.props?U:this.state.value;"max"in this.props&&T.max!==H&&typeof ae=="number"&&ae>H&&W&&W(H),"min"in this.props&&T.min!==I&&typeof ae=="number"&&ae1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(T);return isNaN(W)?T:(WU&&(W=U),W)}},{key:"setValue",value:function(T,M){var U=this.props.precision,W=this.isNotCompleteNumber(parseFloat(T))?null:parseFloat(T),H=this.state.value,I=H===void 0?null:H,N=this.state.inputValue,z=N===void 0?null:N,$=typeof W=="number"?W.toFixed(U):"".concat(W),ae=W!==I||$!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},M)):this.setState({value:W,inputValue:this.toPrecisionAsStep(T)},M),ae&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(T){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,W=U.precision,H=U.step;if(h(W))return W;var I=this.getPrecision(M),N=this.getPrecision(H),z=this.getPrecision(T);return T?Math.max(z,I+N):I+N}},{key:"getPrecisionFactor",value:function(T){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(T,M);return Math.pow(10,U)}},{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(T){return this.props.formatter?this.props.formatter(T):T}},{key:"toPrecisionAsStep",value:function(T){if(this.isNotCompleteNumber(T)||T==="")return T;var M=Math.abs(this.getMaxPrecision(T));return isNaN(M)?T.toString():Number(T).toFixed(M)}},{key:"toNumber",value:function(T){var M=this.props.precision,U=this.state.focused,W=T&&T.length>16&&U;return this.isNotCompleteNumber(T)||W?T:h(M)?Math.round(T*Math.pow(10,M))/Math.pow(10,M):Number(T)}},{key:"upStep",value:function(T,M){var U=this.props.step,W=this.getPrecisionFactor(T,M),H=Math.abs(this.getMaxPrecision(T,M)),I=((W*T+W*U*M)/W).toFixed(H);return this.toNumber(I)}},{key:"downStep",value:function(T,M){var U=this.props.step,W=this.getPrecisionFactor(T,M),H=Math.abs(this.getMaxPrecision(T,M)),I=((W*T-W*U*M)/W).toFixed(H);return this.toNumber(I)}},{key:"step",value:function(T,M){var U=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var I=this.props;if(I.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var z=this["".concat(T,"Step")](N,W),$=z>I.max||zI.max?z=I.max:z=le),Ve=(nt||nt===0)&&(isNaN(nt)||Number(nt)<=De),he=ke||W||H,ue=Ve||W||H,ie=C()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(K.a)({},"".concat(U,"-handler-up-disabled"),he)),Y=C()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(K.a)({},"".concat(U,"-handler-down-disabled"),ue)),q=I?{onTouchStart:he?f:this.up,onTouchEnd:this.stop}:{onMouseDown:he?f:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},re=I?{onTouchStart:ue?f:this.down,onTouchEnd:this.stop}:{onMouseDown:ue?f:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:Te,style:xe,title:Pe,onMouseEnter:Le,onMouseLeave:we,onMouseOver:me,onMouseOut:pe,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(U,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Increase Value","aria-disabled":he,className:ie}),z||A.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:s})),A.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Decrease Value","aria-disabled":ue,className:Y}),$||A.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:s}))),A.a.createElement("div",{className:"".concat(U,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":De,"aria-valuemax":le,"aria-valuenow":nt,required:Q,type:fe,placeholder:Ae,onPaste:rt,onClick:de,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:te,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Be?this.onKeyDown:f,onKeyUp:Be?this.onKeyUp:f,autoFocus:Ke,maxLength:Ze,readOnly:H,disabled:W,max:le,min:De,step:et,name:He,title:Pe,id:_e,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ze),pattern:Ge,inputMode:Ne,onInput:at},be))))}}]),b}(A.a.Component);y.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:f,onKeyDown:f,onPressEnter:f,onFocus:f,onBlur:f,parser:l,required:!1,autoComplete:"off"};var u=y,d=$e.a=u},dugo:function(pt,$e,G){"use strict";G.r($e);var ee=G("7Kak"),K=G("9yH6"),R=G("tJVT"),j=G("q1tI"),m=G.n(j),_=G("FrRK"),F=G("2qtc"),P=G("kLXV"),A=G("5Dmo"),L=G("3S7+"),C=G("+L6B"),w=G("2/Rp"),k=G("R9oj"),O=G("ECub"),E=G("miYZ"),p=G("tsqr"),f=G("9og8"),s=G("WmNS"),l=G.n(s),c=G("9kvl"),x=G("HBuW"),v=G("1vsH"),h=G("Lai7"),S=G.n(h),y=G("9Bee"),u=G("EGTK"),d=G("m3rI"),o=G("mT4J"),a=G.n(o),b=G("ErOA"),g=function(He){var rt=He.newShixuns,at=He.user,ut=He.dispatch,ot=Object(j.useState)(null),nt=Object(R.a)(ot,2),Je=nt[0],Te=nt[1],be=Object(j.useState)(null),Be=Object(R.a)(be,2),ze=Be[0],ke=Be[1],Ve=Object(j.useState)({}),he=Object(R.a)(Ve,2),ue=he[0],ie=he[1],Y=Object(j.useState)(!1),q=Object(R.a)(Y,2),re=q[0],oe=q[1],Se=Object(j.useState)(!1),Ue=Object(R.a)(Se,2),Ye=Ue[0],dt=Ue[1],ht=rt.environmentData,st=ht.frequence_image,Dt=st===void 0?[]:st,Mt=ht.environments,Tt=Mt===void 0?[]:Mt,zt=ht.other_image,Xt=zt===void 0?[]:zt,St=ue.name,Bt=ue.description,gt=ue.authorization,Nt=ue.template_shixuns,Wt=Nt===void 0?[]:Nt,Rt=ue.recommend_shixuns,Jt=Rt===void 0?[]:Rt;Object(j.useEffect)(function(){ut({type:"newShixuns/getEnvironmentData"})},[]),Object(j.useEffect)(function(){if(ze===null)return;nn()},[ze]);var nn=function(){var kt=Object(f.a)(l.a.mark(function ct(){var qt;return l.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(x.P)({mirror_repository_id:ze});case 2:qt=an.sent,ie(qt.data);case 4:case"end":return an.stop()}},ct)}));return function(){return kt.apply(this,arguments)}}();Object(j.useEffect)(function(){(Dt==null?void 0:Dt.length)>0&&ke(Dt[0].id)},[Dt]);var Tn=function(ct){Te(ct),oe(!0)},Qt=function(){var kt=Object(f.a)(l.a.mark(function ct(){var qt,Mn;return l.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return dt(!0),Ut.next=3,Object(b.a)("/api/shixuns/".concat(Je==null?void 0:Je.identifier,"/copy.json"),{method:"post",body:{}});case 3:qt=Ut.sent,qt.status===0&&(c.d===null||c.d===void 0||c.d.push("/shixuns/".concat((Mn=qt.data)===null||Mn===void 0?void 0:Mn.shixun,"/edit")),oe(!1),p.b.success("\u590D\u5236\u6210\u529F")),dt(!1);case 6:case"end":return Ut.stop()}},ct)}));return function(){return kt.apply(this,arguments)}}(),Gn=function(){oe(!1)},Wn=function(){var kt=Object(f.a)(l.a.mark(function ct(){var qt,Mn,an,Ut=arguments;return l.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return qt=Ut.length>0&&Ut[0]!==void 0?Ut[0]:!1,Object(v.cb)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE","\u5168\u5B9E\u8DF5\u9879\u76EE",qt?"\u6682\u4E0D\u9009\u7528\u955C\u50CF":"\u4F7F\u7528\u5F53\u524D\u955C\u50CF"]),Mn=ze&&!qt?{image_id:ze}:{},It.next=5,Object(b.a)("/api/shixuns/choose_environment_or_skip.json",{method:"post",body:Mn});case 5:an=It.sent,an.status===0&&c.d.push("/shixuns/".concat(an.data.identifier,"/edit"));case 7:case"end":return It.stop()}},ct)}));return function(){return kt.apply(this,arguments)}}();return m.a.createElement("div",{className:a.a.practice},m.a.createElement(u.a,{dispatch:ut,value:ze,data:Tt,otherData:Xt,tags:Dt,onChange:function(ct){return ke(ct)}}),m.a.createElement("div",{className:a.a.right},m.a.createElement("header",null,m.a.createElement("div",{className:a.a.title},"\u5B9E\u9A8C\u73AF\u5883:\xA0",ze===null?"\u2014 \u2014":St)),m.a.createElement("div",{className:a.a.content},ze===null&&m.a.createElement(m.a.Fragment,null,m.a.createElement(O.a,{image:S.a,description:"\u8BF7\u9009\u62E9\u5B9E\u9A8C\u73AF\u5883"}),m.a.createElement("div",{className:a.a.btns},m.a.createElement(w.a,{size:"large",style:{marginRight:20},onClick:function(){return Wn(!0)}}," \u6682\u4E0D\u9009\u7528\u955C\u50CF"),m.a.createElement(w.a,{size:"large",type:"primary",disabled:ze===null,onClick:function(){return Wn()}},"\u4F7F\u7528\u5F53\u524D\u955C\u50CF"))),ze!==null&&m.a.createElement("div",{className:a.a.des},m.a.createElement("div",{className:a.a.mainBody},m.a.createElement(y.a,{value:Bt})),m.a.createElement("div",{className:a.a.btns,style:{borderBottom:Wt.length||Jt.length?"1px solid #F1F1F1":0}},m.a.createElement(w.a,{size:"large",style:{marginRight:20},onClick:function(){return Wn(!0)}}," \u6682\u4E0D\u9009\u7528\u955C\u50CF"),m.a.createElement(w.a,{size:"large",type:"primary",disabled:ze===null,onClick:function(){return Wn()}},"\u4F7F\u7528\u5F53\u524D\u955C\u50CF")),!!Wt.length&&m.a.createElement("div",{className:a.a.title},"\u57FA\u4E8E\u6A21\u677F\u521B\u5EFA"),m.a.createElement("ul",{className:a.a.sys},Wt.map(function(kt,ct){var qt=kt.pic,Mn=kt.name,an=kt.identifier,Ut=kt.template_description,An=kt.id;return m.a.createElement("li",{className:a.a.li,key:ct},m.a.createElement("div",{className:a.a.d1},m.a.createElement("div",{className:a.a.img},m.a.createElement("img",{src:"".concat(d.a.IMG_SERVER,"/").concat(qt)})),m.a.createElement("div",{className:a.a.btn},m.a.createElement("div",{className:a.a.b1,onClick:function(){return Object(v.R)("/shixuns/".concat(an,"/challenges"))}},"\u67E5\u770B\u8BE6\u60C5"),m.a.createElement("div",{className:a.a.b2,onClick:function(){return Tn(kt)}},"\u4F7F\u7528\u6A21\u677F")),m.a.createElement("div",{className:a.a.bot},Mn||"--")),Ut?m.a.createElement(L.a,{title:Ut},m.a.createElement("div",{className:a.a.d2},Ut)):m.a.createElement("div",{className:a.a.d2},"--"))})),!!Jt.length&&m.a.createElement("div",{className:a.a.title},"\u63A8\u8350\u5B9E\u8DF5\u9879\u76EE\u6837\u4F8B"),m.a.createElement("ul",{className:a.a.sys},Jt.map(function(kt,ct){var qt=kt.pic,Mn=kt.name,an=kt.identifier,Ut=kt.id;return m.a.createElement("li",{className:a.a.li,key:ct},m.a.createElement("div",{className:a.a.d1},m.a.createElement("div",{className:a.a.img},m.a.createElement("img",{src:"".concat(d.a.IMG_SERVER,"/").concat(qt)})),m.a.createElement("div",{className:a.a.btn},m.a.createElement("div",{className:a.a.b1,onClick:function(){return Object(v.R)("/shixuns/".concat(an,"/challenges"))}},"\u67E5\u770B\u8BE6\u60C5"),m.a.createElement("div",{className:a.a.b2,onClick:function(){return Tn(kt)}},"\u4E00\u952E\u590D\u5236")),m.a.createElement("div",{className:a.a.bot},Mn)))}))))),m.a.createElement(P.a,{title:"\u4E00\u952E\u65B0\u5EFA",visible:re,centered:!0,onCancel:Gn,footer:null,wrapClassName:a.a.practiceModal},gt&&m.a.createElement("div",{className:a.a.content},m.a.createElement("p",null,"\u4E00\u952E\u65B0\u5EFA\u540E\uFF0C\u60A8\u53EF\u4EE5\u57FA\u4E8E\u8FD9\u4E2A\u5B9E\u8BAD\u4FEE\u6539\u5F62\u6210\u65B0\u7684\u5B9E\u8BAD"),m.a.createElement(w.a,{className:a.a.btn,loading:Ye,onClick:Qt},"\u786E\u8BA4\u590D\u5236")),!gt&&m.a.createElement("div",{className:a.a.content},m.a.createElement("aside",null,m.a.createElement("p",null,"\u8BE5\u5B9E\u8BAD\u6240\u4F7F\u7528\u7684\u5B9E\u9A8C\u73AF\u5883\u4E3A\u79C1\u6709\u73AF\u5883\uFF1A",m.a.createElement("span",{style:{color:"#0152d9"}},St)),m.a.createElement("p",null,"\u60A8\u65E0\u8BE5\u5B9E\u9A8C\u73AF\u5883\u7684\u4F7F\u7528\u6743\u9650\uFF0C\u6240\u4EE5\u65E0\u6CD5\u590D\u5236\u8BE5\u5B9E\u8BAD")),m.a.createElement("div",{onClick:function(){return oe(!1)}},"\u6211\u77E5\u9053\u4E86"))))},T=Object(c.a)(function(Ke){var He=Ke.newShixuns,rt=Ke.globalSetting,at=Ke.user;return{newShixuns:He,globalSetting:rt,user:at}})(g),M=G("sRBo"),U=G("kaz8"),W=G("5NDa"),H=G("5rEg"),I=G("k1fw"),N=G("y8nQ"),z=G("Vl3Y"),$=G("OaEy"),ae=G("2fM7"),le=G("Ot1p"),De=G("YiCM"),xe=G.n(De),Pe=G("QXZ7"),Le=ae.a.Option,we=function(He){var rt,at,ut,ot,nt,Je=He.newShixuns,Te=He.loading,be=He.dispatch,Be=He.is_jupyter_lab,ze=He.user,ke=z.a.useForm(),Ve=Object(R.a)(ke,1),he=Ve[0],ue=Object(j.useState)({}),ie=Object(R.a)(ue,2),Y=ie[0],q=ie[1],re=Object(j.useState)(!1),oe=Object(R.a)(re,2),Se=oe[0],Ue=oe[1],Ye=Object(j.useState)({}),dt=Object(R.a)(Ye,2),ht=dt[0],st=dt[1];Object(j.useEffect)(function(){var St="newShixuns/getNewShixunsData";Be&&(St="newShixuns/getShixunsJupyterLab"),be({type:St})},[Be]),Object(j.useEffect)(function(){var St,Bt,gt,Nt=Je==null||((St=Je.newData)===null||St===void 0||((Bt=St.main_type)===null||Bt===void 0||((gt=Bt[0])===null||gt===void 0)))?void 0:gt.id;he.setFieldsValue({mainType:Nt}),Tt(Nt)},[Je]);var Dt=function(){be({type:"newShixuns/setActionTabs",payload:{key:"NewShixuns-Apply"}})},Mt=function(Bt,gt){q(Object(I.a)({},gt)),console.log(Bt,"changeValues"),"mainType"in Bt&&Tt(gt.mainType,gt.subType),"subType"in Bt&&Tt(gt.mainType,gt.subType)},Tt=function(Bt){var gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Nt=Je.newData||{},Wt=Nt.main_type,Rt=Nt.small_type,Jt=Wt==null?void 0:Wt.find(function(Tn){return Tn.id===Bt}),nn={mainTypeName:Jt==null?void 0:Jt.type_name,mainTypeDescription:Jt==null?void 0:Jt.description,smallType:[]};gt.map(function(Tn){Rt.map(function(Qt){Tn===Qt.id&&!!Qt.description&&nn.smallType.push({name:Qt.type_name,des:Qt.description})})}),st(nn)},zt=function(){var St=Object(f.a)(l.a.mark(function Bt(gt){var Nt,Wt,Rt,Jt,nn,Tn,Qt,Gn,Wn;return l.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return Nt=gt||{},Wt=Nt.intro,Rt=Nt.mainType,Jt=Nt.subType,nn=Nt.name,Tn=Nt.difficulty,Qt=Nt.jupyter_show_description,Gn=Qt===void 0?!1:Qt,Object(v.cb)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Be?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u4FDD\u5B58"]),ct.next=4,be({type:"newShixuns/submitShixuns",payload:{description:Wt,main_type:Rt,sub_type:Jt,shixun:{jupyter_show_description:Gn,name:nn,trainee:Tn,is_jupyter:!Be,is_jupyter_lab:Be}}});case 4:Wn=ct.sent,Wn&&c.d.push("/shixuns/".concat(Wn.shixun_identifier,"/challenges"));case 6:case"end":return ct.stop()}},Bt)}));return function(gt){return St.apply(this,arguments)}}(),Xt=function(){be({type:"newShixuns/setActionTabs",payload:{key:"Create-Environment"}})};return m.a.createElement(z.a,{form:he,className:xe.a.JupyterFieldWrapElse,scrollToFirstError:!0,layout:"vertical",initialValues:{difficulty:1},onValuesChange:Mt,onFinish:zt},m.a.createElement("div",{className:xe.a.fieldWrap},m.a.createElement(z.a.Item,{name:"name",label:"\u540D\u79F0:",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"}]},m.a.createElement(H.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((rt=Y.name)===null||rt===void 0?void 0:rt.length)||0,"/60")})),m.a.createElement(z.a.Item,{name:"intro",label:"\u7B80\u4ECB:"},m.a.createElement(le.a,{watch:!0})),m.a.createElement(z.a.Item,{name:"jupyter_show_description",valuePropName:"checked"},m.a.createElement(U.a,null,"\u663E\u793A\u4EFB\u52A1\u8981\u6C42\uFF08\u52FE\u9009\u540E\uFF0C\u5C06\u7B80\u4ECB\u4F5C\u4E3A\u4EFB\u52A1\u8981\u6C42\u663E\u793A\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF09")),m.a.createElement("div",{className:"".concat(xe.a.flexRow," ").concat(xe.a.flexAlignCenter)},m.a.createElement(z.a.Item,{className:xe.a.width180,name:"difficulty",label:"\u96BE\u6613\u5EA6:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},m.a.createElement(ae.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6",style:{width:500}},m.a.createElement(Le,{value:1},"\u521D\u7EA7"),m.a.createElement(Le,{value:2},"\u4E2D\u7EA7"),m.a.createElement(Le,{value:3},"\u4E2D\u9AD8\u7EA7"),m.a.createElement(Le,{value:4},"\u9AD8\u7EA7")))),m.a.createElement("div",{className:"".concat(xe.a.flexRow," ").concat(xe.a.flexAlignEnd)},m.a.createElement(z.a.Item,{className:xe.a.width240,name:"mainType",label:"\u5B9E\u9A8C\u73AF\u5883:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"}]},m.a.createElement(ae.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"},(at=Je.newData)===null||at===void 0||((ut=at.main_type)===null||ut===void 0)?void 0:ut.map(function(St){return m.a.createElement(Le,{value:St.id,key:St.id,name:St.description},St.type_name)}))),m.a.createElement(z.a.Item,{name:"subType",className:"".concat(xe.a.width240," ml20")},m.a.createElement(ae.a,{getPopupContainer:function(Bt){return Bt.parentNode},bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u5C0F\u7C7B\u522B",mode:"multiple"},(ot=Je.newData)===null||ot===void 0||((nt=ot.small_type)===null||nt===void 0)?void 0:nt.map(function(St){return m.a.createElement(Le,{value:St.id,key:St.id,name:St.description},St.type_name)}))),m.a.createElement("div",{className:xe.a.installPackage,onClick:function(){return Ue(!0)}},"\u73AF\u5883\u4ECB\u7ECD")),m.a.createElement("div",{className:xe.a.apply},m.a.createElement("span",{className:xe.a.p1},"\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F"),m.a.createElement("span",{className:xe.a.p2,onClick:Dt}," ","\u7533\u8BF7\u65B0\u5EFA"),m.a.createElement("span",{className:xe.a.p2,onClick:Xt}," ","\u5728\u7EBF\u521B\u5EFA"))),m.a.createElement(z.a.Item,null,m.a.createElement("div",{className:xe.a.buttonWrap},m.a.createElement(w.a,{size:"large",className:"".concat(xe.a.button," mr20"),onClick:function(){Object(v.cb)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Be?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u53D6\u6D88"]),c.d.push("/shixuns")}},"\u53D6\u6D88"),m.a.createElement(w.a,{size:"large",type:"primary",className:"".concat(xe.a.button," mr20"),htmlType:"submit",loading:Te["newShixuns/submitCourses"]},"\u4FDD\u5B58"))),m.a.createElement(Pe.a,{installPackage:ht,visible:Se,setVisible:Ue}))},me=Object(c.a)(function(Ke){var He=Ke.newShixuns,rt=Ke.loading,at=Ke.user;return{newShixuns:He,loading:rt.effects,user:at}})(we),pe=G("edzW"),Q=G("5TE/"),de=G.n(Q),te=ae.a.Option,fe=function(He){var rt,at,ut,ot,nt,Je=He.newShixuns,Te=He.loading,be=He.dispatch,Be=He.is_jupyter_lab,ze=He.user,ke=z.a.useForm(),Ve=Object(R.a)(ke,1),he=Ve[0],ue={difficulty:1,is_openi:"1"},ie=Object(j.useState)(ue),Y=Object(R.a)(ie,2),q=Y[0],re=Y[1],oe=Object(j.useState)(!1),Se=Object(R.a)(oe,2),Ue=Se[0],Ye=Se[1],dt=Object(j.useState)([]),ht=Object(R.a)(dt,2),st=ht[0],Dt=ht[1],Mt=Object(j.useState)("GPU"),Tt=Object(R.a)(Mt,2),zt=Tt[0],Xt=Tt[1],St=Object(j.useState)("OpenI"),Bt=Object(R.a)(St,2),gt=Bt[0],Nt=Bt[1],Wt=Object(j.useState)({}),Rt=Object(R.a)(Wt,2),Jt=Rt[0],nn=Rt[1],Tn=Object(j.useState)([]),Qt=Object(R.a)(Tn,2),Gn=Qt[0],Wn=Qt[1];Object(j.useEffect)(function(){var It="newShixuns/getNewShixunsData";Be&&(It="newShixuns/getShixunsJupyterLab"),be({type:It})},[Be]),Object(j.useEffect)(function(){kt(),ct(),he.setFieldsValue({place_image_id:"",spec_id:""})},[zt,gt]);var kt=function(){var It=Object(f.a)(l.a.mark(function on(){var Qe,yt;return l.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(b.a)("/api/shixuns/openi_jupyter_lab_specs.json",{method:"get",params:{compute:zt,cluster_type:gt}});case 2:Qe=bn.sent,Qe.status===0&&Dt((Qe==null||((yt=Qe.data)===null||yt===void 0)?void 0:yt.specs)||[]);case 4:case"end":return bn.stop()}},on)}));return function(){return It.apply(this,arguments)}}(),ct=function(){var It=Object(f.a)(l.a.mark(function on(){var Qe,yt;return l.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(b.a)("/api/shixuns/openi_jupyter_lab_images.json",{method:"get",params:{compute:zt,cluster_type:gt}});case 2:Qe=bn.sent,Qe.status===0&&(zt==="NPU"?Wn((Qe==null?void 0:Qe.data)||[]):Wn((Qe==null||((yt=Qe.data)===null||yt===void 0)?void 0:yt.images)||[]));case 4:case"end":return bn.stop()}},on)}));return function(){return It.apply(this,arguments)}}();Object(j.useEffect)(function(){var It,on,Qe,yt=Je==null||((It=Je.newData)===null||It===void 0||((on=It.main_type)===null||on===void 0||((Qe=on[0])===null||Qe===void 0)))?void 0:Qe.id;he.setFieldsValue({mainType:yt}),an(yt)},[Je]);var qt=function(){be({type:"newShixuns/setActionTabs",payload:{key:"NewShixuns-Apply"}})},Mn=function(on,Qe){re(Object(I.a)({},Qe)),console.log(on,"changeValues"),"mainType"in on&&an(Qe.mainType,Qe.subType),"subType"in on&&an(Qe.mainType,Qe.subType)},an=function(on){var Qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],yt=Je.newData||{},Dn=yt.main_type,bn=yt.small_type,lt=Dn==null?void 0:Dn.find(function(Un){return Un.id===on}),ur={mainTypeName:lt==null?void 0:lt.type_name,mainTypeDescription:lt==null?void 0:lt.description,smallType:[]};Qe.map(function(Un){bn.map(function(_t){Un===_t.id&&!!_t.description&&ur.smallType.push({name:_t.type_name,des:_t.description})})}),nn(ur)},Ut=function(){var It=Object(f.a)(l.a.mark(function on(Qe){var yt,Dn,bn,lt,ur,Un,_t,Pn,Vn,Zn,Rn,hr,At;return l.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return console.log(Qe,"values"),yt=Qe||{},Dn=yt.intro,bn=yt.mainType,lt=yt.subType,ur=yt.name,Un=yt.difficulty,_t=yt.jupyter_show_description,Pn=_t===void 0?!1:_t,Vn=yt.spec_id,Zn=yt.is_openi,Rn=yt.place_image_id,hr=(Gn==null?void 0:Gn.find(function(Pt){return Pt.id===(Rn==null?void 0:Rn[0])}))||{},Object(v.cb)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Be?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u4FDD\u5B58"]),Ct.next=6,be({type:"newShixuns/submitShixuns",payload:{description:Dn,main_type:bn,sub_type:lt,is_openi:Zn==="2",shixun:{jupyter_show_description:Pn,name:ur,trainee:Un,is_jupyter:!Be,is_jupyter_lab:Be},openi_data:{spec_id:Vn,image_data:hr}}});case 6:At=Ct.sent,At&&c.d.push("/shixuns/".concat(At.shixun_identifier,"/challenges"));case 8:case"end":return Ct.stop()}},on)}));return function(Qe){return It.apply(this,arguments)}}(),An=function(){be({type:"newShixuns/setActionTabs",payload:{key:"Create-Environment"}})};return m.a.createElement(z.a,{form:he,className:de.a.JupyterFieldWrapElse,scrollToFirstError:!0,layout:"vertical",initialValues:ue,onValuesChange:Mn,onFinish:Ut},m.a.createElement("div",{className:de.a.fieldWrap},m.a.createElement(z.a.Item,{name:"name",label:"\u540D\u79F0:",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"}]},m.a.createElement(H.a,{bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",suffix:"".concat(((rt=q.name)===null||rt===void 0?void 0:rt.length)||0,"/60")})),m.a.createElement(z.a.Item,{name:"intro",label:"\u7B80\u4ECB:"},m.a.createElement(le.a,{watch:!0})),m.a.createElement(z.a.Item,{name:"jupyter_show_description",valuePropName:"checked"},m.a.createElement(U.a,null,"\u663E\u793A\u4EFB\u52A1\u8981\u6C42\uFF08\u52FE\u9009\u540E\uFF0C\u5C06\u7B80\u4ECB\u4F5C\u4E3A\u4EFB\u52A1\u8981\u6C42\u663E\u793A\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF09")),m.a.createElement("div",{className:"".concat(de.a.flexRow," ").concat(de.a.flexAlignCenter)},m.a.createElement(z.a.Item,{className:de.a.width180,name:"difficulty",label:"\u96BE\u6613\u5EA6:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},m.a.createElement(ae.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6",style:{width:500}},m.a.createElement(te,{value:1},"\u521D\u7EA7"),m.a.createElement(te,{value:2},"\u4E2D\u7EA7"),m.a.createElement(te,{value:3},"\u4E2D\u9AD8\u7EA7"),m.a.createElement(te,{value:4},"\u9AD8\u7EA7")))),m.a.createElement(z.a.Item,{className:de.a.radio,name:"is_openi",label:"\u5B9E\u9A8C\u73AF\u5883",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5B9E\u9A8C\u73AF\u5883"}]},m.a.createElement(K.a.Group,{size:"large",buttonStyle:"solid"},m.a.createElement(K.a.Button,{value:"1"},"\u901A\u7528\u4E91"),m.a.createElement(K.a.Button,{value:"2"},"\u4E13\u6709\u4E91"))),q.is_openi==="1"&&m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:"".concat(de.a.flexRow," ").concat(de.a.flexAlignEnd)},m.a.createElement(z.a.Item,{className:de.a.width240,name:"mainType",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"}]},m.a.createElement(ae.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B"},(at=Je.newData)===null||at===void 0||((ut=at.main_type)===null||ut===void 0)?void 0:ut.map(function(It){return m.a.createElement(te,{value:It.id,key:It.id,name:It.description},It.type_name)}))),m.a.createElement(z.a.Item,{name:"subType",className:"".concat(de.a.width240," ml20")},m.a.createElement(ae.a,{getPopupContainer:function(on){return on.parentNode},bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u5C0F\u7C7B\u522B",mode:"multiple"},(ot=Je.newData)===null||ot===void 0||((nt=ot.small_type)===null||nt===void 0)?void 0:nt.map(function(It){return m.a.createElement(te,{value:It.id,key:It.id,name:It.description},It.type_name)}))),m.a.createElement("div",{className:de.a.installPackage,onClick:function(){return Ye(!0)}},"\u73AF\u5883\u4ECB\u7ECD")),m.a.createElement("div",{className:de.a.apply},m.a.createElement("span",{className:de.a.p1},"\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F"),m.a.createElement("span",{className:de.a.p2,onClick:qt}," ","\u7533\u8BF7\u65B0\u5EFA"),m.a.createElement("span",{className:de.a.p2,onClick:An}," ","\u5728\u7EBF\u521B\u5EFA"))),q.is_openi==="2"&&m.a.createElement(m.a.Fragment,null,m.a.createElement(z.a.Item,{name:"place_image_id",noStyle:!0},m.a.createElement(pe.a,{tab:zt,setTab:Xt,type:gt,setType:Nt,dataSource:Gn})),m.a.createElement(z.a.Item,{className:de.a.width240,name:"spec_id",label:"\u89C4\u683C",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u89C4\u683C"}]},m.a.createElement(ae.a,{bordered:!1,placeholder:"\u8BF7\u9009\u62E9\u89C4\u683C"},st==null?void 0:st.map(function(It){return m.a.createElement(te,{value:It.id,key:It.id},"".concat(It.compute_resource,"\uFF1A").concat(It.cpu_cores,"\u6838 ").concat(zt==="NPU"?It.mem_gi_b:It.gpu_mem_gi_b,"GB"))}))))),m.a.createElement(z.a.Item,null,m.a.createElement("div",{className:de.a.buttonWrap},m.a.createElement(w.a,{size:"large",className:"".concat(de.a.button," mr20"),onClick:function(){Object(v.cb)(["\u5B9E\u8DF5\u9879\u76EE","\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",Be?"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE":"JupyterLab\u5B9E\u8DF5\u9879\u76EE","\u53D6\u6D88"]),c.d.push("/shixuns")}},"\u53D6\u6D88"),m.a.createElement(w.a,{size:"large",type:"primary",className:"".concat(de.a.button," mr20"),htmlType:"submit",loading:Te["newShixuns/submitCourses"]},"\u4FDD\u5B58"))),m.a.createElement(Pe.a,{installPackage:Jt,visible:Ue,setVisible:Ye}))},Ae=Object(c.a)(function(Ke){var He=Ke.newShixuns,rt=Ke.loading,at=Ke.user;return{newShixuns:He,loading:rt.effects,user:at}})(fe),_e=G("N3QO"),Ne=G("6f40"),Ge=G.n(Ne),et=function(){var He=Object(j.useState)("1"),rt=Object(R.a)(He,2),at=rt[0],ut=rt[1],ot=function(Je){ut(Je.target.value)};return m.a.createElement("section",{className:Ge.a.practicalTraining},m.a.createElement("div",{className:Ge.a.titleWrap},m.a.createElement("div",{className:Ge.a.title},"\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE"),m.a.createElement("div",{className:Ge.a.line}),m.a.createElement(K.a.Group,{value:at,onChange:ot},m.a.createElement(K.a,{style:{fontSize:16},value:"1"},"\u5168\u6808\u5B9E\u8DF5\u9879\u76EE"),m.a.createElement(K.a,{value:"2",style:{marginLeft:40,fontSize:16}},"Jupyter Notebook\u5B9E\u8DF5\u9879\u76EE"),m.a.createElement(K.a,{value:"3",style:{marginLeft:40,fontSize:16}},"JupyterLab\u5B9E\u8DF5\u9879\u76EE")),m.a.createElement("div",{className:Ge.a.dec},at==="1"&&"\u591A\u529F\u80FD\u65B0\u578B\u5B9E\u6218\u9879\u76EE\u6A21\u5F0F\uFF0C\u652F\u6301\u56FE\u5F62\u5316\u684C\u9762\u3001Web IDE\u3001\u547D\u4EE4\u884C\u3001\u865A\u62DF\u4EFF\u771F\u7B49\u591A\u79CD\u5B9E\u9A8C\u573A\u666F\uFF0C\u9002\u7528\u4E8E\u5404\u7C7B\u590D\u6742\u5DE5\u7A0B\u9879\u76EE\u7814\u53D1\u3002",at==="2"&&"\u591A\u529F\u80FD\u5B9E\u65F6\u4EA4\u4E92\u5B9E\u9A8C\u6A21\u5F0F\uFF0C\u652F\u6301\u5B9E\u65F6\u4EE3\u7801\u3001\u6570\u5B66\u65B9\u7A0B\u3001\u53EF\u89C6\u5316\u548CMarkDown\u7B49\u3002 \u9002\u7528\u4E8E\u6570\u636E\u6E05\u7406\u3001\u6570\u503C\u6A21\u62DF\u3001\u7EDF\u8BA1\u5EFA\u6A21\u3001\u673A\u5668\u5B66\u4E60\u7B49\u7CFB\u5217\u5B9E\u9A8C\u3002",at==="3"&&"JupyterLab\u662F\u65B0\u4E00\u4EE3Jupyter Notebook\uFF0C\u914D\u7F6E\u6587\u4EF6\u76EE\u5F55\u548CNotebook\uFF0C\u652F\u6301\u6570\u636E\u79D1\u5B66\u4E2D\u7684\u5404\u79CD\u5DE5\u4F5C\u6D41\u7A0B\uFF0C\u9002\u5408\u4E2D\u5927\u578B\u9879\u76EE\u3002")),at==="1"&&m.a.createElement(T,null),at==="2"&&m.a.createElement(me,{is_jupyter_lab:!1}),at==="3"&&m.a.createElement(Ae,{is_jupyter_lab:!0}),m.a.createElement(_.a,null),m.a.createElement(_e.a,null))},Ze=$e.default=et},edzW:function(pt,$e,G){"use strict";var ee=G("g9YV"),K=G("wCAj"),R=G("Znn+"),j=G("ZTPi"),m=G("7Kak"),_=G("9yH6"),F=G("q1tI"),P=G.n(F),A=G("H7bD"),L=G.n(A),C=function(k){var O=k.value,E=k.onChange,p=k.tab,f=k.setTab,s=k.type,l=k.setType,c=k.dataSource,x=[{title:"\u540D\u79F0",dataIndex:p==="GPU"?"place":"value",ellipsis:!0},{title:"\u7C7B\u578B",width:100,dataIndex:"type",ellipsis:!0,render:function(){return p}},{title:"\u63CF\u8FF0",dataIndex:"description",ellipsis:!0}],v={selectedRowKeys:O,columnWidth:54,type:"radio",onChange:function(S){return E(S)}};return P.a.createElement("div",{className:L.a.container},P.a.createElement(_.a.Group,{onChange:function(S){return l(S.target.value)},value:s,optionType:"button"},P.a.createElement(_.a,{value:"OpenI"},"\u542F\u667A\u96C6\u7FA4"),P.a.createElement(_.a,{value:"C2Net"},"\u667A\u7B97\u96C6\u7FA4")),P.a.createElement(j.a,{style:{margin:"6px 0 15px 0"},activeKey:p,onChange:function(S){return f(S)}},P.a.createElement(j.a.TabPane,{tab:"GPU",key:"GPU"}),P.a.createElement(j.a.TabPane,{tab:"NPU",key:"NPU"})),P.a.createElement(K.a,{rowSelection:v,rowKey:"id",columns:x,dataSource:c,scroll:{y:240},pagination:!1}))};$e.a=C},fyJ8:function(pt,$e,G){"use strict";var ee=G("rePB"),K=G("VTBJ"),R=G("Ff2n"),j=G("U8pU"),m=G("q1tI"),_=G.n(m),F=G("TSYQ"),P=G.n(F),A=G("c+Xe"),L=G("sR1s");function C(p){return p&&Object(j.a)(p)==="object"&&!Array.isArray(p)&&!m.isValidElement(p)}function w(p){return typeof p=="string"?!0:Object(A.c)(p)}function k(p,f){var s,l=p.prefixCls,c=p.className,x=p.record,v=p.index,h=p.dataIndex,S=p.render,y=p.children,u=p.component,d=u===void 0?"td":u,o=p.colSpan,a=p.rowSpan,b=p.fixLeft,g=p.fixRight,T=p.firstFixLeft,M=p.lastFixLeft,U=p.firstFixRight,W=p.lastFixRight,H=p.appendNode,I=p.additionalProps,N=I===void 0?{}:I,z=p.ellipsis,$=p.align,ae=p.rowType,le=p.isSticky,De="".concat(l,"-cell"),xe,Pe;if(y)Pe=y;else{var Le=Object(L.b)(x,h);if(Pe=Le,S){var we=S(Le,x,v);C(we)?(Pe=we.children,xe=we.props):Pe=we}}Object(j.a)(Pe)==="object"&&!Array.isArray(Pe)&&!m.isValidElement(Pe)&&(Pe=null),z&&(M||U)&&(Pe=m.createElement("span",{className:"".concat(De,"-content")},Pe));var me=xe||{},pe=me.colSpan,Q=me.rowSpan,de=me.style,te=me.className,fe=Object(R.a)(me,["colSpan","rowSpan","style","className"]),Ae=pe!==void 0?pe:o,_e=Q!==void 0?Q:a;if(Ae===0||_e===0)return null;var Ne={},Ge=typeof b=="number",et=typeof g=="number";Ge&&(Ne.position="sticky",Ne.left=b),et&&(Ne.position="sticky",Ne.right=g);var Ze={};$&&(Ze.textAlign=$);var Ke,He=z===!0?{showTitle:!0}:z;He&&(He.showTitle||ae==="header")&&(typeof Pe=="string"||typeof Pe=="number"?Ke=Pe.toString():m.isValidElement(Pe)&&typeof Pe.props.children=="string"&&(Ke=Pe.props.children));var rt=Object(K.a)(Object(K.a)(Object(K.a)({title:Ke},fe),N),{},{colSpan:Ae&&Ae!==1?Ae:null,rowSpan:_e&&_e!==1?_e:null,className:P()(De,c,(s={},Object(ee.a)(s,"".concat(De,"-fix-left"),Ge),Object(ee.a)(s,"".concat(De,"-fix-left-first"),T),Object(ee.a)(s,"".concat(De,"-fix-left-last"),M),Object(ee.a)(s,"".concat(De,"-fix-right"),et),Object(ee.a)(s,"".concat(De,"-fix-right-first"),U),Object(ee.a)(s,"".concat(De,"-fix-right-last"),W),Object(ee.a)(s,"".concat(De,"-ellipsis"),z),Object(ee.a)(s,"".concat(De,"-with-append"),H),Object(ee.a)(s,"".concat(De,"-fix-sticky"),(Ge||et)&&le),s),N.className,te),style:Object(K.a)(Object(K.a)(Object(K.a)(Object(K.a)({},N.style),Ze),Ne),de),ref:w(d)?f:null});return m.createElement(d,Object.assign({},rt),H,Pe)}var O=m.forwardRef(k);O.displayName="Cell";var E=m.memo(O,function(p,f){return f.shouldCellUpdate?!f.shouldCellUpdate(f.record,p.record):!1});$e.a=E},h78n:function(pt,$e,G){"use strict";G.d($e,"a",function(){return T});var ee=G("q1tI"),K=G.n(ee),R=G("TSYQ"),j=G.n(R),m={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},_=function(W){var H=W.map(function(){return Object(ee.useRef)()}),I=Object(ee.useRef)();return Object(ee.useEffect)(function(){var N=Date.now(),z=!1;Object.keys(H).forEach(function($){var ae=H[$].current;if(!ae)return;z=!0;var le=ae.style;le.transitionDuration=".3s, .3s, .3s, .06s",I.current&&N-I.current<100&&(le.transitionDuration="0s, 0s")}),z&&(I.current=Date.now())}),[H]};function F(){return F=Object.assign||function(U){for(var W=1;WU.length)&&(W=U.length);for(var H=0,I=new Array(W);H=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;H[I]=U[I]}}return H}function E(U,W){if(U==null)return{};var H={},I=Object.keys(U),N,z;for(z=0;z=0)continue;H[N]=U[N]}return H}var p=function(W){var H=W.className,I=W.percent,N=W.prefixCls,z=W.strokeColor,$=W.strokeLinecap,ae=W.strokeWidth,le=W.style,De=W.trailColor,xe=W.trailWidth,Pe=W.transition,Le=O(W,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Le.gapPosition;var we=Array.isArray(I)?I:[I],me=Array.isArray(z)?z:[z],pe=_(we),Q=P(pe,1),de=Q[0],te=ae/2,fe=100-ae/2,Ae="M ".concat($==="round"?te:0,",").concat(te,` L `).concat($==="round"?fe:100,",").concat(te),_e="0 0 100 ".concat(ae),Ne=0;return K.a.createElement("svg",F({className:j()("".concat(N,"-line"),H),viewBox:_e,preserveAspectRatio:"none",style:le},Le),K.a.createElement("path",{className:"".concat(N,"-line-trail"),d:Ae,strokeLinecap:$,stroke:De,strokeWidth:xe||ae,fillOpacity:"0"}),we.map(function(Ge,et){var Ze={strokeDasharray:"".concat(Ge,"px, 100px"),strokeDashoffset:"-".concat(Ne,"px"),transition:Pe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ke=me[et]||me[me.length-1];return Ne+=Ge,K.a.createElement("path",{key:et,className:"".concat(N,"-line-path"),d:Ae,strokeLinecap:$,stroke:Ke,strokeWidth:ae,fillOpacity:"0",ref:de[et],style:Ze})}))};p.defaultProps=m;var f=p;function s(){return s=Object.assign||function(U){for(var W=1;WU.length)&&(W=U.length);for(var H=0,I=new Array(W);H=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,I))continue;H[I]=U[I]}}return H}function u(U,W){if(U==null)return{};var H={},I=Object.keys(U),N,z;for(z=0;z=0)continue;H[N]=U[N]}return H}var d=0;function o(U){return+U.replace("%","")}function a(U){return Array.isArray(U)?U:[U]}function b(U,W,H,I){var N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,$=50-I/2,ae=0,le=-$,De=0,xe=-2*$;switch(z){case"left":ae=-$,le=0,De=2*$,xe=0;break;case"right":ae=$,le=0,De=-2*$,xe=0;break;case"bottom":le=$,xe=2*$;break;default:}var Pe="M 50,50 m ".concat(ae,",").concat(le,` a `).concat($,",").concat($," 0 1 1 ").concat(De,",").concat(-xe,` a `).concat($,",").concat($," 0 1 1 ").concat(-De,",").concat(xe),Le=Math.PI*2*$,we={stroke:H,strokeDasharray:"".concat(W/100*(Le-N),"px ").concat(Le,"px"),strokeDashoffset:"-".concat(N/2+U/100*(Le-N),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Pe,pathStyle:we}}var g=function(W){var H=W.prefixCls,I=W.strokeWidth,N=W.trailWidth,z=W.gapDegree,$=W.gapPosition,ae=W.trailColor,le=W.strokeLinecap,De=W.style,xe=W.className,Pe=W.strokeColor,Le=W.percent,we=y(W,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),me=Object(ee.useMemo)(function(){return d+=1,d},[]),pe=b(0,100,ae,I,z,$),Q=pe.pathString,de=pe.pathStyle,te=a(Le),fe=a(Pe),Ae=fe.find(function(Ze){return Object.prototype.toString.call(Ze)==="[object Object]"}),_e=_(te),Ne=l(_e,1),Ge=Ne[0],et=function(){var Ke=0;return te.map(function(He,rt){var at=fe[rt]||fe[fe.length-1],ut=Object.prototype.toString.call(at)==="[object Object]"?"url(#".concat(H,"-gradient-").concat(me,")"):"",ot=b(Ke,He,at,I,z,$);return Ke+=He,K.a.createElement("path",{key:rt,className:"".concat(H,"-circle-path"),d:ot.pathString,stroke:ut,strokeLinecap:le,strokeWidth:I,opacity:He===0?0:1,fillOpacity:"0",style:ot.pathStyle,ref:Ge[rt]})})};return K.a.createElement("svg",s({className:j()("".concat(H,"-circle"),xe),viewBox:"0 0 100 100",style:De},we),Ae&&K.a.createElement("defs",null,K.a.createElement("linearGradient",{id:"".concat(H,"-gradient-").concat(me),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ae).sort(function(Ze,Ke){return o(Ze)-o(Ke)}).map(function(Ze,Ke){return K.a.createElement("stop",{key:Ke,offset:Ze,stopColor:Ae[Ze]})}))),K.a.createElement("path",{className:"".concat(H,"-circle-trail"),d:Q,stroke:ae,strokeLinecap:le,strokeWidth:N||I,fillOpacity:"0",style:de}),et().reverse())};g.defaultProps=m;var T=g,M={Line:f,Circle:T}},hW8S:function(pt,$e,G){"use strict";G.d($e,"a",function(){return j}),G.d($e,"c",function(){return m}),G.d($e,"b",function(){return _});var ee=G("VTBJ"),K=G("Ff2n"),R=G("Kwbf"),j="RC_TABLE_INTERNAL_COL_DEFINE";function m(F){var P=F.expandable,A=Object(K.a)(F,["expandable"]);return"expandable"in F?Object(ee.a)(Object(ee.a)({},A),P):A}function _(F){return Object.keys(F).reduce(function(P,A){return(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-")&&(P[A]=F[A]),P},{})}},k3GJ:function(pt,$e,G){"use strict";G.d($e,"a",function(){return xo});var ee=G("rePB"),K=G("ODXe"),R=G("Ff2n"),j=G("VTBJ"),m=G("q1tI"),_=G("TSYQ"),F=G.n(_),P=G("Zm9Q"),A=G("6cGi"),L=G("KQm4"),C=G("xEkU"),w=G.n(C),k=G("t23M");function O(ce){var Oe=Object(m.useRef)(),Me=Object(m.useRef)(!1);function ve(){for(var J=arguments.length,se=new Array(J),ne=0;neje&&(ft=je-mt),Object(m.useMemo)(function(){if(!se.length)return[0,0];for(var bt=se.length,$t=bt,sn=0;snRe+ft){$t=sn-1;break}}for(var en=0,ln=bt-1;ln>=0;ln-=1){var rn=ce.get(se[ln].key)||x;if(rn[Ie]1&&arguments[1]!==void 0?arguments[1]:!1,ve=Oe&&typeof Oe.getBoundingClientRect=="function"&&Oe.getBoundingClientRect().width;if(ve){if(Me){var J=getComputedStyle(Oe),se=J.marginLeft,ne=J.marginRight;ve+=+se.replace("px","")+ +ne.replace("px","")}ve=+ve.toFixed(6)}return ve||0},Ke=function(Oe,Me,ve){Oe&&Object(U.a)(Oe.style)==="object"&&(Oe.style[Me]=ve)},He=function(){return te.any},rt=G("bdgK"),at=G("i8i4"),ut=G.n(at),ot=G("wgJM"),nt=G("l4aY"),Je=G("m+aA"),Te=G("c+Xe"),be=G("zT1h"),Be=G("QC+M");function ze(ce,Oe,Me){return Me?ce[0]===Oe[0]:ce[0]===Oe[0]&&ce[1]===Oe[1]}function ke(ce,Oe,Me){var ve=ce[Oe]||{};return Object(j.a)(Object(j.a)({},ve),Me)}function Ve(ce,Oe,Me,ve){for(var J=Me.points,se=Object.keys(ce),ne=0;ne1&&arguments[1]!==void 0?arguments[1]:2;Oe();var se=Object(ot.a)(function(){J<=1?ve({isCanceled:function(){return se!==ce.current}}):Me(ve,J-1)});ce.current=se}return m.useEffect(function(){return function(){Oe()}},[]),[Me,Oe]},Gn=[gt,Nt,Wt,Rt],Wn=!1,kt=!0;function ct(ce){return ce===Wt||ce===Rt}var qt=function(ce,Oe){var Me=m.useState(Bt),ve=Object(K.a)(Me,2),J=ve[0],se=ve[1],ne=Qt(),ye=Object(K.a)(ne,2),Ee=ye[0],Ie=ye[1];function Re(){se(gt)}return Tn(function(){if(J!==Bt&&J!==Rt){var je=Gn.indexOf(J),qe=Gn[je+1],mt=Oe(J);mt===Wn?se(qe):Ee(function(ft){function bt(){if(ft.isCanceled())return;se(qe)}mt===!0?bt():Promise.resolve(mt).then(bt)})}},[ce,J]),m.useEffect(function(){return function(){Ie()}},[]),[Re,J]},Mn=function(ce){var Oe=Object(m.useRef)(),Me=Object(m.useRef)(ce);Me.current=ce;var ve=m.useCallback(function(ne){Me.current(ne)},[]);function J(ne){ne&&(ne.removeEventListener(Dt,ve),ne.removeEventListener(st,ve))}function se(ne){Oe.current&&Oe.current!==ne&&J(Oe.current),ne&&ne!==Oe.current&&(ne.addEventListener(Dt,ve),ne.addEventListener(st,ve),Oe.current=ne)}return m.useEffect(function(){return function(){J(Oe.current)}},[]),[se,J]};function an(ce,Oe,Me,ve){var J=ve.motionEnter,se=J===void 0?!0:J,ne=ve.motionAppear,ye=ne===void 0?!0:ne,Ee=ve.motionLeave,Ie=Ee===void 0?!0:Ee,Re=ve.motionDeadline,je=ve.motionLeaveImmediately,qe=ve.onAppearPrepare,mt=ve.onEnterPrepare,ft=ve.onLeavePrepare,bt=ve.onAppearStart,$t=ve.onEnterStart,sn=ve.onLeaveStart,Zt=ve.onAppearActive,en=ve.onEnterActive,ln=ve.onLeaveActive,rn=ve.onAppearEnd,tn=ve.onEnterEnd,En=ve.onLeaveEnd,fn=ve.onVisibleChanged,rr=Jt(),hn=Object(K.a)(rr,2),Ht=hn[0],Ft=hn[1],vn=Jt(Tt),xn=Object(K.a)(vn,2),Lt=xn[0],Cn=xn[1],ar=Jt(null),wn=Object(K.a)(ar,2),Kn=wn[0],jn=wn[1],cr=Object(m.useRef)(!1),Tr=Object(m.useRef)(null),or=Object(m.useRef)(!1),Ur=Object(m.useRef)(null);function sa(){var Xn=Me();return Xn||Ur.current}var Kr=Object(m.useRef)(!1);function Cr(Xn){var Nn=sa();if(Xn&&!Xn.deadline&&Xn.target!==Nn)return;var Sr;Lt===zt&&Kr.current?Sr=rn==null?void 0:rn(Nn,Xn):Lt===Xt&&Kr.current?Sr=tn==null?void 0:tn(Nn,Xn):Lt===St&&Kr.current&&(Sr=En==null?void 0:En(Nn,Xn)),Sr!==!1&&!or.current&&(Cn(Tt),jn(null))}var Jn=Mn(Cr),Hn=Object(K.a)(Jn,1),sr=Hn[0],ir=m.useMemo(function(){var Xn,Nn,Sr;switch(Lt){case"appear":return Xn={},Object(ee.a)(Xn,gt,qe),Object(ee.a)(Xn,Nt,bt),Object(ee.a)(Xn,Wt,Zt),Xn;case"enter":return Nn={},Object(ee.a)(Nn,gt,mt),Object(ee.a)(Nn,Nt,$t),Object(ee.a)(Nn,Wt,en),Nn;case"leave":return Sr={},Object(ee.a)(Sr,gt,ft),Object(ee.a)(Sr,Nt,sn),Object(ee.a)(Sr,Wt,ln),Sr;default:return{}}},[Lt]),la=qt(Lt,function(Xn){if(Xn===gt){var Nn=ir[gt];return Nn?Nn(sa()):Wn}if(Bn in ir){var Sr;jn(((Sr=ir[Bn])===null||Sr===void 0?void 0:Sr.call(ir,sa(),null))||null)}return Bn===Wt&&(sr(sa()),Re>0&&(clearTimeout(Tr.current),Tr.current=setTimeout(function(){Cr({deadline:!0})},Re))),kt}),Oa=Object(K.a)(la,2),Aa=Oa[0],Bn=Oa[1],pa=ct(Bn);Kr.current=pa,Tn(function(){Ft(Oe);var Xn=cr.current;if(cr.current=!0,!ce)return;var Nn;!Xn&&Oe&&ye&&(Nn=zt),Xn&&Oe&&se&&(Nn=Xt),(Xn&&!Oe&&Ie||!Xn&&je&&!Oe&&Ie)&&(Nn=St),Nn&&(Cn(Nn),Aa())},[Oe]),Object(m.useEffect)(function(){(Lt===zt&&!ye||Lt===Xt&&!se||Lt===St&&!Ie)&&Cn(Tt)},[ye,se,Ie]),Object(m.useEffect)(function(){return function(){clearTimeout(Tr.current),or.current=!0}},[]),Object(m.useEffect)(function(){Ht!==void 0&&Lt===Tt&&(fn==null||fn(Ht))},[Ht,Lt]);var Da=Kn;return ir[gt]&&Bn===Nt&&(Da=Object(j.a)({transition:"none"},Da)),[Lt,Bn,Da,Ht!=null?Ht:Oe]}var Ut=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(){return Object(S.a)(this,Me),Oe.apply(this,arguments)}return Object(y.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(m.Component),An=Ut;function It(ce){var Oe=ce;Object(U.a)(ce)==="object"&&(Oe=ce.transitionSupport);function Me(J){return!!(J.motionName&&Oe)}var ve=m.forwardRef(function(J,se){var ne=J.visible,ye=ne===void 0?!0:ne,Ee=J.removeOnLeave,Ie=Ee===void 0?!0:Ee,Re=J.forceRender,je=J.children,qe=J.motionName,mt=J.leavedClassName,ft=J.eventProps,bt=Me(J),$t=Object(m.useRef)(),sn=Object(m.useRef)();function Zt(){try{return Object(Je.a)($t.current||sn.current)}catch(Cn){return null}}var en=an(bt,ye,Zt,J),ln=Object(K.a)(en,4),rn=ln[0],tn=ln[1],En=ln[2],fn=ln[3],rr=m.useRef(fn);fn&&(rr.current=!0);var hn=Object(m.useRef)(se);hn.current=se;var Ht=m.useCallback(function(Cn){$t.current=Cn,Object(Te.b)(hn.current,Cn)},[]),Ft,vn=Object(j.a)(Object(j.a)({},ft),{},{visible:ye});if(!je)Ft=null;else if(rn===Tt||!Me(J))fn?Ft=je(Object(j.a)({},vn),Ht):!Ie&&rr.current?Ft=je(Object(j.a)(Object(j.a)({},vn),{},{className:mt}),Ht):Re?Ft=je(Object(j.a)(Object(j.a)({},vn),{},{style:{display:"none"}}),Ht):Ft=null;else{var xn,Lt;tn===gt?Lt="prepare":ct(tn)?Lt="active":tn===Nt&&(Lt="start"),Ft=je(Object(j.a)(Object(j.a)({},vn),{},{className:F()(Mt(qe,rn),(xn={},Object(ee.a)(xn,Mt(qe,"".concat(rn,"-").concat(Lt)),Lt),Object(ee.a)(xn,qe,typeof qe=="string"),xn)),style:En}),Ht)}return m.createElement(An,{ref:sn},Ft)});return ve.displayName="CSSMotion",ve}var on=It(ht),Qe="add",yt="keep",Dn="remove",bn="removed";function lt(ce){var Oe;return ce&&Object(U.a)(ce)==="object"&&"key"in ce?Oe=ce:Oe={key:ce},Object(j.a)(Object(j.a)({},Oe),{},{key:String(Oe.key)})}function ur(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ce.map(lt)}function Un(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Me=[],ve=0,J=Oe.length,se=ur(ce),ne=ur(Oe);se.forEach(function(Ie){for(var Re=!1,je=ve;je1});return Ee.forEach(function(Ie){Me=Me.filter(function(Re){var je=Re.key,qe=Re.status;return je!==Ie||qe!==Dn}),Me.forEach(function(Re){Re.key===Ie&&(Re.status=yt)})}),Me}var _t=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Pn(ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:on,Me=function(ve){Object(d.a)(se,ve);var J=Object(o.a)(se);function se(){var ne;return Object(S.a)(this,se),ne=J.apply(this,arguments),ne.state={keyEntities:[]},ne.removeKey=function(ye){ne.setState(function(Ee){var Ie=Ee.keyEntities;return{keyEntities:Ie.map(function(Re){return Re.key!==ye?Re:Object(j.a)(Object(j.a)({},Re),{},{status:bn})})}})},ne}return Object(y.a)(se,[{key:"render",value:function(){var ye=this,Ee=this.state.keyEntities,Ie=this.props,Re=Ie.component,je=Ie.children,qe=Ie.onVisibleChanged,mt=Object(R.a)(Ie,["component","children","onVisibleChanged"]),ft=Re||m.Fragment,bt={};return _t.forEach(function($t){bt[$t]=mt[$t],delete mt[$t]}),delete mt.keys,m.createElement(ft,mt,Ee.map(function($t){var sn=$t.status,Zt=Object(R.a)($t,["status"]),en=sn===Qe||sn===yt;return m.createElement(Oe,Object(h.a)({},bt,{key:Zt.key,visible:en,eventProps:Zt,onVisibleChanged:function(rn){qe==null||qe(rn,{key:Zt.key}),rn||ye.removeKey(Zt.key)}}),je)}))}}],[{key:"getDerivedStateFromProps",value:function(ye,Ee){var Ie=ye.keys,Re=Ee.keyEntities,je=ur(Ie),qe=Un(Re,je);return{keyEntities:qe.filter(function(mt){var ft=Re.find(function(bt){var $t=bt.key;return mt.key===$t});return!(ft&&ft.status===bn&&mt.status===Dn)})}}}]),se}(m.Component);return Me.defaultProps={component:"div"},Me}var Vn=Pn(ht),Zn=on;function Rn(ce){var Oe=ce.prefixCls,Me=ce.motion,ve=ce.animation,J=ce.transitionName;return Me||(ve?{motionName:"".concat(Oe,"-").concat(ve)}:J?{motionName:J}:null)}function hr(ce){var Oe=ce.prefixCls,Me=ce.visible,ve=ce.zIndex,J=ce.mask,se=ce.maskMotion,ne=ce.maskAnimation,ye=ce.maskTransitionName;if(!J)return null;var Ee={};return(se||ye||ne)&&(Ee=Object(j.a)({motionAppear:!0},Rn({motion:se,prefixCls:Oe,transitionName:ye,animation:ne}))),m.createElement(Zn,Object(h.a)({},Ee,{visible:Me,removeOnLeave:!0}),function(Ie){var Re=Ie.className;return m.createElement("div",{style:{zIndex:ve},className:F()("".concat(Oe,"-mask"),Re)})})}var At=G("9mu1"),Xe=G("o0o1"),Ct=G.n(Xe),Pt=G("HaE+"),mn=["measure","align",null,"motion"],gn=function(ce,Oe){var Me=Object(m.useState)(null),ve=Object(K.a)(Me,2),J=ve[0],se=ve[1],ne=Object(m.useRef)(),ye=Object(m.useRef)(!1);function Ee(je){ye.current||se(je)}function Ie(){ot.a.cancel(ne.current)}function Re(je){Ie(),ne.current=Object(ot.a)(function(){Ee(function(qe){switch(J){case"align":return"motion";case"motion":return"stable";default:}return qe}),je==null||je()})}return Object(m.useEffect)(function(){Ee("measure")},[ce]),Object(m.useEffect)(function(){switch(J){case"measure":Oe();break;default:}J&&(ne.current=Object(ot.a)(Object(Pt.a)(Ct.a.mark(function je(){var qe,mt;return Ct.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:qe=mn.indexOf(J),mt=mn[qe+1],mt&&qe!==-1&&Ee(mt);case 3:case"end":return bt.stop()}},je)}))))},[J]),Object(m.useEffect)(function(){return function(){ye.current=!0,Ie()}},[]),[J,Re]},qn=function(ce){var Oe=m.useState({width:0,height:0}),Me=Object(K.a)(Oe,2),ve=Me[0],J=Me[1];function se(ye){J({width:ye.offsetWidth,height:ye.offsetHeight})}var ne=m.useMemo(function(){var ye={};if(ce){var Ee=ve.width,Ie=ve.height;ce.indexOf("height")!==-1&&Ie?ye.height=Ie:ce.indexOf("minHeight")!==-1&&Ie&&(ye.minHeight=Ie),ce.indexOf("width")!==-1&&Ee?ye.width=Ee:ce.indexOf("minWidth")!==-1&&Ee&&(ye.minWidth=Ee)}return ye},[ce,ve]);return[ne,se]},Fn=m.forwardRef(function(ce,Oe){var Me=ce.visible,ve=ce.prefixCls,J=ce.className,se=ce.style,ne=ce.children,ye=ce.zIndex,Ee=ce.stretch,Ie=ce.destroyPopupOnHide,Re=ce.forceRender,je=ce.align,qe=ce.point,mt=ce.getRootDomNode,ft=ce.getClassNameFromAlign,bt=ce.onAlign,$t=ce.onMouseEnter,sn=ce.onMouseLeave,Zt=ce.onMouseDown,en=ce.onTouchStart,ln=Object(m.useRef)(),rn=Object(m.useRef)(),tn=Object(m.useState)(),En=Object(K.a)(tn,2),fn=En[0],rr=En[1],hn=qn(Ee),Ht=Object(K.a)(hn,2),Ft=Ht[0],vn=Ht[1];function xn(){Ee&&vn(mt())}var Lt=gn(Me,xn),Cn=Object(K.a)(Lt,2),ar=Cn[0],wn=Cn[1],Kn=Object(m.useRef)();function jn(){return qe||mt}function cr(){var Jn;(Jn=ln.current)===null||Jn===void 0||Jn.forceAlign()}function Tr(Jn,Hn){var sr=ft(Hn);fn!==sr&&rr(sr),ar==="align"&&(fn!==sr?Promise.resolve().then(function(){cr()}):wn(function(){var ir;(ir=Kn.current)===null||ir===void 0||ir.call(Kn)}),bt==null||bt(Jn,Hn))}var or=Object(j.a)({},Rn(ce));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Jn){var Hn=or[Jn];or[Jn]=function(sr,ir){return wn(),Hn==null?void 0:Hn(sr,ir)}});function Ur(){return new Promise(function(Jn){Kn.current=Jn})}m.useEffect(function(){!or.motionName&&ar==="motion"&&wn()},[or.motionName,ar]),m.useImperativeHandle(Oe,function(){return{forceAlign:cr,getElement:function(){return rn.current}}});var sa=Object(j.a)(Object(j.a)({},Ft),{},{zIndex:ye,opacity:ar==="motion"||ar==="stable"||!Me?void 0:0,pointerEvents:ar==="stable"?void 0:"none"},se),Kr=!0;(je==null?void 0:je.points)&&(ar==="align"||ar==="stable")&&(Kr=!1);var Cr=ne;return m.Children.count(ne)>1&&(Cr=m.createElement("div",{className:"".concat(ve,"-content")},ne)),m.createElement(Zn,Object(h.a)({visible:Me,ref:rn,leavedClassName:"".concat(ve,"-hidden")},or,{onAppearPrepare:Ur,onEnterPrepare:Ur,removeOnLeave:Ie,forceRender:Re}),function(Jn,Hn){var sr=Jn.className,ir=Jn.style,la=F()(ve,J,fn,sr);return m.createElement(At.a,{target:jn(),key:"popup",ref:ln,monitorWindowResize:!0,disabled:Kr,align:je,onAlign:Tr},m.createElement("div",{ref:Hn,className:la,onMouseEnter:$t,onMouseLeave:sn,onMouseDownCapture:Zt,onTouchStartCapture:en,style:Object(j.a)(Object(j.a)({},ir),sa)},Cr))})});Fn.displayName="PopupInner";var kn=Fn,Rr=m.forwardRef(function(ce,Oe){var Me=ce.prefixCls,ve=ce.visible,J=ce.zIndex,se=ce.children,ne=ce.mobile;ne=ne===void 0?{}:ne;var ye=ne.popupClassName,Ee=ne.popupStyle,Ie=ne.popupMotion,Re=Ie===void 0?{}:Ie,je=ne.popupRender,qe=m.useRef();m.useImperativeHandle(Oe,function(){return{forceAlign:function(){},getElement:function(){return qe.current}}});var mt=Object(j.a)({zIndex:J},Ee),ft=se;return m.Children.count(se)>1&&(ft=m.createElement("div",{className:"".concat(Me,"-content")},se)),je&&(ft=je(ft)),m.createElement(Zn,Object(h.a)({visible:ve,ref:qe,removeOnLeave:!0},Re),function(bt,$t){var sn=bt.className,Zt=bt.style,en=F()(Me,ye,sn);return m.createElement("div",{ref:$t,className:en,style:Object(j.a)(Object(j.a)({},Zt),mt)},ft)})});Rr.displayName="MobilePopupInner";var Lr=Rr,Br=["visible","mobile"],gr=m.forwardRef(function(ce,Oe){var Me=ce.visible,ve=ce.mobile,J=Object(R.a)(ce,Br),se=Object(m.useState)(Me),ne=Object(K.a)(se,2),ye=ne[0],Ee=ne[1],Ie=Object(m.useState)(!1),Re=Object(K.a)(Ie,2),je=Re[0],qe=Re[1],mt=Object(j.a)(Object(j.a)({},J),{},{visible:ye});Object(m.useEffect)(function(){Ee(Me),Me&&ve&&qe(he())},[Me,ve]);var ft=je?m.createElement(Lr,Object(h.a)({},mt,{mobile:ve,ref:Oe})):m.createElement(kn,Object(h.a)({},mt,{ref:Oe}));return m.createElement("div",null,m.createElement(hr,mt),ft)});gr.displayName="Popup";var Ha=gr,za=m.createContext(null),aa=za;function Xr(){}function ii(){return""}function Ga(ce){return ce?ce.ownerDocument:window.document}var oi=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Ia(ce){var Oe=function(Me){Object(d.a)(J,Me);var ve=Object(o.a)(J);function J(se){var ne;Object(S.a)(this,J),ne=ve.call(this,se),ne.popupRef=m.createRef(),ne.triggerRef=m.createRef(),ne.attachId=void 0,ne.clickOutsideHandler=void 0,ne.touchOutsideHandler=void 0,ne.contextMenuOutsideHandler1=void 0,ne.contextMenuOutsideHandler2=void 0,ne.mouseDownTimeout=void 0,ne.focusTime=void 0,ne.preClickTime=void 0,ne.preTouchTime=void 0,ne.delayTimer=void 0,ne.hasPopupMouseDown=void 0,ne.onMouseEnter=function(Ee){var Ie=ne.props.mouseEnterDelay;ne.fireEvents("onMouseEnter",Ee),ne.delaySetPopupVisible(!0,Ie,Ie?null:Ee)},ne.onMouseMove=function(Ee){ne.fireEvents("onMouseMove",Ee),ne.setPoint(Ee)},ne.onMouseLeave=function(Ee){ne.fireEvents("onMouseLeave",Ee),ne.delaySetPopupVisible(!1,ne.props.mouseLeaveDelay)},ne.onPopupMouseEnter=function(){ne.clearDelayTimer()},ne.onPopupMouseLeave=function(Ee){var Ie;if(Ee.relatedTarget&&!Ee.relatedTarget.setTimeout&&Object(nt.a)((Ie=ne.popupRef.current)===null||Ie===void 0?void 0:Ie.getElement(),Ee.relatedTarget))return;ne.delaySetPopupVisible(!1,ne.props.mouseLeaveDelay)},ne.onFocus=function(Ee){ne.fireEvents("onFocus",Ee),ne.clearDelayTimer(),ne.isFocusToShow()&&(ne.focusTime=Date.now(),ne.delaySetPopupVisible(!0,ne.props.focusDelay))},ne.onMouseDown=function(Ee){ne.fireEvents("onMouseDown",Ee),ne.preClickTime=Date.now()},ne.onTouchStart=function(Ee){ne.fireEvents("onTouchStart",Ee),ne.preTouchTime=Date.now()},ne.onBlur=function(Ee){ne.fireEvents("onBlur",Ee),ne.clearDelayTimer(),ne.isBlurToHide()&&ne.delaySetPopupVisible(!1,ne.props.blurDelay)},ne.onContextMenu=function(Ee){Ee.preventDefault(),ne.fireEvents("onContextMenu",Ee),ne.setPopupVisible(!0,Ee)},ne.onContextMenuClose=function(){ne.isContextMenuToShow()&&ne.close()},ne.onClick=function(Ee){if(ne.fireEvents("onClick",Ee),ne.focusTime){var Ie;if(ne.preClickTime&&ne.preTouchTime?Ie=Math.min(ne.preClickTime,ne.preTouchTime):ne.preClickTime?Ie=ne.preClickTime:ne.preTouchTime&&(Ie=ne.preTouchTime),Math.abs(Ie-ne.focusTime)<20)return;ne.focusTime=0}ne.preClickTime=0,ne.preTouchTime=0,ne.isClickToShow()&&(ne.isClickToHide()||ne.isBlurToHide())&&Ee&&Ee.preventDefault&&Ee.preventDefault();var Re=!ne.state.popupVisible;(ne.isClickToHide()&&!Re||Re&&ne.isClickToShow())&&ne.setPopupVisible(!ne.state.popupVisible,Ee)},ne.onPopupMouseDown=function(){if(ne.hasPopupMouseDown=!0,clearTimeout(ne.mouseDownTimeout),ne.mouseDownTimeout=window.setTimeout(function(){ne.hasPopupMouseDown=!1},0),ne.context){var Ee;(Ee=ne.context).onPopupMouseDown.apply(Ee,arguments)}},ne.onDocumentClick=function(Ee){if(ne.props.mask&&!ne.props.maskClosable)return;var Ie=Ee.target,Re=ne.getRootDomNode(),je=ne.getPopupDomNode();(!Object(nt.a)(Re,Ie)||ne.isContextMenuOnly())&&!Object(nt.a)(je,Ie)&&!ne.hasPopupMouseDown&&ne.close()},ne.getRootDomNode=function(){var Ee=ne.props.getTriggerDOMNode;if(Ee)return Ee(ne.triggerRef.current);try{var Ie=Object(Je.a)(ne.triggerRef.current);if(Ie)return Ie}catch(Re){}return ut.a.findDOMNode(Object(u.a)(ne))},ne.getPopupClassNameFromAlign=function(Ee){var Ie=[],Re=ne.props,je=Re.popupPlacement,qe=Re.builtinPlacements,mt=Re.prefixCls,ft=Re.alignPoint,bt=Re.getPopupClassNameFromAlign;return je&&qe&&Ie.push(Ve(qe,mt,Ee,ft)),bt&&Ie.push(bt(Ee)),Ie.join(" ")},ne.getComponent=function(){var Ee=ne.props,Ie=Ee.prefixCls,Re=Ee.destroyPopupOnHide,je=Ee.popupClassName,qe=Ee.onPopupAlign,mt=Ee.popupMotion,ft=Ee.popupAnimation,bt=Ee.popupTransitionName,$t=Ee.popupStyle,sn=Ee.mask,Zt=Ee.maskAnimation,en=Ee.maskTransitionName,ln=Ee.maskMotion,rn=Ee.zIndex,tn=Ee.popup,En=Ee.stretch,fn=Ee.alignPoint,rr=Ee.mobile,hn=Ee.forceRender,Ht=ne.state,Ft=Ht.popupVisible,vn=Ht.point,xn=ne.getPopupAlign(),Lt={};return ne.isMouseEnterToShow()&&(Lt.onMouseEnter=ne.onPopupMouseEnter),ne.isMouseLeaveToHide()&&(Lt.onMouseLeave=ne.onPopupMouseLeave),Lt.onMouseDown=ne.onPopupMouseDown,Lt.onTouchStart=ne.onPopupMouseDown,m.createElement(Ha,Object(h.a)({prefixCls:Ie,destroyPopupOnHide:Re,visible:Ft,point:fn&&vn,className:je,align:xn,onAlign:qe,animation:ft,getClassNameFromAlign:ne.getPopupClassNameFromAlign},Lt,{stretch:En,getRootDomNode:ne.getRootDomNode,style:$t,mask:sn,zIndex:rn,transitionName:bt,maskAnimation:Zt,maskTransitionName:en,maskMotion:ln,ref:ne.popupRef,motion:mt,mobile:rr,forceRender:hn}),typeof tn=="function"?tn():tn)},ne.attachParent=function(Ee){ot.a.cancel(ne.attachId);var Ie=ne.props,Re=Ie.getPopupContainer,je=Ie.getDocument,qe=ne.getRootDomNode(),mt;Re?(qe||Re.length===0)&&(mt=Re(qe)):mt=je(ne.getRootDomNode()).body,mt?mt.appendChild(Ee):ne.attachId=Object(ot.a)(function(){ne.attachParent(Ee)})},ne.getContainer=function(){var Ee=ne.props.getDocument,Ie=Ee(ne.getRootDomNode()).createElement("div");return Ie.style.position="absolute",Ie.style.top="0",Ie.style.left="0",Ie.style.width="100%",ne.attachParent(Ie),Ie},ne.setPoint=function(Ee){var Ie=ne.props.alignPoint;if(!Ie||!Ee)return;ne.setState({point:{pageX:Ee.pageX,pageY:Ee.pageY}})},ne.handlePortalUpdate=function(){ne.state.prevPopupVisible!==ne.state.popupVisible&&ne.props.afterPopupVisibleChange(ne.state.popupVisible)},ne.triggerContextValue={onPopupMouseDown:ne.onPopupMouseDown};var ye;return"popupVisible"in se?ye=!!se.popupVisible:ye=!!se.defaultPopupVisible,ne.state={prevPopupVisible:ye,popupVisible:ye},oi.forEach(function(Ee){ne["fire".concat(Ee)]=function(Ie){ne.fireEvents(Ee,Ie)}}),ne}return Object(y.a)(J,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ne=this.props,ye=this.state;if(ye.popupVisible){var Ee;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ee=ne.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(be.a)(Ee,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ee=Ee||ne.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(be.a)(Ee,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ee=Ee||ne.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(be.a)(Ee,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(be.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ot.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ne;return((ne=this.popupRef.current)===null||ne===void 0?void 0:ne.getElement())||null}},{key:"getPopupAlign",value:function(){var ne=this.props,ye=ne.popupPlacement,Ee=ne.popupAlign,Ie=ne.builtinPlacements;return ye&&Ie?ke(Ie,ye,Ee):Ee}},{key:"setPopupVisible",value:function(ne,ye){var Ee=this.props.alignPoint,Ie=this.state.popupVisible;this.clearDelayTimer(),Ie!==ne&&("popupVisible"in this.props||this.setState({popupVisible:ne,prevPopupVisible:Ie}),this.props.onPopupVisibleChange(ne)),Ee&&ye&&ne&&this.setPoint(ye)}},{key:"delaySetPopupVisible",value:function(ne,ye,Ee){var Ie=this,Re=ye*1e3;if(this.clearDelayTimer(),Re){var je=Ee?{pageX:Ee.pageX,pageY:Ee.pageY}:null;this.delayTimer=window.setTimeout(function(){Ie.setPopupVisible(ne,je),Ie.clearDelayTimer()},Re)}else this.setPopupVisible(ne,Ee)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(ne){var ye=this.props.children.props,Ee=this.props;return ye[ne]&&Ee[ne]?this["fire".concat(ne)]:ye[ne]||Ee[ne]}},{key:"isClickToShow",value:function(){var ne=this.props,ye=ne.action,Ee=ne.showAction;return ye.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ne=this.props.action;return ne==="contextMenu"||ne.length===1&&ne[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ne=this.props,ye=ne.action,Ee=ne.showAction;return ye.indexOf("contextMenu")!==-1||Ee.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ne=this.props,ye=ne.action,Ee=ne.hideAction;return ye.indexOf("click")!==-1||Ee.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ne=this.props,ye=ne.action,Ee=ne.showAction;return ye.indexOf("hover")!==-1||Ee.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ne=this.props,ye=ne.action,Ee=ne.hideAction;return ye.indexOf("hover")!==-1||Ee.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ne=this.props,ye=ne.action,Ee=ne.showAction;return ye.indexOf("focus")!==-1||Ee.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ne=this.props,ye=ne.action,Ee=ne.hideAction;return ye.indexOf("focus")!==-1||Ee.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ne;(ne=this.popupRef.current)===null||ne===void 0||ne.forceAlign()}}},{key:"fireEvents",value:function(ne,ye){var Ee=this.props.children.props[ne];Ee&&Ee(ye);var Ie=this.props[ne];Ie&&Ie(ye)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ne=this.state.popupVisible,ye=this.props,Ee=ye.children,Ie=ye.forceRender,Re=ye.alignPoint,je=ye.className,qe=ye.autoDestroy,mt=m.Children.only(Ee),ft={key:"trigger"};this.isContextMenuToShow()?ft.onContextMenu=this.onContextMenu:ft.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ft.onClick=this.onClick,ft.onMouseDown=this.onMouseDown,ft.onTouchStart=this.onTouchStart):(ft.onClick=this.createTwoChains("onClick"),ft.onMouseDown=this.createTwoChains("onMouseDown"),ft.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ft.onMouseEnter=this.onMouseEnter,Re&&(ft.onMouseMove=this.onMouseMove)):ft.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ft.onMouseLeave=this.onMouseLeave:ft.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ft.onFocus=this.onFocus,ft.onBlur=this.onBlur):(ft.onFocus=this.createTwoChains("onFocus"),ft.onBlur=this.createTwoChains("onBlur"));var bt=F()(mt&&mt.props&&mt.props.className,je);bt&&(ft.className=bt);var $t=Object(j.a)({},ft);Object(Te.c)(mt)&&($t.ref=Object(Te.a)(this.triggerRef,mt.ref));var sn=m.cloneElement(mt,$t),Zt;return(ne||this.popupRef.current||Ie)&&(Zt=m.createElement(ce,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ne&&qe&&(Zt=null),m.createElement(aa.Provider,{value:this.triggerContextValue},sn,Zt)}}],[{key:"getDerivedStateFromProps",value:function(ne,ye){var Ee=ne.popupVisible,Ie={};return Ee!==void 0&&ye.popupVisible!==Ee&&(Ie.popupVisible=Ee,Ie.prevPopupVisible=ye.popupVisible),Ie}}]),J}(m.Component);return Oe.contextType=aa,Oe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ii,getDocument:Ga,onPopupVisibleChange:Xr,afterPopupVisibleChange:Xr,onPopupAlign:Xr,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Oe}var ia=Ia(Be.a),kr={adjustX:1,adjustY:1},fa={topLeft:{points:["bl","tl"],overflow:kr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:kr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:kr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:kr,offset:[4,0]}},ha={topLeft:{points:["bl","tl"],overflow:kr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:kr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:kr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:kr,offset:[4,0]}},va=fa,yr=0,br={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ir=function(Oe,Me,ve){var J=_e(Me),se=Oe.getState();Oe.setState({defaultActiveFirst:Object(j.a)(Object(j.a)({},se.defaultActiveFirst),{},Object(ee.a)({},J,ve))})},ta=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(ve){var J;Object(S.a)(this,Me),J=Oe.call(this,ve),J.onDestroy=function(Re){J.props.onDestroy(Re)},J.onKeyDown=function(Re){var je=Re.keyCode,qe=J.menuInstance,mt=J.props.store,ft=J.getVisible();if(je===p.a.ENTER)return J.onTitleClick(Re),Ir(mt,J.props.eventKey,!0),!0;if(je===p.a.RIGHT)return ft?qe.onKeyDown(Re):(J.triggerOpenChange(!0),Ir(mt,J.props.eventKey,!0)),!0;if(je===p.a.LEFT){var bt;if(ft)bt=qe.onKeyDown(Re);else return;return bt||(J.triggerOpenChange(!1),bt=!0),bt}return ft&&(je===p.a.UP||je===p.a.DOWN)?qe.onKeyDown(Re):void 0},J.onOpenChange=function(Re){J.props.onOpenChange(Re)},J.onPopupVisibleChange=function(Re){J.triggerOpenChange(Re,Re?"mouseenter":"mouseleave")},J.onMouseEnter=function(Re){var je=J.props,qe=je.eventKey,mt=je.onMouseEnter,ft=je.store;Ir(ft,J.props.eventKey,!1),mt({key:qe,domEvent:Re})},J.onMouseLeave=function(Re){var je=J.props,qe=je.parentMenu,mt=je.eventKey,ft=je.onMouseLeave;qe.subMenuInstance=Object(u.a)(J),ft({key:mt,domEvent:Re})},J.onTitleMouseEnter=function(Re){var je=J.props,qe=je.eventKey,mt=je.onItemHover,ft=je.onTitleMouseEnter;mt({key:qe,hover:!0}),ft({key:qe,domEvent:Re})},J.onTitleMouseLeave=function(Re){var je=J.props,qe=je.parentMenu,mt=je.eventKey,ft=je.onItemHover,bt=je.onTitleMouseLeave;qe.subMenuInstance=Object(u.a)(J),ft({key:mt,hover:!1}),bt({key:mt,domEvent:Re})},J.onTitleClick=function(Re){var je=Object(u.a)(J),qe=je.props;if(qe.onTitleClick({key:qe.eventKey,domEvent:Re}),qe.triggerSubMenuAction==="hover")return;J.triggerOpenChange(!J.getVisible(),"click"),Ir(qe.store,J.props.eventKey,!1)},J.onSubMenuClick=function(Re){typeof J.props.onClick=="function"&&J.props.onClick(J.addKeyPath(Re))},J.onSelect=function(Re){J.props.onSelect(Re)},J.onDeselect=function(Re){J.props.onDeselect(Re)},J.getPrefixCls=function(){return"".concat(J.props.rootPrefixCls,"-submenu")},J.getActiveClassName=function(){return"".concat(J.getPrefixCls(),"-active")},J.getDisabledClassName=function(){return"".concat(J.getPrefixCls(),"-disabled")},J.getSelectedClassName=function(){return"".concat(J.getPrefixCls(),"-selected")},J.getOpenClassName=function(){return"".concat(J.props.rootPrefixCls,"-submenu-open")},J.getVisible=function(){return J.state.isOpen},J.getMode=function(){return J.state.mode},J.saveMenuInstance=function(Re){J.menuInstance=Re},J.addKeyPath=function(Re){return Object(j.a)(Object(j.a)({},Re),{},{keyPath:(Re.keyPath||[]).concat(J.props.eventKey)})},J.triggerOpenChange=function(Re,je){var qe=J.props.eventKey,mt=function(){J.onOpenChange({key:qe,item:Object(u.a)(J),trigger:je,open:Re})};je==="mouseenter"?J.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},J.isChildrenSelected=function(){var Re={find:!1};return Ge(J.props.children,J.props.selectedKeys,Re),Re.find},J.isInlineMode=function(){return J.getMode()==="inline"},J.adjustWidth=function(){if(!J.subMenuTitle||!J.menuInstance)return;var Re=at.findDOMNode(J.menuInstance);if(Re.offsetWidth>=J.subMenuTitle.offsetWidth)return;Re.style.minWidth="".concat(J.subMenuTitle.offsetWidth,"px")},J.saveSubMenuTitle=function(Re){J.subMenuTitle=Re},J.getBaseProps=function(){var Re=Object(u.a)(J),je=Re.props,qe=J.getMode();return{mode:qe==="horizontal"?"vertical":qe,visible:J.getVisible(),level:je.level+1,inlineIndent:je.inlineIndent,focusable:!1,onClick:J.onSubMenuClick,onSelect:J.onSelect,onDeselect:J.onDeselect,onDestroy:J.onDestroy,selectedKeys:je.selectedKeys,eventKey:"".concat(je.eventKey,"-menu-"),openKeys:je.openKeys,motion:je.motion,onOpenChange:J.onOpenChange,subMenuOpenDelay:je.subMenuOpenDelay,parentMenu:Object(u.a)(J),subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,triggerSubMenuAction:je.triggerSubMenuAction,builtinPlacements:je.builtinPlacements,defaultActiveFirst:je.store.getState().defaultActiveFirst[_e(je.eventKey)],multiple:je.multiple,prefixCls:je.rootPrefixCls,id:J.internalMenuId,manualRef:J.saveMenuInstance,itemIcon:je.itemIcon,expandIcon:je.expandIcon,direction:je.direction}},J.getMotion=function(Re,je){var qe=Object(u.a)(J),mt=qe.haveRendered,ft=J.props,bt=ft.motion,$t=ft.rootPrefixCls,sn=Object(j.a)(Object(j.a)({},bt),{},{leavedClassName:"".concat($t,"-hidden"),removeOnLeave:!1,motionAppear:mt||!je||Re!=="inline"});return sn};var se=ve.store,ne=ve.eventKey,ye=se.getState(),Ee=ye.defaultActiveFirst;J.isRootMenu=!1;var Ie=!1;return Ee&&(Ie=Ee[ne]),Ir(se,ne,Ie),J.state={mode:ve.mode,isOpen:ve.isOpen},J}return Object(y.a)(Me,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var J=this,se=this.props,ne=se.mode,ye=se.parentMenu,Ee=se.manualRef,Ie=se.isOpen,Re=function(){J.setState({mode:ne,isOpen:Ie})},je=Ie!==this.state.isOpen,qe=ne!==this.state.mode;if((qe||je)&&(ot.a.cancel(this.updateStateRaf),qe?this.updateStateRaf=Object(ot.a)(Re):Re()),Ee&&Ee(this),ne!=="horizontal"||!(ye==null?void 0:ye.isRootMenu)||!Ie)return;this.minWidthTimeout=setTimeout(function(){return J.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var J=this.props,se=J.onDestroy,ne=J.eventKey;se&&se(ne),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),ot.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(J,se){var ne=this.getBaseProps();return m.createElement(er,Object(h.a)({},ne,{id:this.internalMenuId,className:J,style:se}),this.props.children)}},{key:"renderChildren",value:function(){var J=this,se=this.getBaseProps(),ne=se.mode,ye=se.visible,Ee=se.forceSubMenuRender,Ie=se.direction,Re=this.getMotion(ne,ye);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ye||Ee,!this.haveOpened)return m.createElement("div",null);var je=F()("".concat(se.prefixCls,"-sub"),Object(ee.a)({},"".concat(se.prefixCls,"-rtl"),Ie==="rtl"));return this.isInlineMode()?m.createElement(Zn,Object(h.a)({visible:se.visible,forceRender:Ee},Re),function(qe){var mt=qe.className,ft=qe.style,bt=F()(je,mt);return J.renderPopupMenu(bt,ft)}):this.renderPopupMenu(je)}},{key:"render",value:function(){var J,se,ne,ye=Object(j.a)({},this.props),Ee=this.getVisible(),Ie=this.getPrefixCls(),Re=this.isInlineMode(),je=this.getMode(),qe=F()(Ie,"".concat(Ie,"-").concat(je),(J={},Object(ee.a)(J,ye.className,!!ye.className),Object(ee.a)(J,this.getOpenClassName(),Ee),Object(ee.a)(J,this.getActiveClassName(),ye.active||Ee&&!Re),Object(ee.a)(J,this.getDisabledClassName(),ye.disabled),Object(ee.a)(J,this.getSelectedClassName(),this.isChildrenSelected()),J));this.internalMenuId||(ye.eventKey?this.internalMenuId="".concat(ye.eventKey,"$Menu"):(yr+=1,this.internalMenuId="$__$".concat(yr,"$Menu")));var mt={},ft={},bt={};ye.disabled||(mt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ft={onClick:this.onTitleClick},bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var $t={},sn=ye.direction,Zt=sn==="rtl";Re&&(Zt?$t.paddingRight=ye.inlineIndent*ye.level:$t.paddingLeft=ye.inlineIndent*ye.level);var en={};this.getVisible()&&(en={"aria-owns":this.internalMenuId});var ln=null;je!=="horizontal"&&(ln=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ln=m.createElement(this.props.expandIcon,Object(j.a)({},this.props))));var rn=m.createElement("div",Object(h.a)({ref:this.saveSubMenuTitle,style:$t,className:"".concat(Ie,"-title"),role:"button"},bt,ft,{"aria-expanded":Ee},en,{"aria-haspopup":"true",title:typeof ye.title=="string"?ye.title:void 0}),ye.title,ln||m.createElement("i",{className:"".concat(Ie,"-arrow")})),tn=this.renderChildren(),En=((se=ye.parentMenu)===null||se===void 0?void 0:se.isRootMenu)?ye.parentMenu.props.getPopupContainer:function(jn){return jn.parentNode},fn=br[je],rr=ye.popupOffset?{offset:ye.popupOffset}:{},hn=F()((ne={},Object(ee.a)(ne,ye.popupClassName,ye.popupClassName&&!Re),Object(ee.a)(ne,"".concat(Ie,"-rtl"),Zt),ne)),Ht=ye.disabled,Ft=ye.triggerSubMenuAction,vn=ye.subMenuOpenDelay,xn=ye.forceSubMenuRender,Lt=ye.subMenuCloseDelay,Cn=ye.builtinPlacements;et.forEach(function(jn){return delete ye[jn]}),delete ye.onClick;var ar=Zt?Object(j.a)(Object(j.a)({},ha),Cn):Object(j.a)(Object(j.a)({},fa),Cn);delete ye.direction;var wn=this.getBaseProps(),Kn=Re?null:this.getMotion(wn.mode,wn.visible);return m.createElement("li",Object(h.a)({},ye,mt,{className:qe,role:"menuitem"}),m.createElement(ia,{prefixCls:Ie,popupClassName:F()("".concat(Ie,"-popup"),hn),getPopupContainer:En,builtinPlacements:ar,popupPlacement:fn,popupVisible:Re?!1:Ee,popupAlign:rr,popup:Re?null:tn,action:Ht||Re?[]:[Ft],mouseEnterDelay:vn,mouseLeaveDelay:Lt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:xn,popupMotion:Kn},rn),Re?tn:null)}}]),Me}(m.Component);ta.defaultProps={onMouseEnter:fe,onMouseLeave:fe,onTitleMouseEnter:fe,onTitleMouseLeave:fe,onTitleClick:fe,manualRef:fe,mode:"vertical",title:""};var ma=Object(a.b)(function(ce,Oe){var Me=ce.openKeys,ve=ce.activeKey,J=ce.selectedKeys,se=Oe.eventKey,ne=Oe.subMenuKey;return{isOpen:Me.indexOf(se)>-1,active:ve[ne]===se,selectedKeys:J}})(ta);ma.isSubMenu=!0;var na=ma,Va="menuitem-overflowed",si=.5,Wr=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(){var ve;return Object(S.a)(this,Me),ve=Oe.apply(this,arguments),ve.resizeObserver=null,ve.mutationObserver=null,ve.originalTotalWidth=0,ve.overflowedItems=[],ve.menuItemSizes=[],ve.cancelFrameId=null,ve.state={lastVisibleIndex:void 0},ve.childRef=m.createRef(),ve.getMenuItemNodes=function(){var J=ve.props.prefixCls,se=ve.childRef.current;return se?[].slice.call(se.children).filter(function(ne){return ne.className.split(" ").indexOf("".concat(J,"-overflowed-submenu"))<0}):[]},ve.getOverflowedSubMenuItem=function(J,se,ne){var ye=ve.props,Ee=ye.overflowedIndicator,Ie=ye.level,Re=ye.mode,je=ye.prefixCls,qe=ye.theme;if(Ie!==1||Re!=="horizontal")return null;var mt=ve.props.children[0],ft=mt.props,bt=ft.children,$t=ft.title,sn=ft.style,Zt=Object(R.a)(ft,["children","title","style"]),en=Object(j.a)({},sn),ln="".concat(J,"-overflowed-indicator"),rn="".concat(J,"-overflowed-indicator");se.length===0&&ne!==!0?en=Object(j.a)(Object(j.a)({},en),{},{display:"none"}):ne&&(en=Object(j.a)(Object(j.a)({},en),{},{visibility:"hidden",position:"absolute"}),ln="".concat(ln,"-placeholder"),rn="".concat(rn,"-placeholder"));var tn=qe?"".concat(je,"-").concat(qe):"",En={};return et.forEach(function(fn){Zt[fn]!==void 0&&(En[fn]=Zt[fn])}),m.createElement(na,Object(h.a)({title:Ee,className:"".concat(je,"-overflowed-submenu"),popupClassName:tn},En,{key:ln,eventKey:rn,disabled:!1,style:en}),se)},ve.setChildrenWidthAndResize=function(){if(ve.props.mode!=="horizontal")return;var J=ve.childRef.current;if(!J)return;var se=J.children;if(!se||se.length===0)return;var ne=J.children[se.length-1];Ke(ne,"display","inline-block");var ye=ve.getMenuItemNodes(),Ee=ye.filter(function(Ie){return Ie.className.split(" ").indexOf(Va)>=0});Ee.forEach(function(Ie){Ke(Ie,"display","inline-block")}),ve.menuItemSizes=ye.map(function(Ie){return Ze(Ie,!0)}),Ee.forEach(function(Ie){Ke(Ie,"display","none")}),ve.overflowedIndicatorWidth=Ze(J.children[J.children.length-1],!0),ve.originalTotalWidth=ve.menuItemSizes.reduce(function(Ie,Re){return Ie+Re},0),ve.handleResize(),Ke(ne,"display","none")},ve.handleResize=function(){if(ve.props.mode!=="horizontal")return;var J=ve.childRef.current;if(!J)return;var se=Ze(J);ve.overflowedItems=[];var ne=0,ye;ve.originalTotalWidth>se+si&&(ye=-1,ve.menuItemSizes.forEach(function(Ee){ne+=Ee,ne+ve.overflowedIndicatorWidth<=se&&(ye+=1)})),ve.setState({lastVisibleIndex:ye})},ve}return Object(y.a)(Me,[{key:"componentDidMount",value:function(){var J=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var se=this.childRef.current;if(!se)return;this.resizeObserver=new rt.default(function(ne){ne.forEach(function(){var ye=J.cancelFrameId;cancelAnimationFrame(ye),J.cancelFrameId=requestAnimationFrame(J.setChildrenWidthAndResize)})}),[].slice.call(se.children).concat(se).forEach(function(ne){J.resizeObserver.observe(ne)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){J.resizeObserver.disconnect(),[].slice.call(se.children).concat(se).forEach(function(ne){J.resizeObserver.observe(ne)}),J.setChildrenWidthAndResize()}),this.mutationObserver.observe(se,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(J){var se=this,ne=this.state.lastVisibleIndex;return(J||[]).reduce(function(ye,Ee,Ie){var Re=Ee;if(se.props.mode==="horizontal"){var je=se.getOverflowedSubMenuItem(Ee.props.eventKey,[]);ne!==void 0&&se.props.className.indexOf("".concat(se.props.prefixCls,"-root"))!==-1&&(Ie>ne&&(Re=m.cloneElement(Ee,{style:{display:"none"},eventKey:"".concat(Ee.props.eventKey,"-hidden"),className:"".concat(Va)})),Ie===ne+1&&(se.overflowedItems=J.slice(ne+1).map(function(mt){return m.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),je=se.getOverflowedSubMenuItem(Ee.props.eventKey,se.overflowedItems)));var qe=[].concat(Object(L.a)(ye),[je,Re]);return Ie===J.length-1&&qe.push(se.getOverflowedSubMenuItem(Ee.props.eventKey,[],!0)),qe}return[].concat(Object(L.a)(ye),[Re])},[])}},{key:"render",value:function(){var J=this.props,se=J.visible,ne=J.prefixCls,ye=J.overflowedIndicator,Ee=J.mode,Ie=J.level,Re=J.tag,je=J.children,qe=J.theme,mt=Object(R.a)(J,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ft=Re;return m.createElement(ft,Object(h.a)({ref:this.childRef},mt),this.renderChildren(je))}}]),Me}(m.Component);Wr.defaultProps={tag:"div",className:""};var Xa=Wr;function Kt(ce){return ce.length?ce.every(function(Oe){return!!Oe.props.disabled}):!0}function Gt(ce,Oe,Me){var ve=ce.getState();ce.setState({activeKey:Object(j.a)(Object(j.a)({},ve.activeKey),{},Object(ee.a)({},Oe,Me))})}function Vt(ce){return ce.eventKey||"0-menu-"}function dn(ce,Oe){var Me=Oe,ve=ce.children,J=ce.eventKey;if(Me){var se;if(Ne(ve,function(ne,ye){ne&&ne.props&&!ne.props.disabled&&Me===Ae(ne,J,ye)&&(se=!0)}),se)return Me}return Me=null,ce.defaultActiveFirst&&Ne(ve,function(ne,ye){!Me&&ne&&!ne.props.disabled&&(Me=Ae(ne,J,ye))}),Me}function _n(ce){if(!ce)return;var Oe=this.instanceArray.indexOf(ce);Oe!==-1?this.instanceArray[Oe]=ce:this.instanceArray.push(ce)}var In=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(ve){var J;return Object(S.a)(this,Me),J=Oe.call(this,ve),J.onKeyDown=function(se,ne){var ye=se.keyCode,Ee;if(J.getFlatInstanceArray().forEach(function(Re){Re&&Re.props.active&&Re.onKeyDown&&(Ee=Re.onKeyDown(se))}),Ee)return 1;var Ie=null;return(ye===p.a.UP||ye===p.a.DOWN)&&(Ie=J.step(ye===p.a.UP?-1:1)),Ie?(se.preventDefault(),Gt(J.props.store,Vt(J.props),Ie.props.eventKey),typeof ne=="function"&&ne(Ie),1):void 0},J.onItemHover=function(se){var ne=se.key,ye=se.hover;Gt(J.props.store,Vt(J.props),ye?ne:null)},J.onDeselect=function(se){J.props.onDeselect(se)},J.onSelect=function(se){J.props.onSelect(se)},J.onClick=function(se){J.props.onClick(se)},J.onOpenChange=function(se){J.props.onOpenChange(se)},J.onDestroy=function(se){J.props.onDestroy(se)},J.getFlatInstanceArray=function(){return J.instanceArray},J.step=function(se){var ne=J.getFlatInstanceArray(),ye=J.props.store.getState().activeKey[Vt(J.props)],Ee=ne.length;if(!Ee)return null;se<0&&(ne=ne.concat().reverse());var Ie=-1;if(ne.every(function(mt,ft){return mt&&mt.props.eventKey===ye?(Ie=ft,!1):!0}),!J.props.defaultActiveFirst&&Ie!==-1&&Kt(ne.slice(Ie,Ee-1)))return;var Re=(Ie+1)%Ee,je=Re;do{var qe=ne[je];if(!qe||qe.props.disabled)je=(je+1)%Ee;else return qe}while(je!==Re);return null},J.renderCommonMenuItem=function(se,ne,ye){var Ee=J.props.store.getState(),Ie=Object(u.a)(J),Re=Ie.props,je=Ae(se,Re.eventKey,ne),qe=se.props;if(!qe||typeof se.type=="string")return se;var mt=je===Ee.activeKey,ft=Object(j.a)(Object(j.a)({mode:qe.mode||Re.mode,level:Re.level,inlineIndent:Re.inlineIndent,renderMenuItem:J.renderMenuItem,rootPrefixCls:Re.prefixCls,index:ne,parentMenu:Re.parentMenu,manualRef:qe.disabled?void 0:Object(g.a)(se.ref,_n.bind(Object(u.a)(J))),eventKey:je,active:!qe.disabled&&mt,multiple:Re.multiple,onClick:function($t){(qe.onClick||fe)($t),J.onClick($t)},onItemHover:J.onItemHover,motion:Re.motion,subMenuOpenDelay:Re.subMenuOpenDelay,subMenuCloseDelay:Re.subMenuCloseDelay,forceSubMenuRender:Re.forceSubMenuRender,onOpenChange:J.onOpenChange,onDeselect:J.onDeselect,onSelect:J.onSelect,builtinPlacements:Re.builtinPlacements,itemIcon:qe.itemIcon||J.props.itemIcon,expandIcon:qe.expandIcon||J.props.expandIcon},ye),{},{direction:Re.direction});return(Re.mode==="inline"||He())&&(ft.triggerSubMenuAction="click"),m.cloneElement(se,Object(j.a)(Object(j.a)({},ft),{},{key:je||ne}))},J.renderMenuItem=function(se,ne,ye){if(!se)return null;var Ee=J.props.store.getState(),Ie={openKeys:Ee.openKeys,selectedKeys:Ee.selectedKeys,triggerSubMenuAction:J.props.triggerSubMenuAction,subMenuKey:ye};return J.renderCommonMenuItem(se,ne,Ie)},ve.store.setState({activeKey:Object(j.a)(Object(j.a)({},ve.store.getState().activeKey),{},Object(ee.a)({},ve.eventKey,dn(ve,ve.activeKey)))}),J.instanceArray=[],J}return Object(y.a)(Me,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(J){return this.props.visible||J.visible||this.props.className!==J.className||!M()(this.props.style,J.style)}},{key:"componentDidUpdate",value:function(J){var se=this.props,ne="activeKey"in se?se.activeKey:se.store.getState().activeKey[Vt(se)],ye=dn(se,ne);if(ye!==ne)Gt(se.store,Vt(se),ye);else if("activeKey"in J){var Ee=dn(J,J.activeKey);ye!==Ee&&Gt(se.store,Vt(se),ye)}}},{key:"render",value:function(){var J=this,se=Object(h.a)({},this.props);this.instanceArray=[];var ne=F()(se.prefixCls,se.className,"".concat(se.prefixCls,"-").concat(se.mode)),ye={className:ne,role:se.role||"menu"};se.id&&(ye.id=se.id),se.focusable&&(ye.tabIndex=0,ye.onKeyDown=this.onKeyDown);var Ee=se.prefixCls,Ie=se.eventKey,Re=se.visible,je=se.level,qe=se.mode,mt=se.overflowedIndicator,ft=se.theme;return et.forEach(function(bt){return delete se[bt]}),delete se.onClick,m.createElement(Xa,Object(h.a)({},se,{prefixCls:Ee,mode:qe,tag:"ul",level:je,theme:ft,visible:Re,overflowedIndicator:mt},ye),Object(P.a)(se.children).map(function(bt,$t){return J.renderMenuItem(bt,$t,Ie||"0-menu-")}))}}]),Me}(m.Component);In.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:fe};var $n=Object(a.b)()(In),er=$n,Yn=G("Kwbf");function $r(ce,Oe,Me){var ve=ce.prefixCls,J=ce.motion,se=ce.defaultMotions,ne=se===void 0?{}:se,ye=ce.openAnimation,Ee=ce.openTransitionName,Ie=Oe.switchingModeFromInline;if(J)return J;if(Object(U.a)(ye)==="object"&&ye)Object(Yn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ye=="string")return{motionName:"".concat(ve,"-open-").concat(ye)};if(Ee)return{motionName:Ee};var Re=ne[Me];return Re||(Ie?null:ne.other)}var tr=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(ve){var J;Object(S.a)(this,Me),J=Oe.call(this,ve),J.onSelect=function(ye){var Ee=Object(u.a)(J),Ie=Ee.props;if(Ie.selectable){var Re=J.store.getState(),je=Re.selectedKeys,qe=ye.key;Ie.multiple?je=je.concat([qe]):je=[qe],"selectedKeys"in Ie||J.store.setState({selectedKeys:je}),Ie.onSelect(Object(j.a)(Object(j.a)({},ye),{},{selectedKeys:je}))}},J.onClick=function(ye){var Ee=J.getRealMenuMode(),Ie=Object(u.a)(J),Re=Ie.store,je=Ie.props.onOpenChange;Ee!=="inline"&&!("openKeys"in J.props)&&(Re.setState({openKeys:[]}),je([])),J.props.onClick(ye)},J.onKeyDown=function(ye,Ee){J.innerMenu.getWrappedInstance().onKeyDown(ye,Ee)},J.onOpenChange=function(ye){var Ee=Object(u.a)(J),Ie=Ee.props,Re=J.store.getState().openKeys.concat(),je=!1,qe=function(ft){var bt=!1;if(ft.open)bt=Re.indexOf(ft.key)===-1,bt&&Re.push(ft.key);else{var $t=Re.indexOf(ft.key);bt=$t!==-1,bt&&Re.splice($t,1)}je=je||bt};Array.isArray(ye)?ye.forEach(qe):qe(ye),je&&("openKeys"in J.props||J.store.setState({openKeys:Re}),Ie.onOpenChange(Re))},J.onDeselect=function(ye){var Ee=Object(u.a)(J),Ie=Ee.props;if(Ie.selectable){var Re=J.store.getState().selectedKeys.concat(),je=ye.key,qe=Re.indexOf(je);qe!==-1&&Re.splice(qe,1),"selectedKeys"in Ie||J.store.setState({selectedKeys:Re}),Ie.onDeselect(Object(j.a)(Object(j.a)({},ye),{},{selectedKeys:Re}))}},J.onMouseEnter=function(ye){J.restoreModeVerticalFromInline();var Ee=J.props.onMouseEnter;Ee&&Ee(ye)},J.onTransitionEnd=function(ye){var Ee=ye.propertyName==="width"&&ye.target===ye.currentTarget,Ie=ye.target.className,Re=Object.prototype.toString.call(Ie)==="[object SVGAnimatedString]"?Ie.animVal:Ie,je=ye.propertyName==="font-size"&&Re.indexOf("anticon")>=0;(Ee||je)&&J.restoreModeVerticalFromInline()},J.setInnerMenu=function(ye){J.innerMenu=ye},J.isRootMenu=!0;var se=ve.defaultSelectedKeys,ne=ve.defaultOpenKeys;return"selectedKeys"in ve&&(se=ve.selectedKeys||[]),"openKeys"in ve&&(ne=ve.openKeys||[]),J.store=Object(a.c)({selectedKeys:se,openKeys:ne,activeKey:{"0-menu-":dn(ve,ve.activeKey)}}),J.state={switchingModeFromInline:!1,prevProps:ve,inlineOpenKeys:[],store:J.store},J}return Object(y.a)(Me,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(J){var se=this.props,ne=se.siderCollapsed,ye=se.inlineCollapsed,Ee=se.onOpenChange;(!J.inlineCollapsed&&ye||!J.siderCollapsed&&ne)&&Ee([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var J=this.props.collapsedWidth,se=this.store,ne=this.prevOpenKeys,ye=this.getInlineCollapsed()&&(J===0||J==="0"||J==="0px");ye?(this.prevOpenKeys=se.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ne&&(this.store.setState({openKeys:ne}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var J=this.props.mode,se=this.state.switchingModeFromInline,ne=this.getInlineCollapsed();return se&&ne?"inline":ne?"vertical":J}},{key:"getInlineCollapsed",value:function(){var J=this.props,se=J.inlineCollapsed,ne=J.siderCollapsed;return ne!==void 0?ne:se}},{key:"restoreModeVerticalFromInline",value:function(){var J=this.state.switchingModeFromInline;J&&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 J=Object(j.a)({},Object(b.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),se=this.getRealMenuMode();return J.className+=" ".concat(J.prefixCls,"-root"),J.direction==="rtl"&&(J.className+=" ".concat(J.prefixCls,"-rtl")),J=Object(j.a)(Object(j.a)({},J),{},{mode:se,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:$r(this.props,this.state,se)}),delete J.openAnimation,delete J.openTransitionName,m.createElement(a.a,{store:this.store},m.createElement(er,Object(h.a)({},J,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(J,se){var ne=se.prevProps,ye=se.store,Ee=ye.getState(),Ie={},Re={prevProps:J};return ne.mode==="inline"&&J.mode!=="inline"&&(Re.switchingModeFromInline=!0),"openKeys"in J?Ie.openKeys=J.openKeys||[]:((J.inlineCollapsed&&!ne.inlineCollapsed||J.siderCollapsed&&!ne.siderCollapsed)&&(Re.switchingModeFromInline=!0,Re.inlineOpenKeys=Ee.openKeys,Ie.openKeys=[]),(!J.inlineCollapsed&&ne.inlineCollapsed||!J.siderCollapsed&&ne.siderCollapsed)&&(Ie.openKeys=se.inlineOpenKeys,Re.inlineOpenKeys=[])),Object.keys(Ie).length&&ye.setState(Ie),Re}}]),Me}(m.Component);tr.defaultProps={selectable:!0,onClick:fe,onSelect:fe,onOpenChange:fe,onDeselect:fe,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:m.createElement("span",null,"\xB7\xB7\xB7")};var oa=tr,nr=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(){var ve;return Object(S.a)(this,Me),ve=Oe.apply(this,arguments),ve.onKeyDown=function(J){var se=J.keyCode;return se===p.a.ENTER?(ve.onClick(J),!0):void 0},ve.onMouseLeave=function(J){var se=ve.props,ne=se.eventKey,ye=se.onItemHover,Ee=se.onMouseLeave;ye({key:ne,hover:!1}),Ee({key:ne,domEvent:J})},ve.onMouseEnter=function(J){var se=ve.props,ne=se.eventKey,ye=se.onItemHover,Ee=se.onMouseEnter;ye({key:ne,hover:!0}),Ee({key:ne,domEvent:J})},ve.onClick=function(J){var se=ve.props,ne=se.eventKey,ye=se.multiple,Ee=se.onClick,Ie=se.onSelect,Re=se.onDeselect,je=se.isSelected,qe={key:ne,keyPath:[ne],item:Object(u.a)(ve),domEvent:J};Ee(qe),ye?je?Re(qe):Ie(qe):je||Ie(qe)},ve.saveNode=function(J){ve.node=J},ve}return Object(y.a)(Me,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var J=this.props;J.onDestroy&&J.onDestroy(J.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 J,se=Object(j.a)({},this.props),ne=F()(this.getPrefixCls(),se.className,(J={},Object(ee.a)(J,this.getActiveClassName(),!se.disabled&&se.active),Object(ee.a)(J,this.getSelectedClassName(),se.isSelected),Object(ee.a)(J,this.getDisabledClassName(),se.disabled),J)),ye=Object(j.a)(Object(j.a)({},se.attribute),{},{title:typeof se.title=="string"?se.title:void 0,className:ne,role:se.role||"menuitem","aria-disabled":se.disabled});se.role==="option"?ye=Object(j.a)(Object(j.a)({},ye),{},{role:"option","aria-selected":se.isSelected}):(se.role===null||se.role==="none")&&(ye.role="none");var Ee={onClick:se.disabled?null:this.onClick,onMouseLeave:se.disabled?null:this.onMouseLeave,onMouseEnter:se.disabled?null:this.onMouseEnter},Ie=Object(j.a)({},se.style);se.mode==="inline"&&(se.direction==="rtl"?Ie.paddingRight=se.inlineIndent*se.level:Ie.paddingLeft=se.inlineIndent*se.level),et.forEach(function(je){return delete se[je]}),delete se.direction;var Re=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Re=m.createElement(this.props.itemIcon,this.props)),m.createElement("li",Object(h.a)({},Object(b.a)(se,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ye,Ee,{style:Ie,ref:this.saveNode}),se.children,Re)}}]),Me}(m.Component);nr.isMenuItem=!0,nr.defaultProps={onSelect:fe,onMouseEnter:fe,onMouseLeave:fe,manualRef:fe};var Yr=Object(a.b)(function(ce,Oe){var Me=ce.activeKey,ve=ce.selectedKeys,J=Oe.eventKey,se=Oe.subMenuKey;return{active:Me[se]===J,isSelected:Array.isArray(ve)?ve.indexOf(J)!==-1:ve===J}})(nr),Jr=Yr,ga=function(ce){Object(d.a)(Me,ce);var Oe=Object(o.a)(Me);function Me(){var ve;return Object(S.a)(this,Me),ve=Oe.apply(this,arguments),ve.renderInnerMenuItem=function(J){var se=ve.props,ne=se.renderMenuItem,ye=se.index;return ne(J,ye,ve.props.subMenuKey)},ve}return Object(y.a)(Me,[{key:"render",value:function(){var J=Object(h.a)({},this.props),se=J.className,ne=se===void 0?"":se,ye=J.rootPrefixCls,Ee="".concat(ye,"-item-group-title"),Ie="".concat(ye,"-item-group-list"),Re=J.title,je=J.children;return et.forEach(function(qe){return delete J[qe]}),delete J.direction,m.createElement("li",Object(h.a)({},J,{onClick:function(mt){return mt.stopPropagation()},className:"".concat(ne," ").concat(ye,"-item-group")}),m.createElement("div",{className:Ee,title:typeof Re=="string"?Re:void 0},Re),m.createElement("ul",{className:Ie},m.Children.map(je,this.renderInnerMenuItem)))}}]),Me}(m.Component);ga.isMenuItemGroup=!0,ga.defaultProps={disabled:!0};var Hi=ga,li=function(Oe){var Me=Oe.className,ve=Oe.rootPrefixCls,J=Oe.style;return m.createElement("li",{className:"".concat(Me," ").concat(ve,"-item-divider"),style:J})};li.defaultProps={disabled:!0,className:"",style:{}};var zi=li,ui=oa,di=G("eDIo");function xi(ce,Oe){var Me=ce.prefixCls,ve=ce.editable,J=ce.locale,se=ce.style;return!ve||ve.showAdd===!1?null:m.createElement("button",{ref:Oe,type:"button",className:"".concat(Me,"-nav-add"),style:se,"aria-label":(J==null?void 0:J.addAriaLabel)||"Add tab",onClick:function(ye){ve.onEdit("add",{event:ye})}},ve.addIcon||"+")}var ya=m.forwardRef(xi);function Sa(ce,Oe){var Me=ce.prefixCls,ve=ce.id,J=ce.tabs,se=ce.locale,ne=ce.mobile,ye=ce.moreIcon,Ee=ye===void 0?"More":ye,Ie=ce.moreTransitionName,Re=ce.style,je=ce.className,qe=ce.editable,mt=ce.tabBarGutter,ft=ce.rtl,bt=ce.onTabClick,$t=Object(m.useState)(!1),sn=Object(K.a)($t,2),Zt=sn[0],en=sn[1],ln=Object(m.useState)(null),rn=Object(K.a)(ln,2),tn=rn[0],En=rn[1],fn="".concat(ve,"-more-popup"),rr="".concat(Me,"-dropdown"),hn=tn!==null?"".concat(fn,"-").concat(tn):null,Ht=se==null?void 0:se.dropdownAriaLabel,Ft=m.createElement(ui,{onClick:function(Kn){var jn=Kn.key,cr=Kn.domEvent;bt(jn,cr),en(!1)},id:fn,tabIndex:-1,role:"listbox","aria-activedescendant":hn,selectedKeys:[tn],"aria-label":Ht!==void 0?Ht:"expanded dropdown"},J.map(function(wn){return m.createElement(Jr,{key:wn.key,id:"".concat(fn,"-").concat(wn.key),role:"option","aria-controls":ve&&"".concat(ve,"-panel-").concat(wn.key),disabled:wn.disabled},wn.tab)}));function vn(wn){for(var Kn=J.filter(function(Ur){return!Ur.disabled}),jn=Kn.findIndex(function(Ur){return Ur.key===tn})||0,cr=Kn.length,Tr=0;TrCn?(xn=Ft,fn.current="x"):(xn=vn,fn.current="y");var ar=Date.now();ar-tn.current>100&&(En.current=!1),(Oe(-xn,-xn)||En.current)&&(Ht.preventDefault(),En.current=!0),tn.current=ar}var hn=Object(m.useRef)(null);hn.current={onTouchStart:en,onTouchMove:ln,onTouchEnd:rn,onWheel:rr},m.useEffect(function(){function Ht(Lt){hn.current.onTouchStart(Lt)}function Ft(Lt){hn.current.onTouchMove(Lt)}function vn(Lt){hn.current.onTouchEnd(Lt)}function xn(Lt){hn.current.onWheel(Lt)}return document.addEventListener("touchmove",Ft,{passive:!1}),document.addEventListener("touchend",vn,{passive:!1}),ce.current.addEventListener("touchstart",Ht,{passive:!1}),ce.current.addEventListener("wheel",xn),function(){document.removeEventListener("touchmove",Ft),document.removeEventListener("touchend",vn)}},[])}function fi(){var ce=Object(m.useRef)(new Map);function Oe(ve){return ce.current.has(ve)||ce.current.set(ve,m.createRef()),ce.current.get(ve)}function Me(ve){ce.current.delete(ve)}return[Oe,Me]}function hi(ce,Oe){var Me=m.useRef(ce),ve=m.useState({}),J=Object(K.a)(ve,2),se=J[1];function ne(ye){var Ee=typeof ye=="function"?ye(Me.current):ye;Ee!==Me.current&&Oe(Ee,Me.current),Me.current=Ee,se({})}return[Me.current,ne]}var Ti=function(Oe){var Me=Oe.position,ve=Oe.prefixCls,J=Oe.extra;if(!J)return null;var se,ne=J;return Me==="right"&&(se=ne.right||!ne.left&&ne||null),Me==="left"&&(se=ne.left||null),se?m.createElement("div",{className:"".concat(ve,"-extra-content")},se):null};function Vi(ce,Oe){var Me,ve=m.useContext(ci),J=ve.prefixCls,se=ve.tabs,ne=ce.className,ye=ce.style,Ee=ce.id,Ie=ce.animated,Re=ce.activeKey,je=ce.rtl,qe=ce.extra,mt=ce.editable,ft=ce.locale,bt=ce.tabPosition,$t=ce.tabBarGutter,sn=ce.children,Zt=ce.onTabClick,en=ce.onTabScroll,ln=Object(m.useRef)(),rn=Object(m.useRef)(),tn=Object(m.useRef)(),En=Object(m.useRef)(),fn=fi(),rr=Object(K.a)(fn,2),hn=rr[0],Ht=rr[1],Ft=bt==="top"||bt==="bottom",vn=hi(0,function(Ln,yn){Ft&&en&&en({direction:Ln>yn?"left":"right"})}),xn=Object(K.a)(vn,2),Lt=xn[0],Cn=xn[1],ar=hi(0,function(Ln,yn){!Ft&&en&&en({direction:Ln>yn?"top":"bottom"})}),wn=Object(K.a)(ar,2),Kn=wn[0],jn=wn[1],cr=Object(m.useState)(0),Tr=Object(K.a)(cr,2),or=Tr[0],Ur=Tr[1],sa=Object(m.useState)(0),Kr=Object(K.a)(sa,2),Cr=Kr[0],Jn=Kr[1],Hn=Object(m.useState)(0),sr=Object(K.a)(Hn,2),ir=sr[0],la=sr[1],Oa=Object(m.useState)(0),Aa=Object(K.a)(Oa,2),Bn=Aa[0],pa=Aa[1],Da=Object(m.useState)(null),Xn=Object(K.a)(Da,2),Nn=Xn[0],Sr=Xn[1],Co=Object(m.useState)(null),Ji=Object(K.a)(Co,2),Ra=Ji[0],Ya=Ji[1],Ci=Object(m.useState)(0),Qi=Object(K.a)(Ci,2),Si=Qi[0],Xo=Qi[1],$o=Object(m.useState)(0),So=Object(K.a)($o,2),Zi=So[0],qi=So[1],Ja=E(new Map),Qa=Object(K.a)(Ja,2),Yo=Qa[0],_i=Qa[1],mi=c(se,Yo,or),Za="".concat(J,"-nav-operations-hidden"),qa=0,ua=0;Ft?je?(qa=0,ua=Math.max(0,or-Nn)):(qa=Math.min(0,Nn-or),ua=0):(qa=Math.min(0,Ra-Cr),ua=0);function Na(Ln){return Lnua?[ua,!1]:[Ln,!0]}var La=Object(m.useRef)(),pi=Object(m.useState)(),Ua=Object(K.a)(pi,2),wi=Ua[0],eo=Ua[1];function Oi(){eo(Date.now())}function to(){window.clearTimeout(La.current)}wa(ln,function(Ln,yn){var _r=!1;function zr(ei,Ea){ei(function(yi){var Pa=Na(yi+Ea),wr=Object(K.a)(Pa,2),Ri=wr[0],ro=wr[1];return _r=ro,Ri})}if(Ft){if(Nn>=or)return _r;zr(Cn,Ln)}else{if(Ra>=Cr)return _r;zr(jn,yn)}return to(),Oi(),_r}),Object(m.useEffect)(function(){return to(),wi&&(La.current=window.setTimeout(function(){eo(0)},100)),to},[wi]);function Ma(){var Ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Re,yn=mi.get(Ln);if(!yn)return;if(Ft){var _r=Lt;je?yn.rightLt+Nn&&(_r=yn.right+yn.width-Nn):yn.left<-Lt?_r=-yn.left:yn.left+yn.width>-Lt+Nn&&(_r=-(yn.left+yn.width-Nn)),jn(0),Cn(Na(_r)[0])}else{var zr=Kn;yn.top<-Kn?zr=-yn.top:yn.top+yn.height>-Kn+Ra&&(zr=-(yn.top+yn.height-Ra)),Cn(0),jn(Na(zr)[0])}}var Fa=v(mi,{width:Nn,height:Ra,left:Lt,top:Kn},{width:ir,height:Bn},{width:Si,height:Zi},Object(j.a)(Object(j.a)({},ce),{},{tabs:se})),_o=Object(K.a)(Fa,2),Jo=_o[0],Qo=_o[1],Zo=se.map(function(Ln){var yn=Ln.key;return m.createElement(s,{id:Ee,prefixCls:J,key:yn,rtl:je,tab:Ln,closable:Ln.closable,editable:mt,active:yn===Re,tabPosition:bt,tabBarGutter:$t,renderWrapper:sn,removeAriaLabel:ft==null?void 0:ft.removeAriaLabel,ref:hn(yn),onClick:function(zr){Zt(yn,zr)},onRemove:function(){Ht(yn)},onFocus:function(){Ma(yn),Oi(),je||(ln.current.scrollLeft=0),ln.current.scrollTop=0}})}),no=O(function(){var Ln,yn,_r,zr,ei,Ea,yi,Pa,wr,Ri=((Ln=ln.current)===null||Ln===void 0?void 0:Ln.offsetWidth)||0,ro=((yn=ln.current)===null||yn===void 0?void 0:yn.offsetHeight)||0,ao=((_r=En.current)===null||_r===void 0?void 0:_r.offsetWidth)||0,Gr=((zr=En.current)===null||zr===void 0?void 0:zr.offsetHeight)||0,On=((ei=tn.current)===null||ei===void 0?void 0:ei.offsetWidth)||0,ca=((Ea=tn.current)===null||Ea===void 0?void 0:Ea.offsetHeight)||0;Sr(Ri),Ya(ro),Xo(ao),qi(Gr);var xa=(((yi=rn.current)===null||yi===void 0?void 0:yi.offsetWidth)||0)-ao,Ta=(((Pa=rn.current)===null||Pa===void 0?void 0:Pa.offsetHeight)||0)-Gr;Ur(xa),Jn(Ta);var io=(wr=tn.current)===null||wr===void 0?void 0:wr.className.includes(Za);la(xa-(io?0:On)),pa(Ta-(io?0:ca)),_i(function(){var Li=new Map;return se.forEach(function(Ro){var Lo=Ro.key,Ba=hn(Lo).current;Ba&&Li.set(Lo,{width:Ba.offsetWidth,height:Ba.offsetHeight,left:Ba.offsetLeft,top:Ba.offsetTop})}),Li})}),qo=se.slice(0,Jo),Hr=se.slice(Qo+1),mr=[].concat(Object(L.a)(qo),Object(L.a)(Hr)),Mr=Object(m.useState)(),pr=Object(K.a)(Mr,2),vi=pr[0],es=pr[1],da=mi.get(Re),wo=Object(m.useRef)();function Oo(){w.a.cancel(wo.current)}Object(m.useEffect)(function(){var Ln={};return da&&(Ft?(je?Ln.right=da.right:Ln.left=da.left,Ln.width=da.width):(Ln.top=da.top,Ln.height=da.height)),Oo(),wo.current=w()(function(){es(Ln)}),Oo},[da,Ft,je]),Object(m.useEffect)(function(){Ma()},[Re,da,mi,Ft]),Object(m.useEffect)(function(){no()},[je,$t,Re,se.map(function(Ln){return Ln.key}).join("_")]);var Ao=!!mr.length,ja="".concat(J,"-nav-wrap"),Ai,gi,Do,Di;return Ft?je?(gi=Lt>0,Ai=Lt+Nn` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,f=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,s=" ";function l(I,N,z){return N.f=N.inline=z,z(I,N)}function c(I,N,z){return N.f=N.block=z,z(I,N)}function x(I){return!I||!/\S/.test(I.string)}function v(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==S){var N=m;if(!N){var z=ee.innerMode(j,I.htmlState);N=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}N&&(I.f=o,I.block=h,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function h(I,N){var z=I.column()===N.indentation,$=x(N.prevLine.stream),ae=N.indentedCode,le=N.prevLine.hr,De=N.list!==!1,xe=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var Pe=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,De)){for(N.list=null;Pe=4&&(ae||N.prevLine.fencedCodeEnd||N.prevLine.header||$))return I.skipToEnd(),N.indentedCode=!0,F.code;if(I.eatSpace())return null;if(z&&N.indentation<=xe&&(me=I.match(w))&&me[1].length<=6)return N.quote=0,N.header=me[1].length,N.thisLine.header=!0,R.highlightFormatting&&(N.formatting="header"),N.f=N.inline,u(N);if(N.indentation<=xe&&I.eat(">"))return N.quote=z?1:N.quote+1,R.highlightFormatting&&(N.formatting="quote"),I.eatSpace(),u(N);if(!we&&!N.setext&&z&&N.indentation<=xe&&(me=I.match(L))){var pe=me[1]?"ol":"ul";return N.indentation=Pe+I.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,R.taskLists&&I.match(C,!1)&&(N.taskList=!0),N.f=N.inline,R.highlightFormatting&&(N.formatting=["list","list-"+pe]),u(N)}else{if(z&&N.indentation<=xe&&(me=I.match(E,!0)))return N.quote=0,N.fencedEndRE=new RegExp(me[1]+"+ *$"),N.localMode=R.fencedCodeBlockHighlighting&&_(me[2]||R.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=ee.startState(N.localMode)),N.f=N.block=y,R.highlightFormatting&&(N.formatting="code-block"),N.code=-1,u(N);if(N.setext||(!Le||!De)&&!N.quote&&N.list===!1&&!N.code&&!we&&!p.test(I.string)&&(me=I.lookAhead(1))&&(me=me.match(k)))return N.setext?(N.header=N.setext,N.setext=0,I.skipToEnd(),R.highlightFormatting&&(N.formatting="header")):(N.header=me[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,u(N);if(we)return I.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,F.hr;if(I.peek()==="[")return l(I,N,M)}return l(I,N,N.inline)}function S(I,N){var z=j.token(I,N.htmlState);if(!m){var $=ee.innerMode(j,N.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||N.md_inside&&I.current().indexOf(">")>-1)&&(N.f=o,N.block=h,N.htmlState=null)}return z}function y(I,N){var z=N.listStack[N.listStack.length-1]||0,$=N.indentation=I.quote?N.push(F.formatting+"-"+I.formatting[z]+"-"+I.quote):N.push("error"))}if(I.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(I.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(I.linkHref?N.push(F.linkHref,"url"):(I.strong&&N.push(F.strong),I.em&&N.push(F.em),I.strikethrough&&N.push(F.strikethrough),I.emoji&&N.push(F.emoji),I.linkText&&N.push(F.linkText),I.code&&N.push(F.code),I.image&&N.push(F.image),I.imageAltText&&N.push(F.imageAltText,"link"),I.imageMarker&&N.push(F.imageMarker)),I.header&&N.push(F.header,F.header+"-"+I.header),I.quote&&(N.push(F.quote),!R.maxBlockquoteDepth||R.maxBlockquoteDepth>=I.quote?N.push(F.quote+"-"+I.quote):N.push(F.quote+"-"+R.maxBlockquoteDepth)),I.list!==!1){var $=(I.listStack.length-1)%3;$?$===1?N.push(F.list2):N.push(F.list3):N.push(F.list1)}return I.trailingSpaceNewLine?N.push("trailing-space-new-line"):I.trailingSpace&&N.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function d(I,N){return I.match(O,!0)?u(N):void 0}function o(I,N){var z=N.text(I,N);if(typeof z!="undefined")return z;if(N.list)return N.list=null,u(N);if(N.taskList){var $=I.match(C,!0)[1]===" ";return $?N.taskOpen=!0:N.taskClosed=!0,R.highlightFormatting&&(N.formatting="task"),N.taskList=!1,u(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&I.match(/^#+$/,!0))return R.highlightFormatting&&(N.formatting="header"),u(N);var ae=I.next();if(N.linkTitle){N.linkTitle=!1;var le=ae;ae==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var De="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(I.match(new RegExp(De),!0))return F.linkHref}if(ae==="`"){var xe=N.formatting;R.highlightFormatting&&(N.formatting="code"),I.eatWhile("`");var Pe=I.current().length;if(N.code==0&&(!N.quote||Pe==1))return N.code=Pe,u(N);if(Pe==N.code){var Le=u(N);return N.code=0,Le}else return N.formatting=xe,u(N)}else if(N.code)return u(N);if(ae==="\\"&&(I.next(),R.highlightFormatting)){var we=u(N),me=F.formatting+"-escape";return we?we+" "+me:me}if(ae==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,R.highlightFormatting&&(N.formatting="image"),u(N);if(ae==="["&&N.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,R.highlightFormatting&&(N.formatting="image"),u(N);if(ae==="]"&&N.imageAltText){R.highlightFormatting&&(N.formatting="image");var we=u(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=b,we}if(ae==="["&&!N.image)return N.linkText&&I.match(/^.*?\]/)||(N.linkText=!0,R.highlightFormatting&&(N.formatting="link")),u(N);if(ae==="]"&&N.linkText){R.highlightFormatting&&(N.formatting="link");var we=u(N);return N.linkText=!1,N.inline=N.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?b:o,we}if(ae==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=a,R.highlightFormatting&&(N.formatting="link");var we=u(N);return we?we+=" ":we="",we+F.linkInline}if(ae==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=a,R.highlightFormatting&&(N.formatting="link");var we=u(N);return we?we+=" ":we="",we+F.linkEmail}if(R.xml&&ae==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var pe=I.string.indexOf(">",I.pos);if(pe!=-1){var Q=I.string.substring(I.start,pe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Q)&&(N.md_inside=!0)}return I.backUp(1),N.htmlState=ee.startState(j),c(I,N,S)}if(R.xml&&ae==="<"&&I.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var de=1,te=I.pos==1?" ":I.string.charAt(I.pos-2);de<3&&I.eat(ae);)de++;var fe=I.peek()||" ",Ae=!/\s/.test(fe)&&(!f.test(fe)||/\s/.test(te)||f.test(te)),_e=!/\s/.test(te)&&(!f.test(te)||/\s/.test(fe)||f.test(fe)),Ne=null,Ge=null;if(de%2&&(!N.em&&Ae&&(ae==="*"||!_e||f.test(te))?Ne=!0:N.em==ae&&_e&&(ae==="*"||!Ae||f.test(fe))&&(Ne=!1)),de>1&&(!N.strong&&Ae&&(ae==="*"||!_e||f.test(te))?Ge=!0:N.strong==ae&&_e&&(ae==="*"||!Ae||f.test(fe))&&(Ge=!1)),Ge!=null||Ne!=null){R.highlightFormatting&&(N.formatting=Ne==null?"strong":Ge==null?"em":"strong em"),Ne===!0&&(N.em=ae),Ge===!0&&(N.strong=ae);var Le=u(N);return Ne===!1&&(N.em=!1),Ge===!1&&(N.strong=!1),Le}}else if(ae===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return u(N);I.backUp(1)}if(R.strikethrough){if(ae==="~"&&I.eatWhile(ae)){if(N.strikethrough){R.highlightFormatting&&(N.formatting="strikethrough");var Le=u(N);return N.strikethrough=!1,Le}else if(I.match(/^[^\s]/,!1))return N.strikethrough=!0,R.highlightFormatting&&(N.formatting="strikethrough"),u(N)}else if(ae===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return u(N);I.backUp(2)}}if(R.emoji&&ae===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,R.highlightFormatting&&(N.formatting="emoji");var et=u(N);return N.emoji=!1,et}return ae===" "&&(I.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),u(N)}function a(I,N){var z=I.next();if(z===">"){N.f=N.inline=o,R.highlightFormatting&&(N.formatting="link");var $=u(N);return $?$+=" ":$="",$+F.linkInline}return I.match(/^[^>]+/,!0),F.linkInline}function b(I,N){if(I.eatSpace())return null;var z=I.next();return z==="("||z==="["?(N.f=N.inline=T(z==="("?")":"]"),R.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,u(N)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(I){return function(N,z){var $=N.next();if($===I){z.f=z.inline=o,R.highlightFormatting&&(z.formatting="link-string");var ae=u(z);return z.linkHref=!1,ae}return N.match(g[I]),z.linkHref=!0,u(z)}}function M(I,N){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=U,I.next(),R.highlightFormatting&&(N.formatting="link"),N.linkText=!0,u(N)):l(I,N,o)}function U(I,N){if(I.match(/^\]:/,!0)){N.f=N.inline=W,R.highlightFormatting&&(N.formatting="link");var z=u(N);return N.linkText=!1,z}return I.match(/^([^\]\\]|\\.)+/,!0),F.linkText}function W(I,N){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?N.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=o,F.linkHref+" url")}var H={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:o,text:d,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&ee.copyState(j,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?ee.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,N){if(N.formatting=!1,I!=N.thisLine.stream){if(N.header=0,N.hr=!1,I.match(/^\s*$/,!0))return v(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:I},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=S)){var z=I.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(N.indentation=z,N.indentationDiff=null,z>0)return null}}return N.f(I,N)},innerMode:function(I){return I.block==S?{state:I.htmlState,mode:j}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:H}},indent:function(I,N,z){return I.block==S&&j.indent?j.indent(I.htmlState,N,z):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,N,z):ee.Pass},blankLine:v,getType:u,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},mT4J:function(pt,$e,G){pt.exports={practice:"practice___2GgSp",right:"right___2iW-T",title:"title___2wI-Y",content:"content___39urh",des:"des___3lOLJ",mainBody:"mainBody___2O3bf",sys:"sys___9a4Vo",li:"li___1a3_u",d1:"d1___--jU-",img:"img___3TRW8",bot:"bot___3H4-s",btn:"btn___2pVoZ",b1:"b1___3uZem",b2:"b2___3A6em",d2:"d2___2tiq3",btns:"btns___2p8vO",practiceModal:"practiceModal___15Ue6"}},n6Qo:function(pt,$e,G){"use strict";G.d($e,"a",function(){return P});var ee=G("q1tI"),K=G("biw7"),R=G("fyJ8");function j(A){var L=A.className,C=A.index,w=A.children,k=A.colSpan,O=A.rowSpan,E=ee.useContext(K.a),p=E.prefixCls,f=E.fixedInfoList,s=f[C];return ee.createElement(R.a,Object.assign({className:L,index:C,component:"td",prefixCls:p,record:null,dataIndex:null,render:function(){return{children:w,props:{colSpan:k,rowSpan:O}}}},s))}function m(A){return ee.createElement("tr",Object.assign({},A))}function _(A){var L=A.children,C=ee.useContext(K.a),w=C.prefixCls;return ee.createElement("tfoot",{className:"".concat(w,"-summary")},L)}var F=$e.b=_,P={Cell:j,Row:m}},osHv:function(pt,$e,G){(function(ee){ee(G("VrN/"))})(function(ee){"use strict";var K=ee.Pos;function R(f,s){return f.line-s.line||f.ch-s.ch}var j="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",m=j+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_=new RegExp("<(/?)(["+j+"]["+m+"]*)","g");function F(f,s,l,c){this.line=s,this.ch=l,this.cm=f,this.text=f.getLine(s),this.min=c?Math.max(c.from,f.firstLine()):f.firstLine(),this.max=c?Math.min(c.to-1,f.lastLine()):f.lastLine()}function P(f,s){var l=f.cm.getTokenTypeAt(K(f.line,s));return l&&/\btag\b/.test(l)}function A(f){return f.line>=f.max?void 0:(f.ch=0,f.text=f.cm.getLine(++f.line),!0)}function L(f){return f.line<=f.min?void 0:(f.text=f.cm.getLine(--f.line),f.ch=f.text.length,!0)}function C(f){for(;;){var s=f.text.indexOf(">",f.ch);if(s==-1){if(A(f))continue;return}if(!P(f,s+1)){f.ch=s+1;continue}var l=f.text.lastIndexOf("/",s),c=l>-1&&!/\S/.test(f.text.slice(l+1,s));return f.ch=s+1,c?"selfClose":"regular"}}function w(f){for(;;){var s=f.ch?f.text.lastIndexOf("<",f.ch-1):-1;if(s==-1){if(L(f))continue;return}if(!P(f,s+1)){f.ch=s;continue}_.lastIndex=s,f.ch=s;var l=_.exec(f.text);if(l&&l.index==s)return l}}function k(f){for(;;){_.lastIndex=f.ch;var s=_.exec(f.text);if(!s){if(A(f))continue;return}if(!P(f,s.index+1)){f.ch=s.index+1;continue}return f.ch=s.index+s[0].length,s}}function O(f){for(;;){var s=f.ch?f.text.lastIndexOf(">",f.ch-1):-1;if(s==-1){if(L(f))continue;return}if(!P(f,s+1)){f.ch=s;continue}var l=f.text.lastIndexOf("/",s),c=l>-1&&!/\S/.test(f.text.slice(l+1,s));return f.ch=s+1,c?"selfClose":"regular"}}function E(f,s){for(var l=[];;){var c=k(f),x,v=f.line,h=f.ch-(c?c[0].length:0);if(!c||!(x=C(f)))return;if(x=="selfClose")continue;if(c[1]){for(var S=l.length-1;S>=0;--S)if(l[S]==c[2]){l.length=S;break}if(S<0&&(!s||s==c[2]))return{tag:c[2],from:K(v,h),to:K(f.line,f.ch)}}else l.push(c[2])}}function p(f,s){for(var l=[];;){var c=O(f);if(!c)return;if(c=="selfClose"){w(f);continue}var x=f.line,v=f.ch,h=w(f);if(!h)return;if(h[1])l.push(h[2]);else{for(var S=l.length-1;S>=0;--S)if(l[S]==h[2]){l.length=S;break}if(S<0&&(!s||s==h[2]))return{tag:h[2],from:K(f.line,f.ch),to:K(x,v)}}}}ee.registerHelper("fold","xml",function(f,s){for(var l=new F(f,s.line,0);;){var c=k(l);if(!c||l.line!=s.line)return;var x=C(l);if(!x)return;if(!c[1]&&x!="selfClose"){var v=K(l.line,l.ch),h=E(l,c[2]);return h&&R(h.from,v)>0?{from:v,to:h.from}:null}}}),ee.findMatchingTag=function(f,s,l){var c=new F(f,s.line,s.ch,l);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var x=C(c),v=x&&K(c.line,c.ch),h=x&&w(c);if(!x||!h||R(c,s)>0)return;var S={from:K(c.line,c.ch),to:v,tag:h[2]};return x=="selfClose"?{open:S,close:null,at:"open"}:h[1]?{open:p(c,h[2]),close:S,at:"close"}:(c=new F(f,v.line,v.ch,l),{open:S,close:E(c,h[2]),at:"open"})},ee.findEnclosingTag=function(f,s,l,c){for(var x=new F(f,s.line,s.ch,l);;){var v=p(x,c);if(!v)break;var h=new F(f,s.line,s.ch,l),S=E(h,v.tag);if(S)return{open:v,close:S}}},ee.scanForClosingTag=function(f,s,l,c){var x=new F(f,s.line,s.ch,c?{from:0,to:c}:null);return E(x,l)}})},p5ED:function(pt,$e,G){"use strict";var ee=G("+L6B"),K=G("2/Rp"),R=G("5Dmo"),j=G("3S7+"),m=G("k1fw"),_=G("tJVT"),F=G("q1tI"),P=G.n(F),A=G("vHTk"),L=G.n(A),C=G("yEEn"),w=G("ZW9T"),k=G("1vsH");$e.a=function(O){var E=O.name,p=O.data,f=O.theme,s=O.type,l=O.filename,c=O.monacoEditor,x=O.className,v=O.style,h=O.close,S=O.onClose,y=O.hasMask,u=Object(F.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),d=Object(_.a)(u,2),o=d[0],a=d[1],b=Object(F.useState)(""),g=Object(_.a)(b,2),T=g[0],M=g[1],U=Object(F.useRef)();l&&(c.filename=l),Object(F.useEffect)(function(){var I,N,z=(I=document.cookie)===null||I===void 0||((N=I.replace(/\s/g,""))===null||N===void 0)?void 0:N.split(";");z==null||z.map(function($){var ae=$.split("=");ae[0]==="_educoder_session"&&M(ae[1])})},[]);var W=function(){if(p.startsWith("http")||p.startsWith("/")){H();return}Object(k.y)(l||"educoder",p,l)},H=function(){Object(k.w)(l||E,p)};return console.log("data:",p,"fileanme:",l," name:",E),P.a.createElement("div",{style:Object(m.a)({},v||{}),className:"".concat(y&&L.a.bgBlack," ").concat(s?L.a.wrp:"hide")},h&&P.a.createElement("div",{className:L.a.close,ref:U},P.a.createElement(j.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},P.a.createElement("span",{onClick:H},P.a.createElement("i",{className:"icon-quxiaozhiding"}))),P.a.createElement(j.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},P.a.createElement("span",{className:"",onClick:S},P.a.createElement("i",{className:"icon-guanbi1"})))),P.a.createElement("div",{className:"".concat(L.a[x]," ").concat(x," ").concat(L.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&P.a.createElement(w.b,c)),s==="audio"&&P.a.createElement("audio",{src:"".concat(p!=null&&p.startsWith("/")||(p==null?void 0:p.indexOf("https://"))>-1?p:"data:audio/mp3;base64,").concat(p),autoPlay:!0}),s==="video"&&P.a.createElement(P.a.Fragment,null,p!=null&&p.startsWith("/")?P.a.createElement("video",{controls:!0,src:"".concat(p),autoPlay:!0}):P.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(p),autoPlay:!0})),s==="pdf"&&P.a.createElement("embed",{className:L.a.embed,src:p}),s==="image"&&P.a.createElement(P.a.Fragment,null,P.a.createElement("img",{src:"".concat(p!=null&&p.startsWith("/")||(p==null?void 0:p.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(p)})),s==="other"&&P.a.createElement("div",null,P.a.createElement(K.a,{type:"primary",size:"large",onClick:W},P.a.createElement(C.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&P.a.createElement(K.a,{type:"primary",size:"large",onClick:W},P.a.createElement(C.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(pt,$e,G){},qB8g:function(pt,$e,G){pt.exports={flexRow:"flexRow___Aj71W",flexColumn:"flexColumn___2jvSr",formWrap:"formWrap___3OxLN",upload:"upload___2lUf4",color0152d9:"color0152d9___10ICR",colorCCC:"colorCCC___2mbRd",footerWrap:"footerWrap___1Ytvb",qrCode:"qrCode___2RFKG",a1:"a1___HdrHw",code:"code___17cwA",group:"group___DUj4t",groupNumber:"groupNumber___3_2zt",a2:"a2___2_e5C"}},"rAM+":function(pt,$e,G){"use strict";G.d($e,"a",function(){return K});var ee=G("Qw5x");function K(R,j){var m;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(m=Object(ee.a)(R))||j&&R&&typeof R.length=="number"){m&&(R=m);var _=0,F=function(){};return{s:F,n:function(){return _>=R.length?{done:!0}:{done:!1,value:R[_++]}},e:function(w){throw w},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=!0,A=!1,L;return{s:function(){m=R[Symbol.iterator]()},n:function(){var w=m.next();return P=w.done,w},e:function(w){A=!0,L=w},f:function(){try{!P&&m.return!=null&&m.return()}finally{if(A)throw L}}}}},rUJ1:function(pt,$e){const G=/[&<>"']/,ee=/[&<>"']/g,K=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,j={"&":"&","<":"<",">":">",'"':""","'":"'"},m=y=>j[y];function _(y,u){if(u){if(G.test(y))return y.replace(ee,m)}else if(K.test(y))return y.replace(R,m);return y}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function P(y){return y.replace(F,(u,d)=>(d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""))}const A=/(^|[^\[])\^/g;function L(y,u){y=y.source||y,u=u||"";const d={replace:(o,a)=>(a=a.source||a,a=a.replace(A,"$1"),y=y.replace(o,a),d),getRegex:()=>new RegExp(y,u)};return d}const C=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(y,u,d){if(y){let o;try{o=decodeURIComponent(P(d)).replace(C,"").toLowerCase()}catch(a){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}u&&!w.test(d)&&(d=s(u,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch(o){return null}return d}const O={},E=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(y,u){O[" "+y]||(E.test(y)?O[" "+y]=y+"/":O[" "+y]=v(y,"/",!0)),y=O[" "+y];const d=y.indexOf(":")===-1;return u.substring(0,2)==="//"?d?u:y.replace(p,"$1")+u:u.charAt(0)==="/"?d?u:y.replace(f,"$1")+u:y+u}const l={exec:function(){}};function c(y){let u=1,d,o;for(;u{let M=!1,U=g;for(;--U>=0&&T[U]==="\\";)M=!M;return M?"|":" |"}),o=d.split(/ \|/);let a=0;if(o.length>u)o.splice(u);else for(;o.length1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var x=c[0];if(_.isValidElement(x)&&Object(C.c)(x)){var v=x.ref;c[0]=_.cloneElement(x,{ref:Object(C.a)(v,this.setChildNode)})}return c.length===1?c[0]:c.map(function(h,S){return!_.isValidElement(h)||"key"in h&&h.key!==null?h:_.cloneElement(h,{key:"".concat(k,"-").concat(S)})})}}]),f}(_.Component);O.displayName="ResizeObserver",$e.a=O},ulZh:function(pt,$e,G){typeof window!="undefined"&&function(K,R){pt.exports=R()}(this,function(){return function(ee){var K={};function R(j){if(K[j])return K[j].exports;var m=K[j]={i:j,l:!1,exports:{}};return ee[j].call(m.exports,m,m.exports,R),m.l=!0,m.exports}return R.m=ee,R.c=K,R.d=function(j,m,_){R.o(j,m)||Object.defineProperty(j,m,{enumerable:!0,get:_})},R.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},R.t=function(j,m){if(m&1&&(j=R(j)),m&8)return j;if(m&4&&typeof j=="object"&&j&&j.__esModule)return j;var _=Object.create(null);if(R.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:j}),m&2&&typeof j!="string")for(var F in j)R.d(_,F,function(P){return j[P]}.bind(null,F));return _},R.n=function(j){var m=j&&j.__esModule?function(){return j.default}:function(){return j};return R.d(m,"a",m),m},R.o=function(j,m){return Object.prototype.hasOwnProperty.call(j,m)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,K,R){"use strict";var j=Object.prototype.hasOwnProperty,m="~";function _(){}Object.create&&(_.prototype=Object.create(null),new _().__proto__||(m=!1));function F(C,w,k){this.fn=C,this.context=w,this.once=k||!1}function P(C,w,k,O,E){if(typeof k!="function")throw new TypeError("The listener must be a function");var p=new F(k,O||C,E),f=m?m+w:w;return C._events[f]?C._events[f].fn?C._events[f]=[C._events[f],p]:C._events[f].push(p):(C._events[f]=p,C._eventsCount++),C}function A(C,w){--C._eventsCount===0?C._events=new _:delete C._events[w]}function L(){this._events=new _,this._eventsCount=0}L.prototype.eventNames=function(){var w=[],k,O;if(this._eventsCount===0)return w;for(O in k=this._events)j.call(k,O)&&w.push(m?O.slice(1):O);return Object.getOwnPropertySymbols?w.concat(Object.getOwnPropertySymbols(k)):w},L.prototype.listeners=function(w){var k=m?m+w:w,O=this._events[k];if(!O)return[];if(O.fn)return[O.fn];for(var E=0,p=O.length,f=new Array(p);E0},!1)}function C(w,k){for(var O={main:[k]},E={main:[]},p={main:{}};L(O);)for(var f=Object.keys(O),s=0;s=2*S/u||T<=U)return;var W=Number.POSITIVE_INFINITY,H;for(H=f.level-1;H>o;H--){var I=d[H].maxBitrate;if(W=S*I/(8*.8*g),W=T)return;var N=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+f.sn+(s?" part "+s.index:"")+" of level "+f.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+` Current BW estimate: `+(Object(j.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+T.toFixed(3)+` s Estimated load time for the next fragment: `+W.toFixed(3)+` s Time to underbuffer: `+U.toFixed(3)+" s"),l.nextLoadLevel=H,this.bwEstimator.sample(y,h.loaded),this.clearTimer(),f.loader&&(this.fragCurrent=this.partCurrent=null,f.loader.abort()),l.trigger(_.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:f,part:s,stats:h})},E.onFragLoaded=function(f,s){var l=s.frag,c=s.part;if(l.type===A.PlaylistLevelType.MAIN&&Object(j.isFiniteNumber)(l.sn)){var x=c?c.stats:l.stats,v=c?c.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var h=this.hls.levels[l.level],S=(h.loaded?h.loaded.bytes:0)+x.loaded,y=(h.loaded?h.loaded.duration:0)+v;h.loaded={bytes:S,duration:y},h.realBitrate=Math.round(8*S/y)}if(l.bitrateTest){var u={stats:x,frag:l,part:c,id:l.type};this.onFragBuffered(_.Events.FRAG_BUFFERED,u),l.bitrateTest=!1}}},E.onFragBuffered=function(f,s){var l=s.frag,c=s.part,x=c?c.stats:l.stats;if(x.aborted)return;if(l.type!==A.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var v=x.parsing.end-x.loading.start;this.bwEstimator.sample(v,x.loaded),x.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},E.onError=function(f,s){switch(s.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},E.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},E.getNextABRAutoLevel=function(){var f=this.fragCurrent,s=this.partCurrent,l=this.hls,c=l.maxAutoLevel,x=l.config,v=l.minAutoLevel,h=l.media,S=s?s.duration:f?f.duration:0,y=h?h.currentTime:0,u=h&&h.playbackRate!==0?Math.abs(h.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():x.abrEwmaDefaultEstimate,o=(F.BufferHelper.bufferInfo(h,y,x.maxBufferHole).end-y)/u,a=this.findBestLevel(d,v,c,o,x.abrBandWidthFactor,x.abrBandWidthUpFactor);if(a>=0)return a;L.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var b=S?Math.min(S,x.maxStarvationDelay):x.maxStarvationDelay,g=x.abrBandWidthFactor,T=x.abrBandWidthUpFactor;if(!o){var M=this.bitrateTestDelay;if(M){var U=S?Math.min(S,x.maxLoadingDelay):x.maxLoadingDelay;b=U-M,L.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),g=T=1}}return a=this.findBestLevel(d,v,c,o+b,g,T),Math.max(a,0)},E.findBestLevel=function(f,s,l,c,x,v){for(var h,S=this.fragCurrent,y=this.partCurrent,u=this.lastLoadedFragLevel,d=this.hls.levels,o=d[u],a=!!(o!=null&&(h=o.details)!==null&&h!==void 0&&h.live),b=o==null?void 0:o.codecSet,g=y?y.duration:S?S.duration:0,T=l;T>=s;T--){var M=d[T];if(!M||b&&M.codecSet!==b)continue;var U=M.details,W=(y?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||g,H=void 0;T<=u?H=x*f:H=v*f;var I=d[T].maxBitrate,N=I*W/H;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(H)+"/"+I+"/"+W+"/"+c+"/"+N),H>I&&(!N||a&&!this.bitrateTestDelay||N0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+a.toFixed(3)),this.state=m.State.IDLE):(this.loadedmetadata=!1,this.state=m.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},u.doTick=function(){switch(this.state){case m.State.IDLE:this.doTickIdle();break;case m.State.WAITING_TRACK:{var o,a=this.levels,b=this.trackId,g=a==null||((o=a[b])===null||o===void 0)?void 0:o.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=m.State.WAITING_INIT_PTS}break}case m.State.FRAG_LOADING_WAITING_RETRY:{var T,M=performance.now(),U=this.retryDate;(!U||M>=U||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=m.State.IDLE);break}case m.State.WAITING_INIT_PTS:{var W=this.waitingData;if(W){var H=W.frag,I=W.part,N=W.cache,z=W.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=m.State.FRAG_LOADING;var $=N.flush(),ae={frag:H,part:I,payload:$,networkDetails:null};this._handleFragmentLoadProgress(ae),z&&S.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),De=F.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),xe=Object(E.fragmentWithinToleranceTest)(De.end,this.config.maxFragLookUpTolerance,H);xe<0&&(s.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+De.end+" is needed"),this.clearWaitingFragment())}}else this.state=m.State.IDLE}}this.onTickEnd()},u.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=m.State.IDLE)},u.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var a=this.mediaBuffer?this.mediaBuffer:o,b=a.buffered;!this.loadedmetadata&&b.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},u.doTickIdle=function(){var o,a,b=this.hls,g=this.levels,T=this.media,M=this.trackId,U=b.config;if(!g||!g[M])return;if(!T&&(this.startFragRequested||!U.startFragPrefetch))return;var W=g[M],H=W.details;if(!H||H.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(H)){this.state=m.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,C.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(I===null)return;var N=I.len,z=this.getMaxBufferLength(),$=this.audioSwitch;if(N>=z&&!$)return;if(!$&&this._streamEnded(I,H)){b.trigger(_.Events.BUFFER_EOS,{type:"audio"}),this.state=m.State.ENDED;return}var ae=H.fragments,le=ae[0].start,De=I.end;if($){var xe=this.getLoadPosition();De=xe,H.PTSKnown&&xele||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=le+.05))}var Pe=this.getNextFragment(De,H);if(!Pe){this.bufferFlushed=!0;return}((o=Pe.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((a=Pe.decryptdata)!==null&&a!==void 0&&a.key)?this.loadKey(Pe,H):this.loadFragment(Pe,H,De)},u.getMaxBufferLength=function(){var o=S.prototype.getMaxBufferLength.call(this),a=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return a===null?o:Math.max(o,a.len)},u.onMediaDetaching=function(){this.videoBuffer=null,S.prototype.onMediaDetaching.call(this)},u.onAudioTracksUpdated=function(o,a){var b=a.audioTracks;this.resetTransmuxer(),this.levels=b.map(function(g){return new A.Level(g)})},u.onAudioTrackSwitching=function(o,a){var b=!!a.url;this.trackId=a.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),b?this.setInterval(v):this.resetTransmuxer(),b?(this.audioSwitch=!0,this.state=m.State.IDLE):this.state=m.State.STOPPED,this.tick()},u.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},u.onLevelLoaded=function(o,a){this.mainDetails=a.details},u.onAudioTrackLoaded=function(o,a){var b,g=this.levels,T=a.details,M=a.id;if(!g){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var U=g[M],W=0;if(T.live||(b=U.details)!==null&&b!==void 0&&b.live){var H=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!H)return;!U.details&&T.hasProgramDateTime&&H.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(T,H),W=T.fragments[0].start):W=this.alignPlaylists(T,U.details)}U.details=T,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(U.details,W),this.state===m.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=m.State.IDLE),this.tick()},u._handleFragmentLoadProgress=function(o){var a,b=o.frag,g=o.part,T=o.payload,M=this.config,U=this.trackId,W=this.levels;if(!W){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+b.sn+" of level "+b.level+" will not be buffered");return}var H=W[U];console.assert(H,"Audio track is defined on fragment load progress");var I=H.details;console.assert(I,"Audio track details are defined on fragment load progress");var N=M.defaultAudioCodec||H.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new k.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[b.cc],ae=(a=b.initSegment)===null||a===void 0?void 0:a.data;if($!==void 0){var le=!1,De=g?g.index:-1,xe=De!==-1,Pe=new O.ChunkMetadata(b.level,b.sn,b.stats.chunkCount,T.byteLength,De,xe);z.push(T,ae,N,"",b,g,I.totalduration,le,Pe,$)}else{s.logger.log("Unknown video PTS for cc "+b.cc+", waiting for video PTS before demuxing audio frag "+b.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+U);var Le=this.waitingData=this.waitingData||{frag:b,part:g,cache:new w.default,complete:!1},we=Le.cache;we.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=m.State.WAITING_INIT_PTS}},u._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}S.prototype._handleFragmentLoadComplete.call(this,o)},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(o,a){var b=a.tracks.audio;b&&(this.mediaBuffer=b.buffer),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},u.onFragBuffered=function(o,a){var b=a.frag,g=a.part;if(b.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(b)){this.warn("Fragment "+b.sn+(g?" p: "+g.index:"")+" of level "+b.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}b.sn!=="initSegment"&&(this.fragPrevious=b,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(b,g)},u.onError=function(o,a){switch(a.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,a);break;case f.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case f.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==m.State.ERROR&&this.state!==m.State.STOPPED&&(this.state=a.fatal?m.State.ERROR:m.State.IDLE,this.warn(a.details+" while loading frag, switching to "+this.state+" state"));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if(a.parent==="audio"&&(this.state===m.State.PARSING||this.state===m.State.PARSED)){var b=!0,g=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);g&&g.len>.5&&(b=!this.reduceMaxBufferLength(g.len)),b&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},u.onBufferFlushed=function(o,a){var b=a.type;b===C.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},u._handleTransmuxComplete=function(o){var a,b="audio",g=this.hls,T=o.remuxResult,M=o.chunkMeta,U=this.getCurrentContext(M);if(!U){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var W=U.frag,H=U.part,I=T.audio,N=T.text,z=T.id3,$=T.initSegment;if(this.fragContextChanged(W))return;if(this.state=m.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,W,M),g.trigger(_.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:b,tracks:$.tracks})),I){var ae=I.startPTS,le=I.endPTS,De=I.startDTS,xe=I.endDTS;H&&(H.elementaryStreams[C.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:le,startDTS:De,endDTS:xe}),W.setElementaryStreamInfo(C.ElementaryStreamTypes.AUDIO,ae,le,De,xe),this.bufferFragmentData(I,W,H,M)}if(z!=null&&(a=z.samples)!==null&&a!==void 0&&a.length){var Pe=l({frag:W,id:b},z);g.trigger(_.Events.FRAG_PARSING_METADATA,Pe)}if(N){var Le=l({frag:W,id:b},N);g.trigger(_.Events.FRAG_PARSING_USERDATA,Le)}},u._bufferInitSegment=function(o,a,b){if(this.state!==m.State.PARSING)return;o.video&&delete o.video;var g=o.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(_.Events.BUFFER_CODECS,o);var T=g.initSegment;if(T!=null&&T.byteLength){var M={type:"audio",frag:a,part:null,chunkMeta:b,parent:a.type,data:T};this.hls.trigger(_.Events.BUFFER_APPENDING,M)}this.tick()},u.loadFragment=function(o,a,b){var g=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||g===P.FragmentState.NOT_LOADED||g===P.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):a.live&&!Object(j.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=m.State.WAITING_INIT_PTS):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,o,a,b)))},u.completeAudioSwitch=function(){var o=this.hls,a=this.media,b=this.trackId;a&&(this.log("Switching audio track : flushing all audio"),S.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(_.Events.AUDIO_TRACK_SWITCHED,{id:b})},y}(m.default);K.default=h},"./src/controller/audio-track-controller.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/events.ts"),m=R("./src/errors.ts"),_=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function P(k,O){for(var E=0;E=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=s[this.trackId];this.log("Now switching to audio-track index "+f);var c=s[f],x=c.id,v=c.groupId,h=v===void 0?"":v,S=c.name,y=c.type,u=c.url;if(this.trackId=f,this.trackName=S,this.selectDefaultTrack=!1,this.hls.trigger(j.Events.AUDIO_TRACK_SWITCHING,{id:x,groupId:h,name:S,type:y,url:u}),c.details&&!c.details.live)return;var d=this.switchParams(c.url,l==null?void 0:l.details);this.loadPlaylist(d)},E.selectInitialTrack=function(){var f=this.tracksInGroup;console.assert(f.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,l=this.findTrackId(s)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},E.findTrackId=function(f){for(var s=this.tracksInGroup,l=0;lO.partTarget&&(c+=1)}if(Object(j.isFiniteNumber)(l))return new m.HlsUrlParameters(l,Object(j.isFiniteNumber)(c)?c:void 0,m.HlsSkip.No)}}},C.loadPlaylist=function(k){},C.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},C.playlistLoaded=function(k,O,E){var p=this,f=O.details,s=O.stats,l=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(f.advancedDateTime=Date.now()-l,f.live||E!=null&&E.live){if(f.reloaded(E),E&&this.log("live playlist "+k+" "+(f.advanced?"REFRESHED "+f.lastPartSn+"-"+f.lastPartIndex:"MISSED")),E&&f.fragments.length>0&&Object(_.mergeDetails)(E,f),!this.canLoad||!f.live)return;var c,x=void 0,v=void 0;if(f.canBlockReload&&f.endSN&&f.advanced){var h=this.hls.config.lowLatencyMode,S=f.lastPartSn,y=f.endSN,u=f.lastPartIndex,d=u!==-1,o=S===y,a=h?0:u;d?(x=o?y+1:S,v=o?a:u+1):x=y+1;var b=f.age,g=b+f.ageHeader,T=Math.min(g-f.partTarget,f.targetduration*1.5);if(T>0){if(E&&T>E.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+E.tuneInGoal+" to: "+T+" with playlist age: "+f.age),T=0;else{var M=Math.floor(T/f.targetduration);if(x+=M,v!==void 0){var U=Math.round(T%f.targetduration/f.partTarget);v+=U}this.log("CDN Tune-in age: "+f.ageHeader+"s last advanced "+b.toFixed(2)+"s goal: "+T+" skip sn "+M+" to part "+v)}f.tuneInGoal=T}if(c=this.getDeliveryDirectives(f,O.deliveryDirectives,x,v),h||!o){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(f,O.deliveryDirectives,x,v);var W=Object(_.computeReloadInterval)(f,s);x!==void 0&&f.canBlockReload&&(W-=f.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(c)},W)}else this.clearTimer()},C.getDeliveryDirectives=function(k,O,E,p){var f=Object(m.getSkipValue)(k,E);return O!=null&&O.skip&&k.deltaUpdateFailed&&(E=O.msn,p=O.part,f=m.HlsSkip.No),new m.HlsUrlParameters(E,p,f)},C.retryLoadingOrFail=function(k){var O=this,E=this.hls.config,p=this.retryCount-1&&(f=k.context)!==null&&f!==void 0&&f.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*E.levelLoadingRetryDelay,E.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return O.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return p},L}()},"./src/controller/base-stream-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"State",function(){return y}),R.d(K,"default",function(){return u});var j=R("./src/polyfills/number.ts"),m=R("./src/task-loop.ts"),_=R("./src/controller/fragment-tracker.ts"),F=R("./src/utils/buffer-helper.ts"),P=R("./src/utils/logger.ts"),A=R("./src/events.ts"),L=R("./src/errors.ts"),C=R("./src/types/transmuxer.ts"),w=R("./src/utils/mp4-tools.ts"),k=R("./src/utils/discontinuities.ts"),O=R("./src/controller/fragment-finders.ts"),E=R("./src/controller/level-helper.ts"),p=R("./src/loader/fragment-loader.ts"),f=R("./src/crypt/decrypter.ts"),s=R("./src/utils/time-ranges.ts"),l=R("./src/types/loader.ts");function c(d,o){for(var a=0;a$;(H0&&H&&H.key&&H.iv&&H.method==="AES-128"){var I=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(W),H.key.buffer,H.iv.buffer).then(function(N){var z=self.performance.now();return U.trigger(A.Events.FRAG_DECRYPTED,{frag:g,payload:N,stats:{tstart:I,tdecrypt:z}}),M.payload=N,M})}return M}).then(function(M){var U=T.fragCurrent,W=T.hls,H=T.levels;if(!H)throw new Error("init load aborted, missing levels");var I=H[g.level].details;console.assert(I,"Level details are defined when init segment is loaded");var N=g.stats;T.state=y.IDLE,T.fragLoadError=0,g.data=new Uint8Array(M.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),M.frag===U&&W.trigger(A.Events.FRAG_BUFFERED,{stats:N,frag:U,part:null,id:g.type}),T.tick()}).catch(function(M){T.warn(M),T.resetFragmentLoading(g)})},a.fragContextChanged=function(g){var T=this.fragCurrent;return!g||!T||g.level!==T.level||g.sn!==T.sn||g.urlId!==T.urlId},a.fragBufferedComplete=function(g,T){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+s.default.toString(F.BufferHelper.getBuffered(M))),this.state=y.IDLE,this.tick()},a._handleFragmentLoadComplete=function(g){var T=this.transmuxer;if(!T)return;var M=g.frag,U=g.part,W=g.partsLoaded,H=!W||W.length===0||W.some(function(N){return!N}),I=new C.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,U?U.index:-1,!H);T.flush(I)},a._handleFragmentLoadProgress=function(g){},a._doFragLoad=function(g,T,M,U){var W=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(g.start,M||0),this.config.lowLatencyMode&&T){var H=T.partList;if(H&&U){M>g.end&&T.fragmentHint&&(g=T.fragmentHint);var I=this.getNextPart(H,g,M);if(I>-1){var N=H[I];return this.log("Loading part sn: "+g.sn+" p: "+N.index+" cc: "+g.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+I+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=y.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:g,part:H[I],targetBufferTime:M}),this.doFragPartsLoad(g,H,I,U).catch(function(z){return W.handleFragLoadError(z)})}else if(!g.url||this.loadedEndOfParts(H,M))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),Object(j.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=y.FRAG_LOADING,this.hls.trigger(A.Events.FRAG_LOADING,{frag:g,targetBufferTime:M}),this.fragmentLoader.load(g,U).catch(function(z){return W.handleFragLoadError(z)})},a.doFragPartsLoad=function(g,T,M,U){var W=this;return new Promise(function(H,I){var N=[],z=function $(ae){var le=T[ae];W.fragmentLoader.loadPart(g,le,U).then(function(De){N[le.index]=De;var xe=De.part;W.hls.trigger(A.Events.FRAG_LOADED,De);var Pe=T[ae+1];if(Pe&&Pe.fragment===g)$(ae+1);else return H({frag:g,part:xe,partsLoaded:N})}).catch(I)};z(M)})},a.handleFragLoadError=function(g){var T=g.data;return T&&T.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(A.Events.ERROR,T),null},a._handleTransmuxerFlush=function(g){var T=this.getCurrentContext(g);if(!T||this.state!==y.PARSING){this.fragCurrent||(this.state=y.IDLE);return}var M=T.frag,U=T.part,W=T.level,H=self.performance.now();M.stats.parsing.end=H,U&&(U.stats.parsing.end=H),this.updateLevelTiming(M,U,W,g.partial)},a.getCurrentContext=function(g){var T=this.levels,M=g.level,U=g.sn,W=g.part;if(!T||!T[M])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+M+". The current chunk will not be buffered."),null;var H=T[M],I=W>-1?Object(E.getPartWith)(H,U,W):null,N=I?I.fragment:Object(E.getFragmentWithSN)(H,U,this.fragCurrent);return N?{frag:N,part:I,level:H}:null},a.bufferFragmentData=function(g,T,M,U){if(!g||this.state!==y.PARSING)return;var W=g.data1,H=g.data2,I=W;if(W&&H&&(I=Object(w.appendUint8Array)(W,H)),!I||!I.length)return;var N={type:g.type,frag:T,part:M,chunkMeta:U,parent:T.type,data:I};this.hls.trigger(A.Events.BUFFER_APPENDING,N),g.dropped&&g.independent&&!M&&this.flushBufferGap(T)},a.flushBufferGap=function(g){var T=this.media;if(!T)return;if(!F.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,g.start);return}var M=T.currentTime,U=F.BufferHelper.bufferInfo(T,M,0),W=g.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,W*.25),I=Math.max(Math.min(g.start-H,U.end-H),M+H);g.start-I>H&&this.flushMainBuffer(I,g.start)},a.getFwdBufferInfo=function(g,T){var M=this.config,U=this.getLoadPosition();if(!Object(j.isFiniteNumber)(U))return null;var W=F.BufferHelper.bufferInfo(g,U,M.maxBufferHole);if(W.len===0&&W.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(U,T);if(H&&W.nextStart=M?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},a.getNextFragment=function(g,T){var M,U,W=T.fragments,H=W.length;if(!H)return null;var I=this.config,N=W[0].start,z;if(T.live){var $=I.initialLiveManifestSize;if(H<$)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+$+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(T,W),this.startPosition=z?this.hls.liveSyncPosition||z.start:g)}else g<=N&&(z=W[0]);if(!z){var ae=I.lowLatencyMode?T.partEnd:T.fragmentEnd;z=this.getFragmentAtPosition(g,ae,T)}return(M=z)!==null&&M!==void 0&&M.initSegment&&!((U=z)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},a.getNextPart=function(g,T,M){for(var U=-1,W=!1,H=!0,I=0,N=g.length;I-1&&MM.start&&M.loaded},a.getInitialLiveFragment=function(g,T){var M=this.fragPrevious,U=null;if(M){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),U=Object(O.findFragmentByPDT)(T,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var W=M.sn+1;if(W>=g.startSN&&W<=g.endSN){var H=T[W-g.startSN];M.cc===H.cc&&(U=H,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(O.findFragWithCC)(T,M.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(U=this.getFragmentAtPosition(I,this.bitrateTest?g.fragmentEnd:g.edge,g))}return U},a.getFragmentAtPosition=function(g,T,M){var U=this.config,W=this.fragPrevious,H=M.fragments,I=M.endSN,N=M.fragmentHint,z=U.maxFragLookUpTolerance,$=!!(U.lowLatencyMode&&M.partList&&N);$&&N&&!this.bitrateTest&&(H=H.concat(N),I=N.sn);var ae;if(gT-z?0:z;ae=Object(O.findFragmentByPTS)(W,H,g,le)}else ae=H[H.length-1];if(ae){var De=ae.sn-M.startSN,xe=W&&ae.level===W.level,Pe=H[De+1],Le=this.fragmentTracker.getState(ae);if(Le===_.FragmentState.BACKTRACKED){ae=null;for(var we=De;H[we]&&this.fragmentTracker.getState(H[we])===_.FragmentState.BACKTRACKED;)W?ae=H[we--]:ae=H[--we];ae||(ae=Pe)}else W&&ae.sn===W.sn&&!$&&(xe&&(ae.sn=H-T.maxFragLookUpTolerance&&W<=I;if(U!==null&&M.duration>U&&(W"+g.startSN+" prev-sn: "+(W?W.sn:"na")+" fragments: "+I),ae}return N},a.waitForCdnTuneIn=function(g){var T=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*T)},a.setStartPosition=function(g,T){var M=this.startPosition;if(M"+g))}}]),o}(m.default)},"./src/controller/buffer-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return O});var j=R("./src/polyfills/number.ts"),m=R("./src/events.ts"),_=R("./src/utils/logger.ts"),F=R("./src/errors.ts"),P=R("./src/utils/buffer-helper.ts"),A=R("./src/utils/mediasource-helper.ts"),L=R("./src/loader/fragment.ts"),C=R("./src/controller/buffer-operation-queue.ts"),w=Object(A.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,O=function(){function E(f){var s=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 l=s.hls,c=s.media,x=s.mediaSource;_.logger.log("[buffer-controller]: Media source opened"),c&&(s.updateMediaElementDuration(),l.trigger(m.Events.MEDIA_ATTACHED,{media:c})),x&&x.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){_.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_.logger.log("[buffer-controller]: Media source ended")},this.hls=f,this._initSourceBuffer(),this.registerListeners()}var p=E.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var s=this.hls;s.on(m.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(m.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(m.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(m.Events.BUFFER_RESET,this.onBufferReset,this),s.on(m.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(m.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(m.Events.BUFFER_EOS,this.onBufferEos,this),s.on(m.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(m.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(m.Events.FRAG_PARSED,this.onFragParsed,this),s.on(m.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var s=this.hls;s.off(m.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(m.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(m.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(m.Events.BUFFER_RESET,this.onBufferReset,this),s.off(m.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(m.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(m.Events.BUFFER_EOS,this.onBufferEos,this),s.off(m.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(m.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(m.Events.FRAG_PARSED,this.onFragParsed,this),s.off(m.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new C.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(s,l){var c=2;(l.audio&&!l.video||!l.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,_.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(s,l){var c=this.media=l.media;if(c&&w){var x=this.mediaSource=new w;x.addEventListener("sourceopen",this._onMediaSourceOpen),x.addEventListener("sourceended",this._onMediaSourceEnded),x.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(x),this._objectUrl=c.src}},p.onMediaDetaching=function(){var s=this.media,l=this.mediaSource,c=this._objectUrl;if(l){if(_.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(x){_.logger.warn("[buffer-controller]: onMediaDetaching: "+x.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(c&&self.URL.revokeObjectURL(c),s.src===c?(s.removeAttribute("src"),s.load()):_.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(m.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(l){var c=s.sourceBuffer[l];try{c&&(s.removeBufferListeners(l),s.mediaSource&&s.mediaSource.removeSourceBuffer(c),s.sourceBuffer[l]=void 0)}catch(x){_.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",x)}}),this._initSourceBuffer()},p.onBufferCodecs=function(s,l){var c=this,x=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(v){if(x){var h=c.tracks[v];if(h&&typeof h.buffer.changeType=="function"){var S=l[v],y=S.codec,u=S.levelCodec,d=S.container,o=(h.levelCodec||h.codec).replace(k,"$1"),a=(u||y).replace(k,"$1");if(o!==a){var b=d+";codecs="+(u||y);c.appendChangeType(v,b)}}}else c.pendingTracks[v]=l[v]}),x)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(s,l){var c=this,x=this.operationQueue,v={execute:function(){var S=c.sourceBuffer[s];S&&(_.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+l),S.changeType(l)),x.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(S){_.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",S)}};x.append(v,s)},p.onBufferAppending=function(s,l){var c=this,x=this.hls,v=this.operationQueue,h=this.tracks,S=l.data,y=l.type,u=l.frag,d=l.part,o=l.chunkMeta,a=o.buffering[y],b=self.performance.now();a.start=b;var g=u.stats.buffering,T=d?d.stats.buffering:null;g.start===0&&(g.start=b),T&&T.start===0&&(T.start=b);var M=h.audio,U=y==="audio"&&o.id===1&&(M==null?void 0:M.container)==="audio/mpeg",W={execute:function(){if(a.executeStart=self.performance.now(),U){var I=c.sourceBuffer[y];if(I){var N=u.start-I.timestampOffset;Math.abs(N)>=.1&&(_.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+u.start+" (delta: "+N+") sn: "+u.sn+")"),I.timestampOffset=u.start)}}c.appendExecutor(S,y)},onStart:function(){},onComplete:function(){var I=self.performance.now();a.executeEnd=a.end=I,g.first===0&&(g.first=I),T&&T.first===0&&(T.first=I);var N=c.sourceBuffer,z={};for(var $ in N)z[$]=P.BufferHelper.getBuffered(N[$]);c.appendError=0,c.hls.trigger(m.Events.BUFFER_APPENDED,{type:y,frag:u,part:d,chunkMeta:o,parent:u.type,timeRanges:z})},onError:function(I){_.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",I);var N={type:F.ErrorTypes.MEDIA_ERROR,parent:u.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=F.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,N.details=F.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>x.config.appendErrorMaxRetry&&(_.logger.error("[buffer-controller]: Failed "+x.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),x.trigger(m.Events.ERROR,N)}};v.append(W,y)},p.onBufferFlushing=function(s,l){var c=this,x=this.operationQueue,v=function(S){return{execute:c.removeExecutor.bind(c,S,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(m.Events.BUFFER_FLUSHED,{type:S})},onError:function(u){_.logger.warn("[buffer-controller]: Failed to remove from "+S+" SourceBuffer",u)}}};l.type?x.append(v(l.type),l.type):this.getSourceBufferTypes().forEach(function(h){x.append(v(h),h)})},p.onFragParsed=function(s,l){var c=this,x=l.frag,v=l.part,h=[],S=v?v.elementaryStreams:x.elementaryStreams;S[L.ElementaryStreamTypes.AUDIOVIDEO]?h.push("audiovideo"):(S[L.ElementaryStreamTypes.AUDIO]&&h.push("audio"),S[L.ElementaryStreamTypes.VIDEO]&&h.push("video"));var y=function(){var d=self.performance.now();x.stats.buffering.end=d,v&&(v.stats.buffering.end=d);var o=v?v.stats:x.stats;c.hls.trigger(m.Events.FRAG_BUFFERED,{frag:x,part:v,stats:o,id:x.type})};h.length===0&&_.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+x.type+" level: "+x.level+" sn: "+x.sn),this.blockBuffers(y,h)},p.onFragChanged=function(s,l){this.flushBackBuffer()},p.onBufferEos=function(s,l){var c=this,x=this.getSourceBufferTypes().reduce(function(v,h){var S=c.sourceBuffer[h];return(!l.type||l.type===h)&&(S&&!S.ended&&(S.ended=!0,_.logger.log("[buffer-controller]: "+h+" sourceBuffer now EOS"))),v&&!!(!S||S.ended)},!0);x&&this.blockBuffers(function(){var v=c.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},p.onLevelUpdated=function(s,l){var c=l.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var s=this.hls,l=this.details,c=this.media,x=this.sourceBuffer;if(!c||l===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var h=l.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(j.isFiniteNumber)(h)||h<0)return;var S=c.currentTime,y=l.levelTargetDuration,u=Math.max(h,y),d=Math.floor(S/y)*y-u;v.forEach(function(o){var a=x[o];if(a){var b=P.BufferHelper.getBuffered(a);b.length>0&&d>b.start(0)&&(s.trigger(m.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),l.live&&s.trigger(m.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),s.trigger(m.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:o}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,l=this.hls,c=this.media,x=this.mediaSource,v=s.fragments[0].start+s.totalduration,h=c.duration,S=Object(j.isFiniteNumber)(x.duration)?x.duration:0;s.live&&l.config.liveDurationInfinity?(_.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),x.duration=Infinity,this.updateSeekableRange(s)):(v>S&&v>h||!Object(j.isFiniteNumber)(h))&&(_.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),x.duration=v)},p.updateSeekableRange=function(s){var l=this.mediaSource,c=s.fragments,x=c.length;if(x&&s.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var v=Math.max(0,c[0].start),h=Math.max(v,v+s.totalduration);l.setLiveSeekableRange(v,h)}},p.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,l=this.operationQueue,c=this.pendingTracks,x=Object.keys(c).length;if(x&&!s||x===2){this.createSourceBuffers(c),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(m.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(h){l.executeNext(h)})}},p.createSourceBuffers=function(s){var l=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var x=0;for(var v in s)if(!l[v]){var h=s[v];if(!h)throw Error("source buffer exists for track "+v+", however track does not");var S=h.levelCodec||h.codec,y=h.container+";codecs="+S;_.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var u=l[v]=c.addSourceBuffer(y),d=v;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[v]={buffer:u,codec:S,container:h.container,levelCodec:h.levelCodec,id:h.id},x++}catch(o){_.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(m.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:y})}}x&&this.hls.trigger(m.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(s){var l=this.operationQueue,c=l.current(s);c.onStart()},p._onSBUpdateEnd=function(s){var l=this.operationQueue,c=l.current(s);c.onComplete(),l.shiftAndExecuteNext(s)},p._onSBUpdateError=function(s,l){_.logger.error("[buffer-controller]: "+s+" SourceBuffer error",l),this.hls.trigger(m.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(s);c&&c.onError(l)},p.removeExecutor=function(s,l,c){var x=this.media,v=this.mediaSource,h=this.operationQueue,S=this.sourceBuffer,y=S[s];if(!x||!v||!y){_.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(s);return}var u=Object(j.isFiniteNumber)(x.duration)?x.duration:Infinity,d=Object(j.isFiniteNumber)(v.duration)?v.duration:Infinity,o=Math.max(0,l),a=Math.min(c,u,d);a>o?(_.logger.log("[buffer-controller]: Removing ["+o+","+a+"] from the "+s+" SourceBuffer"),console.assert(!y.updating,s+" sourceBuffer must not be updating"),y.remove(o,a)):h.shiftAndExecuteNext(s)},p.appendExecutor=function(s,l){var c=this.operationQueue,x=this.sourceBuffer,v=x[l];if(!v){_.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(l);return}v.ended=!1,console.assert(!v.updating,l+" sourceBuffer must not be updating"),v.appendBuffer(s)},p.blockBuffers=function(s,l){var c=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){_.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var x=this.operationQueue,v=l.map(function(h){return x.appendBlocker(h)});Promise.all(v).then(function(){s(),l.forEach(function(h){var S=c.sourceBuffer[h];(!S||!S.updating)&&x.shiftAndExecuteNext(h)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(s,l,c){var x=this.sourceBuffer[s];if(!x)return;var v=c.bind(this,s);this.listeners[s].push({event:l,listener:v}),x.addEventListener(l,v)},p.removeBufferListeners=function(s){var l=this.sourceBuffer[s];if(!l)return;this.listeners[s].forEach(function(c){l.removeEventListener(c.event,c.listener)})},E}()},"./src/controller/buffer-operation-queue.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return m});var j=R("./src/utils/logger.ts"),m=function(){function _(P){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=P}var F=_.prototype;return F.append=function(A,L){var C=this.queues[L];C.push(A),C.length===1&&this.buffers[L]&&this.executeNext(L)},F.insertAbort=function(A,L){var C=this.queues[L];C.unshift(A),this.executeNext(L)},F.appendBlocker=function(A){var L,C=new Promise(function(k){L=k}),w={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(w,A),C},F.executeNext=function(A){var L=this.buffers,C=this.queues,w=L[A],k=C[A];if(k.length){var O=k[0];try{O.execute()}catch(E){j.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),O.onError(E),(!w||!w.updating)&&(k.shift(),this.executeNext(A))}}},F.shiftAndExecuteNext=function(A){this.queues[A].shift(),this.executeNext(A)},F.current=function(A){return this.queues[A][0]},_}()},"./src/controller/cap-level-controller.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/events.ts");function m(P,A){for(var L=0;L0&&this.mediaWidth>0){var C=this.hls.levels;if(C.length){var w=this.hls;w.autoLevelCapping=this.getMaxLevel(C.length-1),w.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=w.autoLevelCapping}}},A.getMaxLevel=function(C){var w=this,k=this.hls.levels;if(!k.length)return-1;var O=k.filter(function(E,p){return P.isLevelAllowed(p,w.restrictedLevels)&&p<=C});return this.clientRect=null,P.getMaxLevelByMediaSize(O,this.mediaWidth,this.mediaHeight)},A.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()},A.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},A.getDimensions=function(){if(this.clientRect)return this.clientRect;var C=this.media,w={width:0,height:0};if(C){var k=C.getBoundingClientRect();w.width=k.width,w.height=k.height,!w.width&&!w.height&&(w.width=k.right-k.left||C.width||0,w.height=k.bottom-k.top||C.height||0)}return this.clientRect=w,w},P.isLevelAllowed=function(C,w){return w===void 0&&(w=[]),w.indexOf(C)===-1},P.getMaxLevelByMediaSize=function(C,w,k){if(!C||!C.length)return-1;for(var O=function(l,c){return c?l.width!==c.width||l.height!==c.height:!0},E=C.length-1,p=0;p=w||f.height>=k)&&O(f,C[p+1])){E=p;break}}return E},_(P,[{key:"mediaWidth",get:function(){return this.getDimensions().width*P.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*P.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var C=1;try{C=self.devicePixelRatio}catch(w){}return C}}]),P}();K.default=F},"./src/controller/cmcd-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return O});var j=R("./src/events.ts"),m=R("./src/types/cmcd.ts"),_=R("./src/utils/buffer-helper.ts"),F=R("./src/utils/logger.ts");function P(E,p){for(var f=0;f=E.length?{done:!0}:{done:!1,value:E[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C(E,p){if(!E)return;if(typeof E=="string")return w(E,p);var f=Object.prototype.toString.call(E).slice(8,-1);if(f==="Object"&&E.constructor&&(f=E.constructor.name),f==="Map"||f==="Set")return Array.from(E);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return w(E,p)}function w(E,p){(p==null||p>E.length)&&(p=E.length);for(var f=0,s=new Array(p);fl&&(l=h.bitrate)}return l>0?l:NaN},p.getBufferLength=function(s){var l=this.hls.media,c=s===m.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!l)return NaN;var x=_.BufferHelper.bufferInfo(c,l.currentTime,this.config.maxBufferHole);return x.len*1e3},p.createPlaylistLoader=function(){var s=this.config.pLoader,l=this.applyPlaylistData,c=s||this.config.loader;return function(){function x(h){this.loader=void 0,this.loader=new c(h)}var v=x.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(S,y,u){l(S),this.loader.load(S,y,u)},A(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},p.createFragmentLoader=function(){var s=this.config.fLoader,l=this.applyFragmentData,c=s||this.config.loader;return function(){function x(h){this.loader=void 0,this.loader=new c(h)}var v=x.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(S,y,u){l(S),this.loader.load(S,y,u)},A(x,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),x}()},E.uuid=function(){var s=URL.createObjectURL(new Blob),l=s.toString();return URL.revokeObjectURL(s),l.substr(l.lastIndexOf("/")+1)},E.serialize=function(s){for(var l=[],c=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},x=function(U){return Math.round(U)},v=function(U){return x(U/100)*100},h=function(U){return encodeURIComponent(U)},S={br:x,d:x,bl:v,dl:v,mtp:v,nor:h,rtp:v,tb:x},y=Object.keys(s||{}).sort(),u=L(y),d;!(d=u()).done;){var o=d.value,a=s[o];if(!c(a))continue;if(o==="v"&&a===1)continue;if(o=="pr"&&a===1)continue;var b=S[o];b&&(a=b(a));var g=typeof a,T=void 0;o==="ot"||o==="sf"||o==="st"?T=o+"="+a:g==="boolean"?T=o:g==="number"?T=o+"="+a:T=o+"="+JSON.stringify(a),l.push(T)}return l.join(",")},E.toHeaders=function(s){for(var l=Object.keys(s),c={},x=["Object","Request","Session","Status"],v=[{},{},{},{}],h={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},S=0,y=l;SL){this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var h=L-this._requestLicenseFailureCount+1;_.logger.warn("Retrying license request, "+h+" attempts left"),this._requestLicense(l,c)}break}},E._generateLicenseRequestChallenge=function(f,s){switch(f.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+f.mediaKeySystemDomain)},E._requestLicense=function(f,s){_.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){_.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(l.mediaKeySystemDomain),x=this._createLicenseXhr(c,f,s);_.logger.log("Sending license request to URL: "+c);var v=this._generateLicenseRequestChallenge(l,f);x.send(v)}catch(h){_.logger.error("Failure requesting DRM license: "+h),this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.KEY_SYSTEM_ERROR,details:m.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},E.onMediaAttached=function(f,s){if(!this._emeEnabled)return;var l=s.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},E.onMediaDetached=function(){var f=this._media,s=this._mediaKeysList;if(!f)return;f.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return f.setMediaKeys(null)}).catch(function(){})},E.onManifestParsed=function(f,s){if(!this._emeEnabled)return;var l=s.levels.map(function(x){return x.audioCodec}).filter(function(x){return!!x}),c=s.levels.map(function(x){return x.videoCodec}).filter(function(x){return!!x});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,l,c)},A(O,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),O}();K.default=k},"./src/controller/fps-controller.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/events.ts"),m=R("./src/utils/logger.ts"),_=function(){function F(A){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=A,this.registerListeners()}var P=F.prototype;return P.setStreamController=function(L){this.streamController=L},P.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},P.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching)},P.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},P.onMediaAttaching=function(L,C){var w=this.hls.config;if(w.capLevelOnFPSDrop){var k=C.media instanceof self.HTMLVideoElement?C.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),w.fpsDroppedMonitoringPeriod)}},P.checkFPS=function(L,C,w){var k=performance.now();if(C){if(this.lastTime){var O=k-this.lastTime,E=w-this.lastDroppedFrames,p=C-this.lastDecodedFrames,f=1e3*E/O,s=this.hls;if(s.trigger(j.Events.FPS_DROP,{currentDropped:E,currentDecoded:p,totalDroppedFrames:w}),f>0&&E>s.config.fpsDroppedMonitoringThreshold*p){var l=s.currentLevel;m.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=l)&&(l=l-1,s.trigger(j.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:s.currentLevel}),s.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=w,this.lastDecodedFrames=C}},P.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var C=L.getVideoPlaybackQuality();this.checkFPS(L,C.totalVideoFrames,C.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},F}();K.default=_},"./src/controller/fragment-finders.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"findFragmentByPDT",function(){return _}),R.d(K,"findFragmentByPTS",function(){return F}),R.d(K,"fragmentWithinToleranceTest",function(){return P}),R.d(K,"pdtWithinToleranceTest",function(){return A}),R.d(K,"findFragWithCC",function(){return L});var j=R("./src/polyfills/number.ts"),m=R("./src/utils/binary-search.ts");function _(C,w,k){if(w===null||!Array.isArray(C)||!C.length||!Object(j.isFiniteNumber)(w))return null;var O=C[0].programDateTime;if(w<(O||0))return null;var E=C[C.length-1].endProgramDateTime;if(w>=(E||0))return null;k=k||0;for(var p=0;pC&&k.start?-1:0}function A(C,w,k){var O=Math.min(w,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,E=k.endProgramDateTime||0;return E-O>C}function L(C,w){return m.default.search(C,function(k){return k.ccw?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"FragmentState",function(){return _}),R.d(K,"FragmentTracker",function(){return F});var j=R("./src/events.ts"),m=R("./src/types/loader.ts"),_;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(_||(_={}));var F=function(){function L(w){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=w,this._registerListeners()}var C=L.prototype;return C._registerListeners=function(){var k=this.hls;k.on(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(j.Events.FRAG_LOADED,this.onFragLoaded,this)},C._unregisterListeners=function(){var k=this.hls;k.off(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(j.Events.FRAG_LOADED,this.onFragLoaded,this)},C.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},C.getAppendedFrag=function(k,O){if(O===m.PlaylistLevelType.MAIN){var E=this.activeFragment,p=this.activeParts;if(!E)return null;if(p)for(var f=p.length;f--;){var s=p[f],l=s?s.end:E.appendedPTS;if(s.start<=k&&l!==void 0&&k<=l)return f>9&&(this.activeParts=p.slice(f-9)),s}else if(E.start<=k&&E.appendedPTS!==void 0&&k<=E.appendedPTS)return E}return this.getBufferedFrag(k,O)},C.getBufferedFrag=function(k,O){for(var E=this.fragments,p=Object.keys(E),f=p.length;f--;){var s=E[p[f]];if((s==null?void 0:s.body.type)===O&&s.buffered){var l=s.body;if(l.start<=k&&k<=l.end)return l}}return null},C.detectEvictedFragments=function(k,O,E){var p=this;Object.keys(this.fragments).forEach(function(f){var s=p.fragments[f];if(!s)return;if(!s.buffered){s.body.type===E&&p.removeFragment(s.body);return}var l=s.range[k];if(!l)return;l.time.some(function(c){var x=!p.isTimeBuffered(c.startPTS,c.endPTS,O);return x&&p.removeFragment(s.body),x})})},C.detectPartialFragments=function(k){var O=this,E=this.timeRanges,p=k.frag,f=k.part;if(!E||p.sn==="initSegment")return;var s=A(p),l=this.fragments[s];if(!l)return;Object.keys(E).forEach(function(c){var x=p.elementaryStreams[c];if(!x)return;var v=E[c],h=f!==null||x.partial===!0;l.range[c]=O.getBufferedTimes(p,f,h,v)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},C.fragBuffered=function(k){var O=A(k),E=this.fragments[O];E&&(E.backtrack=E.loaded=null,E.buffered=!0)},C.getBufferedTimes=function(k,O,E,p){for(var f={time:[],partial:E},s=O?O.start:k.start,l=O?O.end:k.end,c=k.minEndPTS||l,x=k.maxStartPTS||s,v=0;v=h&&c<=S){f.time.push({startPTS:Math.max(s,p.start(v)),endPTS:Math.min(l,p.end(v))});break}else if(sh)f.partial=!0,f.time.push({startPTS:Math.max(s,p.start(v)),endPTS:Math.min(l,p.end(v))});else if(l<=h)break}return f},C.getPartialFragment=function(k){var O=null,E,p,f,s=0,l=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(x){var v=c[x];if(!v)return;P(v)&&(p=v.body.start-l,f=v.body.end+l,k>=p&&k<=f&&(E=Math.min(k-p,f-k),s<=E&&(O=v.body,s=E)))}),O},C.getState=function(k){var O=A(k),E=this.fragments[O];return E?E.buffered?P(E)?_.PARTIAL:_.OK:E.backtrack?_.BACKTRACKED:_.APPENDING:_.NOT_LOADED},C.backtrack=function(k,O){var E=A(k),p=this.fragments[E];if(!p||p.backtrack)return null;var f=p.backtrack=O||p.loaded;return p.loaded=null,f},C.getBacktrackData=function(k){var O=A(k),E=this.fragments[O];if(E){var p,f=E.backtrack;if(f!=null&&(p=f.payload)!==null&&p!==void 0&&p.byteLength)return f;this.removeFragment(k)}return null},C.isTimeBuffered=function(k,O,E){for(var p,f,s=0;s=p&&O<=f)return!0;if(O<=p)return!1}return!1},C.onFragLoaded=function(k,O){var E=O.frag,p=O.part;if(E.sn==="initSegment"||E.bitrateTest||p)return;var f=A(E);this.fragments[f]={body:E,loaded:O,backtrack:null,buffered:!1,range:Object.create(null)}},C.onBufferAppended=function(k,O){var E=this,p=O.frag,f=O.part,s=O.timeRanges;if(p.type===m.PlaylistLevelType.MAIN)if(this.activeFragment=p,f){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(f)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(c){var x=s[c];if(E.detectEvictedFragments(c,x),!f)for(var v=0;vk&&p.removeFragment(l)}})},C.removeFragment=function(k){var O=A(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[O]},C.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function P(L){var C,w;return L.buffered&&(((C=L.range.video)===null||C===void 0?void 0:C.partial)||((w=L.range.audio)===null||w===void 0?void 0:w.partial))}function A(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"STALL_MINIMUM_DURATION_MS",function(){return P}),R.d(K,"MAX_START_GAP_JUMP",function(){return A}),R.d(K,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),R.d(K,"SKIP_BUFFER_RANGE_START",function(){return C}),R.d(K,"default",function(){return w});var j=R("./src/utils/buffer-helper.ts"),m=R("./src/errors.ts"),_=R("./src/events.ts"),F=R("./src/utils/logger.ts"),P=250,A=2,L=.1,C=.05,w=function(){function k(E,p,f,s){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=E,this.media=p,this.fragmentTracker=f,this.hls=s}var O=k.prototype;return O.destroy=function(){this.hls=this.fragmentTracker=this.media=null},O.poll=function(p){var f=this.config,s=this.media,l=this.stalled,c=s.currentTime,x=s.seeking,v=this.seeking&&!x,h=!this.seeking&&x;if(this.seeking=x,c!==p){if(this.moved=!0,l!==null){if(this.stallReported){var S=self.performance.now()-l;F.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(S)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((h||v)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!j.BufferHelper.getBuffered(s).length)return;var y=j.BufferHelper.bufferInfo(s,c,0),u=y.len>0,d=y.nextStart||0;if(!u&&!d)return;if(x){var o=y.len>A,a=!d||d-c>A&&!this.fragmentTracker.getPartialFragment(c);if(o||a)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var b,g=Math.max(d,y.start||0)-c,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=T==null||((b=T.details)===null||b===void 0)?void 0:b.live,U=M?T.details.targetduration*2:A;if(g>0&&g<=U){this._trySkipBufferHole(null);return}}var W=self.performance.now();if(l===null){this.stalled=W;return}var H=W-l;!x&&H>=P&&this._reportStall(y.len);var I=j.BufferHelper.bufferInfo(s,c,f.maxBufferHole);this._tryFixBufferStall(I,H)},O._tryFixBufferStall=function(p,f){var s=this.config,l=this.fragmentTracker,c=this.media,x=c.currentTime,v=l.getPartialFragment(x);if(v){var h=this._trySkipBufferHole(v);if(h)return}p.len>s.maxBufferHole&&f>s.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},O._reportStall=function(p){var f=this.hls,s=this.media,l=this.stallReported;l||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+p+")"),f.trigger(_.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},O._trySkipBufferHole=function(p){for(var f=this.config,s=this.hls,l=this.media,c=l.currentTime,x=0,v=j.BufferHelper.getBuffered(l),h=0;h=x&&c.05&&this.forwardBufferLength>1){var h=Math.min(2,Math.max(1,s)),S=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;k.playbackRate=Math.min(h,Math.max(1,S))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},C.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},C.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},P(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,O=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:O?k.liveMaxLatencyDurationCount*O.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var O=k.holdBack,E=k.partHoldBack,p=k.targetduration,f=this.config,s=f.liveSyncDuration,l=f.liveSyncDurationCount,c=f.lowLatencyMode,x=this.hls.userConfig,v=c&&E||O;(x.liveSyncDuration||x.liveSyncDurationCount||v===0)&&(v=s!==void 0?s:l*p);var h=p,S=1;return v+Math.min(this.stallCount*S,h)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),O=this.targetLatency,E=this.levelDetails;if(k===null||O===null||E===null)return null;var p=E.edge,f=k-O-this.edgeStalled,s=p-E.totalduration,l=p-(this.config.lowLatencyMode&&E.partTarget||E.targetduration);return Math.min(Math.max(s,f),l)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var O=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-O,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,O=this.levelDetails;if(!k||!O)return 0;var E=k.buffered.length;return E?k.buffered.end(E-1):O.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return f});var j=R("./src/types/level.ts"),m=R("./src/events.ts"),_=R("./src/errors.ts"),F=R("./src/utils/codecs.ts"),P=R("./src/controller/level-helper.ts"),A=R("./src/controller/base-playlist-controller.ts"),L=R("./src/types/loader.ts");function C(){return C=Object.assign||function(s){for(var l=1;l0){d=S[0].bitrate,S.sort(function(H,I){return H.bitrate-I.bitrate}),this._levels=S;for(var M=0;Mthis.hls.config.fragLoadingMaxRetry&&(o=h.frag.level)):o=h.frag.level}break;case _.ErrorDetails.LEVEL_LOAD_ERROR:case _.ErrorDetails.LEVEL_LOAD_TIMEOUT:S&&(S.deliveryDirectives&&(d=!1),o=S.level),u=!0;break;case _.ErrorDetails.REMUX_ALLOC_ERROR:o=h.level,u=!0;break}o!==void 0&&this.recoverLevel(h,o,u,d)},c.recoverLevel=function(v,h,S,y){var u=v.details,d=this._levels[h];if(d.loadError++,S){var o=this.retryLoadingOrFail(v);if(o)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(y){var a=d.url.length;if(a>1&&d.loadError1){var y=(h.urlId+1)%S;this.warn("Switching to redundant URL-id "+y),this._levels.forEach(function(u){u.urlId=y}),this.level=v}},c.onFragLoaded=function(v,h){var S=h.frag;if(S!==void 0&&S.type===L.PlaylistLevelType.MAIN){var y=this._levels[S.level];y!==void 0&&(y.fragmentError=0,y.loadError=0)}},c.onLevelLoaded=function(v,h){var S,y=h.level,u=h.details,d=this._levels[y];if(!d){var o;this.warn("Invalid level index "+y),(o=h.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(u.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(d.fragmentError===0&&(d.loadError=0,this.retryCount=0),this.playlistLoaded(y,h,d.details)):(S=h.deliveryDirectives)!==null&&S!==void 0&&S.skip&&(u.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(v,h){var S=this.hls.levels[this.currentLevelIndex];if(!S)return;if(S.audioGroupIds){for(var y=-1,u=this.hls.audioTracks[h.id].groupId,d=0;d0){var y=S.urlId,u=S.url[y];if(v)try{u=v.addDirectives(u)}catch(d){this.warn("Could not construct new URL with HLS Delivery Directives: "+d)}this.log("Attempt loading level index "+h+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+y+" "+u),this.clearTimer(),this.hls.trigger(m.Events.LEVEL_LOADING,{url:u,level:h,id:y,deliveryDirectives:v||null})}},c.removeLevel=function(v,h){var S=function(d,o){return o!==h},y=this._levels.filter(function(u,d){return d!==v?!0:u.url.length>1&&h!==void 0?(u.url=u.url.filter(S),u.audioGroupIds&&(u.audioGroupIds=u.audioGroupIds.filter(S)),u.textGroupIds&&(u.textGroupIds=u.textGroupIds.filter(S)),u.urlId=0,!0):!1}).map(function(u,d){var o=u.details;return o!=null&&o.fragments&&o.fragments.forEach(function(a){a.level=d}),u});this._levels=y,this.hls.trigger(m.Events.LEVELS_UPDATED,{levels:y})},k(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var h,S=this._levels;if(S.length===0)return;if(this.currentLevelIndex===v&&(h=S[v])!==null&&h!==void 0&&h.details)return;if(v<0||v>=S.length){var y=v<0;if(this.hls.trigger(m.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:y,reason:"invalid level idx"}),y)return;v=Math.min(v,S.length-1)}this.clearTimer();var u=this.currentLevelIndex,d=S[u],o=S[v];this.log("switching to level "+v+" from "+u),this.currentLevelIndex=v;var a=C({},o,{level:v,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete a._urlId,this.hls.trigger(m.Events.LEVEL_SWITCHING,a);var b=o.details;if(!b||b.live){var g=this.switchParams(o.uri,d==null?void 0:d.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),l}(A.default)},"./src/controller/level-helper.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"addGroupId",function(){return _}),R.d(K,"assignTrackIdsByGroup",function(){return F}),R.d(K,"updatePTS",function(){return P}),R.d(K,"updateFragPTSDTS",function(){return L}),R.d(K,"mergeDetails",function(){return C}),R.d(K,"mapPartIntersection",function(){return w}),R.d(K,"mapFragmentIntersection",function(){return k}),R.d(K,"adjustSliding",function(){return O}),R.d(K,"addSliding",function(){return E}),R.d(K,"computeReloadInterval",function(){return p}),R.d(K,"getFragmentWithSN",function(){return f}),R.d(K,"getPartWith",function(){return s});var j=R("./src/polyfills/number.ts"),m=R("./src/utils/logger.ts");function _(l,c,x){switch(c){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(x);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(x);break}}function F(l){var c={};l.forEach(function(x){var v=x.groupId||"";x.id=c[v]=c[v]||0,c[v]++})}function P(l,c,x){var v=l[c],h=l[x];A(v,h)}function A(l,c){var x=c.startPTS;if(Object(j.isFiniteNumber)(x)){var v=0,h;c.sn>l.sn?(v=x-l.start,h=l):(v=l.start-x,h=c),h.duration!==v&&(h.duration=v)}else if(c.sn>l.sn){var S=l.cc===c.cc;S&&l.minEndPTS?c.start=l.start+(l.minEndPTS-l.start):c.start=l.start+l.duration}else c.start=Math.max(l.start-c.duration,0)}function L(l,c,x,v,h,S){var y=v-x;y<=0&&(m.logger.warn("Fragment should have a positive duration",c),v=x+c.duration,S=h+c.duration);var u=x,d=v,o=c.startPTS,a=c.endPTS;if(Object(j.isFiniteNumber)(o)){var b=Math.abs(o-x);Object(j.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(b,c.deltaPTS):c.deltaPTS=b,u=Math.max(x,o),x=Math.min(x,o),h=Math.min(h,c.startDTS),d=Math.min(v,a),v=Math.max(v,a),S=Math.max(S,c.endDTS)}c.duration=v-x;var g=x-c.start;c.appendedPTS=v,c.start=c.startPTS=x,c.maxStartPTS=u,c.startDTS=h,c.endPTS=v,c.minEndPTS=d,c.endDTS=S;var T=c.sn;if(!l||Tl.endSN)return 0;var M,U=T-l.startSN,W=l.fragments;for(W[U]=c,M=U;M>0;M--)A(W[M],W[M-1]);for(M=U;M=0;h--){var S=v[h].initSegment;if(S){x=S;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var y=0,u;if(k(l,c,function(M,U){M.relurl&&(y=M.cc-U.cc),Object(j.isFiniteNumber)(M.startPTS)&&Object(j.isFiniteNumber)(M.endPTS)&&(U.start=U.startPTS=M.startPTS,U.startDTS=M.startDTS,U.appendedPTS=M.appendedPTS,U.maxStartPTS=M.maxStartPTS,U.endPTS=M.endPTS,U.endDTS=M.endDTS,U.minEndPTS=M.minEndPTS,U.duration=M.endPTS-M.startPTS,U.duration&&(u=U),c.PTSKnown=c.alignedSliding=!0),U.elementaryStreams=M.elementaryStreams,U.loader=M.loader,U.stats=M.stats,U.urlId=M.urlId,M.initSegment&&(U.initSegment=M.initSegment,x=M.initSegment)}),x){var d=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;d.forEach(function(M){var U;(!M.initSegment||M.initSegment.relurl===((U=x)===null||U===void 0?void 0:U.relurl))&&(M.initSegment=x)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(M){return!M}),c.deltaUpdateFailed)){m.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=c.skippedSegments;o--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var a=c.fragments;if(y){m.logger.warn("discontinuity sliding from playlist, take drift into account");for(var b=0;b=v.length)return;E(c,v[x].start)}function E(l,c){if(c){for(var x=l.fragments,v=l.skippedSegments;v0&&h0&&d===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),d=o),this.state=m.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()}else this._forceStartLoad=!0,this.state=m.State.STOPPED},y.stopLoad=function(){this._forceStartLoad=!1,h.prototype.stopLoad.call(this)},y.doTick=function(){switch(this.state){case m.State.IDLE:this.doTickIdle();break;case m.State.WAITING_LEVEL:{var d,o=this.levels,a=this.level,b=o==null||((d=o[a])===null||d===void 0)?void 0:d.details;if(b&&(!b.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(b))break;this.state=m.State.IDLE;break}break}case m.State.FRAG_LOADING_WAITING_RETRY:{var g,T=self.performance.now(),M=this.retryDate;(!M||T>=M||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=m.State.IDLE)}break;default:break}this.onTickEnd()},y.onTickEnd=function(){h.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},y.doTickIdle=function(){var d,o,a=this.hls,b=this.levelLastLoaded,g=this.levels,T=this.media,M=a.config,U=a.nextLoadLevel;if(b===null||!T&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[U])return;var W=g[U];this.level=a.nextLoadLevel=U;var H=W.details;if(!H||this.state===m.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==U){this.state=m.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,L.PlaylistLevelType.MAIN);if(I===null)return;var N=I.len,z=this.getMaxBufferLength(W.maxBitrate);if(N>=z)return;if(this._streamEnded(I,H)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,$),this.state=m.State.ENDED;return}var ae=I.end,le=this.getNextFragment(ae,H);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var De=le.sn-H.startSN;De>1&&(le=H.fragments[De-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===A.FragmentState.OK&&this.nextLoadPosition>ae){var xe=this.audioOnly&&!this.altAudio?C.ElementaryStreamTypes.AUDIO:C.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,xe,L.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,H)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((d=le.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((o=le.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(le,H):this.loadFragment(le,H,ae)},y.loadFragment=function(d,o,a){var b,g=this.fragmentTracker.getState(d);if(this.fragCurrent=d,g===A.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(d);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else g=A.FragmentState.NOT_LOADED}g===A.FragmentState.NOT_LOADED||g===A.FragmentState.PARTIAL?d.sn==="initSegment"?this._loadInitSegment(d):this.bitrateTest?(d.bitrateTest=!0,this.log("Fragment "+d.sn+" of level "+d.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(d)):(this.startFragRequested=!0,h.prototype.loadFragment.call(this,d,o,a)):g===A.FragmentState.APPENDING?this.reduceMaxBufferLength(d.duration)&&this.fragmentTracker.removeFragment(d):((b=this.media)===null||b===void 0?void 0:b.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},y.getAppendedFrag=function(d){var o=this.fragmentTracker.getAppendedFrag(d,L.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},y.getBufferedFrag=function(d){return this.fragmentTracker.getBufferedFrag(d,L.PlaylistLevelType.MAIN)},y.followingBufferedFrag=function(d){return d?this.getBufferedFrag(d.end+.5):null},y.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},y.nextLevelSwitch=function(){var d=this.levels,o=this.media;if(o!=null&&o.readyState){var a,b=this.getAppendedFrag(o.currentTime);if(b&&b.start>1&&this.flushMainBuffer(0,b.start-1),!o.paused&&d){var g=this.hls.nextLoadLevel,T=d[g],M=this.fragLastKbps;M&&this.fragCurrent?a=this.fragCurrent.duration*T.maxBitrate/(1e3*M)+1:a=0}else a=0;var U=this.getBufferedFrag(o.currentTime+a);if(U){var W=this.followingBufferedFrag(U);if(W){this.abortCurrentFrag();var H=W.maxStartPTS?W.maxStartPTS:W.start,I=W.duration,N=Math.max(U.end,H+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},y.abortCurrentFrag=function(){var d=this.fragCurrent;this.fragCurrent=null,d!=null&&d.loader&&d.loader.abort(),this.state===m.State.KEY_LOADING&&(this.state=m.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},y.flushMainBuffer=function(d,o){h.prototype.flushMainBuffer.call(this,d,o,this.altAudio?"video":null)},y.onMediaAttached=function(d,o){h.prototype.onMediaAttached.call(this,d,o);var a=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new O.default(this.config,a,this.fragmentTracker,this.hls)},y.onMediaDetaching=function(){var d=this.media;d&&(d.removeEventListener("playing",this.onvplaying),d.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),h.prototype.onMediaDetaching.call(this)},y.onMediaPlaying=function(){this.tick()},y.onMediaSeeked=function(){var d=this.media,o=d?d.currentTime:null;Object(j.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},y.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},y.onManifestParsed=function(d,o){var a=!1,b=!1,g;o.levels.forEach(function(T){g=T.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(a=!0),g.indexOf("mp4a.40.5")!==-1&&(b=!0))}),this.audioCodecSwitch=a&&b&&!Object(_.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},y.onLevelLoading=function(d,o){var a=this.levels;if(!a||this.state!==m.State.IDLE)return;var b=a[o.level];(!b.details||b.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(b.details))&&(this.state=m.State.WAITING_LEVEL)},y.onLevelLoaded=function(d,o){var a,b=this.levels,g=o.level,T=o.details,M=T.totalduration;if(!b){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+M);var U=this.fragCurrent;U&&(this.state===m.State.FRAG_LOADING||this.state===m.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==o.level&&U.loader&&(this.state=m.State.IDLE,U.loader.abort()));var W=b[g],H=0;if(T.live||(a=W.details)!==null&&a!==void 0&&a.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;H=this.alignPlaylists(T,W.details)}if(W.details=T,this.levelLastLoaded=g,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:T,level:g}),this.state===m.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=m.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,H),this.tick()},y._handleFragmentLoadProgress=function(d){var o,a=d.frag,b=d.part,g=d.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+a.sn+" of level "+a.level+" will not be buffered");return}var M=T[a.level],U=M.details;if(!U){this.warn("Dropping fragment "+a.sn+" of level "+a.level+" after level details were reset");return}var W=M.videoCodec,H=U.PTSKnown||!U.live,I=(o=a.initSegment)===null||o===void 0?void 0:o.data,N=this._getAudioCodec(M),z=this.transmuxer=this.transmuxer||new w.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=b?b.index:-1,ae=$!==-1,le=new k.ChunkMetadata(a.level,a.sn,a.stats.chunkCount,g.byteLength,$,ae),De=this.initPTS[a.cc];z.push(g,I,N,W,a,b,U.totalduration,H,le,De)},y.onAudioTrackSwitching=function(d,o){var a=this.altAudio,b=!!o.url,g=o.id;if(!b){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;a&&M.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:g})}},y.onAudioTrackSwitched=function(d,o){var a=o.id,b=!!this.hls.audioTracks[a].url;if(b){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=b,this.tick()},y.onBufferCreated=function(d,o){var a=o.tracks,b,g,T=!1;for(var M in a){var U=a[M];if(U.id==="main"){if(g=M,b=U,M==="video"){var W=a[M];W&&(this.videoBuffer=W.buffer)}}else T=!0}T&&b?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=b.buffer):this.mediaBuffer=this.media},y.onFragBuffered=function(d,o){var a=o.frag,b=o.part;if(a&&a.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(a)){this.warn("Fragment "+a.sn+(b?" p: "+b.index:"")+" of level "+a.level+" finished buffering, but was aborted. state: "+this.state),this.state===m.State.PARSED&&(this.state=m.State.IDLE);return}var g=b?b.stats:a.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),a.sn!=="initSegment"&&(this.fragPrevious=a),this.fragBufferedComplete(a,b)},y.onError=function(d,o){switch(o.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:case E.ErrorDetails.KEY_LOAD_ERROR:case E.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,o);break;case E.ErrorDetails.LEVEL_LOAD_ERROR:case E.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==m.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=m.State.ERROR):!o.levelRetry&&this.state===m.State.WAITING_LEVEL&&(this.state=m.State.IDLE));break;case E.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===m.State.PARSING||this.state===m.State.PARSED)){var a=!0,b=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);b&&b.len>.5&&(a=!this.reduceMaxBufferLength(b.len)),a&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},y.checkBuffer=function(){var d=this.media,o=this.gapController;if(!d||!o||!d.readyState)return;var a=P.BufferHelper.getBuffered(d);!this.loadedmetadata&&a.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=d.currentTime},y.onFragLoadEmergencyAborted=function(){this.state=m.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},y.onBufferFlushed=function(d,o){var a=o.type;if(a!==C.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var b=(a===C.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(b,a,L.PlaylistLevelType.MAIN)}},y.onLevelsUpdated=function(d,o){this.levels=o.levels},y.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},y.seekToStartPos=function(){var d=this.media,o=d.currentTime,a=this.startPosition;if(a>=0&&o0&&(T1&&d.seeking===!1){var a=d.currentTime;if(P.BufferHelper.isBuffered(d,a)?o=this.getAppendedFrag(a):P.BufferHelper.isBuffered(d,a+.1)&&(o=this.getAppendedFrag(a+.1)),o){var b=this.fragPlaying,g=o.level;(!b||o.sn!==b.sn||b.level!==g||o.urlId!==b.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:o}),(!b||b.level!==g)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=o)}}},s(S,[{key:"nextLevel",get:function(){var d=this.nextBufferedFrag;return d?d.level:-1}},{key:"currentLevel",get:function(){var d=this.media;if(d){var o=this.getAppendedFrag(d.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var d=this.media;if(d){var o=this.getAppendedFrag(d.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),S}(m.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"SubtitleStreamController",function(){return l});var j=R("./src/events.ts"),m=R("./src/utils/logger.ts"),_=R("./src/utils/buffer-helper.ts"),F=R("./src/controller/fragment-finders.ts"),P=R("./src/utils/discontinuities.ts"),A=R("./src/controller/level-helper.ts"),L=R("./src/controller/fragment-tracker.ts"),C=R("./src/controller/base-stream-controller.ts"),w=R("./src/types/loader.ts"),k=R("./src/types/level.ts");function O(c,x){for(var v=0;v=o[g].start&&b<=o[g].end){a=o[g];break}var T=u.start+u.duration;a?a.end=T:(a={start:b,end:T},o.push(a)),this.fragmentTracker.fragBuffered(u)},v.onBufferFlushing=function(S,y){var u=y.startOffset,d=y.endOffset;if(u===0&&d!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,a=this.levels;if(!a.length||!a[o]||!a[o].details)return;var b=a[o].details,g=b.targetduration,T=d-g;if(T<=0)return;y.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(M){for(var U=0;U=b.length||o!==a||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,d.live||(u=g.details)!==null&&u!==void 0&&u.live){var T=this.mainDetails;if(d.deltaUpdateFailed||!T)return;var M=T.fragments[0];if(!g.details)d.hasProgramDateTime&&T.hasProgramDateTime?Object(P.alignMediaPlaylistByPDT)(d,T):M&&Object(A.addSliding)(d,M.start);else{var U=this.alignPlaylists(d,g.details);U===0&&M&&Object(A.addSliding)(d,M.start)}}if(g.details=d,this.levelLastLoaded=o,this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===C.State.IDLE){var W=Object(F.findFragmentByPTS)(null,d.fragments,this.media.currentTime,0);W||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},v._handleFragmentLoadComplete=function(S){var y=S.frag,u=S.payload,d=y.decryptdata,o=this.hls;if(this.fragContextChanged(y))return;if(u&&u.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(u),d.key.buffer,d.iv.buffer).then(function(b){var g=performance.now();o.trigger(j.Events.FRAG_DECRYPTED,{frag:y,payload:b,stats:{tstart:a,tdecrypt:g}})})}},v.doTick=function(){if(!this.media){this.state=C.State.IDLE;return}if(this.state===C.State.IDLE){var S,y=this.currentTrackId,u=this.levels;if(!u.length||!u[y]||!u[y].details)return;var d=u[y].details,o=d.targetduration,a=this.config,b=this.media,g=_.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,b.currentTime-o,a.maxBufferHole),T=g.end,M=g.len,U=this.getMaxBufferLength()+o;if(M>U)return;console.assert(d,"Subtitle track details are defined on idle subtitle stream controller tick");var W=d.fragments,H=W.length,I=d.edge,N,z=this.fragPrevious;if(T-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)},p.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},p.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 s=k(this.media.textTracks);s.forEach(function(l){Object(m.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(s,l){this.tracks=l.subtitleTracks},p.onSubtitleTrackLoaded=function(s,l){var c=l.id,x=l.details,v=this.trackId,h=this.tracksInGroup[v];if(!h){this.warn("Invalid subtitle track id "+c);return}var S=h.details;h.details=l.details,this.log("subtitle track "+c+" loaded ["+x.startSN+"-"+x.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,l,S))},p.onLevelLoading=function(s,l){this.switchLevel(l.level)},p.onLevelSwitching=function(s,l){this.switchLevel(l.level)},p.switchLevel=function(s){var l=this.hls.levels[s];if(!(l!=null&&l.textGroupIds))return;var c=l.textGroupIds[l.urlId];if(this.groupId!==c){var x=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(y){return!c||y.groupId===c});this.tracksInGroup=v;var h=this.findTrackId(x==null?void 0:x.name)||this.findTrackId();this.groupId=c;var S={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(j.Events.SUBTITLE_TRACKS_UPDATED,S),h!==-1&&this.setSubtitleTrack(h,x)}},p.findTrackId=function(s){for(var l=this.tracksInGroup,c=0;c=x.length)return;this.clearTimer();var v=x[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,v){var h=v.id,S=v.groupId,y=S===void 0?"":S,u=v.name,d=v.type,o=v.url;this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:h,groupId:y,name:u,type:d,url:o});var a=this.switchParams(v.url,l==null?void 0:l.details);this.loadPlaylist(a)}else this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:s})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,l=k(this.media.textTracks),c=0;c=0&&(d[0]=Math.min(d[0],x),d[1]=Math.max(d[1],v),y=!0,o/(v-x)>.5))return}if(y||S.push([x,v]),this.config.renderTextTracksNatively){var a=this.captionsTracks[c];this.Cues.newCue(a,x,v,h)}else{var b=this.Cues.newCue(null,x,v,h);this.hls.trigger(m.Events.CUES_PARSED,{type:"captions",cues:b,track:c})}},s.onInitPtsFound=function(c,x){var v=this,h=x.frag,S=x.id,y=x.initPTS,u=x.timescale,d=this.unparsedVttFrags;S==="main"&&(this.initPTS[h.cc]=y,this.timescale[h.cc]=u),d.length&&(this.unparsedVttFrags=[],d.forEach(function(o){v.onFragLoaded(m.Events.FRAG_LOADED,o)}))},s.getExistingTrack=function(c){var x=this.media;if(x)for(var v=0;v>>8^u&255^99,L[h]=u,C[u]=h;var d=v[h],o=v[d],a=v[o],b=v[u]*257^u*16843008;k[h]=b<<24|b>>>8,O[h]=b<<16|b>>>16,E[h]=b<<8|b>>>24,p[h]=b,b=a*16843009^o*65537^d*257^h*16843008,s[u]=b<<24|b>>>8,l[u]=b<<16|b>>>16,c[u]=b<<8|b>>>24,x[u]=b,h?(h=d^v[v[v[a^d]]],S^=v[v[S]]):h=S=1}},P.expandKey=function(L){for(var C=this.uint8ArrayToUint32Array_(L),w=!0,k=0;k>>6)+1;var b=(c[x+2]&60)>>>2;if(b>a.length-1){l.trigger(_.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b});return}return y=(c[x+2]&1)<<2,y|=(c[x+3]&192)>>>6,j.logger.log("manifest codec:"+v+", ADTS type:"+h+", samplingIndex:"+b),/firefox/i.test(d)?b>=6?(h=5,u=new Array(4),S=b-3):(h=2,u=new Array(2),S=b):d.indexOf("android")!==-1?(h=2,u=new Array(2),S=b):(h=5,u=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&b>=6?S=b-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(b>=6&&y===1||/vivaldi/i.test(d))||!v&&y===1)&&(h=2,u=new Array(2)),S=b)),u[0]=h<<3,u[0]|=(b&14)>>1,u[1]|=(b&1)<<7,u[1]|=y<<3,h===5&&(u[1]|=(S&14)>>1,u[2]=(S&1)<<7,u[2]|=2<<2,u[3]=0),{config:u,samplerate:a[b],channelCount:y,codec:"mp4a.40."+h,manifestCodec:o}}function P(l,c){return l[c]===255&&(l[c+1]&246)===240}function A(l,c){return l[c+1]&1?7:9}function L(l,c){return(l[c+3]&3)<<11|l[c+4]<<3|(l[c+5]&224)>>>5}function C(l,c){return c+5=l.length)return!1;var v=L(l,c);if(v<=x)return!1;var h=c+v;return h===l.length||w(l,h)}return!1}function E(l,c,x,v,h){if(!l.samplerate){var S=F(c,x,v,h);if(!S)return;l.config=S.config,l.samplerate=S.samplerate,l.channelCount=S.channelCount,l.codec=S.codec,l.manifestCodec=S.manifestCodec,j.logger.log("parsed codec:"+l.codec+", rate:"+S.samplerate+", channels:"+S.channelCount)}}function p(l){return 1024*9e4/l}function f(l,c,x,v,h){var S=A(l,c),y=L(l,c);if(y-=S,y>0){var u=x+v*h;return{headerLength:S,frameLength:y,stamp:u}}}function s(l,c,x,v,h){var S=p(l.samplerate),y=f(c,x,v,h,S);if(y){var u=y.frameLength,d=y.headerLength,o=y.stamp,a=d+u,b=Math.max(0,x+a-c.length),g;b?(g=new Uint8Array(a-d),g.set(c.subarray(x+d,c.length),0)):g=c.subarray(x+d,x+a);var T={unit:g,pts:o};return b||l.samples.push(T),{sample:T,length:a,missing:b}}}},"./src/demux/base-audio-demuxer.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"initPTSFn",function(){return L});var j=R("./src/polyfills/number.ts"),m=R("./src/demux/id3.ts"),_=R("./src/demux/dummy-demuxed-track.ts"),F=R("./src/utils/mp4-tools.ts"),P=R("./src/utils/typed-array.ts"),A=function(){function C(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var w=C.prototype;return w.resetInitSegment=function(O,E,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},w.resetTimeStamp=function(){},w.resetContiguity=function(){},w.canParse=function(O,E){return!1},w.appendFrame=function(O,E,p){},w.demux=function(O,E){this.cachedData&&(O=Object(F.appendUint8Array)(this.cachedData,O),this.cachedData=null);var p=m.getID3Data(O,0),f=p?p.length:0,s,l,c=this._audioTrack,x=this._id3Track,v=p?m.getTimeStamp(p):void 0,h=O.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(v,E)),p&&p.length>0&&x.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),l=this.initPTS;fA?(this.word<<=A,this.bitsAvailable-=A):(A-=this.bitsAvailable,L=A>>3,A-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=A,this.bitsAvailable-=A)},F.readBits=function(A){var L=Math.min(this.bitsAvailable,A),C=this.word>>>32-L;return A>32&&j.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=A-L,L>0&&this.bitsAvailable?C<>>A)!==0)return this.word<<=A,this.bitsAvailable-=A,A;return this.loadWord(),A+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var A=this.skipLZ();return this.readBits(A+1)-1},F.readEG=function(){var A=this.readUEG();return 1&A?1+A>>>1:-1*(A>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(A){for(var L=8,C=8,w,k=0;k0?h.subarray(y,y+u):void 0},F=function(h,S){var y=0;return y=(h[S]&127)<<21,y|=(h[S+1]&127)<<14,y|=(h[S+2]&127)<<7,y|=h[S+3]&127,y},P=function(h,S){return j(h,S)&&F(h,S+6)+10<=h.length-S},A=function(h){for(var S=w(h),y=0;y>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(a);break;case 12:case 13:b=h[M++],T+=String.fromCharCode((a&31)<<6|b&63);break;case 14:b=h[M++],g=h[M++],T+=String.fromCharCode((a&15)<<12|(b&63)<<6|(g&63)<<0);break;default:}}return T},l={decodeTextFrame:E},c;function x(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/demux/base-audio-demuxer.ts"),m=R("./src/demux/id3.ts"),_=R("./src/utils/logger.ts"),F=R("./src/demux/mpegaudio.ts");function P(C,w){C.prototype=Object.create(w.prototype),C.prototype.constructor=C,A(C,w)}function A(C,w){return A=Object.setPrototypeOf||function(O,E){return O.__proto__=E,O},A(C,w)}var L=function(C){P(w,C);function w(){return C.apply(this,arguments)||this}var k=w.prototype;return k.resetInitSegment=function(E,p,f){C.prototype.resetInitSegment.call(this,E,p,f),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:E,duration:f,inputTimeScale:9e4,dropped:0}},w.probe=function(E){if(!E)return!1;for(var p=m.getID3Data(E,0)||[],f=p.length,s=E.length;f0},P.demux=function(L){var C=L,w=Object(m.dummyTrack)();if(this.config.progressive){this.remainderData&&(C=Object(j.appendUint8Array)(this.remainderData,L));var k=Object(j.segmentValidRange)(C);this.remainderData=k.remainder,w.samples=k.valid||new Uint8Array}else w.samples=C;return{audioTrack:Object(m.dummyTrack)(),avcTrack:w,id3Track:Object(m.dummyTrack)(),textTrack:Object(m.dummyTrack)()}},P.flush=function(){var L=Object(m.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(m.dummyTrack)(),avcTrack:L,id3Track:Object(m.dummyTrack)(),textTrack:Object(m.dummyTrack)()}},P.demuxSampleAes=function(L,C,w){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},P.destroy=function(){},F}();_.minProbeByteLength=1024,K.default=_},"./src/demux/mpegaudio.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"appendFrame",function(){return A}),R.d(K,"parseHeader",function(){return L}),R.d(K,"isHeaderPattern",function(){return C}),R.d(K,"isHeader",function(){return w}),R.d(K,"canParse",function(){return k}),R.d(K,"probe",function(){return O});var j=null,m=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],_=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],P=[0,1,1,4];function A(E,p,f,s,l){if(f+24>p.length)return;var c=L(p,f);if(c&&f+c.frameLength<=p.length){var x=c.samplesPerFrame*9e4/c.sampleRate,v=s+l*x,h={unit:p.subarray(f,f+c.frameLength),pts:v,dts:v};return E.config=[],E.channelCount=c.channelCount,E.samplerate=c.sampleRate,E.samples.push(h),{sample:h,length:c.frameLength,missing:0}}}function L(E,p){var f=E[p+1]>>3&3,s=E[p+1]>>1&3,l=E[p+2]>>4&15,c=E[p+2]>>2&3;if(f!==1&&l!==0&&l!==15&&c!==3){var x=E[p+2]>>1&1,v=E[p+3]>>6,h=f===3?3-s:s===3?3:4,S=m[h*14+l-1]*1e3,y=f===3?0:f===2?1:2,u=_[y*3+c],d=v===3?1:2,o=F[f][s],a=P[s],b=o*8*a,g=Math.floor(o*S/u+x)*a;if(j===null){var T=navigator.userAgent||"",M=T.match(/Chrome\/(\d+)/i);j=M?parseInt(M[1]):0}var U=!!j&&j<=87;return U&&s===2&&S>=224e3&&v===0&&(E[p+3]=E[p+3]|128),{sampleRate:u,channelCount:d,frameLength:g,samplesPerFrame:b}}}function C(E,p){return E[p]===255&&(E[p+1]&224)===224&&(E[p+1]&6)!==0}function w(E,p){return p+1=L.length){w();return}if(L[C].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(L,C,w,k),!k)return}},P.getAvcEncryptedData=function(L){for(var C=Math.floor((L.length-48)/160)*16+16,w=new Int8Array(C),k=0,O=32;O<=L.length-16;O+=160,k+=16)w.set(L.subarray(O,O+16),k);return w},P.getAvcDecryptedUnit=function(L,C){for(var w=new Uint8Array(C),k=0,O=32;O<=L.length-16;O+=160,k+=16)L.set(w.subarray(k,k+16),O);return L},P.decryptAvcSample=function(L,C,w,k,O,E){var p=Object(m.discardEPB)(O.data),f=this.getAvcEncryptedData(p),s=this;this.decryptBuffer(f.buffer,function(l){O.data=s.getAvcDecryptedUnit(p,l),E||s.decryptAvcSamples(L,C,w+1,k)})},P.decryptAvcSamples=function(L,C,w,k){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;C++,w=0){if(C>=L.length){k();return}for(var O=L[C].units;!(w>=O.length);w++){var E=O[w];if(E.data.length<=48||E.type!==1&&E.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(L,C,w,k,E,p),!p)return}}},F}();K.default=_},"./src/demux/transmuxer-interface.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return O});var j=R("./node_modules/webworkify-webpack/index.js"),m=R.n(j),_=R("./src/events.ts"),F=R("./src/demux/transmuxer.ts"),P=R("./src/utils/logger.ts"),A=R("./src/errors.ts"),L=R("./src/utils/mediasource-helper.ts"),C=R("./node_modules/eventemitter3/index.js"),w=R.n(C),k=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},O=function(){function E(f,s,l,c){var x=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=f,this.id=s,this.onTransmuxComplete=l,this.onFlush=c;var v=f.config,h=function(o,a){a=a||{},a.frag=x.frag,a.id=x.id,f.trigger(o,a)};this.observer=new C.EventEmitter,this.observer.on(_.Events.FRAG_DECRYPTED,h),this.observer.on(_.Events.ERROR,h);var S={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},y=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){P.logger.log("demuxing in webworker");var u;try{u=this.worker=j("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),u.addEventListener("message",this.onwmsg),u.onerror=function(d){f.trigger(_.Events.ERROR,{type:A.ErrorTypes.OTHER_ERROR,details:A.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(d.message+" ("+d.filename+":"+d.lineno+")")})},u.postMessage({cmd:"init",typeSupported:S,vendor:y,id:s,config:JSON.stringify(v)})}catch(d){P.logger.warn("Error in worker:",d),P.logger.error("Error while initializing DemuxerWorker, fallback to inline"),u&&self.URL.revokeObjectURL(u.objectURL),this.transmuxer=new F.default(this.observer,S,v,y,s),this.worker=null}}else this.transmuxer=new F.default(this.observer,S,v,y,s)}var p=E.prototype;return p.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},p.push=function(s,l,c,x,v,h,S,y,u,d){var o=this;u.transmuxing.start=self.performance.now();var a=this.transmuxer,b=this.worker,g=h?h.start:v.start,T=v.decryptdata,M=this.frag,U=!(M&&v.cc===M.cc),W=!(M&&u.level===M.level),H=M?u.sn-M.sn:-1,I=this.part?u.part-this.part.index:1,N=!W&&(H===1||H===0&&I===1),z=self.performance.now();(W||H||v.stats.parsing.start===0)&&(v.stats.parsing.start=z),h&&(I||!N)&&(h.stats.parsing.start=z);var $=new F.TransmuxState(U,N,y,W,g);if(!N||U){P.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+` discontinuity: `+U+` trackSwitch: `+W+` contiguous: `+N+` accurateTimeOffset: `+y+` timeOffset: `+g);var ae=new F.TransmuxConfig(c,x,l,S,d);this.configureTransmuxer(ae)}if(this.frag=v,this.part=h,b)b.postMessage({cmd:"demux",data:s,decryptdata:T,chunkMeta:u,state:$},s instanceof ArrayBuffer?[s]:[]);else if(a){var le=a.push(s,T,u,$);Object(F.isPromise)(le)?le.then(function(De){o.handleTransmuxComplete(De)}):this.handleTransmuxComplete(le)}},p.flush=function(s){var l=this;s.transmuxing.start=self.performance.now();var c=this.transmuxer,x=this.worker;if(x)x.postMessage({cmd:"flush",chunkMeta:s});else if(c){var v=c.flush(s);Object(F.isPromise)(v)?v.then(function(h){l.handleFlushResult(h,s)}):this.handleFlushResult(v,s)}},p.handleFlushResult=function(s,l){var c=this;s.forEach(function(x){c.handleTransmuxComplete(x)}),this.onFlush(l)},p.onWorkerMessage=function(s){var l=s.data,c=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,c.trigger(l.event,l.data);break}}},p.configureTransmuxer=function(s){var l=this.worker,c=this.transmuxer;l?l.postMessage({cmd:"configure",config:s}):c&&c.configure(s)},p.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},E}()},"./src/demux/transmuxer-worker.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return A});var j=R("./src/demux/transmuxer.ts"),m=R("./src/events.ts"),_=R("./src/utils/logger.ts"),F=R("./node_modules/eventemitter3/index.js"),P=R.n(F);function A(O){var E=new F.EventEmitter,p=function(s,l){O.postMessage({event:s,data:l})};E.on(m.Events.FRAG_DECRYPTED,p),E.on(m.Events.ERROR,p),O.addEventListener("message",function(f){var s=f.data;switch(s.cmd){case"init":{var l=JSON.parse(s.config);O.transmuxer=new j.default(E,s.typeSupported,l,s.vendor,s.id),Object(_.enableLogs)(l.debug),p("init",null);break}case"configure":{O.transmuxer.configure(s.config);break}case"demux":{var c=O.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(j.isPromise)(c)?c.then(function(h){L(O,h)}):L(O,c);break}case"flush":{var x=s.chunkMeta,v=O.transmuxer.flush(x);Object(j.isPromise)(v)?v.then(function(h){w(O,h,x)}):w(O,v,x);break}default:break}})}function L(O,E){if(k(E.remuxResult))return;var p=[],f=E.remuxResult,s=f.audio,l=f.video;s&&C(p,s),l&&C(p,l),O.postMessage({event:"transmuxComplete",data:E},p)}function C(O,E){E.data1&&O.push(E.data1.buffer),E.data2&&O.push(E.data2.buffer)}function w(O,E,p){E.forEach(function(f){L(O,f)}),O.postMessage({event:"flush",data:p})}function k(O){return!O.audio&&!O.video&&!O.text&&!O.id3&&!O.initSegment}},"./src/demux/transmuxer.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return l}),R.d(K,"isPromise",function(){return v}),R.d(K,"TransmuxConfig",function(){return h}),R.d(K,"TransmuxState",function(){return S});var j=R("./src/events.ts"),m=R("./src/errors.ts"),_=R("./src/crypt/decrypter.ts"),F=R("./src/demux/aacdemuxer.ts"),P=R("./src/demux/mp4demuxer.ts"),A=R("./src/demux/tsdemuxer.ts"),L=R("./src/demux/mp3demuxer.ts"),C=R("./src/remux/mp4-remuxer.ts"),w=R("./src/remux/passthrough-remuxer.ts"),k=R("./src/demux/chunk-cache.ts"),O=R("./src/utils/mp4-tools.ts"),E=R("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(y){E.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var f=[{demux:A.default,remux:C.default},{demux:P.default,remux:w.default},{demux:F.default,remux:C.default},{demux:L.default,remux:C.default}],s=1024;f.forEach(function(y){var u=y.demux;s=Math.max(s,u.minProbeByteLength)});var l=function(){function y(d,o,a,b,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new k.default,this.observer=d,this.typeSupported=o,this.config=a,this.vendor=b,this.id=g}var u=y.prototype;return u.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},u.push=function(o,a,b,g){var T=this,M=b.transmuxing;M.executeStart=p();var U=new Uint8Array(o),W=this.cache,H=this.config,I=this.currentTransmuxState,N=this.transmuxConfig;g&&(this.currentTransmuxState=g);var z=c(U,a);if(z&&z.method==="AES-128"){var $=this.getDecrypter();if(H.enableSoftwareAES){var ae=$.softwareDecrypt(U,z.key.buffer,z.iv.buffer);if(!ae)return M.executeEnd=p(),x(b);U=new Uint8Array(ae)}else return this.decryptionPromise=$.webCryptoDecrypt(U,z.key.buffer,z.iv.buffer).then(function(Ne){var Ge=T.push(Ne,null,b);return T.decryptionPromise=null,Ge}),this.decryptionPromise}var le=g||I,De=le.contiguous,xe=le.discontinuity,Pe=le.trackSwitch,Le=le.accurateTimeOffset,we=le.timeOffset,me=N.audioCodec,pe=N.videoCodec,Q=N.defaultInitPts,de=N.duration,te=N.initSegmentData;if((xe||Pe)&&this.resetInitSegment(te,me,pe,de),xe&&this.resetInitialTimestamp(Q),De||this.resetContiguity(),this.needsProbing(U,xe,Pe)){if(W.dataLength){var fe=W.flush();U=Object(O.appendUint8Array)(fe,U)}this.configureTransmuxer(U,N)}var Ae=this.transmux(U,z,we,Le,b),_e=this.currentTransmuxState;return _e.contiguous=!0,_e.discontinuity=!1,_e.trackSwitch=!1,M.executeEnd=p(),Ae},u.flush=function(o){var a=this,b=o.transmuxing;b.executeStart=p();var g=this.decrypter,T=this.cache,M=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return a.flush(o)});var W=[],H=M.timeOffset;if(g){var I=g.flush();I&&W.push(this.push(I,null,o))}var N=T.dataLength;T.reset();var z=this.demuxer,$=this.remuxer;if(!z||!$)return N>=s&&this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),b.executeEnd=p(),[x(o)];var ae=z.flush(H);return v(ae)?ae.then(function(le){return a.flushRemux(W,le,o),W}):(this.flushRemux(W,ae,o),W)},u.flushRemux=function(o,a,b){var g=a.audioTrack,T=a.avcTrack,M=a.id3Track,U=a.textTrack,W=this.currentTransmuxState,H=W.accurateTimeOffset,I=W.timeOffset;E.logger.log("[transmuxer.ts]: Flushed fragment "+b.sn+(b.part>-1?" p: "+b.part:"")+" of level "+b.level);var N=this.remuxer.remux(g,T,M,U,I,H,!0,this.id);o.push({remuxResult:N,chunkMeta:b}),b.transmuxing.executeEnd=p()},u.resetInitialTimestamp=function(o){var a=this.demuxer,b=this.remuxer;if(!a||!b)return;a.resetTimeStamp(o),b.resetTimeStamp(o)},u.resetContiguity=function(){var o=this.demuxer,a=this.remuxer;if(!o||!a)return;o.resetContiguity(),a.resetNextTimestamp()},u.resetInitSegment=function(o,a,b,g){var T=this.demuxer,M=this.remuxer;if(!T||!M)return;T.resetInitSegment(a,b,g),M.resetInitSegment(o,a,b)},u.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},u.transmux=function(o,a,b,g,T){var M;return a&&a.method==="SAMPLE-AES"?M=this.transmuxSampleAes(o,a,b,g,T):M=this.transmuxUnencrypted(o,b,g,T),M},u.transmuxUnencrypted=function(o,a,b,g){var T=this.demuxer.demux(o,a,!1,!this.config.progressive),M=T.audioTrack,U=T.avcTrack,W=T.id3Track,H=T.textTrack,I=this.remuxer.remux(M,U,W,H,a,b,!1,this.id);return{remuxResult:I,chunkMeta:g}},u.transmuxSampleAes=function(o,a,b,g,T){var M=this;return this.demuxer.demuxSampleAes(o,a,b).then(function(U){var W=M.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,b,g,!1,M.id);return{remuxResult:W,chunkMeta:T}})},u.configureTransmuxer=function(o,a){for(var b=this.config,g=this.observer,T=this.typeSupported,M=this.vendor,U=a.audioCodec,W=a.defaultInitPts,H=a.duration,I=a.initSegmentData,N=a.videoCodec,z,$=0,ae=f.length;$0&&u!=null&&u.key!=null&&u.iv!==null&&u.method!=null&&(d=u),d}var x=function(u){return{remuxResult:{},chunkMeta:u}};function v(y){return"then"in y&&y.then instanceof Function}var h=function(u,d,o,a,b){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=u,this.videoCodec=d,this.initSegmentData=o,this.duration=a,this.defaultInitPts=b},S=function(u,d,o,a,b){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=u,this.contiguous=d,this.accurateTimeOffset=o,this.trackSwitch=a,this.timeOffset=b}},"./src/demux/tsdemuxer.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"discardEPB",function(){return x});var j=R("./src/demux/adts.ts"),m=R("./src/demux/mpegaudio.ts"),_=R("./src/demux/exp-golomb.ts"),F=R("./src/demux/id3.ts"),P=R("./src/demux/sample-aes.ts"),A=R("./src/events.ts"),L=R("./src/utils/mp4-tools.ts"),C=R("./src/utils/logger.ts"),w=R("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},O=function(){function v(S,y,u){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=S,this.config=y,this.typeSupported=u}v.probe=function(y){var u=v.syncOffset(y);return u<0?!1:(u&&C.logger.warn("MPEG2-TS detected but first sync word found @ offset "+u+", junk ahead ?"),!0)},v.syncOffset=function(y){for(var u=Math.min(1e3,y.length-3*188),d=0;d>4,me=void 0;if(we>1){if(me=xe+5+y[xe+4],me===xe+188)continue}else me=xe+4;switch(Le){case M:Pe&&(U&&(a=s(U))&&this.parseAVCPES(a,!1),U={data:[],size:0}),U&&(U.data.push(y.subarray(me,xe+188)),U.size+=xe+188-me);break;case W:Pe&&(I&&(a=s(I))&&(g.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),I={data:[],size:0}),I&&(I.data.push(y.subarray(me,xe+188)),I.size+=xe+188-me);break;case H:Pe&&(N&&(a=s(N))&&this.parseID3PES(a),N={data:[],size:0}),N&&(N.data.push(y.subarray(me,xe+188)),N.size+=xe+188-me);break;case 0:Pe&&(me+=y[me]+1),ae=this._pmtId=p(y,me);break;case ae:{Pe&&(me+=y[me]+1);var pe=f(y,me,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,d);M=pe.avc,M>0&&(b.pid=M),W=pe.audio,W>0&&(g.pid=W,g.isAAC=pe.isAAC),H=pe.id3,H>0&&(T.pid=H),z&&!$&&(C.logger.log("reparse from beginning"),z=!1,xe=De-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(A.Events.ERROR,A.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});b.pesData=U,g.pesData=I,T.pesData=N;var Q={audioTrack:g,avcTrack:b,id3Track:T,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Q),Q},h.flush=function(){var y=this.remainderData;this.remainderData=null;var u;return y?u=this.demux(y,-1,!1,!0):u={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(u),this.sampleAes?this.decrypt(u,this.sampleAes):u},h.extractRemainingSamples=function(y){var u=y.audioTrack,d=y.avcTrack,o=y.id3Track,a=d.pesData,b=u.pesData,g=o.pesData,T;a&&(T=s(a))?(this.parseAVCPES(T,!0),d.pesData=null):d.pesData=a,b&&(T=s(b))?(u.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),u.pesData=null):(b!=null&&b.size&&C.logger.log("last AAC PES packet truncated,might overlap between fragments"),u.pesData=b),g&&(T=s(g))?(this.parseID3PES(T),o.pesData=null):o.pesData=g},h.demuxSampleAes=function(y,u,d){var o=this.demux(y,d,!0,!this.config.progressive),a=this.sampleAes=new P.default(this.observer,this.config,u);return this.decrypt(o,a)},h.decrypt=function(y,u){return new Promise(function(d){var o=y.audioTrack,a=y.avcTrack;o.samples&&o.isAAC?u.decryptAacSamples(o.samples,0,function(){a.samples?u.decryptAvcSamples(a.samples,0,0,function(){d(y)}):d(y)}):a.samples&&u.decryptAvcSamples(a.samples,0,0,function(){d(y)})})},h.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},h.parseAVCPES=function(y,u){var d=this,o=this._avcTrack,a=this.parseAVCNALu(y.data),b=!1,g=this.avcSample,T,M=!1;y.data=null,g&&a.length&&!o.audFound&&(l(g,o),g=this.avcSample=E(!1,y.pts,y.dts,"")),a.forEach(function(U){switch(U.type){case 1:{T=!0,g||(g=d.avcSample=E(!0,y.pts,y.dts,"")),b&&(g.debug+="NDR "),g.frame=!0;var W=U.data;if(M&&W.length>4){var H=new _.default(W).readSliceType();(H===2||H===4||H===7||H===9)&&(g.key=!0)}break}case 5:T=!0,g||(g=d.avcSample=E(!0,y.pts,y.dts,"")),b&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{T=!0,b&&g&&(g.debug+="SEI ");var I=new _.default(x(U.data));I.readUByte();for(var N=0,z=0,$=!1,ae=0;!$&&I.bytesAvailable>1;){N=0;do ae=I.readUByte(),N+=ae;while(ae===255);z=0;do ae=I.readUByte(),z+=ae;while(ae===255);if(N===4&&I.bytesAvailable!==0){$=!0;var le=I.readUByte();if(le===181){var De=I.readUShort();if(De===49){var xe=I.readUInt();if(xe===1195456820){var Pe=I.readUByte();if(Pe===3){for(var Le=I.readUByte(),we=I.readUByte(),me=31&Le,pe=[Le,we],Q=0;Q16){for(var de=[],te=0;te<16;te++)de.push(I.readUByte().toString(16)),(te===3||te===5||te===7||te===9)&&de.push("-");for(var fe=z-16,Ae=new Uint8Array(fe),_e=0;_e=0){var I={data:y.subarray(W,g-o-1),type:H};b.push(I)}else{var N=this.getLastNalUnit();if(N&&(a&&g<=4-a&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-a))),M=g-o-1,M>0)){var z=new Uint8Array(N.data.byteLength+M);z.set(N.data,0),z.set(y.subarray(0,M),N.data.byteLength),N.data=z,N.state=0}}g=0&&o>=0){var $={data:y.subarray(W,u),type:H,state:o};b.push($)}if(b.length===0){var ae=this.getLastNalUnit();if(ae){var le=new Uint8Array(ae.data.byteLength+y.byteLength);le.set(ae.data,0),le.set(y,ae.data.byteLength),ae.data=le}}return d.naluState=o,b},h.parseAACPES=function(y){var u=0,d=this._audioTrack,o=this.aacOverFlow,a=y.data;if(o){this.aacOverFlow=null;var b=o.sample.unit.byteLength,g=Math.min(o.missing,b),T=b-g;o.sample.unit.set(a.subarray(0,g),T),d.samples.push(o.sample),u=o.missing}var M,U;for(M=u,U=a.length;M1;){var b=new Uint8Array(a[0].length+a[1].length);b.set(a[0]),b.set(a[1],a[0].length),a[0]=b,a.splice(1,1)}S=a[0];var g=(S[0]<<16)+(S[1]<<8)+S[2];if(g===1){if(y=(S[4]<<8)+S[5],y&&y>v.size-6)return null;var T=S[7];T&192&&(d=(S[9]&14)*536870912+(S[10]&255)*4194304+(S[11]&254)*16384+(S[12]&255)*128+(S[13]&254)/2,T&64?(o=(S[14]&14)*536870912+(S[15]&255)*4194304+(S[16]&254)*16384+(S[17]&255)*128+(S[18]&254)/2,d-o>60*9e4&&(C.logger.warn(Math.round((d-o)/9e4)+"s delta between PTS and DTS, align them"),d=o)):o=d),u=S[8];var M=u+9;if(v.size<=M)return null;v.size-=M;for(var U=new Uint8Array(v.size),W=0,H=a.length;WI){M-=I;continue}else S=S.subarray(M),I-=M,M=0;U.set(S,h),h+=I}return y&&(y-=u+3),{data:U,pts:d,dts:o,len:y}}return null}function l(v,h){if(v.units.length&&v.frame){if(v.pts===void 0){var S=h.samples,y=S.length;if(y){var u=S[y-1];v.pts=u.pts,v.dts=u.dts}else{h.dropped++;return}}h.samples.push(v)}v.debug.length&&C.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function c(v,h){var S=v.length;if(S>0){if(h.pts>=v[S-1].pts)v.push(h);else for(var y=S-1;y>=0;y--)if(h.ptsd)return a;return 0}},{key:"maxAutoLevel",get:function(){var u=this.levels,d=this.autoLevelCapping,o;return d===-1&&u&&u.length?o=u.length-1:o=d,o}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(u){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,u)}},{key:"audioTracks",get:function(){var u=this.audioTrackController;return u?u.audioTracks:[]}},{key:"audioTrack",get:function(){var u=this.audioTrackController;return u?u.audioTrack:-1},set:function(u){var d=this.audioTrackController;d&&(d.audioTrack=u)}},{key:"subtitleTracks",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTrack:-1},set:function(u){var d=this.subtitleTrackController;d&&(d.subtitleTrack=u)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var u=this.subtitleTrackController;return u?u.subtitleDisplay:!1},set:function(u){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=u)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(u){this.config.lowLatencyMode=u}},{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 s.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return h.defaultConfig?h.defaultConfig:E.hlsDefaultConfig},set:function(u){h.defaultConfig=u}}]),h}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"isSupported",function(){return _}),R.d(K,"changeTypeSupported",function(){return F});var j=R("./src/utils/mediasource-helper.ts");function m(){return self.SourceBuffer||self.WebKitSourceBuffer}function _(){var P=Object(j.getMediaSource)();if(!P)return!1;var A=m(),L=P&&typeof P.isTypeSupported=="function"&&P.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),C=!A||A.prototype&&typeof A.prototype.appendBuffer=="function"&&typeof A.prototype.remove=="function";return!!L&&!!C}function F(){var P,A=m();return typeof(A==null||((P=A.prototype)===null||P===void 0)?void 0:P.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return O}),R.d(K,"LoadError",function(){return p});var j=R("./src/polyfills/number.ts"),m=R("./src/errors.ts");function _(f,s){f.prototype=Object.create(s.prototype),f.prototype.constructor=f,C(f,s)}function F(f){var s=typeof Map=="function"?new Map:void 0;return F=function(c){if(c===null||!L(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(c))return s.get(c);s.set(c,x)}function x(){return P(c,arguments,w(this).constructor)}return x.prototype=Object.create(c.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),C(x,c)},F(f)}function P(f,s,l){return A()?P=Reflect.construct:P=function(x,v,h){var S=[null];S.push.apply(S,v);var y=Function.bind.apply(x,S),u=new y;return h&&C(u,h.prototype),u},P.apply(null,arguments)}function A(){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(f){return!1}}function L(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function C(f,s){return C=Object.setPrototypeOf||function(c,x){return c.__proto__=x,c},C(f,s)}function w(f){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},w(f)}var k=Math.pow(2,17),O=function(){function f(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var s=f.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(c,x){var v=this,h=c.url;if(!h)return Promise.reject(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(h?"part list":"url")));this.abort();var S=this.config,y=S.fLoader,u=S.loader;return new Promise(function(d,o){v.loader&&v.loader.destroy();var a=v.loader=c.loader=y?new y(S):new u(S),b=E(c),g={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:k};c.stats=a.stats,a.load(b,g,{onSuccess:function(M,U,W,H){v.resetLoader(c,a),d({frag:c,part:null,payload:M.data,networkDetails:H})},onError:function(M,U,W){v.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:M,networkDetails:W}))},onAbort:function(M,U,W){v.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:W}))},onTimeout:function(M,U,W){v.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:W}))},onProgress:function(M,U,W,H){x&&x({frag:c,part:null,payload:W,networkDetails:H})}})})},s.loadPart=function(c,x,v){var h=this;this.abort();var S=this.config,y=S.fLoader,u=S.loader;return new Promise(function(d,o){h.loader&&h.loader.destroy();var a=h.loader=c.loader=y?new y(S):new u(S),b=E(c,x),g={timeout:S.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:S.fragLoadingMaxRetryTimeout,highWaterMark:k};x.stats=a.stats,a.load(b,g,{onSuccess:function(M,U,W,H){h.resetLoader(c,a),h.updateStatsFromPart(c,x);var I={frag:c,part:x,payload:M.data,networkDetails:H};v(I),d(I)},onError:function(M,U,W){h.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:x,response:M,networkDetails:W}))},onAbort:function(M,U,W){c.stats.aborted=x.stats.aborted,h.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:x,networkDetails:W}))},onTimeout:function(M,U,W){h.resetLoader(c,a),o(new p({type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:x,networkDetails:W}))}})})},s.updateStatsFromPart=function(c,x){var v=c.stats,h=x.stats,S=h.total;if(v.loaded+=h.loaded,S){var y=Math.round(c.duration/x.duration),u=Math.min(Math.round(v.loaded/S),y),d=y-u,o=d*Math.round(v.loaded/u);v.total=v.loaded+o}else v.total=Math.max(v.loaded,v.total);var a=v.loading,b=h.loading;a.start?a.first+=b.first-b.start:(a.start=b.start,a.first=b.first),a.end=b.end},s.resetLoader=function(c,x){c.loader=null,this.loader===x&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),x.destroy()},f}();function E(f,s){s===void 0&&(s=null);var l=s||f,c={frag:f,part:s,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},x=l.byteRangeStartOffset,v=l.byteRangeEndOffset;return Object(j.isFiniteNumber)(x)&&Object(j.isFiniteNumber)(v)&&(c.rangeStart=x,c.rangeEnd=v),c}var p=function(f){_(s,f);function s(l){for(var c,x=arguments.length,v=new Array(x>1?x-1:0),h=1;h>8*(15-S)&255;return h},c.setDecryptDataFromLevelKey=function(v,h){var S=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(S=P.LevelKey.fromURI(v.uri),S.method=v.method,S.iv=this.createInitializationVector(h),S.keyFormat="identity"),S},c.setElementaryStreamInfo=function(v,h,S,y,u,d){d===void 0&&(d=!1);var o=this.elementaryStreams,a=o[v];if(!a){o[v]={startPTS:h,endPTS:S,startDTS:y,endDTS:u,partial:d};return}a.startPTS=Math.min(a.startPTS,h),a.endPTS=Math.max(a.endPTS,S),a.startDTS=Math.min(a.startDTS,y),a.endDTS=Math.max(a.endDTS,u)},c.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[O.AUDIO]=null,v[O.VIDEO]=null,v[O.AUDIOVIDEO]=null},k(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&F.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(j.isFiniteNumber)(this.programDateTime))return null;var v=Object(j.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),l}(E),f=function(s){L(l,s);function l(c,x,v,h,S){var y;y=s.call(this,v)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new A.LoadStats,y.duration=c.decimalFloatingPoint("DURATION"),y.gap=c.bool("GAP"),y.independent=c.bool("INDEPENDENT"),y.relurl=c.enumeratedString("URI"),y.fragment=x,y.index=h;var u=c.enumeratedString("BYTERANGE");return u&&y.setByteRange(u,S),S&&(y.fragOffset=S.fragOffset+S.duration),y}return k(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var x=this.elementaryStreams;return!!(x.audio||x.video||x.audiovideo)}}]),l}(E)},"./src/loader/key-loader.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return F});var j=R("./src/events.ts"),m=R("./src/errors.ts"),_=R("./src/utils/logger.ts"),F=function(){function P(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var A=P.prototype;return A._registerListeners=function(){this.hls.on(j.Events.KEY_LOADING,this.onKeyLoading,this)},A._unregisterListeners=function(){this.hls.off(j.Events.KEY_LOADING,this.onKeyLoading)},A.destroy=function(){this._unregisterListeners();for(var C in this.loaders){var w=this.loaders[C];w&&w.destroy()}this.loaders={}},A.onKeyLoading=function(C,w){var k=w.frag,O=k.type,E=this.loaders[O];if(!k.decryptdata){_.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=k.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var f=this.hls.config;if(E&&(_.logger.warn("abort previous key loader for type:"+O),E.abort()),!p){_.logger.warn("key uri is falsy");return}var s=f.loader,l=k.loader=this.loaders[O]=new s(f);this.decrypturl=p,this.decryptkey=null;var c={url:p,frag:k,responseType:"arraybuffer"},x={timeout:f.fragLoadingTimeOut,maxRetry:0,retryDelay:f.fragLoadingRetryDelay,maxRetryDelay:f.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(c,x,v)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(j.Events.KEY_LOADED,{frag:k}))},A.loadsuccess=function(C,w,k){var O=k.frag;if(!O.decryptdata){_.logger.error("after key load, decryptdata unset");return}this.decryptkey=O.decryptdata.key=new Uint8Array(C.data),O.loader=null,delete this.loaders[O.type],this.hls.trigger(j.Events.KEY_LOADED,{frag:O})},A.loaderror=function(C,w){var k=w.frag,O=k.loader;O&&O.abort(),delete this.loaders[k.type],this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:C})},A.loadtimeout=function(C,w){var k=w.frag,O=k.loader;O&&O.abort(),delete this.loaders[k.type],this.hls.trigger(j.Events.ERROR,{type:m.ErrorTypes.NETWORK_ERROR,details:m.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},P}()},"./src/loader/level-details.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"LevelDetails",function(){return P});var j=R("./src/polyfills/number.ts");function m(A,L){for(var C=0;Cw.endSN||k>0||k===0&&O>0,this.updated||this.advanced?this.misses=Math.floor(w.misses*.6):this.misses=w.misses+1,this.availabilityDelay=w.availabilityDelay},_(A,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(j.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var w=this.driftEndTime-this.driftStartTime;if(w>0){var k=this.driftEnd-this.driftStart;return k*1e3/w}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var w;return(w=this.fragments)!==null&&w!==void 0&&w.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var w;return(w=this.partList)!==null&&w!==void 0&&w.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),A}()},"./src/loader/level-key.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"LevelKey",function(){return P});var j=R("./node_modules/url-toolkit/src/url-toolkit.js"),m=R.n(j);function _(A,L){for(var C=0;C2){var o=d.shift()+".";return o+=parseInt(d.shift()).toString(16),o+=("000"+parseInt(d.shift()).toString(16)).substr(-4),o}return u},S.resolve=function(u,d){return m.buildAbsoluteURL(d,u,{alwaysNormalize:!0})},S.parseMasterPlaylist=function(u,d){var o=[],a={},b=!1;k.lastIndex=0;for(var g;(g=k.exec(u))!=null;)if(g[1]){var T=new L.AttrList(g[1]),M={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:S.resolve(g[2],d)},U=T.decimalResolution("RESOLUTION");U&&(M.width=U.width,M.height=U.height),c((T.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=S.convertAVC1ToAVCOTI(M.videoCodec)),o.push(M)}else if(g[3]){var W=new L.AttrList(g[3]);W["DATA-ID"]&&(b=!0,a[W["DATA-ID"]]=W)}return{levels:o,sessionData:b?a:null}},S.parseMasterPlaylistMedia=function(u,d,o,a){a===void 0&&(a=[]);var b,g=[],T=0;for(O.lastIndex=0;(b=O.exec(u))!==null;){var M=new L.AttrList(b[1]);if(M.TYPE===o){var U={attrs:M,bitrate:0,id:T++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:o,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?S.resolve(M.URI,d):""};if(a.length){var W=S.findGroup(a,U.groupId)||a[0];x(U,W,"audioCodec"),x(U,W,"textCodec")}g.push(U)}}return g},S.parseLevelPlaylist=function(u,d,o,a,b){var g=new P.LevelDetails(d),T=g.fragments,M=null,U=0,W=0,H=0,I=0,N=null,z=new F.Fragment(a,d),$,ae,le,De=-1,xe=!1;for(E.lastIndex=0,g.m3u8=u;($=E.exec(u))!==null;){xe&&(xe=!1,z=new F.Fragment(a,d),z.start=H,z.sn=U,z.cc=I,z.level=o,M&&(z.initSegment=M,z.rawProgramDateTime=M.rawProgramDateTime));var Pe=$[1];if(Pe){z.duration=parseFloat(Pe);var Le=(" "+$[2]).slice(1);z.title=Le||null,z.tagList.push(Le?["INF",Pe,Le]:["INF",Pe])}else if($[3])Object(j.isFiniteNumber)(z.duration)&&(z.start=H,le&&(z.levelkey=le),z.sn=U,z.level=o,z.cc=I,z.urlId=b,T.push(z),z.relurl=(" "+$[3]).slice(1),h(z,N),N=z,H+=z.duration,U++,W=0,xe=!0);else if($[4]){var we=(" "+$[4]).slice(1);N?z.setByteRange(we,N):z.setByteRange(we)}else if($[5])z.rawProgramDateTime=(" "+$[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),De===-1&&(De=T.length);else{if($=$[0].match(p),!$){C.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<$.length&&!(typeof $[ae]!="undefined");ae++);var me=(" "+$[ae]).slice(1),pe=(" "+$[ae+1]).slice(1),Q=$[ae+2]?(" "+$[ae+2]).slice(1):"";switch(me){case"PLAYLIST-TYPE":g.type=pe.toUpperCase();break;case"MEDIA-SEQUENCE":U=g.startSN=parseInt(pe);break;case"SKIP":{var de=new L.AttrList(pe),te=de.decimalInteger("SKIPPED-SEGMENTS");if(Object(j.isFiniteNumber)(te)){g.skippedSegments=te;for(var fe=te;fe--;)T.unshift(null);U+=te}var Ae=de.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ae&&(g.recentlyRemovedDateranges=Ae.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(pe);break;case"VERSION":g.version=parseInt(pe);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(pe||Q)&&z.tagList.push(Q?[pe,Q]:[pe]);break;case"DIS":I++;case"GAP":z.tagList.push([me]);break;case"BITRATE":z.tagList.push([me,pe]);break;case"DISCONTINUITY-SEQ":I=parseInt(pe);break;case"KEY":{var _e,Ne=new L.AttrList(pe),Ge=Ne.enumeratedString("METHOD"),et=Ne.URI,Ze=Ne.hexadecimalInteger("IV"),Ke=Ne.enumeratedString("KEYFORMATVERSIONS"),He=Ne.enumeratedString("KEYID"),rt=(_e=Ne.enumeratedString("KEYFORMAT"))!=null?_e:"identity",at=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(at.indexOf(rt)>-1){C.logger.warn("Keyformat "+rt+" is not supported from the manifest");continue}else if(rt!=="identity")continue;Ge&&(le=A.LevelKey.fromURL(d,et),et&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ge)>=0&&(le.method=Ge,le.keyFormat=rt,He&&(le.keyID=He),Ke&&(le.keyFormatVersions=Ke),le.iv=Ze));break}case"START":{var ut=new L.AttrList(pe),ot=ut.decimalFloatingPoint("TIME-OFFSET");Object(j.isFiniteNumber)(ot)&&(g.startTimeOffset=ot);break}case"MAP":{var nt=new L.AttrList(pe);z.relurl=nt.URI,nt.BYTERANGE&&z.setByteRange(nt.BYTERANGE),z.level=o,z.sn="initSegment",le&&(z.levelkey=le),z.initSegment=null,M=z,xe=!0;break}case"SERVER-CONTROL":{var Je=new L.AttrList(pe);g.canBlockReload=Je.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Je.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Je.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Je.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Je.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Te=new L.AttrList(pe);g.partTarget=Te.decimalFloatingPoint("PART-TARGET");break}case"PART":{var be=g.partList;be||(be=g.partList=[]);var Be=W>0?be[be.length-1]:void 0,ze=W++,ke=new F.Part(new L.AttrList(pe),z,d,ze,Be);be.push(ke),z.duration+=ke.duration;break}case"PRELOAD-HINT":{var Ve=new L.AttrList(pe);g.preloadHint=Ve;break}case"RENDITION-REPORT":{var he=new L.AttrList(pe);g.renditionReports=g.renditionReports||[],g.renditionReports.push(he);break}default:C.logger.warn("line parsed but not handled: "+$);break}}}N&&!N.relurl?(T.pop(),H-=N.duration,g.partList&&(g.fragmentHint=N)):g.partList&&(h(z,N),z.cc=I,g.fragmentHint=z);var ue=T.length,ie=T[0],Y=T[ue-1];if(H+=g.skippedSegments*g.targetduration,H>0&&ue&&Y){g.averagetargetduration=H/ue;var q=Y.sn;g.endSN=q!=="initSegment"?q:0,ie&&(g.startCC=ie.cc,ie.initSegment||g.fragments.every(function(re){return re.relurl&&s(re.relurl)})&&(C.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new F.Fragment(a,d),z.relurl=Y.relurl,z.level=o,z.sn="initSegment",ie.initSegment=z,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(H+=g.fragmentHint.duration),g.totalduration=H,g.endCC=I,De>0&&v(T,De),g},S}();function c(S,y){["video","audio","text"].forEach(function(u){var d=S.filter(function(a){return Object(w.isCodecType)(a,u)});if(d.length){var o=d.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});y[u+"Codec"]=o.length>0?o[0]:d[0],S=S.filter(function(a){return d.indexOf(a)===-1})}}),y.unknownCodecs=S}function x(S,y,u){var d=y[u];d&&(S[u]=d)}function v(S,y){for(var u=S[y],d=y;d--;){var o=S[d];if(!o)return;o.programDateTime=u.programDateTime-o.duration*1e3,u=o}}function h(S,y){S.rawProgramDateTime?S.programDateTime=Date.parse(S.rawProgramDateTime):y!=null&&y.programDateTime&&(S.programDateTime=y.endProgramDateTime),Object(j.isFiniteNumber)(S.programDateTime)||(S.programDateTime=null,S.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/polyfills/number.ts"),m=R("./src/events.ts"),_=R("./src/errors.ts"),F=R("./src/utils/logger.ts"),P=R("./src/utils/mp4-tools.ts"),A=R("./src/loader/m3u8-parser.ts"),L=R("./src/types/loader.ts"),C=R("./src/utils/attr-list.ts");function w(E){var p=E.type;switch(p){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function k(E,p){var f=E.url;return(f===void 0||f.indexOf("data:")===0)&&(f=p.url),f}var O=function(){function E(f){this.hls=void 0,this.loaders=Object.create(null),this.hls=f,this.registerListeners()}var p=E.prototype;return p.registerListeners=function(){var s=this.hls;s.on(m.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(m.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(m.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(m.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var s=this.hls;s.off(m.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(m.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(m.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(m.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(s){var l=this.hls.config,c=l.pLoader,x=l.loader,v=c||x,h=new v(l);return s.loader=h,this.loaders[s.type]=h,h},p.getInternalLoader=function(s){return this.loaders[s.type]},p.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},p.destroyInternalLoaders=function(){for(var s in this.loaders){var l=this.loaders[s];l&&l.destroy(),this.resetInternalLoader(s)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(s,l){var c=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},p.onLevelLoading=function(s,l){var c=l.id,x=l.level,v=l.url,h=l.deliveryDirectives;this.load({id:c,groupId:null,level:x,responseType:"text",type:L.PlaylistContextType.LEVEL,url:v,deliveryDirectives:h})},p.onAudioTrackLoading=function(s,l){var c=l.id,x=l.groupId,v=l.url,h=l.deliveryDirectives;this.load({id:c,groupId:x,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:h})},p.onSubtitleTrackLoading=function(s,l){var c=l.id,x=l.groupId,v=l.url,h=l.deliveryDirectives;this.load({id:c,groupId:x,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:h})},p.load=function(s){var l,c=this.hls.config,x=this.getInternalLoader(s);if(x){var v=x.context;if(v&&v.url===s.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),x.abort()}var h,S,y,u;switch(s.type){case L.PlaylistContextType.MANIFEST:h=c.manifestLoadingMaxRetry,S=c.manifestLoadingTimeOut,y=c.manifestLoadingRetryDelay,u=c.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:h=0,S=c.levelLoadingTimeOut;break;default:h=c.levelLoadingMaxRetry,S=c.levelLoadingTimeOut,y=c.levelLoadingRetryDelay,u=c.levelLoadingMaxRetryTimeout;break}if(x=this.createInternalLoader(s),(l=s.deliveryDirectives)!==null&&l!==void 0&&l.part){var d;if(s.type===L.PlaylistContextType.LEVEL&&s.level!==null?d=this.hls.levels[s.level].details:s.type===L.PlaylistContextType.AUDIO_TRACK&&s.id!==null?d=this.hls.audioTracks[s.id].details:s.type===L.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(d=this.hls.subtitleTracks[s.id].details),d){var o=d.partTarget,a=d.targetduration;o&&a&&(S=Math.min(Math.max(o*3,a*.8)*1e3,S))}}var b={timeout:S,maxRetry:h,retryDelay:y,maxRetryDelay:u,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};x.load(s,b,g)},p.loadsuccess=function(s,l,c,x){if(x===void 0&&(x=null),c.isSidxRequest){this.handleSidxRequest(s,c),this.handlePlaylistLoaded(s,l,c,x);return}this.resetInternalLoader(c.type);var v=s.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,c,"no EXTM3U delimiter",x);return}l.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,l,c,x):this.handleMasterPlaylist(s,l,c,x)},p.loaderror=function(s,l,c){c===void 0&&(c=null),this.handleNetworkError(l,c,!1,s)},p.loadtimeout=function(s,l,c){c===void 0&&(c=null),this.handleNetworkError(l,c,!0)},p.handleMasterPlaylist=function(s,l,c,x){var v=this.hls,h=s.data,S=k(s,c),y=A.default.parseMasterPlaylist(h,S),u=y.levels,d=y.sessionData;if(!u.length){this.handleManifestParsingError(s,c,"no level found in manifest",x);return}var o=u.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),a=u.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),b=A.default.parseMasterPlaylistMedia(h,S,"AUDIO",o),g=A.default.parseMasterPlaylistMedia(h,S,"SUBTITLES",a),T=A.default.parseMasterPlaylistMedia(h,S,"CLOSED-CAPTIONS");if(b.length){var M=b.some(function(U){return!U.url});!M&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),b.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new C.AttrList({}),bitrate:0,url:""}))}v.trigger(m.Events.MANIFEST_LOADED,{levels:u,audioTracks:b,subtitles:g,captions:T,url:S,stats:l,networkDetails:x,sessionData:d})},p.handleTrackOrLevelPlaylist=function(s,l,c,x){var v=this.hls,h=c.id,S=c.level,y=c.type,u=k(s,c),d=Object(j.isFiniteNumber)(h)?h:0,o=Object(j.isFiniteNumber)(S)?S:d,a=w(c),b=A.default.parseLevelPlaylist(s.data,u,o,a,d);if(!b.fragments.length){v.trigger(m.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:u,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(y===L.PlaylistContextType.MANIFEST){var g={attrs:new C.AttrList({}),bitrate:0,details:b,name:"",url:u};v.trigger(m.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:u,stats:l,networkDetails:x,sessionData:null})}if(l.parsing.end=performance.now(),b.needSidxRanges){var T,M=(T=b.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:M,isSidxRequest:!0,type:y,level:S,levelDetails:b,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=b,this.handlePlaylistLoaded(s,l,c,x)},p.handleSidxRequest=function(s,l){var c=Object(P.parseSegmentIndex)(new Uint8Array(s.data));if(!c)return;var x=c.references,v=l.levelDetails;x.forEach(function(h,S){var y=h.info,u=v.fragments[S];u.byteRange.length===0&&u.setByteRange(String(1+y.end-y.start)+"@"+String(y.start)),u.initSegment&&u.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(s,l,c,x){this.hls.trigger(m.Events.ERROR,{type:_.ErrorTypes.NETWORK_ERROR,details:_.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===L.PlaylistContextType.MANIFEST,url:s.url,reason:c,response:s,context:l,networkDetails:x})},p.handleNetworkError=function(s,l,c,x){c===void 0&&(c=!1),F.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var v=_.ErrorDetails.UNKNOWN,h=!1,S=this.getInternalLoader(s);switch(s.type){case L.PlaylistContextType.MANIFEST:v=c?_.ErrorDetails.MANIFEST_LOAD_TIMEOUT:_.ErrorDetails.MANIFEST_LOAD_ERROR,h=!0;break;case L.PlaylistContextType.LEVEL:v=c?_.ErrorDetails.LEVEL_LOAD_TIMEOUT:_.ErrorDetails.LEVEL_LOAD_ERROR,h=!1;break;case L.PlaylistContextType.AUDIO_TRACK:v=c?_.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:_.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,h=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:v=c?_.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:_.ErrorDetails.SUBTITLE_LOAD_ERROR,h=!1;break}S&&this.resetInternalLoader(s.type);var y={type:_.ErrorTypes.NETWORK_ERROR,details:v,fatal:h,url:s.url,loader:S,context:s,networkDetails:l};x&&(y.response=x),this.hls.trigger(m.Events.ERROR,y)},p.handlePlaylistLoaded=function(s,l,c,x){var v=c.type,h=c.level,S=c.id,y=c.groupId,u=c.loader,d=c.levelDetails,o=c.deliveryDirectives;if(!(d!=null&&d.targetduration)){this.handleManifestParsingError(s,c,"invalid target duration",x);return}if(!u)return;d.live&&(u.getCacheAge&&(d.ageHeader=u.getCacheAge()||0),(!u.getCacheAge||isNaN(d.ageHeader))&&(d.ageHeader=0));switch(v){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(m.Events.LEVEL_LOADED,{details:d,level:h||0,id:S||0,stats:l,networkDetails:x,deliveryDirectives:o});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(m.Events.AUDIO_TRACK_LOADED,{details:d,id:S||0,groupId:y||"",stats:l,networkDetails:x,deliveryDirectives:o});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(m.Events.SUBTITLE_TRACK_LOADED,{details:d,id:S||0,groupId:y||"",stats:l,networkDetails:x,deliveryDirectives:o});break}},E}();K.default=O},"./src/polyfills/number.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"isFiniteNumber",function(){return j}),R.d(K,"MAX_SAFE_INTEGER",function(){return m});var j=Number.isFinite||function(_){return typeof _=="number"&&isFinite(_)},m=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,K,R){"use strict";R.r(K);var j=function(){function m(){}return m.getSilentFrame=function(F,P){switch(F){case"mp4a.40.2":if(P===1)return new Uint8Array([0,200,0,128,35,128]);if(P===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(P===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(P===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(P===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(P===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(P===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(P===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(P===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},m}();K.default=j},"./src/remux/mp4-generator.ts":function(ee,K,R){"use strict";R.r(K);var j=Math.pow(2,32)-1,m=function(){function _(){}return _.init=function(){_.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var P;for(P in _.types)_.types.hasOwnProperty(P)&&(_.types[P]=[P.charCodeAt(0),P.charCodeAt(1),P.charCodeAt(2),P.charCodeAt(3)]);var A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);_.HDLR_TYPES={video:A,audio:L};var C=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),w=new Uint8Array([0,0,0,0,0,0,0,0]);_.STTS=_.STSC=_.STCO=w,_.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),_.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),_.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),O=new Uint8Array([97,118,99,49]),E=new Uint8Array([0,0,0,1]);_.FTYP=_.box(_.types.ftyp,k,E,k,O),_.DINF=_.box(_.types.dinf,_.box(_.types.dref,C))},_.box=function(P){for(var A=8,L=arguments.length,C=new Array(L>1?L-1:0),w=1;w>24&255,E[1]=A>>16&255,E[2]=A>>8&255,E[3]=A&255,E.set(P,4),k=0,A=8;k>24&255,P>>16&255,P>>8&255,P&255,L>>24,L>>16&255,L>>8&255,L&255,C>>24,C>>16&255,C>>8&255,C&255,85,196,0,0]))},_.mdia=function(P){return _.box(_.types.mdia,_.mdhd(P.timescale,P.duration),_.hdlr(P.type),_.minf(P))},_.mfhd=function(P){return _.box(_.types.mfhd,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255]))},_.minf=function(P){return P.type==="audio"?_.box(_.types.minf,_.box(_.types.smhd,_.SMHD),_.DINF,_.stbl(P)):_.box(_.types.minf,_.box(_.types.vmhd,_.VMHD),_.DINF,_.stbl(P))},_.moof=function(P,A,L){return _.box(_.types.moof,_.mfhd(P),_.traf(L,A))},_.moov=function(P){for(var A=P.length,L=[];A--;)L[A]=_.trak(P[A]);return _.box.apply(null,[_.types.moov,_.mvhd(P[0].timescale,P[0].duration)].concat(L).concat(_.mvex(P)))},_.mvex=function(P){for(var A=P.length,L=[];A--;)L[A]=_.trex(P[A]);return _.box.apply(null,[_.types.mvex].concat(L))},_.mvhd=function(P,A){A*=P;var L=Math.floor(A/(j+1)),C=Math.floor(A%(j+1)),w=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,L>>24,L>>16&255,L>>8&255,L&255,C>>24,C>>16&255,C>>8&255,C&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return _.box(_.types.mvhd,w)},_.sdtp=function(P){var A=P.samples||[],L=new Uint8Array(4+A.length),C,w;for(C=0;C>>8&255),A.push(k&255),A=A.concat(Array.prototype.slice.call(w));for(C=0;C>>8&255),L.push(k&255),L=L.concat(Array.prototype.slice.call(w));var O=_.box(_.types.avcC,new Uint8Array([1,A[3],A[4],A[5],252|3,224|P.sps.length].concat(A).concat([P.pps.length]).concat(L))),E=P.width,p=P.height,f=P.pixelRatio[0],s=P.pixelRatio[1];return _.box(_.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,E>>8&255,E&255,p>>8&255,p&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]),O,_.box(_.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),_.box(_.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,s>>24,s>>16&255,s>>8&255,s&255])))},_.esds=function(P){var A=P.config.length;return new Uint8Array([0,0,0,0,3,23+A,0,1,0,4,15+A,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([A]).concat(P.config).concat([6,1,2]))},_.mp4a=function(P){var A=P.samplerate;return _.box(_.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]),_.box(_.types.esds,_.esds(P)))},_.mp3=function(P){var A=P.samplerate;return _.box(_.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,A>>8&255,A&255,0,0]))},_.stsd=function(P){return P.type==="audio"?!P.isAAC&&P.codec==="mp3"?_.box(_.types.stsd,_.STSD,_.mp3(P)):_.box(_.types.stsd,_.STSD,_.mp4a(P)):_.box(_.types.stsd,_.STSD,_.avc1(P))},_.tkhd=function(P){var A=P.id,L=P.duration*P.timescale,C=P.width,w=P.height,k=Math.floor(L/(j+1)),O=Math.floor(L%(j+1));return _.box(_.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,A>>24&255,A>>16&255,A>>8&255,A&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,C>>8&255,C&255,0,0,w>>8&255,w&255,0,0]))},_.traf=function(P,A){var L=_.sdtp(P),C=P.id,w=Math.floor(A/(j+1)),k=Math.floor(A%(j+1));return _.box(_.types.traf,_.box(_.types.tfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255])),_.box(_.types.tfdt,new Uint8Array([1,0,0,0,w>>24,w>>16&255,w>>8&255,w&255,k>>24,k>>16&255,k>>8&255,k&255])),_.trun(P,L.length+16+20+8+16+8+8),L)},_.trak=function(P){return P.duration=P.duration||4294967295,_.box(_.types.trak,_.tkhd(P),_.mdia(P))},_.trex=function(P){var A=P.id;return _.box(_.types.trex,new Uint8Array([0,0,0,0,A>>24,A>>16&255,A>>8&255,A&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},_.trun=function(P,A){var L=P.samples||[],C=L.length,w=12+16*C,k=new Uint8Array(w),O,E,p,f,s,l;for(A+=8+w,k.set([0,0,15,1,C>>>24&255,C>>>16&255,C>>>8&255,C&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255],0),O=0;O>>24&255,p>>>16&255,p>>>8&255,p&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*O);return _.box(_.types.trun,k)},_.initSegment=function(P){_.types||_.init();var A=_.moov(P),L=new Uint8Array(_.FTYP.byteLength+A.byteLength);return L.set(_.FTYP),L.set(A,_.FTYP.byteLength),L},_}();m.types=void 0,m.HDLR_TYPES=void 0,m.STTS=void 0,m.STSC=void 0,m.STCO=void 0,m.STSZ=void 0,m.VMHD=void 0,m.SMHD=void 0,m.STSD=void 0,m.FTYP=void 0,m.DINF=void 0,K.default=m},"./src/remux/mp4-remuxer.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return l}),R.d(K,"normalizePts",function(){return c});var j=R("./src/polyfills/number.ts"),m=R("./src/remux/aac-helper.ts"),_=R("./src/remux/mp4-generator.ts"),F=R("./src/events.ts"),P=R("./src/errors.ts"),A=R("./src/utils/logger.ts"),L=R("./src/types/loader.ts"),C=R("./src/utils/timescale-conversion.ts");function w(){return w=Object.assign||function(S){for(var y=1;y0?b:g.pts},d[0].pts);return o&&A.logger.debug("PTS rollover detected"),a},y.remux=function(d,o,a,b,g,T,M,U){var W,H,I,N,z,$,ae=g,le=g,De=d.pid>-1,xe=o.pid>-1,Pe=o.samples.length,Le=d.samples.length>0,we=Pe>1,me=(!De||Le)&&(!xe||we)||this.ISGenerated||M;if(me){this.ISGenerated||(I=this.generateIS(d,o,g));var pe=this.isVideoContiguous,Q=-1;if(we&&(Q=x(o.samples),!pe&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,Q>0){A.logger.warn("[mp4-remuxer]: Dropped "+Q+" out of "+Pe+" video samples due to a missing keyframe");var de=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Q),o.dropped+=Q,le+=(o.samples[0].pts-de)/(o.timescale||9e4)}else Q===-1&&(A.logger.warn("[mp4-remuxer]: No keyframe found out of "+Pe+" video samples"),$=!1);if(this.ISGenerated){if(Le&&we){var te=this.getVideoStartPts(o.samples),fe=c(d.samples[0].pts,te)-te,Ae=fe/o.inputTimeScale;ae+=Math.max(0,Ae),le+=Math.max(0,-Ae)}if(Le){if(d.samplerate||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(d,o,g)),H=this.remuxAudio(d,ae,this.isAudioContiguous,T,xe||we||U===L.PlaylistLevelType.AUDIO?le:void 0),we){var _e=H?H.endPTS-H.startPTS:0;o.inputTimeScale||(A.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(d,o,g)),W=this.remuxVideo(o,le,pe,_e)}}else we&&(W=this.remuxVideo(o,le,pe,0));W&&(W.firstKeyFrame=Q,W.independent=Q!==-1)}}return this.ISGenerated&&(a.samples.length&&(z=this.remuxID3(a,g)),b.samples.length&&(N=this.remuxText(b,g))),{audio:H,video:W,initSegment:I,independent:$,text:N,id3:z}},y.generateIS=function(d,o,a){var b=d.samples,g=o.samples,T=this.typeSupported,M={},U=!Object(j.isFiniteNumber)(this._initPTS),W="audio/mp4",H,I,N;if(U&&(H=I=Infinity),d.config&&b.length&&(d.timescale=d.samplerate,d.isAAC||(T.mpeg?(W="audio/mpeg",d.codec=""):T.mp3&&(d.codec="mp3")),M.audio={id:"audio",container:W,codec:d.codec,initSegment:!d.isAAC&&T.mpeg?new Uint8Array(0):_.default.initSegment([d]),metadata:{channelCount:d.channelCount}},U&&(N=d.inputTimeScale,H=I=b[0].pts-Math.round(N*a))),o.sps&&o.pps&&g.length&&(o.timescale=o.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:_.default.initSegment([o]),metadata:{width:o.width,height:o.height}},U)){N=o.inputTimeScale;var z=this.getVideoStartPts(g),$=Math.round(N*a);I=Math.min(I,c(g[0].dts,z)-$),H=Math.min(H,z-$)}if(Object.keys(M).length)return this.ISGenerated=!0,U&&(this._initPTS=H,this._initDTS=I),{tracks:M,initPTS:H,timescale:N}},y.remuxVideo=function(d,o,a,b){var g=d.inputTimeScale,T=d.samples,M=[],U=T.length,W=this._initPTS,H=this.nextAvcDts,I=8,N,z,$,ae=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,De=0,xe=!1;if(!a||H===null){var Pe=o*g,Le=T[0].pts-c(T[0].dts,T[0].pts);H=Pe-Le}for(var we=0;weme.pts){var pe=9e4*.2;De=Math.max(Math.min(De,me.pts-me.dts),-1*pe)}me.dts0?we-1:we].dts&&(xe=!0)}xe&&T.sort(function(Dt,Mt){var Tt=Dt.dts-Mt.dts,zt=Dt.pts-Mt.pts;return Tt||zt}),z=T[0].dts,$=T[T.length-1].dts;var Q=Math.round(($-z)/(U-1));if(De<0){if(DeQ,Ne=Ae<-1;if(_e||Ne){_e?A.logger.warn("AVC: "+Object(C.toMsFromMpegTsClock)(Ae,!0)+" ms ("+Ae+"dts) hole between fragments detected, filling it"):A.logger.warn("AVC: "+Object(C.toMsFromMpegTsClock)(-Ae,!0)+" ms ("+Ae+"dts) overlapping between fragments detected"),z=H;var Ge=T[0].pts-Ae;T[0].dts=z,T[0].pts=Ge,A.logger.log("Video: First PTS/DTS adjusted: "+Object(C.toMsFromMpegTsClock)(Ge,!0)+"/"+Object(C.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(C.toMsFromMpegTsClock)(Ae,!0)+" ms")}}s&&(z=Math.max(0,z));for(var et=0,Ze=0,Ke=0;Ke0?be-1:be].dts;if(q.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor(q.maxBufferHole*g),Se=(b?ae+b*g:this.nextAudioPts)-Be.pts;Se>oe?(N=Se-re,N<0&&(N=re),A.logger.log("[mp4-remuxer]: It is approximately "+Se/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=re}else N=re}var Ue=Math.round(Be.pts-Be.dts);M.push(new v(Be.key,N,ke,Ue))}if(M.length&&p&&p<70){var Ye=M[0].flags;Ye.dependsOn=2,Ye.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=$+N,this.isVideoContiguous=!0;var dt=_.default.moof(d.sequenceNumber++,z,w({},d,{samples:M})),ht="video",st={data1:dt,data2:Je,startPTS:ae/g,endPTS:(le+N)/g,startDTS:z/g,endDTS:H/g,type:ht,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:d.dropped};return d.samples=[],d.dropped=0,console.assert(Je.length,"MDAT length must not be zero"),st},y.remuxAudio=function(d,o,a,b,g){var T=d.inputTimeScale,M=d.samplerate?d.samplerate:T,U=T/M,W=d.isAAC?O:E,H=W*U,I=this._initPTS,N=!d.isAAC&&this.typeSupported.mpeg,z=[],$=d.samples,ae=N?0:8,le=this.nextAudioPts||-1,De=o*T;if(this.isAudioContiguous=a=a||$.length&&le>0&&(b&&Math.abs(De-le)<9e3||Math.abs(c($[0].pts-I,De)-le)<20*H),$.forEach(function(ie){ie.pts=c(ie.pts-I,De)}),!a||le<0){if($=$.filter(function(ie){return ie.pts>=0}),!$.length)return;g===0?le=0:b?le=Math.max(0,De):le=$[0].pts}if(d.isAAC)for(var xe=g!==void 0,Pe=this.config.maxAudioFramesDrift,Le=0,we=le;Le<$.length;Le++){var me=$[Le],pe=me.pts,Q=pe-we,de=Math.abs(1e3*Q/T);if(Q<=-Pe*H&&xe)Le===0&&(A.logger.warn("Audio frame @ "+(pe/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Q/T)+" ms."),this.nextAudioPts=le=we=pe);else if(Q>=Pe*H&&de0){Ze+=ae;try{et=new Uint8Array(Ze)}catch(ie){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:P.ErrorTypes.MUX_ERROR,details:P.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ze,reason:"fail allocating audio mdat "+Ze});return}if(!N){var Je=new DataView(et.buffer);Je.setUint32(0,Ze),et.set(_.default.types.mdat,4)}}else return;et.set(ut,ae);var Te=ut.byteLength;ae+=Te,z.push(new v(!0,W,Te,0)),Ge=ot}var be=z.length;if(!be)return;var Be=z[z.length-1];this.nextAudioPts=le=Ge+U*Be.duration;var ze=N?new Uint8Array(0):_.default.moof(d.sequenceNumber++,Ne/U,w({},d,{samples:z}));d.samples=[];var ke=Ne/T,Ve=le/T,he="audio",ue={data1:ze,data2:et,startPTS:ke,endPTS:Ve,startDTS:ke,endDTS:Ve,type:he,hasAudio:!0,hasVideo:!1,nb:be};return this.isAudioContiguous=!0,console.assert(et.length,"MDAT length must not be zero"),ue},y.remuxEmptyAudio=function(d,o,a,b){var g=d.inputTimeScale,T=d.samplerate?d.samplerate:g,M=g/T,U=this.nextAudioPts,W=(U!==null?U:b.startDTS*g)+this._initDTS,H=b.endDTS*g+this._initDTS,I=M*O,N=Math.ceil((H-W)/I),z=m.default.getSilentFrame(d.manifestCodec||d.codec,d.channelCount);if(A.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){A.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],ae=0;ae4294967296;)S+=u;return S}function x(S){for(var y=0;y0?this.lastEndDTS=d:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!S.audio,a=!!S.video,b="";o&&(b+="audio"),a&&(b+="video");var g={data1:v,startPTS:u,startDTS:u,endPTS:d,endDTS:d,type:b,hasAudio:o,hasVideo:a,nb:1,dropped:0};return x.audio=g.type==="audio"?g:void 0,x.video=g.type!=="audio"?g:void 0,x.text=f,x.id3=p,x.initSegment=h,x},C}(),A=function(w,k,O){return Object(m.getStartDTS)(w,k)-O};function L(C,w){var k=C==null?void 0:C.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||w===_.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}K.default=P},"./src/task-loop.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"default",function(){return j});var j=function(){function m(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var _=m.prototype;return _.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},_.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},_.onHandlerDestroyed=function(){},_.hasInterval=function(){return!!this._tickInterval},_.hasNextTick=function(){return!!this._tickTimer},_.setInterval=function(P){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,P),!0)},_.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},_.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},_.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},_.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},_.doTick=function(){},m}()},"./src/types/cmcd.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"CMCDVersion",function(){return j}),R.d(K,"CMCDObjectType",function(){return m}),R.d(K,"CMCDStreamingFormat",function(){return _}),R.d(K,"CMCDStreamType",function(){return F});var j=1,m;(function(P){P.MANIFEST="m",P.AUDIO="a",P.VIDEO="v",P.MUXED="av",P.INIT="i",P.CAPTION="c",P.TIMED_TEXT="tt",P.KEY="k",P.OTHER="o"})(m||(m={}));var _;(function(P){P.DASH="d",P.HLS="h",P.SMOOTH="s",P.OTHER="o"})(_||(_={}));var F;(function(P){P.VOD="v",P.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"HlsSkip",function(){return _}),R.d(K,"getSkipValue",function(){return F}),R.d(K,"HlsUrlParameters",function(){return P}),R.d(K,"Level",function(){return A});function j(L,C){for(var w=0;wNumber.MAX_SAFE_INTEGER?Infinity:C},P.hexadecimalInteger=function(L){if(this[L]){var C=(this[L]||"0x").slice(2);C=(C.length&1?"0":"")+C;for(var w=new Uint8Array(C.length/2),k=0;kNumber.MAX_SAFE_INTEGER?Infinity:C},P.decimalFloatingPoint=function(L){return parseFloat(this[L])},P.optionalFloat=function(L,C){var w=this[L];return w?parseFloat(w):C},P.enumeratedString=function(L){return this[L]},P.bool=function(L){return this[L]==="YES"},P.decimalResolution=function(L){var C=j.exec(this[L]);return C===null?void 0:{width:parseInt(C[1],10),height:parseInt(C[2],10)}},F.parseAttrList=function(L){var C,w={},k='"';for(m.lastIndex=0;(C=m.exec(L))!==null;){var O=C[2];O.indexOf(k)===0&&O.lastIndexOf(k)===O.length-1&&(O=O.slice(1,-1)),w[C[1]]=O}return w},F}()},"./src/utils/binary-search.ts":function(ee,K,R){"use strict";R.r(K);var j={search:function(_,F){for(var P=0,A=_.length-1,L=null,C=null;P<=A;){L=(P+A)/2|0,C=_[L];var w=F(C);if(w>0)P=L+1;else if(w<0)A=L-1;else return C}return null}};K.default=j},"./src/utils/buffer-helper.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"BufferHelper",function(){return _});var j=R("./src/utils/logger.ts"),m={length:0,start:function(){return 0},end:function(){return 0}},_=function(){function F(){}return F.isBuffered=function(A,L){try{if(A){for(var C=F.getBuffered(A),w=0;w=C.start(w)&&L<=C.end(w))return!0}}catch(k){}return!1},F.bufferInfo=function(A,L,C){try{if(A){var w=F.getBuffered(A),k=[],O;for(O=0;OE&&(w[O-1].end=A[k].end):w.push(A[k])}else w.push(A[k])}else w=A;for(var p=0,f,s=L,l=L,c=0;c=x&&L=a&&j.logger.log(this.time+" ["+a+"] "+b)},u}(),p=function(d){for(var o=[],a=0;aP&&(this.logger.log(O.DEBUG,"Too large cursor position "+this.pos),this.pos=P)},d.moveCursor=function(a){var b=this.pos+a;if(a>1)for(var g=this.pos+1;g=144&&this.backSpace();var b=_(a);if(this.pos>=P){this.logger.log(O.ERROR,"Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},d.clearFromPos=function(a){var b;for(b=a;b0&&(a?g="["+b.join(" | ")+"]":g=b.join(` `)),g},d.getTextAndFormat=function(){return this.rows},u}(),x=function(){function u(o,a,b){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=o,this.outputFilter=a,this.mode=null,this.verbose=0,this.displayedMemory=new c(b),this.nonDisplayedMemory=new c(b),this.lastOutputScreen=new c(b),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=b}var d=u.prototype;return d.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},d.getHandler=function(){return this.outputFilter},d.setHandler=function(a){this.outputFilter=a},d.setPAC=function(a){this.writeScreen.setPAC(a)},d.setBkgData=function(a){this.writeScreen.setBkgData(a)},d.setMode=function(a){if(a===this.mode)return;this.mode=a,this.logger.log(O.INFO,"MODE="+a),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=a},d.insertChars=function(a){for(var b=0;b=46,b.italics)b.foreground="white";else{var g=Math.floor(a/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=T[g]}this.logger.log(O.INFO,"MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},d.outputDataUpdate=function(a){a===void 0&&(a=!1);var b=this.logger.time;if(b===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=b:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:b),this.lastOutputScreen.copy(this.displayedMemory))},d.cueSplitAtTime=function(a){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a))},u}(),v=function(){function u(o,a,b){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new E;this.channels=[null,new x(o,a,g),new x(o+1,b,g)],this.cmdHistory=y(),this.logger=g}var d=u.prototype;return d.getHandler=function(a){return this.channels[a].getHandler()},d.setHandler=function(a,b){this.channels[a].setHandler(b)},d.addData=function(a,b){var g,T,M,U=!1;this.logger.time=a;for(var W=0;W ("+p([T,M])+")"),g=this.parseCmd(T,M),g||(g=this.parseMidrow(T,M)),g||(g=this.parsePAC(T,M)),g||(g=this.parseBackgroundAttributes(T,M)),!g&&(U=this.parseChars(T,M),U)){var H=this.currentChannel;if(H&&H>0){var I=this.channels[H];I.insertChars(U)}else this.logger.log(O.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!U&&this.logger.log(O.WARNING,"Couldn't parse cleaned data "+p([T,M])+" orig: "+p([b[W],b[W+1]]))}},d.parseCmd=function(a,b){var g=this.cmdHistory,T=(a===20||a===28||a===21||a===29)&&b>=32&&b<=47,M=(a===23||a===31)&&b>=33&&b<=35;if(!(T||M))return!1;if(S(a,b,g))return h(null,null,g),this.logger.log(O.DEBUG,"Repeated command ("+p([a,b])+") is dropped"),!0;var U=a===20||a===21||a===23?1:2,W=this.channels[U];return a===20||a===21||a===28||a===29?b===32?W.ccRCL():b===33?W.ccBS():b===34?W.ccAOF():b===35?W.ccAON():b===36?W.ccDER():b===37?W.ccRU(2):b===38?W.ccRU(3):b===39?W.ccRU(4):b===40?W.ccFON():b===41?W.ccRDC():b===42?W.ccTR():b===43?W.ccRTD():b===44?W.ccEDM():b===45?W.ccCR():b===46?W.ccENM():b===47&&W.ccEOC():W.ccTO(b-32),h(a,b,g),this.currentChannel=U,!0},d.parseMidrow=function(a,b){var g=0;if((a===17||a===25)&&b>=32&&b<=47){if(a===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(O.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[g];return T?(T.ccMIDROW(b),this.logger.log(O.DEBUG,"MIDROW ("+p([a,b])+")"),!0):!1}return!1},d.parsePAC=function(a,b){var g,T=this.cmdHistory,M=(a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127,U=(a===16||a===24)&&b>=64&&b<=95;if(!(M||U))return!1;if(S(a,b,T))return h(null,null,T),!0;var W=a<=23?1:2;b>=64&&b<=95?g=W===1?A[a]:C[a]:g=W===1?L[a]:w[a];var H=this.channels[W];return H?(H.setPAC(this.interpretPAC(g,b)),h(a,b,T),this.currentChannel=W,!0):!1},d.interpretPAC=function(a,b){var g,T={color:null,italics:!1,indent:null,underline:!1,row:a};return b>95?g=b-96:g=b-64,T.underline=(g&1)===1,g<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((g-16)/2)*4,T},d.parseChars=function(a,b){var g,T=null,M=null;if(a>=25?(g=2,M=a-8):(g=1,M=a),M>=17&&M<=19){var U;M===17?U=b+80:M===18?U=b+112:U=b+144,this.logger.log(O.INFO,"Special char '"+_(U)+"' in channel "+g),T=[U]}else a>=32&&a<=127&&(T=b===0?[a]:[a,b]);if(T){var W=p(T);this.logger.log(O.DEBUG,"Char codes = "+W.join(",")),h(a,b,this.cmdHistory)}return T},d.parseBackgroundAttributes=function(a,b){var g=(a===16||a===24)&&b>=32&&b<=47,T=(a===23||a===31)&&b>=45&&b<=47;if(!(g||T))return!1;var M,U={};a===16||a===24?(M=Math.floor((b-32)/2),U.background=k[M],b%2===1&&(U.background=U.background+"_semi")):b===45?U.background="transparent":(U.foreground="black",b===47&&(U.underline=!0));var W=a<=23?1:2,H=this.channels[W];return H.setBkgData(U),h(a,b,this.cmdHistory),!0},d.reset=function(){for(var a=0;a=16?s--:s++;var h=Object(j.fixLineBreaks)(l.trim()),S=Object(m.generateCueId)(C,w,h);(!L||!L.cues||!L.cues.getCueById(S))&&(p=new c(C,w,h),p.id=S,p.line=x+1,p.align="left",p.position=10+Math.min(80,Math.floor(s*8/32)*10),O.push(p))}return L&&O.length&&(O.sort(function(y,u){return y.line==="auto"||u.line==="auto"?0:y.line>8&&u.line>8?u.line-y.line:y.line-u.line}),O.forEach(function(y){return Object(_.addCueToTrack)(L,y)})),O}};K.default=P},"./src/utils/discontinuities.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"findFirstFragWithCC",function(){return F}),R.d(K,"shouldAlignOnDiscontinuities",function(){return P}),R.d(K,"findDiscontinuousReferenceFrag",function(){return A}),R.d(K,"adjustSlidingStart",function(){return C}),R.d(K,"alignStream",function(){return w}),R.d(K,"alignPDT",function(){return O}),R.d(K,"alignFragmentByPDTDelta",function(){return E}),R.d(K,"alignMediaPlaylistByPDT",function(){return p});var j=R("./src/polyfills/number.ts"),m=R("./src/utils/logger.ts"),_=R("./src/controller/level-helper.ts");function F(f,s){for(var l=null,c=0,x=f.length;cl.startCC||f&&f.cc=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},_}();K.default=m},"./src/utils/ewma.ts":function(ee,K,R){"use strict";R.r(K);var j=function(){function m(F,P,A){P===void 0&&(P=0),A===void 0&&(A=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=P,this.totalWeight_=A}var _=m.prototype;return _.sample=function(P,A){var L=Math.pow(this.alpha_,P);this.estimate_=A*(1-L)+L*this.estimate_,this.totalWeight_+=P},_.getTotalWeight=function(){return this.totalWeight_},_.getEstimate=function(){if(this.alpha_){var P=1-Math.pow(this.alpha_,this.totalWeight_);if(P)return this.estimate_/P}return this.estimate_},m}();K.default=j},"./src/utils/fetch-loader.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"fetchSupported",function(){return E});var j=R("./src/polyfills/number.ts"),m=R("./src/loader/load-stats.ts"),_=R("./src/demux/chunk-cache.ts");function F(c,x){c.prototype=Object.create(x.prototype),c.prototype.constructor=c,w(c,x)}function P(c){var x=typeof Map=="function"?new Map:void 0;return P=function(h){if(h===null||!C(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof x!="undefined"){if(x.has(h))return x.get(h);x.set(h,S)}function S(){return A(h,arguments,k(this).constructor)}return S.prototype=Object.create(h.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),w(S,h)},P(c)}function A(c,x,v){return L()?A=Reflect.construct:A=function(S,y,u){var d=[null];d.push.apply(d,y);var o=Function.bind.apply(S,d),a=new o;return u&&w(a,u.prototype),a},A.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function C(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function w(c,x){return w=Object.setPrototypeOf||function(h,S){return h.__proto__=S,h},w(c,x)}function k(c){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},k(c)}function O(){return O=Object.assign||function(c){for(var x=1;x=u&&d(S,y,o.flush(),h)):d(S,y,M,h),g()}).catch(function(){return Promise.reject()})};return b()},c}();function f(c,x){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:x,headers:new self.Headers(O({},c.headers))};return c.rangeEnd&&v.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),v}function s(c,x){return new self.Request(c.url,x)}var l=function(c){F(x,c);function x(v,h,S){var y;return y=c.call(this,v)||this,y.code=void 0,y.details=void 0,y.code=h,y.details=S,y}return x}(P(Error));K.default=p},"./src/utils/imsc1-ttml-parser.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"IMSC1_CODEC",function(){return C}),R.d(K,"parseIMSC1",function(){return E});var j=R("./src/utils/mp4-tools.ts"),m=R("./src/utils/vttparser.ts"),_=R("./src/utils/vttcue.ts"),F=R("./src/demux/id3.ts"),P=R("./src/utils/timescale-conversion.ts"),A=R("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(u){for(var d=1;d"):j}function P(C){for(var w=arguments.length,k=new Array(w>1?w-1:0),O=1;O>24,x[v+1]=h>>16&255,x[v+2]=h>>8&255,x[v+3]=h&255}function w(x,v){var h=[];if(!v.length)return h;var S,y,u;"data"in x?(S=x.data,y=x.start,u=x.end):(S=x,y=0,u=S.byteLength);for(var d=y;d1?d+o:u;if(a===v[0])if(v.length===1)h.push({data:S,start:d+8,end:b});else{var g=w({data:S,start:d+8,end:b},v.slice(1));g.length&&F.apply(h,g)}d=b}return h}function k(x){var v=w(x,["moov"]),h=v[0],S=h?h.end:null,y=w(x,["sidx"]);if(!y||!y[0])return null;var u=[],d=y[0],o=d.data[0],a=o===0?8:16,b=L(d,a);a+=4;var g=0,T=0;o===0?a+=8:a+=16,a+=2;var M=d.end+T,U=A(d,a);a+=2;for(var W=0;W>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=L(d,H);H+=4,u.push({referenceSize:N,subsegmentDuration:$,info:{duration:$/b,start:M,end:M+N-1}}),M+=N,H+=4,a=H}return{earliestPresentationTime:g,timescale:b,version:o,referencesCount:U,references:u,moovEndOffset:S}}function O(x){for(var v=[],h=w(x,["moov","trak"]),S=0;SP)&&(this.startTime=P),this.endTime=A,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},_.reset=function(){this.cueRanges=[]},m}()},"./src/utils/texttrack-utils.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"sendAddTrackEvent",function(){return m}),R.d(K,"addCueToTrack",function(){return _}),R.d(K,"clearCurrentCues",function(){return F}),R.d(K,"removeCuesInRange",function(){return P}),R.d(K,"getCuesInRange",function(){return L});var j=R("./src/utils/logger.ts");function m(C,w){var k;try{k=new Event("addtrack")}catch(O){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=C,w.dispatchEvent(k)}function _(C,w){var k=C.mode;if(k==="disabled"&&(C.mode="hidden"),C.cues&&!C.cues.getCueById(w.id))try{if(C.addCue(w),!C.cues.getCueById(w.id))throw new Error("addCue is failed for: "+w)}catch(E){j.logger.debug("[texttrack-utils]: "+E);var O=new self.TextTrackCue(w.startTime,w.endTime,w.text);O.id=w.id,C.addCue(O)}k==="disabled"&&(C.mode=k)}function F(C){var w=C.mode;if(w==="disabled"&&(C.mode="hidden"),C.cues)for(var k=C.cues.length;k--;)C.removeCue(C.cues[k]);w==="disabled"&&(C.mode=w)}function P(C,w,k){var O=C.mode;if(O==="disabled"&&(C.mode="hidden"),C.cues&&C.cues.length>0)for(var E=L(C.cues,w,k),p=0;pC[k].endTime)return-1;for(var O=0,E=k;O<=E;){var p=Math.floor((E+O)/2);if(wC[p].startTime&&O-1)for(var p=E,f=C.length;p=w&&s.endTime<=k)O.push(s);else if(s.startTime>k)return O}return O}},"./src/utils/time-ranges.ts":function(ee,K,R){"use strict";R.r(K);var j={toString:function(_){for(var F="",P=_.length,A=0;A1?w-1:0),O=1;O100)throw new Error("Position must be between 0 and 100.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(O,"positionAlign",A({},E,{get:function(){return d},set:function(g){var T=P(g);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");d=T,this.hasBeenReset=!0}})),Object.defineProperty(O,"size",A({},E,{get:function(){return o},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");o=g,this.hasBeenReset=!0}})),Object.defineProperty(O,"align",A({},E,{get:function(){return a},set:function(g){var T=P(g);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");a=T,this.hasBeenReset=!0}})),O.displayState=void 0}return L.prototype.getCueAsHTML=function(){var C=self.WebVTT;return C.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"parseTimeStamp",function(){return _}),R.d(K,"fixLineBreaks",function(){return w}),R.d(K,"VTTParser",function(){return k});var j=R("./src/utils/vttcue.ts"),m=function(){function O(){}var E=O.prototype;return E.decode=function(f,s){if(!f)return"";if(typeof f!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(f))},O}();function _(O){function E(f,s,l,c){return(f|0)*3600+(s|0)*60+(l|0)+parseFloat(c||0)}var p=O.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?E(p[2],p[3],0,p[4]):E(p[1],p[2],p[3],p[4]):null}var F=function(){function O(){this.values=Object.create(null)}var E=O.prototype;return E.set=function(f,s){!this.get(f)&&s!==""&&(this.values[f]=s)},E.get=function(f,s,l){return l?this.has(f)?this.values[f]:s[l]:this.has(f)?this.values[f]:s},E.has=function(f){return f in this.values},E.alt=function(f,s,l){for(var c=0;c=0&&l<=100)return this.set(f,l),!0}return!1},O}();function P(O,E,p,f){var s=f?O.split(f):[O];for(var l in s){if(typeof s[l]!="string")continue;var c=s[l].split(p);if(c.length!==2)continue;var x=c[0],v=c[1];E(x,v)}}var A=new j.default(0,0,""),L=A.align==="middle"?"middle":"center";function C(O,E,p){var f=O;function s(){var x=_(O);if(x===null)throw new Error("Malformed timestamp: "+f);return O=O.replace(/^[^\sa-zA-Z-]+/,""),x}function l(x,v){var h=new F;P(x,function(u,d){var o;switch(u){case"region":for(var a=p.length-1;a>=0;a--)if(p[a].id===d){h.set(u,p[a].region);break}break;case"vertical":h.alt(u,d,["rl","lr"]);break;case"line":o=d.split(","),h.integer(u,o[0]),h.percent(u,o[0])&&h.set("snapToLines",!1),h.alt(u,o[0],["auto"]),o.length===2&&h.alt("lineAlign",o[1],["start",L,"end"]);break;case"position":o=d.split(","),h.percent(u,o[0]),o.length===2&&h.alt("positionAlign",o[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":h.percent(u,d);break;case"align":h.alt(u,d,["start",L,"end","left","right"]);break}},/:/,/\s/),v.region=h.get("region",null),v.vertical=h.get("vertical","");var S=h.get("line","auto");S==="auto"&&A.line===-1&&(S=-1),v.line=S,v.lineAlign=h.get("lineAlign","start"),v.snapToLines=h.get("snapToLines",!0),v.size=h.get("size",100),v.align=h.get("align",L);var y=h.get("position","auto");y==="auto"&&A.position===50&&(y=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=y}function c(){O=O.replace(/^\s+/,"")}if(c(),E.startTime=s(),c(),O.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+f);O=O.substr(3),c(),E.endTime=s(),c(),l(O,E)}function w(O){return O.replace(//gi,` `)}var k=function(){function O(){this.state="INITIAL",this.buffer="",this.decoder=new m,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var E=O.prototype;return E.parse=function(f){var s=this;f&&(s.buffer+=s.decoder.decode(f,{stream:!0}));function l(){var y=s.buffer,u=0;for(y=w(y);u")===-1){s.cue.id=x;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{C(x,s.cue,s.regionList)}catch(y){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var S=x.indexOf("-->")!==-1;if(!x||S&&(h=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=` `),s.cue.text+=x}continue;case"BADCUE":x||(s.state="ID")}}}catch(y){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},E.flush=function(){var f=this;try{if((f.cue||f.state==="HEADER")&&(f.buffer+=` `,f.parse()),f.state==="INITIAL"||f.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){f.onparsingerror&&f.onparsingerror(s)}return f.onflush&&f.onflush(),this},O}()},"./src/utils/webvtt-parser.ts":function(ee,K,R){"use strict";R.r(K),R.d(K,"generateCueId",function(){return k}),R.d(K,"parseWebVTT",function(){return E});var j=R("./src/polyfills/number.ts"),m=R("./src/utils/vttparser.ts"),_=R("./src/demux/id3.ts"),F=R("./src/utils/timescale-conversion.ts"),P=R("./src/remux/mp4-remuxer.ts"),A=/\r\n|\n\r|\n|\r/g,L=function(f,s,l){return l===void 0&&(l=0),f.substr(l,s.length)===s},C=function(f){var s=parseInt(f.substr(-3)),l=parseInt(f.substr(-6,2)),c=parseInt(f.substr(-9,2)),x=f.length>9?parseInt(f.substr(0,f.indexOf(":"))):0;if(!Object(j.isFiniteNumber)(s)||!Object(j.isFiniteNumber)(l)||!Object(j.isFiniteNumber)(c)||!Object(j.isFiniteNumber)(x))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+f);return s+=1e3*l,s+=60*1e3*c,s+=60*60*1e3*x,s},w=function(f){for(var s=5381,l=f.length;l;)s=s*33^f.charCodeAt(--l);return(s>>>0).toString()};function k(p,f,s){return w(p.toString())+w(f.toString())+w(s)}var O=function(f,s,l){var c=f[s],x=f[c.prevCC];if(!x||!x.new&&c.new){f.ccOffset=f.presentationOffset=c.start,c.new=!1;return}for(;(v=x)!==null&&v!==void 0&&v.new;){var v;f.ccOffset+=c.start-x.start,c.new=!1,c=x,x=f[c.prevCC]}f.presentationOffset=l};function E(p,f,s,l,c,x,v,h){var S=new m.VTTParser,y=Object(_.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(A,` `).split(` `),u=[],d=Object(F.toMpegTsClockFromTimescale)(f,s),o="00:00.000",a=0,b=0,g,T=!0,M=!1;S.oncue=function(U){var W=l[c],H=l.ccOffset,I=(a-d)/9e4;if(W!=null&&W.new&&(b!==void 0?H=l.ccOffset=W.start:O(l,c,I)),I&&(H=I-l.presentationOffset),M){var N=U.endTime-U.startTime,z=Object(P.normalizePts)((U.startTime+H-b)*9e4,x*9e4)/9e4;U.startTime=z,U.endTime=z+N}var $=U.text.trim();U.text=decodeURIComponent(encodeURIComponent($)),U.id||(U.id=k(U.startTime,U.endTime,$)),U.endTime>0&&u.push(U)},S.onparsingerror=function(U){g=U},S.onflush=function(){if(g){h(g);return}v(u)},y.forEach(function(U){if(T)if(L(U,"X-TIMESTAMP-MAP=")){T=!1,M=!0,U.substr(16).split(",").forEach(function(W){L(W,"LOCAL:")?o=W.substr(6):L(W,"MPEGTS:")&&(a=parseInt(W.substr(7)))});try{b=C(o)/1e3}catch(W){M=!1,g=W}return}else U===""&&(T=!1);S.parse(U+` `)}),S.flush()}},"./src/utils/xhr-loader.ts":function(ee,K,R){"use strict";R.r(K);var j=R("./src/utils/logger.ts"),m=R("./src/loader/load-stats.ts"),_=/^age:\s*[\d.]+\s*$/m,F=function(){function P(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new m.LoadStats,this.retryDelay=0}var A=P.prototype;return A.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},A.abortInternal=function(){var C=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),C&&(C.onreadystatechange=null,C.onprogress=null,C.readyState!==4&&(this.stats.aborted=!0,C.abort()))},A.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},A.load=function(C,w,k){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=C,this.config=w,this.callbacks=k,this.retryDelay=w.retryDelay,this.loadInternal()},A.loadInternal=function(){var C=this.config,w=this.context;if(!C)return;var k=this.loader=new self.XMLHttpRequest,O=this.stats;O.loading.first=0,O.loaded=0;var E=this.xhrSetup;try{if(E)try{E(k,w.url)}catch(s){k.open("GET",w.url,!0),E(k,w.url)}k.readyState||k.open("GET",w.url,!0);var p=this.context.headers;if(p)for(var f in p)k.setRequestHeader(f,p[f])}catch(s){this.callbacks.onError({code:k.status,text:s.message},w,k);return}w.rangeEnd&&k.setRequestHeader("Range","bytes="+w.rangeStart+"-"+(w.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=w.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),C.timeout),k.send()},A.readystatechange=function(){var C=this.context,w=this.loader,k=this.stats;if(!C||!w)return;var O=w.readyState,E=this.config;if(k.aborted)return;if(O>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),O===4){w.onreadystatechange=null,w.onprogress=null;var p=w.status;if(p>=200&&p<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var f,s;if(C.responseType==="arraybuffer"?(f=w.response,s=f.byteLength):(f=w.responseText,s=f.length),k.loaded=k.total=s,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(k,C,f,w),!this.callbacks)return;var c={url:w.responseURL,data:f};this.callbacks.onSuccess(c,k,C,w)}else k.retry>=E.maxRetry||p>=400&&p<499?(j.logger.error(p+" while loading "+C.url),this.callbacks.onError({code:p,text:w.statusText},C,w)):(j.logger.warn(p+" while loading "+C.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,E.maxRetryDelay),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout)},A.loadtimeout=function(){j.logger.warn("timeout while loading "+this.context.url);var C=this.callbacks;C&&(this.abortInternal(),C.onTimeout(this.stats,this.context,this.loader))},A.loadprogress=function(C){var w=this.stats;w.loaded=C.loaded,C.lengthComputable&&(w.total=C.total)},A.getCacheAge=function(){var C=null;if(this.loader&&_.test(this.loader.getAllResponseHeaders())){var w=this.loader.getResponseHeader("age");C=w?parseFloat(w):null}return C},P}();K.default=F}}).default})},vHTk:function(pt,$e,G){pt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(pt,$e,G){"use strict";G.d($e,"a",function(){return ut});var ee=G("rePB"),K=G("VTBJ"),R=G("KQm4"),j=G("U8pU"),m=G("ODXe"),_=G("q1tI"),F=G("TSYQ"),P=G.n(F),A=G("Gytx"),L=G.n(A),C=G("Kwbf"),w=G("t23M"),k=G("qx4F"),O=G("6eGT"),E=G("IBYe"),p=G("Ff2n"),f=G("c+Xe"),s=G("fyJ8"),l=G("biw7");function c(Te,be,Be,ze,ke){var Ve=Be[Te]||{},he=Be[be]||{},ue,ie;Ve.fixed==="left"?ue=ze.left[Te]:he.fixed==="right"&&(ie=ze.right[be]);var Y=!1,q=!1,re=!1,oe=!1,Se=Be[be+1],Ue=Be[Te-1];if(ke==="rtl"){if(ue!==void 0){var Ye=Ue&&Ue.fixed==="left";oe=!Ye}else if(ie!==void 0){var dt=Se&&Se.fixed==="right";re=!dt}}else if(ue!==void 0){var ht=Se&&Se.fixed==="left";Y=!ht}else if(ie!==void 0){var st=Ue&&Ue.fixed==="right";q=!st}return{fixLeft:ue,fixRight:ie,lastFixLeft:Y,firstFixRight:q,lastFixRight:re,firstFixLeft:oe,isSticky:ze.isSticky}}var x=G("sR1s");function v(Te){var be=Te.cells,Be=Te.stickyOffsets,ze=Te.flattenColumns,ke=Te.rowComponent,Ve=Te.cellComponent,he=Te.onHeaderRow,ue=Te.index,ie=_.useContext(l.a),Y=ie.prefixCls,q=ie.direction,re;he&&(re=he(be.map(function(Se){return Se.column}),ue));var oe=Object(x.a)(be.map(function(Se){return Se.column}));return _.createElement(ke,Object.assign({},re),be.map(function(Se,Ue){var Ye=Se.column,dt=c(Se.colStart,Se.colEnd,ze,Be,q),ht;return Ye&&Ye.onHeaderCell&&(ht=Se.column.onHeaderCell(Ye)),_.createElement(s.a,Object.assign({},Se,{ellipsis:Ye.ellipsis,align:Ye.align,component:Ve,prefixCls:Y,key:oe[Ue]},dt,{additionalProps:ht,rowType:"header"}))}))}v.displayName="HeaderRow";var h=v;function S(Te){var be=[];function Be(he,ue){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;be[ie]=be[ie]||[];var Y=ue,q=he.filter(Boolean).map(function(re){var oe={key:re.key,className:re.className||"",children:re.title,column:re,colStart:Y},Se=1,Ue=re.children;return Ue&&Ue.length>0&&(Se=Be(Ue,Y,ie+1).reduce(function(Ye,dt){return Ye+dt},0),oe.hasSubColumns=!0),"colSpan"in re&&(Se=re.colSpan),"rowSpan"in re&&(oe.rowSpan=re.rowSpan),oe.colSpan=Se,oe.colEnd=oe.colStart+Se-1,be[ie].push(oe),Y+=Se,Se});return q}Be(Te,0);for(var ze=be.length,ke=function(ue){be[ue].forEach(function(ie){!("rowSpan"in ie)&&!ie.hasSubColumns&&(ie.rowSpan=ze-ue)})},Ve=0;Ve=0;ue-=1){var ie=be[ue],Y=Be&&Be[ue],q=Y&&Y[d.a];(ie||q||he)&&(ke.unshift(_.createElement("col",Object.assign({key:ue,style:{width:ie,minWidth:ie}},q))),he=!0)}return _.createElement("colgroup",null,ke)}var a=o;function b(Te,be){return Object(_.useMemo)(function(){for(var Be=[],ze=0;ze1?Vn-1:0),Rn=1;Rn=re&&(Qt=re-oe),he({scrollLeft:Qt/re*(q+2)}),st.current.x=Rt.pageX},gt=function(){var Rt=Object(et.b)(Ve.current).top,Jt=Rt+Ve.current.offsetHeight,nn=document.documentElement.scrollTop+window.innerHeight;Jt-Object(k.a)()<=nn||Rt>=nn-ue?ht(function(Tn){return Object(K.a)(Object(K.a)({},Tn),{},{isHiddenScrollBar:!0})}):ht(function(Tn){return Object(K.a)(Object(K.a)({},Tn),{},{isHiddenScrollBar:!1})})},Nt=function(Rt){ht(function(Jt){return Object(K.a)(Object(K.a)({},Jt),{},{scrollLeft:Rt/q*re||0})})};return _.useImperativeHandle(Be,function(){return{setScrollLeft:Nt}}),_.useEffect(function(){var Wt=Object(Ge.a)(document.body,"mouseup",Xt,!1),Rt=Object(Ge.a)(document.body,"mousemove",Bt,!1);return gt(),function(){Wt.remove(),Rt.remove()}},[oe,Tt]),_.useEffect(function(){var Wt=Object(Ge.a)(window,"scroll",gt,!1),Rt=Object(Ge.a)(window,"resize",gt,!1);return function(){Wt.remove(),Rt.remove()}},[]),_.useEffect(function(){dt.isHiddenScrollBar||ht(function(Wt){var Rt,Jt;return Object(K.a)(Object(K.a)({},Wt),{},{scrollLeft:Ve.current.scrollLeft/((Rt=Ve.current)===null||Rt===void 0?void 0:Rt.scrollWidth)*((Jt=Ve.current)===null||Jt===void 0?void 0:Jt.clientWidth)})})},[dt.isHiddenScrollBar]),q<=re||!oe||dt.isHiddenScrollBar?null:_.createElement("div",{style:{height:Object(k.a)(),width:re,bottom:ue},className:"".concat(Y,"-sticky-scroll")},_.createElement("div",{onMouseDown:St,ref:Se,className:P()("".concat(Y,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(Y,"-sticky-scroll-bar-active"),Tt)),style:{width:"".concat(oe,"px"),transform:"translate3d(".concat(dt.scrollLeft,"px, 0, 0)")}}))},Ke=_.forwardRef(Ze);function He(Te,be){return _.useMemo(function(){var Be=!!Te;return{isSticky:Be,stickyClassName:Be?"".concat(be,"-sticky-header"):"",offsetHeader:Object(j.a)(Te)==="object"&&Te.offsetHeader||0,offsetScroll:Object(j.a)(Te)==="object"&&Te.offsetScroll||0}},[Te,be])}var rt=[],at={},ut="rc-table-internal-hook",ot=_.memo(function(Te){var be=Te.children;return be},function(Te,be){return L()(Te.props,be.props)?Te.pingLeft!==be.pingLeft||Te.pingRight!==be.pingRight:!1});function nt(Te){var be,Be=Te.prefixCls,ze=Te.className,ke=Te.rowClassName,Ve=Te.style,he=Te.data,ue=Te.rowKey,ie=Te.scroll,Y=Te.tableLayout,q=Te.direction,re=Te.title,oe=Te.footer,Se=Te.summary,Ue=Te.id,Ye=Te.showHeader,dt=Te.components,ht=Te.emptyText,st=Te.onRow,Dt=Te.onHeaderRow,Mt=Te.internalHooks,Tt=Te.transformColumns,zt=Te.internalRefs,Xt=Te.sticky,St=he||rt,Bt=!!St.length,gt=_.useState(0),Nt=Object(m.a)(gt,2),Wt=Nt[0],Rt=Nt[1];_.useEffect(function(){Rt(Object(k.a)())});var Jt=_.useMemo(function(){return Object(x.c)(dt,{})},[dt]),nn=_.useCallback(function(Sn,pn){return Object(x.b)(Jt,Sn)||pn},[Jt]),Tn=_.useMemo(function(){return typeof ue=="function"?ue:function(Sn){var pn=Sn&&Sn[ue];return pn}},[ue]),Qt=Object(d.c)(Te),Gn=Qt.expandIcon,Wn=Qt.expandedRowKeys,kt=Qt.defaultExpandedRowKeys,ct=Qt.defaultExpandAllRows,qt=Qt.expandedRowRender,Mn=Qt.onExpand,an=Qt.onExpandedRowsChange,Ut=Qt.expandRowByClick,An=Qt.rowExpandable,It=Qt.expandIconColumnIndex,on=Qt.expandedRowClassName,Qe=Qt.childrenColumnName,yt=Qt.indentSize,Dn=Gn||_e,bn=Qe||"children",lt=_.useMemo(function(){return qt?"row":Te.expandable&&Mt===ut&&Te.expandable.__PARENT_RENDER_ICON__||St.some(function(Sn){return Sn&&Object(j.a)(Sn)==="object"&&Sn[bn]})?"nest":!1},[!!qt,St]),ur=_.useState(function(){return kt||(ct?Ne(St,Tn,bn):[])}),Un=Object(m.a)(ur,2),_t=Un[0],Pn=Un[1],Vn=_.useMemo(function(){return new Set(Wn||_t||[])},[Wn,_t]),Zn=_.useCallback(function(Sn){var pn=Tn(Sn,St.indexOf(Sn)),cn,Nr=Vn.has(pn);Nr?(Vn.delete(pn),cn=Object(R.a)(Vn)):cn=[].concat(Object(R.a)(Vn),[pn]),Pn(cn),Mn&&Mn(!Nr,Sn),an&&an(cn)},[Tn,Vn,St,Mn,an]),Rn=_.useState(0),hr=Object(m.a)(Rn,2),At=hr[0],Xe=hr[1],Ct=Object(Pe.b)(Object(K.a)(Object(K.a)(Object(K.a)({},Te),Qt),{},{expandable:!!qt,expandedKeys:Vn,getRowKey:Tn,onTriggerExpand:Zn,expandIcon:Dn,expandIconColumnIndex:It,direction:q}),Mt===ut?Tt:null),Pt=Object(m.a)(Ct,2),mn=Pt[0],gn=Pt[1],qn=_.useMemo(function(){return{columns:mn,flattenColumns:gn}},[mn,gn]),Fn=_.useRef(),kn=_.useRef(),Rr=_.useRef(),Lr=_.useState(!1),Br=Object(m.a)(Lr,2),gr=Br[0],Ha=Br[1],za=_.useState(!1),aa=Object(m.a)(za,2),Xr=aa[0],ii=aa[1],Ga=me(new Map),oi=Object(m.a)(Ga,2),Ia=oi[0],ia=oi[1],kr=Object(x.a)(gn),fa=kr.map(function(Sn){return Ia.get(Sn)}),ha=_.useMemo(function(){return fa},[fa.join("_")]),va=de(ha,gn.length,q),yr=ie&&Object(x.d)(ie.y),br=ie&&Object(x.d)(ie.x),Ir=br&&gn.some(function(Sn){var pn=Sn.fixed;return pn}),ta=_.useRef(),ma=He(Xt,Be),na=ma.isSticky,Va=ma.offsetHeader,si=ma.offsetScroll,Wr=ma.stickyClassName,Xa,Kt,Gt;yr&&(Kt={overflowY:"scroll",maxHeight:ie.y}),br&&(Xa={overflowX:"auto"},yr||(Kt={overflowY:"hidden"}),Gt={width:ie.x===!0?"auto":ie.x,minWidth:"100%"});var Vt=_.useCallback(function(Sn,pn){ia(function(cn){var Nr=new Map(cn);return Nr.set(Sn,pn),Nr})},[]),dn=pe(null),_n=Object(m.a)(dn,2),In=_n[0],$n=_n[1];function er(Sn,pn){if(!pn)return;typeof pn=="function"?pn(Sn):pn.scrollLeft!==Sn&&(pn.scrollLeft=Sn)}var Yn=function(pn){var cn=pn.currentTarget,Nr=pn.scrollLeft,_a=typeof Nr=="number"?Nr:cn.scrollLeft,wa=cn||at;if(!$n()||$n()===wa){var fi;In(wa),er(_a,kn.current),er(_a,Rr.current),er(_a,(fi=ta.current)===null||fi===void 0?void 0:fi.setScrollLeft)}if(cn){var hi=cn.scrollWidth,Ti=cn.clientWidth;Ha(_a>0),ii(_a1?Ae-1:0),Ne=1;Ne/gm),ae=F(/^data-[\-\w.\u00B7-\uFFFF]/),le=F(/^aria-[\-\w]+$/),De=F(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xe=F(/^(?:\w+script|data):/i),Pe=F(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te};function we(te){if(Array.isArray(te)){for(var fe=0,Ae=Array(te.length);fe0&&arguments[0]!==void 0?arguments[0]:me(),fe=function(Xe){return Q(Xe)};if(fe.version="2.0.15",fe.removed=[],!te||!te.document||te.document.nodeType!==9)return fe.isSupported=!1,fe;var Ae=te.document,_e=!1,Ne=te.document,Ge=te.DocumentFragment,et=te.HTMLTemplateElement,Ze=te.Node,Ke=te.NodeFilter,He=te.NamedNodeMap,rt=He===void 0?te.NamedNodeMap||te.MozNamedAttrMap:He,at=te.Text,ut=te.Comment,ot=te.DOMParser,nt=te.trustedTypes;if(typeof et=="function"){var Je=Ne.createElement("template");Je.content&&Je.content.ownerDocument&&(Ne=Je.content.ownerDocument)}var Te=pe(nt,Ae),be=Te&&Gn?Te.createHTML(""):"",Be=Ne,ze=Be.implementation,ke=Be.createNodeIterator,Ve=Be.getElementsByTagName,he=Be.createDocumentFragment,ue=Ae.importNode,ie=a(Ne).documentMode?Ne.documentMode:{},Y={};fe.isSupported=ze&&typeof ze.createHTMLDocument!="undefined"&&ie!==9;var q=z,re=$,oe=ae,Se=le,Ue=xe,Ye=Pe,dt=De,ht=null,st=o({},[].concat(we(b),we(g),we(T),we(M),we(U))),Dt=null,Mt=o({},[].concat(we(W),we(H),we(I),we(N))),Tt=null,zt=null,Xt=!0,St=!0,Bt=!1,gt=!1,Nt=!1,Wt=!1,Rt=!1,Jt=!1,nn=!1,Tn=!1,Qt=!1,Gn=!1,Wn=!0,kt=!0,ct=!1,qt={},Mn=o({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),an=null,Ut=o({},["audio","video","img","source","image","track"]),An=null,It=o({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),on=null,Qe=Ne.createElement("form"),yt=function(Xe){if(on&&on===Xe)return;(!Xe||(typeof Xe=="undefined"?"undefined":Le(Xe))!=="object")&&(Xe={}),Xe=a(Xe),ht="ALLOWED_TAGS"in Xe?o({},Xe.ALLOWED_TAGS):st,Dt="ALLOWED_ATTR"in Xe?o({},Xe.ALLOWED_ATTR):Mt,An="ADD_URI_SAFE_ATTR"in Xe?o(a(It),Xe.ADD_URI_SAFE_ATTR):It,an="ADD_DATA_URI_TAGS"in Xe?o(a(Ut),Xe.ADD_DATA_URI_TAGS):Ut,Tt="FORBID_TAGS"in Xe?o({},Xe.FORBID_TAGS):{},zt="FORBID_ATTR"in Xe?o({},Xe.FORBID_ATTR):{},qt="USE_PROFILES"in Xe?Xe.USE_PROFILES:!1,Xt=Xe.ALLOW_ARIA_ATTR!==!1,St=Xe.ALLOW_DATA_ATTR!==!1,Bt=Xe.ALLOW_UNKNOWN_PROTOCOLS||!1,gt=Xe.SAFE_FOR_JQUERY||!1,Nt=Xe.SAFE_FOR_TEMPLATES||!1,Wt=Xe.WHOLE_DOCUMENT||!1,nn=Xe.RETURN_DOM||!1,Tn=Xe.RETURN_DOM_FRAGMENT||!1,Qt=Xe.RETURN_DOM_IMPORT||!1,Gn=Xe.RETURN_TRUSTED_TYPE||!1,Jt=Xe.FORCE_BODY||!1,Wn=Xe.SANITIZE_DOM!==!1,kt=Xe.KEEP_CONTENT!==!1,ct=Xe.IN_PLACE||!1,dt=Xe.ALLOWED_URI_REGEXP||dt,Nt&&(St=!1),Tn&&(nn=!0),qt&&(ht=o({},[].concat(we(U))),Dt=[],qt.html===!0&&(o(ht,b),o(Dt,W)),qt.svg===!0&&(o(ht,g),o(Dt,H),o(Dt,N)),qt.svgFilters===!0&&(o(ht,T),o(Dt,H),o(Dt,N)),qt.mathMl===!0&&(o(ht,M),o(Dt,I),o(Dt,N))),Xe.ADD_TAGS&&(ht===st&&(ht=a(ht)),o(ht,Xe.ADD_TAGS)),Xe.ADD_ATTR&&(Dt===Mt&&(Dt=a(Dt)),o(Dt,Xe.ADD_ATTR)),Xe.ADD_URI_SAFE_ATTR&&o(An,Xe.ADD_URI_SAFE_ATTR),kt&&(ht["#text"]=!0),Wt&&o(ht,["html","head","body"]),ht.table&&(o(ht,["tbody"]),delete Tt.tbody),_&&_(Xe),on=Xe},Dn=function(Xe){p(fe.removed,{element:Xe});try{Xe.parentNode.removeChild(Xe)}catch(Ct){Xe.outerHTML=be}},bn=function(Xe,Ct){try{p(fe.removed,{attribute:Ct.getAttributeNode(Xe),from:Ct})}catch(Pt){p(fe.removed,{attribute:null,from:Ct})}Ct.removeAttribute(Xe)},lt=function(Xe){var Ct=void 0,Pt=void 0;if(Jt)Xe=""+Xe;else{var mn=l(Xe,/^[\r\n\t ]+/);Pt=mn&&mn[0]}var gn=Te?Te.createHTML(Xe):Xe;try{Ct=new ot().parseFromString(gn,"text/html")}catch(kn){}if(_e&&o(Tt,["title"]),!Ct||!Ct.documentElement){Ct=ze.createHTMLDocument("");var qn=Ct,Fn=qn.body;Fn.parentNode.removeChild(Fn.parentNode.firstElementChild),Fn.outerHTML=gn}return Xe&&Pt&&Ct.body.insertBefore(Ne.createTextNode(Pt),Ct.body.childNodes[0]||null),Ve.call(Ct,Wt?"html":"body")[0]};fe.isSupported&&function(){try{var At=lt("</title><img>");h(/<\/title/,At.querySelector("title").innerHTML)&&(_e=!0)}catch(Xe){}}();var ur=function(Xe){return ke.call(Xe.ownerDocument||Xe,Xe,Ke.SHOW_ELEMENT|Ke.SHOW_COMMENT|Ke.SHOW_TEXT,function(){return Ke.FILTER_ACCEPT},!1)},Un=function(Xe){return Xe instanceof at||Xe instanceof ut?!1:typeof Xe.nodeName!="string"||typeof Xe.textContent!="string"||typeof Xe.removeChild!="function"||!(Xe.attributes instanceof rt)||typeof Xe.removeAttribute!="function"||typeof Xe.setAttribute!="function"||typeof Xe.namespaceURI!="string"},_t=function(Xe){return(typeof Ze=="undefined"?"undefined":Le(Ze))==="object"?Xe instanceof Ze:Xe&&(typeof Xe=="undefined"?"undefined":Le(Xe))==="object"&&typeof Xe.nodeType=="number"&&typeof Xe.nodeName=="string"},Pn=function(Xe,Ct,Pt){if(!Y[Xe])return;w(Y[Xe],function(mn){mn.call(fe,Ct,Pt,on)})},Vn=function(Xe){var Ct=void 0;if(Pn("beforeSanitizeElements",Xe,null),Un(Xe))return Dn(Xe),!0;if(l(Xe.nodeName,/[\u0080-\uFFFF]/))return Dn(Xe),!0;var Pt=s(Xe.nodeName);if(Pn("uponSanitizeElement",Xe,{tagName:Pt,allowedTags:ht}),(Pt==="svg"||Pt==="math")&&Xe.querySelectorAll("p, br").length!==0)return Dn(Xe),!0;if(!ht[Pt]||Tt[Pt]){if(kt&&!Mn[Pt]&&typeof Xe.insertAdjacentHTML=="function")try{var mn=Xe.innerHTML;Xe.insertAdjacentHTML("AfterEnd",Te?Te.createHTML(mn):mn)}catch(gn){}return Dn(Xe),!0}return Pt==="noscript"&&h(/<\/noscript/i,Xe.innerHTML)||Pt==="noembed"&&h(/<\/noembed/i,Xe.innerHTML)?(Dn(Xe),!0):(gt&&!_t(Xe.firstElementChild)&&(!_t(Xe.content)||!_t(Xe.content.firstElementChild))&&h(/</g,Xe.textContent)&&(p(fe.removed,{element:Xe.cloneNode()}),Xe.innerHTML?Xe.innerHTML=c(Xe.innerHTML,/</g,"<"):Xe.innerHTML=c(Xe.textContent,/</g,"<")),Nt&&Xe.nodeType===3&&(Ct=Xe.textContent,Ct=c(Ct,q," "),Ct=c(Ct,re," "),Xe.textContent!==Ct&&(p(fe.removed,{element:Xe.cloneNode()}),Xe.textContent=Ct)),Pn("afterSanitizeElements",Xe,null),!1)},Zn=function(Xe,Ct,Pt){if(Wn&&(Ct==="id"||Ct==="name")&&(Pt in Ne||Pt in Qe))return!1;if(!(St&&h(oe,Ct))){if(!(Xt&&h(Se,Ct))){if(!Dt[Ct]||zt[Ct])return!1;if(!An[Ct]){if(!h(dt,c(Pt,Ye,""))){if(!((Ct==="src"||Ct==="xlink:href"||Ct==="href")&&Xe!=="script"&&x(Pt,"data:")===0&&an[Xe])){if(!(Bt&&!h(Ue,c(Pt,Ye,"")))){if(Pt)return!1}}}}}}return!0},Rn=function(Xe){var Ct=void 0,Pt=void 0,mn=void 0,gn=void 0,qn=void 0;Pn("beforeSanitizeAttributes",Xe,null);var Fn=Xe.attributes;if(!Fn)return;var kn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Dt};for(qn=Fn.length;qn--;){Ct=Fn[qn];var Rr=Ct,Lr=Rr.name,Br=Rr.namespaceURI;if(Pt=v(Ct.value),mn=s(Lr),kn.attrName=mn,kn.attrValue=Pt,kn.keepAttr=!0,kn.forceKeepAttr=void 0,Pn("uponSanitizeAttribute",Xe,kn),Pt=kn.attrValue,kn.forceKeepAttr)continue;if(mn==="name"&&Xe.nodeName==="IMG"&&Fn.id)gn=Fn.id,Fn=f(Fn,[]),bn("id",Xe),bn(Lr,Xe),k(Fn,gn)>qn&&Xe.setAttribute("id",gn.value);else{if(Xe.nodeName==="INPUT"&&mn==="type"&&Pt==="file"&&kn.keepAttr&&(Dt[mn]||!zt[mn]))continue;Lr==="id"&&Xe.setAttribute(Lr,""),bn(Lr,Xe)}if(!kn.keepAttr)continue;if(gt&&h(/\/>/i,Pt)){bn(Lr,Xe);continue}if(h(/svg|math/i,Xe.namespaceURI)&&h(S("</("+O(m(Mn),"|")+")","i"),Pt)){bn(Lr,Xe);continue}Nt&&(Pt=c(Pt,q," "),Pt=c(Pt,re," "));var gr=Xe.nodeName.toLowerCase();if(!Zn(gr,mn,Pt))continue;try{Br?Xe.setAttributeNS(Br,Lr,Pt):Xe.setAttribute(Lr,Pt),E(fe.removed)}catch(Ha){}}Pn("afterSanitizeAttributes",Xe,null)},hr=function At(Xe){var Ct=void 0,Pt=ur(Xe);for(Pn("beforeSanitizeShadowDOM",Xe,null);Ct=Pt.nextNode();){if(Pn("uponSanitizeShadowNode",Ct,null),Vn(Ct))continue;Ct.content instanceof Ge&&At(Ct.content),Rn(Ct)}Pn("afterSanitizeShadowDOM",Xe,null)};return fe.sanitize=function(At,Xe){var Ct=void 0,Pt=void 0,mn=void 0,gn=void 0,qn=void 0;if(At||(At="<!-->"),typeof At!="string"&&!_t(At)){if(typeof At.toString!="function")throw y("toString is not a function");if(At=At.toString(),typeof At!="string")throw y("dirty is not a string, aborting")}if(!fe.isSupported){if(Le(te.toStaticHTML)==="object"||typeof te.toStaticHTML=="function"){if(typeof At=="string")return te.toStaticHTML(At);if(_t(At))return te.toStaticHTML(At.outerHTML)}return At}if(Rt||yt(Xe),fe.removed=[],typeof At=="string"&&(ct=!1),!ct)if(At instanceof Ze)Ct=lt("<!-->"),Pt=Ct.ownerDocument.importNode(At,!0),Pt.nodeType===1&&Pt.nodeName==="BODY"||Pt.nodeName==="HTML"?Ct=Pt:Ct.appendChild(Pt);else{if(!nn&&!Nt&&!Wt&&At.indexOf("<")===-1)return Te&&Gn?Te.createHTML(At):At;if(Ct=lt(At),!Ct)return nn?null:be}Ct&&Jt&&Dn(Ct.firstChild);for(var Fn=ur(ct?At:Ct);mn=Fn.nextNode();){if(mn.nodeType===3&&mn===gn)continue;if(Vn(mn))continue;mn.content instanceof Ge&&hr(mn.content),Rn(mn),gn=mn}if(gn=null,ct)return At;if(nn){if(Tn)for(qn=he.call(Ct.ownerDocument);Ct.firstChild;)qn.appendChild(Ct.firstChild);else qn=Ct;return Qt&&(qn=ue.call(Ae,qn,!0)),qn}var kn=Wt?Ct.outerHTML:Ct.innerHTML;return Nt&&(kn=c(kn,q," "),kn=c(kn,re," ")),Te&&Gn?Te.createHTML(kn):kn},fe.setConfig=function(At){yt(At),Rt=!0},fe.clearConfig=function(){on=null,Rt=!1},fe.isValidAttribute=function(At,Xe,Ct){on||yt({});var Pt=s(At),mn=s(Xe);return Zn(Pt,mn,Ct)},fe.addHook=function(At,Xe){if(typeof Xe!="function")return;Y[At]=Y[At]||[],p(Y[At],Xe)},fe.removeHook=function(At){Y[At]&&E(Y[At])},fe.removeHooks=function(At){Y[At]&&(Y[At]=[])},fe.removeAllHooks=function(){Y={}},fe}var de=Q();return de})},wRmb:function(pt,$e,G){"use strict";G.d($e,"a",function(){return L});var ee=G("rePB"),K=G("KQm4"),R=G("VTBJ"),j=G("Ff2n"),m=G("q1tI"),_=G.n(m),F=G("Kwbf"),P=G("Zm9Q"),A=G("hW8S");function L(E){return Object(P.a)(E).filter(function(p){return m.isValidElement(p)}).map(function(p){var f=p.key,s=p.props,l=s.children,c=Object(j.a)(s,["children"]),x=Object(R.a)({key:f},c);return l&&(x.children=L(l)),x})}function C(E){return E.reduce(function(p,f){var s=f.fixed,l=s===!0?"left":s,c=f.children;return c&&c.length>0?[].concat(Object(K.a)(p),Object(K.a)(C(c).map(function(x){return Object(R.a)({fixed:l},x)}))):[].concat(Object(K.a)(p),[Object(R.a)(Object(R.a)({},f),{},{fixed:l})])},[])}function w(E){for(var p=!0,f=0;f<E.length;f+=1){var s=E[f];if(p&&s.fixed!=="left")p=!1;else if(!p&&s.fixed==="left"){Object(F.a)(!1,"Index ".concat(f-1," of `columns` missing `fixed='left'` prop."));break}}for(var l=!0,c=E.length-1;c>=0;c-=1){var x=E[c];if(l&&x.fixed!=="right")l=!1;else if(!l&&x.fixed==="right"){Object(F.a)(!1,"Index ".concat(c+1," of `columns` missing `fixed='right'` prop."));break}}}function k(E){return E.map(function(p){var f=p.fixed,s=Object(j.a)(p,["fixed"]),l=f;return f==="left"?l="right":f==="right"&&(l="left"),Object(R.a)({fixed:l},s)})}function O(E,p){var f=E.prefixCls,s=E.columns,l=E.children,c=E.expandable,x=E.expandedKeys,v=E.getRowKey,h=E.onTriggerExpand,S=E.expandIcon,y=E.rowExpandable,u=E.expandIconColumnIndex,d=E.direction,o=E.expandRowByClick,a=m.useMemo(function(){return s||L(l)},[s,l]),b=m.useMemo(function(){if(c){var M,U=u||0,W=a[U],H=(M={},Object(ee.a)(M,A.a,{className:"".concat(f,"-expand-icon-col")}),Object(ee.a)(M,"title",""),Object(ee.a)(M,"fixed",W?W.fixed:null),Object(ee.a)(M,"className","".concat(f,"-row-expand-icon-cell")),Object(ee.a)(M,"render",function(z,$,ae){var le=v($,ae),De=x.has(le),xe=y?y($):!0,Pe=S({prefixCls:f,expanded:De,expandable:xe,record:$,onExpand:h});return o?m.createElement("span",{onClick:function(we){return we.stopPropagation()}},Pe):Pe}),M),I=a.slice();return U>=0&&I.splice(U,0,H),I}return a},[c,a,v,x,S,d]),g=m.useMemo(function(){var M=b;return p&&(M=p(M)),M.length||(M=[{render:function(){return null}}]),M},[p,b,d]),T=m.useMemo(function(){return d==="rtl"?k(C(g)):C(g)},[g,d]);return[g,T]}$e.b=O},"y0+3":function(pt,$e,G){"use strict";G.d($e,"a",function(){return C}),G.d($e,"b",function(){return k});var ee=/margin|padding|width|height|max|min|offset/,K={left:!0,top:!0},R={cssFloat:1,styleFloat:1,float:1};function j(O){return O.nodeType===1?O.ownerDocument.defaultView.getComputedStyle(O,null):{}}function m(O,E,p){if(E=E.toLowerCase(),p==="auto"){if(E==="height")return O.offsetHeight;if(E==="width")return O.offsetWidth}return E in K||(K[E]=ee.test(E)),K[E]?parseFloat(p)||0:p}function _(O,E){var p=arguments.length,f=j(O);return E=R[E]?"cssFloat"in O.style?"cssFloat":"styleFloat":E,p===1?f:m(O,E,f[E]||O.style[E])}function F(O,E,p){var f=arguments.length;if(E=R[E]?"cssFloat"in O.style?"cssFloat":"styleFloat":E,f===3)return typeof p=="number"&&ee.test(E)&&(p="".concat(p,"px")),O.style[E]=p,p;for(var s in E)E.hasOwnProperty(s)&&F(O,s,E[s]);return j(O)}function P(O){return O===document.body?document.documentElement.clientWidth:O.offsetWidth}function A(O){return O===document.body?window.innerHeight||document.documentElement.clientHeight:O.offsetHeight}function L(){var O=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),E=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:O,height:E}}function C(){var O=document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight;return{width:O,height:E}}function w(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function k(O){var E=O.getBoundingClientRect(),p=document.documentElement;return{left:E.left+(window.pageXOffset||p.scrollLeft)-(p.clientLeft||document.body.clientLeft||0),top:E.top+(window.pageYOffset||p.scrollTop)-(p.clientTop||document.body.clientTop||0)}}}}]);